---
title: Detector Error Model (DEM) in QEC
url: https://www.emergentmind.com/topics/detector-error-model-dem
type: topic
---

# Detector Error Model (DEM) in QEC

to circuit noise and experimental syndrome data; each elementary event has a probability and specifies which detectors and logical observables it flips. Cite 2606.11496 and 2606.14677 maybe enough.

Need numbered h2 sections 1-6 maybe.

Section 1: Definition and semantics.
- detector definition from 2606.11496: $v_i^{exp}=...$ and event map $e \mapsto (p_e,h_e,\ell_e)$.
- mention alternative equivalent formalizations: hypergraph over detectors 2606.16288, incidence matrix M and excitation rates theta 2512.10814, DEM={(E_i,p_Ei)} 2504.14643.
- mention DEM not microscopic Hamiltonian/gate-noise model.
- mention detector and logical observable.
Could cite 2606.11496, 2504.14643, 2606.16288, 2606.14677 maybe once each.

Section 2: Mathematical representations and transforms
- independent-event sampling formula.
- parity/polarization/attenuation from 2504.14643 and 2512.10814 and CAHR moment equation from 2606.16288.
- maybe include matching weight formula from 2606.11496.
- mention exact inversion transform via Hadamard etc.
Need avoid too many formulas? Some key ones okay.

Section 3: From circuit-level noise to DEMs
- circuit-generated DEM groups physical faults sharing detector-logical signature via parity rule 2606.11496.
- LightStim automates detector/observable annotation during compilation 2604.21472.
- beyond Pauli stochastic noise: EEG-based mapping from general Markovian noise to DEM 2603.18457.
Could discuss standard Stim workflows. Mention errors as edges/hyperedges. Mention theorem 1 single class => single DEM event maybe.
Need careful not to overstate exactness beyond leading order.

Section 4: Estimation from syndrome data
- central recent topic: estimate probabilities on fixed support from syndromes 2606.11496; hierarchical inversion formulas with moments up to 4, independent-event assumption, bootstrap regularization, no supervised fitting to logical outcomes, support fixed.
- general exact inversion from detector histories 2504.14643 using Walsh-Hadamard; aggregated classes and sparse methods.
- 2512.10814 consolidates algorithms for structure and rates from syndromes alone, moment- and parity-based, exact transforms, learning on Google Willow.
Need mention fixed support vs structure learning distinction. Maybe 2606.16288 next section topology learning? Could combine.

Section 5: Structure learning, equivalence, and tooling
- CAHR reconstructs topology with top-down pruning, benchmarks.
- Quasilinear equivalence checking and normal forms for DEMs 2606.14677.
- average detector likelihood as compressed derived statistic not DEM 2408.02082 maybe related abstraction.
Maybe section title "Reconstruction, comparison, and reduced statistics".

Section 6: Empirical performance, applications, and limits
- 2606.11496 Google Willow and IBM: 5-10% LEP reduction, larger IBM ~37/38%.
- 2512.10814 syndrome-trained vs RL-trained on Willow: syndrome-fit better at held-out syndrome likelihood, RL slightly better decoder prior. time-series drift, long-range correlations, artifacts not well modeled by DEM.
- 2606.16288 FP/FN exact topology at enough shots; variance cascade.
- limitations: identifiability restricted, support missing can't recover, independent-event assumption, negative correlators/unphysical estimates, non-Markovian/leakage/radiation/TLS-like events outside DEM assumptions.
- mention 2603.18457 negative DEM rates can arise beyond leading order due anticorrelations.
Maybe also mention detector likelihood paper as compressed benchmark and loss of structure maybe in limits section or previous.

Need encyclopedia style maybe sections numbered. Let's ensure intro no heading. Could be 6 sections.

Need use citations not too repetitive. At most once per section each paper. Fine.

Need article only. Let's draft.


A **Detector Error Model (DEM)** is a detector-level stochastic model for the events and logical-observable flips relevant to quantum error correction decoding. In the standard formulation, a DEM is a set of independent elementary error mechanisms, each specified by a probability and by the subset of detectors and logical observables it toggles; it therefore sits between microscopic circuit-level faults and decoder-level logical inference, retaining the syndrome-visible structure while discarding physically irrelevant detail [2606.11496][2606.14677].

## 1. Definition and semantic scope

A DEM is defined operationally at the level of detector outcomes. If an experiment produces measurement bits \(m_a\in\mathbb F_2\), a detector is a parity check of a selected subset of those outcomes with a known noiseless reference value,
\[
v_i^{\mathrm{exp}}=b_i\oplus\bigoplus_{a\in D_i} m_a,
\]
and a detector event occurs when \(v_i^{\mathrm{exp}}=1\). In repeated surface-code memory experiments with reset, the typical detector is the parity of two consecutive measurements of the same stabilizer,
\[
v_{j,t}^{\mathrm{exp}}=m_{j,t-1}\oplus m_{j,t},
\]
whereas in no-reset settings detectors can compare measurements two cycles apart [2606.11496].

