Go to file
Jake Lishman b8a4448c3e
Pin Numpy to less than 1.25 in CI (#10306)
We are not (should not be) fundamentally incompatible with Numpy 1.25,
there are just new deprecation warnings and seemingly some behavioural
changes that are causing flakiness in the isometry CI.  This temporarily
pins Numpy to allow people to continue working while we address the root
cause.
2023-06-19 11:23:33 +00:00
.azure Use stable Python C API for building Rust extension (#10120) 2023-06-12 13:45:27 +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 Pin Aer to known good version (#10270) 2023-06-13 12:37:54 +00:00
crates Use stable Python C API for building Rust extension (#10120) 2023-06-12 13:45:27 +00:00
docs Update typo in `qi_migration.rst` (#10292) 2023-06-15 17:08:52 +00:00
examples refactored and optimized code (#9292) 2023-01-11 19:45:31 +00:00
qiskit Remove deprecated InstructionSet circuit_cregs argument (#10302) 2023-06-16 20:52:01 +00:00
releasenotes Remove deprecated InstructionSet circuit_cregs argument (#10302) 2023-06-16 20:52:01 +00:00
test Remove deprecated InstructionSet circuit_cregs argument (#10302) 2023-06-16 20:52:01 +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.24.0rc1 tag (#10005) 2023-04-20 21:58:50 +00:00
.stestr.conf Removes stestr's grouping configuration. (#6399) 2021-05-12 19:06:06 +00:00
CITATION.bib CITATION.md from metapackage (#10111) 2023-05-15 14:22:59 +00:00
CODE_OF_CONDUCT.md
CONTRIBUTING.md Add ruff to local tests and CI (#10116) 2023-05-30 22:43:36 +00:00
Cargo.lock Bump rustworkx-core from 0.12.1 to 0.13.0 (#10237) 2023-06-07 13:30:39 +00:00
Cargo.toml Bump main branch version post 0.24.0rc1 tag (#10005) 2023-04-20 21:58:50 +00:00
LICENSE.txt
MANIFEST.in Remove non-existent files from MANIFEST.in (#9752) 2023-03-08 13:09:39 +00:00
Makefile Add ruff to local tests and CI (#10116) 2023-05-30 22:43:36 +00:00
README.md CITATION.md from metapackage (#10111) 2023-05-15 14:22:59 +00:00
SECURITY.md Add SECURITY.md to document security policy (#9589) 2023-02-16 11:26:57 -05:00
azure-pipelines.yml Drop support for Python 3.7 (#10009) 2023-05-05 15:28:34 +00:00
constraints.txt Pin Numpy to less than 1.25 in CI (#10306) 2023-06-19 11:23:33 +00:00
pyproject.toml Use stable Python C API for building Rust extension (#10120) 2023-06-12 13:45:27 +00:00
qiskit_bot.yaml Turn off Qiskit Bot notifications for code owners (#9931) 2023-05-09 16:16:56 +00:00
requirements-dev.txt Add ruff to local tests and CI (#10116) 2023-05-30 22:43:36 +00:00
requirements.txt Drop support for Python 3.7 (#10009) 2023-05-05 15:28:34 +00:00
rust-toolchain.toml Add `rust-toolchain.toml` for a consistent Rust development version (#9584) 2023-02-15 19:38:00 +00:00
setup.py Use stable Python C API for building Rust extension (#10120) 2023-06-12 13:45:27 +00:00
tox.ini Add ruff to local tests and CI (#10116) 2023-05-30 22:43:36 +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