Metadata-Version: 2.1
Name: mqt.qecc
Version: 1.0.2
Summary: MQT QECC - A Tool for Quantum Error Correcting Codes
Author-email: Lucas Berent <lucas.berent@tum.de>
License: MIT License
        
        Copyright (c) 2022 Lucas Berent
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/cda-tum/qecc
Project-URL: Documentation, https://github.com/cda-tum/qecc
Project-URL: Bug Tracker, https://github.com/cda-tum/qecc/issues
Project-URL: Discussions, https://github.com/cda-tum/qecc/discussions
Keywords: MQT,quantum computing,quantum error correction,error-correcting codes,decoding,algorithms
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: C++
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Intended Audience :: Science/Research
Classifier: Natural Language :: English
Classifier: Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Provides-Extra: test
Provides-Extra: coverage
Provides-Extra: docs
Provides-Extra: dev
License-File: LICENSE

[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT)
[![CI](https://img.shields.io/github/workflow/status/cda-tum/qecc/C++?style=flat-square&logo=github&label=c%2B%2B)](https://github.com/cda-tum/qecc/actions/workflows/ci.yml)
[![Python CI](https://img.shields.io/github/workflow/status/cda-tum/qecc/Python?style=flat-square&logo=github&label=python)](https://github.com/cda-tum/qecc/actions/workflows/python-ci.yml)
[![Bindings](https://img.shields.io/github/workflow/status/cda-tum/qecc/Python%20Packaging?style=flat-square&logo=github&label=packaging)](https://github.com/cda-tum/qecc/actions/workflows/deploy.yml)
[![codecov](https://img.shields.io/codecov/c/github/cda-tum/qecc?style=flat-square&logo=codecov)](https://codecov.io/gh/cda-tum/qecc)

# MQT QECC - A 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](https://www.cda.cit.tum.de/) at the [Technical University of Munich](https://www.tum.de/)
based on methods proposed in [[1]](https://arxiv.org/abs/2209.01180). 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]](https://ieeexplore.ieee.org/abstract/document/9682738)
and a heuristic (which improves the runtime of the algorithm) [[1]](https://arxiv.org/abs/2209.01180) are implemented.
Currently, open-source software by Joschka Roffe et
al.: [[3]](https://github.com/quantumgizmos/bias_tailored_qldpc) is used to construct codes (toric, lifted product and
hypergraph product).

<p align="center">
  <a href="https://qecc.readthedocs.io/en/latest/">
  <img width=30% src="https://img.shields.io/badge/documentation-blue?style=for-the-badge&logo=read%20the%20docs" alt="Documentation" />
  </a>
</p>

If you have any questions, feel free to contact us via [quantum.cda@xcit.tum.de](mailto:quantum.cda@xcit.tum.de) or by
creating an issue on [GitHub](https://github.com/cda-tum/qecc/issues).

## Getting Started

QECC is available via [PyPI](https://pypi.org/project/mqt.qecc/) for Linux, macOS, and Windows.

```console
(venv) $ pip install mqt.qecc
```

The following code gives an example on the usage:

```python3
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))
```

**Detailed documentation on all available methods, options, and input formats is available
at [ReadTheDocs](https://qecc.readthedocs.io/en/latest/).**

> **Note**
> Pre-built wheels are not yet available. They will be released soon. In the meantime, follow the instructions below for
> cloning the repository
> and call `pip install --editable .` in the cloned directory to install the Python package.

## System Requirements and Building

The implementation is compatible with any C++17 compiler and a minimum CMake version of 3.14.
Please refer to the [documentation](https://qecc.readthedocs.io/en/latest/) 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](https://github.com/actions/virtual-environments).

## Reference

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

[![a](https://img.shields.io/static/v1?label=arXiv&message=2011.07288&color=inactive&style=flat-square)](https://arxiv.org/abs/2209.01180)
L. Berent, L. Burgholzer, and R.
Wille, "[Software Tools for Decoding Quantum Low-Density Parity Check Codes](https://arxiv.org/abs/2209.01180),"
in Asia and South Pacific Design Automation Conference (ASP-DAC), 2023
