ILP Model for QEC Decoding¶
This page summarizes the integer linear program (ILP) used by ILPDecoder.
Notation¶
- Parity-check matrix: \(H \in \{0,1\}^{m \times n}\)
- Syndrome: \(s \in \{0,1\}^m\)
- Error variables: \(e \in \{0,1\}^n\)
- Weights: \(w \in \mathbb{R}^n\)
Each column of H corresponds to an error mechanism, and each row corresponds
to a detector or parity check.
Maximum-Likelihood ILP¶
The decoding problem is:
subject to the parity constraints:
To express parity over the integers, introduce auxiliary variables \(a \in \mathbb{Z}_{\ge 0}^m\) and write:
The full ILP is:
Weights from Error Probabilities¶
If each error mechanism has an independent probability \(p_j\), the standard log-likelihood ratio weight is:
Minimizing the weighted sum is equivalent to maximum-likelihood decoding under the independent error model. ILPDecoder requires \(p_j \in (0, 0.5]\) and rejects larger values; provide explicit weights if \(p_j > 0.5\).
Observables (Stim DEM)¶
When decoding a Stim DetectorErrorModel, the DEM is parsed into:
H: detector parity-check matrixO: observable matrixw: weights derived fromerror(p)lines
After solving for e, the predicted logical observables are:
Assumptions¶
- Error mechanisms are treated as independent.
- Probabilities are mapped to weights as above.
- For DEM specifics (supported instructions,
^handling, flattening), seestim_dem.md.