Skip to main content

License: MIT CI Python CI Bindings codecov

QECC: An MQT tool for Quantum Error Correcting Codes written in C++

⚠️ This project is still in early development and breaking changes might happen frequently.

(Additionally to the basic numerical results already provided, further data will be published continually)

A tool for quantum error correcting codes and numerical simulations developed by the Chair for Design Automation at the Technical University of Munich based on methods proposed in [1]. QECC is part of the Munich Quantum Toolkit (MQT).

The tool can be used to:

  • Decode quantum LDPC codes and conduct respective numerical simulations.
    • At the moment the general QLDPC decoder [2] and a heuristic (which improves the runtime of the algorithm) [1] are implemented. Currently, open-source software by Joschka Roffe et al.: [3] is used to construct codes (toric, lifted product and hypergraph product).
  • Apply error correction to quantum circuits.
    • The framework allows to apply different ECC schemes to quantum circuits and either exports the resulting circuits or simulates them using Qiskit [4]. Currently, 6 different ECCs are supported with varying extend of functionality.

Documentation

If you have any questions, feel free to contact us via quantum.cda@xcit.tum.de or by creating an issue on GitHub.

Getting Started

QECC is available via PyPI for Linux, macOS, and Windows.

(venv) $ pip install mqt.qecc

The following code gives an example on the usage:

Example for decoding quantum LDPC codes

from mqt.qecc import *
import numpy as np

H = [
    [1, 0, 0, 1, 0, 1, 1],
    [0, 1, 0, 1, 1, 0, 1],
    [0, 0, 1, 0, 1, 1, 1]
]
code = Code(H, H)
decoder = UFHeuristic()
decoder.set_code(code)
x_err = sample_iid_pauli_err(code.N, 0.05)
decoder.decode(code.get_x_syndrome(x_err))
result = decoder.result
print(result)
residual_err = np.array(x_err) ^ np.array(result.estimate)
print(code.is_x_stabilizer(residual_err))

Example for applying error correction to a circuit

from mqt import qecc

file = "path/to/qasm/file.qasm"  # Path to the OpenQASM file the quantum circuit shall be loaded from
ecc = "Q7Steane"  # Error correction code that shall be applied to the quantum circuit
ecc_frequency = 100  # After how many times a qubit is used, error correction is applied

result = qecc.apply_ecc(file, ecc, ecc_frequency)

# print the resulting circuit as OpenQASM string
print(result["circ"])

A wrapper script for applying error correction to quantum circuits (provided as OpenQASM) and performing a noise-aware quantum circuit simulation (using Qiskit) is provided. The script can be used like this:

$ (venv) ecc_qiskit_wrapper -ecc Q7Steane -fq 100 -m D -p 0.0001 -n 2000 -fs aer_simulator_stabilizer -s 0 -f  ent_simple1000_n2.qasm
_____Trying to simulate with D (prob=0.0001, shots=2000, n_qubits=17, error correction=Q7Steane) Error______
State |00> probability 0.515
State |01> probability 0.0055
State |10> probability 0.0025
State |11> probability 0.477

Detailed documentation on all available methods, options, and input formats is available at ReadTheDocs.

System Requirements and Building

The implementation is compatible with any C++17 compiler and a minimum CMake version of 3.19. Please refer to the documentation on how to build the project.

Building (and running) is continuously tested under Linux, macOS, and Windows using the latest available system versions for GitHub Actions.

Reference

If you use our tool for your research, we will be thankful if you refer to it by citing the appropriate publication:

T. Grurl, C. Pichler, J. Fuss and R. Wille, "Automatic Implementation and Evaluation of Error-Correcting Codes for Quantum Computing: An Open-Source Framework for Quantum Error-Correction," in International Conference on VLSI Design and International Conference on Embedded Systems (VLSID), 2023

a L. Berent, L. Burgholzer, and R. Wille, "Software Tools for Decoding Quantum Low-Density Parity Check Codes," in Asia and South Pacific Design Automation Conference (ASP-DAC), 2023

