GottesmanIntro Ch05b: supporting definitions
DefinitionQAlgorithms_GottesmanIntro_Ch05b_ModelGottesman, An introduction to quantum error correction, §5.2: decoding with bad extended
QAlgorithms.GottesmanIntro.exRecSize
For any protocol and any location kind among preparation, Hadamard, T, CNOT, measurement, and wait, this is , where the size of a location circuit is the total number of listed locations over all its steps. The leading count is for preparation and otherwise the location arity; the trailing count is for measurement and otherwise the arity; CNOT has arity and every other kind has arity . Thus the error-correction size multiplier is for preparation and measurement, for CNOT, and for Hadamard, T, and wait. A protocol contains arbitrary natural parameters , a complex code subspace on bits, an encoding matrix from a Boolean index, a matrix-to-matrix decoding function, six gadgets on bits, an error-correction circuit on bits, and a Boolean decoder of lists of measurement bits; it carries no correctness hypotheses. Empty gadgets and error-correction circuits are permitted.
QAlgorithms.GottesmanIntro.exRecSubsetMax
For any protocol with arbitrary natural parameters , code subspace, encoding matrix, matrix-to-matrix decoding function, six location-circuit gadgets, error-correction location circuit, and Boolean decoder of measurement lists, this is the maximum over the six kinds preparation, Hadamard, T, CNOT, measurement, and wait of , where is the gadget's number of listed locations plus the error-correction circuit's number of listed locations multiplied by for preparation or measurement, for CNOT, and for the other kinds. The fold takes its initial maximum against . The binomial coefficient is whenever , so the result is if every size is at most ; no protocol correctness assumptions are imposed.
QAlgorithms.GottesmanIntro.levelReducedBound
For any protocol (arbitrary natural parameters , code subspace, encoding matrix, decoding function, six gadgets, error-correction circuit, and measurement-list decoder), any natural number , any location circuit on wires, any function , and any index pair , this defines as a real number. To define , replace each step of by gadget layers of depth equal to the maximum of the six gadget depths, concatenating at each layer the corresponding layer of each location's gadget in listed order, and then by all layers of the error-correction circuit on each wire that participates in a nonmeasurement location of that step, with these wires ordered increasingly. Each gadget location has owner equal to the original location pair; each error-correction location has owner . These lists of layers define physical index pairs (layer number, position in layer). If is not a listed location of , set . Otherwise, writing its step as and its wire set as , include in precisely the physical locations owned by its gadget, together with error-correction locations owned by where and either its kind is not preparation and , or its kind is not measurement and . No trailing location is truncated. If , including an invalid , the sum is ; need not be nonnegative or bounded, and no well-formedness or correctness assumption is required for or .
import Definitions.Def_QAlgorithms_Defs_FTCircuit
/-!
# Gottesman, *An introduction to quantum error correction*, §5.2: decoding with bad extended
rectangles, level reduction, the threshold theorem (Theorems 8, 9, 10)
D. Gottesman, *An introduction to quantum error correction and fault-tolerant quantum
computation* (arXiv:0904.2557), cited "Gottesman intro p.N" (PDF pages).
Standing assumptions of the section, carried by the frozen definition layer: one
`[[n, 1, 2t + 1]]` code (p.19) with fault-tolerant gadgets for preparation, measurement, `H`,
`R_{π/8}`, CNOT, wait and error correction (Defs. 2–5, `FTProtocol.IsFaultTolerant`), gadgets of
a common depth so that `C′` is again divided into time steps (Def. 6, `FTProtocol.HasUniformDepth`);
`C` is a Def. 6 circuit with no input, every qubit prepared first and measured last
(`LocCircuit.IsIdealCircuit`); the output of `C′` is its measurement record decoded classically
by the measurement gadgets' decoding (classical computation is perfect, p.17).
-/
namespace QAlgorithms.GottesmanIntro
/-- The number of locations of a full ExRec of type `κ` (Def. 7): the gadget for `κ` plus one
leading EC per input block (none for a preparation) and one trailing EC per output block (none
for a measurement). -/
def exRecSize (P : FTProtocol) (κ : LocKind) : ℕ :=
(P.gadget κ).size + (κ.leadCount + κ.trailCount) * P.ec.size
/-- Gottesman intro p.41, the constant `A` of eq. (85): the maximum over the types of ExRecs of
the number of sets of exactly `t + 1` locations in the ExRec. -/
def exRecSubsetMax (P : FTProtocol) : ℕ :=
[LocKind.prep, .had, .tgate, .cnot, .meas, .wait].foldr
(fun κ acc => max ((exRecSize P κ).choose (P.t + 1)) acc) 0
/-- Gottesman intro p.40, eq. (84): the error bound `p′_i = Σ_R Π_{j∈R} p_j` for location `ℓ` of
`C`, the sum over the sets `R` of exactly `t + 1` locations of `C′` contained in the (full) ExRec
of `ℓ`. -/
noncomputable def levelReducedBound (P : FTProtocol) {N : ℕ} (C : LocCircuit N)
(p : ℕ × ℕ → ℝ) (ℓ : ℕ × ℕ) : ℝ :=
∑ R ∈ (exRecLocs P C ℓ ∅).powersetCard (P.t + 1), ∏ j ∈ R, p j
end QAlgorithms.GottesmanIntro