Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Analog information decoding #183

Merged
merged 130 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from 123 commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
f9eb191
init commit
lucasberent Nov 2, 2023
068f2a4
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 2, 2023
43c18bb
add link to raw simulation data
lucasberent Nov 2, 2023
feefba9
Merge remote-tracking branch 'origin/analog-information-decoding' int…
lucasberent Nov 2, 2023
b2c92dd
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 2, 2023
7836157
add bp parameter plots
lucasberent Nov 3, 2023
a53c4bf
Merge remote-tracking branch 'origin/analog-information-decoding' int…
lucasberent Nov 3, 2023
535fe85
adapt readmes
lucasberent Nov 3, 2023
fa22c8d
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 3, 2023
0f8cbb6
rename top module
lucasberent Nov 3, 2023
7edebf8
adapt readme
lucasberent Nov 3, 2023
520a49f
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 3, 2023
8510c48
fix relative imports
lucasberent Nov 3, 2023
25caf4a
Merge remote-tracking branch 'origin/analog-information-decoding' int…
lucasberent Nov 3, 2023
dc6382b
update bp parameter comparisons overview
lucasberent Nov 3, 2023
7b28c6c
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 3, 2023
2c0ea05
fix some mypy issues
lucasberent Nov 8, 2023
637054c
mypy fixes
lucasberent Nov 8, 2023
42f0a3e
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 8, 2023
0819fdd
down to 30 mypy errors
lucasberent Nov 8, 2023
56602d9
fix mypy :)
lucasberent Nov 9, 2023
b0fd8ba
further fixes
lucasberent Nov 9, 2023
3932993
maybe fix mypy
lucasberent Nov 9, 2023
0aae41b
try to make formatter happier
lucasberent Nov 13, 2023
2c1df62
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 13, 2023
c5a20f8
small fixes
lucasberent Nov 13, 2023
1af9236
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 13, 2023
c0ceec5
ignore some ruff type warnings for now
lucasberent Nov 13, 2023
50ea9bf
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 13, 2023
9b69cb6
Merge branch 'main' into analog-information-decoding
burgholzer Nov 14, 2023
f18ebb1
🔧 run pre-commit autoupdate
burgholzer Nov 14, 2023
fe1b22d
⬆️ update ruff configuration
burgholzer Nov 14, 2023
1c47233
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 14, 2023
a9c869f
move tests to proper directory
lucasberent Nov 15, 2023
f825057
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 15, 2023
7f7e560
move readme to doc
lucasberent Nov 15, 2023
9302579
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 15, 2023
60f7024
make ruff happy and readme update
lucasberent Nov 21, 2023
ad2952b
adapt config of mypy and codecov
lucasberent Nov 24, 2023
a1ee2ed
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 24, 2023
009ebe7
fix ruff ignore
lucasberent Nov 24, 2023
46a4d4f
maybe fix rst warnings with code mentions
lucasberent Nov 24, 2023
b7a5161
mypy ignores
lucasberent Nov 24, 2023
9d11b4a
Merge branch 'main' into analog-information-decoding
lucasberent Nov 24, 2023
cbbcbab
remove unnecessary ignores
lucasberent Nov 24, 2023
725fc87
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 24, 2023
995da03
fix codespell issues
lucasberent Nov 24, 2023
34e7092
ignore ser (=syndrome error rate) in codespell
lucasberent Nov 25, 2023
fc20a6c
try fix mypy exclude toml strings
lucasberent Nov 25, 2023
7c548e1
maybe fix precommit improper capitalization warning
lucasberent Nov 25, 2023
b8bb62e
try fix mypy ignore with precommit integration
lucasberent Nov 25, 2023
c371a2a
add atd example script
lucasberent Nov 25, 2023
30c9371
add some atd sim tests
lucasberent Nov 25, 2023
6654194
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 25, 2023
e640041
more tests
lucasberent Nov 25, 2023
4433922
push merges
lucasberent Nov 26, 2023
c1ae230
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 26, 2023
d9bf296
try include test dependencies
lucasberent Nov 29, 2023
49210ee
Merge remote-tracking branch 'origin/analog-information-decoding' int…
lucasberent Nov 29, 2023
cc49dbf
add dependency to .toml
lucasberent Nov 29, 2023
b084dfe
remove abs path
lucasberent Nov 29, 2023
1c251b4
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 29, 2023
b04387c
try to include numba in readthedocs requirements
lucasberent Nov 29, 2023
1985cf2
merge
lucasberent Nov 29, 2023
2082ee3
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 29, 2023
c7db572
readthedocs requirements
lucasberent Nov 29, 2023
ea0f984
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 29, 2023
df20631
try unfix numba
lucasberent Nov 29, 2023
5730641
add numba for docs dependency
lucasberent Nov 29, 2023
8acdb3c
add docs pymatching dependency
lucasberent Nov 29, 2023
fa2c964
try fix some mypy warnings
lucasberent Nov 29, 2023
8a1eb2f
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 29, 2023
fdc9eb2
maybe fix mypy
lucasberent Nov 29, 2023
ffdf285
fix more mypy
lucasberent Nov 30, 2023
520cf35
try fix more mypy
lucasberent Nov 30, 2023
db2a83c
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 30, 2023
6a1f279
fix more mypy
lucasberent Nov 30, 2023
ceeeddc
mypy fixes
lucasberent Nov 30, 2023
06b0ecc
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 30, 2023
3d5f85d
fixing mypy ctd
lucasberent Nov 30, 2023
7e1f4a1
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 30, 2023
f09270f
mypy ctd
lucasberent Nov 30, 2023
aaaf828
refactor AtdSmulator code param passing
lucasberent Nov 30, 2023
986e752
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 30, 2023
76cd150
remove unnecessary file
lucasberent Nov 30, 2023
cf757dc
fix tests
lucasberent Nov 30, 2023
bd79980
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 30, 2023
c1da240
try fix tests
lucasberent Nov 30, 2023
c1304e3
remove file
lucasberent Nov 30, 2023
7d7cf1e
try fix pipeline
lucasberent Nov 30, 2023
cf01a44
try fix tests
lucasberent Nov 30, 2023
101f1ca
fix some tests
lucasberent Nov 30, 2023
1effc0c
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 30, 2023
f46a578
add deprecation warning ignore
lucasberent Nov 30, 2023
3056525
add decode mr test
lucasberent Nov 30, 2023
6180f76
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 30, 2023
f8fc87d
improve tests, add fixtures
lucasberent Dec 1, 2023
8a4645d
commit merge changes
lucasberent Dec 1, 2023
5df5ac1
add some basic tests for single shot simulator
lucasberent Dec 1, 2023
0ea8eb5
fix memory experiment test
lucasberent Dec 3, 2023
0624a6c
mypy stuff
lucasberent Dec 3, 2023
0bec282
add test for run
lucasberent Dec 3, 2023
e69e7c8
🎨 pre-commit fixes
pre-commit-ci[bot] Dec 3, 2023
b009fee
trying to make codecov happy
lucasberent Dec 4, 2023
dfb40b2
Merge branch 'main' into analog-information-decoding
lucasberent Dec 8, 2023
15bdf17
disable numba for ci codecov action
lucasberent Dec 8, 2023
d2f59b2
Merge remote-tracking branch 'origin/analog-information-decoding' int…
lucasberent Dec 8, 2023
dcb759b
add missing dependencies
lucasberent Dec 18, 2023
157a2ef
⬆️ update to latest mqt-core
burgholzer Dec 18, 2023
2f2965f
⬆️ update pre-commit
burgholzer Dec 18, 2023
21333c9
⚗️ try to fix deprecation warning
burgholzer Dec 18, 2023
fcb5359
Merge remote-tracking branch 'origin/analog-information-decoding' int…
burgholzer Dec 18, 2023
d168939
Apply suggestions from code review
burgholzer Dec 18, 2023
9013684
🔧 update ruff config
burgholzer Dec 18, 2023
dd1ec9d
🔧 update noxfile and loosen scikit-build-core requirement
burgholzer Dec 18, 2023
555e61e
🔥 remove unnecessary files
burgholzer Dec 18, 2023
ff3ad6c
✏️ fix indentation
burgholzer Dec 18, 2023
9e50fd7
🔥 remove unnecessary `__init__.py` files
burgholzer Dec 18, 2023
d85a8e7
⬇️ downgrade to prettier 3.1.0
burgholzer Dec 18, 2023
fa3a42c
⬇️ downgrade to cpp-linter 2.7.2
burgholzer Dec 18, 2023
e12483a
🩹 re-add necessary `__init__.py`
burgholzer Dec 18, 2023
f985743
🏷️ use proper `numpy.typing` import
burgholzer Dec 18, 2023
33c3195
mypy ignores and codeql
lucasberent Dec 20, 2023
b7a0718
codeql
lucasberent Dec 20, 2023
1b4e21d
🎨 clean up code
burgholzer Dec 22, 2023
bbfc2c6
⬆️ update mqt-core
burgholzer Dec 22, 2023
83d8323
⬆️ update GitHub actions
burgholzer Dec 22, 2023
b2a1ac5
⬆️ update pre-commit
burgholzer Dec 22, 2023
b95e4b1
🚨 loosen ruff exclusions and fix a couple more warnings
burgholzer Dec 22, 2023
88c7c99
🚨 also lint code construction
burgholzer Dec 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ ignore:
- "**/python"
- "test/**/*"
- "src/mqt/qecc/cc_decoder/plots.py"
- "src/mqt/qecc/analog_information_decoding/utils/data_utils.py"
- "src/mqt/qecc/analog_information_decoding/code_construction/*"

