Introducing Qiskit Aer: A high performance simulator framework for quantum circuits
Written by: Dr Christopher J. Wood
This week the Qiskit team releases a major update to the Qiskit software stack with the first release of Qiskit Aer 0.1. Qiskit Aer is a high-performance simulator framework for studying quantum computing algorithms and applications in the noisy intermediate scale quantum (NISQ) regime.
Why do we care about simulating noisy quantum computers?
Quantum computing, by its very nature, cannot be efficiently reproduced using classical computers. The resources required to simulate quantum hardware increases exponentially with the number of qubits. For the hardware developed in the next few years, even the world’s largest classical supercomputers won’t be enough.
Despite this, these near-term devices are still ‘intermediate scale’. Though large enough that their simulation will be intractable, they won’t yet be large enough to implement full-scale quantum error correction. This means that errors will occur during execution of any quantum computation. The longer our quantum program, the more these errors will accumulate.
These errors are unavoidable, and can take many forms depending on the physics of the devices. To develop quantum algorithms that are robust against their effects, we need to know our enemy. This requires us to have an accurate model of the errors that occur, as well as the ability to simulate their effects. Then we’ll be much better equipped to explore near-term quantum applications with noisy devices.
A simple example.
Let’s consider running a circuit to prepare a 3-qubit entangled state on both a real quantum computer, and an (ideal) quantum simulator. Below is the expected output returned by a simulator:
Now let’s see what happens when we run this algorithm on an actual quantum computer:
Notice the extra peaks? These are due to noise and errors during execution. The larger the quantum computer, and the longer the computation, the more random this output histogram will look.
How can Qiskit Aer Help?
Qiskit Aer is a high-performance simulator for Qiskit Terra that provides a highly configurable noise model for studying quantum computing in the NISQ regime. Its core is written in C++ for speed and incorporates features from IBM’s high performance online simulators into a local simulator that scales to run on your own system, whether that is a laptop, desktop, or server.
The first release includes three simulator backends:
1. The QASM Simulator is the main Qiskit Aer backend. This backend emulates execution of a quantum circuits on a real device and returns measurement counts. It includes highly configurable noise models and can even be loaded with automatically generated approximate noise models based on the calibration parameters of actual hardware devices.
2. The Statevector Simulator is an auxiliary backend for Qiskit Aer. It simulates the ideal execution of a quantum circuit and returns the final quantum state vector of the device at the end of simulation. This is useful for education, as well as the theoretical study and debugging of algorithms.
3. The Unitary Simulator is another auxiliary backend for Qiskit Aer. It allows simulation of the final unitary matrix implemented by an ideal quantum circuit. This is also useful for education and algorithm studies.
To see these backends in action see the Qiskit Aer backends Jupyter notebook tutorial.
Do I need a quantum computing PhD to use Qiskit Aer?
Studying the types of errors that occur in quantum devices is an active area of research. Qiskit Aer includes both advanced tools for researchers in this field and automatic tools for generating a simplified approximate noise model for real devices that can be used without any experience in this area.
Let us return to our previous example of generating a 3-qubit entangled state. The histogram below shows the output of simulating this circuit on the Qiskit Aer QASM Simulator using an automatically generated noise model based on the real device’s parameters:
To see the full details for generating this example you can view the device noise simulation Juptyer notebook tutorial. Note that this model is only an approximation based on single gate and measure error parameters and should not be expected to exactly match the noise on a real device.
For advanced users and researchers in quantum characterization and validation, Qiskit Aer allows the building of customized noise models. A noise model can assign a custom quantum error channel (completely-positive trace preserving map) to any unitary gate, measure, or reset operation acting on any qubit or set of qubits. For example, a different error can be assigned to a Controlled-NOT gate with qubit-0 as control and qubit-1 as target, then for qubit-1 as control and qubit-0 as the target. In addition, errors need not only act on the gate qubits either: non-local errors can also be added to a noise model to study correlated noise processes such as cross-talk. Additional tutorials on building custom noise models and using the advanced noise model features will be added soon to the qiskit-tutorials Github repo.
What should I know before installing Qiskit Aer?
The recommended way to install Qiskit is by using the PIP (Python package manager) tool. By installing Qiskit, you will receive the latest stable release of Qiskit Aer and Qiskit Terra, along with all the dependencies.
The development of Qiskit Aer has been a collaborative effort from IBM-Q researchers Christopher J. Wood, Hiroshi Horii, Hitomi Takahashi, Juan Gomez Mosquera, Yael Ben-Haim, Gadi Aleksandrowski, Yehuda Naveh, and John Gunnels from the IBM TJ Watson Research Center, IBM Research Tokyo, and IBM Research Haifa.