Skip to main content

LiDMaS+ (Logical Injection & Decoding Modeling System) quantum error-correction simulator

Project description

LiDMaS+

Logical Injection & Decoding Modeling System

LiDMaS+ is a C++ research simulator for quantum error-correction studies, with surface-code threshold experiments under discrete Pauli noise and hybrid continuous-variable (CV)-discrete noise models as the primary workflow. It also includes CSS and LDPC engine paths for comparative studies.

Install from PyPI:

python -m pip install --upgrade lidmas

Then run:

lidmas --help

Documentation:

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 rate p.
    • hybrid: sweep logical error rate versus CV displacement scale sigma using 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 matplotlib and pandas

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_mwpm requires --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 thresholds, scaling workflows, decoder comparison, 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_01):

paper_01 graphic

@misc{wayo2026decoder,
  title={Decoder Performance in Hybrid CV-Discrete Surface-Code Threshold Estimation Using LiDMaS+},
  author={Dennis Delali Kwesi Wayo and Chinonso Onah and Vladimir Milchakov and Leonardo Goliatt and Sven Groppe},
  year={2026},
  eprint={2603.06730},
  archivePrefix={arXiv},
  primaryClass={quant-ph},
  url={https://arxiv.org/abs/2603.06730}
}

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lidmas-1.2.0.tar.gz (337.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

lidmas-1.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (468.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

lidmas-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (468.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

lidmas-1.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (468.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

lidmas-1.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (468.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

Details for the file lidmas-1.2.0.tar.gz.

File metadata

  • Download URL: lidmas-1.2.0.tar.gz
  • Upload date:
  • Size: 337.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lidmas-1.2.0.tar.gz
Algorithm Hash digest
SHA256 469f89591503b9d2678c07caa4d7eb881b184e05549b1a2043f086f6e5a3da30
MD5 51a58ac124696d65d4e37dc3b42b90ec
BLAKE2b-256 3dabffed5b53c33a6b2069daab51b8b4dad52d97125867c93f56401931b89a78

See more details on using hashes here.

Provenance

The following attestation bundles were made for lidmas-1.2.0.tar.gz:

Publisher: pypi.yml on DennisWayo/lidmas_cpp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lidmas-1.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lidmas-1.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f5cf5497553132f1c8b4507b510ba639a130dfca82b78bd29e25bd7fa1e833a5
MD5 1bbf737700aaa6f3de428e6ad3e5f9e3
BLAKE2b-256 3ff95f2784500f5ff47bc6fee2e46debf991c3f17e81c03f2dcdee49100a26d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for lidmas-1.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi.yml on DennisWayo/lidmas_cpp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lidmas-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lidmas-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bdb94b4a5f1e9c2958282054c267d13e23322d0d825bfbd835e435c6e35736c4
MD5 4de8ca7f0c16c038511e60f1d3b00de3
BLAKE2b-256 b00e1ffcc4d03fa6b8f07f93e66545f316afc2e9f7c8c34383777814e8a2e6c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for lidmas-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi.yml on DennisWayo/lidmas_cpp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lidmas-1.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lidmas-1.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f79adf0eca9b9ae08601f430c2e72396248e9d48dd3511cfbbd1befa7b6e687b
MD5 f87666ca56a6f50fb3529008aaf7b779
BLAKE2b-256 48bbdc3cc595ffeed4c8c9ed39b7793c1c63b4cc947180dc392e202d1f1d3664

See more details on using hashes here.

Provenance

The following attestation bundles were made for lidmas-1.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi.yml on DennisWayo/lidmas_cpp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lidmas-1.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for lidmas-1.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 65c264c62456c845e84f18cb3daa16fcddd0ab25529230ce72d55b612a75204c
MD5 bb3a40e884167629a7b64e532993da87
BLAKE2b-256 8b39c2c8a58d80a3e633f5862d343ccc6feb8ae65dff2bdd61b78a3ed8c49a07

See more details on using hashes here.

Provenance

The following attestation bundles were made for lidmas-1.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi.yml on DennisWayo/lidmas_cpp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page