No project description provided
Project description
Mitiq
Mitiq is a Python toolkit for implementing error mitigation techniques on quantum computers.
Installation
Mitiq can be installed from PyPi via
pip install mitiq
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'd prefer to clone and install from source, our would like to develop 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 for a simple example of Mitiq in action:
import numpy as np
from cirq import depolarize, Circuit, DensityMatrixSimulator, LineQubit, X
from mitiq 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
Error mitigation techniques
Mitiq currently implements zero-noise extrapolation and is designed to support additional techniques.
Documentation
Mitiq's documentation is hosted at mitiq.readthedocs.io. A PDF version of the latest release can be found here.
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.
Citation
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}
}
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mitiq-0.3.0.tar.gz
.
File metadata
- Download URL: mitiq-0.3.0.tar.gz
- Upload date:
- Size: 55.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6819de4618501d5fd9b0fb8177fa67936e327788b44ec8e617ec9849b9c16741 |
|
MD5 | 2531d599713965f32d48775b193680d8 |
|
BLAKE2b-256 | 107de56788180d4b6573a4d54d018d6431aa738ed88c4266bca4603d3750c952 |
File details
Details for the file mitiq-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: mitiq-0.3.0-py3-none-any.whl
- Upload date:
- Size: 72.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d22fe019bde9d8bf5923060adbc01bf3c478ee48b63f920d26b9d14ab506bf05 |
|
MD5 | 457410423b79ddf00a37f0713772f678 |
|
BLAKE2b-256 | 659fd184845de7f67ecc5f67f1e2af8ad83d8a3fddac368203affdccbb598677 |