LiDMaS+ (Logical Injection & Decoding Modeling System) quantum error-correction simulator
Project description
LiDMaS+
Logical Injection & Decoding Modeling System
LiDMaS+ is a C++ research platform for quantum error-correction studies, covering surface-code threshold analysis, hybrid CV-DV (including digitized GKP) noise modeling, and hardware-to-decoder replay benchmarking under a common decoder IO contract. It also includes CSS and LDPC engine paths for comparative studies and supports cross-stack decoder comparability workflows.
Install from PyPI:
python -m pip install --upgrade lidmas
Then run:
lidmas --help
Documentation:
- Lidmas+ Documentation
- Read the Docs mirror is currently unavailable.
Statement of Need
Benchmarking decoder behavior and threshold trends requires reproducible, scriptable, and inspectable simulation pipelines. LiDMaS+ provides:
- deterministic Monte Carlo runs with explicit seed control,
- multiple decoders under a common interface,
- confidence-interval-aware threshold outputs,
- numerous reproducible workflows and scripts across
examples/.
This makes it suitable for method development, reproducibility appendices, and comparative decoder studies.
Core Capabilities
- Surface-code simulation with configurable code distance and trial counts.
- CSS and LDPC demo/threshold workflows via engine switching.
- Decoder plugins:
mwpm,uf,neural_mwpm. - Noise modes:
pauli: sweep logical error rate versus physical Pauli error ratep.hybrid: sweep logical error rate versus CV displacement scalesigmausing GKP digitization.
- Optional threshold analysis tools (crossing estimates and scaling fits).
- Reproducible example suite under
examples/.
Requirements
- C++20 compiler
- CMake >= 3.16
- Optional: OpenMP for parallel threshold runs
- Optional: CUDA toolkit (for GPU-accelerated Pauli surface_threshold sampling)
- Optional (for plots): Python 3 with
matplotlibandpandas
Build
cmake -S . -B build
cmake --build build -j
Primary executable:
build/lidmas
Packaging Notes
- Brand name remains LiDMaS+.
- PyPI package name is
lidmas. - CLI command is
lidmas. - Published wheels are CPU-oriented; CUDA builds are supported from source builds.
Optional CUDA build (Pauli surface_threshold sampling)
cmake -S . -B build -DLIDMAS_ENABLE_CUDA=ON
cmake --build build -j
At runtime, enable with:
./build/lidmas --engine=surface --surface_threshold --mode=pauli --gpu ...
Quick benchmark:
./build/lidmas --gpu_bench
./build/lidmas --gpu_bench_quick
./build/lidmas --gpu_bench_full
Quick Start
Show CLI help:
./build/lidmas --help
Run deterministic smoke test:
./build/lidmas --smoke
Run a Pauli threshold sweep (surface engine):
./build/lidmas --engine=surface --surface_threshold \
--mode=pauli \
--decoder=mwpm \
--d=3,5,7 \
--p_start=0.01 --p_end=0.15 --p_step=0.01 \
--trials=2000 \
--seed=1337 \
--out=surface_threshold.csv
Run a hybrid CV sweep (surface engine):
./build/lidmas --engine=surface --surface_threshold \
--mode=hybrid \
--decoder=mwpm \
--d=3,5,7 \
--sigma_start=0.05 --sigma_end=0.60 --sigma_step=0.05 \
--trials=2000 \
--seed=1337 \
--out=surface_threshold.csv
Run a native GKP sweep (surface engine):
./build/lidmas --engine=surface --surface_threshold \
--mode=gkp \
--decoder=mwpm \
--d=3,5,7 \
--sigma_start=0.05 --sigma_end=0.60 --sigma_step=0.05 \
--gkp_gate=0.0005 --gkp_meas=0.0005 --gkp_idle=0.0002 \
--gkp_loss=0.001 \
--trials=2000 \
--seed=1337 \
--out=gkp_surface_threshold.csv
Neural decoder note:
--decoder=neural_mwpmrequires--neural_model=<path>.- A trained reference model is provided at
examples/decoder_comparison/trained_model.json. - To retrain it, run
python3 examples/decoder_comparison/train_neural_model.py.
CSS engine demo / threshold (experimental):
./build/lidmas --engine=css \
--css_spec=examples/css_codes/steane/spec.yaml
./build/lidmas --engine=css \
--css_repetition=7
./build/lidmas --engine=css \
--css_shor
./build/lidmas --engine=css --css_threshold --mode=pauli --trials=2000 \
--css_spec=examples/css_codes/steane/spec.yaml \
--out=css_threshold.csv
CSS matrix files are dense 0/1 text (space or comma separated). Logical files can include multiple rows.
--css_repetition=<n> builds a bit-flip repetition code automatically (Hx empty, Hz chain).
--css_shor builds the Shor [[9,1,3]] code automatically.
LDPC engine (default):
./build/lidmas --engine=ldpc
Reproducible Examples
The examples/ directory contains ready-to-run scripts for smoke checks,
Pauli/hybrid/GKP thresholds, hardware-integration replay, stack-comparison
benchmarking, scaling workflows, and plotting.
Setup once:
./examples/setup_env.sh
Run a minimal end-to-end check:
bash examples/quick_smoke/run.sh
Generated artifacts are written to:
examples/results/<example_name>/
Output Schema
Threshold CSV output uses:
mode,distance,sigma,pauli_p,trials,ler,ci_low,ci_high,defect_mean,weight_mean,decoder_fail_rate,mwpm_weight_scale,mwpm_graph,timestamp
Validation
For quick validation in local or CI environments:
./build/lidmas --smoke
Hardware Integration
See hardware-integration for the decoder IO schema, recommended data transport, and adapter API.
Xanadu-style job conversion example:
bash hardware_integration/xanadu/run.sh
Aurora/QCA/GKP fixture conversions:
bash hardware_integration/xanadu/run_public_datasets.sh
One-command real-data slice (download + convert + replay):
bash hardware_integration/xanadu/xandau_hardware_data.sh --install-deps
For large real datasets, use converter streaming/chunk flags:
--stream --shot-start <N> --max-shots <K> [--append-out].
Replay converted NDJSON through the C++ adapter:
./build/lidmas --decoder_io_replay \
--decoder_io_in=examples/results/hardware_integration/decoder_requests.ndjson \
--decoder_io_out=examples/results/hardware_integration/decoder_responses.ndjson \
--decoder_io_continue_on_error
Project Layout
include/ # public headers and interfaces
src/ # simulator and decoder implementations
examples/ # reproducible runs and plotting scripts
hardware_integration/ # provider-oriented hardware data ingestion
Release Notes
Detailed release notes and version-specific changes are tracked in Git tags and GitHub Releases.
Citation
If you use LiDMaS+ in academic work, cite the software release used for your experiments (tag + commit hash).
Paper reference (paper_03):
@misc{wayo2026unifiedhardwaretodecoderarchitecturehybrid,
title={A Unified Hardware-to-Decoder Architecture for Hybrid Continuous-Variable and Discrete-Variable Quantum Error Correction in LiDMaS+},
author={Dennis Delali Kwesi Wayo and Chinonso Onah and Leonardo Goliatt and Sven Groppe},
year={2026},
eprint={2604.15389},
archivePrefix={arXiv},
primaryClass={quant-ph},
url={https://arxiv.org/abs/2604.15389}
}
License
This project is released under the MIT License (see LICENSE).
Contributing
Issues and pull requests are welcome. Please include:
- a clear problem statement,
- reproduction steps,
- expected versus observed behavior,
- and, where possible, a minimal test or script.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lidmas-1.2.1.tar.gz.
File metadata
- Download URL: lidmas-1.2.1.tar.gz
- Upload date:
- Size: 3.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f10c53b5c6662e1449910f7c9c4aa31f084f30ab5337652fb07e76069f78627f
|
|
| MD5 |
4c8195d5e528cfb1aa0e85195cc7c176
|
|
| BLAKE2b-256 |
91ed4e3f6741f67a031c8d9a03e3a0f4899aa25787f6eecc1ce59e54c9dda25c
|
Provenance
The following attestation bundles were made for lidmas-1.2.1.tar.gz:
Publisher:
pypi.yml on DennisWayo/lidmas_cpp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lidmas-1.2.1.tar.gz -
Subject digest:
f10c53b5c6662e1449910f7c9c4aa31f084f30ab5337652fb07e76069f78627f - Sigstore transparency entry: 1341668249
- Sigstore integration time:
-
Permalink:
DennisWayo/lidmas_cpp@1e394cc8700b63e2a645e1b09063a1ddffb5e655 -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/DennisWayo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@1e394cc8700b63e2a645e1b09063a1ddffb5e655 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lidmas-1.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: lidmas-1.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 468.2 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ed7c228735ed9d38a8f23f04834698ea0f15900eed1aa2a9e4fdac6ee9fcb97
|
|
| MD5 |
5e625cedc2f7a99e152a89cc74ddedb9
|
|
| BLAKE2b-256 |
ef1bd735e7cb4816218e52d5490d086aafff61302c4e08d1b4462cd2a63802e6
|
Provenance
The following attestation bundles were made for lidmas-1.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
pypi.yml on DennisWayo/lidmas_cpp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lidmas-1.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
1ed7c228735ed9d38a8f23f04834698ea0f15900eed1aa2a9e4fdac6ee9fcb97 - Sigstore transparency entry: 1341668271
- Sigstore integration time:
-
Permalink:
DennisWayo/lidmas_cpp@1e394cc8700b63e2a645e1b09063a1ddffb5e655 -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/DennisWayo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@1e394cc8700b63e2a645e1b09063a1ddffb5e655 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lidmas-1.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: lidmas-1.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 468.2 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c3160b0defbd3c17c0a0d3df69273de94811c895dfd96b91d1219dee8c05906
|
|
| MD5 |
1064b818dda9607257b5aab77e07db93
|
|
| BLAKE2b-256 |
9cab2a2ae1d928354f7f0af60988c9eb63b6a4919377672651469808eff34d2b
|
Provenance
The following attestation bundles were made for lidmas-1.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
pypi.yml on DennisWayo/lidmas_cpp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lidmas-1.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
9c3160b0defbd3c17c0a0d3df69273de94811c895dfd96b91d1219dee8c05906 - Sigstore transparency entry: 1341668257
- Sigstore integration time:
-
Permalink:
DennisWayo/lidmas_cpp@1e394cc8700b63e2a645e1b09063a1ddffb5e655 -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/DennisWayo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@1e394cc8700b63e2a645e1b09063a1ddffb5e655 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lidmas-1.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: lidmas-1.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 468.2 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a2924c257d5e3914c5f10c2e8ab90d3c546a15ae2d8279a3365275bda7d48d9
|
|
| MD5 |
17c5fa21d29cb6256d9ab65aa0b2eceb
|
|
| BLAKE2b-256 |
7b4b4a381a8bdfc5b0189f1f959381b4cf15dc74cb0b2508eb499ff367d7b639
|
Provenance
The following attestation bundles were made for lidmas-1.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
pypi.yml on DennisWayo/lidmas_cpp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lidmas-1.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
3a2924c257d5e3914c5f10c2e8ab90d3c546a15ae2d8279a3365275bda7d48d9 - Sigstore transparency entry: 1341668264
- Sigstore integration time:
-
Permalink:
DennisWayo/lidmas_cpp@1e394cc8700b63e2a645e1b09063a1ddffb5e655 -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/DennisWayo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@1e394cc8700b63e2a645e1b09063a1ddffb5e655 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lidmas-1.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: lidmas-1.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 468.2 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a19f990dfd618ca477b8badd0da78df330b4787f2a07bf3d5349fc606df1455
|
|
| MD5 |
ba9b20c140c5cee54686104863e53466
|
|
| BLAKE2b-256 |
ae9013f7f7ccce97c64b6ef6a4873225ac6730e2e1896ba975540c69ab1f3915
|
Provenance
The following attestation bundles were made for lidmas-1.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
pypi.yml on DennisWayo/lidmas_cpp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lidmas-1.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
5a19f990dfd618ca477b8badd0da78df330b4787f2a07bf3d5349fc606df1455 - Sigstore transparency entry: 1341668278
- Sigstore integration time:
-
Permalink:
DennisWayo/lidmas_cpp@1e394cc8700b63e2a645e1b09063a1ddffb5e655 -
Branch / Tag:
refs/tags/v1.2.1 - Owner: https://github.com/DennisWayo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@1e394cc8700b63e2a645e1b09063a1ddffb5e655 -
Trigger Event:
push
-
Statement type: