stabilizer-qec
A surface-code simulator and decoder written in Rust, with Python bindings.
- Circuits and detector error models in Stim's text formats, and error models built by walking a circuit backwards, identical to Stim's on every circuit checked.
- Exact minimum-weight matching by sparse blossom, and correlated matching, checked against
PyMatching on finite corpora. Plain
Matchingreproduces recorded tied choices; separate correlated routes may choose another equal-weight answer and require an unedited DEM/circuit loaded withenable_correlations=True, with actual observable IDs 0–63 (wider ensured output is zero-padded). - A bit-parallel sampler, 64 shots per machine word, that runs
REPEATblocks without flattening. - Raw measurements to detection events, reproducing the recorded Google Willow and Sycamore files bit for bit.
- Sliding and parallel window decoders for real-time decoding, and decoding as a service
(
decode_async, a decoder queue with statistics, a decoder server). - The APIs of Stim, PyMatching, sinter, ldpc, Tsim, tqec, Deltakit, PECOS and seventeen more QEC tools under their own names, each port checked against its original.
- Clifford+T circuits with a coherent error on every gate: a stabilizer-rank sampler for the gates and a joint sampler that reweights the twirl of the errors around them.
- Fault-tolerant compilation (tqec's block graphs, Loom's lattice surgery), resource estimates (Azure's and Qualtran's), and sampling and min-sum BP on the GPU through wgpu.
- Belief propagation reproducing the
ldpclibrary's arithmetic on the recorded controls, and belief-matching checked againstbeliefmatching, subject to documented ties, platform arithmetic and API limits. - BP+OSD (OSD-0, OSD-E, OSD-CS), checked against
ldpc'sBpOsdDecoderon recorded inputs, with documented tie limits, and IBM's bivariate bicycle codes: the gross code [[144, 12, 12]] and [[72, 12, 6]], with the depth-8 syndrome cycle of Bravyi et al. (Nature 627, 778, 2024). - On the gross code, every automorphism's action on the logical qubits, and the gauging measurement of a logical operator as a circuit, its error model equal to Stim's.
- Stim's whole circuit language (every gate, all three bases,
MPP,SPP, correlated and heralded noise, measurement feedback, instruction tags, Pauli-target observables), checked against Stim on random circuits that use every gate. - Lattice surgery as single circuits, their error models equal to Stim's: Z⊗Z and X⊗X merges, a logical CNOT, merges in a row, and lines of patches merged at once.
- sinter, whole (
stabilizer_qec.sinter), for threshold sweeps with nothing else installed, and objects that pickle formultiprocessing.
import stabilizer_qec as sq
circuit = sq.memory_circuit(distance=5, rounds=5, p=0.004) # a d = 5 SD6 memory
dets, obs = circuit.compile_detector_sampler(seed=1).sample(100_000, separate_observables=True, threads=0)
dem = circuit.detector_error_model(decompose_errors=True)
pred = sq.Matching(dem, enable_correlations=True).decode_batch(dets, enable_correlations=True, threads=0)
print((pred != obs).any(axis=1).mean()) # logical error rate
The gross code, decoded by BP+OSD:
gross = sq.BivariateBicycleCode("gross") # [[144, 12, 12]], 12 cycles
c = gross.memory_circuit(12, 0.003)
dets, obs = c.compile_detector_sampler(seed=2).sample(2_000, separate_observables=True)
pred = sq.BpOsd(c.detector_error_model()).decode_batch(dets, threads=0)
print((pred != obs).any(axis=1).mean()) # any of the 12 logicals wrong
Threshold sweeps with stabilizer_qec.sinter, which is sinter whole (matplotlib to plot):
from stabilizer_qec import sinter
stats = sinter.collect(tasks=tasks, decoders=["pymatching", "belief_matching", "bposd"],
num_workers=8, max_shots=100_000)
The names follow Stim (Circuit, compile_detector_sampler, separate_observables),
PyMatching (Matching, decode_batch, enable_correlations) and ldpc (BpDecoder,
BpOsdDecoder, error_channel). Within a version, a seed and shot position give the same shots
on any number of threads; a correction to a sampler can change its seeded shots, and the
changelog names it (2.2's coherent merged-proposal and stable-group arithmetic fixes do). Coherent whole-class sums require a completed
kernel and a fitting contraction plan (or at most twelve generators); larger or incomplete sums
are approximations. An incomplete kernel warns, and so does the coherent sampler of a Clifford
circuit past its contraction budget. The joint sampler (non-Clifford gates or Clifford-angle
errors) has no contraction plan and ignores max_contraction: past twelve generators it
truncates without a warning, and only exact_weights=False reports it.
exact_weights describes coverage in floating-point arithmetic,
not universal numerical validation. Entry budgets are not byte limits and successful planning
can dominate compilation.
The root guide
documents port-specific refusals, exceptions, tie choices and migration changes. Crashes and
hangs remain bugs to report; resource checks do not make all allocation failures recoverable.
All coherent validation and capacity rows, and the d = 3 sweep and crosstalk rows, were
remeasured with the actual 2.2.0 wheel and carry the generation revision coherent-merged-proposal-v1, which records
provenance independently of exactness and validation; current tables accept only those rows.
Only the 12 larger-distance sweep and 5 crosstalk rows, measured by 1.8.0 before the
merged-proposal correction, remain archival and are excluded from current tables. Earlier
development-2.2 measurements remain in Git history and the preserved raw evidence.
See the changelog.
The explainer, its figures running the engine in the browser, is at https://qcompiler.jaspersands.com, with a technical report. The source and the full write-up are at https://github.com/Jaspersands/quantum-simulator-qec.
Metadata
Release files for stabilizer-qec 2.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| stabilizer_qec-2.2.0.tar.gz | 5.8 MB | With provenance | Details for stabilizer_qec-2.2.0.tar.gz |
Built distributions (wheels)
Total release size: 166.2 MB
Release files / stabilizer_qec-2.2.0.tar.gz
| Download URL | stabilizer_qec-2.2.0.tar.gz |
|---|---|
| Size | 5.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9427fe5dca92d93f150c5c70d5a707f580d717ac61c90e00da467fe3d8fb1acd
|
|
BLAKE2b-256 checksum How to use checksums |
8714080e704592f24516b973aeefc9faf21e39fbd62bd0df561a831714f96671
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logRelease files / stabilizer_qec-2.2.0-cp314-cp314t-win_amd64.whl
| Download URL | stabilizer_qec-2.2.0-cp314-cp314t-win_amd64.whl |
|---|---|
| Size | 12.1 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Windows x86-64 |
|
SHA-256 checksum How to use checksums |
82a58578e34e1102b38b1970f286968627a8b12ff7617de2268d3ff0cb6aa45e
|
|
BLAKE2b-256 checksum How to use checksums |
a2d282661810a708c357117482294fd9754c952d9ce58bae363571694d4fdb6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logRelease files / stabilizer_qec-2.2.0-cp314-cp314t-manylinux_2_28_x86_64.whl
| Download URL | stabilizer_qec-2.2.0-cp314-cp314t-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 12.6 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
45bd2d72c97da76bd0c6c5d86d6e11adec661c0db5834a4295db8144d1f37fe6
|
|
BLAKE2b-256 checksum How to use checksums |
34b0dde4545e79570bcbe67ea9d9839fe8cf336ed72ed9e927f474a5dedf640a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logRelease files / stabilizer_qec-2.2.0-cp314-cp314t-manylinux_2_28_aarch64.whl
| Download URL | stabilizer_qec-2.2.0-cp314-cp314t-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 12.0 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
7bcda8299da6ec6cdfd05f73fafe993c362390bff2997330f82125e7093a8892
|
|
BLAKE2b-256 checksum How to use checksums |
66c7c9d929accc15166812586814f7b7a1346a0fd165067e607b4a8f18c699d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logRelease files / stabilizer_qec-2.2.0-cp314-cp314t-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl
| Download URL | stabilizer_qec-2.2.0-cp314-cp314t-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl |
|---|---|
| Size | 19.0 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6935a63397b83fced62820bc2c15c233b1710ccba51d6dc222b8d7dfa485cf49
|
|
BLAKE2b-256 checksum How to use checksums |
40b9b748b696139cb1f47ab3af00754423752f50154a635625f88a4397d15dee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logRelease files / stabilizer_qec-2.2.0-cp39-abi3-win_arm64.whl
| Download URL | stabilizer_qec-2.2.0-cp39-abi3-win_arm64.whl |
|---|---|
| Size | 11.4 MB |
| Tags | CPython 3.9 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
d7eb1135bc28d37406db28420225d6aa69e51f67e344a2d1250fe8153c6e186b
|
|
BLAKE2b-256 checksum How to use checksums |
86e30eb95a28b94c9bc83972b0812a7a978baffd432d09d91e06fc671db9daa3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logRelease files / stabilizer_qec-2.2.0-cp39-abi3-win_amd64.whl
| Download URL | stabilizer_qec-2.2.0-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 12.2 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
d396e09a0f2762618e87cb9e26239918d9c88fd71541a1ee356e969f37352321
|
|
BLAKE2b-256 checksum How to use checksums |
f2080a9691ae56f00c71db364ef6e9a4b6bb5b3c297c19e270821451b17145dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logRelease files / stabilizer_qec-2.2.0-cp39-abi3-musllinux_1_2_x86_64.whl
| Download URL | stabilizer_qec-2.2.0-cp39-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 19.1 MB |
| Tags | CPython 3.9 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
00436d570f9801a4aa8c620eb224b748943023a692fd7cffba7aea660bd250dc
|
|
BLAKE2b-256 checksum How to use checksums |
4b65f824a3b9929bf298f31380d43419c259057c0274337d800243d48f753209
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logRelease files / stabilizer_qec-2.2.0-cp39-abi3-musllinux_1_2_aarch64.whl
| Download URL | stabilizer_qec-2.2.0-cp39-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 18.4 MB |
| Tags | CPython 3.9 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
a3e682dd72730fdd232b5af4599760088a5f9f55f8130320c8cb27b3fca7f31d
|
|
BLAKE2b-256 checksum How to use checksums |
e469772b9102551c2a6e739a6cce410b5b08440c572869b7cdd9ab0d188546d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logRelease files / stabilizer_qec-2.2.0-cp39-abi3-manylinux_2_28_aarch64.whl
| Download URL | stabilizer_qec-2.2.0-cp39-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 12.0 MB |
| Tags | CPython 3.9 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
f177fd82c0873bc4f1558ed1cc4510b45dd900c59b73c44fa32c2171f1ab720d
|
|
BLAKE2b-256 checksum How to use checksums |
95706c83e163794e360a02ee7e38d4c68ae3a532caeba7a0443f0de74ba126a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logRelease files / stabilizer_qec-2.2.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | stabilizer_qec-2.2.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 12.6 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
6e9fd4f97552c69d1aae0ca593c0b473f82af243a94c70334f1e94388223f705
|
|
BLAKE2b-256 checksum How to use checksums |
a257df2f5b520b18e87a262be6aecdf0de5ffa7eb98c1ae15daa0d03271d69a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logRelease files / stabilizer_qec-2.2.0-cp39-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl
| Download URL | stabilizer_qec-2.2.0-cp39-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl |
|---|---|
| Size | 19.0 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f5f66db9d19d3182c9259b70e1749e676705d5f68a1a7489c501643d9e99d54e
|
|
BLAKE2b-256 checksum How to use checksums |
a65470f7ba2648120ec670fcedc5ea84f8b64e95bd1f31e227e1a1beb0fae301
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logSecurity for stabilizer-qec 2.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 12 files in this release have been uploaded with provenance metadata.
Attestation for stabilizer_qec-2.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.