qiskit
Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
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
Keywords from Contributors
Repository
Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
Basic Info
- Host: GitHub
- Owner: Qiskit
- License: apache-2.0
- Language: Python
- Default Branch: main
- Homepage: https://www.ibm.com/quantum/qiskit
- Size: 149 MB
Statistics
- Stars: 6,415
- Watchers: 227
- Forks: 2,627
- Open Issues: 1,195
- Releases: 151
Topics
Metadata Files
README.md
Qiskit
<!--- long-description-skip-begin -->
<!--- long-description-skip-end -->
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:
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
Owner
- Name: Qiskit
- Login: Qiskit
- Kind: organization
- Email: qiskit@us.ibm.com
- Website: https://www.ibm.com/quantum/qiskit
- Twitter: qiskit
- Repositories: 25
- Profile: https://github.com/Qiskit
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
Top Committers
| Name | 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... | ||
Committer Domains (Top 20 + Academic)
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
Pull Request Labels
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.
- Homepage: https://www.ibm.com/quantum/qiskit
- Documentation: https://quantum.cloud.ibm.com/docs
- License: Apache 2.0
-
Latest release: 2.1.2
published 4 months ago
Rankings
Maintainers (1)
Advisories (3)
pypi.org: qiskit-terra
Software for developing quantum computing programs
- Homepage: https://www.ibm.com/quantum/qiskit
- Documentation: https://docs.quantum.ibm.com
- License: Apache 2.0
-
Latest release: 0.46.3
published over 1 year ago
Rankings
Maintainers (1)
Advisories (2)
conda-forge.org: qiskit-terra
- Homepage: https://www.ibm.com/quantum/qiskit
- License: Apache-2.0
-
Latest release: 0.22.1
published about 3 years ago
Rankings
Dependencies
- actions/checkout v3 composite
- actions/setup-python v4 composite
- coverallsapp/github-action master composite
- dtolnay/rust-toolchain stable composite
- actions/checkout v3 composite
- actions/download-artifact v3 composite
- actions/setup-python v4 composite
- actions/upload-artifact v3 composite
- Qiskit/qiskit-neko main composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- peter-evans/create-or-update-comment v2 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- peter-evans/create-or-update-comment v2 composite
- 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
- 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
- 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
- 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
- Sphinx *
- jupyter *
- nbsphinx *
- networkx >=2.3
- pyscf *
- qiskit_sphinx_theme *
- 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 *