In the independent-event representation, a DEM is a finite set \(\mathcal M=\{e\}\) of elementary detector-level mechanisms with
\[
e\mapsto (p_e,\mathbf h_e,\boldsymbol\ell_e),
\]
where \(p_e\) is the event probability, \(\mathbf h_e\in\mathbb F_2^M\) is the detector-flip vector, and \(\boldsymbol\ell_e\in\mathbb F_2^K\) is the logical-observable flip vector. The pair \((\mathbf h_e,\boldsymbol\ell_e)\) is the event’s detector-logical signature [2606.11496]. Closely related formalisms describe the DEM as a hypergraph \(G=(V,E)\), with detectors as vertices and fault mechanisms as hyperedges, or equivalently by an incidence matrix \(\mathbf M\in\mathbb F_2^{n\times E}\) together with excitation rates \(\boldsymbol\theta\in[0,1]^E\) [2606.16288][2512.10814].

This detector-level viewpoint is explicitly distinct from a microscopic Hamiltonian or gate-noise model. A DEM is not a full description of the underlying physics; it is an effective stochastic model of observable detector histories. In the language of syndrome-history inference, detector histories arise by starting from the all-zero detector string and XOR-adding independent DEM events, so that the model is defined by observable detector patterns rather than by physically unique fault locations [2504.14643]. The same idea appears in Stim-style syntax, where an instruction
\[
\mathtt{error}(p)\; D_{i_1}\cdots D_{i_m}\; L_{j_1}\cdots L_{j_w}
\]
means that an independent fault channel fires with probability \(p\), triggers detectors \(D_{i_1},\dots,D_{i_m}\), and flips logical observables \(L_{j_1},\dots,L_{j_w}\) [2606.14677].

## 2. Mathematical structure

Under the independent DEM semantics, one samples Bernoulli variables \(x_e\) with \(\Pr(x_e=1)=p_e\) and forms
\[
\mathbf v^{\mathrm{DEM}}=\bigoplus_{e\in\mathcal M} x_e\mathbf h_e,\qquad
\boldsymbol\lambda^{\mathrm{DEM}}=\bigoplus_{e\in\mathcal M} x_e\boldsymbol\ell_e.
\]
This is the model-level analog of the experimentally computed detector bits and logical labels [2606.11496]. In matrix language, if the event supports are the columns of \(\mathcal E\), then a detector history \(x\in\{0,1\}^N\) is generated as
\[
x=\mathcal E\,\mathbf q
\]
over \(\mathbb F_2\), with independent \(q_i\sim\mathrm{Bernoulli}(p_{s_i})\) [2504.14643].

Several equivalent transforms are used to analyze DEMs. A standard parity variable is
\[
z_y=(-1)^{x\cdot y},
\]
with polarization \(\langle z_y\rangle\) and depolarization
\[
\omega_y=-\ln\big(\langle z_y\rangle\big).
\]
For event attenuation
\[
a_s=-\ln(1-2p_s),
\]
the DEM model obeys the linear relation
\[
\omega_y=\sum_s (y\cdot s)\,a_s,
\]
which yields exact inversion formulas via the Walsh-Hadamard transform when the full parity family is available [2504.14643]. A closely related formulation writes
\[
\pi_{\mathbf y}=\prod_{\mathbf s\in\mathbf M}(1-2\theta_{\mathbf s})^{\mathbf s\cdot\mathbf y},
\]
defines \(\omega_{\mathbf y}=-\ln \pi_{\mathbf y}\) and \(\psi_{\mathbf s}=-\ln(1-2\theta_{\mathbf s})\), and obtains
\[
\boldsymbol{\psi}=\frac{-2}{2^n}\mathbf H\boldsymbol\omega
\]
after fixing the redundant empty-set parameter [2512.10814].

For graphlike decoding, DEM probabilities become decoder weights directly. An event with detector support \(E\) receives matching weight
\[
w_E=\log\frac{1-p_E}{p_E},
\]
so inaccurate DEM probabilities imply inaccurate decoder priors [2606.11496]. This is one reason DEM calibration is not merely descriptive: the event probabilities are part of the decoder itself.

## 3. Construction from circuits and noise models

In circuit-generated DEMs, one starts from physical fault locations \(f\) with probabilities \(r_f\), propagates each fault through the noiseless stabilizer circuit, and groups together faults with the same detector-logical signature. If \(G_e\) is the set of physical faults with a common signature, the effective DEM probability is
\[
p_e=\frac{1-\prod_{f\in G_e}(1-2r_f)}{2}.
\]
The resulting DEM is already a compressed detector-level image of the physical noise model [2606.11496].

