Mitiq
Mitiq is an open source toolkit for implementing error mitigation techniques on most current intermediate-scale quantum computers.
Install / Use
/learn @unitaryfoundation/MitiqREADME
<a href="https://github.com/unitaryfoundation/mitiq"><img src="https://raw.githubusercontent.com/unitaryfoundation/mitiq/main/docs/source/img/mitiq-logo.png" alt="Mitiq logo" width="350"/></a>
Mitiq [mitt • tick] is a Python toolkit for implementing error mitigation techniques on quantum computers.
Current quantum computers are noisy due to interactions with the environment, imperfect gate applications, state preparation and measurement errors, etc. Error mitigation seeks to reduce these effects at the software level by compiling quantum programs in clever ways.
Want to know more?
- Check out our documentation.
- For code, repo, or theory questions, especially those requiring more detailed responses, submit a Discussion.
- For casual or time sensitive questions, chat with mitiq developers on the
#mitiqchannel on Discord. - Contributions to Mitiq are eligible for compensation! More details here, and all payouts can be found on our wiki!
Quickstart
Installation
pip install mitiq
Example
Define a function which takes a circuit as input and returns an expectation value you want to compute, then use Mitiq to mitigate errors.
import cirq
from mitiq import zne, benchmarks
def execute(circuit, noise_level=0.005):
"""Returns Tr[ρ |0⟩⟨0|] where ρ is the state prepared by the circuit
with depolarizing noise."""
noisy_circuit = circuit.with_noise(cirq.depolarize(p=noise_level))
return (
cirq.DensityMatrixSimulator()
.simulate(noisy_circuit)
.final_density_matrix[0, 0]
.real
)
circuit = benchmarks.generate_rb_circuits(n_qubits=1, num_cliffords=50)[0]
true_value = execute(circuit, noise_level=0.0) # Ideal quantum computer
noisy_value = execute(circuit) # Noisy quantum computer
zne_value = zne.execute_with_zne(circuit, execute) # Noisy quantum computer + Mitiq
print(f"Error w/o Mitiq: {abs((true_value - noisy_value) / true_value):.3f}")
print(f"Error w Mitiq: {abs((true_value - zne_value) / true_value):.3f}")
Sample output:
Error w/o Mitiq: 0.264
Error w Mitiq: 0.073
Calibration
Unsure which error mitigation technique or parameters to use? Try out the calibration module demonstrated below to help find the best parameters for your particular backend!

See our guides and examples for more explanation, techniques, and benchmarks.
Quick Tour
Error mitigation techniques
You can check out currently available quantum error mitigation techniques by calling
mitiq.qem_methods()
| Technique | Documentation | Mitiq module | Paper Reference(s) |
| ----------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Zero-noise extrapolation | ZNE | mitiq.zne | 1611.09301<br>1612.02058<br>1805.04492 |
| Probabilistic error cancellation | PEC | mitiq.pec | 1612.02058<br>1712.09271<br>1905.10135 |
| (Variable-noise) Clifford data regression | CDR | mitiq.cdr | 2005.10189<br>2011.01157 |
| Digital dynamical decoupling | DDD | mitiq.ddd | 9803057<br>1807.08768 |
| Readout-error mitigation | REM | mitiq.rem | 1907.08518 <br>2006.14044
| Quantum Subspace Expansion | QSE | mitiq.qse | 1903.05786|
| Layerwise Richardson Extrapolation | LRE | mitiq.lre | 2402.04000 |
The following techniques are experimental and must be imported via from mitiq import experimental.
Experimental techniques are not covered by mitiq's semantic versioning guarantees.
A technique graduates to stable once it has broad test coverage, documented user guides, and has seen real-world validation on hardware or well-studied noise models.
If you are using an experimental technique and would like to help it graduate, please open an issue or contribute to the discussion on GitHub.
| Technique | Documentation | Mitiq module | Paper Reference(s) |
| ----------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Robust Shadow Estimation | RSE| mitiq.experimental.shadows | 2011.09636 <br> 2002.08953|
| Probabilistic Error Amplification | PEA | mitiq.experimental.pea | Nature |
| Virtual Distillation | VD | mitiq.experimental.vd | APS |
| Twirled Readout Error eXtinction | TREX | mitiq.experimental.trex | 2012.09738 |
In addition, we also have Pauli Twirling which is a noise tailoring technique:
| Noise-tailoring Technique | Documentation | Mitiq module | Paper Reference(s)
