mitiq
Mitiq is an open source toolkit for implementing error mitigation techniques on most current intermediate-scale quantum computers.
Science Score: 77.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 1 DOI reference(s) in README -
✓Academic publication links
Links to: arxiv.org, scholar.google, nature.com, aps.org -
✓Committers with academic emails
4 of 74 committers (5.4%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.5%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Mitiq is an open source toolkit for implementing error mitigation techniques on most current intermediate-scale quantum computers.
Basic Info
- Host: GitHub
- Owner: unitaryfoundation
- License: gpl-3.0
- Language: Python
- Default Branch: main
- Homepage: https://mitiq.readthedocs.io
- Size: 40.1 MB
Statistics
- Stars: 394
- Watchers: 10
- Forks: 189
- Open Issues: 126
- Releases: 55
Topics
Metadata Files
README.md
Mitiq 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. - To see what's in store for Mitiq, look at our roadmap in the wiki. - For code, repo, or theory questions, especially those requiring more detailed responses, submit a Discussion. - For casual or time sensitive questions, chat with us on Discord. - Join our weekly community call on Discord (public agenda).
Quickstart
Installation
bash
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.
```python import cirq from mitiq import zne, benchmarks
def execute(circuit, noiselevel=0.005): """Returns Tr[ρ |0⟩⟨0|] where ρ is the state prepared by the circuit with depolarizing noise.""" noisycircuit = circuit.withnoise(cirq.depolarize(p=noiselevel)) return ( cirq.DensityMatrixSimulator() .simulate(noisycircuit) .finaldensity_matrix[0, 0] .real )
circuit = benchmarks.generaterbcircuits(nqubits=1, numcliffords=50)[0]
truevalue = execute(circuit, noiselevel=0.0) # Ideal quantum computer noisyvalue = execute(circuit) # Noisy quantum computer znevalue = zne.executewithzne(circuit, execute) # Noisy quantum computer + Mitiq
print(f"Error w/o Mitiq: {abs((truevalue - noisyvalue) / truevalue):.3f}") print(f"Error w Mitiq: {abs((truevalue - znevalue) / truevalue):.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
python
mitiq.qem_methods()
| Technique | Documentation | Mitiq module | Paper Reference(s) |
| ----------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Zero-noise extrapolation | ZNE | mitiq.zne | 1611.09301
1612.02058
1805.04492 |
| Probabilistic error cancellation | PEC | mitiq.pec | 1612.02058
1712.09271
1905.10135 |
| (Variable-noise) Clifford data regression | CDR | mitiq.cdr | 2005.10189
2011.01157 |
| Digital dynamical decoupling | DDD | mitiq.ddd | 9803057
1807.08768 |
| Readout-error mitigation | REM | mitiq.rem | 1907.08518
2006.14044
| Quantum Subspace Expansion | QSE | mitiq.qse | 1903.05786|
| Robust Shadow Estimation 🚧 | RSE| mitiq.shadows | 2011.09636
2002.08953|
| Layerwise Richardson Extrapolation | LRE | mitiq.lre | 2402.04000 |
| Probabilistic Error Amplification 🚧 | Coming soon | mitiq.pea | Nature |
| Virtual Distillation 🚧 | Coming soon | mitiq.vd | APS |
In addition, we also have a noise tailoring technique currently available with limited functionality:
| Noise-tailoring Technique | Documentation | Mitiq module | Paper Reference(s) |
| ----------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Pauli Twirling 🚧 | PT | mitiq.pt | 1512.01098 |
🚧: Technique is currently a work in progress or is untested and may have some rough edges. If you try any of these techniques and have suggestions, please open an issue!
See our roadmap for additional candidate techniques to implement. If there is a technique you are looking for, please file a feature request.
Interface
We refer to any programming language you can write quantum circuits in as a frontend, and any quantum computer / simulator you can simulate circuits in as a backend.
Supported frontends
| Cirq | Qiskit | pyQuil | Braket | PennyLane | Qibo |
|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:---------------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|
|
|
|
| |
You can install Mitiq support for these frontends by specifying them during installation, as optional extras, along with the main package. To install Mitiq with one or more frontends, you can specify each frontend in square brackets as part of the installation command.
For example,
to install Mitiq with support for Qiskit and Qibo:
bash
pip install mitiq[qiskit,qibo]
Here is an up-to-date list of supported frontends.
Note: Currently, Cirq is a core requirement of Mitiq and is installed when you pip install mitiq (even without the optional [cirq])
Supported backends
You can use Mitiq with any backend you have access to that can interface with supported frontends.
Citing Mitiq
If you use Mitiq in your research, please reference the Mitiq whitepaper using the bibtex entry found in CITATION.bib.
A list of papers citing Mitiq can be found on Google Scholar / Semantic Scholar.
License
Contributing
We welcome contributions to Mitiq including bug fixes, feature requests, etc. To get started, check out our contribution guidelines and/or documentation guidelines.
Contributors ✨
Thank you to all of the wonderful people that have made this project possible. Non-code contributors are also much appreciated, and are listed here. Thank you to
- @francespoblete for much of Mitiq's design work/vision
Contributions of any kind are welcome!
Owner
- Name: Unitary Foundation
- Login: unitaryfoundation
- Kind: organization
- Email: info@unitary.foundation
- Website: https://unitary.foundation/
- Twitter: unitaryfdn
- Repositories: 55
- Profile: https://github.com/unitaryfoundation
Unitary Foundation is a non-profit working to create a quantum technology ecosystem that benefits the most people.
Citation (CITATION.bib)
@article{mitiq,
title = {Mitiq: A software package for error mitigation on noisy quantum computers},
author = {Ryan LaRose and Andrea Mari and Sarah Kaiser and Peter J. Karalekas and Andre A. Alves and Piotr Czarnik and Mohamed El Mandouh and Max H. Gordon and Yousef Hindy and Aaron Robertson and Purva Thakre and Misty Wahl and Danny Samuel and Rahul Mistri and Maxime Tremblay and Nick Gardner and Nathaniel T. Stemen and Nathan Shammah and William J. Zeng},
journal = {Quantum},
year = {2022},
month = {Aug},
doi = {10.22331/q-2022-08-11-774},
url = {https://doi.org/10.22331/q-2022-08-11-774},
publisher = {Verein zur Forderung des Open Access Publizierens in den Quantenwissenschaften},
volume = {6},
pages = {774},
}
GitHub Events
Total
- Fork event: 20
- Create event: 53
- Release event: 2
- Issues event: 37
- Watch event: 16
- Delete event: 39
- Member event: 1
- Issue comment event: 268
- Push event: 108
- Gollum event: 3
- Pull request review event: 188
- Pull request review comment event: 164
- Pull request event: 112
Last Year
- Fork event: 20
- Create event: 53
- Release event: 2
- Issues event: 37
- Watch event: 16
- Delete event: 39
- Member event: 1
- Issue comment event: 268
- Push event: 108
- Gollum event: 3
- Pull request review event: 188
- Pull request review comment event: 164
- Pull request event: 112
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| dependabot[bot] | 4****] | 331 |
| Andrea Mari | 4****i | 174 |
| Ryan LaRose | r****e@u****u | 166 |
| Nathan Shammah | n****h@g****m | 153 |
| nate stemen | n****e@u****d | 144 |
| Purva Thakre | 6****e | 88 |
| Misty Wahl | 8****W | 65 |
| Will Zeng | w****g | 42 |
| Sarah Kaiser | s****r@s****m | 40 |
| allcontributors[bot] | 4****] | 38 |
| L-P-B | m****n@g****m | 35 |
| Peter Karalekas | p****r@k****m | 28 |
| Alessandro Cosentino | a****o@u****d | 28 |
| Brian G | b****h@g****m | 23 |
| Andre | a****s@2****m | 21 |
| Aaron Robertson | 5****n | 19 |
| jordandsullivan | j****n@u****d | 15 |
| maxtremblay | m****m@p****m | 14 |
| Amir Ebrahimi | g****b@a****m | 10 |
| FarLab | f****h@u****d | 10 |
| Min Li | m****2@i****u | 10 |
| nickdgardner | 3****r | 7 |
| Shivansh Mittal | 8****8 | 6 |
| Abdulrahman Sahmoud | b****a | 4 |
| Ashish Panigrahi | a****i@p****m | 4 |
| Mohamed El Mandouh | 7****h | 4 |
| Vladimir Kozhukalov | k****v@g****m | 3 |
| Vincent Russo | v****1@g****m | 3 |
| Rahul Mistri | 5****i | 3 |
| DSamuel1 | 4****1 | 3 |
| and 44 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 30
- Total pull requests: 73
- Average time to close issues: 8 months
- Average time to close pull requests: 14 days
- Total issue authors: 18
- Total pull request authors: 17
- Average comments per issue: 1.6
- Average comments per pull request: 1.97
- Merged pull requests: 26
- Bot issues: 0
- Bot pull requests: 29
Past Year
- Issues: 25
- Pull requests: 73
- Average time to close issues: 3 months
- Average time to close pull requests: 14 days
- Issue authors: 16
- Pull request authors: 17
- Average comments per issue: 0.96
- Average comments per pull request: 1.97
- Merged pull requests: 26
- Bot issues: 0
- Bot pull requests: 29
Top Authors
Issue Authors
- natestemen (8)
- jordandsullivan (3)
- cosenal (2)
- purva-thakre (2)
- nathanshammah (2)
- beitom (1)
- simonecantori (1)
- crazy4pi314 (1)
- spiraldoodles (1)
- Shivansh20128 (1)
- sanketsharma (1)
- SimoneGasperini (1)
- astralcai (1)
- bdg221 (1)
- andrijapau (1)
Pull Request Authors
- dependabot[bot] (28)
- natestemen (18)
- bdg221 (5)
- raptor7197 (2)
- Roll249 (2)
- ACE07-Sev (2)
- q-inho (2)
- FarLab (2)
- Misty-W (1)
- NazTM (1)
- lifechange777 (1)
- Jegbrz (1)
- ahkatlio (1)
- maloleroy (1)
- khknopp (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 7,714 last-month
- Total dependent packages: 0
- Total dependent repositories: 5
- Total versions: 55
- Total maintainers: 6
pypi.org: mitiq
Mitiq is an open source toolkit for implementing error mitigation techniques on most current intermediate-scale quantum computers.
- Homepage: https://unitary.foundation
- Documentation: https://mitiq.readthedocs.io/en/stable/
- License: GPL v3.0
-
Latest release: 0.46.0
published 6 months ago
Rankings
Maintainers (6)
Dependencies
- actions/checkout v3 composite
- actions/setup-python v4 composite
- actions/setup-python v3 composite
- codecov/codecov-action v3.1.1 composite
- actions/checkout v3 composite
- actions/create-release v1 composite
- actions/first-interaction v1 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- mcr.microsoft.com/vscode/devcontainers/python 0-${VARIANT} build
- Sphinx ==5.2.3 development
- amazon-braket-sdk * development
- black ==22.10 development
- bqskit ==1.0.3 development
- flake8 ==6.0.0 development
- jupytext ==1.14.1 development
- mypy ==1.0.0 development
- myst-nb ==0.17.1 development
- nbsphinx ==0.8.9 development
- openfermion ==1.5.1 development
- openfermionpyscf ==0.5 development
- pennylane * development
- pennylane-qiskit * development
- pydata-sphinx-theme ==0.11.0 development
- pyquil * development
- pyscf ==2.1.1 development
- pytest ==7.1.3 development
- pytest-cov ==4.0.0 development
- pytest-xdist ==3.0.2 development
- qiskit * development
- schema ==0.7.5 development
- sphinx-autodoc-typehints ==1.19.4 development
- sphinx-copybutton ==0.5.0 development
- sphinx-gallery ==0.10.1 development
- sphinxcontrib-bibtex ==2.5.0 development
- cirq *
- numpy >=1.22.0
- scipy *
