Skip to main content

No project description provided

Project description

Mitiq

build codecov Documentation Status PyPI version arXiv Downloads Repository

Unitary Fund

logo

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.

Installation

Mitiq can be installed from PyPi via

pip install mitiq

To build from source, see these installation instructions. To test installation, run

import mitiq
mitiq.about()

This prints out version information about core requirements and optional quantum software packages which Mitiq can interface with.

If you would like to contribute to Mitiq, check out the contribution guidelines for more information.

Supported quantum programming libraries

Mitiq can currently interface with:

Cirq is a core requirement of Mitiq and is automatically installed. To use Mitiq with other quantum programming libraries, install the optional package(s) following the instructions linked above.

Supported quantum processors

Mitiq can be used on any quantum processor which can be accessed by supported quantum programming libraries and is available to the user.

Getting started

See the getting started guide in Mitiq's documentation for a complete walkthrough of how to use Mitiq. For a quick preview, check out the following snippet:

import numpy as np
from cirq import depolarize, Circuit, DensityMatrixSimulator, LineQubit, X
from mitiq.zne import execute_with_zne

def noisy_simulation(circ: Circuit) -> float:
    """Simulates a circuit with depolarizing noise.

    Args:
        circ: The quantum program as a Cirq Circuit.

    Returns:
        The expectation value of the |0><0| observable.
    """
    circuit = circ.with_noise(depolarize(p=0.001))
    rho = DensityMatrixSimulator().simulate(circuit).final_density_matrix
    return np.real(np.trace(rho @ np.diag([1, 0])))

# simple circuit that should compose to the identity when noiseless
circ = Circuit(X(LineQubit(0)) for _ in range(80))

# run the circuit using a density matrix simulator with depolarizing noise
unmitigated = noisy_simulation(circ)
print(f"Error in simulation (w/o  mitigation): {1.0 - unmitigated:.{3}}")

# run again, but using mitiq's zero-noise extrapolation to mitigate errors
mitigated = execute_with_zne(circ, noisy_simulation)
print(f"Error in simulation (with mitigation): {1.0 - mitigated:.{3}}")

Sample output:

Error in simulation (w/o  mitigation): 0.0506
Error in simulation (with mitigation): 0.000519

Example with Qiskit

Alt Text

Example with Cirq

Alt Text

Error mitigation techniques

Mitiq currently implements:

and is designed to support additional techniques.

Documentation

Mitiq's documentation is hosted at mitiq.readthedocs.io.

Developer information

We welcome contributions to Mitiq including bug fixes, feature requests, etc. Please see the contribution guidelines for more details. To contribute to the documentation, please see these documentation guidelines.

Authors

An up-to-date list of authors can be found here.

Research

We look forward to adding new features to Mitiq. If you have a proposal for implementing a new quantum error mitigation technique, or adding an example used in your research, please read our guidelines for contributing.

Citing Mitiq

If you use Mitiq in your research, please reference the Mitiq preprint as follows:

@misc{larose2020mitiq,
    title={Mitiq: A software package for error mitigation on noisy quantum computers},
    author={Ryan LaRose and Andrea Mari and Peter J. Karalekas
            and Nathan Shammah and William J. Zeng},
    year={2020},
    eprint={2009.04417},
    archivePrefix={arXiv},
    primaryClass={quant-ph}
}

A list of papers citing Mitiq can be found here.

License

GNU GPL v.3.0.

unitaryHACK

Mitiq is participating in unitaryHACK, check out and contribute on open issues labeled unitaryhack!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mitiq-0.9.2.tar.gz (80.6 kB view details)

Uploaded Source

Built Distribution

mitiq-0.9.2-py3-none-any.whl (112.7 kB view details)

Uploaded Python 3

File details

Details for the file mitiq-0.9.2.tar.gz.

File metadata

  • Download URL: mitiq-0.9.2.tar.gz
  • Upload date:
  • Size: 80.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2.post20210110 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.7

File hashes

Hashes for mitiq-0.9.2.tar.gz
Algorithm Hash digest
SHA256 8d19f8fcac65aabe52a9ccfb34b3d9789a59f92f924f826cb9695708c28e29b8
MD5 ae0329990dbe5ff0c3c1f3f92e3206b9
BLAKE2b-256 e6553e84009b3e400d0031498aaa12cdb8d90174a879fc32b13303209c82b4ad

See more details on using hashes here.

File details

Details for the file mitiq-0.9.2-py3-none-any.whl.

File metadata

  • Download URL: mitiq-0.9.2-py3-none-any.whl
  • Upload date:
  • Size: 112.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2.post20210110 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.7

File hashes

Hashes for mitiq-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9292fad8c2a0478142f8dfcba57dd5b793c21e999fee4881a97f72cf3a908db5
MD5 2af9e2bd63fd22263d059dc13f43b493
BLAKE2b-256 419d6c1510012938c3b191664884895c5c8fa3397dcc9a7dcb04c8a2c56f57b7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page