The Knill–Laflamme conditions #
Category: 1-Mathlib (CSD-free; staged for upstream). BACKLOG #14(a), the first brick of active error correction.
Glossary: https://glossary.constraintsurfacedynamics.com/knill-laflamme/
Plain-language, CSD-role and formal statements of the Knill-Laflamme conditions, with this module as
the Lean anchor. Kept symmetric by scripts/check-glossary.sh.
A code is an orthogonal projector P on a finite-dimensional Hilbert space; a family of
error operators E i is correctable on the code when some quantum channel R (the
recovery) undoes every error on every code state: R (E i ρ E iᴴ) = λ i • ρ whenever
ρ = P ρ P. The Knill–Laflamme condition is the algebraic criterion
P E iᴴ E j P = c i j • P for some matrix c,
and the theorem is that the two are equivalent (Knill–Laflamme 1997; Nielsen–Chuang Thm 10.1):
- ★★
exists_recovery_of_knillLaflamme— the recovery map exists: from the condition, withcHermitian (KnillLaflamme.isHermitian), diagonalisec = U D U*(Mathlib'sMatrix.IsHermitian.spectral_theorem;U = klUnitary); the canonical errorsF k = ∑ᵢ U i k • E isatisfyP F kᴴ F l P = d k δ_kl Pwithd k ≥ 0(knillLaflamme_canonicalError), so their images of the code are orthogonal; the Kraus operatorsR k = d k^{−1/2} P F kᴴ(ford k ≠ 0) haveR kᴴ R k = d k⁻¹ F k P F kᴴ, orthogonal projectors summing toQ, and1 − Qcompletes the channel (recoveryChannel); on a code stateR (F k ρ F lᴴ) = d k δ_kl ρ(recoveryChannel_apply), henceR (E i ρ E jᴴ) = c j i • ρ; - ★
exists_recovery_channel_of_knillLaflamme— for a noise channel𝓔with Kraus operatorsE,R (𝓔 ρ) = ρon the code: trace preservation makestr c = 1; - ★★
knillLaflamme_of_recovery— the converse: if a channel corrects the errors up to scalars, the condition holds. EachR k E i Pmaps every code vector to a multiple of itself (exists_smul_of_sum_conj_eq: the sandwiched identity∑ₖ |⟨u, R k E i v⟩|² = λ |⟨u, v⟩|²withuthe component ofR k E i vorthogonal tov), hence is a scalar on the code (exists_smul_of_forall_smul), andP E iᴴ E j P = ∑ₖ (R k E i P)ᴴ (R k E j P)by trace preservation; knillLaflamme_iff— the equivalence;- ★★
recovery_apply_lin_comb— discretization: the correction property is bilinear in the two error slots and a channel is linear, so a recovery corrects every linear combination of the family, up to the scalar the coefficients give (exists_smul_recovery_apply_of_eq_lin_combis the existential form). Correcting the four Paulis on a qubit therefore corrects every operator on that qubit.
Honest scope #
⚠️ Matrices over ℂ on a finite index type; the code is a projector, not a subspace, and no
stabiliser structure is assumed (the stabiliser instances — Steane, BACKLOG #14(b) — are
downstream). Degenerate codes are covered (c need not be invertible: d k = 0 errors act as 0
on the code). The recovery is constructed, not shown unique.
References: E. Knill, R. Laflamme, Theory of quantum error-correcting codes, Phys. Rev. A 55
(1997) 900; M. Nielsen, I. Chuang, Quantum Computation and Quantum Information, Thm 10.1;
QuantumInfo/Channel.lean; specs/BACKLOG.md #14; specs/steane-plan.md;
docs/FROM-POSTULATES-TO-QUANTUM-COMPUTERS.md §10.
Code projectors #
A real scalar a with a • P positive semidefinite is nonnegative.
The Knill–Laflamme condition #
The Knill–Laflamme condition for the errors E on the code P, with matrix c:
P E iᴴ E j P = c i j • P.
Equations
- QuantumInfo.KnillLaflamme P E c = ∀ (i j : ι), P * (E i).conjTranspose * E j * P = c i j • P
Instances For
The Knill–Laflamme matrix of a nonzero code is Hermitian.
The recovery channel of an orthogonal error family #
The projector onto the span of all error images: ∑ₖ R kᴴ R k.
Equations
- QuantumInfo.recoveryProj P F d = ∑ k : κ, (QuantumInfo.recoveryOp P F d k).conjTranspose * QuantumInfo.recoveryOp P F d k
Instances For
The recovery Kraus family: the R k, completed by 1 − ∑ₖ R kᴴ R k.
Equations
- QuantumInfo.recoveryKraus P F d (some k) = QuantumInfo.recoveryOp P F d k
- QuantumInfo.recoveryKraus P F d none = 1 - QuantumInfo.recoveryProj P F d
Instances For
An error with d k = 0 kills the code.
The recovery Kraus family is trace preserving.
The recovery channel of an orthogonal error family.
Equations
- QuantumInfo.recoveryChannel hP hd hF = { kraus := QuantumInfo.recoveryKraus P F d, tp := ⋯ }
Instances For
The action of one recovery operator on an error term of a code state.
The completion 1 − Q kills every error image of the code.
★ The recovery channel undoes an orthogonal error family on the code:
R (F k ρ F lᴴ) = d k δ_kl • ρ for ρ = P ρ P.
Diagonalising the Knill–Laflamme matrix #
The eigenvector unitary of the Knill–Laflamme matrix, as a matrix.
Equations
- QuantumInfo.klUnitary hc' = ↑hc'.eigenvectorUnitary
Instances For
The canonical errors F k = ∑ᵢ U i k • E i, U the eigenvector unitary of c.
Equations
- QuantumInfo.canonicalError hc' E k = ∑ i : ι, QuantumInfo.klUnitary hc' i k • E i
Instances For
The canonical errors satisfy the diagonal Knill–Laflamme condition.
The errors in terms of the canonical ones: E i = ∑ₖ conj(U i k) • F k.
The Knill–Laflamme matrix in terms of the eigen-data: c j i = ∑ₖ U j k d k conj(U i k).
The Knill–Laflamme theorem #
★★ The Knill–Laflamme theorem (recovery exists). If the errors E satisfy the
Knill–Laflamme condition on the nonzero code P, there is a channel R with
R (E i ρ E jᴴ) = c j i • ρ on every code state ρ = P ρ P; in particular
R (E i ρ E iᴴ) = c i i • ρ.
★ A noise channel satisfying Knill–Laflamme is corrected on the code: for a channel 𝓔
whose Kraus operators satisfy the condition, R (𝓔 ρ) = ρ for every ρ = P ρ P.
Discretization: the recovery corrects the whole span of the errors #
★★ The recovery corrects every linear combination of the error operators, up to the scalar its coefficients give. This is the discretization step: a code that corrects finitely many errors corrects the whole subspace they span, because the correction property is bilinear in the two error slots and the recovery is linear. Correcting the four Paulis on a qubit therefore corrects every operator on that qubit.
The same statement for an error given as a linear combination: if F is a combination of the
E i, the recovery returns a multiple of the code state.
The converse: a recovery forces the condition #
Kraus operators of a scalar map on the code are scalars. If
∑ₖ A k X (A k)ᴴ = λ • P X P for every X, and each A k vanishes off the code, then every
A k is a scalar multiple of P.
★★ The Knill–Laflamme theorem (the condition is necessary). If a channel R corrects the
errors E on the code P up to scalars — R (E i ρ E iᴴ) = λ i • ρ on code states — then the
errors satisfy the Knill–Laflamme condition.
The Knill–Laflamme theorem: the errors E are correctable on the nonzero code P — some
channel inverts every error on the code up to a scalar — if and only if they satisfy the
Knill–Laflamme condition for some matrix c.
The condition in encoder form #
An isometric encoder gives a code projector: P = V Vᴴ for Vᴴ V = 1.
The code of an isometric encoder is nonzero as soon as it encodes something.
★ Encoder form implies projector form. If the errors are scalar on the encoded qubit,
Vᴴ Eᵢᴴ Eⱼ V = cᵢⱼ • 1, they satisfy Knill–Laflamme on the code V Vᴴ. The encoder form is what
a concatenation composes: it needs no rank statement relating V Vᴴ to a stabiliser projector,
and not even that V is an isometry.
★ Projector form implies encoder form, for an encoder whose columns are code states.
The logical action of a single error, for a family containing the identity: the identity's row of the Knill–Laflamme matrix.
The Knill–Laflamme condition in encoder form, existential in the scalars: every pair of errors acts on the encoded space as some scalar. This is the form a concatenation carries through its induction, where the scalars themselves are of no interest.
Equations
- QuantumInfo.EncoderKL V E = ∀ (i j : ι), ∃ (γ : ℂ), V.conjTranspose * (E i).conjTranspose * E j * V = γ • 1
Instances For
★★ A recovery from the encoder form: errors that act as scalars on the encoded space are corrected by one channel.
★ A unitary error is undone exactly: if a recovery returns a code state up to a scalar and
the error is unitary, that scalar is 1, because both the error and the channel preserve the
trace.