Add QubitSparsePauli and QubitSparsePauliList classes to quantum_info (#14283)
attempting to add initial structure
adding module creation function
partial progress with copying
partial progress 2
partial progress 3
copying over
successful compilation and import
minor changes
renaming SparseTerm to QubitSparsePauli
starting to transfer tests
moving more tests
updating repr of QubitSparsePauliList and adding tests
testing from_pauli
more test progress
moved relevant QubitSparsePauliList tests
adding from_label and from_pauli constructors to QubitSparsePauli
adding tests from from_pauli and from_label
added from_sparse_label method
fixing QubitSparsePauli constructors
working through tests for QubitSparsePuli
saving
done adding tests (I think)
formatting and linting
QubitSparsePauli main doc
done initial pass on QubitSparsePauliList docs
initial pass on docs for QubitSparsePauli
last edits
Update crates/accelerate/src/pauli_lindblad_map/qubit_sparse_pauli.rs
Co-authored-by: Samuele Ferracin sam.ferracin@ibm.com
- Update crates/accelerate/src/pauli_lindblad_map/qubit_sparse_pauli.rs
Co-authored-by: Samuele Ferracin sam.ferracin@ibm.com
changing the order of the class additions in mod.rs
attempting to fix table
fixing last warning in docs build
renaming BitTerm -> Pauli
fixing formatting
fixing table indentation
fixing error message
making error checking test more specific
cleaning up some docs
fixing test
changing all docs references to standard quantum_info to :class:
updating all pauli references
removing from_raw_parts and raw array data properties from QubitSparsePauliList
deleting documentation for QubitSparsePauliList that details the internal array storage
removing the Pauli attribute from QubitSparsePauliList
fixing tests
re-adding Pauli alphabet to QubitSparsePauli
formatting
minor docs change
removing IterMut
removing unnecessary methods return mutable references
fixing method name
linting
Correct extraneous documentation
removing Pauli.py_name and changing all calls to it to py_label
dropping other unused methods
fixing test comments/cases
formatting
Co-authored-by: Samuele Ferracin sam.ferracin@ibm.com Co-authored-by: Jake Lishman jake.lishman@ibm.com
Qiskit
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://docs.quantum.ibm.com/
Installation
We encourage installing Qiskit via
pip
: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:
Create an example quantum circuit using the
QuantumCircuit
class: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:Running this will give an outcome similar to
{'000': 497, '111': 503}
which is000
50% of the time and111
50% 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.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
andqiskit.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 thebasis_gates = ["cz", "sx", "rz"]
and a linear chain of qubits $0 \rightarrow 1 \rightarrow 2$ with thecoupling_map = [[0, 1], [1, 2]]
.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
andqiskit.primitives.BaseEstimatorV2
interfaces. For example, some packages that provide implementations of a runtime primitive implementation are:Qiskit also provides a lower-level abstract interface for describing quantum backends. This interface, located in
qiskit.providers
, defines an abstractBackendV2
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: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 theqiskit
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
Apache License 2.0