coverage:
range: 60..90
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cpp-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug

- name: Run cpp-linter
uses: cpp-linter/cpp-linter-action@v2
uses: cpp-linter/cpp-linter-action@v2.7.2
id: linter
env:
GITHUB_TOKEN: ${{ github.token }}
Expand Down
27 changes: 10 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ repos:

# Handling unwanted unicode characters
- repo: https://github.com/sirosen/texthooks
rev: 0.6.2
rev: 0.6.3
hooks:
- id: fix-ligatures
- id: fix-smartquotes
Expand All @@ -51,7 +51,7 @@ repos:

# Python linting and formatting using ruff
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
rev: v0.1.8
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -68,27 +68,31 @@ repos:

# Check static types with mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.6.1
rev: v1.7.1
hooks:
- id: mypy
files: ^(src/mqt|test/python)
exclude: "code_construction* | ^data_utils\\.py$"
args: []
additional_dependencies:
- importlib_resources
- numpy
- pytest
- pytest-mock
- ldpc
- bposd
- numba

# Check for spelling
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
args: ["-L", "wille,linz,applys", "--skip", "*.ipynb"]
args: ["-L", "wille,linz,applys,ser", "--skip", "*.ipynb"]

# Clang-format the C++ part of the code base automatically
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.4
rev: v17.0.6
hooks:
- id: clang-format
types_or: [c++, c, cuda]
Expand All @@ -104,7 +108,7 @@ repos:

# Format configuration files with prettier
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
rev: v3.1.0
hooks:
- id: prettier
types_or: [yaml, markdown, html, css, scss, javascript, json]
Expand All @@ -117,14 +121,3 @@ repos:
language: pygrep
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest|Mqt|Tum
exclude: .pre-commit-config.yaml

# Checking sdist validity
- repo: https://github.com/henryiii/check-sdist
rev: v0.1.3
hooks:
- id: check-sdist
args: [--inject-junk]
additional_dependencies:
- scikit-build-core[pyproject]>=0.5.0,<0.6 # TODO: remove upper cap once scikit-build-core is updated
- setuptools-scm>=7
- pybind11>=2.11
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ The tool can be used to:
- The framework allows to apply different QECC schemes to quantum circuits and either exports the resulting
circuits or simulates them using Qiskit [[4]](https://qiskit.org/). 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.

<p align="center">
<a href="https://mqt.readthedocs.io/projects/qecc">
Expand Down Expand Up @@ -132,6 +134,9 @@ Windows support is currently experimental.

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=2311.01328&color=inactive&style=flat-square)](https://arxiv.org/abs/2311.01328)
L. Berent, T. Hillmann, J. Eisert, R. Wille, and J. Roffe, "Analog information decoding of bosonic quantum LDPC codes".

- [![a](https://img.shields.io/static/v1?label=arXiv&message=2303.14237&color=inactive&style=flat-square)](https://arxiv.org/abs/2303.14237)
L. Berent, L. Burgholzer, P.J. Derks, J. Eisert, and R. Wille, "Decoding quantum color codes with MaxSAT".

Expand All @@ -144,3 +149,13 @@ If you use our tool for your research, we will be thankful if you refer to it by
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

## Credits

The authors of this software are:

- Lucas Berent
- Lukas Burgholzer
- Thomas Grurl
- Peter-Jan H.S. Derks
- Timo Hillmann
56 changes: 56 additions & 0 deletions docs/source/AnalogInfo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Analog Information Decoding
===========================
This submodule provides means to conduct decoding simulations for quantum CSS codes with
analog syndrome information as proposed in the corresponding paper :cite:labelpar:`berent2023analog`.
Proper integration and setup is a work in progress.
The main functionality is provided in the :code:`simulators` module, which contains the main classes
that can be used to conduct several types of simulations:

- :code:`ATD_Simulator`: Analog Tanner graph decoding,
- :code:`Single-Shot Simulator`: Analog Single-Shot decoding with meta checks.
- :code:`QSS_Simulator`: Quasi-Single-Shot decoding, and

Moreover, :code:`memory_experiment` contains methods for analog overlapping window decoding, in
particular the :code:`decode_multiround` method.

Results
-------
The :code:`results` directory contains the results used in the paper :cite:labelpar:`berent2023analog`.

Codes
-----

The :code:`codes` directory contains the parity-check matrices of the codes used in the paper :cite:labelpar:`berent2023analog`.
Three dimensional toric codes can either be constructed with the hypergraph product construction
or with a library, e.g., panqec :cite:labelpar:`huang2023panceq`.

Code construction
-----------------

The :code:`code_construction` directory contains the code used to construct higher-dimensional hypergraph
product codes and used the :code:`compute_distances.sh` script to automatically compute bounds on the
distances of the constructed codes using the GAP library QDistRnd :cite:labelpar:`pryadko2023qdistrnd`.

Utils
-----
Here we present an overview of the functionality of the utils package.

Plotting
++++++++
The :code:`plotting` directory contains the code used to plot the results in the paper :cite:labelpar:`berent2023analog`.

Data Utils
++++++++++

We have implemented several utility functions as part of this package that might be of independent
interest for decoding simulations and data analysis. These are provided in the :code:`data_utils` module.

Simulation Utils
++++++++++++++++
This module contains functionality needed throughout different simulation types.

Dependencies
++++++++++++

The used BP+OSD implementation, as well as our implementation of the soft-syndrome minimum-sum decoder are provided
in the ldpc2 package a preliminary beta version of which is available on github :cite:labelpar:`roffe2023ldpc`.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
class CDAStyle(UnsrtStyle):
"""Custom style for including PDF links."""

def format_url(self, _e: Entry) -> HRef:
def format_url(self, _e: Entry) -> HRef: # noqa: PLR6301
"""Format URL field as a link to the PDF."""
url = field("url", raw=True)
return href()[url, "[PDF]"]
Expand Down
32 changes: 32 additions & 0 deletions docs/source/refs.bib
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,35 @@ @article{FowlerSurfaceCodes
doi = {10.1103/PhysRevA.80.052312},
url = {https://link.aps.org/doi/10.1103/PhysRevA.80.052312}
}
@article{berent2023analog,
title={Analog information decoding of bosonic quantum LDPC codes},
author={Berent, Lucas and Hillmann, Timo and Eisert, Jens and Wille, Robert and Roffe, Joschka},
journal={arXiv preprint arXiv:2311.01328},
year={2023}
}
@misc{huang2023panceq,
author = {Huang, Eric and Pesah Arthur},
title = {PanQEC},
year = {2023},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/panqec/panqec}},
commit = {a9dd27e}
}

@misc{roffe2023ldpc,
author = {Roffe Joschka},
title = {LDPC},
year = {2023},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/quantumgizmos/ldpc/tree/ldpc_v2}},
commit = {9fe6d13}
}

