surface_sim.models.Model.meas_target#
- models.Model.meas_target(qubit, rel_meas_ind)#
Returns the global measurement index for
stim.target_recfor the specified qubit and its relative measurement index (for the given qubit).Instead of working with global measurement indexing (as
stimdoes), this function allows to work with local measurement indexing for each qubit (seeNotesfor an example).- Parameters:
- qubit
Label of the qubit.
- rel_meas_ind
Relative measurement index for the given qubit.
- Returns:
- GateTarget
Target measurement index (
stim.target_rec) for building the detectors and observables.
Notes
To access the first measurement in the following example
M 0 M 1 M 0
one would use
-3instim’s indexing. However, in the “local measurement indexing for each qubit”, it would correspond to (q0, -2). This makes it easier for building the detectors as they correspond to the XOR of syndrome outcomes (ancilla outcomes) between different QEC rounds (or some linear combination of syndrome outcomes).