qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.

https://github.com/qiskit/qiskit

Science Score: 77.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    23 of 601 committers (3.8%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.2%) to scientific vocabulary

Keywords

python qiskit quantum quantum-circuit quantum-computing quantum-programming-language sdk

Keywords from Contributors

graph-theory dag jax quantum-programming closember quantum-information unitaryhack error-mitigation codeformatter formatter
Last synced: 4 months ago · JSON representation ·

Repository

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.

Basic Info
Statistics
  • Stars: 6,415
  • Watchers: 227
  • Forks: 2,627
  • Open Issues: 1,195
  • Releases: 151
Topics
python qiskit quantum quantum-circuit quantum-computing quantum-programming-language sdk
Created almost 9 years ago · Last pushed 4 months ago
Metadata Files
Readme Contributing License Code of conduct Citation Codeowners Security

README.md

Qiskit

License <!--- long-description-skip-begin --> Current Release Extended Support Release Downloads Coverage Status PyPI - Python Version Minimum rustc 1.85 Downloads<!--- long-description-skip-end --> DOI

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.

This library is the core component of Qiskit, which contains the building blocks for creating and working with quantum circuits, quantum operators, and primitive functions (Sampler and Estimator). It also contains a transpiler that supports optimizing quantum circuits, and a quantum information toolbox for creating advanced operators.

For more details on how to use Qiskit, refer to the documentation located here:

https://quantum.cloud.ibm.com/docs/

Installation

We encourage installing Qiskit via pip:

bash pip install qiskit

Pip will handle all dependencies automatically and you will always install the latest (and well-tested) version.

To install from source, follow the instructions in the documentation.

Create your first quantum program in Qiskit

Now that Qiskit is installed, it's time to begin working with Qiskit. The essential parts of a quantum program are: 1. Define and build a quantum circuit that represents the quantum state 2. Define the classical output by measurements or a set of observable operators 3. Depending on the output, use the Sampler primitive to sample outcomes or the Estimator primitive to estimate expectation values.

Create an example quantum circuit using the QuantumCircuit class:

```python import numpy as np from qiskit import QuantumCircuit

1. A quantum circuit for preparing the quantum state |000> + i |111> / 2

qc = QuantumCircuit(3) qc.h(0) # generate superposition qc.p(np.pi / 2, 0) # add quantum phase qc.cx(0, 1) # 0th-qubit-Controlled-NOT gate on 1st qubit qc.cx(0, 2) # 0th-qubit-Controlled-NOT gate on 2nd qubit ```

This simple example creates an entangled state known as a GHZ state $(|000\rangle + i|111\rangle)/\sqrt{2}$. It uses the standard quantum gates: Hadamard gate (h), Phase gate (p), and CNOT gate (cx).

Once you've made your first quantum circuit, choose which primitive you will use. Starting with the Sampler, we use measure_all(inplace=False) to get a copy of the circuit in which all the qubits are measured:

```python

2. Add the classical output in the form of measurement of all qubits

qcmeasured = qc.measureall(inplace=False)

3. Execute using the Sampler primitive

from qiskit.primitives import StatevectorSampler sampler = StatevectorSampler() job = sampler.run([qcmeasured], shots=1000) result = job.result() print(f" > Counts: {result[0].data['meas'].getcounts()}") `` Running this will give an outcome similar to{'000': 497, '111': 503}which is00050% of the time and11150% of the time up to statistical fluctuations. To illustrate the power of the Estimator, we now use the quantum information toolbox to create the operator $XXY+XYX+YXX-YYY$ and pass it to therun()function, along with our quantum circuit. Note that the Estimator requires a circuit _**without**_ measurements, so we use theqc` circuit we created earlier.

```python

2. Define the observable to be measured

from qiskit.quantuminfo import SparsePauliOp operator = SparsePauliOp.fromlist([("XXY", 1), ("XYX", 1), ("YXX", 1), ("YYY", -1)])

3. Execute using the Estimator primitive

from qiskit.primitives import StatevectorEstimator estimator = StatevectorEstimator() job = estimator.run([(qc, operator)], precision=1e-3) result = job.result() print(f" > Expectation values: {result[0].data.evs}") ```

Running this will give the outcome 4. For fun, try to assign a value of +/- 1 to each single-qubit operator X and Y and see if you can achieve this outcome. (Spoiler alert: this is not possible!)

Using the Qiskit-provided qiskit.primitives.StatevectorSampler and qiskit.primitives.StatevectorEstimator will not take you very far. The power of quantum computing cannot be simulated on classical computers and you need to use real quantum hardware to scale to larger quantum circuits. However, running a quantum circuit on hardware requires rewriting to the basis gates and connectivity of the quantum hardware. The tool that does this is the transpiler, and Qiskit includes transpiler passes for synthesis, optimization, mapping, and scheduling. However, it also includes a default compiler, which works very well in most examples. The following code will map the example circuit to the basis_gates = ["cz", "sx", "rz"] and a linear chain of qubits $0 \rightarrow 1 \rightarrow 2$ with the coupling_map = [[0, 1], [1, 2]].

python from qiskit import transpile qc_transpiled = transpile(qc, basis_gates=["cz", "sx", "rz"], coupling_map=[[0, 1], [1, 2]], optimization_level=3)

Executing your code on real quantum hardware

Qiskit provides an abstraction layer that lets users run quantum circuits on hardware from any vendor that provides a compatible interface. The best way to use Qiskit is with a runtime environment that provides optimized implementations of Sampler and Estimator for a given hardware platform. This runtime may involve using pre- and post-processing, such as optimized transpiler passes with error suppression, error mitigation, and, eventually, error correction built in. A runtime implements qiskit.primitives.BaseSamplerV2 and qiskit.primitives.BaseEstimatorV2 interfaces. For example, some packages that provide implementations of a runtime primitive implementation are:

  • https://github.com/Qiskit/qiskit-ibm-runtime

Qiskit also provides a lower-level abstract interface for describing quantum backends. This interface, located in qiskit.providers, defines an abstract BackendV2 class that providers can implement to represent their hardware or simulators to Qiskit. The backend class includes a common interface for executing circuits on the backends; however, in this interface each provider may perform different types of pre- and post-processing and return outcomes that are vendor-defined. Some examples of published provider packages that interface with real hardware are:

  • https://github.com/qiskit-community/qiskit-ionq
  • https://github.com/qiskit-community/qiskit-aqt-provider
  • https://github.com/qiskit-community/qiskit-braket-provider
  • https://github.com/qiskit-community/qiskit-quantinuum-provider
  • https://github.com/rigetti/qiskit-rigetti

You can refer to the documentation of these packages for further instructions on how to get access and use these systems.

Contribution Guidelines

If you'd like to contribute to Qiskit, please take a look at our contribution guidelines. By participating, you are expected to uphold our code of conduct.

We use GitHub issues for tracking requests and bugs. Please join the Qiskit Slack community for discussion, comments, and questions. For questions related to running or using Qiskit, Stack Overflow has a qiskit. For questions on quantum computing with Qiskit, use the qiskit tag in the Quantum Computing Stack Exchange (please, read first the guidelines on how to ask in that forum).

Authors and Citation

Qiskit is the work of many people who contribute to the project at different levels. If you use Qiskit, please cite as per the included BibTeX file.

Changelog and Release Notes

The changelog for a particular release is dynamically generated and gets written to the release page on Github for each release. For example, you can find the page for the 1.2.0 release here:

https://github.com/Qiskit/qiskit/releases/tag/1.2.0

The changelog for the current release can be found in the releases tab: Releases The changelog provides a quick overview of notable changes for a given release.

Additionally, as part of each release, detailed release notes are written to document in detail what has changed as part of a release. This includes any documentation on potential breaking changes on upgrade and new features. See all release notes here.

Acknowledgements

We acknowledge partial support for Qiskit development from the DOE Office of Science National Quantum Information Science Research Centers, Co-design Center for Quantum Advantage (C2QA) under contract number DE-SC0012704.

License

Apache License 2.0

Owner

  • Name: Qiskit
  • Login: Qiskit
  • Kind: organization
  • Email: qiskit@us.ibm.com

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.

Citation (CITATION.bib)

@misc{qiskit2024,
      title={Quantum computing with {Q}iskit},
      author={Javadi-Abhari, Ali and Treinish, Matthew and Krsulich, Kevin and Wood, Christopher J. and Lishman, Jake and Gacon, Julien and Martiel, Simon and Nation, Paul D. and Bishop, Lev S. and Cross, Andrew W. and Johnson, Blake R. and Gambetta, Jay M.},
      year={2024},
      doi={10.48550/arXiv.2405.08810},
      eprint={2405.08810},
      archivePrefix={arXiv},
      primaryClass={quant-ph}
}

