Detector Error Models
A detector error model (DEM) describes how faults in a quantum circuit flip
detectors and logical observables. For a complete circuit, CUDA-Q QEC provides
DetectorErrorModel in Python and
cudaq::qec::detector_error_model in C++. Functions such as
dem_from_memory_circuit() construct a DEM from a QEC circuit and a noise
model. For circuit-level noise, the DEM can be put into a canonical form
organized by measurement rounds, making it suitable for multi-round decoding.
The parity check matrix a decoder consumes is derived from the DEM: each row is a detector and each column a possible error mechanism. For a runnable example that generates a DEM from a surface code and decodes with it, see Experiments and Noise Modeling.
When the error mechanisms are known but their probabilities are uncertain, noise learning can estimate those probabilities from detector samples. It learns rates for the existing DEM mechanisms; it does not discover missing mechanisms. See Learning Noise and Decoding with Learned Rates for the workflow.
The following guides cover different ways to use detector error models:
Decoding from Stim DEM Text explains how to construct a decoder from an existing Stim DEM and how its fault information is parsed.
DEM Sampling explains how to generate synthetic errors and syndromes from a DEM to test a decoder, using CPU or GPU sampling.
Dynamic DEM explains how reusable phases describe repeating error-correction cycles, preserve effects across round boundaries, and support fixed-length shots or streaming decoding.