@article{pryadko2023qdistrnd,
title={QDistRnd: A GAP package for computing the distance of quantum error-correcting codes},
author={Pryadko, Leonid P and Shabashov, Vadim A and Kozin, Valerii K},
journal={arXiv preprint arXiv:2308.15140},
year={2023}
}
2 changes: 1 addition & 1 deletion extern/mqt-core
Submodule mqt-core updated 215 files
38 changes: 10 additions & 28 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@

PYTHON_ALL_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12"]

BUILD_REQUIREMENTS = [
"scikit-build-core[pyproject]>=0.6.1",
"setuptools_scm>=7",
"pybind11>=2.11",
]

if os.environ.get("CI", None):
nox.options.error_on_missing_interpreters = True

Expand All @@ -27,19 +33,6 @@ def lint(session: nox.Session) -> None:
session.run("pre-commit", "run", "--all-files", *session.posargs)


@nox.session(reuse_venv=True)
def pylint(session: nox.Session) -> None:
"""Run PyLint.

Simply execute `nox -rs pylint` to run PyLint.
"""
session.install(
"scikit-build-core[pyproject]<0.6", "setuptools_scm", "pybind11"
) # TODO: remove upper cap once scikit-build-core is updated
session.install("--no-build-isolation", "-ve.", "pylint")
session.run("pylint", "mqt.qecc", *session.posargs)


