deltakit.circuit.Circuit.detectors_gates#

Circuit.detectors_gates(measurement_gate_stack: list[MX | MY | MZ | MRX | MRY | MRZ | HERALD_LEAKAGE_EVENT | MPP] | None = None) list[tuple[Detector, list[MX | MY | MZ | MRX | MRY | MRZ | HERALD_LEAKAGE_EVENT | MPP]]]#

Return the gates associated with each detector in this circuit, including nested circuits. This is returned by resolving the lookback indices in the full context of the circuit.

Where a repeated detector can refer to multiple possible measurement gates, this logic returns the reference for the last repeated instance of the detector.

Parameters:

measurement_gate_stack (List[_MeasurementGate] | None, optional) – Any measurements from outside the current circuit, by default None

Returns:

List of tuples. Tuple is a detector, and the measurement gate it is formed from.

Return type:

List[Tuple[Detector, List[_MeasurementGate]]]