This compression is the basis of standard QEC toolchains. The decoder does not operate on the raw circuit; it operates on detector and logical-observable parities compiled from the circuit. LightStim formalizes this by maintaining a Pauli tableau augmented with measurement records during circuit compilation. Mid-circuit detectors are produced by back-propagating a measured ancilla Pauli,
\[
\hat p=C^\dagger Z_q C,
\]
checking whether it commutes with the current tableau, and, in the commuting case, emitting a detector parity
\[
D=m_q\oplus(m_1\oplus\cdots\oplus m_s).
\]
At final readout, remaining stabilizer rows produce detectors and remaining logical rows produce `OBSERVABLE_INCLUDE` declarations. In this framework, DEM construction is concurrent with circuit compilation rather than a separate manual annotation pass [2604.21472].

More general constructions extend DEMs beyond Pauli-stochastic noise. For a Clifford circuit with general small Markovian circuit-level CPTP noise, the noise can be expressed in the elementary error generator basis and propagated to the end of the circuit to form a circuit error generator \(G_c\). The key step is to decompose \(G_c\) by detector-event class and approximate
\[
\mathcal E_c\approx \exp(G_1)\exp(G_2)\cdots\exp(G_k)\prod_{i=2}^j W_i.
\]
If a generator consists entirely of elementary error generators from a single detector-event class \(D\), then \(\exp(G)\) is modeled by a single DEM event with probability
\[
\frac12\left(1-\mathrm{Tr}(P\,\mathcal E_D[\psi])\right),
\]
for any representative detector \(P\in D\). This construction captures leading coherent accumulation and cancellation effects in effective DEM rates, although exact stochastic DEM semantics need not hold beyond the perturbative regime [2603.18457].

## 4. Estimation from syndrome data

A major recent development is DEM inference directly from experimental syndrome records. One line of work assumes that the detector-logical support is known from a reference DEM and estimates only the event probabilities from observed detector statistics. In surface-code memory experiments, empirical detector moments are formed from
\[
s_i=(-1)^{v_i}=1-2v_i,\qquad
m_A=\left\langle \prod_{i\in A} s_i\right\rangle,
\]
and then inverted analytically. For graphlike supports, pair and boundary probabilities can be recovered from low-order detector moments; for supports up to size four, one defines \(q_E=1-2p_E\) and uses hierarchical inversion formulas of the form
\[
m_A=\prod_{F\in\mathcal E_{\le 4}} q_F^{|A\cap F|\bmod 2},
\]
followed by a downward recursion from larger supports to smaller ones [2606.11496].

In this fixed-support setting, the support is not reconstructed from scratch. The question is whether DEM event probabilities learned directly from syndrome history on a fixed reference detector-logical support serve as a competitive decoder prior. The method uses only detector-event statistics and inherited support information; it does not use final logical success or failure outcomes, does not perform supervised fitting to logical labels, and does not optimize a separate likelihood objective over probabilities [2606.11496].

A more general algebraic program estimates DEMs from syndrome histories by transforming detector data into polarizations and depolarizations. When all \(2^N\) polarizations are available,
\[
a_s=-\frac{2}{2^N}\sum_y (-1)^{y\cdot s}\,\omega_y,
\qquad
p_s=\frac12-\frac12\left(\prod_y \langle z_y\rangle^{(-1)^{y\cdot s\oplus 1}}\right)^{2^{1-N}},
\]
so individual DEM event probabilities are exactly reconstructible in principle. For large systems, one instead estimates aggregated event classes on small detector subsets or uses sparse recovery schemes based on low-weight parities and class-lattice pruning [2504.14643].

Recent work on Google hardware systematizes both moment-based and parity-based estimation. It treats the inverse problem as learning the hypergraph structure \(\mathbf M\) and rates \(\boldsymbol\theta\) from syndrome data alone, without using a decoder. The exact transform
\[
\boldsymbol{\theta}
=
\frac12-\frac12
\exp\left\{\frac{-2}{2^n}\mathbf H\left[-\ln(\mathbf H[\mathbf p])\right]\right\}
\]
is tractable only for small detector sets, so large-scale inference relies on local moments, local parities, clique growth, and low-cardinality search [2512.10814].

## 5. Structure learning, comparison, and reduced statistics

