# About Error Mitigation¶

This is intended as a primer on quantum error mitigation, providing a collection of up-to-date resources from the academic literature, as well as other external links framing this topic in the open-source software ecosystem. This recent review article [3] summarizes the theory behind many error-mitigating techniques.

## What is quantum error mitigation?¶

Quantum error mitigation refers to a series of techniques aimed at
reducing (*mitigating*) the errors that occur in quantum computing algorithms.
Unlike software bugs affecting code in usual computers, the errors which we
attempt to reduce with mitigation are due to the hardware.

Quantum error mitigation techniques try to *reduce* the impact of noise in
quantum computations. They generally do not completely remove it. Alternative
nomenclature refers to error mitigation as (approximate) error suppression or
approximate quantum error correction, but it is worth noting that error mitigation
is distinctly different from error correction. Two leading
error mitigation techniques implemented in Mitiq are zero-noise extrapolation
and probabilistic error cancellation.

### Zero-noise extrapolation¶

In Mitiq, zero-noise extrapolation is implemented in the module `mitiq.zne`

.

The crucial idea behind zero-noise extrapolation is that, although some minimum
noise strength quantified \(\lambda\) exists in the computer,
it is possible to *increase* the noise to \(\lambda'=c\lambda\) where \(c>1\).
In Mitiq, noise-scaling methods are contained in `mitiq.zne.scaling`

. After computing
the observable of interest at increased noise levels, we can fit a trend to this data and
extrapolate to the zero-noise limit. In Mitiq, extrapolation (or inference) methods are
contained in `mitiq.zne.inference`

.

### Limitations of zero-noise extrapolation¶

While zero-noise extrapolation is very general and can be applied even if
the underlying noise model is unknown, the method can be sensitive to
extrapolation errors. For this reason, it is important to choose a good
noise-scaling method, set of scale factors, and extrapolation method, which
*a priori* may not be known. Moreover, one has to take into account that any
initial error in the measured expectation values will propagate to the extrapolated
value. This fact can significantly amplify the statistical uncertainty of the result.

### Probabilistic error cancellation¶

In Mitiq, probabilistic error cancellation is implemented in the module `mitiq.pec`

.

Probabilistic error cancellation (PEC) uses a quasi-probability representation [1] to express an ideal (unitary) quantum channel as a linear combination of noisy operations. Given a set of noisy but implementable operations \(\Omega = \{O_1, \dots, O_m\}\), an ideal unitary gate can be expressed as \(\mathcal{G} = \sum_{\alpha} \eta_{\alpha} \mathcal{O}_\alpha = \gamma \sum_{\alpha} P(\alpha) \sigma(\alpha) \mathcal{O}_\alpha\), where \(\eta_\alpha\) are real coefficients, \(\gamma = \sum_{\alpha} |\eta_\alpha|\), \(P(\alpha)=|\eta_\alpha | /\gamma\) is a probability distribution, and \(\sigma(\alpha)={\rm sign}(\eta_\alpha)\).

As usual, we want to estimate the ideal expectation value of some observable of interest \(\langle X\rangle_{\text{ideal}}\) after the action of an ideal circuit \(\{\mathcal{\mathcal G}_i\}_{i=1}^L\). To do this in PEC, we sample a noisy operation \(\mathcal{O}_{\alpha}\) for each ideal gate \(\mathcal{G}_i\) with probability \(P_i(\alpha)\). This sampling produces a sequence of noisy operations \(\{\mathcal{O}_{\alpha_i}\}_{i=1}^L\)) whose execution produces the final mixed state \(\rho_f\). Then, by measuring the observable \(X\), setting \(\gamma_{\text{tot}} := \prod_{i}^L \gamma_i\) and \(\sigma_{\text{tot}} = \prod_{i=1}^L \sigma_i(\alpha)\), we can obtain an unbiased estimate of the ideal expectation value as \(\langle X\rangle_{\text{ideal}} = \mathbb E \left[ \gamma_{\text{tot}} \sigma_{\text{tot}} X_{\rm noisy} \right]\), where \(X_{\rm noisy}\) is the experimental estimate of \({\rm tr}[\rho_f X]\) and \(\mathbb E\) is the sample average over many repetitions of the previous procedure.

### Limitations of probabilistic error cancellation¶

The number of samples required to estimate the ideal expectation value with error \(\delta\) and probability \(1-\epsilon\) scales as \(\left(2 \gamma_{\text{tot}}^{2} / \delta^{2}\right) \log (2 / \epsilon)\) [4]. Thus, the sampling overhead is determined by \(\gamma_{\text{tot}}\) which grows exponentially in the number of gates. It is then crucial to find a linear decomposition that minimizes \(\gamma_{\text{tot}}\). In addition, a full characterization of the noisy operations up to a good precision is required, which can be costly depending on the implementation.