GitHub Events

Total
  • Create event: 1,069
  • Commit comment event: 5
  • Release event: 15
  • Delete event: 1,055
  • Member event: 1
  • Pull request event: 1,757
  • Fork event: 289
  • Issues event: 697
  • Watch event: 1,156
  • Issue comment event: 4,249
  • Push event: 1,164
  • Gollum event: 49
  • Pull request review event: 5,508
  • Pull request review comment event: 5,110
Last Year
  • Create event: 1,069
  • Commit comment event: 5
  • Release event: 15
  • Delete event: 1,055
  • Member event: 1
  • Pull request event: 1,757
  • Fork event: 289
  • Issues event: 697
  • Watch event: 1,156
  • Issue comment event: 4,249
  • Push event: 1,164
  • Gollum event: 49
  • Pull request review event: 5,508
  • Pull request review comment event: 5,110

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 8,794
  • Total Committers: 601
  • Avg Commits per committer: 14.632
  • Development Distribution Score (DDS): 0.857
Past Year
  • Commits: 774
  • Committers: 95
  • Avg Commits per committer: 8.147
  • Development Distribution Score (DDS): 0.784
Top Committers
Name Email Commits
Matthew Treinish m****h@k****g 1,255
Jake Lishman j****n@i****m 553
Luciano Bello b****l@z****m 536
Diego M. Rodríguez d****9@g****m 422
Jay M. Gambetta j****a@u****m 379
Julien Gacon j****l@z****m 329
Ali Javadi-Abhari a****i@i****m 313
Paul Nation n****n@g****m 240
Manoel Marques m****l@u****m 228
Christopher J. Wood c****d@u****m 207
Erick Winston e****n@u****m 161
Kevin Krsulich k****h@i****m 154
dependabot[bot] 4****] 151
Richard Chen c****n 137
Andrew W. Cross a****s@u****m 127
Naoki Kanazawa 3****9 114
Ismael Faro Sertage i****1@i****m 108
Elena Peña Tapia 5****T 107
Alexander Ivrii a****i@i****m 106
Lauren Capelluto l****o 103
Juan Gomez-Mosquera a****g@g****m 101
Ikko Hamamura i****m 99
Thomas Alexander t****r@i****m 99
Eric Arellano 1****o 98
Edwin Navarro e****o@c****t 94
Takashi Imamichi 3****i 93
Stephen Wood 4****m 71
qiskit-bot 5****t 67
Shelly Garion 4****n 65
Soolu Thomas s****s@i****m 63
and 571 more...

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 1,210
  • Total pull requests: 3,940
  • Average time to close issues: 7 months
  • Average time to close pull requests: 28 days
  • Total issue authors: 374
  • Total pull request authors: 223
  • Average comments per issue: 2.57
  • Average comments per pull request: 2.89
  • Merged pull requests: 2,736
  • Bot issues: 8
  • Bot pull requests: 1,040
Past Year
  • Issues: 523
  • Pull requests: 2,200
  • Average time to close issues: 19 days
  • Average time to close pull requests: 8 days
  • Issue authors: 189
  • Pull request authors: 114
  • Average comments per issue: 0.99
  • Average comments per pull request: 2.51
  • Merged pull requests: 1,525
  • Bot issues: 4
  • Bot pull requests: 611
Top Authors
Issue Authors
  • mtreinish (183)
  • jakelishman (66)
  • 1ucian0 (55)
  • nonhermitian (54)
  • t-imamichi (35)
  • kevinsung (32)
  • Cryoris (28)
  • aeddins-ibm (26)
  • raynelfss (24)
  • alexanderivrii (20)
  • chriseclectic (17)
  • ShellyGarion (16)
  • nkanazawa1989 (14)
  • wshanks (14)
  • garrison (13)
Pull Request Authors
  • mergify[bot] (813)
  • mtreinish (512)
  • jakelishman (379)
  • dependabot[bot] (227)
  • Cryoris (186)
  • 1ucian0 (154)
  • alexanderivrii (153)
  • ElePT (143)
  • raynelfss (141)
  • kevinhartman (86)
  • ShellyGarion (68)
  • Eric-Arellano (54)
  • eliarbel (47)
  • joesho112358 (39)
  • t-imamichi (35)