Metadata

Release files for mqt.qecc 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mqt.qecc 1.2.1
File Size Uploaded Provenance Actions
mqt.qecc-1.2.1.tar.gz 1.8 MB Without provenance Details for mqt.qecc-1.2.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for mqt.qecc 1.2.1
File Actions
mqt.qecc-1.2.1-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details for mqt.qecc-1.2.1-cp311-cp311-manylinux_2_28_x86_64.whl
mqt.qecc-1.2.1-cp311-cp311-macosx_10_15_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.15+ x86-64 Details for mqt.qecc-1.2.1-cp311-cp311-macosx_10_15_x86_64.whl
mqt.qecc-1.2.1-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details for mqt.qecc-1.2.1-cp310-cp310-manylinux_2_28_x86_64.whl
mqt.qecc-1.2.1-cp310-cp310-macosx_10_15_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.15+ x86-64 Details for mqt.qecc-1.2.1-cp310-cp310-macosx_10_15_x86_64.whl
mqt.qecc-1.2.1-cp39-cp39-manylinux_2_28_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.28+ x86-64 Details for mqt.qecc-1.2.1-cp39-cp39-manylinux_2_28_x86_64.whl
mqt.qecc-1.2.1-cp39-cp39-macosx_10_15_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.15+ x86-64 Details for mqt.qecc-1.2.1-cp39-cp39-macosx_10_15_x86_64.whl
mqt.qecc-1.2.1-cp38-cp38-manylinux_2_28_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.28+ x86-64 Details for mqt.qecc-1.2.1-cp38-cp38-manylinux_2_28_x86_64.whl
mqt.qecc-1.2.1-cp38-cp38-macosx_10_15_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.15+ x86-64 Details for mqt.qecc-1.2.1-cp38-cp38-macosx_10_15_x86_64.whl
mqt.qecc-1.2.1-cp37-cp37m-manylinux_2_28_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.28+ x86-64 Details for mqt.qecc-1.2.1-cp37-cp37m-manylinux_2_28_x86_64.whl
mqt.qecc-1.2.1-cp37-cp37m-macosx_10_15_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.15+ x86-64 Details for mqt.qecc-1.2.1-cp37-cp37m-macosx_10_15_x86_64.whl

Total release size: 112.3 MB

Release files / mqt.qecc-1.2.1.tar.gz

Download URL mqt.qecc-1.2.1.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
c4cde7179a8ac20e8722d266e9af079abb196befba7fedb17f5779163f31cf8a
BLAKE2b-256 checksum
How to use checksums
c04e00a3bba767ef7ebf803013d1743fac48380daac4fe9657084820a01396c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / mqt.qecc-1.2.1-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL mqt.qecc-1.2.1-cp311-cp311-manylinux_2_28_x86_64.whl
Size 17.7 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
325b3d943494377f2e21255adc63ba46a4439aedd636a7f67cedb8b37d6b1f65
BLAKE2b-256 checksum
How to use checksums
5e3785f84414d449b8eff19c2dfcd7cf0b618c6545a4546b5f51fb3fa983b933
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / mqt.qecc-1.2.1-cp311-cp311-macosx_10_15_x86_64.whl

Download URL mqt.qecc-1.2.1-cp311-cp311-macosx_10_15_x86_64.whl
Size 4.4 MB
Tags CPython 3.11 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
a8aaf1c12ecf1167b876f2b86455b845b7d3ce80a0453bb7961e4b8bd203351a
BLAKE2b-256 checksum
How to use checksums
18155e6ab47336af37646e889b7b59dd838d5d6285d99b12dfcfc50531d5a010
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / mqt.qecc-1.2.1-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL mqt.qecc-1.2.1-cp310-cp310-manylinux_2_28_x86_64.whl
Size 17.7 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
ee214a3984fcbb307b9d6c123e6557b3e303ce5db4a895da5f6e798735bc5a2d
BLAKE2b-256 checksum
How to use checksums
eba4c4c2825fe0dc52d99f6082bbca835eef31a27c2065de5cf45f645609c176
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / mqt.qecc-1.2.1-cp310-cp310-macosx_10_15_x86_64.whl

