Go to file
Julien Gacon e58ac5678e
Improve the ``qiskit.algorithms`` docs: clearly show legacy vs. primitive algorithms (#9382)
* Algorithms init cleanup

Emphasize the split in primitive-based and legacy algorithms more clearly

* add "pending deprecation" in heading

* apply same layout to time evolvers

* temporarily pin to get CI done, merge from main later

* pin to 1.23.1

* remove "pending deprecation"

* add missing TrotterQRTE import

* Apply suggestions from code review

Co-authored-by: ElePT <57907331+ElePT@users.noreply.github.com>

* trailing whitespaces

* more trailing whitespace -- this time at front

* reword

Co-authored-by: ElePT <57907331+ElePT@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-01-23 09:10:36 +00:00
.azure Run QPY backwards compatibility tests in parallel (#9349) 2023-01-20 21:49:07 +00:00
.binder Add rust to binder configuration (#7732) 2022-03-04 02:32:17 +00:00
.cargo Implement multithreaded stochastic swap in rust (#7658) 2022-02-28 21:49:54 +00:00
.github Refactor coverage CI workflow (#9361) 2023-01-11 22:24:15 +00:00
docs Bump main branch version post 0.23.0rc1 tag (#9396) 2023-01-20 14:18:44 +00:00
examples refactored and optimized code (#9292) 2023-01-11 19:45:31 +00:00
qiskit Improve the ``qiskit.algorithms`` docs: clearly show legacy vs. primitive algorithms (#9382) 2023-01-23 09:10:36 +00:00
releasenotes Fix qpy for `MCX` gates (#9391) 2023-01-20 22:45:01 +00:00
src Update PyO3 and Rust Numpy to 0.18.0 (#9392) 2023-01-19 12:56:47 +00:00
test Improve the ``qiskit.algorithms`` docs: clearly show legacy vs. primitive algorithms (#9382) 2023-01-23 09:10:36 +00:00
tools Add deprecation warning on use of qiskit.IBMQ (#8080) 2023-01-18 18:34:25 +00:00
.editorconfig Add .editorconfig (#6033) 2022-01-31 20:12:23 +00:00
.git-blame-ignore-revs Update git blame rev ignore list (#7620) 2022-02-03 21:31:01 +00:00
.gitignore Support reproducible builds of Rust library (#7728) 2022-03-03 17:47:13 +00:00
.local-spellings speeling fixes (#5858) 2021-02-19 00:54:19 +00:00
.mailmap Update garrison's name in .mailmap (#7443) 2021-12-23 15:06:18 +00:00
.mergify.yml Bump main branch version post 0.23.0rc1 tag (#9396) 2023-01-20 14:18:44 +00:00
.pylintrc Disable pylint's import-error (#8973) 2022-10-21 20:02:46 +00:00
.stestr.conf Removes stestr's grouping configuration. (#6399) 2021-05-12 19:06:06 +00:00
CODE_OF_CONDUCT.md Pointing all Qiskit projects to main CoC file moving forward. (#5412) 2020-11-18 13:24:17 -05:00
CONTRIBUTING.md Bump MSRV to 1.61 and all rust dependencies to latest releases (#9393) 2023-01-20 19:53:10 +00:00
Cargo.lock Bump MSRV to 1.61 and all rust dependencies to latest releases (#9393) 2023-01-20 19:53:10 +00:00
Cargo.toml Bump MSRV to 1.61 and all rust dependencies to latest releases (#9393) 2023-01-20 19:53:10 +00:00
LICENSE.txt
MANIFEST.in Fix manifest entry for mpl styles (#9004) 2022-10-26 22:51:28 +00:00
Makefile Move release note in wrong location and add script to block this (#8320) 2022-07-12 12:16:03 +00:00
README.md Bump MSRV to 1.61 and all rust dependencies to latest releases (#9393) 2023-01-20 19:53:10 +00:00
azure-pipelines.yml Bump MSRV to 1.61 and all rust dependencies to latest releases (#9393) 2023-01-20 19:53:10 +00:00
constraints.txt Relax pin on sphinx-autodoc-typehints (#9379) 2023-01-17 13:48:35 +00:00
pyproject.toml Add support for Python 3.11 (#9028) 2022-11-03 16:58:14 +00:00
qiskit_bot.yaml Remove nkanazawa1989 from code owner (#8840) 2022-10-05 17:34:56 +00:00
requirements-dev.txt Add importer for OpenQASM 3 (#9347) 2023-01-19 19:42:20 +00:00
requirements.txt Switch from retworkx to rustworkx package (#9162) 2022-11-18 20:44:53 +00:00
setup.py Bump main branch version post 0.23.0rc1 tag (#9396) 2023-01-20 14:18:44 +00:00
tox.ini Re-enable parallel sphinx builds by default (#9348) 2023-01-06 19:49:58 +00:00

README.md

Qiskit Terra

LicenseReleaseDownloadsCoverage StatusMinimum rustc 1.61.0

Qiskit is an open-source framework for working with noisy quantum computers at the level of pulses, circuits, and algorithms.

This library is the core component of Qiskit, Terra, which contains the building blocks for creating and working with quantum circuits, programs, and algorithms. It also contains a compiler that supports different quantum computers and a common interface for running programs on different quantum computer architectures.

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

https://qiskit.org/documentation/

Installation

We encourage installing Qiskit via pip. The following command installs the core Qiskit components, including Terra.

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.

Creating Your First Quantum Program in Qiskit Terra

Now that Qiskit is installed, it's time to begin working with Qiskit. To do this we create a QuantumCircuit object to define a basic quantum program.

from qiskit import QuantumCircuit
qc = QuantumCircuit(2, 2)
qc.h(0)
qc.cx(0, 1)
qc.measure([0,1], [0,1])

This simple example makes an entangled state, also called a Bell state.

Once you've made your first quantum circuit, you can then simulate it. To do this, first we need to compile your circuit for the target backend we're going to run on. In this case we are leveraging the built-in BasicAer simulator. However, this simulator is primarily for testing and is limited in performance and functionality (as the name implies). You should consider more sophisticated simulators, such as qiskit-aer, for any real simulation work.

from qiskit import transpile
from qiskit.providers.basicaer import QasmSimulatorPy
backend_sim = QasmSimulatorPy()
transpiled_qc = transpile(qc, backend_sim)

After compiling the circuit we can then run this on the backend object with:

result = backend_sim.run(transpiled_qc).result()
print(result.get_counts(qc))

The output from this execution will look similar to this:

{'00': 513, '11': 511}

For further examples of using Qiskit you can look at the example scripts in examples/python. You can start with using_qiskit_terra_level_0.py and working up in the levels. Also you can refer to the tutorials in the documentation here:

https://qiskit.org/documentation/tutorials.html

Executing your code on a real quantum chip

You can also use Qiskit to execute your code on a real quantum processor. Qiskit provides an abstraction layer that lets users run quantum circuits on hardware from any vendor that provides an interface to their systems through Qiskit. Using these providers you can run any Qiskit code against real quantum computers. Some examples of published provider packages for running on real hardware are:

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 Terra, please take a look at our contribution guidelines. This project adheres to Qiskit's code of conduct. By participating, you are expected to uphold this code.

We use GitHub issues for tracking requests and bugs. Please join the Qiskit Slack community and use our Qiskit Slack channel for discussion and simple questions. For questions that are more suited for a forum we use the qiskit tag in the Stack Exchange.

Next Steps

Now you're set up and ready to check out some of the other examples from our Qiskit Tutorials repository.

Authors and Citation

Qiskit Terra 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 0.9.0 release here:

https://github.com/Qiskit/qiskit-terra/releases/tag/0.9.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. For example, you can find the release notes for the 0.9.0 release in the Qiskit documentation here:

https://qiskit.org/documentation/release_notes.html#terra-0-9

License

Apache License 2.0