AWS Quantum Technologies Blog
Exploring quantum error mitigation with Mitiq and Amazon Braket
By Ryan LaRose, a researcher with Unitary Fund and Michigan State University; Nathan Shammah, CTO of Unitary Fund; Peter Karalekas, Software Engineer at the AWS Center for Quantum Computing; and Eric Kessler, Sr. Manager of Applied Science for Amazon Braket.
In this blog post, we demonstrate how to use Mitiq, an open-source library for quantum error mitigation, on Amazon Braket to improve performance when executing circuits on Rigetti devices.
One of the main challenges with today’s quantum processing units is that they don’t execute operations perfectly. Instead, every time an operation is executed, or even when a qubit is just waiting for the next operation, there is a small chance that an error occurs, potentially compromising the results of the algorithm. In the long term, quantum error correction (QEC) protocols, like the one described in this blog post, could suppress these errors by using additional qubits to redundantly encode quantum information, analogous to classical error correction. Such protocols, however, are resource intensive and cannot yet be implemented with the devices available today due to limited qubit numbers and control capabilities. In the meantime, researchers can already improve the performance of quantum algorithms through quantum error mitigation (QEM). While not providing full fault tolerance like quantum error correction, quantum error mitigation provides a practical way to suppress errors on noisy intermediate-scale quantum (NISQ) devices.
Amazon Braket recently launched support for verbatim compilation which offers customers the ability to run their circuits exactly as defined, without any modifications or optimizations during compilation. While this feature enables researchers to run reproducible experiments, e.g., for device benchmarking, running circuits exactly as defined is also necessary for many quantum error mitigation techniques.
Mitiq: A Python toolkit for quantum error mitigation
A large number of quantum error mitigation techniques have been proposed in recent literature (e.g. Temme et al., Phys. Rev. Lett. 119, 180509 (2017) and Endo et al., J. Phys. Soc. Japan 90, 032001 (2021)), a fact which reflects the importance and timeliness of the subject. The ability to implement quantum error mitigation in a platform-independent manner is crucial for testing, advancing, and ultimately deploying these techniques in applications.
This is why a community of open-source developers and Unitary Fund are developing Mitiq, a Python toolkit for implementing quantum error mitigation on NISQ computers. Currently, Mitiq can be used to implement zero-noise extrapolation (ZNE), probabilistic error cancellation (PEC), and Clifford data regression (CDR) techniques on quantum circuits written in the Amazon Braket SDK, Cirq, pyQuil, or Qiskit. You can use Mitiq with any quantum computer which interfaces with these packages. The Mitiq Github repository contains an example to help you get started quickly with quantum error mitigation.
An overview of Mitiq’s structure, containing modules for implementing quantum error mitigation techniques: zero-noise extrapolation (ZNE), probabilistic error cancellation (PEC), and Clifford data regression (CDR). Mitiq also includes modules for benchmarking the performance of quantum computers, and interfacing with various quantum programming SDKs.
Using Mitiq’s zero-noise extrapolation on Amazon Braket
Verbatim compilation in Amazon Braket enables quantum programmers to use Mitiq’s zero-noise extrapolation (ZNE) on Rigetti devices. The ZNE algorithm introduces extra gates into the circuit that normally would be compiled to the identity. However, verbatim compilation ensures the gates are exactly executed as defined, artificially increasing the noise in the computation. After you run the computation at several increased noise levels, ZNE fits a statistical model to the data. You will then use this model to extrapolate the results of the circuit down to the zero-noise limit.
It is possible to then benchmark the performance of Rigetti quantum computers with and without Mitiq’s zero-noise extrapolation on mirror circuits. Mirror circuits are special circuits designed for benchmarking where, in the ideal case without noise, only one bitstring is sampled. Any other sampled bitstrings are due to noise. A natural metric to define the performance of a device is the frequency of measuring the correct bitstring – the so-called “survival probability.” A higher survival probability is better, and the maximum value is 1. The following plot shows the survival probability on a set of two-qubit mirror circuits at increasing depths. You can see that survival probabilities with Mitiq’s zero-noise extrapolation are consistently higher than without quantum error mitigation. At the lowest depth, the average survival probability without ZNE is 79.0%, whereas the average survival probability with ZNE is 91.0%, meaning that the average error (1 – survival probability) has been reduced by 2.65x. You can see exactly how Mitiq was used with Amazon Braket to produce these results in the Mitiq with Braket notebook.
(Top panel) Error reduction factors with zero-noise extrapolation (ZNE). (Bottom panel) Survival probability of two-qubit mirror circuits at increasing depths, with and without ZNE. Each marker is the average survival probability of four random mirror circuits, and the color bands mark the minimum and maximum survival probabilities.
Conclusion
In this blog post, you were able to see a simple way to apply quantum error mitigation on Amazon Braket using the open-source library Mitiq. To learn more about verbatim compilation, follow the available Amazon Braket tutorial notebook or refer to the relevant documentation. To get started with Mitiq on Amazon Braket, see the Mitiq with Braket notebook. To try other quantum error mitigation techniques with Mitiq, see its getting started documentation. The quantum community needs more research and benchmarking to assess the scope of quantum error mitigation and its feasibility at scale. If you are a developer, we’d be happy to accept your contributions to Mitiq. You can also meet other members of the open-source quantum computing community on Unitary Fund’s Discord.