Download URL mqt.qecc-1.2.1-cp310-cp310-macosx_10_15_x86_64.whl
Size 4.4 MB
Tags CPython 3.10 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
82d8767ce508492f088aead0663f3cbc2dc9b81f21e29cd1b15b14b8ee989346
BLAKE2b-256 checksum
How to use checksums
b416ddcf2bebd7e68aa47d2a5a99667b46e8f3dbc7cb041e8579ea40b72a663b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / mqt.qecc-1.2.1-cp39-cp39-manylinux_2_28_x86_64.whl

Download URL mqt.qecc-1.2.1-cp39-cp39-manylinux_2_28_x86_64.whl
Size 17.7 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
fc21c4d02572f2b513c4fce4d5e8ec50bafd621234e5ebc2c3253c0b114cc14e
BLAKE2b-256 checksum
How to use checksums
6eec636ea087157523432e45cfe45727072737978f340bd366d64f3ee37e0efc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / mqt.qecc-1.2.1-cp39-cp39-macosx_10_15_x86_64.whl

Download URL mqt.qecc-1.2.1-cp39-cp39-macosx_10_15_x86_64.whl
Size 4.4 MB
Tags CPython 3.9 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
50711064311b031f6eaa9c06a875cec37ec1c6e5d409beed17c73167b9bf419e
BLAKE2b-256 checksum
How to use checksums
b17449d6ea9428538eeb7f0b18952c6c26fe57b2a75120f7a6d09ea72299c4d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / mqt.qecc-1.2.1-cp38-cp38-manylinux_2_28_x86_64.whl

Download URL mqt.qecc-1.2.1-cp38-cp38-manylinux_2_28_x86_64.whl
Size 17.7 MB
Tags CPython 3.8 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
af9064d77d5198e365907f95a80280c58e53e5b0cc86f6bb73cb67f1f4c039ba
BLAKE2b-256 checksum
How to use checksums
dca7b3f47295ea02ad53e17e01d01c94a28ee5ceb5339641c24fd07b3d016b1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / mqt.qecc-1.2.1-cp38-cp38-macosx_10_15_x86_64.whl

Download URL mqt.qecc-1.2.1-cp38-cp38-macosx_10_15_x86_64.whl
Size 4.4 MB
Tags CPython 3.8 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
7c630bb54e86db61c8c9ea122412f223db96444e4508c96c5c8d84342661567c
BLAKE2b-256 checksum
How to use checksums
7a5ad04fba79347060ab6430c92406b9c002ae92f0ce80cc6fed31056d9a489e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / mqt.qecc-1.2.1-cp37-cp37m-manylinux_2_28_x86_64.whl

Download URL mqt.qecc-1.2.1-cp37-cp37m-manylinux_2_28_x86_64.whl
Size 17.7 MB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9566bd4f30ffe2ac898271a8d3d486569c16e390ec2cd358eb93db2d575f3ed0
BLAKE2b-256 checksum
How to use checksums
17329640151df29fd8aa79e6a7d2e73ef6b1c2280e7c29b5846e8e2f80eeb9b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Release files / mqt.qecc-1.2.1-cp37-cp37m-macosx_10_15_x86_64.whl

Download URL mqt.qecc-1.2.1-cp37-cp37m-macosx_10_15_x86_64.whl
Size 4.4 MB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
5c9ff2a853034f3cad55c022709af0ffb7f8da128dd9c755a5e5296b7d2fc532
BLAKE2b-256 checksum
How to use checksums
782aa1da3d5425175877f58d2baba6a543d737804f4bcacde18a2071782d5819
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.1

Security for mqt.qecc 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page