Stim DetectorErrorModel Support¶
ILPDecoder parses Stim DetectorErrorModels into an ILP by extracting the
error(p) mechanisms and building parity-check and observable matrices.
Supported Instructions¶
error(p) ...lines are parsed. Tags inerror[...]are ignored.detectorandlogical_observablemetadata lines are ignored.shift_detectorsoffsets are applied.repeatblocks are flattened by default (flatten_dem=True).detector_separatoris unsupported and raises an error.
The ^ Separator¶
Stim uses ^ to describe alternative components of a correlated mechanism.
ILPDecoder currently treats ^ as whitespace, which discards the alternative
structure. If your DEM contains ^, prefer decompose_errors=True when
building the DEM so each error is a single unambiguous mechanism.
Flattening and Size¶
Flattening expands repeat blocks and applies shift_detectors. This is
convenient for parsing but can increase the DEM size significantly. To fail
fast instead, pass flatten_dem=False when creating the decoder.
Recommendations¶
- Use
decompose_errors=Truewhen constructing DEMs from Stim circuits. - Use
flatten_dem=Trueunless the DEM is very large, and then pre-flatten only when needed.