Go to file
Matthew Treinish a3b359b899
Add tweedledum to requirements-dev.txt (#9477)
* Add tweedledum to requirements-dev.txt

This commit adds a tweedledum to the requirements-dev.txt list. Since
the release of qiskit-terra 0.23.0 the CI docs job has started to fail.
This is because tweedledum is a requirement for the classicalfunction
compiler docs. It turns out we were getting tweedledum installed in docs
build jobs via a weird path. The install order for docs build was
installing packages that require qiskit-terra before terra itself was
being installed. This would cause qiskit-terra from pypi from being
isntalled first, and old versions of terra required tweedledum which
would install it. Then we'd later upgrade terra to the current version
under test. To fix this in the short term this adds add tweedledum to
the requirements list so we unblock CI. One thing to note is that since
the primary reason we removed tweedledum from the requirements list
in #8947 was because macOS users were not able to install it reliably
the new entry in the requirement-dev.txt list does not cause issues for
developers on macOS systems.

Longer term we should make two fixes, first we need to update the
classicalfunction compiler docs so they build without having tweedledum
installed. The second is we should update the CI job to avoid installing
terra from pypi before we build it from source. But, given that CI is
currently broken just adding it to the requirements-dev.txt list is the
fastest fix.

* Exclude tweedledum on Python 3.11 too
2023-01-27 22:36:33 +00:00
.azure Pin tox version in CI (#9460) 2023-01-25 22:16:59 +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 transpiler documentation (#9087) 2023-01-26 15:15:18 +00:00
releasenotes Fix add_calibration bug (#9223) 2023-01-25 14:43:23 +00:00
src Fix clippy failures with Rust 1.67.0 (#9470) 2023-01-26 19:31:50 +00:00
test Fix find_z2_symmetries when resulting object is empty (#9427) 2023-01-25 15:33:29 +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 ahash from 0.8.2 to 0.8.3 (#9449) 2023-01-25 13:49:04 +00:00
Cargo.toml Bump ahash from 0.8.2 to 0.8.3 (#9449) 2023-01-25 13:49:04 +00:00
LICENSE.txt Consistent license across all the project (#550) 2018-06-08 15:00:58 +02:00
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 tweedledum to requirements-dev.txt (#9477) 2023-01-27 22:36:33 +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