Top Labels
Issue Labels
bug (540) type: feature request (321) Rust (100) documentation (68) mod: transpiler (63) performance (59) good first issue (48) synthesis (35) mod: pulse (35) type: enhancement (31) mod: circuit (28) C API (27) priority: high (25) mod: quantum info (22) mod: primitives (17) type: epic (17) mod: qasm3 (14) type: qa (13) mod: opflow (13) mod: qpy (11) mod: visualization (10) Changelog: None (9) mod: qasm2 (9) type: discussion (9) short project (8) help wanted (8) priority: medium (5) priority: low (5) stable backport potential (5) randomized test (4)
Pull Request Labels
Changelog: None (1,804) Rust (738) Changelog: Bugfix (626) stable backport potential (565) Community PR (473) documentation (457) type: qa (425) Changelog: New Feature (343) mod: transpiler (326) performance (261) dependencies (261) mod: circuit (246) priority: high (132) C API (111) mod: primitives (110) synthesis (109) Changelog: Deprecation (98) Changelog: Removal (72) mod: quantum info (72) Changelog: API Change (69) on hold (66) conflicts (60) mod: pulse (52) ci: test wheels (47) mod: qpy (35) mod: qasm3 (33) mod: visualization (31) mod: qasm2 (28) affects extended support (28) Intern PR (24)

Packages

  • Total packages: 3
  • Total downloads:
    • pypi 685,433 last-month
  • Total docker downloads: 4,022
  • Total dependent packages: 276
    (may contain duplicates)
  • Total dependent repositories: 1,337
    (may contain duplicates)
  • Total versions: 272
  • Total maintainers: 1
  • Total advisories: 3
pypi.org: qiskit

An open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.

  • Versions: 189
  • Dependent Packages: 198
  • Dependent Repositories: 987
  • Downloads: 594,963 Last month
  • Docker Downloads: 1,973
Rankings
Dependent packages count: 0.1%
Forks count: 0.3%
Dependent repos count: 0.4%
Downloads: 0.6%
Average: 0.7%
Stargazers count: 1.1%
Docker downloads count: 1.8%
Maintainers (1)
Last synced: 4 months ago
pypi.org: qiskit-terra

Software for developing quantum computing programs

  • Versions: 73
  • Dependent Packages: 71
  • Dependent Repositories: 350
  • Downloads: 90,470 Last month
  • Docker Downloads: 2,049
Rankings
Dependent packages count: 0.2%
Forks count: 0.3%
Downloads: 0.6%
Dependent repos count: 0.8%
Average: 0.8%
Stargazers count: 1.1%
Docker downloads count: 1.8%
Maintainers (1)
Last synced: 12 months ago
conda-forge.org: qiskit-terra
  • Versions: 10
  • Dependent Packages: 7
  • Dependent Repositories: 0
Rankings
Forks count: 2.8%
Stargazers count: 5.6%
Dependent packages count: 8.0%
Average: 12.6%
Dependent repos count: 34.0%
Last synced: 4 months ago

Dependencies

.github/workflows/coverage.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • coverallsapp/github-action master composite
  • dtolnay/rust-toolchain stable composite
.github/workflows/docs_deploy.yml actions
  • actions/checkout v3 composite
  • actions/download-artifact v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
.github/workflows/neko.yml actions
  • Qiskit/qiskit-neko main composite
.github/workflows/randomized_tests.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • peter-evans/create-or-update-comment v2 composite
.github/workflows/slow.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • peter-evans/create-or-update-comment v2 composite
.github/workflows/wheels.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
  • docker/setup-qemu-action v1 composite
  • dtolnay/rust-toolchain stable composite
  • pypa/cibuildwheel v2.13.0 composite
