qector-dem-pipelinelisted
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