When the DEM support is not known, the central problem becomes topology recovery. CAHR addresses this by treating the DEM as a detector hypergraph and using exact correlation identities together with top-down concurrent pruning. For detector subset \(\beta\),
\[
f_\beta=\prod_{\alpha\subseteq\beta} M_\alpha^{(-1)^{|\alpha|-1}}
\]
depends only on hyperedges containing \(\beta\), which enables recursive estimation of candidate hyperedge probabilities from high degree downward. The method first builds a pruned pair-correlation graph, enumerates cliques up to an assumed \(k_{\max}\), and then infers candidate hyperedges in descending order while pruning immediately when inferred probabilities fall below threshold [2606.16288].

A different but related question is when two DEMs should be regarded as equivalent. A recent equational theory models DEMs as a term language with XOR semantics on detector and observable targets, provides rewrite rules such as same-target fusion
\[
\mathtt{error}(p_1)\,S;\mathtt{error}(p_2)\,S
\to
\mathtt{error}(p_1\oplus p_2)\,S,
\qquad
p\oplus q=p+q-2pq,
\]
and proves that every DEM term has a unique normal form up to same-scope permutation. The associated static equivalence procedure runs in quasilinear time \(O(k|E|\log|E|)\), where \(|E|\) is the number of instructions and \(k\) bounds target-set size [2606.14677].

Not every detector-derived quantity is a DEM. The average detector likelihood,
\[
\langle D\rangle,
\]
is the mean probability that selected bulk detectors click. It can be derived from detector samples or from a DEM, and it can be used to define an effective flat-noise parameter
\[
p_{\mathrm{eff}}=-\frac{1}{\alpha}\ln(1-2\langle D\rangle),
\]
but it is only a scalar summary statistic. It discards detector identity, pairwise and higher-order correlations, hyperedge structure, space-time anisotropy, and logical-observable information, and is therefore not a full detector error model [2408.02082].

## 6. Empirical behavior, applications, and limitations

On real surface-code memory data, syndrome-estimated DEMs can improve decoding relative to baseline device-informed DEMs. For Google Willow and IBM `ibm_miami`, re-estimating DEM event probabilities from syndrome data while keeping the reference support fixed improved decoded logical error probabilities relative to baseline priors, typically at the \(5\%-10\%\) level, with larger gains in some IBM cases and a largest reported reduction of about \(\sim 37\%\) for \(r=1\) in IBM \(Z\)-memory without dynamical decoupling; the abstract reports a largest fractional reduction of about \(\sim 38\%\) for a single syndrome-extraction cycle [2606.11496].

The distinction between **syndrome fidelity** and **decoder utility** is now explicit. On Google’s Willow data, syndrome-trained DEMs estimated directly from observed syndromes matched held-out syndrome distributions more closely than RL-trained DEMs, while RL-trained DEMs could still be slightly better decoder priors in logical memory experiments. In a tractable \(d=3\), \(r=2\) held-out likelihood comparison, the learned-structure parity DEM achieved the best \(D_{\mathrm{KL}}\) and \(\Delta\mathrm{AIC}\), whereas RL-trained priors remained competitive or superior for downstream decoding [2512.10814].

For topology recovery, shot count matters sharply. In CAHR benchmarks at physical error rate \(p=0.001\), a \(d=5\) rotated surface code with \(r=5\) and \(k_{\max}=4\) required \(5\times 10^6\) shots for perfect support recovery, while a dense 8-body \(d=5\) 2D color code required \(1.5\times 10^7\) shots. The same work identifies a **variance cascade**: absolute statistical variance accumulates from high-degree parent mechanisms into lower-degree estimates, making support recovery easier than stable continuous parameter recovery in dense DEMs [2606.16288].

The limitations are equally central. DEM estimation from syndrome data is identifiable only on the assumed detector support or on the restricted detector subsets actually queried. If multiple DEM events share the same detector support but differ in logical support, detector moments alone do not separate them [2606.11496]. Fixed-support methods cannot recover detector-logical signatures absent from the reference DEM [2606.11496]. Exact inversion becomes unstable when polarizations approach zero, and sparse recovery depends on low-cardinality, sparse-hypergraph structure [2504.14643][2512.10814]. Non-Markovian effects, leakage, strong coherent correlations, or nonstationary artifacts can violate the independent-event assumption [2603.18457][2606.11496].

Hardware studies also show phenomena that are not well modeled by DEMs. On Google repetition-code data, two artifacts were identified as outside the DEM framework: correlated flipping of pairs of adjacent detectors for many consecutive rounds, described as TLS-like events, and signatures consistent with radiation events occurring more frequently than previously reported. These are temporally extended, nonstationary processes rather than stationary iid Bernoulli excitations [2512.10814]. More generally, beyond leading order, exact detector statistics under non-Pauli noise can require negative DEM event rates to represent anticorrelations, demonstrating that standard positive-rate DEMs are effective perturbative surrogates rather than universally exact models [2603.18457].

Source: https://www.emergentmind.com/topics/detector-error-model-dem