Definitions for Continuous symmetries and approximate quantum error correction
DefinitionQAlgorithms_Papers_Independent_Extend50_P22The objects the formalized statements of Continuous symmetries and approximate quantum error correction (arXiv:1902.07714) are stated in. Each was checked against the paper by a blind read-back and a moderator.
entangledInputRootFidelity: PDF p.6, (6): root fidelity on one fixed reference-entangled unit input.fixedFidelity: PDF p.6, (8a), and pp.27,67: optimize over all CPTP recoveries for a fixed input. On the channels and unit inputs used below this set is nonempty and bounded in [0,1].worstFidelity: PDF p.6, (7),(8b): one recovery is chosen before the minimum over unit inputs.errorE: PDF p.6, (9a): the average-entanglement error, not average pure-state error.errorWorst: PDF p.6, (9b): optimal worst-case entanglement infidelity parameter.TensorBasis: Finite tensor-product computational coordinates (PDF p.5).CovariantErasureCodeData: PDF p.5, isometric code with positive logical and local dimensions and n>0.splice: PDF p.6, (11b): splice erased coordinates back into a remaining configuration.erase: PDF p.6, (11b): erasure resets the chosen sites to fixed normalized pure vectors.CovariantErasureCodeData.reset: The coordinate choice for the arbitrary fixed pure resets in (10), PDF p.6.locationFlaggedChannel: PDF p.6, (11a): orthogonal location flag, including all off-diagonal input blocks.CovariantErasureCodeData.noise: PDF pp.6,8: composite encoding and single located erasure, with probabilities q.CovariantErasureCodeData.uniformNoise: PDF p.8: uniform single erasure qi=1/n.finiteMax: PDF p.8: finite maximum, always used with an explicitly positive number of sites.chargeRange: PDF p.8: spectral range, from the actual Hermitian eigenvalues with multiplicity. Its uses below have positive dimension, so both finite extrema are attained.meanSpread: PDF pp.8,36: the trace-norm mean-centered charge spread, with factor 1/(2d).liftLocal: PDF p.8: lift one local observable, with identity on every other site.ChargeCovariant: PDF pp.7–8, (21): exact charge covariance, including the allowed scalar offset.localTensorProduct: PDF pp.8,15: tensor product of local physical operators.Transversal: PDF p.53: pointwise transversality; no continuity of individual factor choices is asserted.SUCovariant: PDF pp.14,56: continuous transversal representations of SU(d), defining logical action.FullAction: PDF p.15, (53): actual continuous local U(d) representations implementing the logical U.CovariantErasureCodeData.maxDim: PDF pp.14–16: largest local dimension; never the total physical dimension.CovariantErasureCodeData.logDim: PDF p.14: max_i ln(di), equivalently ln(max_i di) since all di are positive.chargeEvolution: PDF p.7, (17): the source's negative-sign one-parameter unitary action.hilbertRootFidelity: PDF pp.5,68: root fidelity on general Hilbert-space density operators. The accepted trace-class model supplies the basis trace. On positive trace-class inputs the square-root sandwich has trace-class square root, so this series is absolutely summable; a finite-dimensional cutoff is not imposed.gaussianNormalization: PDF pp.12,41: the same Gaussian normalization c_w as (39),(D.13).theta3Imaginary: PDF p.46: DLMF nome convention theta3(i*b,q); every summand is real for imaginary z.theta2Zero: PDF p.46: theta2(0,q) in the source's nome convention.normalizedWeylDimension: PDF p.55, (E.8): finite-row adapter to the accepted Weyl dimension formula. The zero extension outside d is never read by the product.symmetricRows: PDF p.55: nonnegative rows of the accepted symmetric highest weight. Int.toNat is lossless because every entry of this weight is nonnegative.upSpins: PDF p.49, (D.60): number of up-spins at magnetization m (used only at admissible parity).dickeMarginalWeight: PDF p.49, (D.60): hypergeometric weights in the common d-spin Dicke eigenbasis. The explicit k<=upSpins branch prevents truncated subtraction from inventing a binomial term.dickeMarginalRootFidelity: PDF p.49, (D.61): root fidelity of the actual commuting magnetization marginals.basisMapMatrix: PDF pp.17–19: matrix of a computational-basis map, with output index first. The definition accepts any function; the group actions used below are bijective.uniformErase: PDF p.6, (11b): uniform-coordinate erasure with an arbitrary fixed basis reset.groupErase: PDF pp.17–19: erase a subset of uniformly G-labelled sites, resetting them to |1>.CorrectsGroupErasure: PDF p.18: exact correctability is existence of one CPTP recovery acting on every operator. The recovery is chosen before the input; no performance predicate is assumed as a hypothesis.orbitEncoding: PDF p.18: normalized finite-group orbit sum. The displayed constructions make g recoverable from their first output coordinate, so there are |G| distinct terms.groupFourEncoding: PDF p.18, (65): preserve the order of all four noncommutative group products.stabilizedFourEncoding: PDF p.18, (67): the distinct stabilized four-site code.groupAt: PDF pp.18–19: total indexing helper for the alternating even-length word. The default is used only outside the logical index interval, at the separately handled endpoints.evenWord: PDF pp.18–19, (68): the general word, with (68) its m=4 example. m=k+2, so endpoints and the nontrivial logical system are present. The second coordinate is handled separately to avoid truncated 1-2 subtraction.evenEncoding: PDF pp.18–19: normalized collective-left orbit of the alternating word.evenPhysical: PDF p.19, (69): right multipliers on adjacent pairs of physical sites.evenLogical: PDF p.19, (70): the independent odd-numbered logical right multipliers.bitEncoding: PDF p.17, (60a): the three-site bit code.groupPhaseEncoding: PDF p.17, (60b): the three-site phase code, with ordered group product.shiftError: PDF p.17: one local left shift, including the identity error.diagonalError: PDF p.17: arbitrary diagonal error on the specified site.CorrectsOperators: PDF pp.17–18: exact Knill–Laflamme criterion for the span of a specified error family.baconShorEncoding: PDF p.18: concatenate m-fold phase encoding with an m-fold bit encoding of each factor. The first member k=0 is the one-site identity code.cyclicEncoding: PDF p.19, (72): the finite cyclic candidate, normalized for every positive modulus.wEncoding: PDF p.16, (55): normalized W-code isometry, vacancy labelled d in each local Fin(d+1).sharpDims: PDF p.11: finite interval embeddings containing the complete support of (36), including the x-dependent second and third coordinate ranges.sharpEncoding: PDF p.11, (36): the sharp code, without discarding any amplitude outside [-m,m] in the second and third physical coordinates.CorrectsUniformErasure: PDF pp.12,18,23: exact recovery of a uniform-coordinate erased set, with fixed reset.fiveQuditEncoding: PDF p.12, (42),(43): normalized cyclic five-qudit tensor; phases are evaluated modulo D.quditCharge: PDF p.12: natural integer charge on one qudit, distinguished from its value modulo D.twoLocalEncoding: PDF p.23: standard [[4,2,2]] basis, ordered so XXII flips the first logical bit.twoLocalQ: PDF p.23: Q=X tensor X tensor I tensor I, supported on the first two physical qubits.firstLogicalX: PDF p.23: the nontrivial first-logical-qubit Pauli X.tensorCartan: PDF p.56: the specified Cartan generator diag(1,0,...,0,-1) on tensor space. It is the sum of the one-cell generators, with the inherited Hilbert inner product.schurCartan: PDF p.56: actual generator on the constructed Schur module. Restriction is expressed using orthogonal projection, as in the accepted polynomial representation; tensorCartan preserves the Young-symmetrizer image. Its norm is the Hilbert operator norm.
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Channel
import Definitions.Def_QAlgorithms_Defs_QuantumInformation
import Definitions.Def_QAlgorithms_Defs_MatrixDistances
import Definitions.Def_QAlgorithms_Defs_SchurModules
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P22
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P65
import Definitions.Def_QAlgorithms_Papers_Independent_Support21_P09
import Definitions.Def_QAlgorithms_Papers_Independent_Renew46_P45
import Definitions.Def_QAlgorithms_Papers_Independent_Dependency50_P13
/-!
Statements from Faist et al., arXiv:1902.07714v1. All page numbers are PDF pages.
The finite-dimensional model uses arbitrary CPTP recovery maps and root fidelity.
The reference is a copy of the logical register. Fixed reset vectors are computational
basis vectors: choosing these is a coordinate convention for the fixed pure resets
in (10), which the receiver can replace freely. Infinite-dimensional results whose
full interfaces are not completed are explicitly inventoried in HARD.md and GAPS.json.
Compilation is pending the batch mechanical stage.
-/
noncomputable section
open scoped Matrix ComplexConjugate ComplexOrder
namespace QAlgorithms.Papers.Independent.Extend50.P22
attribute [local instance] Classical.propDecidable Classical.decEq
open QAlgorithms.Papers.Independent.Information100.P22 (bell)
open QAlgorithms.Papers.Independent.Support21.P09 (Irreducible)
open QAlgorithms.Papers.Independent.Renew46.P45 (symmetricWeight)
/-- PDF p.6, (6): root fidelity on one fixed reference-entangled unit input. -/
def entangledInputRootFidelity {d : ℕ} (K : Superop (Fin d) (Fin d))
(psi : EuclideanSpace ℂ (Fin d × Fin d)) : ℝ :=
rootFidelity (pureDensity psi) (idTensorSuperop K (pureDensity psi))
/-- PDF p.6, (8a), and pp.27,67: optimize over all CPTP recoveries for a fixed input.
On the channels and unit inputs used below this set is nonempty and bounded in [0,1]. -/
def fixedFidelity {d : ℕ} {B : Type*} [Fintype B] [DecidableEq B]
(C : Superop (Fin d) B) (psi : EuclideanSpace ℂ (Fin d × Fin d)) : ℝ :=
sSup {f | ∃ R : Superop B (Fin d), IsChannel R ∧ f = entangledInputRootFidelity (R ∘ C) psi}
/-- PDF p.6, (7),(8b): one recovery is chosen before the minimum over unit inputs. -/
def worstFidelity {d : ℕ} {B : Type*} [Fintype B] [DecidableEq B]
(C : Superop (Fin d) B) : ℝ :=
sSup {f | ∃ R : Superop B (Fin d), IsChannel R ∧
f = sInf {g | ∃ psi : EuclideanSpace ℂ (Fin d × Fin d),
IsState psi ∧ g = entangledInputRootFidelity (R ∘ C) psi}}
/-- PDF p.6, (9a): the average-entanglement error, not average pure-state error. -/
def errorE {d : ℕ} {B : Type*} [Fintype B] [DecidableEq B]
(C : Superop (Fin d) B) : ℝ :=
Real.sqrt (1 - fixedFidelity C (bell (Fin d)) ^ 2)
/-- PDF p.6, (9b): optimal worst-case entanglement infidelity parameter. -/
def errorWorst {d : ℕ} {B : Type*} [Fintype B] [DecidableEq B]
(C : Superop (Fin d) B) : ℝ :=
Real.sqrt (1 - worstFidelity C ^ 2)
/-- Finite tensor-product computational coordinates (PDF p.5). -/
abbrev TensorBasis {n : ℕ} (dims : Fin n → ℕ) := (i : Fin n) → Fin (dims i)
/-- PDF p.5, isometric code with positive logical and local dimensions and n>0. -/
structure CovariantErasureCodeData (d n : ℕ) where
logicalPositive : 0 < d
sitesPositive : 0 < n
dims : Fin n → ℕ
dimsPositive : ∀ i, 0 < dims i
V : Matrix (TensorBasis dims) (Fin d) ℂ
isometry : Vᴴ * V = 1
/-- PDF p.6, (11b): splice erased coordinates back into a remaining configuration. -/
def splice {n : ℕ} {dims : Fin n → ℕ} (S : Finset (Fin n))
(y : TensorBasis dims) (a : (i : S) → Fin (dims i)) : TensorBasis dims :=
fun i => if h : i ∈ S then a ⟨i, h⟩ else y i
/-- PDF p.6, (11b): erasure resets the chosen sites to fixed normalized pure vectors. -/
def erase {n : ℕ} {dims : Fin n → ℕ} (S : Finset (Fin n))
(reset : (i : Fin n) → Fin (dims i)) : Superop (TensorBasis dims) (TensorBasis dims) :=
fun X y z => if (∀ i ∈ S, y i = reset i ∧ z i = reset i) then
∑ a : (i : S) → Fin (dims i), X (splice S y a) (splice S z a) else 0
/-- The coordinate choice for the arbitrary fixed pure resets in (10), PDF p.6. -/
def CovariantErasureCodeData.reset {d n : ℕ} (c : CovariantErasureCodeData d n) (i : Fin n) : Fin (c.dims i) :=
⟨0, c.dimsPositive i⟩
/-- PDF p.6, (11a): orthogonal location flag, including all off-diagonal input blocks. -/
def locationFlaggedChannel {K A B : Type*} [Fintype K] (q : K → ℝ) (C : K → Superop A B) :
Superop A (K × B) :=
fun X y z => if y.1 = z.1 then (q y.1 : ℂ) * C y.1 X y.2 z.2 else 0
/-- PDF pp.6,8: composite encoding and single located erasure, with probabilities q. -/
def CovariantErasureCodeData.noise {d n : ℕ} (c : CovariantErasureCodeData d n) (q : Fin n → ℝ) :
Superop (Fin d) (Fin n × TensorBasis c.dims) :=
locationFlaggedChannel q (fun i => erase {i} c.reset ∘ conjSuperop c.V)
/-- PDF p.8: uniform single erasure qi=1/n. -/
def CovariantErasureCodeData.uniformNoise {d n : ℕ} (c : CovariantErasureCodeData d n) := c.noise (fun _ => (n : ℝ)⁻¹)
/-- PDF p.8: finite maximum, always used with an explicitly positive number of sites. -/
def finiteMax {B : Type*} [LinearOrder B] {n : ℕ} (hn : 0 < n) (f : Fin n → B) : B :=
Finset.univ.sup' ⟨⟨0, hn⟩, Finset.mem_univ _⟩ f
/-- PDF p.8: spectral range, from the actual Hermitian eigenvalues with multiplicity.
Its uses below have positive dimension, so both finite extrema are attained. -/
def chargeRange {I : Type*} [Fintype I] [DecidableEq I] (T : Matrix I I ℂ) : ℝ :=
sSup (Set.range (ascEigenvalues T)) - sInf (Set.range (ascEigenvalues T))
/-- PDF pp.8,36: the trace-norm mean-centered charge spread, with factor 1/(2d). -/
def meanSpread {d : ℕ} (T : Matrix (Fin d) (Fin d) ℂ) : ℝ :=
traceNorm (T - (T.trace / (d : ℂ)) • (1 : Matrix (Fin d) (Fin d) ℂ)) / (2 * d)
/-- PDF p.8: lift one local observable, with identity on every other site. -/
def liftLocal {n : ℕ} {dims : Fin n → ℕ} (i : Fin n)
(T : Matrix (Fin (dims i)) (Fin (dims i)) ℂ) : Matrix (TensorBasis dims) (TensorBasis dims) ℂ :=
fun y z => T (y i) (z i) * ∏ j ∈ Finset.univ.erase i, if y j = z j then 1 else 0
/-- PDF pp.7–8, (21): exact charge covariance, including the allowed scalar offset. -/
def ChargeCovariant {d n : ℕ} (c : CovariantErasureCodeData d n) (TL : Matrix (Fin d) (Fin d) ℂ)
(Ti : (i : Fin n) → Matrix (Fin (c.dims i)) (Fin (c.dims i)) ℂ) : Prop :=
TL.IsHermitian ∧ (∀ i, (Ti i).IsHermitian) ∧ ∃ nu : ℝ,
(∑ i, liftLocal i (Ti i)) * c.V = c.V * (TL - (nu : ℂ) • 1)
/-- PDF pp.8,15: tensor product of local physical operators. -/
def localTensorProduct {n : ℕ} {dims : Fin n → ℕ}
(U : (i : Fin n) → Matrix (Fin (dims i)) (Fin (dims i)) ℂ) :
Matrix (TensorBasis dims) (TensorBasis dims) ℂ := fun y z => ∏ i, U i (y i) (z i)
/-- PDF p.53: pointwise transversality; no continuity of individual factor choices is asserted. -/
def Transversal {n : ℕ} {dims : Fin n → ℕ} (U : Matrix (TensorBasis dims) (TensorBasis dims) ℂ) : Prop :=
∃ u : (i : Fin n) → Matrix.unitaryGroup (Fin (dims i)) ℂ,
U = localTensorProduct (fun i => (u i : Matrix _ _ ℂ))
/-- PDF pp.14,56: continuous transversal representations of SU(d), defining logical action. -/
def SUCovariant {d n : ℕ} (c : CovariantErasureCodeData d n) : Prop :=
∃ r : (i : Fin n) → Matrix.specialUnitaryGroup (Fin d) ℂ →*
Matrix.unitaryGroup (Fin (c.dims i)) ℂ,
(∀ i, Continuous (r i)) ∧ ∀ U,
localTensorProduct (fun i => (r i U : Matrix _ _ ℂ)) * c.V =
c.V * (U : Matrix (Fin d) (Fin d) ℂ)
/-- PDF p.15, (53): actual continuous local U(d) representations implementing the logical U. -/
structure FullAction {d n : ℕ} (c : CovariantErasureCodeData d n) where
localRep : (i : Fin n) → Matrix.unitaryGroup (Fin d) ℂ →*
Matrix.unitaryGroup (Fin (c.dims i)) ℂ
continuous : ∀ i, Continuous (localRep i)
intertwines : ∀ U, localTensorProduct (fun i => (localRep i U : Matrix _ _ ℂ)) * c.V =
c.V * (U : Matrix (Fin d) (Fin d) ℂ)
/-- PDF pp.14–16: largest local dimension; never the total physical dimension. -/
def CovariantErasureCodeData.maxDim {d n : ℕ} (c : CovariantErasureCodeData d n) : ℕ := finiteMax c.sitesPositive c.dims
/-- PDF p.14: max_i ln(di), equivalently ln(max_i di) since all di are positive. -/
def CovariantErasureCodeData.logDim {d n : ℕ} (c : CovariantErasureCodeData d n) : ℝ := Real.log (c.maxDim : ℝ)
/-- PDF p.7, (17): the source's negative-sign one-parameter unitary action. -/
def chargeEvolution {I : Type*} [Fintype I] [DecidableEq I]
(T : Matrix I I ℂ) (theta : ℝ) : Matrix I I ℂ :=
NormedSpace.exp ((-Complex.I * (theta : ℂ)) • T)
/-- PDF pp.5,68: root fidelity on general Hilbert-space density operators.
The accepted trace-class model supplies the basis trace. On positive trace-class
inputs the square-root sandwich has trace-class square root, so this series is
absolutely summable; a finite-dimensional cutoff is not imposed. -/
def hilbertRootFidelity {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H]
[CompleteSpace H] {I : Type*} (basis : HilbertBasis I ℂ H)
(rho sigma : H →L[ℂ] H) : ℝ :=
let S := cfc Real.sqrt rho
(QAlgorithms.Papers.Independent.Dependency50.P13.operatorTrace basis
(cfc Real.sqrt (S.comp (sigma.comp S)))).re
example {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H]
[CompleteSpace H] {I : Type*} (basis : HilbertBasis I ℂ H) :
hilbertRootFidelity basis 0 0 = 0 := by
simp [hilbertRootFidelity,
QAlgorithms.Papers.Independent.Dependency50.P13.operatorTrace, cfc_zero]
/-- PDF pp.12,41: the same Gaussian normalization c_w as (39),(D.13). -/
def gaussianNormalization (w : ℝ) : ℝ := ∑' y : ℤ, Real.exp (-((y : ℝ) ^ 2) / (2 * w ^ 2))
/-- PDF p.46: DLMF nome convention theta3(i*b,q); every summand is real for imaginary z. -/
def theta3Imaginary (b q : ℝ) : ℝ :=
∑' k : ℤ, Real.exp ((k : ℝ) ^ 2 * Real.log q - 2 * k * b)
/-- PDF p.46: theta2(0,q) in the source's nome convention. -/
def theta2Zero (q : ℝ) : ℝ :=
∑' k : ℤ, Real.exp (((k : ℝ) + 1 / 2) ^ 2 * Real.log q)
/-- PDF p.55, (E.8): finite-row adapter to the accepted Weyl dimension formula.
The zero extension outside d is never read by the product. -/
def normalizedWeylDimension {d : ℕ} (lambda : Fin d → ℕ) : ℝ :=
QAlgorithms.Papers.Independent.Information100.P65.weylDimension
(fun a => if ha : a < d then lambda ⟨a, ha⟩ else 0) d
/-- PDF p.55: nonnegative rows of the accepted symmetric highest weight.
Int.toNat is lossless because every entry of this weight is nonnegative. -/
def symmetricRows (d l : ℕ) : Fin d → ℕ :=
fun i => (symmetricWeight d l i).toNat
/-- PDF p.49, (D.60): number of up-spins at magnetization m (used only at admissible parity). -/
def upSpins (N : ℕ) (m : ℤ) : ℕ := (((N : ℤ) + m) / 2).toNat
/-- PDF p.49, (D.60): hypergeometric weights in the common d-spin Dicke eigenbasis.
The explicit k<=upSpins branch prevents truncated subtraction from inventing a binomial term. -/
def dickeMarginalWeight (N d : ℕ) (m : ℤ) (k : Fin (d + 1)) : ℝ :=
if k.val ≤ upSpins N m then
(Nat.choose d k.val : ℝ) * Nat.choose (N - d) (upSpins N m - k.val) /
Nat.choose N (upSpins N m) else 0
/-- PDF p.49, (D.61): root fidelity of the actual commuting magnetization marginals. -/
def dickeMarginalRootFidelity (N d : ℕ) (m : ℤ) : ℝ :=
∑ k : Fin (d + 1), Real.sqrt (dickeMarginalWeight N d m k * dickeMarginalWeight N d 0 k)
/-- Sanity examples pin normalization, flag coherences, boundary indexing, and dimensions.
They are local definition checks, not proofs of the paper's theorems. -/
example : bell (Fin 1) (0, 0) = 1 := by simp [bell]
example (d : ℕ) (i : Fin d) : bell (Fin d) (i, i) = ((Real.sqrt (d : ℝ))⁻¹ : ℂ) := by
simp [bell]
example {K A B : Type*} [Fintype K] (q : K → ℝ) (C : K → Superop A B)
(X : Matrix A A ℂ) (k : K) (b b' : B) :
locationFlaggedChannel q C X (k, b) (k, b') = (q k : ℂ) * C k X b b' := by simp [locationFlaggedChannel]
example {n : ℕ} {dims : Fin n → ℕ} (y : TensorBasis dims)
(a : (i : (∅ : Finset (Fin n))) → Fin (dims i)) : splice ∅ y a = y := by
funext i
simp [splice]
example {I : Type*} [Fintype I] [DecidableEq I] (T : Matrix I I ℂ) :
chargeEvolution T 0 = 1 := by simp [chargeEvolution]
example : normalizedWeylDimension (symmetricRows 2 1) = 2 := by
norm_num [normalizedWeylDimension,
QAlgorithms.Papers.Independent.Information100.P65.weylDimension,
symmetricRows, symmetricWeight, Finset.prod_range_succ]
example (N d : ℕ) (m : ℤ) (k : Fin (d + 1)) (hk : upSpins N m < k.val) :
dickeMarginalWeight N d m k = 0 := by simp [dickeMarginalWeight, Nat.not_le.mpr hk]
/-- PDF pp.17–19: matrix of a computational-basis map, with output index first.
The definition accepts any function; the group actions used below are bijective. -/
def basisMapMatrix {I : Type*} (f : I → I) : Matrix I I ℂ :=
fun y x => if y = f x then 1 else 0
/-- PDF p.6, (11b): uniform-coordinate erasure with an arbitrary fixed basis reset. -/
def uniformErase {J A : Type*} [Fintype J] [Fintype A] (S : Finset J) (reset : J → A) :
Superop (J → A) (J → A) :=
fun X y z => if (∀ i ∈ S, y i = reset i ∧ z i = reset i) then
∑ a : S → A,
X (fun i => if hi : i ∈ S then a ⟨i, hi⟩ else y i)
(fun i => if hi : i ∈ S then a ⟨i, hi⟩ else z i) else 0
/-- PDF pp.17–19: erase a subset of uniformly G-labelled sites, resetting them to |1>. -/
def groupErase {J G : Type*} [Fintype J] [Fintype G] [Group G] (S : Finset J) :
Superop (J → G) (J → G) :=
fun X y z => if (∀ i ∈ S, y i = 1 ∧ z i = 1) then
∑ a : S → G,
X (fun i => if hi : i ∈ S then a ⟨i, hi⟩ else y i)
(fun i => if hi : i ∈ S then a ⟨i, hi⟩ else z i) else 0
/-- PDF p.18: exact correctability is existence of one CPTP recovery acting on every operator.
The recovery is chosen before the input; no performance predicate is assumed as a hypothesis. -/
def CorrectsGroupErasure {J G L : Type*} [Fintype J] [Fintype G] [Group G]
[Fintype L] [DecidableEq L] (V : Matrix (J → G) L ℂ) (S : Finset J) : Prop :=
∃ R : Superop (J → G) L, IsChannel R ∧ ∀ X, R (groupErase S (conjSuperop V X)) = X
/-- PDF p.18: normalized finite-group orbit sum. The displayed constructions make g
recoverable from their first output coordinate, so there are |G| distinct terms. -/
def orbitEncoding {G L J : Type*} [Fintype G] [Fintype J]
(word : G → L → J → G) : Matrix (J → G) L ℂ :=
fun y x => ((Real.sqrt (Fintype.card G : ℝ))⁻¹ : ℂ) *
∑ g : G, if y = word g x then 1 else 0
/-- PDF p.18, (65): preserve the order of all four noncommutative group products. -/
def groupFourEncoding (G : Type*) [Group G] [Fintype G] : Matrix (Fin 4 → G) (G × G) ℂ :=
orbitEncoding (fun g x => ![g, g⁻¹ * x.1, g * x.2, g⁻¹ * x.1 * x.2])
/-- PDF p.18, (67): the distinct stabilized four-site code. -/
def stabilizedFourEncoding (G : Type*) [Group G] [Fintype G] :
Matrix (Fin 4 → G) (G × G) ℂ :=
orbitEncoding (fun g x => ![g, g * x.1, g * x.2 * x.1, g * x.2])
/-- PDF pp.18–19: total indexing helper for the alternating even-length word.
The default is used only outside the logical index interval, at the separately handled endpoints. -/
def groupAt {G : Type*} [Group G] {k : ℕ} (x : Fin k → G) (j : ℕ) : G :=
if h : j < k then x ⟨j, h⟩ else 1
/-- PDF pp.18–19, (68): the general word, with (68) its m=4 example.
m=k+2, so endpoints and the nontrivial logical system are present.
The second coordinate is handled separately to avoid truncated 1-2 subtraction. -/
def evenWord {G : Type*} [Group G] (k : ℕ) (x : Fin (2 * (k + 2) - 2) → G) :
Fin (2 * (k + 2)) → G :=
fun j => if j.val = 0 then 1 else if j.val = 2 * (k + 2) - 1 then
groupAt x (2 * (k + 2) - 3) else if j.val = 1 then groupAt x 0 else if j.val % 2 = 0 then
groupAt x (j.val - 1) * groupAt x (j.val - 2) else
groupAt x (j.val - 2) * groupAt x (j.val - 1)
/-- PDF pp.18–19: normalized collective-left orbit of the alternating word. -/
def evenEncoding (G : Type*) [Group G] [Fintype G] (k : ℕ) :
Matrix (Fin (2 * (k + 2)) → G) (Fin (2 * (k + 2) - 2) → G) ℂ :=
orbitEncoding (fun g x j => g * evenWord k x j)
/-- PDF p.19, (69): right multipliers on adjacent pairs of physical sites. -/
def evenPhysical {G : Type*} [Group G] (k : ℕ) (r : Fin (k + 1) → G)
(y : Fin (2 * (k + 2)) → G) : Fin (2 * (k + 2)) → G :=
fun j => if hj : 0 < j.val ∧ j.val < 2 * (k + 2) - 1 then
y j * (r ⟨(j.val - 1) / 2, by omega⟩)⁻¹ else y j
/-- PDF p.19, (70): the independent odd-numbered logical right multipliers. -/
def evenLogical {G : Type*} [Group G] (k : ℕ) (r : Fin (k + 1) → G)
(x : Fin (2 * (k + 2) - 2) → G) : Fin (2 * (k + 2) - 2) → G :=
fun j => if j.val % 2 = 0 then x j * (r ⟨j.val / 2, by omega⟩)⁻¹ else x j
/-- PDF p.17, (60a): the three-site bit code. -/
def bitEncoding (G : Type*) [Group G] : Matrix (Fin 3 → G) G ℂ :=
fun y g => if ∀ i, y i = g then 1 else 0
/-- PDF p.17, (60b): the three-site phase code, with ordered group product. -/
def groupPhaseEncoding (G : Type*) [Group G] [Fintype G] : Matrix (Fin 3 → G) G ℂ :=
fun y g => if y 0 * y 1 * y 2 = g then ((Fintype.card G : ℂ)⁻¹) else 0
/-- PDF p.17: one local left shift, including the identity error. -/
def shiftError {G : Type*} [Group G] (i : Fin 3) (g : G) : Matrix (Fin 3 → G) (Fin 3 → G) ℂ :=
basisMapMatrix (fun y => Function.update y i (g * y i))
/-- PDF p.17: arbitrary diagonal error on the specified site. -/
def diagonalError {G : Type*} (i : Fin 3) (f : G → ℂ) : Matrix (Fin 3 → G) (Fin 3 → G) ℂ :=
Matrix.diagonal (fun y => f (y i))
/-- PDF pp.17–18: exact Knill–Laflamme criterion for the span of a specified error family. -/
def CorrectsOperators {A L K : Type*} [Fintype A] [Fintype L] [DecidableEq L]
(V : Matrix A L ℂ) (E : K → Matrix A A ℂ) : Prop :=
∀ e f, ∃ z : ℂ, Vᴴ * (E e)ᴴ * E f * V = z • 1
/-- PDF p.18: concatenate m-fold phase encoding with an m-fold bit encoding of each factor.
The first member k=0 is the one-site identity code. -/
def baconShorEncoding (G : Type*) [Group G] [Fintype G] (k : ℕ) :
Matrix ((Fin (k + 1) × Fin (k + 1)) → G) G ℂ :=
fun y g => if (∀ i j, y (i, j) = y (i, 0)) ∧
(List.ofFn (fun i : Fin (k + 1) => y (i, 0))).prod = g then
((Real.sqrt ((Fintype.card G : ℝ) ^ k))⁻¹ : ℂ) else 0
/-- PDF p.19, (72): the finite cyclic candidate, normalized for every positive modulus. -/
def cyclicEncoding (N : ℕ) [NeZero N] : Matrix (Fin 3 → ZMod N) (ZMod N) ℂ :=
orbitEncoding (fun h g => ![h, g - h, g - 2 * h])
/-- PDF p.16, (55): normalized W-code isometry, vacancy labelled d in each local Fin(d+1). -/
def wEncoding (d n : ℕ) : Matrix (Fin n → Fin (d + 1)) (Fin d) ℂ :=
fun y x => ((Real.sqrt (n : ℝ))⁻¹ : ℂ) *
∑ i : Fin n, ∏ j : Fin n,
if j = i then (if (y j).val = x.val then 1 else 0)
else (if (y j).val = d then 1 else 0)
/-- PDF p.11: finite interval embeddings containing the complete support of (36),
including the x-dependent second and third coordinate ranges. -/
def sharpDims (h m : ℕ) : Fin 3 → ℕ := ![6 * m + 1, 2 * (m + h) + 1, 4 * (m + h) + 1]
/-- PDF p.11, (36): the sharp code, without discarding any amplitude outside [-m,m]
in the second and third physical coordinates. -/
def sharpEncoding (h m : ℕ) : Matrix (TensorBasis (sharpDims h m)) (Fin (2 * h + 1)) ℂ :=
fun y x =>
let a : Fin 3 → ℤ := fun i => ((y i).val : ℤ) -
(![3 * m, m + h, 2 * (m + h)] i : ℕ)
let logical : ℤ := (x.val : ℤ) - h
if ∃ t : ℤ, -(m : ℤ) ≤ t ∧ t ≤ m ∧
a 0 = -3 * t ∧ a 1 = t - logical ∧ a 2 = 2 * (t + logical) then
((Real.sqrt (2 * (m : ℝ) + 1))⁻¹ : ℂ) else 0
example {G : Type*} [Group G] (x : G × G) :
(![1, x.1, x.2 * x.1, x.2] : Fin 4 → G) 2 = x.2 * x.1 := rfl
example {G : Type*} [Group G] (x : Fin 6 → G) :
evenWord 2 x = ![1, x 0, x 1 * x 0, x 1 * x 2, x 3 * x 2,
x 3 * x 4, x 5 * x 4, x 5] := by
funext i
fin_cases i <;> simp [evenWord, groupAt]
example (d : ℕ) (y : Fin 1 → Fin (d + 1)) (x : Fin d) :
wEncoding d 1 y x = if (y 0).val = x.val then 1 else 0 := by
simp [wEncoding]
/-- PDF pp.12,18,23: exact recovery of a uniform-coordinate erased set, with fixed reset. -/
def CorrectsUniformErasure {J A L : Type*} [Fintype J] [Fintype A]
[Fintype L] [DecidableEq L] (V : Matrix (J → A) L ℂ) (reset : J → A) (S : Finset J) : Prop :=
∃ R : Superop (J → A) L, IsChannel R ∧
∀ X, R (uniformErase S reset (conjSuperop V X)) = X
/-- PDF p.12, (42),(43): normalized cyclic five-qudit tensor; phases are evaluated modulo D. -/
def fiveQuditEncoding (D : ℕ) [NeZero D] (omega : ℂ) :
Matrix (Fin 5 → ZMod D) (ZMod D) ℂ :=
fun y x => if (∑ i, y i) = x then
((D : ℂ) ^ 2)⁻¹ * omega ^ (∑ i : Fin 5, y i * y ⟨(i.val + 1) % 5, by omega⟩).val
else 0
/-- PDF p.12: natural integer charge on one qudit, distinguished from its value modulo D. -/
def quditCharge (D : ℕ) [NeZero D] : Matrix (ZMod D) (ZMod D) ℂ :=
Matrix.diagonal (fun x => (x.val : ℂ))
/-- PDF p.23: standard [[4,2,2]] basis, ordered so XXII flips the first logical bit. -/
def twoLocalEncoding : Matrix (Fin 4 → Bool) (Bool × Bool) ℂ :=
fun y x =>
let word : Fin 4 → Bool := ![false, x.2, x.1, xor x.1 x.2]
if y = word ∨ y = (fun i => !(word i)) then ((Real.sqrt 2)⁻¹ : ℂ) else 0
/-- PDF p.23: Q=X tensor X tensor I tensor I, supported on the first two physical qubits. -/
def twoLocalQ : Matrix (Fin 4 → Bool) (Fin 4 → Bool) ℂ :=
basisMapMatrix (fun y => ![!(y 0), !(y 1), y 2, y 3])
/-- PDF p.23: the nontrivial first-logical-qubit Pauli X. -/
def firstLogicalX : Matrix (Bool × Bool) (Bool × Bool) ℂ :=
basisMapMatrix (fun x => (!x.1, x.2))
example : twoLocalQ (![true, true, false, false]) (![false, false, false, false]) = 1 := by
simp [twoLocalQ, basisMapMatrix]
example (D : ℕ) [NeZero D] (omega : ℂ) (y : Fin 5 → ZMod D) (x : ZMod D)
(h : (∑ i, y i) ≠ x) : fiveQuditEncoding D omega y x = 0 := by
simp [fiveQuditEncoding, h]
/-- PDF p.56: the specified Cartan generator diag(1,0,...,0,-1) on tensor space.
It is the sum of the one-cell generators, with the inherited Hilbert inner product. -/
def tensorCartan (d n : ℕ) : Matrix (Fin n → Fin d) (Fin n → Fin d) ℂ :=
Matrix.diagonal (fun w =>
((Finset.univ.filter (fun i => (w i).val = 0)).card : ℂ) -
((Finset.univ.filter (fun i => (w i).val = d - 1)).card : ℂ))
/-- PDF p.56: actual generator on the constructed Schur module. Restriction is expressed
using orthogonal projection, as in the accepted polynomial representation; tensorCartan
preserves the Young-symmetrizer image. Its norm is the Hilbert operator norm. -/
def schurCartan {d n : ℕ} (lambda : QAlgorithms.Schur.Partition d n) :
QAlgorithms.Schur.schurModule lambda →L[ℂ] QAlgorithms.Schur.schurModule lambda :=
(QAlgorithms.Schur.schurModule lambda).orthogonalProjectionOnto.comp
((Matrix.toEuclideanCLM (n := Fin n → Fin d) (𝕜 := ℂ) (tensorCartan d n)).comp
(QAlgorithms.Schur.schurModule lambda).subtypeL)
example (d : ℕ) : tensorCartan d 0 = 0 := by
ext y x
simp [tensorCartan]
end QAlgorithms.Papers.Independent.Extend50.P22
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
QAlgorithms.Papers.Independent.Extend50.P22.ChargeCovariant
For natural numbers , let specify , , positive site dimensions , and an isometry from into the register with basis , so . For a complex matrix and a complex matrix at every site, this predicate means that and every are Hermitian and that there exists a real number such that
The real shift is unrestricted.
QAlgorithms.Papers.Independent.Extend50.P22.CorrectsGroupErasure
For finite types , with decidable equality on , a finite group , a complex matrix with rows indexed by and columns by , and a finite subset , this property means that there exists a function from matrices on to matrices on , admitting a finite Kraus representation
for some natural number and matrices with rows indexed by and columns by , such that for every complex matrix on . Here is zero unless for every , and otherwise equals . The equality is required for all , not just density matrices; no isometry assumption on is part of this definition. Empty , and , are included wherever the displayed requirements can hold.
QAlgorithms.Papers.Independent.Extend50.P22.CorrectsOperators
For arbitrary types , with and finite and equality on decidable, a complex matrix with rows indexed by and columns indexed by , and an arbitrary family , this defines the proposition
The scalar may depend on the ordered pair . The definition assumes neither that is an isometry nor that the operators satisfy any channel condition. The finite sets may be empty, and need not be finite; if is empty, the proposition is vacuous, and if is empty, every displayed matrix equality holds.
QAlgorithms.Papers.Independent.Extend50.P22.CorrectsUniformErasure
For arbitrary finite types , with decidable equality on , a complex matrix with rows indexed by functions and columns indexed by , a reset function , and a finite subset , this predicate means that there exists a channel from matrices on to matrices on such that
For a matrix , the entry is zero unless for every ; otherwise it is , where replacement changes exactly the coordinates in . The channel requirement is the existence of finitely many matrices with and on the physical input space. The definition imposes no separate isometry assumption on , requires recovery of all matrices rather than only density matrices, permits empty finite types, and includes , for which the erasure map is the identity.
QAlgorithms.Papers.Independent.Extend50.P22.CovariantErasureCodeData.logDim
For natural numbers and data consisting of , , positive site dimensions , and an encoding matrix satisfying , this definition returns the real number
where is the natural logarithm and the natural-number maximum is regarded as a real number. Its argument is at least ; if all site dimensions are , the value is zero.
QAlgorithms.Papers.Independent.Extend50.P22.CovariantErasureCodeData.maxDim
For natural numbers and data consisting of , , positive site dimensions , and an encoding matrix satisfying , this definition returns the natural number . The stored hypothesis supplies the nonempty index set required for this maximum, and positivity of the site dimensions makes the result at least .
QAlgorithms.Papers.Independent.Extend50.P22.CovariantErasureCodeData
For natural numbers , an element of this structure consists of proofs that and , natural numbers for every site , and a complex matrix
Thus its physical row indices are assignments of a valid local coordinate to every site, and its logical column indices are . These are all the fields and requirements; in particular, the structure itself specifies no group action or covariance equation. It has no elements when or .
QAlgorithms.Papers.Independent.Extend50.P22.CovariantErasureCodeData.noise
For any natural numbers , any datum containing positive , positive local dimensions , and a complex matrix indexed by , where and , and any real weights , this defines a function from complex matrices to matrices indexed by . For every input matrix its entries are
Here changes only coordinate of to . Thus each diagonal label block first applies , sums over the selected site's common row and column coordinate, resets that site to zero, and multiplies by . The weights have no nonnegativity or normalization hypothesis, and has no density-matrix hypothesis.
QAlgorithms.Papers.Independent.Extend50.P22.CovariantErasureCodeData.reset
For any natural numbers , any datum consisting of positive , positive local dimensions , and a complex matrix with rows indexed by and columns indexed by satisfying , and any site , this defines the reset coordinate to be . Its validity follows from the positivity of stored in .
QAlgorithms.Papers.Independent.Extend50.P22.CovariantErasureCodeData.uniformNoise
For natural numbers , let consist of , , positive site dimensions for , and a complex matrix from to the register with basis , satisfying . This definition assigns to every complex matrix a matrix indexed by , whose entries are
Here replaces coordinate of by . Thus each site is selected with weight , traced out and reset to basis value , with its index recorded in the first output register; the definition acts on all matrices , without requiring them to be density matrices.
QAlgorithms.Papers.Independent.Extend50.P22.FullAction
For natural numbers , let specify , , positive site dimensions , and an isometry satisfying , where . An object of this structure consists of a group homomorphism for each site , proofs that all these homomorphisms are continuous, and a proof that for every ,
Each homomorphism preserves multiplication and identity; the equation is required for every logical unitary.
QAlgorithms.Papers.Independent.Extend50.P22.SUCovariant
For natural numbers , let specify , , positive site dimensions , and a complex isometry with , where . This predicate means that for every site there is a continuous group homomorphism , preserving multiplication and identity, such that for every unitary matrix of determinant ,
The allowed dimensions include , for which is the trivial group.
QAlgorithms.Papers.Independent.Extend50.P22.TensorBasis
For any natural number and any assignment of natural numbers to indices , this is the type
Its elements choose one valid coordinate at every site. If , it contains exactly the empty assignment; if any , it is empty.
QAlgorithms.Papers.Independent.Extend50.P22.Transversal
For every natural number , every family of natural dimensions , and every complex matrix indexed by , this predicate means that there exist unitary complex matrices , one for each site, such that
There is no additional overall phase in this equality. For , the predicate holds exactly when is the matrix ; if a site dimension is zero, the global basis is empty and the equality of entries is vacuous.
QAlgorithms.Papers.Independent.Extend50.P22.baconShorEncoding
For every finite group and natural number , this defines a complex matrix with rows indexed by arrays and columns indexed by , with entries
Thus the product of the row values is ordered by increasing row index. The definition permits noncommutative and trivial groups. For , it is the matrix with entry exactly when .
QAlgorithms.Papers.Independent.Extend50.P22.basisMapMatrix
For every type and every function , this defines the complex matrix , with rows and columns indexed by , by
There is no finiteness, nonemptiness, injectivity, or surjectivity assumption on or .
QAlgorithms.Papers.Independent.Extend50.P22.bitEncoding
For every group , this defines a complex matrix with rows indexed by triples and columns indexed by , with entries
Neither finiteness nor commutativity of is assumed.
QAlgorithms.Papers.Independent.Extend50.P22.chargeEvolution
For any finite index type equipped with decidable equality, any complex matrix indexed by , and any real number , this definition assigns the matrix
where the exponential is the matrix exponential. There is no Hermiticity assumption on , and may be empty.
QAlgorithms.Papers.Independent.Extend50.P22.chargeRange
For any finite index type with decidable equality and any complex matrix indexed by , define a list of real numbers to be the eigenvalues of in ascending order, with multiplicities, when is Hermitian, and to be identically zero otherwise. This definition returns
For nonempty and Hermitian , this is the largest eigenvalue minus the smallest. For non-Hermitian it is zero, and for empty it is also zero, using the real-valued supremum and infimum conventions for the empty set.
QAlgorithms.Papers.Independent.Extend50.P22.cyclicEncoding
For every nonzero natural number , this defines a complex matrix with rows indexed by triples and columns indexed by , by
All arithmetic inside the triple is modulo . Since its first coordinate determines , the entry is when , and zero otherwise. No primality assumption is imposed; is included.
QAlgorithms.Papers.Independent.Extend50.P22.diagonalError
For every type , coordinate , and arbitrary function , this defines the diagonal complex matrix on given by
No group structure, finiteness, normalization, or restriction on the values of is assumed.
QAlgorithms.Papers.Independent.Extend50.P22.dickeMarginalRootFidelity
For every pair of natural numbers and integer , this defines
where, for any integer , setting ,
Natural-number subtractions are truncated at zero, division by zero gives zero, and the square root is the real square root. No positivity, parity, or size conditions are imposed on , and normalization of these weights is not a hypothesis. When , the sum still contains its term.
QAlgorithms.Papers.Independent.Extend50.P22.dickeMarginalWeight
For every pair of natural numbers , integer , and integer index with , let . This defines the real number
Here and are natural-number subtractions, truncated at zero. No assumption requires , , or any parity relation. Binomial coefficients outside their natural range are zero, and division by zero gives zero; thus if , every value is zero. The definition includes and .
QAlgorithms.Papers.Independent.Extend50.P22.entangledInputRootFidelity
For any natural number , any function from complex matrices to complex matrices, and any vector , put and define the action on the second register by
The declaration defines the real number
where is the continuous functional calculus of the real square-root function: on a Hermitian matrix it applies to each eigenvalue, and on a non-Hermitian matrix it is zero. Neither normalization of nor any channel, linearity, or positivity condition on is assumed. The case is included, and its value is .
QAlgorithms.Papers.Independent.Extend50.P22.erase
For any natural number , natural local dimensions , finite subset of the sites, and reset assignment , this defines a function on complex matrices indexed by by
Here replaces by on and retains elsewhere. The input is an arbitrary matrix. The reset assignment cannot exist if any . Empty gives the identity function on matrices; taking to be every site gives . The case is included.
QAlgorithms.Papers.Independent.Extend50.P22.errorE
For every natural number , every finite type with decidable equality, and every function from complex matrices to complex matrices indexed by , let have coordinates
For each recovery function satisfying , set and
The declaration defines . Here is any natural number, is a complex matrix, applies to each block with fixed first-register indices, and is real-square-root continuous functional calculus, assigning zero to non-Hermitian matrices and mapping negative eigenvalues to zero. The function is unrestricted; the real supremum is if its set is empty or unbounded above, and the real square root is for a negative argument. The case is included: is then the zero vector and the defined error is .
QAlgorithms.Papers.Independent.Extend50.P22.errorWorst
For every natural number , every finite type with decidable equality, and every function from complex matrices to complex matrices indexed by , define
The declaration defines . The outer supremum ranges over functions , for any natural number , where the complex matrices satisfy . The operation applies to each block with fixed first-register indices, and is continuous functional calculus for the real square root, mapping negative eigenvalues to zero and assigning zero to non-Hermitian matrices. No condition is imposed on . The extrema use the real conventions assigning to empty sets and to the respective unbounded extrema, and a negative square-root argument gives . When , the unit-vector set is empty, , and the defined error is .
QAlgorithms.Papers.Independent.Extend50.P22.evenEncoding
For every finite group and every natural number , including , put and . This defines a complex matrix with rows indexed by and columns indexed by , whose entries are
Here is when its condition holds and otherwise, and all products retain the displayed order. No commutativity or nontriviality assumption is imposed on .
QAlgorithms.Papers.Independent.Extend50.P22.evenLogical
For every group , natural number , tuple , and tuple , this defines a tuple of the same length by
Here is an integer when the first case applies. The definition includes and assumes neither finiteness nor commutativity of .
QAlgorithms.Papers.Independent.Extend50.P22.evenPhysical
For every group , natural number , tuple , and tuple , this defines another tuple of the same length by
Thus the two endpoint coordinates remain fixed, while each consecutive interior pair , for , is right multiplied by . Finiteness and commutativity of are not assumed; is included.
QAlgorithms.Papers.Independent.Extend50.P22.evenWord
For every group , natural number , and tuple , this defines a tuple . Put , and define for and otherwise. For , the coordinates are
Natural-number subtractions are truncated at zero, and the cases are tested in the displayed order. No finiteness or commutativity of is assumed; is included and gives .
QAlgorithms.Papers.Independent.Extend50.P22.finiteMax
For any type equipped with a linear order, any natural number with a supplied hypothesis , and any function , this definition returns the maximum . The positivity hypothesis ensures that the set of values is nonempty; the definition has no case with .
QAlgorithms.Papers.Independent.Extend50.P22.firstLogicalX
This defines a complex matrix whose rows and columns are indexed by pairs of Boolean values. For row and column ,
Thus its action on a computational basis vector flips the first component.
QAlgorithms.Papers.Independent.Extend50.P22.fiveQuditEncoding
For every nonzero natural number and every complex number , this defines a complex matrix with rows and columns , by
Here the quadratic sum is first computed modulo , and then selects its representative in as the natural-number exponent. The definition assumes neither primality of nor any root-of-unity property of ; is allowed, with . For , the matrix has one entry, equal to .
QAlgorithms.Papers.Independent.Extend50.P22.fixedFidelity
For every natural number , every finite type with decidable equality, every function from complex matrices to complex matrices indexed by , and every , this defines
Here , and ranges over functions admitting a finite Kraus representation
for some natural number and complex matrices with rows indexed by and columns indexed by . For a function , applies separately to each block . The operation applies the real square-root function through continuous functional calculus, with negative eigenvalues mapped to zero and non-Hermitian matrices assigned zero. The function is unrestricted, and need not have norm one. The supremum is the real supremum used in the code, which is for an empty or unbounded-above set; an admissible need not exist, for example when is empty and . The value is when .
QAlgorithms.Papers.Independent.Extend50.P22.gaussianNormalization
For every real number , this defines the real number
There is no assumption that is positive or nonzero. Division uses the total real-field convention , and the infinite sum has value when the family is not summable. In particular, at every summand is , so this definition gives .
QAlgorithms.Papers.Independent.Extend50.P22.groupAt
For every group , natural number , function , and natural number , this defines
No finiteness or commutativity of is assumed. In particular, when , the value is for every .
QAlgorithms.Papers.Independent.Extend50.P22.groupErase
For a finite type , a finite group , and a finite subset , this defines a function on complex matrices indexed by . Writing for the group identity and for replacement of the coordinates in by , its entries are
No positivity or normalization of , or commutativity of , is required. The type and subset may be empty; for , this is the identity function on matrices.
QAlgorithms.Papers.Independent.Extend50.P22.groupFourEncoding
For every finite group , this defines a complex matrix with rows indexed by four-tuples and columns by pairs , by
Products occur in the displayed order; commutativity is not assumed. The trivial group is included.
QAlgorithms.Papers.Independent.Extend50.P22.groupPhaseEncoding
For every finite group , this defines a complex matrix with rows indexed by triples and columns indexed by , with entries
The product is taken in the displayed order. The group may be trivial and need not be commutative.
QAlgorithms.Papers.Independent.Extend50.P22.hilbertRootFidelity
Let be a complete complex inner product space with its compatible normed additive group structure, let be any index type, and let be a Hilbert basis of . For arbitrary bounded complex-linear operators , put , where denotes the total continuous functional calculus. The definition assigns the real number
There are no positivity, trace-class, normalization, or summability hypotheses on and , and no countability assumption on . The sum is the total infinite sum, whose value is zero when the family being summed is not summable.
QAlgorithms.Papers.Independent.Extend50.P22.liftLocal
For a natural number , any family of natural dimensions , a chosen index , and any complex matrix , this definition produces a matrix on the basis with entries
Thus its entry is when and agree outside site , and zero otherwise. The supplied index excludes ; individual dimensions may be zero, in which case is empty. When , the displayed product is empty and equals .
QAlgorithms.Papers.Independent.Extend50.P22.localTensorProduct
For every natural number , every family of natural dimensions , and every family of complex matrices , this definition produces the matrix indexed by whose entries are
No positivity or unitarity assumptions are imposed. For , has one element and the empty product gives the matrix ; if any site dimension is zero, is empty.
QAlgorithms.Papers.Independent.Extend50.P22.locationFlaggedChannel
For arbitrary types , with a finite enumeration of , any real function , and any family of functions taking complex matrices indexed by to complex matrices indexed by , this defines a function into matrices indexed by through
Thus the output has diagonal blocks and zero blocks between distinct labels. The weights are not required to be nonnegative or sum to one, and the component functions are not required to be channels or linear. The types and need not be finite or nonempty; empty is also allowed and gives a matrix with an empty index type.
QAlgorithms.Papers.Independent.Extend50.P22.meanSpread
For every natural number , including , and every complex matrix , put . This definition returns
where the square root is defined by functional calculus. No Hermitian hypothesis is imposed on . Division by zero uses the total field convention , so the value at is zero.
QAlgorithms.Papers.Independent.Extend50.P22.normalizedWeylDimension
For every natural number and every function , this defines
where all arithmetic inside the fractions takes place in . The definition extends by zero beyond its domain before evaluating this product, but the displayed product only uses indices below . No monotonicity or partition condition is assumed. Empty products equal , so .
QAlgorithms.Papers.Independent.Extend50.P22.orbitEncoding
For finite types , an arbitrary type , and a function , this defines a complex matrix with rows indexed by and columns by , whose entries are
Thus repeated occurrences of the same word contribute separately. No group structure, injectivity, or normalization property is assumed. The finite types may be empty; if is empty, the reciprocal square root is zero under total inversion and the matrix entries are zero.
QAlgorithms.Papers.Independent.Extend50.P22.quditCharge
For every nonzero natural number , this defines the diagonal complex matrix indexed by , with
where is regarded as a complex number. Thus the diagonal uses the chosen nonnegative integer representatives, rather than residues as complex numbers. The case is included and gives the zero matrix.
QAlgorithms.Papers.Independent.Extend50.P22.schurCartan
For natural numbers and a Young diagram with exactly cells and first-column length at most , this defines a continuous complex-linear operator on the following subspace of the Euclidean space with coordinates indexed by words : number the cells using the finite-enumeration bijection in the definition, let and consist respectively of permutations preserving each numbered cell’s row and column, let when and zero otherwise, and set
The defined operator sends to the orthogonal projection onto of , where is diagonal with entry at word , using natural-number subtraction for . No positivity assumption on or is imposed; for the operator is zero, and permits only the empty diagram.
QAlgorithms.Papers.Independent.Extend50.P22.sharpDims
For arbitrary natural numbers , this defines the three site dimensions as the function on given by
There is no assumption that , and zero values of either parameter are permitted; all three resulting dimensions are positive.
QAlgorithms.Papers.Independent.Extend50.P22.sharpEncoding
For arbitrary natural numbers , put , , and . This defines a complex matrix with rows , where , and columns . Define the integers , , , and . Then
The subtractions defining and are integer subtractions, so negative values are allowed. No assumption is included in the definition; and are allowed, and the normalization denominator is always positive.
QAlgorithms.Papers.Independent.Extend50.P22.shiftError
For every group , coordinate , and element , this defines a complex matrix on triples from by
Thus its column indexed by has its in the row obtained by left multiplying coordinate by . No finiteness or commutativity assumption is made.
QAlgorithms.Papers.Independent.Extend50.P22.splice
For any natural number , any natural local dimensions , any finite subset , any assignment , and any assignment , this defines the assignment
When is empty the result is , and when is all sites the result uses everywhere. No positivity of the dimensions is separately assumed, although the supplied cannot exist if any local dimension is zero; is allowed.
QAlgorithms.Papers.Independent.Extend50.P22.stabilizedFourEncoding
For every finite group , this defines a complex matrix with rows indexed by and columns by , by
The multiplication order is exactly as displayed, without a commutativity assumption. The trivial group is included.
QAlgorithms.Papers.Independent.Extend50.P22.symmetricRows
For every pair of natural numbers , this defines a function by
Thus gives the unique function on the empty index set, and gives the zero function.
QAlgorithms.Papers.Independent.Extend50.P22.tensorCartan
For every pair of natural numbers , this defines a diagonal complex matrix indexed by words , with
and all off-diagonal entries zero. The subtraction in the symbol being counted is natural-number subtraction, so it equals zero when . If , the sole word is empty and its diagonal entry is zero; if , there are no indexing words; and if , the two counts coincide, so the matrix is zero.
QAlgorithms.Papers.Independent.Extend50.P22.theta2Zero
For every real number , this defines
There is no restriction on . The real logarithm is total, with , and the infinite sum has value for a nonsummable family; in particular, this definition gives .
QAlgorithms.Papers.Independent.Extend50.P22.theta3Imaginary
For every pair of real numbers , this defines
No positivity or convergence assumption is imposed on or . Here the real logarithm is the total real logarithm, with , and the real infinite sum is assigned value when its family is not summable; for example, .
QAlgorithms.Papers.Independent.Extend50.P22.twoLocalEncoding
This defines a complex matrix with rows indexed by four-bit strings and columns indexed by pairs of bits . For each column, put , where is Boolean exclusive-or. Then
where flips all four bits. The condition is a disjunction assigning the single value ; its two alternatives are distinct because their first bits differ.
QAlgorithms.Papers.Independent.Extend50.P22.twoLocalQ
This defines a complex matrix whose rows and columns are indexed by four-bit strings. For row and column ,
Thus its action on a computational basis vector flips the first two bits.
QAlgorithms.Papers.Independent.Extend50.P22.uniformErase
For finite types , a finite subset , and a function , this defines a function from complex matrices indexed by to matrices with the same indices. For , let equal on and outside . Then
This applies to every matrix , with no positivity or normalization assumption. Empty types and are included; when , the resulting function is the identity.
QAlgorithms.Papers.Independent.Extend50.P22.upSpins
For every natural number and integer , this defines
as a natural number: first is divided by using integer division, then negative results are converted to . There is no parity condition on and no bound on ; in particular, the result need not be at most .
QAlgorithms.Papers.Independent.Extend50.P22.wEncoding
For arbitrary natural numbers , this defines a complex matrix whose rows are words and whose columns are , by
Thus, for , an entry is exactly when has the value at one coordinate and the value at every other coordinate, and is zero otherwise. No positivity assumptions are part of this definition: when , the sum is empty and every existing entry is zero, with the inverse of defined as zero; when , there are no columns.
QAlgorithms.Papers.Independent.Extend50.P22.worstFidelity
For every natural number , every finite type with decidable equality, and every function from complex matrices to complex matrices indexed by , this defines
Here , and ranges over functions of the form for some natural number , with complex matrices satisfying . The operation applies to each matrix block with fixed first-register row and column, and applies the real square-root function by continuous functional calculus, mapping negative eigenvalues to zero and assigning zero to non-Hermitian matrices. Thus the same is chosen before taking the infimum over all unit vectors . No condition is imposed on . Both extrema are taken in , where the empty-set infimum or supremum is , as are the corresponding unbounded extrema. When there are no unit vectors, and the resulting value is ; the outer set can also be empty, for example if is empty and .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.