Classical Python toy simulation of OES-32-style metrics. No qubits, no QEC code; every output is SYNTHETIC.
METRIC_TAG=SYNTHETIC. Every number this script prints comes from hand-written formulas on generated inputs.
- A single classical Python script,
oes32_v14_improved.py, that runs a Monte Carlo loop over hand-written formulas relating a simulated erasure probability to "coherence", "success rate", and a few other labelled quantities. - A teaching/exploration toy for the OES-32 naming used across the Spark AI NLP repositories.
- Not a quantum computer implementation and not a quantum error-correcting code (no qubits, no stabilizers, no surface code, no decoder).
- Not a benchmark. Metric names such as "spooky correlation" and "entanglement entropy" are labels for formulas in the script, not quantum measurements.
- Not hardware, field, medical, or production software.
- Not bit-matched to the normative OES-32 residual (see Relationship to ADR-001).
The repository name predates these scope statements and is kept so existing links keep working.
Requires Python 3.8+. tqdm (progress bar) is the only third-party import and is optional.
git clone https://github.com/sparkainlp-x/quantum-error-correction-demo.git
cd quantum-error-correction-demo
python3 -m pip install -r requirements.txt # optional (tqdm)
python3 oes32_v14_improved.py --iterations 20000 --erasure 0.15 --seed 42Other options: --iterations N (default 1,000,000), --erasure P (default 0.20), --seed S (reproducible output), -v (verbose logging).
A report with run metadata and SYNTHETIC values for coherence before/after, success rate, "spooky correlation", "entanglement entropy", and collapse rate. The header and footer carry METRIC_TAG=SYNTHETIC, and the success-rate line carries its own SYNTHETIC note.
SYNTHETIC. Recovery success is drawn with probability max(0.95, 1 − 0.7·p_erasure), so the success rate is ≈95% by construction for p_erasure ≥ ~0.07. Reported figures near 95% are sampling outcomes of that hard-coded 0.95 floor, not a measured error-correction rate, and are not comparable with any QEC benchmark.
There is no unit-test suite. CI (smoke.yml) runs the script twice with --seed 42 and checks that:
- the report header, footer, and success-rate line are tagged SYNTHETIC;
- the removed "investor" / unconditional "STABLE" wording has not come back;
- the two seeded runs produce identical output (timestamp excluded).
To reproduce locally, run the Quickstart command twice and compare the outputs.
| Item | Tag |
|---|---|
| Every printed metric | SYNTHETIC (formula output on generated inputs) |
| Any hardware, qubit, or QEC performance interpretation | Not claimed |
Tag definitions: sparkainlp-x/.github.
The normative OES-32 residual definition is oes32-residual@b77b612 (ADR-001). This demo is not bit-matched to it and is not a Profile A sidecar.
oes32-residual: normative residual contractoes32_engine: Profile A sidecar (Python)oes32-hls: Profile A sidecar (C++ HLS prototype; synthesis UNRUN)- OES-512 (16 × OES-32 blocks, weighted latch) is a TARGET; source not published (
oes512-residual)
Archived on Zenodo: concept DOI 10.5281/zenodo.22985530 (all versions; resolves to the latest). The latest version, v0.1.3, is 10.5281/zenodo.23241551. The first archive, labelled v0.1.0 on Zenodo, is 10.5281/zenodo.22985531; its source tree is git tag v0.1.2 (the same files, re-tagged on the rewritten history).
Citation metadata is in CITATION.cff (GitHub shows a "Cite this repository" button). This is a toy script: if you mention it, cite a tagged release (or the repository URL and commit SHA) and describe its outputs as SYNTHETIC.
Author: Jean-François Brisson, Spark AI NLP, https://sparkainlpx.xyz. Questions: open an issue in this repository.
This software is available under the GNU Affero General Public License v3.0 only (AGPL-3.0-only); see LICENSE.
Organizations that want to use it in proprietary products or services without AGPL obligations can contact the author about a commercial license via https://sparkainlpx.xyz.
Versions published before 2026-09-29 were released under the MIT License and remain available under those terms.