Welcome to the Quantum Gates documentation
Quantum Gates is a Python library for simulating the noisy behaviour of real quantum devices. The noise is incorporated directly into the gates, which become stochastic matrices.
This project is under active development.
How to install
The Python version should be 3.9 or later. We recommend using the library together with a IBM Quantum Lab account, as it necessary for circuit compilation with Qiskit.
Installation as a user
The library is available on the Python Package Index (PyPI) with
pip install quantum-gates.
Installation as a contributor
For users who want to have access to the source code, we recommend cloning the repository from Github.
To sample quantum gates with the noise incorporated in them, one can set up a Gates instance. The methods of this object return the matrices as numpy array. The sampling is stochastic, and one can set the numpy seed to always get the same sequence of noise.
When constructing a set of quantum gates with the Gates class, one can specify a Pulse instance. This pulse describes the shape of the RF pulses used to implement the gates.
Behind the scenes, we solve Ito integrals to deal with the different pulse shapes. This is handled by the integrator.
For the computation, we provide backends out of the box, such as the EfficientBackend that uses optimized tensor contractions to simulate 20+ qubits with the statevector method.
The simulators can be configured with a Circuits class, such as EfficientCircuit. This class is responsible for sampling the noisy gates. The class can be configured with a Gates instance and one of the Backends that executes the statevector simulation.
Four quantum algorithms are provided as functions which return the Qiskit circuit for a specific number of qubits
Hadamard reverse QFT circuit
Quantum Approximate Optimization Algorithm circuit
We also provide the legacy implementations of the gates, simulator and circuit classes. They can be used for unit testing.
In performing quantum simulation, there are many steps that are performed repeatedly, such as setup the IBM backend with setup_backend(), loading the noise information as DeviceParameters, transpiling the quantum circuits with create_qc_list(), and executing the simulation in parallel with multiprocessing_parallel_simulation() on a powerful machine. For this reason, the most frequently used functions are part of the utilities.