Git Product home page Git Product logo

mitiq's Introduction

Mitiq logo

All Contributors

build Documentation Status codecov PyPI version arXiv Downloads Repository Unitary Fund Discord Chat Binder

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 and chat with us on Discord.

Do you use near-term quantum hardware? Have you tried Mitiq? Either way, take our survey and help make Mitiq better! bit.ly/mitiq-survey

Quickstart

Installation

pip install mitiq

Example

Define a function which inputs a circuit 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: cirq.Circuit, noise_level: float = 0.001) -> float:
    """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: cirq.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): %0.4f" %abs((true_value - noisy_value) / true_value))
print(f"Error (with Mitiq): %0.4f" %abs((true_value - zne_value) / true_value))

Sample output:

Error (w/o  Mitiq): 0.0688
Error (with Mitiq): 0.0002

See our guides and examples for more explanation, techniques, and benchmarks. The examples and other notebooks can be run interactively on the cloud with mybinder.org.

Quick Tour

Error mitigation techniques

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
Dynamical decoupling (In progress) (In progress) 9803057
1807.08768

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
Cirq logo Qiskit logo Rigetti logo AWS logo    PennyLane logo

Note: Cirq is a core requirement of Mitiq and is installed when you pip install mitiq.

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 preprint (bibtex). A list of papers citing Mitiq can be found on Google Scholar / Semantic Scholar.

License

GNU GPL v.3.0.

Contributing

We welcome contributions to Mitiq including bug fixes, feature requests, etc. To get started, check out our contribution guidelines and/or documentation guidelines. An up-to-date list of contributors can be found here and below.

Contributors

Thanks goes to these wonderful people (emoji key):


Yash-10

⚠️ 💻

Laurent AJDNIK

📖

Tianyi Hao

💻 🐛

Brian Lui

💻 🐛

Cole Kissane

💻 🐛

Michał Stęchły

💻

Kunal Marwaha

📖

k-m-schultz

💡

Bobin Mathew

📖

LogMoss

📖 🐛

DSamuel1

💡 💻

sid1993

💻 🐛

Yousef Hindy

💻 ⚠️ 📖

Mohamed El Mandouh

💻 ⚠️ 📖

Aaron Robertson

💡 ⚠️ 🐛

Ashish Panigrahi

📖

Maxime Tremblay

💻 📖 🤔

Andre

📖 ⚠️

Purva Thakre

📖 🚇 💻 🤔

Peter Karalekas

🚧 💻 📖 🚇 🤔

Sarah Kaiser

🚧 💻 📖 🚇 🤔

Andrea Mari

🚧 💻 📖 🚇 🤔

Will Zeng

🚧 💻 📖 🚇 🤔

Nathan Shammah

🚧 💻 📖 🚇 🤔

Ryan LaRose

🚧 💻 📖 🚇 🤔

francespoblete

🎨

Misty-W

💻 💡

AkashNarayanan B

🚇

This project follows the all-contributors specification. Contributions of any kind welcome!

mitiq's People

Contributors

aaron-robertson avatar akashnarayanan avatar allcontributors[bot] avatar andre-a-alves avatar andreamari avatar bobinmathew avatar ckissane avatar crazy4pi314 avatar dependabot[bot] avatar dsamuel1 avatar elmandouh avatar grmlarose avatar k-m-schultz avatar karalekas avatar l-p-b avatar laurentajdnik avatar logmoss avatar marwahaha avatar maxtremblay avatar misty-w avatar mstechly avatar nathanshammah avatar paniash avatar purva-thakre avatar rahul-mistri avatar rmlarose avatar sid1993 avatar willzeng avatar yash-10 avatar yhindy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.