Skip to main content

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, agreeing with PyMatching shot for shot except for ties.
  • A bit-parallel sampler, 64 shots per machine word, that runs REPEAT blocks without flattening.
  • Raw measurements to detection events, reproducing Google's 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 ldpc library's arithmetic bit for bit, and belief-matching equal to the beliefmatching package's.
  • BP+OSD (OSD-0, OSD-E, OSD-CS), whose corrections equal ldpc's BpOsdDecoder's, 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 for multiprocessing.
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). A seed gives the same shots on any machine and thread count. 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.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stabilizer-qec 2.1.0
File Size Uploaded Provenance
stabilizer_qec-2.1.0.tar.gz 5.2 MB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for stabilizer-qec 2.1.0
File
stabilizer_qec-2.1.0-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details
stabilizer_qec-2.1.0-cp314-cp314t-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64 Details
stabilizer_qec-2.1.0-cp314-cp314t-manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64 Details
stabilizer_qec-2.1.0-cp314-cp314t-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.14 CPython 3.14 free-threading macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64, macOS 10.12+ x86-64 Details
stabilizer_qec-2.1.0-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details
stabilizer_qec-2.1.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
stabilizer_qec-2.1.0-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details
stabilizer_qec-2.1.0-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details
stabilizer_qec-2.1.0-cp39-abi3-manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64 Details
stabilizer_qec-2.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
stabilizer_qec-2.1.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.9 abi3 macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64, macOS 10.12+ x86-64 Details

Total release size: 157.3 MB

Release files / stabilizer_qec-2.1.0.tar.gz

Download URL stabilizer_qec-2.1.0.tar.gz
Size 5.2 MB
Tags Source
SHA-256 checksum
How to use checksums
3ece3c91d4a202d0d38bada3af67723a2aec35fd907d25fd6f02a59cdecc6fda
BLAKE2b-256 checksum
How to use checksums
828c8ee33006223e7b102e245284fdaba46c188c8dc9273aebaccf80a43fc425
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 20, 2026.

Transparency log

Release files / stabilizer_qec-2.1.0-cp314-cp314t-win_amd64.whl

Download URL stabilizer_qec-2.1.0-cp314-cp314t-win_amd64.whl
Size 11.4 MB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
ba576a9dec6a1cca23c1c175a7b11a14753a0bd25552cecaa27952784cc02820
BLAKE2b-256 checksum
How to use checksums
8636e054945c272211008f6bc330f9ec451808fb899e021f5240b7c73df089c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 20, 2026.

Transparency log

Release files / stabilizer_qec-2.1.0-cp314-cp314t-manylinux_2_28_x86_64.whl

Download URL stabilizer_qec-2.1.0-cp314-cp314t-manylinux_2_28_x86_64.whl
Size 11.9 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3f2634fbd617ca1fcf4451900ae17cc0fef9d4876e983530e5f8c5c0a24a85cd
BLAKE2b-256 checksum
How to use checksums
86b637025ee8465ada0e4140399c8501f95885f0e43567d4c0632ccdf308ec14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 20, 2026.

Transparency log

Release files / stabilizer_qec-2.1.0-cp314-cp314t-manylinux_2_28_aarch64.whl

Download URL stabilizer_qec-2.1.0-cp314-cp314t-manylinux_2_28_aarch64.whl
Size 11.3 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
2bdce62d852d0c44dfbefc63eecf12e20fe8e969e614de155783bd6a0b840397
BLAKE2b-256 checksum
How to use checksums
a90feb7c7db95f72f34fb976e1741efb9dae28db40e9dae144fa857c8f90a4ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 20, 2026.

Transparency log

Release files / stabilizer_qec-2.1.0-cp314-cp314t-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL stabilizer_qec-2.1.0-cp314-cp314t-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 18.1 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
53228648249c8da36d21ef6078f9b1988befd7fa974c1e57cec88fa79cf2b5f5
BLAKE2b-256 checksum
How to use checksums
4f60a3a84321c9ea7c55b240e79d26615485c52d43b475696edae689c8dcf784
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 20, 2026.

Transparency log

Release files / stabilizer_qec-2.1.0-cp39-abi3-win_arm64.whl

Download URL stabilizer_qec-2.1.0-cp39-abi3-win_arm64.whl
Size 10.7 MB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
4174d759e2037913d76d47455e96d7211a29cf7decb26d7632afa0e8c66c33c0
BLAKE2b-256 checksum
How to use checksums
3ffe440eb1c4b33e2af3321c6e9c594f977f8e5aa12c00e71c367456b8cb533b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 20, 2026.

Transparency log

Release files / stabilizer_qec-2.1.0-cp39-abi3-win_amd64.whl

Download URL stabilizer_qec-2.1.0-cp39-abi3-win_amd64.whl
Size 11.4 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
5a86f87e64282ef63ab74c497584c49c118b6a96957be5796cd946220613c167
BLAKE2b-256 checksum
How to use checksums
04019046625f781d6e6c82fb8ef395bd0e012a0485334637dfc40798bd7cfbe5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 20, 2026.

Transparency log

Release files / stabilizer_qec-2.1.0-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL stabilizer_qec-2.1.0-cp39-abi3-musllinux_1_2_x86_64.whl
Size 18.4 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
df7a1d7da9facec28d32c46df0002d6ea225055317b879b003af3137ce3af805
BLAKE2b-256 checksum
How to use checksums
45e9dad306f6784f73f26aec770fe8c5152f90611f4e5453d300572900ef36f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 20, 2026.

Transparency log

Release files / stabilizer_qec-2.1.0-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL stabilizer_qec-2.1.0-cp39-abi3-musllinux_1_2_aarch64.whl
Size 17.7 MB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
e3b1ba94fdb8944b9886b22b83bfeecce50ce4635bd10862f0aec7d459111238
BLAKE2b-256 checksum
How to use checksums
ef681a46b9a47ba6d578914f7c69afa2444ba73859a8fc2bd25546dde64a8fe7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 20, 2026.

Transparency log

Release files / stabilizer_qec-2.1.0-cp39-abi3-manylinux_2_28_aarch64.whl

Download URL stabilizer_qec-2.1.0-cp39-abi3-manylinux_2_28_aarch64.whl
Size 11.3 MB
Tags CPython 3.9 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
61d6f997b993a0378abf3d87a4817785f02060adb386f08965f03371ac0f3e98
BLAKE2b-256 checksum
How to use checksums
589d392fac95fa73af82949f3eac2ada594d098845e10880ce2cb481136b32b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 20, 2026.

Transparency log

Release files / stabilizer_qec-2.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL stabilizer_qec-2.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 11.8 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
7ad4324feb26360317e55b70f4c7267e003be66d6a13ba08b9c0a47c6c59bcce
BLAKE2b-256 checksum
How to use checksums
a765fd65b5d1434df1439d43994390c372a3aa79c623e398a9328320b1c0e3f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 20, 2026.

Transparency log

Release files / stabilizer_qec-2.1.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL stabilizer_qec-2.1.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 18.1 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
3363eb6c551bfa9532edf4ecb750903e139bd65c4b16a419ff7fbbc96fbfe9a0
BLAKE2b-256 checksum
How to use checksums
1ddbe5f403af52c00eb1fb96e1edb2c346f0354ffb3f085adb8d9649b636e24d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 20, 2026.

Transparency log

Security for stabilizer-qec 2.1.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.

Select from 12 files

Attestation for stabilizer_qec-2.1.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 20, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page