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.0.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.0.0
File Size Uploaded Provenance
stabilizer_qec-2.0.0.tar.gz 4.9 MB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for stabilizer-qec 2.0.0
File
stabilizer_qec-2.0.0-cp314-cp314t-win_amd64.whl CPython 3.14 CPython 3.14 free-threading Windows x86-64 Details
stabilizer_qec-2.0.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.0.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.0.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+ x86-64, macOS 11.0+ ARM64, macOS 10.12+ universal2 (ARM64, x86-64) Details
stabilizer_qec-2.0.0-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details
stabilizer_qec-2.0.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
stabilizer_qec-2.0.0-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details
stabilizer_qec-2.0.0-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details
stabilizer_qec-2.0.0-cp39-abi3-manylinux_2_28_aarch64.whl CPython 3.9 abi3 Linux glibc 2.28+ ARM64 Details
stabilizer_qec-2.0.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.0.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 10.12+ x86-64, macOS 11.0+ ARM64 Details

Total release size: 152.0 MB

Release files / stabilizer_qec-2.0.0.tar.gz

Download URL stabilizer_qec-2.0.0.tar.gz
Size 4.9 MB
Tags Source
SHA-256 checksum
How to use checksums
ec57eaee68d08aa85bd027ec1d0da6a03be49711d15011902ab1f55187a4fae2
BLAKE2b-256 checksum
How to use checksums
7be3f3bac848b8b98fecd183dc7af52d38649495a839c4e5e2759504e231a886
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 18, 2026.

Transparency log

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

Download URL stabilizer_qec-2.0.0-cp314-cp314t-win_amd64.whl
Size 10.9 MB
Tags CPython 3.14 CPython 3.14 free-threading Windows x86-64
SHA-256 checksum
How to use checksums
117f5de69b50854d7b2a37fd2594f212236812c874c2eb2f4d7b1cc9011364f5
BLAKE2b-256 checksum
How to use checksums
6ae77fa96962c03a8a0cf66692b2f832ffc4c63aa7dba0afb72ec3f6db4d1176
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 18, 2026.

Transparency log

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

Download URL stabilizer_qec-2.0.0-cp314-cp314t-manylinux_2_28_x86_64.whl
Size 11.4 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f524dab429914ec79877102f00b29a1ebb1e412c6836f8c7a46762642ebd509e
BLAKE2b-256 checksum
How to use checksums
5326feeb119d3dbd76e2b457f9e9e71bd1358c647a5d40a88e70df1e8a2439a9
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 18, 2026.

Transparency log

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

Download URL stabilizer_qec-2.0.0-cp314-cp314t-manylinux_2_28_aarch64.whl
Size 10.8 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
9cfcf7bc4d06feeef74c30e7c9487eff2e954d99dad219b87257c3713c4213e9
BLAKE2b-256 checksum
How to use checksums
a611f3f22e91dac48edd38804eade364d5a17d88a4348149613a4e7538576a5f
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 18, 2026.

Transparency log

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

Download URL stabilizer_qec-2.0.0-cp314-cp314t-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 17.6 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
8fb2c0130d0731fa61382bcfda383a4e0e4b8b4761a5d723c578f99cd9c7714c
BLAKE2b-256 checksum
How to use checksums
c5372977b0b53f6dd1a5c28cb966adc7fbfaac93fbfcf013a4c15631fc482a89
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 18, 2026.

Transparency log

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

Download URL stabilizer_qec-2.0.0-cp39-abi3-win_arm64.whl
Size 10.2 MB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
6a6c76cd37467db3c0578e6af7a76a3ff289dee00660921f897cc5c9143a1641
BLAKE2b-256 checksum
How to use checksums
b94f2db7a6c0e4bdb81a63335bc2646ed23aa7a83a4f97354284256a0ce8dd33
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 18, 2026.

Transparency log

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

Download URL stabilizer_qec-2.0.0-cp39-abi3-win_amd64.whl
Size 11.0 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
638e4fcea08b2eeabb617d3702cbcbebacad1b79ed37b447b506f4efd1b93b85
BLAKE2b-256 checksum
How to use checksums
3464e1256f764c96cba089b1df9ef20ed904a364a59a8ac10197dc43910d4484
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 18, 2026.

Transparency log

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

Download URL stabilizer_qec-2.0.0-cp39-abi3-musllinux_1_2_x86_64.whl
Size 18.0 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
55b918072b0430ac9d239fdeca6d8cd2942d37746432a079718727cdbc38c2e1
BLAKE2b-256 checksum
How to use checksums
fe052b1b74348f9fe173b14fefc188afc68e04d42bfcd3bb5d0f50660e73f900
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 18, 2026.

Transparency log

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

Download URL stabilizer_qec-2.0.0-cp39-abi3-musllinux_1_2_aarch64.whl
Size 17.3 MB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
1958a831e5209ef5c9c53b896a026c4ad0c8897e77a1009b22fd0b694f019a17
BLAKE2b-256 checksum
How to use checksums
a18794b844280ca4824ed2242c1a9e1c55e4354d2e79c30100576b33bcb8c534
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 18, 2026.

Transparency log

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

Download URL stabilizer_qec-2.0.0-cp39-abi3-manylinux_2_28_aarch64.whl
Size 10.9 MB
Tags CPython 3.9 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
b6c5f8044a4cef318bc69f09de5900c46b78ad0bf8221a35b565398e02bc0946
BLAKE2b-256 checksum
How to use checksums
c6dd77e2d99e6b5ab43203402fe2f2e9f6445501370d2bfc149259cc610ea8ac
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 18, 2026.

Transparency log

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

Download URL stabilizer_qec-2.0.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 11.4 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
b3ce05752ee7b25c096a7998fb8dd89715654f9d1f0fff3f5a894806d145c68f
BLAKE2b-256 checksum
How to use checksums
b4773460f56c3ebab7db586edc9a99ac7bd4969f64b6deeaa101beb64d881649
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 18, 2026.

Transparency log

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

Download URL stabilizer_qec-2.0.0-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 17.5 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
8be302f4edb9632398f2c9ea707240d6db465891c44585cc49fd81b8a789a44e
BLAKE2b-256 checksum
How to use checksums
3457650739890c56c7e5b24d1b9250cc7b2476a2b2f73a5bec64f0af7d9d38e0
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 18, 2026.

Transparency log

Security for stabilizer-qec 2.0.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.0.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 18, 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