Definitions for Numerical evidence for bound secrecy from two-way post-processing in quantum key distribution
DefinitionQAlgorithms_Papers_Independent_Intakethird100_P30The objects the formalized statements of Numerical evidence for bound secrecy from two-way post-processing in quantum key distribution (arXiv:1612.07734) are stated in. Each was checked against the paper by a blind read-back and a moderator.
sixStateBellPair: PDF p.1: the normalized Bell vector, reusing the frozen one-EPR-pair vector. The bijection sends a Bool to its constant one-bit word; no new Bell state is defined.sixState: PDF pp.1,3: the six-state input, with QBER in [0,1/2] in the statements.sixStateCopies: PDF p.3, (1): independent sixStateCopies, explicitly regrouped as A^I B^I.codeKraus: PDF p.3, (2): the codeword-to-label Kraus operator, not a channel.bobState: PDF p.3, (1): Bob-only filtered operator, constructed by actual conjugation.bothState: PDF p.7, (20): Alice and Bob both apply the same code filter.otherMarginal: PDF pp.1,9: trace out the original B, retaining A and the B-prime copy.IsBobCopyExtension: PDF pp.1,9 and reference [21], p.10: actual positive-operator extension.BobExtendible: PDF pp.1,9: extendability to a copy of Bob; zero operators are allowed.threshold: PDF p.3: upper transition boundary. The inserted zero and the bounded QBER domain make this supremum nonempty and bounded for every input family. This formulation records 'beyond which', without assuming a transition theorem.bobThreshold: PDF p.3: Bob-only threshold of the constructed family (1).bothThreshold: PDF p.7: threshold in the same-code Alice/Bob regime (20).codeWordXor: PDF pp.3–4: coordinatewise XOR.CodeEquivalent: PDF p.4: equivalence forgets word order as well as coordinate order and translation. The coordinate bijection also handles differently named finite register sets.NoConstantColumns: PDF p.4: every coordinate assumes both values among codewords.codeProduct: PDF p.4: Cartesian concatenation; the coordinate registers are explicitly a sum.FixedCoordinates: PDF p.4: the constant-coordinate register of a code.VaryingCoordinates: PDF p.4: the surviving register after deleting all constant columns.deleteConstants: PDF p.4: deletion is a restriction of the actual words, including the empty tail.repetition: PDF pp.2,4: the two repetition words; injective only on a nonempty register.repetitionPolynomial: PDF p.5, (9), and p.10, (A3): the exact repetition polynomial.chau: PDF p.5: Chau's limiting QBER.repetitionApprox: PDF p.5, (10): the displayed approximation, used only at positive block length.diagonalLaw: PDF p.3: the normalized diagonal law; never used without positive trace.acceptanceMass: PDF p.3: acceptance mass in the original computational-basis distribution.xorSectorBlock: PDF p.3: XOR-sector block, with all word labels retained.xorSectorPermutation: PDF p.3, (4): fixed computational-basis permutation (alpha,k) -> (alpha XOR Ck,k).MatrixEntryCompatible: PDF p.3: full compatible-case condition from both Kronecker deltas in (3).multiCode: PDF p.4: a finite iterated Cartesian concatenation, with named coordinate blocks.publicAnnouncement: PDF p.3: the retained announcement is a classical, duplicated public label. All off-diagonal label blocks vanish; membership is checked on both Bob indices.forgottenAnnouncement: PDF p.3: forgetting the classical label sums branch operators, not amplitudes.transformCodeSet: PDF p.4: action on unordered code sets, coordinate permutation then fixed XOR.codeOrbit: PDF p.4: the finite orbit of an unordered code, used as its canonical class key.SetNoConstantColumns: PDF p.4: absence of constant columns for an unordered code set.codeClassCount: PDF p.4, Table I: number of distinct orbits of size-m code sets. Taking the image of full orbits forgets both codeword order and coordinate symmetries.tableEntries: PDF p.4, Table I: all and only the numeric cells, visually checked in the PDF. Each triple is (block length, number of words, number of inequivalent codes).SDPFeasible: PDF p.5, (11): free Hermitian R with PSD shifted R, not necessarily PSD R.slackValues: PDF p.5, (11): the feasible objective values, with actual marginal constraints.sdpMinimum: PDF p.5: exact SDP value. Feasibility, a lower bound, and attainment are conclusions of sdpCharacterization, never extra hypotheses deciding extendability.codeSlack: PDF p.5, (12): exact function T_C; no spline or grid is used here.CodeLinear: PDF p.3: linearity means XOR closure, without imposing it on general codes.fourWordCode: PDF p.6, (14): the four explicit words on a first bit and an n-bit tail.prependCodeColumn: PDF p.7: add the new column first; moving it to the last position is a coordinate permutation.columnOrbitCandidates: PDF p.7: orbits represented by nonconstant new columns, allowing further identifications.complementExtension: PDF p.7, (19): lower block is the complement, not another unchanged copy of C.twistedExtension: PDF p.7: the more general extension uses the equivalent code in its lower block.ComplementClosed: PDF p.7: complement closure as a pointwise property of the entire code set.zeroTail: PDF p.7: the converse constructs the first-bit-zero tail code, not a free witness.Equidistant: PDF p.8: equidistance is imposed on every pair of distinct code labels.simplexS: PDF p.8, (21): the common diagonal coefficient s.simplexU: PDF pp.3,8, (3),(21): the off-equal-label population u.simplexV: PDF pp.3,8, (3),(21): the coherence coefficient v.simplexZ: PDF p.8, (21)–(22): the positive trace used to normalize the filtered operator.simplexA: PDF p.8, (22): eigenvalue of the distinguished Bell vector.simplexB: PDF p.8, (22): the other zero-shift eigenvalue.simplexWeights: PDF p.8, (22): the third eigenvalue, computed from the actual code coefficients.cyclicBellVector: PDF p.8: generalized Bell vectors for the source's X(k)Z(l) order. The clock phase acts on the original second label i, before its cyclic shift by k. This defines Bell vectors directly, without introducing a duplicate Weyl operator.vectorPurification: PDF p.8, IV B step 1: vec(sqrt(P)), physical AB first and E1E2 second. This is an unnormalized purification for general PSD P, not an arbitrary state witness.candidateDegrader: PDF p.8, IV B step 2: candidate E = N after trace E2.complementaryOperator: PDF p.8: complementary Choi operator, obtained by tracing the actual B from the constructed purification. It is not assumed trace preserving.candidateExtension: PDF pp.8–9: the proposed extension is constructed by acting on the purification.
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Channel
import Definitions.Def_QAlgorithms_Defs_Measurement
/-!
Khatri–Lütkenhaus, arXiv:1612.07734v2. All citations use PDF page numbers.
Filtered operators are unnormalized. Code labels are arbitrary finite types;
requiring injectivity and nonempty labels gives precisely distinct nonempty codes.
Finite coordinate types allow explicit splitting and regrouping of registers.
For `Fin n` the word space is the frozen `QAlgorithms.Qubits n`.
Compilation is pending the authorized batch handoff.
-/
noncomputable section
namespace QAlgorithms.Papers.Independent.Intakethird100.P30
open scoped BigOperators Matrix ComplexConjugate ComplexOrder
attribute [local instance] Classical.propDecidable Classical.decEq
variable {I J K L A B : Type}
variable [Fintype I] [Fintype J] [Fintype K] [Fintype L]
variable [Fintype A] [Fintype B]
/-- PDF p.1: the normalized Bell vector, reusing the frozen one-EPR-pair vector.
The bijection sends a Bool to its constant one-bit word; no new Bell state is defined. -/
def sixStateBellPair : EuclideanSpace ℂ (Bool × Bool) :=
WithLp.toLp 2 fun p => maxEntangled 1 ((fun _ => p.1), (fun _ => p.2))
/-- PDF pp.1,3: the six-state input, with QBER in [0,1/2] in the statements. -/
def sixState (Q : ℝ) : Matrix (Bool × Bool) (Bool × Bool) ℂ :=
((1 - 2 * Q : ℝ) : ℂ) • pureDensity sixStateBellPair + ((Q / 2 : ℝ) : ℂ) • 1
/-- PDF p.3, (1): independent sixStateCopies, explicitly regrouped as A^I B^I. -/
def sixStateCopies (I : Type) [Fintype I] (Q : ℝ) :
Matrix ((I → Bool) × (I → Bool)) ((I → Bool) × (I → Bool)) ℂ :=
fun p q => ∏ i, sixState Q (p.1 i, p.2 i) (q.1 i, q.2 i)
/-- PDF p.3, (2): the codeword-to-label Kraus operator, not a channel. -/
def codeKraus (C : K → (I → Bool)) : Matrix K (I → Bool) ℂ :=
fun k w => if w = C k then 1 else 0
/-- PDF p.3, (1): Bob-only filtered operator, constructed by actual conjugation. -/
def bobState (C : K → (I → Bool)) (Q : ℝ) :
Matrix ((I → Bool) × K) ((I → Bool) × K) ℂ :=
let F := Matrix.kronecker (1 : Matrix (I → Bool) (I → Bool) ℂ) (codeKraus C)
F * sixStateCopies I Q * Fᴴ
/-- PDF p.7, (20): Alice and Bob both apply the same code filter. -/
def bothState (C : K → (I → Bool)) (Q : ℝ) : Matrix (K × K) (K × K) ℂ :=
let F := Matrix.kronecker (codeKraus C) (codeKraus C)
F * sixStateCopies I Q * Fᴴ
/-- PDF pp.1,9: trace out the original B, retaining A and the B-prime copy. -/
def otherMarginal (R : Matrix ((A × B) × B) ((A × B) × B) ℂ) :
Matrix (A × B) (A × B) ℂ :=
fun p q => ∑ b, R ((p.1, b), p.2) ((q.1, b), q.2)
/-- PDF pp.1,9 and reference [21], p.10: actual positive-operator extension. -/
def IsBobCopyExtension (P : Matrix (A × B) (A × B) ℂ)
(R : Matrix ((A × B) × B) ((A × B) × B) ℂ) : Prop :=
R.PosSemidef ∧ traceRight R = P ∧ otherMarginal R = P
/-- PDF pp.1,9: extendability to a copy of Bob; zero operators are allowed. -/
def BobExtendible (P : Matrix (A × B) (A × B) ℂ) : Prop :=
∃ R, IsBobCopyExtension P R
/-- PDF p.3: upper transition boundary. The inserted zero and the bounded
QBER domain make this supremum nonempty and bounded for every input family.
This formulation records 'beyond which', without assuming a transition theorem. -/
def threshold (P : ℝ → Matrix (A × B) (A × B) ℂ) : ℝ :=
sSup (insert 0 {q : ℝ | 0 ≤ q ∧ q ≤ 1 / 2 ∧ ¬ BobExtendible (P q)})
/-- PDF p.3: Bob-only threshold of the constructed family (1). -/
def bobThreshold (C : K → (I → Bool)) : ℝ := threshold (bobState C)
/-- PDF p.7: threshold in the same-code Alice/Bob regime (20). -/
def bothThreshold (C : K → (I → Bool)) : ℝ := threshold (bothState C)
/-- PDF pp.3–4: coordinatewise XOR. -/
def codeWordXor (u v : I → Bool) : I → Bool := fun i => Bool.xor (u i) (v i)
/-- PDF p.4: equivalence forgets word order as well as coordinate order and translation.
The coordinate bijection also handles differently named finite register sets. -/
def CodeEquivalent (C : K → (I → Bool)) (D : L → (J → Bool)) : Prop :=
∃ (p : I ≃ J) (t : I → Bool) (e : K ≃ L),
∀ k i, C k i = Bool.xor (D (e k) (p i)) (t i)
/-- PDF p.4: every coordinate assumes both values among codewords. -/
def NoConstantColumns (C : K → (I → Bool)) : Prop :=
∀ i, ∃ k l, C k i ≠ C l i
/-- PDF p.4: Cartesian concatenation; the coordinate registers are explicitly a sum. -/
def codeProduct (C : K → (I → Bool)) (D : L → (J → Bool)) :
(K × L) → (Sum I J → Bool) :=
fun k => Sum.elim (C k.1) (D k.2)
/-- PDF p.4: the constant-coordinate register of a code. -/
abbrev FixedCoordinates (C : K → (I → Bool)) := {i : I // ∀ k l, C k i = C l i}
/-- PDF p.4: the surviving register after deleting all constant columns. -/
abbrev VaryingCoordinates (C : K → (I → Bool)) := {i : I // ∃ k l, C k i ≠ C l i}
/-- PDF p.4: deletion is a restriction of the actual words, including the empty tail. -/
def deleteConstants (C : K → (I → Bool)) : K → (VaryingCoordinates C → Bool) :=
fun k i => C k i.val
/-- PDF pp.2,4: the two repetition words; injective only on a nonempty register. -/
def repetition (I : Type) : Bool → (I → Bool) := fun b _ => b
/-- PDF p.5, (9), and p.10, (A3): the exact repetition polynomial. -/
def repetitionPolynomial (n : ℕ) (q : ℝ) : ℝ :=
4 * q ^ (2 * n) - 4 * q ^ n * (1 - q) ^ n + (1 - 2 * q) ^ (2 * n)
/-- PDF p.5: Chau's limiting QBER. -/
def chau : ℝ := (5 - Real.sqrt 5) / 10
/-- PDF p.5, (10): the displayed approximation, used only at positive block length. -/
def repetitionApprox (n : ℕ) : ℝ :=
let r := Real.rpow (1 / 4) (1 / (n : ℝ))
let a := 4 * r + 1
(a - Real.sqrt (a ^ 2 - 4 * r * a)) / (2 * a)
/-- PDF p.3: the normalized diagonal law; never used without positive trace. -/
def diagonalLaw (P : Matrix (A × B) (A × B) ℂ) (a : A) (b : B) : ℝ :=
(P (a, b) (a, b)).re / P.trace.re
/-- PDF p.3: acceptance mass in the original computational-basis distribution. -/
def acceptanceMass (C : K → (I → Bool)) (Q : ℝ) : ℝ :=
∑ a : I → Bool, ∑ k, (sixStateCopies I Q (a, C k) (a, C k)).re
/-- PDF p.3: XOR-sector block, with all word labels retained. -/
def xorSectorBlock (C : K → (I → Bool)) (Q : ℝ) (beta : I → Bool) : Matrix K K ℂ :=
fun k l => bobState C Q (codeWordXor beta (C k), k) (codeWordXor beta (C l), l)
/-- PDF p.3, (4): fixed computational-basis permutation (alpha,k) -> (alpha XOR Ck,k). -/
def xorSectorPermutation (C : K → (I → Bool)) :
Matrix ((I → Bool) × K) ((I → Bool) × K) ℂ :=
fun p q => if p.1 = codeWordXor q.1 (C q.2) ∧ p.2 = q.2 then 1 else 0
/-- PDF p.3: full compatible-case condition from both Kronecker deltas in (3). -/
def MatrixEntryCompatible (C : K → (I → Bool)) (a a2 : I → Bool) (k l : K) : Prop :=
codeWordXor a (C k) = codeWordXor a2 (C l) ∧
∀ i, ¬ (codeWordXor a (C k) i = true ∧ codeWordXor a a2 i = true)
/-- PDF p.4: a finite iterated Cartesian concatenation, with named coordinate blocks. -/
def multiCode {S : Type} {D M : S → Type} (C : (s : S) → M s → (D s → Bool)) :
((s : S) → M s) → (Sigma D → Bool) :=
fun k i => C i.1 (k i.1) i.2
/-- PDF p.1: maximally noisy endpoint is I/4. -/
example : sixState (1 / 2) = (1 / 4 : ℂ) • (1 : Matrix (Bool × Bool) (Bool × Bool) ℂ) := by
norm_num [sixState]
/-- PDF p.3: no sixStateCopies give the scalar one, a combinatorial helper only. -/
example (q : ℝ) (p r : (Fin 0 → Bool) × (Fin 0 → Bool)) : sixStateCopies (Fin 0) q p r = 1 := by
simp [sixStateCopies]
/-- PDF p.3: a codeword is sent to its full label with amplitude one. -/
example (C : K → (I → Bool)) (k : K) : codeKraus C k (C k) = 1 := by
simp [codeKraus]
/-- PDF p.10, reference [21]: the zero positive operator has a zero extension. -/
example : BobExtendible (0 : Matrix (A × B) (A × B) ℂ) := by
refine ⟨0, Matrix.PosSemidef.zero, ?_, ?_⟩
· ext p q
simp [traceRight]
· ext p q
simp [otherMarginal]
/-- PDF p.4: the two one-bit repetition words are distinct. -/
example : Function.Injective (repetition (Fin 1)) := by
intro a b h
exact congrFun h 0
/-- PDF p.3: the retained announcement is a classical, duplicated public label.
All off-diagonal label blocks vanish; membership is checked on both Bob indices. -/
def publicAnnouncement {n : ℕ} {S : Type} [Fintype S]
(cells : S → Finset (Qubits n)) (accepted : Finset S) (Q : ℝ) :
Matrix ((Qubits n × S) × (Qubits n × S))
((Qubits n × S) × (Qubits n × S)) ℂ :=
fun p q =>
if p.1.2 = p.2.2 ∧ q.1.2 = q.2.2 ∧ p.1.2 = q.1.2 ∧
p.1.2 ∈ accepted ∧ p.2.1 ∈ cells p.1.2 ∧ q.2.1 ∈ cells p.1.2
then sixStateCopies (Fin n) Q (p.1.1, p.2.1) (q.1.1, q.2.1) else 0
/-- PDF p.3: forgetting the classical label sums branch operators, not amplitudes. -/
def forgottenAnnouncement {n : ℕ} {S : Type} [Fintype S]
(cells : S → Finset (Qubits n)) (accepted : Finset S) (Q : ℝ) :
Matrix (Qubits n × Qubits n) (Qubits n × Qubits n) ℂ :=
fun p q => ∑ s ∈ accepted,
if p.2 ∈ cells s ∧ q.2 ∈ cells s then sixStateCopies (Fin n) Q p q else 0
/-- PDF p.3: with no accepted cells the forgotten branch is the zero operator. -/
example {n : ℕ} {S : Type} [Fintype S] (cells : S → Finset (Qubits n)) (Q : ℝ) :
forgottenAnnouncement cells ∅ Q = 0 := by
ext p q
simp [forgottenAnnouncement]
/-- PDF p.4: action on unordered code sets, coordinate permutation then fixed XOR. -/
def transformCodeSet {n : ℕ} (p : Equiv.Perm (Fin n)) (t : Qubits n)
(C : Finset (Qubits n)) : Finset (Qubits n) :=
C.image (fun w i => Bool.xor (w (p i)) (t i))
/-- PDF p.4: the finite orbit of an unordered code, used as its canonical class key. -/
def codeOrbit {n : ℕ} (C : Finset (Qubits n)) : Finset (Finset (Qubits n)) :=
(Finset.univ : Finset (Equiv.Perm (Fin n) × Qubits n)).image
(fun g => transformCodeSet g.1 g.2 C)
/-- PDF p.4: absence of constant columns for an unordered code set. -/
def SetNoConstantColumns {n : ℕ} (C : Finset (Qubits n)) : Prop :=
∀ i, ∃ u ∈ C, ∃ v ∈ C, u i ≠ v i
/-- PDF p.4, Table I: number of distinct orbits of size-m code sets.
Taking the image of full orbits forgets both codeword order and coordinate symmetries. -/
def codeClassCount (n m : ℕ) : ℕ :=
(((Finset.univ : Finset (Qubits n)).powerset.filter
(fun C => C.card = m ∧ SetNoConstantColumns C)).image codeOrbit).card
/-- PDF p.4, Table I: all and only the numeric cells, visually checked in the PDF.
Each triple is (block length, number of words, number of inequivalent codes). -/
def tableEntries : List (ℕ × ℕ × ℕ) :=
[(2,2,1), (2,3,1),
(3,2,1), (3,3,2), (3,4,5), (3,5,3), (3,6,3), (3,7,1),
(4,2,1), (4,3,3), (4,4,13), (4,5,24), (4,6,47), (4,7,55),
(4,8,73), (4,9,56), (4,10,50), (4,11,27), (4,12,19),
(4,13,6), (4,14,4), (4,15,1),
(5,2,1), (5,3,4), (5,4,28), (5,5,104), (5,6,422),
(6,2,1), (6,3,6), (6,4,56), (7,2,1), (7,3,7), (8,2,1), (8,3,9)]
/-- PDF p.4: the identity coordinate action fixes every unordered code. -/
example {n : ℕ} (C : Finset (Qubits n)) :
transformCodeSet (Equiv.refl _) (fun _ => false) C = C := by
simp [transformCodeSet]
/-- PDF p.4: the transcription contains 34 asserted numeric cells. -/
example : tableEntries.length = 34 := by rfl
/-- PDF p.5, (11): free Hermitian R with PSD shifted R, not necessarily PSD R. -/
def SDPFeasible (P : Matrix (A × B) (A × B) ℂ) (t : ℝ)
(R : Matrix ((A × B) × B) ((A × B) × B) ℂ) : Prop :=
R.IsHermitian ∧ (R + (t : ℂ) • 1).PosSemidef ∧
traceRight R = P ∧ otherMarginal R = P
/-- PDF p.5, (11): the feasible objective values, with actual marginal constraints. -/
def slackValues (P : Matrix (A × B) (A × B) ℂ) : Set ℝ :=
{t | ∃ R, SDPFeasible P t R}
/-- PDF p.5: exact SDP value. Feasibility, a lower bound, and attainment are
conclusions of sdpCharacterization, never extra hypotheses deciding extendability. -/
def sdpMinimum (P : Matrix (A × B) (A × B) ℂ) : ℝ := sInf (slackValues P)
/-- PDF p.5, (12): exact function T_C; no spline or grid is used here. -/
def codeSlack (C : K → (I → Bool)) (Q : ℝ) : ℝ := sdpMinimum (bobState C Q)
/-- PDF p.5: zero operator, zero slack, zero R are feasible, including the boundary. -/
example : SDPFeasible (0 : Matrix (A × B) (A × B) ℂ) 0 0 := by
refine ⟨?_, ?_, ?_, ?_⟩
· simp [Matrix.IsHermitian]
· simpa using (Matrix.PosSemidef.zero : (0 : Matrix ((A × B) × B) ((A × B) × B) ℂ).PosSemidef)
· ext p q
simp [traceRight]
· ext p q
simp [otherMarginal]
/-- PDF p.3: linearity means XOR closure, without imposing it on general codes. -/
def CodeLinear (C : K → (I → Bool)) : Prop :=
∀ k l, ∃ r, C r = codeWordXor (C k) (C l)
/-- PDF p.6, (14): the four explicit words on a first bit and an n-bit tail. -/
def fourWordCode (n : ℕ) : (Bool × Bool) → (Sum (Fin 1) (Fin n) → Bool) :=
fun k => Sum.elim (fun _ => k.1) (fun _ => k.2)
/-- PDF p.6: the all-zero word belongs to the constructed four-word family. -/
example (n : ℕ) : fourWordCode n (false, false) = (fun _ => false) := by
funext i
exact Sum.rec (fun _ => rfl) (fun _ => rfl) i
/-- PDF p.7: add the new column first; moving it to the last position is a coordinate permutation. -/
def prependCodeColumn {n m : ℕ} (C : Fin m → Qubits n) (v : Fin m → Bool) :
Fin m → Qubits (n + 1) := fun k => Fin.cons (v k) (C k)
/-- PDF p.7: orbits represented by nonconstant new columns, allowing further identifications. -/
def columnOrbitCandidates {n m : ℕ} (C : Fin m → Qubits n) :
Finset (Finset (Finset (Qubits (n + 1)))) :=
((Finset.univ : Finset (Fin m → Bool)).filter (fun v => ∃ k l, v k ≠ v l)).image
(fun v => codeOrbit ((Finset.univ : Finset (Fin m)).image (prependCodeColumn C v)))
/-- PDF p.7: the added first bit is the chosen column bit. -/
example {n m : ℕ} (C : Fin m → Qubits n) (v : Fin m → Bool) (k : Fin m) :
prependCodeColumn C v k 0 = v k := by simp [prependCodeColumn]
/-- PDF p.7, (19): lower block is the complement, not another unchanged copy of C. -/
def complementExtension {n : ℕ} (C : Finset (Qubits n)) : Finset (Qubits (n + 1)) :=
C.image (fun w => Fin.cons false w) ∪
C.image (fun w => Fin.cons true (fun i => !(w i)))
/-- PDF p.7: the more general extension uses the equivalent code in its lower block. -/
def twistedExtension {n : ℕ} (C : Finset (Qubits n))
(p : Equiv.Perm (Fin n)) (t : Qubits n) : Finset (Qubits (n + 1)) :=
C.image (fun w => Fin.cons false w) ∪
(transformCodeSet p t C).image (fun w => Fin.cons true w)
/-- PDF p.7: complement closure as a pointwise property of the entire code set. -/
def ComplementClosed {n : ℕ} (C : Finset (Qubits n)) : Prop :=
∀ w ∈ C, (fun i => !(w i)) ∈ C
/-- PDF p.7: the converse constructs the first-bit-zero tail code, not a free witness. -/
def zeroTail {n : ℕ} (D : Finset (Qubits (n + 1))) : Finset (Qubits n) :=
(D.filter (fun w => w 0 = false)).image (fun w i => w i.succ)
/-- PDF p.7: an empty input gives an empty extension; nonemptiness is a theorem hypothesis. -/
example {n : ℕ} : complementExtension (∅ : Finset (Qubits n)) = ∅ := by
simp [complementExtension]
/-- PDF p.8: equidistance is imposed on every pair of distinct code labels. -/
def Equidistant (C : K → (I → Bool)) (d : ℕ) : Prop :=
∀ k l, k ≠ l → hammingDist (C k) (C l) = d
/-- PDF p.8, (21): the common diagonal coefficient s. -/
def simplexS (n : ℕ) (Q : ℝ) : ℝ := ((1 - Q) / 2) ^ n
/-- PDF pp.3,8, (3),(21): the off-equal-label population u. -/
def simplexU (n d : ℕ) (Q : ℝ) : ℝ := Q ^ d * (1 - Q) ^ (n - d) / 2 ^ n
/-- PDF pp.3,8, (3),(21): the coherence coefficient v. -/
def simplexV (n d : ℕ) (Q : ℝ) : ℝ := (1 - 2 * Q) ^ d * (1 - Q) ^ (n - d) / 2 ^ n
/-- PDF p.8, (21)–(22): the positive trace used to normalize the filtered operator. -/
def simplexZ (n m d : ℕ) (Q : ℝ) : ℝ :=
m * simplexS n Q + m * (m - 1) * simplexU n d Q
/-- PDF p.8, (22): eigenvalue of the distinguished Bell vector. -/
def simplexA (n m d : ℕ) (Q : ℝ) : ℝ :=
(simplexS n Q + (m - 1) * simplexV n d Q) / simplexZ n m d Q
/-- PDF p.8, (22): the other zero-shift eigenvalue. -/
def simplexB (n m d : ℕ) (Q : ℝ) : ℝ :=
(simplexS n Q - simplexV n d Q) / simplexZ n m d Q
/-- PDF p.8, (22): the third eigenvalue, computed from the actual code coefficients. -/
def simplexWeights (n m d : ℕ) (Q : ℝ) (k l : Fin m) : ℝ :=
if k.val = 0 ∧ l.val = 0 then simplexA n m d Q
else if k.val = 0 then simplexB n m d Q
else simplexU n d Q / simplexZ n m d Q
/-- PDF p.8: generalized Bell vectors for the source's X(k)Z(l) order.
The clock phase acts on the original second label i, before its cyclic shift by k.
This defines Bell vectors directly, without introducing a duplicate Weyl operator. -/
def cyclicBellVector (m : ℕ) (k l : Fin m) : EuclideanSpace ℂ (Fin m × Fin m) :=
WithLp.toLp 2 fun p =>
if p.2.val = (p.1.val + k.val) % m then
(Real.sqrt (m : ℝ) : ℂ)⁻¹ *
Complex.exp (((2 * Real.pi * (p.1.val : ℝ) * (l.val : ℝ) / m : ℝ) : ℂ) * Complex.I)
else 0
/-- PDF p.8: the zero-shift, zero-clock two-dimensional Bell coefficient. -/
example : cyclicBellVector 2 0 0 (0, 0) = (Real.sqrt 2 : ℂ)⁻¹ := by
simp [cyclicBellVector]
/-- PDF p.8: a shifted Bell vector has no coefficient on |00>. -/
example : cyclicBellVector 2 1 0 (0, 0) = 0 := by
norm_num [cyclicBellVector]
/-- PDF p.8, IV B step 1: vec(sqrt(P)), physical AB first and E1E2 second.
This is an unnormalized purification for general PSD P, not an arbitrary state witness. -/
def vectorPurification (P : Matrix (A × B) (A × B) ℂ) :
EuclideanSpace ℂ ((A × B) × (A × B)) :=
WithLp.toLp 2 fun p => cfc Real.sqrt P p.1 p.2
/-- PDF p.8, IV B step 2: candidate E = N after trace E2. -/
def candidateDegrader (N : Superop A B) : Superop (A × B) B :=
fun X => N (traceRight X)
/-- PDF p.8: complementary Choi operator, obtained by tracing the actual B
from the constructed purification. It is not assumed trace preserving. -/
def complementaryOperator (P : Matrix (A × B) (A × B) ℂ) :
Matrix (A × (A × B)) (A × (A × B)) ℂ :=
fun p q => ∑ b, pureDensity (vectorPurification P) ((p.1, b), p.2) ((q.1, b), q.2)
/-- PDF pp.8–9: the proposed extension is constructed by acting on the purification. -/
def candidateExtension (P : Matrix (A × B) (A × B) ℂ) (N : Superop A B) :
Matrix ((A × B) × B) ((A × B) × B) ℂ :=
idTensorSuperop (candidateDegrader N) (pureDensity (vectorPurification P))
/-- PDF p.8: pins the vectorization ordering, including off-diagonal coefficients. -/
example (P : Matrix (A × B) (A × B) ℂ) (i j : A × B) :
vectorPurification P (i, j) = cfc Real.sqrt P i j := by rfl
end QAlgorithms.Papers.Independent.Intakethird100.P30
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
QAlgorithms.Papers.Independent.Intakethird100.P30.BobExtendible
For finite index types and any complex matrix indexed by , this predicate means that there exists a positive semidefinite complex matrix indexed by such that, for every and ,
Neither trace-one normalization nor exchange symmetry of is required. If either index type is empty, such an exists.
QAlgorithms.Papers.Independent.Intakethird100.P30.CodeEquivalent
For types and functions and , this proposition means that there exist bijections and , and a function , such that for every and , where exclusive-or is true exactly when its two inputs differ. The bijections are required even when the coordinatewise equality is vacuous because or is empty; neither nor is required to be injective.
QAlgorithms.Papers.Independent.Intakethird100.P30.CodeLinear
For types and and a collection of Boolean words , this defines the property that for every pair of labels there exists a label such that, at every coordinate ,
where is Boolean exclusive-or. Thus the image is closed under coordinatewise exclusive-or; no injectivity or nonemptiness is required, and the property holds vacuously when is empty.
QAlgorithms.Papers.Independent.Intakethird100.P30.ComplementClosed
For every natural number and finite set of Boolean words of length , this defines the property that whenever , the word whose bit at every coordinate is also belongs to . No nonemptiness assumption is imposed: the empty set satisfies the property. For , complementation fixes the unique empty word, so every such satisfies it.
QAlgorithms.Papers.Independent.Intakethird100.P30.Equidistant
For a type , a finite coordinate type , a map , and a natural number , the assertion that is equidistant with parameter means that every pair of distinct indices satisfies
There is no separate injectivity requirement: when , distinct indices must have identical strings. If has at most one element, the condition is vacuous.
QAlgorithms.Papers.Independent.Intakethird100.P30.FixedCoordinates
For types and a function , this denotes the subtype of coordinates satisfying for every . If is empty or has one element, every coordinate satisfies this condition.
QAlgorithms.Papers.Independent.Intakethird100.P30.IsBobCopyExtension
For finite index types , a complex matrix indexed by , and a complex matrix indexed by , this predicate means that is positive semidefinite and that, for every and , both equalities
hold. No trace-one condition or invariance under exchanging the two coordinates is included. If or is empty, the entry equalities are vacuous and the unique matrix is positive semidefinite.
QAlgorithms.Papers.Independent.Intakethird100.P30.MatrixEntryCompatible
For a code , Boolean strings , and labels , this defines compatibility to mean the conjunction
In particular, the common XOR string must have no coordinate equal to at a coordinate where and differ. There is no requirement that the strings or labels be distinct, or that be injective. If is empty, compatibility holds for every pair of labels.
QAlgorithms.Papers.Independent.Intakethird100.P30.NoConstantColumns
For types and a function , this proposition means that for every coordinate , there exist with . It holds vacuously when is empty; when is nonempty and has at most one element, it cannot hold.
QAlgorithms.Papers.Independent.Intakethird100.P30.SDPFeasible
For finite index types , a complex matrix indexed by , a real number , and a complex matrix indexed by , this defines the conjunction that is Hermitian, is positive semidefinite, where is the identity matrix on , and for every and ,
There is no separate requirement that , that itself be positive semidefinite, or that either matrix have trace . If or is empty, the matrix index types are empty and these conditions hold for every real .
QAlgorithms.Papers.Independent.Intakethird100.P30.SetNoConstantColumns
For every natural number and finite set , this defines the proposition that for every coordinate , there exist words with . The witnesses may depend on . For the condition is vacuously true, including when is empty; for , an empty set or a singleton cannot satisfy it.
QAlgorithms.Papers.Independent.Intakethird100.P30.VaryingCoordinates
For types and a function , this denotes the subtype of coordinates for which there exist satisfying . This subtype is empty if is empty or has at most one element.
QAlgorithms.Papers.Independent.Intakethird100.P30.acceptanceMass
For a finite coordinate type , a finite label type , a code , and any real , this defines the real number
Thus it sums the real diagonal entries of the tensor product of the two-bit matrices , evaluated at , where . There is no injectivity assumption on or restriction on . If is empty, the result is zero; if is empty, each product is , so the result is .
QAlgorithms.Papers.Independent.Intakethird100.P30.bobState
For a finite coordinate type , a label type , any map , and any real , with decidable equality on the Boolean functions used as matrix indices, this defines a complex matrix indexed by . Its entries are
Here denotes the indicator of . This is the matrix obtained by multiplying the coordinatewise product matrix of the displayed two-bit factors on the left by and on the right by its conjugate transpose, where . No injectivity, normalization, or restriction on is required; if is empty, every existing entry is , and if is empty the matrix has no entries.
QAlgorithms.Papers.Independent.Intakethird100.P30.bobThreshold
For finite coordinate and label types , any map , and the decidable equalities used for these matrix indices, put and define a matrix on , for each real , by
The defined number is the supremum of together with all for which there is no positive semidefinite complex matrix on satisfying, for every and , both and . Here is the indicator of ; no injectivity assumption on or trace-one requirement on these matrices is imposed. Empty coordinate types are allowed, with empty products equal to , and an empty gives value . If no satisfies the stated nonexistence condition, the value is .
QAlgorithms.Papers.Independent.Intakethird100.P30.bothState
For a finite coordinate type , a label type , any map , and any real , with decidable equality on the Boolean functions used as matrix indices, this defines a complex matrix indexed by , whose entries are
Here denotes the indicator of . Equivalently, the definition multiplies the coordinatewise product matrix of these two-bit factors on the left by and on the right by its conjugate transpose, where . There is no injectivity or normalization requirement and no restriction on . If is empty, every existing entry is ; if is empty, the matrix has no entries.
QAlgorithms.Papers.Independent.Intakethird100.P30.bothThreshold
For finite coordinate and label types , any map , and the decidable equalities used for these matrix indices, define, for each real , a complex matrix on by
The defined number is the supremum of together with all for which there is no positive semidefinite complex matrix on satisfying, for every , both and . Here is the indicator of ; no injectivity assumption on or trace-one requirement on these matrices is imposed. Empty coordinate types are allowed, with empty products equal to , and an empty gives value . If no satisfies the stated nonexistence condition, the value is .
QAlgorithms.Papers.Independent.Intakethird100.P30.candidateDegrader
For an index type , a finite index type , and any function sending complex matrices indexed by to complex matrices indexed by , this defines a function sending a matrix indexed by to
Thus its input to is the partial trace over . No linearity, positivity, trace-preservation, or channel assumption is imposed on . The sum is zero when is empty.
QAlgorithms.Papers.Independent.Intakethird100.P30.candidateExtension
For finite index types with decidable equality, any complex matrix indexed by , and any function from complex matrices indexed by to complex matrices indexed by , let , with applied by the real continuous functional calculus. This defines a matrix indexed by as follows: for , form the matrix indexed by with entries
and set
This is the stated blockwise application of after a partial trace to the matrix , where . No positivity or normalization hypothesis is imposed on , and no channel or linearity hypothesis is imposed on . For Hermitian , the real square root sends negative eigenvalues to zero; for non-Hermitian , . Empty index types are allowed.
QAlgorithms.Papers.Independent.Intakethird100.P30.chau
This defines the real constant , where is the nonnegative real square root.
QAlgorithms.Papers.Independent.Intakethird100.P30.codeClassCount
For any natural numbers , consider all subsets with exactly elements such that, at each coordinate , some two words in differ at . For each such , form
The definition returns the number of distinct finite sets obtained this way, counting equal orbit sets only once. Here is Boolean exclusive-or. The value is zero if , or if and . For , the coordinate condition is vacuous, and the value is for or , and otherwise.
QAlgorithms.Papers.Independent.Intakethird100.P30.codeKraus
For index types and , with equality of Boolean functions on decidable, and any map , this defines a complex matrix with rows indexed by and columns indexed by Boolean functions on , by if , and otherwise. No injectivity assumption is imposed on ; distinct labels with the same image give identical rows. An empty gives a matrix with no rows.
QAlgorithms.Papers.Independent.Intakethird100.P30.codeOrbit
For every natural number and finite set , this defines the finite set of finite sets
where denotes Boolean exclusive-or. Equal resulting sets occur only once, even if several choices of produce them. This collection is nonempty and includes ; if , it is , and if , it is .
QAlgorithms.Papers.Independent.Intakethird100.P30.codeProduct
For types and functions and , this defines a function indexed by , whose coordinates lie in the disjoint union : the word indexed by has value at the copy of , and value at the copy of . Empty types are allowed, with empty if either indexing type is empty.
QAlgorithms.Papers.Independent.Intakethird100.P30.codeSlack
For finite types and with decidable equality, any indexed collection of Boolean words , and any real , define the matrix indexed by by
where is when holds and otherwise. This defines the code slack to be the infimum of all real admitting a Hermitian matrix indexed by such that is positive semidefinite and both sums
equal for every . An empty or unbounded-below feasible set has real infimum . No restriction on , injectivity of , or nonemptiness of the index types is imposed; an empty coordinate product equals .
QAlgorithms.Papers.Independent.Intakethird100.P30.codeWordXor
For any index type and functions , this defines their coordinatewise exclusive-or: is true exactly when . If is empty, the result is the unique function on the empty type.
QAlgorithms.Papers.Independent.Intakethird100.P30.columnOrbitCandidates
For arbitrary natural numbers and any collection of Boolean words of length , this defines the finite set
where denotes prepending the bit , and, for a finite set of length- words,
The result is therefore a finite set of orbits, each orbit being a finite set of finite word sets. Repeated words and repeated orbits are discarded. No injectivity assumption on is imposed; when or , there are no varying columns and the result is empty.
QAlgorithms.Papers.Independent.Intakethird100.P30.complementExtension
For every natural number and finite set of Boolean words of length , this defines the finite set of length- words
where the displayed first bit is prepended and reverses every bit of . The definition includes empty , giving the empty set, and , when is a subset of the singleton set consisting of the empty word.
QAlgorithms.Papers.Independent.Intakethird100.P30.complementaryOperator
For finite index types with decidable equality and any complex matrix indexed by , let , where is applied by the real continuous functional calculus. This defines a matrix indexed by through
Equivalently, the summands are entries of the matrix , where . No positivity or normalization assumption is imposed on ; for Hermitian , negative eigenvalues contribute zero under the real square root, and for non-Hermitian , . Empty index types are allowed, and an empty sum is zero.
QAlgorithms.Papers.Independent.Intakethird100.P30.cyclicBellVector
For every natural number and indices , this defines a vector in the complex Euclidean space indexed by , with coordinates
The remainder is computed using natural numbers, while the division in the exponential is real division. The supplied indices force ; for there are no choices of .
QAlgorithms.Papers.Independent.Intakethird100.P30.deleteConstants
For types and a function , this defines a function with the same word index type , restricted to coordinates for which some satisfy : its value at word index and such a coordinate is . If there are no such coordinates, every indexed word is the unique function on the empty coordinate type.
QAlgorithms.Papers.Independent.Intakethird100.P30.diagonalLaw
For finite index types , any complex matrix with rows and columns indexed by , and elements , , this defines the real value , where . No positivity or normalization condition on is imposed, and the value is whenever the real part of its trace is , because real division by zero is defined to give .
QAlgorithms.Papers.Independent.Intakethird100.P30.forgottenAnnouncement
For every natural number , finite type with its specified finite enumeration, family of finite sets , finite set , and real number , this defines a complex matrix indexed by . Its entry at row and column is
No restriction on , partition condition, or nonemptiness condition is imposed. In particular, a pair belonging to several accepted cells contributes once for each such cell. An empty accepted set gives zero, and for the product is the empty product .
QAlgorithms.Papers.Independent.Intakethird100.P30.fourWordCode
For every natural number , this defines a Boolean word for each pair of Boolean values on the disjoint union of a singleton coordinate set and an -element coordinate set: its value on the singleton is , and its value at each of the other coordinates is . Equivalently, it is the word with copies of . This includes , when the word has only the singleton coordinate and is independent of .
QAlgorithms.Papers.Independent.Intakethird100.P30.multiCode
For any type , coordinate types and label types depending on , and maps , this defines a code whose labels are dependent choices , with , and whose coordinates are pairs with , by
No finiteness, nonemptiness, or injectivity assumptions are imposed. In particular, if is empty, both the label-assignment type and the Boolean-string type on the resulting empty coordinate type have a single element.
QAlgorithms.Papers.Independent.Intakethird100.P30.otherMarginal
For an index type , a finite index type , and any complex matrix indexed by , this defines a matrix on by
Thus the sum uses the same value in the middle coordinate of the row and column. No positivity, Hermitian symmetry, or trace condition is assumed on . If is empty, the resulting matrix has an empty index set.
QAlgorithms.Papers.Independent.Intakethird100.P30.prependCodeColumn
For arbitrary natural numbers , a collection of Boolean words of length , and a Boolean column indexed by the same labels, this defines the collection of length- words whose word at label has first bit and remaining bits equal to . Explicitly, its coordinate is , and its coordinate is for . No injectivity or variation condition is imposed; gives an empty indexed collection, and gives one-bit words.
QAlgorithms.Papers.Independent.Intakethird100.P30.publicAnnouncement
For every natural number , finite type with its specified finite enumeration, family of finite sets , finite set , and real number , this defines a complex matrix indexed by . Write
for bits . Its entry at row and column is
There are no assumptions on , on whether the cells are nonempty or form a partition, or on whether the accepted set is nonempty. An empty accepted set gives the zero matrix; when , the displayed product is ; and when is empty, the matrix has an empty index type.
QAlgorithms.Papers.Independent.Intakethird100.P30.repetition
For any type , this defines the function taking each Boolean to the constant word with value at every coordinate. If is empty, both Boolean inputs produce the same empty word.
QAlgorithms.Papers.Independent.Intakethird100.P30.repetitionApprox
For every natural number , set , using real exponentiation and real division, and set ; this defines the real value , where the square root is the real square-root function. The definition includes : real division gives , so , , and the resulting value is .
QAlgorithms.Papers.Independent.Intakethird100.P30.repetitionPolynomial
For every natural number and real number , this defines the real value . There is no restriction on ; is included and gives the value for every , using the convention that every zeroth power, including , is .
QAlgorithms.Papers.Independent.Intakethird100.P30.sdpMinimum
For finite index types and with decidable equality and any complex matrix indexed by , this defines a real number as the infimum of all real for which there exists a Hermitian matrix indexed by such that is positive semidefinite and, for every and ,
There is no positivity or normalization assumption on , and no attainment assertion in this definition. The real infimum is interpreted as if its defining set is empty or unbounded below.
QAlgorithms.Papers.Independent.Intakethird100.P30.simplexA
For every triple of natural numbers and every real number , this defines
The coefficients use real subtraction , and the exponent uses truncated natural-number subtraction. There are no restrictions on the parameters and no nonzero-denominator hypothesis: division by zero has value , so in particular the value is when . Zeroth powers, including , are .
QAlgorithms.Papers.Independent.Intakethird100.P30.simplexB
For every triple of natural numbers and every real number , this defines
The denominator's coefficients use real subtraction , and the exponent uses truncated natural-number subtraction. There are no restrictions on the parameters and no nonzero-denominator hypothesis: division by zero has value , so in particular the value is when . Zeroth powers, including , are .
QAlgorithms.Papers.Independent.Intakethird100.P30.simplexS
For every natural number and every real number , this defines
There is no restriction on ; when , the value is , including when the base is zero.
QAlgorithms.Papers.Independent.Intakethird100.P30.simplexU
For every pair of natural numbers and every real number , this defines
The subtraction in the exponent is natural-number subtraction, so the exponent is whenever . No condition or restriction on is imposed, and every zeroth power, including , is .
QAlgorithms.Papers.Independent.Intakethird100.P30.simplexV
For every pair of natural numbers and every real number , this defines
The subtraction in the exponent is natural-number subtraction, so the exponent is whenever . No condition or restriction on is imposed, and every zeroth power, including , is .
QAlgorithms.Papers.Independent.Intakethird100.P30.simplexWeights
For natural numbers , a real number , and indices , put
The defined weight is
Here in the coefficients is real subtraction, the exponent uses truncated natural-number subtraction, and zeroth powers are , including . No restriction on or nonvanishing condition on is imposed; if , all these quotients are . When , there are no indices at which to evaluate the function.
QAlgorithms.Papers.Independent.Intakethird100.P30.simplexZ
For every triple of natural numbers and every real number , this defines
where is regarded as a real number in the coefficients, so there is real subtraction, while the exponent uses truncated natural-number subtraction. No positivity or nonvanishing condition is imposed; in particular, gives . Zeroth powers are , including .
QAlgorithms.Papers.Independent.Intakethird100.P30.sixState
For every real number , this defines the complex matrix , with rows and columns indexed by pairs of Boolean values, by
where is when holds and otherwise. Equivalently, , where . The parameter is unrestricted; in particular, the definition imposes no positivity condition on the resulting matrix.
QAlgorithms.Papers.Independent.Intakethird100.P30.sixStateBellPair
This defines a vector by when , and otherwise. Thus , where denotes false, denotes true, and is the coordinate vector supported at .
QAlgorithms.Papers.Independent.Intakethird100.P30.sixStateCopies
For every finite type and every real number , this defines a complex matrix indexed by pairs of Boolean functions on . Its entry at row and column , where , is
Here denotes the indicator of , and no restriction is placed on . If is empty, the product is , so the resulting matrix has its sole entry equal to .
QAlgorithms.Papers.Independent.Intakethird100.P30.slackValues
For finite index types and any complex matrix indexed by , this defines the set of all real numbers for which there exists a complex matrix indexed by such that is Hermitian, is positive semidefinite, and, for every and ,
Here is the identity matrix on the index type of . The witness may depend on ; no nonnegativity restriction on or trace normalization is imposed. If or is empty, this set is all of .
QAlgorithms.Papers.Independent.Intakethird100.P30.tableEntries
This defines the following ordered list of triples of natural numbers:
QAlgorithms.Papers.Independent.Intakethird100.P30.threshold
For finite index types and any function assigning a complex matrix on to each real number, this defines
No continuity, positivity, or normalization assumption is imposed on . The inserted makes the set nonempty, and all its elements lie in ; if there are no qualifying , the value is . In particular, it is when either or is empty.
QAlgorithms.Papers.Independent.Intakethird100.P30.transformCodeSet
For every natural number , permutation of the coordinate set , word , and finite set , this defines the finite set
where is Boolean exclusive-or. This is a set image, so repeated image values are counted only once. The empty set maps to the empty set; for , the transformation leaves every possible unchanged.
QAlgorithms.Papers.Independent.Intakethird100.P30.twistedExtension
For every natural number , finite set of Boolean words of length , coordinate permutation of , and Boolean word of length , this defines the finite set
Thus the first part prepends to each original word, and the second prepends to each word obtained by the specified coordinate permutation and coordinatewise exclusive-or with . Empty gives the empty set; for , the permutation and Boolean offset are the unique empty ones.
QAlgorithms.Papers.Independent.Intakethird100.P30.vectorPurification
For finite index types with decidable equality and any complex matrix indexed by , this defines a vector by
where is obtained using the real continuous functional calculus. No positivity, Hermitian, trace, or normalization hypothesis is imposed on . For Hermitian , this applies the real square-root function to its eigenvalues, with for ; for non-Hermitian , this real functional calculus returns the zero matrix. Empty index types are allowed.
QAlgorithms.Papers.Independent.Intakethird100.P30.xorSectorBlock
For finite coordinate and label types , a code , any real , and any Boolean string , this defines a complex matrix indexed by , with
where is Boolean XOR and
Here is when holds and otherwise, and these real entries are viewed as complex numbers. This is the restriction of the matrix obtained by applying the code-selection matrix on the second subsystem of the product of the two-bit states . No injectivity or range condition on is imposed. An empty coordinate type gives every entry value , and an empty label type gives an empty matrix.
QAlgorithms.Papers.Independent.Intakethird100.P30.xorSectorPermutation
For coordinate and label types and a code , this defines the complex matrix , whose rows and columns are indexed by , by
Thus its entry is precisely when the row index is obtained from the column index by XORing the Boolean string with the codeword indexed by its label and retaining that label. No injectivity assumption on is part of this definition; when is empty, the string condition is vacuous.
QAlgorithms.Papers.Independent.Intakethird100.P30.zeroTail
For every natural number and finite set of Boolean strings of length , is the set of length- strings obtained by keeping exactly the strings in whose first bit is false and deleting that first bit:
Repeated tails appear only once because the result is a set. This definition includes empty and , where a tail is the unique empty string.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.