def _run_tests(
session: nox.Session,
*,
Expand All @@ -51,21 +44,15 @@ def _run_tests(
env = {"PIP_DISABLE_PIP_VERSION_CHECK": "1"}

if os.environ.get("CI", None) and sys.platform == "win32":
env["SKBUILD_CMAKE_ARGS"] = "-T ClangCL"
env["CMAKE_GENERATOR"] = "Ninja"

_extras = ["test", *extras]
if "--cov" in posargs:
_extras.append("coverage")
posargs.append("--cov-config=pyproject.toml")

session.install(
"scikit-build-core[pyproject]<0.6",
"setuptools_scm",
"pybind11",
*install_args,
env=env,
) # TODO: remove upper cap once scikit-build-core is updated
install_arg = f"-ve.[{','.join(_extras)}]"
session.install(*BUILD_REQUIREMENTS, *install_args, env=env)
install_arg = f".[{','.join(_extras)}]"
session.install("--no-build-isolation", install_arg, *install_args, env=env)
session.run("pytest", *run_args, *posargs, env=env)

Expand Down Expand Up @@ -98,13 +85,8 @@ def docs(session: nox.Session) -> None:
if args.builder != "html" and args.serve:
session.error("Must not specify non-HTML builder with --serve")

build_requirements = [
"scikit-build-core[pyproject]<0.6",
"setuptools_scm",
"pybind11",
] # TODO: remove upper cap once scikit-build-core is updated
extra_installs = ["sphinx-autobuild"] if args.serve else []
session.install(*build_requirements, *extra_installs)
session.install(*BUILD_REQUIREMENTS, *extra_installs)
session.install("--no-build-isolation", "-ve.[docs]")
session.chdir("docs")

Expand Down
Loading
Loading