Skip to main content

License: MIT CI Python CI Bindings codecov

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

:warning: 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.0

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.0
File Size Uploaded Provenance Actions
mqt.qecc-1.2.0.tar.gz 1.8 MB Without provenance Details for mqt.qecc-1.2.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for mqt.qecc 1.2.0
File Actions
mqt.qecc-1.2.0-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.0-cp311-cp311-manylinux_2_28_x86_64.whl
mqt.qecc-1.2.0-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.0-cp311-cp311-macosx_10_15_x86_64.whl
mqt.qecc-1.2.0-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.0-cp310-cp310-manylinux_2_28_x86_64.whl
mqt.qecc-1.2.0-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.0-cp310-cp310-macosx_10_15_x86_64.whl
mqt.qecc-1.2.0-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.0-cp39-cp39-manylinux_2_28_x86_64.whl
mqt.qecc-1.2.0-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.0-cp39-cp39-macosx_10_15_x86_64.whl
mqt.qecc-1.2.0-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.0-cp38-cp38-manylinux_2_28_x86_64.whl
mqt.qecc-1.2.0-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.0-cp38-cp38-macosx_10_15_x86_64.whl
mqt.qecc-1.2.0-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.0-cp37-cp37m-manylinux_2_28_x86_64.whl
mqt.qecc-1.2.0-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.0-cp37-cp37m-macosx_10_15_x86_64.whl

Total release size: 112.3 MB

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

Download URL mqt.qecc-1.2.0.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
195686b485613db95839139f848408fb176371dd0717119b5e42534b922798b8
BLAKE2b-256 checksum
How to use checksums
ae8ef2b8f0fbcbc162c6410a17b00e9df2b1df54164f640d4aab86d0798d1090
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.0-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL mqt.qecc-1.2.0-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
e00869ef6de5dfc71bb9729b452d5cc7de12ecb740568dea84435659ad97dfec
BLAKE2b-256 checksum
How to use checksums
c885f9b8c1e6e8a167b0827c74288f8eb2714d27ec22c2dc25dbd5e768f328c3
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.0-cp311-cp311-macosx_10_15_x86_64.whl

Download URL mqt.qecc-1.2.0-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
6cb61acac1714660a2d5631b0a1f465d39fcb5fdc774e5658378b480b0f699a0
BLAKE2b-256 checksum
How to use checksums
8f1470003930a992cea2e2d36e26ce761240769adb0121982c4f8e86ba0dc4c3
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.0-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL mqt.qecc-1.2.0-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
06da10cf7f8fc20ae9b43f114b8fc1a1030954bd612a534fa006e2cb9b36c171
BLAKE2b-256 checksum
How to use checksums
1e084be57137dbd0a7253e9f2d84c84edf48a7c9e9ea6b7fa23812bec995ae2a
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.0-cp310-cp310-macosx_10_15_x86_64.whl

Download URL mqt.qecc-1.2.0-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
130aad3493906dfc9741f7b3e7517b9207fcfcde34d61bf469ec2929d66a98dd
BLAKE2b-256 checksum
How to use checksums
5649cf734e784e6351114d1314eac4c02b761cbfe493e8471be211ebfa9818f4
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.0-cp39-cp39-manylinux_2_28_x86_64.whl

Download URL mqt.qecc-1.2.0-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
0f6903eb7fccbfd98e4775be45bdfe4c9c7cbb35a6c2a66fab253732a75ada22
BLAKE2b-256 checksum
How to use checksums
bb17bd0795338ea8b8f7ed0d50560c458350921da379f1d1ead87e283658ff27
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.0-cp39-cp39-macosx_10_15_x86_64.whl

Download URL mqt.qecc-1.2.0-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
d093dde6ab5ef7fff19f6beca0a995531c03844cf0d73f78aced32a2f2a7aaa5
BLAKE2b-256 checksum
How to use checksums
1765ba663c1ce180d81d10a0d4bf492fc6bf96ee8970b8167390a684f96be888
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.0-cp38-cp38-manylinux_2_28_x86_64.whl

Download URL mqt.qecc-1.2.0-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
723d524aa4725c2c7de2e0a580026cfa37c1ab51b1bb7391d678bcc7ed7dae1d
BLAKE2b-256 checksum
How to use checksums
a3d9bb2d5aa9cfc22507d08b6de25e171072786db878ecce9935c7cc9c8efb76
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.0-cp38-cp38-macosx_10_15_x86_64.whl

Download URL mqt.qecc-1.2.0-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
d4653be9622d62684ce23517b753cefdba29fdf26b6aadae21a7d62599678dda
BLAKE2b-256 checksum
How to use checksums
6d853614a6b1d7f9a906fbada48e3d6a5a38f1d966991c478bede0b4d6198358
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.0-cp37-cp37m-manylinux_2_28_x86_64.whl

Download URL mqt.qecc-1.2.0-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
698ddf17d8e1254881d76f39aad473cb61b2440911eb34186e21632b9b50b63d
BLAKE2b-256 checksum
How to use checksums
ce6b995f1c74ed1cd2211f373c15424881919d89d682ef2802fb9a990b631bd6
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.0-cp37-cp37m-macosx_10_15_x86_64.whl

Download URL mqt.qecc-1.2.0-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
2226fa5161233f7627d31404ef13e268cf24d4ea94350896e213279484c7754d
BLAKE2b-256 checksum
How to use checksums
e76fcc40b4c0f29c48b3feef1269aaa25f14cd16d054fdf37a1cd52cbb567988
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.0

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