qecx.DecoderTag

class qecx.DecoderTag(*, name, by_source=<factory>, overrides=<factory>)

Bases: object

Per-detector tag assigning decoder metadata to syndrome bits.

A tag assigns one value to every detector the decoder builds from the code’s syndrome bits. by_source is the primary assignment: one value per syndrome operator of a source, propagating to every syndrome bit recorded from that source. overrides refines it per syndrome-measurement variant and classical register where a bit’s value must differ; an override takes precedence over the source-anchored values for the named register’s bits in the named variant. The values are decoder-defined and opaque to the generic layer.

Variables:
  • name (str) – Tag name (e.g. "color").

  • by_source (Mapping[SyndromeSource, Sequence[object | ScalarRef] | SequenceRef]) – Source-anchored values: per syndrome source, a list with one entry per syndrome operator of that source (entries may mix literal values and element-wise ScalarRef references) or a single whole-value SequenceRef resolving to such a list. Defaults to an empty mapping.

  • overrides (Mapping[SyndromeMeasurementVariant, Mapping[ClassicalRegister, Sequence[object | ScalarRef] | SequenceRef]]) – Per-variant refinements, keyed by the live syndrome-measurement variant object and then by the live classical register object; each variant must be a registered syndrome-measurement variant of the owning document and each register listed in that variant’s syndrome_cregs, checked at document registration. Each value is a list with one entry per bit of its register (entries may mix literal values and element-wise ScalarRef references) or a single whole-value SequenceRef. Defaults to an empty mapping.