Skip to main content

bloqade-decoders

The QEC user interface providing integration with popular open-source decoders for the Bloqade SDK.

By default, the following decoders from the ldpc package and their corresponding interfaces are immediately available for decoding use upon installation of this package:

  • BP+OSD - through bloqade.decoders.BpOsdDecoder
  • BP+LSD - through bloqade.decoders.BpLsdDecoder
  • Belief Find - through bloqade.decoders.BeliefFindDecoder

Interfaces also exist for the following optional decoders, which are not included as dependencies by default:

  • MWPF - through bloqade.decoders.MWPFDecoder (MWPF)
  • Tesseract - through bloqade.decoders.TesseractDecoder (Tesseract)
  • MLE (Gurobi) - through bloqade.decoders.GurobiDecoder, finds the most likely error pattern via mixed-integer programming
  • MLD (Table Lookup) - through bloqade.decoders.TableDecoder, builds a lookup table from sampled data

Sinter-compatible adapters for MLE and MLD are also available through bloqade.decoders.sinter_interface.

You can install them separately or specify you would like them included with the bloqade-decoders installation through the additional instructions below.

Installation

For access to the ldpc-package originating decoders and their respective interfaces, just do the following:

pip install bloqade-decoders

To add the tesseract decoder you can do:

pip install bloqade-decoders[tesseract]

Or for MWPF do:

pip install bloqade-decoders[mwpf]

For MLE (a full Gurobi license is needed for larger problems, but small models work with the size-limited license bundled with gurobipy):

pip install bloqade-decoders[mle]

For MLD:

pip install bloqade-decoders[mld]

You can combine multiple extras:

pip install bloqade-decoders[mwpf, tesseract, mle, mld, sinter]

Usage

The decoding interfaces are designed to align as closely as possible with the decoders themselves in terms of arguments. The only major difference is you're expected to pass in a Detector Error Model (DEM) to instantiate the interface.

Furthermore, all decoder interfaces are designed to accept the detector results of a single shot OR a batch of shots as a numpy ndarray of booleans, with the result being the observable correction (also as an ndarray of booleans).

from bloqade.decoders import BpOsdDecoder
import numpy as np
import stim

dem = stim.DetectorErrorModel("""
    error(0.1) D0
    error(0.1) D0 D1
    error(0.1) D1 L0
""")
# Pretend that circuit was executed twice,
# with two sets of detector results.
syndromes = np.array([[False, False], [False, True]])

# instantiate decoder, passing in desired arguments as you would
# the original decoder interface.
decoder = BpOsdDecoder(dem, bp_method="product_sum")

decoded_observable = decoder.decode(syndromes)
# decoded_observable should give you
# np.array([[False], [True]])

MLE / MLD Decoders

The GurobiDecoder takes a DEM directly (note: must use decompose_errors=False):

from bloqade.decoders import GurobiDecoder

decoder = GurobiDecoder(dem)
corrections = decoder.decode(syndromes)

The TableDecoder can be constructed directly with a DEM and pre-computed counts, or from a stim circuit which handles the sampling for you:

from bloqade.decoders import TableDecoder

# from a circuit (samples shots to build the lookup table)
decoder = TableDecoder.from_stim_circuit(circuit, num_shots=100_000)

# or from pre-sampled detector-observable shots
decoder = TableDecoder.from_det_obs_shots(dem, det_obs_shots)

corrections = decoder.decode(syndromes)

Metadata

Release files for bloqade-decoders 0.6.1

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

Source distribution (sdist)

Source distribution for bloqade-decoders 0.6.1
File Size Uploaded
bloqade_decoders-0.6.1.tar.gz 153.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bloqade-decoders 0.6.1
File Interpreter ABI Platform
bloqade_decoders-0.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 179.5 kB

Release files / bloqade_decoders-0.6.1.tar.gz

Download URL bloqade_decoders-0.6.1.tar.gz
Size 153.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a4b410724410fbe28800d8ab40e60da6913112d0b234f75122a68d1e07c74366
BLAKE2b-256 checksum
How to use checksums
0ff40690bb769df64802373c1def476cdb3d57d2c9bd526e655944d917d4eab8
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 Sep 9, 2026.

Transparency log

Release files / bloqade_decoders-0.6.1-py3-none-any.whl

Download URL bloqade_decoders-0.6.1-py3-none-any.whl
Size 26.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd65fb936966b187a384d186ca823e6ce669eda91f1687a30c9a551a0b47dd73
BLAKE2b-256 checksum
How to use checksums
5b1f3fb130617eb023d3a575c3665f50d93b07fe7cbceed44bb012c09b6ab2b6
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 Sep 9, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.1 This release

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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