Good implies correct: an extended rectangle with at most t faults is correct
OpenQAlgorithms.GottesmanIntro.good_exRec_correctThis is the basic correctness property of fault-tolerant gadgets: an extended rectangle that has no more faults than the code corrects behaves like the ideal location.
Fix an quantum code with an ideal decoder (a fault-free decoding circuit that corrects every error of weight at most ). Fix fault-tolerant gadgets for preparation of , standard-basis measurement, the gates , , CNOT, the wait location, and error correction (EC), satisfying the properties Meas, Prep A/B, Gate A/B and EC A/B of Definitions 2–5. Faults are Pauli errors at locations of the gadgets.
An extended rectangle (ExRec) of type consists of the leading EC gadget on each input block, the gadget for , and the trailing EC gadget on each output block (a preparation ExRec has no leading EC, a measurement ExRec no trailing EC). It is good if its total number of faulty locations satisfies
Then every good ExRec is correct:
- Gate or wait ExRec with logical gate on blocks: , where (diagram (72)).
- Preparation ExRec: (diagram (73)).
- Measurement ExRec: for each outcome , the probability weight of decoded outcome of the measurement gadget after the leading EC equals (diagram (74)).
All equalities are equalities of superoperators, so they hold on every input, including parts of entangled states; the faults on both sides are the same.
Theorem 6 is the step from gadget-level fault tolerance to circuit-level simulation (Theorem 7) and level reduction.
Formalization Note The protocol is FTProtocol with the hypothesis IsFaultTolerant (Defs. 2–5, the code is an code, the decoder is ideal). The gadgets are concrete circuits of locations; their superoperators under a Pauli fault arrangement are computed from the circuit semantics. A full ExRec is the truncation set .
import Definitions.Def_QAlgorithms_Defs_FTCircuit set_option autoImplicit false
namespace QAlgorithms.GottesmanIntro
/-- Gottesman intro p.35, Theorem 6 (Good implies correct): "A good ExRec is correct."
Let `P` be a fault-tolerant protocol for an `[[n, 1, 2t + 1]]` code (gadgets satisfying
Defs. 2–5 with the ideal decoder of Def. 1). For every location type `κ` (preparation,
measurement, `H`, `R_{π/8}`, CNOT, wait) and every Pauli fault arrangement `F` of a full ExRec
of type `κ` (leading ECs, the gadget, trailing ECs; Def. 7) with at most `t` faults in total
(good, Def. 9), the ExRec is correct (Def. 8, diagrams (72)–(74)). -/
theorem good_exRec_correct (P : FTProtocol) (hP : P.IsFaultTolerant) (κ : LocKind)
(F : ExRecFaults κ) (hgood : F.count P ∅ ≤ P.t) :
ExRecCorrect P κ F ∅ := by
sorry
end QAlgorithms.GottesmanIntro
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. A fault-tolerant protocol consists of the following data:
- natural numbers (block length), (correctable faults) and (ancillas per block);
- a subspace (the code);
- an encoding matrix ;
- a decoder , an arbitrary map from -qubit operators to -qubit operators;
- for each location kind , a gadget circuit on physical qubits, where the arity is for CNOT and otherwise;
- an error-correction circuit on qubits;
- a classical decoding function from bit lists to bits.
In each block, the first wires are data and the last are ancillas.
Pauli fault arrangements. A Pauli fault arrangement assigns to each location id either nothing or a pair of single-qubit Paulis from . Running a gadget under works as follows:
- At each location where gives , the state is conjugated by on the location's first wire and by on its remaining wire (if any).
- This conjugation is applied after the location's ideal action, but before the measurement for measurement locations.
- Ids that are not locations are ignored.
- Classically controlled gate locations act only when their condition, read on earlier-step outcomes, is true.
We write for the number of locations of at which places a pair. A pair counts.
Derived maps.
- . Put an operator on the data qubits of blocks, with all ancillas in . Run under , add the resulting unnormalized states over all measurement records, and trace out the ancillas.
- . The same construction with on one block.
- . The -qubit operator obtained by running from the all-zero state in the same way.
- . The complex number obtained by running on (ancillas zero) and taking the trace of the sum over those records with .
- . The map , where is the orthogonal projector onto the span of . The weight of a Pauli string is the number of its non-identity factors.
- . The linear extension of the tensor product of superoperators.
- . The ideal unitary: , , CNOT (first wire is the control), or for wait. We write .
The fault-tolerance hypothesis . It states all of the following.
- Code. . Every -qubit operator of the form supported on at most qubits is detectable: there is a constant with for all unit .
- Encoding. and .
- Ideal decoder. is a channel, i.e. it has finitely many Kraus operators with . Moreover, for every in the complex span of Pauli strings of weight and every unit ,
-
Well-formedness. The live-qubit flows of the gadgets are:
- prep gadget: from no live qubits to exactly the block's data qubits;
- meas gadget: from data qubits to none;
- gate, wait and EC gadgets: from data qubits to data qubits.
Well-formed means:
- in each step, locations act on disjoint qubits;
- every live qubit is touched in the step;
- preparations act only on non-live qubits and all other locations only on live qubits;
- preparations add qubits to the live set and measurements remove them;
- the final live set is as stated.
-
Fault properties. Whenever the fault counts allow it:
- Meas. If , then for all .
- Prep A. If , then .
- Prep B. If , then .
- Gate A. For gate/wait and with :
- Gate B. Under the same condition:
- EC A. If , then .
- EC B. If , then .
ExRec fault data . For a kind , consists of:
- leading arrangements , one per input block (none for prep);
- a gadget arrangement ;
- trailing arrangements , one per output block (none for meas).
Its fault count with truncation set is
ExRec correctness with truncation .
- prep: , where is the identity if and otherwise.
- meas: for both , the identity holds. This ignores .
- gate/wait:
Here , with for and otherwise.
Statement. For every protocol satisfying , every kind , and every ExRec fault data whose fault count with empty truncation is at most :
the ExRec for is correct with empty truncation. In particular:
- for prep, the trailing EC is always applied;
- for gates, every trailing EC is applied.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.