The first eight lectures used Deltakit from the outside: import a class, call it, read a number. This lecture looks inside, with the questions a physicist asks before changing someone else’s research code. Which package owns the thing I want to change? How do I build and test it? How do the maintainers want changes proposed? Which problems are open, in the code and in the field?
Deltakit is young and its issues get assigned and closed, so everything below is as we checked it on 2026-11-09, with a link for each claim.
Field map
The packages and what each owns
Release 0.10.0 (2026-09-02) removed Deltakit’s subpackages (CHANGELOG, PR #332). Each part is now its own repository and PyPI distribution.
Definition 9.1 (Meta-package).A meta-package is a distribution with almost no code, which pins and installs other distributions. The
deltakitmodule only re-exports four components (deltakit.circuit,.core,.decode,.explorer) and adds the cloudClient.
Because deltakit is a meta-package (Definition 9.1), the name you import and the
repository you would change often differ. This primer pins these versions:
| distribution | import as | owns | needs (Deltakit) |
|---|---|---|---|
| deltakit-stim 0.2.7 | deltakit_stim | the C++ Stim fork: sampling, DEMs, leakage gates | none |
| deltakit-circuit 0.9.2 | deltakit.circuit | circuits, gates, noise channels, Stim conversion | stim |
| deltakit-core 0.9.2 | deltakit.core | data formats, decoding graphs, window primitives | stim |
| deltakit-decode 0.9.2 | deltakit.decode | PyMatchingDecoder, the sampling-and-decoding loop | circuit, core, stim |
| deltakit-explorer 0.9.4 | deltakit.explorer | codes, QPU, noise models, analysis, cloud client and decoders | circuit, core, decode, stim |
| deltakit-compile 0.1.0 | deltakit_compile | the xDSL compiler from logical programs to Stim | stim |
| deltakit-visualise 0.4.0 | deltakit_visualise | views of programs compiled by deltakit-compile | compile |
The map shows two stacks. On the left runs Lecture 0’s pipeline: the explorer builds the code
and the noisy memory circuit as deltakit.circuit objects; the decode package turns that
circuit into a decoder, using a decoding graph from deltakit-core and PyMatching; deltakit-stim
samples detection events; and deltakit.explorer.analysis turns failures into LEP,
Remark 9.1 (Where a class lives, and where it runs).
deltakit.decodeisdeltakit_decodeplus six cloud classes defined indeltakit_explorer._cloud_decoders:MWPMDecoder,CCDecoder(Collision Clustering),BeliefMatchingDecoder,BPOSDecoder,ACDecoder(Ambiguity Clustering) andLCDecoder(Local Clustering). Withoutclient=, their constructors raiseNotImplementedErrorbefore any network traffic. With one, the only implemented method,decode_batch_to_logical_flip, sends the circuit text and detection events to Riverlane’s service. Everything else runs locally as long as you pass noclient=.
So a fix to a cloud decoder’s wrapper is a change to deltakit-explorer, although you import the
class from deltakit.decode (Remark 9.1).
Building, testing and contributing
The rules for every repository are in the meta-repository’s
docs/CONTRIBUTING.md.
File issues in the affected package’s repository, and cross-package or documentation issues in
Deltakit/deltakit. Fork, clone, add the original
as upstream, and let uv build the test environment:
git clone https://github.com/<your-handle>/deltakit-explorer.git
cd deltakit-explorer
git remote add upstream https://github.com/Deltakit/deltakit-explorer.git
uv sync --group test
uv run pytest tests/analysisThe meta-repository adds just test, just lint (typos, ruff, pydoclint, mypy, deptry) and
just check. CI also tests the lowest dependency versions allowed
(--resolution lowest-direct), so code needing a newer dependency must raise its lower bound.
Issue and PR titles and commit messages follow Conventional Commits, except that bug reports
start bug: and requests request:; PRs use fix:, feat: or perf:. A bot asks for a
Contributor License Agreement on your first PR; during review, add commits instead of rebasing
or force-pushing.
Picking up work. Issues labelled good first issue or help wanted are open to anyone. For
the rest, explain your approach in a comment and wait to be assigned. Between volunteers, the
maintainers weigh the quality of the approach and who came first. A maintainer’s rule of thumb
for an issue (#325, 2026-08-19): at most
three paragraphs (about 300 words), two or three images, two or three citations, and extra
detail in a <details> fold.
The AI-use policy. “Use of AI tools” binds every contributor, maintainers included. Its
premise: a plausible PR is now cheap to generate but no cheaper to review, and QEC experiments
“may fail quietly”. AI tools are allowed if you understand every line, answer review questions
yourself and keep changes small. Disclose substantial use in the PR: tool and model, what it
changed, how you checked it (“Used LLMs” is not enough). Never credit a tool as an author or
commit agent files such as CLAUDE.md or .claude/.
The Deltakit Community Fund
The Deltakit Community Fund is run jointly by the Unitary Foundation and Riverlane. Its page, read on 2026-11-09, says:
- Award: up to 4k USD and mentorship from both teams, for one to two quarters (3 to 6 months).
- Projects: an unassigned
community-fund-proposalissue, or your own idea opened as a new issue; apply through the page’s form. - Dates: the 2027 Q1 round closes on 2 December 2026, results follow on 11 December (status issue #343), and work starts in January 2027. Later rounds open in February, May and August 2027.
- Rules: after a rejection, wait a quarter before reapplying. People in countries under US export controls (EAR groups D:1 and D:5) or OFAC sanctions are excluded.
The page lists no judging criteria. CONTRIBUTING.md adds that an assigned fund issue’s scope is reserved while the project runs.
Open problems in the code base
Five issues in Deltakit/deltakit, all open on 2026-11-09, make good first contributions for a physicist.
#321: does the decoder know when it is unsure?
#321 (community-fund-proposal) proposes
decoder calibration scoring. Matching can report a complementary gap
A maximum-likelihood decoder with the true noise model returns each logical class’s true posterior, so it is calibrated by construction. Matching keeps only the best error per class, and a wrong noise model miscalibrates any decoder, so calibration tests a decoder’s model against the noise. A maintainer deferred it in the first funding round (2026-08-14), promising priority in the next; several people want to work on it.
#325: decoding while the data arrive
#325 (no label) asks for windowed decoding.
On hardware, rounds keep coming, one every 1.1 μs on Google’s Willow chip (PUBLISHED,
Nature 638, 920 (2025)), and a decoder that
falls behind builds an ever-growing backlog. A sliding window decodes rounds
deltakit-core 0.9.2 already exports the graph surgery (induce_subhypergraph,
connect_dangling_to_boundary_hypergraph, annotate_edges_with_window_ids, …), but no other
Deltakit package uses it. The issue proposes a windowed decoder in deltakit-decode that wraps
any decoder returning a full correction. A maintainer wrote (2026-08-14) that it is not on the
current roadmap and suggested revisiting it in early 2027.
#411: a local decoder for qLDPC codes
#411 (no label, no comments) asks for
Relay-BP. PyMatching cannot decode bivariate bicycle codes: in the RelayBPDecoder as an optional extra over IBM’s Apache-2.0 relay-bp package.
#415 and #416: two compiler problems
deltakit-compile represents a program as intermediate representation (IR) in xDSL
dialects. In the qref dialect a gate acts on a qubit reference in place:
qref.gate<#qcore.gate.h>(%q0) changes what %q0 holds.
#415 (community-fund-proposal, written by
a maintainer) asks for a qssa dialect in static single assignment form, where every value
is defined once: a gate consumes a qubit value and returns a new one. Each qubit’s history
becomes a chain of values, so gate dependencies are visible in the values themselves, and
passes that reorder or cancel gates become local rewrites. In the issue’s example every qubit
value is used exactly once, which mirrors no-cloning. The work is the dialect plus passes from
qref to qssa and back. One applicant has posted a plan; a maintainer replied (2026-11-04)
that nothing is accepted yet and others may apply until 2 December 2026.
#416 (enhancement,
community-fund-proposal, no comments) asks for an importer from
OpenQASM 3.0, a quantum programming language
with classical control flow. QEC needs control flow: in teleportation and magic-state
injection, a measurement result decides the next gate. The importer parses text into an
openqasm3 dialect, which Riverlane plans to open-source before the round starts, and lowers it
to deltakit-compile’s dialects (scf, arith, qstruct, qcore, qec). Out of scope:
export, timing, physical qubits, switch, break, continue, end and pulse-level features.
Rough edges we hit while writing this primer
Three behaviours of Deltakit 0.10.2 (deltakit-decode 0.9.2, deltakit-explorer 0.9.4) cost us time; each is harmless once you know it.
1. The decoder’s circuit is not your circuit.
PyMatchingDecoder.construct_decoder_and_stim_circuit returns a new circuit that keeps only
the detectors the decoder uses. Sampling the circuit you built fails:
import textwrap
from deltakit.circuit.gates import PauliBasis
from deltakit.decode import PyMatchingDecoder
from deltakit.explorer.codes import RotatedPlanarCode, css_code_memory_circuit
from deltakit.explorer.qpu import QPU, SI1000Noise
code = RotatedPlanarCode(width=3, height=3)
circ = css_code_memory_circuit(code, num_rounds=3, logical_basis=PauliBasis.Z)
qpu = QPU(qubits=code.qubits, noise_model=SI1000Noise(p=1e-3))
noisy = qpu.compile_and_add_noise_to_circuit(circ)
dec, dec_circ = PyMatchingDecoder.construct_decoder_and_stim_circuit(noisy)
mine = noisy.as_stim_circuit()
print(f"detectors: {mine.num_detectors} in mine, "
f"{dec_circ.num_detectors} in the decoder's")
dets = mine.compile_detector_sampler(seed=2026).sample(10)
try:
dec.decode_batch_to_logical_flip(dets)
except ValueError as err:
print(textwrap.fill(f"ValueError: {err}", width=72))detectors: 24 in mine, 16 in the decoder's
ValueError: `shots` array should have at least 16 columns (the number of
detectors), and no more than 17 columns (the number of nodes), but
instead has 24 columnsThe eight
2. Two conventions for calculate_lambda_and_lambda_stddev fits
predict_quops_at_distance, predict_distance_for_quops,
predict_quops_interval) use _calculate_lep
in analysis/_quops.py, unchanged on upstream main at b280a96). One
from deltakit.explorer.analysis import (
calculate_lambda_and_lambda_stddev,
predict_quops_at_distance,
)
eps = [1.1769e-3, 1.8414e-4, 3.1077e-5] # LEP per round at d = 3, 5, 7
std = [3.1e-5, 9.6e-6, 3.3e-6] # their standard errors
ld = calculate_lambda_and_lambda_stddev([3, 5, 7], eps, std)
eps11 = 1 / (ld.lambda0 * ld.lambda_**6) # the fit's own model at d = 11
p_L = (1 - (1 - 2 * eps11) ** 11) / 2 # one 11-round block fails
print(f"Lambda = {ld.lambda_:.2f}, Lambda_0 = {ld.lambda0:.1f}")
print(f"QuOps(d=11) by hand: {1 / p_L:,.0f}")
q = predict_quops_at_distance(ld.lambda0, ld.lambda_, 11)
print(f"passing ld.lambda0: {q:,.1f}")
q = predict_quops_at_distance(1 / ld.lambda0, ld.lambda_, 11)
print(f"passing 1 / ld.lambda0: {q:,.0f}")Lambda = 6.26, Lambda_0 = 21.7
QuOps(d=11) by hand: 119,107
passing ld.lambda0: 253.5
passing 1 / ld.lambda0: 119,107Passing the fit straight through underestimates the QuOps about 470-fold (119,107 / 253.5).
predict_quops_interval(lambda_data, d) does exactly that internally. Pass 1 / ld.lambda0.
3. Seeded results depend on the hash seed. Lecture 0’s first run gives 344 failures with
PYTHONHASHSEED=0 and 340 with PYTHONHASHSEED=1, both with seed=2026 (rerun on
2026-11-09). In deltakit-explorer, codes/_css/_css_stage.py (line 144 in 0.9.4) stores the
first round’s gates in a frozenset. A frozenset iterates in hash order, a gate’s hash includes
its class name, and Python salts string hashes per process unless PYTHONHASHSEED is set. So
the first reset layer lists the qubits in another order (R 14 4 12 … against R 4 12 11 …),
Stim hands its random numbers to different qubits, and the same seed yields different shots.
The runs agree statistically, not shot by shot, which breaks regression tests across processes.
This primer pins PYTHONHASHSEED=0 and runs python -P, never python -I, which ignores the
variable.
Open research problems
- Real-time decoding at scale. Willow’s real-time decoder averaged 63 μs latency at
distance 5 over up to a million 1.1 μs cycles (PUBLISHED,
Nature 638, 920 (2025)). The Collision
Clustering decoder behind
CCDecoderdecodes at MHz rates on an FPGA (surface codes up to 881 qubits) and a 0.06 mm², 8 mW ASIC (up to 1,057) (PUBLISHED, Nat. Electron. 8, 84 (2025)). The Local Clustering Decoder behindLCDecodertakes under 1 μs per round on an FPGA and adapts to heralded leakage (PUBLISHED, Nat. Commun. 16, 11048 (2025)). Open: the same speed for logical operations on many logical qubits (#325). - qLDPC decoding. Bivariate bicycle codes have a threshold of about 0.7% (the arXiv abstract
says 0.8%), and the gross code
is estimated to keep 12 logical qubits for nearly a million cycles on 288 physical qubits at (PUBLISHED, Nature 627, 778 (2024)). Running such codes needs a decoder both accurate and fast; Relay-BP and Ambiguity Clustering, the algorithm behind ACDecoder(PREPRINT, arXiv 2406.14527), are candidates; Deltakit has no local qLDPC decoder (#411). - Leakage. Leakage spreads through multi-qubit gates into correlated errors that erode
exponential suppression. Removing it every cycle on Sycamore cut steady-state data-qubit leakage
tenfold in a distance-3 surface code, and a distance-21 bit-flip code showed the logical
benefit
(PUBLISHED, Nat. Phys. 19, 1780 (2023)).
Deltakit simulates leakage (
SI1000Noise(pL=...)), but its leakage-aware decoder, LCD, is cloud-only. - Machine-learning decoders. AlphaQubit beat the algorithmic decoders it was compared with on Sycamore data at distances 3 and 5, kept its advantage in simulation up to distance 11, and stayed accurate far beyond the 25 rounds it was trained on (PUBLISHED, Nature 635, 834 (2024)). The abstract reports accuracy, not speed. A decoder that outputs a probability is what calibration (#321) scores.
- Below threshold at larger distance. Willow’s distance-7 memory reached
and 0.143% error per cycle on 101 qubits; its repetition codes, up to distance 29, were limited by correlated error events about once an hour (about cycles) (PUBLISHED, Nature 638, 920 (2025), as above). Whether holds at larger , and what sets the floor, is open. Direct sampling needs about shots to see ten failures at a logical error rate of .
In Deltakit
The block below reads versions and dependencies from the installed metadata, then tries each decoder class without a client. Nothing goes over the network.
import importlib.metadata as md
import re
import deltakit.decode as dd
from deltakit.circuit.gates import PauliBasis
from deltakit.explorer.codes import RotatedPlanarCode, css_code_memory_circuit
from deltakit.explorer.qpu import QPU, SI1000Noise
PKGS = ["deltakit", "deltakit-circuit", "deltakit-core", "deltakit-decode",
"deltakit-explorer", "deltakit-stim", "deltakit-compile",
"deltakit-visualise"]
def dist_name(req):
return re.split(r"[ ;<>=~!\[(]", req)[0].lower().replace("_", "-")
for pkg in PKGS:
reqs = [r for r in md.requires(pkg) or [] if "extra ==" not in r]
deps = {dist_name(r) for r in reqs} & set(PKGS)
short = sorted(d.removeprefix("deltakit-") for d in deps)
print(f"{pkg:19s} {md.version(pkg):7s} {', '.join(short) or '-'}")
code = RotatedPlanarCode(width=3, height=3)
circ = css_code_memory_circuit(code, num_rounds=3, logical_basis=PauliBasis.Z)
qpu = QPU(qubits=code.qubits, noise_model=SI1000Noise(p=1e-3))
noisy = qpu.compile_and_add_noise_to_circuit(circ)
print()
for name in sorted(n for n in dir(dd) if n.endswith("Decoder")):
cls = getattr(dd, name)
try:
if name == "PyMatchingDecoder":
cls.construct_decoder_and_stim_circuit(noisy)
else:
cls(noisy) # no client= given
where = "local"
except NotImplementedError:
where = "cloud: needs client="
print(f"{name:22s} {cls.__module__:33s} {where}")deltakit 0.10.2 circuit, compile, core, decode, explorer, visualise
deltakit-circuit 0.9.2 stim
deltakit-core 0.9.2 stim
deltakit-decode 0.9.2 circuit, core, stim
deltakit-explorer 0.9.4 circuit, core, decode, stim
deltakit-stim 0.2.7 -
deltakit-compile 0.1.0 stim
deltakit-visualise 0.4.0 compile
ACDecoder deltakit_explorer._cloud_decoders cloud: needs client=
BPOSDecoder deltakit_explorer._cloud_decoders cloud: needs client=
BeliefMatchingDecoder deltakit_explorer._cloud_decoders cloud: needs client=
CCDecoder deltakit_explorer._cloud_decoders cloud: needs client=
LCDecoder deltakit_explorer._cloud_decoders cloud: needs client=
MWPMDecoder deltakit_explorer._cloud_decoders cloud: needs client=
PyMatchingDecoder deltakit_decode._mwpm_decoder localThe first table is the package map’s arrows. The second puts the remark in code: six of the seven decoder classes are defined in the explorer and stop at the constructor.
Try this
- Clone deltakit-explorer and run
uv run pytest tests/analysis/test_quops.py. Its fixture passes, . Which convention is that, and would any test there notice the mismatch above? - On paper, for #321: a decoder that reports the same confidence
on every shot ( the LEP) is calibrated. Show that its Brier score is , and why a decoder with useful per-shot confidence scores lower. - Draft the issue you would write for one rough edge under the maintainers’ rule of thumb: three paragraphs, the version, a minimal script and its output. Search the tracker first.
Readings
- Deltakit
docs/CONTRIBUTING.md(“Picking up work”, “Use of AI tools”); the Community Fund page and status issue #343. - L. Skoric et al., Parallel window decoding enables scalable fault tolerant quantum computation, Nat. Commun. 14, 7040 (2023). The scheme behind #325.
- T. Müller et al., Improved belief propagation is sufficient for real-time decoding of quantum memory, arXiv 2506.01779 (preprint). Relay-BP (#411).
- S. Bravyi et al., High-threshold and low-overhead fault-tolerant quantum memory, Nature 627, 778 (2024). The gross code.