### Other error mitigation techniques¶

A collection of references on additional error mitigation techniques, including randomized compiling or subspace expansion, can be found in Research articles.

## Why is quantum error mitigation important?¶

The noisy intermediate-scale quantum (NISQ) era is characterized by short-depth circuits in which noise affects state preparation, gate operations, and measurement [5]. It is not possible to implement quantum error correcting codes on them due to the needed qubit number and circuit depth required by these codes. Error mitigation offers low-overhead methods to more accurately and reliably estimate observable values.

Mitiq aims at providing a comprehensive, flexible, and performant toolchain for error mitigation techniques to increase the performance of NISQ computers.

## External References¶

Here is a list of useful external resources on quantum error mitigation, including software tools that provide the possibility of studying quantum circuits.

### Research articles¶

A list of research articles academic resources on error mitigation:

- On
**randomization methods**: Randomized compiling with twirling gates, J. Wallman

*et al.*,*Phys. Rev. A*, 2016 [16]Porbabilistic error correction, K. Temme

*et al.*,*Phys. Rev. Lett.*, 2017 [1]Practical proposal, S. Endo

*et al.*,*Phys. Rev. X*, 2018 [17]Experiment on trapped ions, S. Zhang

*et al.*,*Nature Comm.*2020 [18]Experiment with gate set tomography on a supeconducting circuit device, J. Sun

*et al.*, 2019 arXiv [19]

- On
- On
**subspace expansion**: By hybrid quantum-classical hierarchy introduction, J. McClean

*et al.*,*Phys. Rev. A*, 2017 [20]By symmetry verification, X. Bonet-Monroig

*et al.*,*Phys. Rev. A*, 2018 [21]With a stabilizer-like method, S. McArdle

*et al.*,*Phys. Rev. Lett.*, 2019, [22]Exploiting molecular symmetries, J. McClean

*et al.*,*Nat. Comm.*, 2020 [23]Experiment on a superconducting circuit device, R. Sagastizabal

*et al.*,*Phys. Rev. A*, 2019 [24]

- On
- On
**other error-mitigation techniques**such as: Approximate error-correcting codes in the generalized amplitude-damping channels, C. Cafaro

*et al.*,*Phys. Rev. A*, 2014 [25]:Extending the variational quantum eigensolver (VQE) to excited states, R. M. Parrish

*et al.*,*Phys. Rev. Lett.*, 2017 [26]Quantum imaginary time evolution, M. Motta

*et al.*,*Nat. Phys.*, 2020 [27]Error mitigation for analog quantum simulation, J. Sun

*et al.*, 2020, arXiv [19]

- On
For an extensive introduction: S. Endo,

*Hybrid quantum-classical algorithms and error mitigation*, PhD Thesis, 2019, Oxford University (Link), or [3].

### Software¶

Here is a (non-comprehensive) list of open-source software libraries related to quantum computing, noisy quantum dynamics and error mitigation:

**IBM Q**’s Qiskit provides a stack for quantum computing simulation and execution on real devices from the cloud. In particular,`qiskit.Aer`

contains the`NoiseModel`

object, integrated with Mitiq tools. Qiskit’s OpenPulse provides pulse-level control of qubit operations in some of the superconducting circuit devices. Mitiq can integrate with Qiskit via conversions in`mitiq_qiskit`

.**Google AI Quantum**’s Cirq offers quantum simulation of quantum circuits. The`cirq.Circuit`

object is integrated in Mitiq algorithms as the default circuit.**Rigetti Computing**’s PyQuil is a library for quantum programming. Rigetti’s stack offers the execution of quantum circuits on superconducting circuits devices from the cloud, as well as their simulation on a quantum virtual machine (QVM), integrated with Mitiq tools in the`mitiq_pyquil`

module.QuTiP, the quantum toolbox in Python, contains a quantum information processing module that allows to simulate quantum circuits, their implementation on devices, as well as the simulation of pulse-level control and time-dependent density matrix evolution with the

`qutip.Qobj`

object and the`Processor`

object in the`qutip.qip`

module.Krotov is a package implementing Krotov method for optimal control interfacing with QuTiP for noisy density-matrix quantum evolution.

PyGSTi allows to characterize quantum circuits by implementing techniques such as gate set tomography (GST) and randomized benchmarking.

This is just a selection of open-source projects related to quantum error mitigation. A more comprehensinve collection of software on quantum computing can be found here and on Unitary Fund’s list of supported projects.