Skip to main content

PyPI OS License: MIT CI CD Documentation codecov

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

A tool for quantum error correcting codes and numerical simulations developed as part of the Munich Quantum Toolkit (MQT) by the Chair for Design Automation at the Technical University of Munich. It builds upon MQT Core, which forms the backbone of the 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).
  • Decode (triangular) color codes and conduct respective numerical simulations.
    • The decoder is based on an analogy to the classical LightsOut puzzle and formulated as a MaxSAT problem. The SMT solver Z3 is used to determine minimal solutions of the MaxSAT problem, resulting in minimum-weight decoding estimates.
  • Apply error correction to quantum circuits.
    • The framework allows to apply different QECC schemes to quantum circuits and either exports the resulting circuits or simulates them using Qiskit [4]. Currently, six different ECCs are supported with varying extent of functionality.
  • WIP: Decode bosonic quantum LDPC codes and conduct numerical simulations for analog information decoding under phenomenological (cat qubit) noise.

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 and macOS and supports Python 3.8 to 3.12.

(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 decoding color codes

Simply running the following code will perform a numerical analysis of the MaxSAT color code decoder for an instance of the distance-21 triangular color code with a bit-flip error rate of 0.01 and 1000 simulations.

from mqt.qecc.cc_decoder import decoder

d = 21  # distance of the triangular code to simulate
p = 0.01  # (bit-flip) error rate
nr_sims = 1000  # number of simulations to run
decoder.run(distance=d, error_rate=p, nr_sims=nr_sims)

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 and macOS using the latest available system versions for GitHub Actions. Windows support is currently experimental.

Reference

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

  • a L. Berent, T. Hillmann, J. Eisert, R. Wille, and J. Roffe, "Analog information decoding of bosonic quantum LDPC codes".

  • a L. Berent, L. Burgholzer, P.J. Derks, J. Eisert, and R. Wille, "Decoding quantum color codes with MaxSAT".

    The dataset used in the paper evaluation on decoding quantum color codes is available on Zenodo: a

  • a 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

Credits

The contributors to this tool are:

  • Lucas Berent
  • Lukas Burgholzer
  • Thomas Grurl
  • Peter-Jan H.S. Derks
  • Timo Hillmann

Acknowledgements

The Munich Quantum Toolkit has been supported by the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation program (grant agreement No. 101001318), the Bavarian State Ministry for Science and Arts through the Distinguished Professorship Program, as well as the Munich Quantum Valley, which is supported by the Bavarian state government with funds from the Hightech Agenda Bayern Plus.

TUM Logo Coat of Arms of Bavaria ERC Logo MQV Logo

Metadata

Release files for mqt.qecc 1.6.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.6.0
File Size Uploaded Provenance Actions
mqt_qecc-1.6.0.tar.gz 487.5 kB Without provenance Details for mqt_qecc-1.6.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for mqt.qecc 1.6.0
File Actions
mqt_qecc-1.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details for mqt_qecc-1.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
mqt_qecc-1.6.0-cp312-cp312-macosx_11_0_x86_64.whl CPython 3.12 CPython 3.12 macOS 11.0+ x86-64 Details for mqt_qecc-1.6.0-cp312-cp312-macosx_11_0_x86_64.whl
mqt_qecc-1.6.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for mqt_qecc-1.6.0-cp312-cp312-macosx_11_0_arm64.whl
mqt_qecc-1.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details for mqt_qecc-1.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
mqt_qecc-1.6.0-cp311-cp311-macosx_11_0_x86_64.whl CPython 3.11 CPython 3.11 macOS 11.0+ x86-64 Details for mqt_qecc-1.6.0-cp311-cp311-macosx_11_0_x86_64.whl
mqt_qecc-1.6.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for mqt_qecc-1.6.0-cp311-cp311-macosx_11_0_arm64.whl
mqt_qecc-1.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details for mqt_qecc-1.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
mqt_qecc-1.6.0-cp310-cp310-macosx_11_0_x86_64.whl CPython 3.10 CPython 3.10 macOS 11.0+ x86-64 Details for mqt_qecc-1.6.0-cp310-cp310-macosx_11_0_x86_64.whl
mqt_qecc-1.6.0-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for mqt_qecc-1.6.0-cp310-cp310-macosx_11_0_arm64.whl
mqt_qecc-1.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details for mqt_qecc-1.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
mqt_qecc-1.6.0-cp39-cp39-macosx_11_0_x86_64.whl CPython 3.9 CPython 3.9 macOS 11.0+ x86-64 Details for mqt_qecc-1.6.0-cp39-cp39-macosx_11_0_x86_64.whl
mqt_qecc-1.6.0-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details for mqt_qecc-1.6.0-cp39-cp39-macosx_11_0_arm64.whl
mqt_qecc-1.6.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details for mqt_qecc-1.6.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
mqt_qecc-1.6.0-cp38-cp38-macosx_11_0_x86_64.whl CPython 3.8 CPython 3.8 macOS 11.0+ x86-64 Details for mqt_qecc-1.6.0-cp38-cp38-macosx_11_0_x86_64.whl
mqt_qecc-1.6.0-cp38-cp38-macosx_11_0_arm64.whl CPython 3.8 CPython 3.8 macOS 11.0+ ARM64 Details for mqt_qecc-1.6.0-cp38-cp38-macosx_11_0_arm64.whl

Total release size: 138.3 MB

Release files / mqt_qecc-1.6.0.tar.gz

Download URL mqt_qecc-1.6.0.tar.gz
Size 487.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0e58f876f7704836f99900926514f6b5dbb738c2f3e3fdf655097abb352b0a55
BLAKE2b-256 checksum
How to use checksums
76974827111e87a01386386e561f389346313cf11fc627e67301a1fa39be5e3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / mqt_qecc-1.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL mqt_qecc-1.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 18.6 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
caa7a71928cced3718edb3340778de159c8961ccf12dc6a1d5dbad4875546183
BLAKE2b-256 checksum
How to use checksums
07bd6af8d05b1d6ff6aedc58a2f9cb67b63891fca38140ff53e8c033041da1df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / mqt_qecc-1.6.0-cp312-cp312-macosx_11_0_x86_64.whl

Download URL mqt_qecc-1.6.0-cp312-cp312-macosx_11_0_x86_64.whl
Size 4.9 MB
Tags CPython 3.12 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
7a8b7eb8751674951c4c5892c57c9e996de8cda679293b8bc2b8b5c0b2397003
BLAKE2b-256 checksum
How to use checksums
74dfba193a5dcf623c9c411fd63129c3dbb2a6971e034025a59a3109c98d9d54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / mqt_qecc-1.6.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL mqt_qecc-1.6.0-cp312-cp312-macosx_11_0_arm64.whl
Size 4.1 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3f3395da98b5726a278105fa3703190d727477f379fec2529b2e418eef78eee3
BLAKE2b-256 checksum
How to use checksums
a396bffc08e3ee626e45953613e4995eb5f06ae2795064c3c212e39ea7a0708b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / mqt_qecc-1.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL mqt_qecc-1.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 18.6 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
3df9f414d8844e787b38363164c1a14443b00f10100dbd532f8918fca68c6a01
BLAKE2b-256 checksum
How to use checksums
e9bb4651ded0f27d53ba3c0bf16b32ef345292c95a7998fe9486c55e1f5f779e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / mqt_qecc-1.6.0-cp311-cp311-macosx_11_0_x86_64.whl

Download URL mqt_qecc-1.6.0-cp311-cp311-macosx_11_0_x86_64.whl
Size 4.8 MB
Tags CPython 3.11 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
4c09fae56ee8265ad23fab0903e901b735234deef1c1d64f0fbe0b265575cc4c
BLAKE2b-256 checksum
How to use checksums
b0dcde3aa052e9486bf5277dc1e2a80e0d85b9227c998ae8ca3251d6f1997df0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / mqt_qecc-1.6.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL mqt_qecc-1.6.0-cp311-cp311-macosx_11_0_arm64.whl
Size 4.1 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
50db6b6db84b9d876b1a8e202ea0ee952af9cbc8d17c756ea52ce042e0becc9f
BLAKE2b-256 checksum
How to use checksums
33ac2b11205ba9baf5cccc0477a1da1b8a7e0110e07913b5df6bc4537f3687ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / mqt_qecc-1.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL mqt_qecc-1.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 18.6 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
fdab099179fbda8617d31c089ca453c920af909b8f2197ee19d0ca969bfae79c
BLAKE2b-256 checksum
How to use checksums
732320bcf2054bc1d19579ec219daa344591b88881bf011d3316756a17a626c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / mqt_qecc-1.6.0-cp310-cp310-macosx_11_0_x86_64.whl

Download URL mqt_qecc-1.6.0-cp310-cp310-macosx_11_0_x86_64.whl
Size 4.8 MB
Tags CPython 3.10 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
5bef54faf45e782f309a593611059e958c5700ce975947ec073834078023cec1
BLAKE2b-256 checksum
How to use checksums
f6dae4e00d607518401933ada08342de7bc06e55c86682c288e1721e59942c65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / mqt_qecc-1.6.0-cp310-cp310-macosx_11_0_arm64.whl

Download URL mqt_qecc-1.6.0-cp310-cp310-macosx_11_0_arm64.whl
Size 4.1 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
24eb1c94823de75c2c48eeb439883aac5882c02cb3aae7c626c18c4f8bddf152
BLAKE2b-256 checksum
How to use checksums
c68fcc4beaf7ef9263edfe5b21443e588e3d0322deccb451aaefd18668b569a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / mqt_qecc-1.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL mqt_qecc-1.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 18.6 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
a2e9e2733ddc7ebb095732f9ab3021bd0835b99bfd24694eb7b943a9caac1edf
BLAKE2b-256 checksum
How to use checksums
5f8ccbc6f052c6cafbad1b01c4b6b282cea30a38f50f242e560091f81f769adc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / mqt_qecc-1.6.0-cp39-cp39-macosx_11_0_x86_64.whl

Download URL mqt_qecc-1.6.0-cp39-cp39-macosx_11_0_x86_64.whl
Size 4.8 MB
Tags CPython 3.9 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
7cf74717d1b3b4ea4bda4913526895f645db7ab4fafeadbdbaace3a9b336cfb0
BLAKE2b-256 checksum
How to use checksums
a3b63e3565b543200888d345b968662e16e94d8d1390dcc79b91fc19d7e89b3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / mqt_qecc-1.6.0-cp39-cp39-macosx_11_0_arm64.whl

Download URL mqt_qecc-1.6.0-cp39-cp39-macosx_11_0_arm64.whl
Size 4.1 MB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7c33021e35ea9a24a5662351da69bcffc56916a8c3bb5a0e32563288623e6cd4
BLAKE2b-256 checksum
How to use checksums
69ccc612cc6d68922ba769e4cd3e6bc8c3dc92d90d7d90fa57b3546d279e7e75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / mqt_qecc-1.6.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL mqt_qecc-1.6.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 18.6 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
01bd19ddd47490e1dc8a2aa1d349329d994889d4e71e763f1fe2ff158e137d45
BLAKE2b-256 checksum
How to use checksums
d5201673a4e3613679eaa18ce667ab165231f0aebbcb3d5d05357afacd07b6fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / mqt_qecc-1.6.0-cp38-cp38-macosx_11_0_x86_64.whl

Download URL mqt_qecc-1.6.0-cp38-cp38-macosx_11_0_x86_64.whl
Size 4.8 MB
Tags CPython 3.8 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
43167457acf7cd5d7e645747f80f3c16b9d57869b48688e2a8efe6ce66f38369
BLAKE2b-256 checksum
How to use checksums
dcee3d7816fd9a19b30ee8c72fa8e6bcb5b6f5980711f3c2eacddb7578fa41b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / mqt_qecc-1.6.0-cp38-cp38-macosx_11_0_arm64.whl

Download URL mqt_qecc-1.6.0-cp38-cp38-macosx_11_0_arm64.whl
Size 4.1 MB
Tags CPython 3.8 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ec724c397b8c4e77ec54c68dd2a84a5451db0e078fa890cfd585c6cd37750c97
BLAKE2b-256 checksum
How to use checksums
b34099247ad94fce4d687fea7827594385b17ec0db4bafc10477278859508ef0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Security for mqt.qecc 1.6.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