Giter Club home page Giter Club logo

qiskit-sdk-py's Introduction

Quantum Information Software Kit (QISKit)

PyPI Build Status

The Quantum Information Software Kit (QISKit for short) is a software development kit (SDK) for working with OpenQASM and the IBM Q experience (QX).

Use QISKit to create quantum computing programs, compile them, and execute them on one of several backends (online Real quantum processors, online simulators, and local simulators). For the online backends, QISKit uses our python API client to connect to the IBM Q experience.

We use GitHub issues for tracking requests and bugs. Please see the IBM Q experience community for questions and discussion. If you'd like to contribute to QISKit, please take a look at our contribution guidelines.

Links to Sections:

Installation

Dependencies

At least Python 3.5 or later is needed for using QISKit. In addition, Jupyter Notebooks is recommended for interacting with the tutorials. For this reason we recommend installing the Anaconda 3 python distribution, as it comes with all of these dependencies pre-installed.

In addition, a basic understanding of quantum information is very helpful when interacting with QISKit. If you're new to quantum, start with our User Guides!

PIP Installation

For those more familiar with python, the fastest way to install QISKit is by using the PIP tool (a python package manager):

    pip install qiskit

Source Installation

An alternative method is to clone the QISKit SDK repository onto your local machine, and change into the cloned directory:

Manual download

Select the "Clone or download" button at the top of this webpage (or from the URL shown in the git clone command), unzip the file if needed, and change into qiskit-sdk-py folder in a terminal window.

Git download

Or, if you have Git installed, run the following commands:

    git clone https://github.com/QISKit/qiskit-sdk-py
    cd qiskit-sdk-py

Setup your enviroment

We recommend using python virtual environments to improve your experience. Refer to our Environment Setup documentation for more information.

Creating your first Quantum Program

Now that the SDK is installed, it's time to begin working with QISKit.

We are ready to try out some QASM examples, which runs via the local simulator.

This is a simple superposition example.

from qiskit import QuantumProgram

# Creating Programs create your first QuantumProgram object instance.
Q_program = QuantumProgram()

try:
  # Creating Registers create your first Quantum Register called "qr" with 2 qubits
  qr = Q_program.create_quantum_register("qr", 2)
  # create your first Classical Register called "cr" with 2 bits
  cr = Q_program.create_classical_register("cr", 2)
  # Creating Circuits create your first Quantum Circuit called "qc" involving your Quantum Register "qr"
  # and your Classical Register "cr"
  qc = Q_program.create_circuit("superposition", [qr], [cr])

  # add the H gate in the Qubit 0, we put this Qubit in superposition
  qc.h(qr[0])

  # add measure to see the state
  qc.measure(qr, cr)

  # Compiled  and execute in the local_qasm_simulator

  result = Q_program.execute(["superposition"], backend='local_qasm_simulator', shots=1024)

  # Show the results
  print(result)
  print(result.get_data("superposition"))

except QISKitError as ex:
  print('There was an error in the circuit!. Error = {}'.format(ex))
except RegisterSizeError as ex:
  print('Error in the number of registers!. Error = {}'.format(ex))

In this case, the output will be (approximately due to random fluctuations):

COMPLETED
{'00': 509, '11': 515}

You can also use QISKit to execute your code on a real Quantum Chip.

First, get your API token:

  • Create an IBM Q experience account if you haven't already done so
  • Get an API token from the IBM Q experience website under “My Account” > “Personal Access Token”

This API token allows you to execute your programs with the IBM Q experience backends. Example.

More details on this and more information see our QISKit documentation.

Next Steps

Now you're set up and ready to check out some of the other examples from our Tutorial repository. Start with the index tutorial and then go to the ‘Getting Started’ example. If you already have Jupyter Notebooks installed, you can copy and modify the notebooks to create your own experiments.

To install the tutorials as part of the QISKit SDK, see the following installation details. Complete SDK documentation can be found in the doc directory.

More Information

For more information on how to use QISKit, tutorial examples, and other helpful links, take a look at these resources:

QISKit was originally developed by researchers and developers on the IBM-Q Team at IBM Research, with the aim of offering a high level development kit to work with quantum computers.

Visit the IBM Q experience community for questions and discussions on QISKit and quantum computing more broadly. If you'd like to contribute to QISKit, please take a look at our contribution guidelines.

Authors (alphabetical)

Jim Challenger, Andrew Cross, Vincent Dwyer, Mark Everitt, Ismael Faro, Jay Gambetta, Juan Gomez, Paco Martin, Antonio Mezzacapo, Jesus Perez, Russell Rundle, Todd Tilma, John Smolin, Erick Winston, Chris Wood

In future releases, anyone who contributes with code to this project is welcome to include their name here.

License

This project uses the Apache License Version 2.0 software license.

qiskit-sdk-py's People

Contributors

jaygambetta avatar awcross1 avatar ismaelfaro avatar ewinston avatar diego-plan9 avatar jesusprubio avatar atilag avatar chriseclectic avatar abbycross avatar rraymondhp avatar pacomf avatar smolinibm avatar dcmckayibm avatar adcorcol avatar markjeveritt avatar christophevuillot avatar attp avatar desireevl avatar francabrera avatar 1ucian0 avatar antoniomezzacapo avatar dtmcclure avatar gnannicini avatar jessicalostinspace avatar jelcaf avatar t-imamichi avatar viktor-prutyanov avatar mosandbe avatar

Watchers

Kenso Trabing avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.