Def_8: Detector #
Statement #
A detector is a collection of state initializations and measurement events that yield a deterministic result in the absence of faults. Specifically, a detector is a subset D of initialization events and measurement events such that:
In a fault-free execution, the product of all measurement outcomes in D (treating +1 outcomes as 0 and −1 outcomes as 1 modulo 2) combined with initialization parities equals a fixed value (conventionally +1 or equivalently 0 mod 2).
This determinism holds regardless of the quantum state being processed (for measurements of stabilizer generators) or is guaranteed by the initialization (for measurements immediately following initialization).
Intuitively, a detector is a parity check on measurement outcomes that should always yield +1 if no errors occurred. A fault that causes a detector to report −1 instead is said to violate that detector.
Main Definitions #
MeasurementOutcome: The outcome of a quantum measurement (+1 or -1, represented as ZMod 2)InitializationEvent: A state initialization event (qubit and time)MeasurementEvent: A measurement event (measurement index and time)DetectorEvent: Either an initialization or measurement eventDetector: A set of events with deterministic fault-free parityDetector.expectedParity: The expected parity (0 for +1 outcome, 1 for -1)Detector.observedParity: The observed parity given measurement outcomesDetector.isViolated: Whether a detector reports an unexpected value
Key Properties #
Detector.satisfied_or_violated: A detector is either satisfied or violatedDetector.satisfied_iff_not_violated: A detector is satisfied iff not violatedDetector.empty_isSatisfied: Empty detector always has parity 0
Measurement Outcomes #
Measurement outcomes in quantum mechanics are typically ±1 eigenvalues. We represent these mod 2: +1 → 0, -1 → 1. This convention means XOR (addition mod 2) computes product parity correctly:
- +1 × +1 = +1 → 0 + 0 = 0
- +1 × -1 = -1 → 0 + 1 = 1
- -1 × +1 = -1 → 1 + 0 = 1
- -1 × -1 = +1 → 1 + 1 = 0
A measurement outcome represented mod 2: 0 for +1, 1 for -1
Equations
Instances For
The +1 outcome (no error detected)
Equations
Instances For
The -1 outcome (error detected)
Equations
Instances For
Convert from Bool: false → +1 (0), true → -1 (1)
Equations
Instances For
Convert to Bool: 0 → false (+1), 1 → true (-1)
Instances For
Product of outcomes is addition mod 2
Instances For
Events: Initialization and Measurement #
A detector monitors both initialization events (where qubits are prepared in known states) and measurement events (where observables are measured).
Equations
- One or more equations did not get rendered due to their size.
Instances For
A measurement event: measuring an observable at a specific time
- measurement : M
The measurement index (which check/observable is measured)
- time : TimeStep
The time of measurement
Instances For
Equations
Instances For
Create an initialization event with +1 expected outcome
Equations
- InitializationEvent.standard q t = { qubit := q, time := t, expectedParity := 0 }
Instances For
Get the time of a measurement event
Detector Events #
A detector event is either an initialization or a measurement.
A detector event: either an initialization or a measurement
- init
{V : Type u_1}
{E : Type u_2}
{M : Type u_3}
: InitializationEvent V E → DetectorEvent V E M
An initialization event
- meas
{V : Type u_1}
{E : Type u_2}
{M : Type u_3}
: MeasurementEvent M → DetectorEvent V E M
A measurement event
Instances For
Equations
- instDecidableEqDetectorEvent.decEq (DetectorEvent.init a) (DetectorEvent.init b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
- instDecidableEqDetectorEvent.decEq (DetectorEvent.init a) (DetectorEvent.meas a_1) = isFalse ⋯
- instDecidableEqDetectorEvent.decEq (DetectorEvent.meas a) (DetectorEvent.init a_1) = isFalse ⋯
- instDecidableEqDetectorEvent.decEq (DetectorEvent.meas a) (DetectorEvent.meas b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
Instances For
Check if this is an initialization event
Equations
Instances For
Check if this is a measurement event
Equations
Instances For
Get the time of a detector event
Equations
- (DetectorEvent.init a).time = a.time
- (DetectorEvent.meas a).time = a.time
Instances For
Get the initialization event if this is one
Equations
- (DetectorEvent.init a).getInit = some a
- (DetectorEvent.meas a).getInit = none
Instances For
Get the measurement event if this is one
Equations
- (DetectorEvent.init a).getMeas = none
- (DetectorEvent.meas a).getMeas = some a
Instances For
Detectors #
A detector is a set of events that together form a parity check with deterministic outcome in fault-free execution.
An outcome assignment: provides measurement outcomes for all measurements at all times
Equations
- OutcomeAssignment M = (M → TimeStep → MeasurementOutcome)
Instances For
An initialization fault record: whether each initialization is faulty
Equations
- InitFaultRecord V E = (QubitLoc V E → TimeStep → Bool)
Instances For
A detector: a set of events with an expected fault-free parity.
The key property is that in fault-free execution, the XOR of all measurement outcomes in the detector (combined with initialization parities) equals the expected value. When faults occur, the observed parity may differ from expected.
- events : Finset (DetectorEvent V E M)
The set of events in this detector
- expectedParity : ZMod 2
The expected parity in fault-free execution (0 for +1, 1 for -1)
Instances For
Equations
- instDecidableEqDetector d1 d2 = if h : d1.events = d2.events ∧ d1.expectedParity = d2.expectedParity then isTrue ⋯ else isFalse ⋯
Get all initialization events in a detector
Equations
Instances For
Get all measurement events in a detector
Equations
Instances For
The contribution from initialization events: sum of their expected parities
Equations
- D.initParity = ∑ e ∈ D.initEvents, e.expectedParity
Instances For
The observed parity: sum of measurement outcomes plus initialization parities
Equations
- D.observedParity outcomes = D.initParity + ∑ e ∈ D.measEvents, outcomes e.measurement e.time
Instances For
A detector is violated if observed parity differs from expected
Equations
- D.isViolated outcomes = (D.observedParity outcomes ≠ D.expectedParity)
Instances For
A detector is satisfied if observed parity equals expected
Equations
- D.isSatisfied outcomes = (D.observedParity outcomes = D.expectedParity)
Instances For
Equations
- D.decIsViolated outcomes = inferInstanceAs (Decidable (D.observedParity outcomes ≠ D.expectedParity))
Equations
- D.decIsSatisfied outcomes = inferInstanceAs (Decidable (D.observedParity outcomes = D.expectedParity))
A detector is either satisfied or violated
Satisfied and violated are mutually exclusive
Empty Detector #
The empty detector with expected parity 0
Equations
- Detector.empty = { events := ∅, expectedParity := 0 }
Instances For
The empty detector is always satisfied
The empty detector is never violated
Single-Event Detectors #
A detector consisting of a single initialization event
Equations
- Detector.singleInit e = { events := {DetectorEvent.init e}, expectedParity := e.expectedParity }
Instances For
A detector consisting of a single measurement event
Equations
- Detector.singleMeas e expectedOutcome = { events := {DetectorEvent.meas e}, expectedParity := expectedOutcome }
Instances For
Combining Detectors #
Combine two detectors by taking symmetric difference of events and XOR of parities. This corresponds to multiplying the parity checks.
Equations
- D₁.combine D₂ = { events := symmDiff D₁.events D₂.events, expectedParity := D₁.expectedParity + D₂.expectedParity }
Instances For
Notation for detector combination
Equations
- Detector.instAdd = { add := Detector.combine }
Two detectors are equal iff their components are equal
Adding empty detector does nothing (from the left)
Adding empty detector does nothing (from the right)
Combining a detector with itself gives empty
Fault-Free Execution #
The key property of detectors is determinism in fault-free execution.
Fault-free outcomes: all measurements return their expected values. For stabilizer measurements, this means +1 (represented as 0). This function represents the outcomes in an ideal fault-free execution.
Equations
- Detector.faultFreeOutcomes expectedMeasOutcome = expectedMeasOutcome
Instances For
A detector with consistent expected outcomes is satisfied in fault-free execution. This captures the defining property of detectors: determinism without faults.
Effect of Faults on Detectors #
Faults can flip measurement outcomes, causing detectors to be violated.
Apply a time fault to outcomes: if the fault is active, flip the outcome
Equations
Instances For
A single time fault at a measurement in the detector flips its contribution
A time fault outside the detector doesn't affect outcomes for events not at that location
Detector Violation Analysis #
We characterize when faults violate detectors.
The syndrome of a fault on a detector: how much the parity is shifted
Equations
- D.faultSyndrome faultedMeas = ↑(D.measEvents ∩ faultedMeas).card
Instances For
A fault violates a detector iff the syndrome is odd (1 mod 2)
Detector Collection #
A fault-tolerant procedure typically has multiple detectors.
A detector collection: a set of detectors for a fault-tolerant procedure
The set of detectors
Instances For
The syndrome: which detectors are violated by given outcomes
Equations
- DC.syndrome outcomes = {D ∈ DC.detectors | D.isViolated outcomes}
Instances For
Count of violated detectors
Equations
- DC.violatedCount outcomes = (DC.syndrome outcomes).card
Instances For
All detectors are satisfied (syndrome is empty)
Equations
- DC.allSatisfied outcomes = (DC.syndrome outcomes = ∅)
Instances For
Empty collection has all detectors satisfied
Summary #
This formalization captures the detector concept from fault-tolerant quantum error correction:
Measurement Outcomes: Represented mod 2 (0 for +1, 1 for -1), with XOR computing product parity.
Events: Either initialization events (preparing qubits) or measurement events (measuring observables).
Detectors: Sets of events with an expected fault-free parity. The key property is that in fault-free execution, the XOR of all measurement outcomes (plus initialization parities) equals the expected value.
Violation: A detector is violated when the observed parity differs from expected. This indicates that a fault has occurred.
Fault Analysis: The syndrome of a fault on a detector counts (mod 2) how many faulted measurements are in the detector. A detector is violated iff this count is odd.
Key properties proven:
- Detectors are either satisfied or violated (exclusive)
- Empty detector is always satisfied
- Combining detectors XORs their events and parities
- Self-combination gives the empty detector
- Fault-free execution satisfies consistent detectors
- Violation occurs iff the fault syndrome is odd