Cargo.lock cargo
  • ahash 0.8.3
  • allocator-api2 0.2.16
  • autocfg 1.1.0
  • bitflags 1.3.2
  • cfg-if 1.0.0
  • crossbeam-channel 0.5.8
  • crossbeam-deque 0.8.3
  • crossbeam-epoch 0.9.15
  • crossbeam-utils 0.8.16
  • either 1.9.0
  • equivalent 1.0.1
  • fixedbitset 0.4.2
  • getrandom 0.2.10
  • hashbrown 0.12.3
  • hashbrown 0.14.0
  • hermit-abi 0.3.2
  • indexmap 1.9.3
  • indexmap 2.0.0
  • indoc 1.0.9
  • itertools 0.10.5
  • libc 0.2.147
  • libm 0.2.7
  • lock_api 0.4.10
  • matrixmultiply 0.3.7
  • memoffset 0.9.0
  • ndarray 0.15.6
  • num-bigint 0.4.4
  • num-complex 0.4.4
  • num-integer 0.1.45
  • num-traits 0.2.16
  • num_cpus 1.16.0
  • numpy 0.19.0
  • once_cell 1.18.0
  • parking_lot 0.12.1
  • parking_lot_core 0.9.8
  • petgraph 0.6.3
  • ppv-lite86 0.2.17
  • priority-queue 1.3.2
  • proc-macro2 1.0.66
  • pyo3 0.19.2
  • pyo3-build-config 0.19.2
  • pyo3-ffi 0.19.2
  • pyo3-macros 0.19.2
  • pyo3-macros-backend 0.19.2
  • quote 1.0.32
  • rand 0.8.5
  • rand_chacha 0.3.1
  • rand_core 0.6.4
  • rand_distr 0.4.3
  • rand_pcg 0.3.1
  • rawpointer 0.2.1
  • rayon 1.7.0
  • rayon-cond 0.2.0
  • rayon-core 1.11.0
  • redox_syscall 0.3.5
  • rustc-hash 1.1.0
  • rustworkx-core 0.13.1
  • scopeguard 1.2.0
  • smallvec 1.11.0
  • syn 1.0.109
  • target-lexicon 0.12.11
  • unicode-ident 1.0.11
  • unindent 0.1.11
  • version_check 0.9.4
  • wasi 0.11.0+wasi-snapshot-preview1
  • windows-targets 0.48.2
  • windows_aarch64_gnullvm 0.48.2
  • windows_aarch64_msvc 0.48.2
  • windows_i686_gnu 0.48.2
  • windows_i686_msvc 0.48.2
  • windows_x86_64_gnu 0.48.2
  • windows_x86_64_gnullvm 0.48.2
  • windows_x86_64_msvc 0.48.2
Cargo.toml cargo
crates/accelerate/Cargo.toml cargo
crates/qasm2/Cargo.toml cargo
pyproject.toml pypi
qiskit_pkg/setup.py pypi
requirements-dev.txt pypi
  • Sphinx >=6.0,<7.2 development
  • astroid ==2.14.2 development
  • black * development
  • coverage >=4.4.0 development
  • ddt >=1.2.0, development
  • hypothesis >=4.24.3 development
  • nbconvert * development
  • nbsphinx * development
  • pylint ==2.16.2 development
  • qiskit-sphinx-theme * development
  • ruff ==0.0.267 development
  • sphinx-design >=0.2.0 development
  • sphinx-remove-toctrees * development
  • stestr >=2.0.0, development
requirements-optional.txt pypi
  • SQSnobFit *
  • cplex *
  • cvxpy *
  • docplex *
  • fixtures *
  • ipykernel *
  • ipython *
  • ipywidgets >=7.3.0
  • jax *
  • jaxlib *
  • jupyter *
  • matplotlib >=3.3
  • pillow >=4.2.1
  • pydot *
  • pygments >=2.4
  • pylatexenc >=1.4
  • python-constraint >=1.4
  • qiskit-aer *
  • qiskit-qasm3-import *
  • scikit-learn >=0.20.0
  • scikit-quant <=0.7
  • seaborn >=0.9.0
  • testtools *
  • tweedledum *
  • z3-solver >=4.7
requirements-tutorials.txt pypi
  • Sphinx *
  • jupyter *
  • nbsphinx *
  • networkx >=2.3
  • pyscf *
  • qiskit_sphinx_theme *
requirements.txt pypi
  • dill >=0.3
  • numpy >=1.17
  • ply >=3.10
  • psutil >=5
  • python-dateutil >=2.8.0
  • rustworkx >=0.13.0
  • scipy >=1.5
  • stevedore >=3.0.0
  • symengine >=0.9,<0.10
  • sympy >=1.3
  • typing-extensions *
setup.py pypi
.github/workflows/backport.yml actions
.binder/environment.yml pypi