Codeword decoding#
Codeword decoding expands one source-port and codeword command into the device events defined by the profile. A command can select several events on different core-local output ports, such as acquisition and a separate discriminator arm.
Connections#
Input: source port and codeword, profile, epoch, instruction ID, first event ID, and an optional measurement reference.
Output:
OperationEventvalues for the timing control’s pending events at the current time point.Caller:
TimingControlwhile executingcw; time point validation also runs when the timing control submits a time point and when the TCU checks enqueue.
Resolving and validating events#
decode_codeword() creates one OperationEvent for each EventSpec
in the selected mapping. It assigns consecutive event IDs and preserves
the instruction ID, source port and codeword.
A GateOutput references a shared two-qubit gate definition. Decoding retains
the output port and codeword; the device checks the required pair at their
physical start tick before applying the gate.
Acquisition and discriminator-arm events carry the measurement reference
reserved by MeasurementRegisters. Timing control collects the events
for the current time point. On submission, it assigns their timing label
and records their IDs in TimingPoint::manifest.
validate_timing_events() checks IDs, mappings and per-port limits before
queue insertion. Device validation checks acquisition and arm pairing.
Objects and state#
Object or member |
Representation |
Role |
|---|---|---|
|
read-only mappings |
Maps a source port and codeword to one or more EventSpec values. |
|
output values |
Resolved event plus epoch, event and instruction IDs and optional measurement references. |
|
timing control-owned aggregate |
Time point, ordered manifest, events and profile fingerprint. |
Reset and errors#
Unknown mappings, inconsistent identities, invalid acquisition and arm pairs and
event counts above the configured limits raise faults. Timing control checks
staging and per-port limits before accepting cw.
Session reset discards pending events while preserving the profile mappings. One codeword expands into events at one time point.
Implementation and tests#
Source: control_protocol.cpp and control_protocol.hpp.
CTest: control.mapping, protocol.capacity, protocol.batch_atomic, protocol.batch_readout.
The tests reject invalid mappings and manifests, and time points that exceed staging or result capacity.
Fixed measurement groups#
A mapping may contain multiple acquisitions on distinct targets. Each acquisition has its own measurement reference; an explicit discriminator arm is paired by its target, independent of action order. Each acquisition still addresses one qubit. Timing control prepares all references and expanded events before committing the codeword. Invalid actions, insufficient capacity, or ID overflow leave no partial reservation. Capacity is counted per action and per measurement, not per codeword. The batch tests check independent completion times, reference pairing and atomic failure when one delivery path has insufficient space.