← ClaudeAtlas

qector-dem-pipelinelisted

Detector error model (DEM) parsing, collapse, priors, and routing for QECTOR. Covers the manual 14 collapse rule (independent-XOR combination p = p1(1-p2) + p2(1-p1)), per-mechanism prior recalibration, the graphlike/hyperedge boundary, and the worked example p1=0.01, p2=0.02 -> p=0.0296, weight=ln(0.9704/0.0296)=3.489. Load for any DEM-related work: parsing .stim DEMs, building decoders from a DEM, weight calculations, and the matching-graph vs BP-OSD routing decision.
GuillaumeLessard/qector-claude-plugin · ★ 1 · AI & Automation · score 62
Install: claude install-skill GuillaumeLessard/qector-claude-plugin
# QECTOR DEM Pipeline The detector error model is the standard machine-readable description of a decoding problem (manual 14). The QECTOR pipeline accepts a Stim DEM (object or text), collapses it to a graph, applies per-mechanism priors and weights, and returns a faithful decoder. ## The two surfaces 1. **Library bench server (Provisional)** — `qector-research.dem_inspect` and `qector-research.dem_collapse_parallel`. A minimal Stim-style parser that is enough for the small fixtures the reference manual uses; it does not require Stim or the optional direct-wheel `dem` module. 2. **Optional direct-wheel `dem` module** (Provisional, manual 16.4) — `dem.from_stim(text)`, `model.collapse_to_graph()`, `model.make_decoder('blossom')`. Verify the exact API on the target device by introspecting the installed wheel. ## The collapse rule (manual 14.1) Parallel mechanisms between the same detector pair are merged into one edge. For two mechanisms `p1` and `p2` the combined probability is p = p1 (1 - p2) + p2 (1 - p1) (the independent-XOR rule, also what `stim`'s `detector_error_model(decompose_errors=True)` produces). The merged edge keeps the **observable set of the more likely member**. The matching decoders only ever use the lowest-weight edge between two detectors, so the collapse is exactly what PyMatching does, and it preserves logical accuracy on the tested workloads. For `n` mechanisms the cumulative form is p_combined = (1 - prod_i (1 - 2 p