Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Definitions for Continuous symmetries and approximate quantum error correction

Definition
QAlgorithms_Papers_Independent_Extend50_P22

by Gohan · Oct 29, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

The 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.
Definition code
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
Source
Continuous symmetries and approximate quantum error correction, arXiv:1902.07714v1, https://arxiv.org/abs/1902.07714v1
Read-back

What the Lean code literally says, in plain math · gpt-6.1-sol

QAlgorithms.Papers.Independent.Extend50.P22.ChargeCovariant

For natural numbers d,nd,nd,n, let ccc specify d>0d>0d>0, n>0n>0n>0, positive site dimensions did_idi​, and an isometry VVV from Cd\mathbb C^dCd into the register with basis B=∏i=0n−1{0,…,di−1}\mathcal B=\prod_{i=0}^{n-1}\{0,\ldots,d_i-1\}B=∏i=0n−1​{0,…,di​−1}, so V†V=IdV^\dagger V=I_dV†V=Id​. For a complex d×dd\times dd×d matrix TLT_LTL​ and a complex di×did_i\times d_idi​×di​ matrix TiT_iTi​ at every site, this predicate means that TLT_LTL​ and every TiT_iTi​ are Hermitian and that there exists a real number ν\nuν such that

(∑i=0n−1Li(Ti))V=V(TL−νId),Li(Ti)y,z=(Ti)yi,zi∏j≠i1{yj=zj}.\left(\sum_{i=0}^{n-1}L_i(T_i)\right)V = V(T_L-\nu I_d), \qquad L_i(T_i)_{y,z} =(T_i)_{y_i,z_i}\prod_{j\ne i}\mathbf1_{\{y_j=z_j\}}.(i=0∑n−1​Li​(Ti​))V=V(TL​−νId​),Li​(Ti​)y,z​=(Ti​)yi​,zi​​j=i∏​1{yj​=zj​}​.

The real shift ν\nuν is unrestricted.

QAlgorithms.Papers.Independent.Extend50.P22.CorrectsGroupErasure

For finite types J,LJ,LJ,L, with decidable equality on LLL, a finite group GGG, a complex matrix VVV with rows indexed by J→GJ\to GJ→G and columns by LLL, and a finite subset S⊆JS\subseteq JS⊆J, this property means that there exists a function RRR from matrices on J→GJ\to GJ→G to matrices on LLL, admitting a finite Kraus representation

R(Y)=∑α=0r−1KαYKα†,∑α=0r−1Kα†Kα=I,R(Y)=\sum_{\alpha=0}^{r-1}K_\alpha YK_\alpha^\dagger, \qquad \sum_{\alpha=0}^{r-1}K_\alpha^\dagger K_\alpha=I,R(Y)=α=0∑r−1​Kα​YKα†​,α=0∑r−1​Kα†​Kα​=I,

for some natural number rrr and matrices KαK_\alphaKα​ with rows indexed by LLL and columns by J→GJ\to GJ→G, such that R(ES(VXV†))=XR(\mathcal E_S(VXV^\dagger))=XR(ES​(VXV†))=X for every complex matrix XXX on LLL. Here ES(Y)y,z\mathcal E_S(Y)_{y,z}ES​(Y)y,z​ is zero unless y(i)=z(i)=1Gy(i)=z(i)=1_Gy(i)=z(i)=1G​ for every i∈Si\in Si∈S, and otherwise equals ∑a:S→GYy[S←a],z[S←a]\sum_{a:S\to G}Y_{y[S\leftarrow a],z[S\leftarrow a]}∑a:S→G​Yy[S←a],z[S←a]​. The equality is required for all XXX, not just density matrices; no isometry assumption on VVV is part of this definition. Empty J,L,SJ,L,SJ,L,S, and r=0r=0r=0, are included wherever the displayed requirements can hold.

QAlgorithms.Papers.Independent.Extend50.P22.CorrectsOperators

For arbitrary types A,L,KA,L,KA,L,K, with AAA and LLL finite and equality on LLL decidable, a complex matrix VVV with rows indexed by AAA and columns indexed by LLL, and an arbitrary family E:K→CA×AE:K\to\mathbb C^{A\times A}E:K→CA×A, this defines the proposition

∀e,f∈K, ∃z∈C,V†Ee†EfV=zIL.\forall e,f\in K,\ \exists z\in\mathbb C,\qquad V^\dagger E_e^\dagger E_fV=zI_L.∀e,f∈K, ∃z∈C,V†Ee†​Ef​V=zIL​.

The scalar zzz may depend on the ordered pair (e,f)(e,f)(e,f). The definition assumes neither that VVV is an isometry nor that the operators satisfy any channel condition. The finite sets A,LA,LA,L may be empty, and KKK need not be finite; if KKK is empty, the proposition is vacuous, and if LLL is empty, every displayed matrix equality holds.

QAlgorithms.Papers.Independent.Extend50.P22.CorrectsUniformErasure

For arbitrary finite types J,A,LJ,A,LJ,A,L, with decidable equality on LLL, a complex matrix VVV with rows indexed by functions J→AJ\to AJ→A and columns indexed by LLL, a reset function r:J→Ar:J\to Ar:J→A, and a finite subset S⊆JS\subseteq JS⊆J, this predicate means that there exists a channel R\mathcal RR from matrices on J→AJ\to AJ→A to matrices on LLL such that

R(ES,r(VXV†))=Xfor every complex matrix X on L.\mathcal R\bigl(\mathcal E_{S,r}(VXV^\dagger)\bigr)=X \quad\text{for every complex matrix }X\text{ on }L.R(ES,r​(VXV†))=Xfor every complex matrix X on L.

For a matrix YYY, the entry ES,r(Y)y,z\mathcal E_{S,r}(Y)_{y,z}ES,r​(Y)y,z​ is zero unless yi=zi=riy_i=z_i=r_iyi​=zi​=ri​ for every i∈Si\in Si∈S; otherwise it is ∑a:S→AYy[S:=a],z[S:=a]\sum_{a:S\to A}Y_{y[S:=a],z[S:=a]}∑a:S→A​Yy[S:=a],z[S:=a]​, where replacement changes exactly the coordinates in SSS. The channel requirement is the existence of finitely many matrices KjK_jKj​ with R(Y)=∑jKjYKj†\mathcal R(Y)=\sum_jK_jYK_j^\daggerR(Y)=∑j​Kj​YKj†​ and ∑jKj†Kj=I\sum_jK_j^\dagger K_j=I∑j​Kj†​Kj​=I on the physical input space. The definition imposes no separate isometry assumption on VVV, requires recovery of all matrices rather than only density matrices, permits empty finite types, and includes S=∅S=\varnothingS=∅, for which the erasure map is the identity.

QAlgorithms.Papers.Independent.Extend50.P22.CovariantErasureCodeData.logDim

For natural numbers d,nd,nd,n and data ccc consisting of d>0d>0d>0, n>0n>0n>0, positive site dimensions did_idi​, and an encoding matrix VVV satisfying V†V=IdV^\dagger V=I_dV†V=Id​, this definition returns the real number

log⁡ ⁣(max⁡0≤i<ndi),\log\!\left(\max_{0\le i<n}d_i\right),log(0≤i<nmax​di​),

where log⁡\loglog is the natural logarithm and the natural-number maximum is regarded as a real number. Its argument is at least 111; if all site dimensions are 111, the value is zero.

QAlgorithms.Papers.Independent.Extend50.P22.CovariantErasureCodeData.maxDim

For natural numbers d,nd,nd,n and data ccc consisting of d>0d>0d>0, n>0n>0n>0, positive site dimensions did_idi​, and an encoding matrix VVV satisfying V†V=IdV^\dagger V=I_dV†V=Id​, this definition returns the natural number max⁡0≤i<ndi\max_{0\le i<n}d_imax0≤i<n​di​. The stored hypothesis n>0n>0n>0 supplies the nonempty index set required for this maximum, and positivity of the site dimensions makes the result at least 111.

QAlgorithms.Papers.Independent.Extend50.P22.CovariantErasureCodeData

For natural numbers d,nd,nd,n, an element of this structure consists of proofs that d>0d>0d>0 and n>0n>0n>0, natural numbers di>0d_i>0di​>0 for every site i∈{0,…,n−1}i\in\{0,\ldots,n-1\}i∈{0,…,n−1}, and a complex matrix

V:Cd⟶C∏i=0n−1{0,…,di−1}satisfyingV†V=Id.V:\mathbb C^d\longrightarrow \mathbb C^{\prod_{i=0}^{n-1}\{0,\ldots,d_i-1\}} \quad\text{satisfying}\quad V^\dagger V=I_d.V:Cd⟶C∏i=0n−1​{0,…,di​−1}satisfyingV†V=Id​.

Thus its physical row indices are assignments of a valid local coordinate to every site, and its logical column indices are 0,…,d−10,\ldots,d-10,…,d−1. These are all the fields and requirements; in particular, the structure itself specifies no group action or covariance equation. It has no elements when d=0d=0d=0 or n=0n=0n=0.

QAlgorithms.Papers.Independent.Extend50.P22.CovariantErasureCodeData.noise

For any natural numbers d,nd,nd,n, any datum ccc containing positive d,nd,nd,n, positive local dimensions did_idi​, and a complex matrix VVV indexed by T×{0,…,d−1}T\times\{0,\ldots,d-1\}T×{0,…,d−1}, where T=∏i{0,…,di−1}T=\prod_i\{0,\ldots,d_i-1\}T=∏i​{0,…,di​−1} and V†V=IdV^\dagger V=I_dV†V=Id​, and any real weights qiq_iqi​, this defines a function from complex d×dd\times dd×d matrices to matrices indexed by {0,…,n−1}×T\{0,\ldots,n-1\}\times T{0,…,n−1}×T. For every input matrix XXX its entries are

[Nq(X)](i,y),(j,z)={qi∑a=0di−1(VXV†)y[i←a], z[i←a],i=j and yi=zi=0,0,otherwise.[\mathcal N_q(X)]_{(i,y),(j,z)} = \begin{cases} \displaystyle q_i\sum_{a=0}^{d_i-1} (VXV^\dagger)_{y[i\leftarrow a],\,z[i\leftarrow a]}, &i=j\ \text{and }y_i=z_i=0,\\ 0,&\text{otherwise}. \end{cases}[Nq​(X)](i,y),(j,z)​=⎩⎨⎧​qi​a=0∑di​−1​(VXV†)y[i←a],z[i←a]​,0,​i=j and yi​=zi​=0,otherwise.​

Here y[i←a]y[i\leftarrow a]y[i←a] changes only coordinate iii of yyy to aaa. Thus each diagonal label block first applies X↦VXV†X\mapsto VXV^\daggerX↦VXV†, sums over the selected site's common row and column coordinate, resets that site to zero, and multiplies by qiq_iqi​. The weights have no nonnegativity or normalization hypothesis, and XXX has no density-matrix hypothesis.

QAlgorithms.Papers.Independent.Extend50.P22.CovariantErasureCodeData.reset

For any natural numbers d,nd,nd,n, any datum ccc consisting of positive d,nd,nd,n, positive local dimensions did_idi​, and a complex matrix VVV with rows indexed by ∏i{0,…,di−1}\prod_i\{0,\ldots,d_i-1\}∏i​{0,…,di​−1} and columns indexed by {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1} satisfying V†V=IdV^\dagger V=I_dV†V=Id​, and any site i∈{0,…,n−1}i\in\{0,\ldots,n-1\}i∈{0,…,n−1}, this defines the reset coordinate to be 0∈{0,…,di−1}0\in\{0,\ldots,d_i-1\}0∈{0,…,di​−1}. Its validity follows from the positivity of did_idi​ stored in ccc.

QAlgorithms.Papers.Independent.Extend50.P22.CovariantErasureCodeData.uniformNoise

For natural numbers d,nd,nd,n, let ccc consist of d>0d>0d>0, n>0n>0n>0, positive site dimensions did_idi​ for i∈{0,…,n−1}i\in\{0,\ldots,n-1\}i∈{0,…,n−1}, and a complex matrix VVV from Cd\mathbb C^dCd to the register with basis B=∏i=0n−1{0,…,di−1}\mathcal B=\prod_{i=0}^{n-1}\{0,\ldots,d_i-1\}B=∏i=0n−1​{0,…,di​−1}, satisfying V†V=IdV^\dagger V=I_dV†V=Id​. This definition assigns to every complex d×dd\times dd×d matrix XXX a matrix indexed by {0,…,n−1}×B\{0,\ldots,n-1\}\times\mathcal B{0,…,n−1}×B, whose entries are

N(X)(i,y),(j,z)={1n∑a=0di−1(VXV†)y[i←a], z[i←a],i=j, yi=0, zi=0,0,otherwise.\mathcal N(X)_{(i,y),(j,z)} = \begin{cases} \displaystyle\frac1n\sum_{a=0}^{d_i-1} (VXV^\dagger)_{y[i\leftarrow a],\,z[i\leftarrow a]}, & i=j,\ y_i=0,\ z_i=0,\\ 0,&\text{otherwise}. \end{cases}N(X)(i,y),(j,z)​=⎩⎨⎧​n1​a=0∑di​−1​(VXV†)y[i←a],z[i←a]​,0,​i=j, yi​=0, zi​=0,otherwise.​

Here y[i←a]y[i\leftarrow a]y[i←a] replaces coordinate iii of yyy by aaa. Thus each site is selected with weight 1/n1/n1/n, traced out and reset to basis value 000, with its index recorded in the first output register; the definition acts on all matrices XXX, without requiring them to be density matrices.

QAlgorithms.Papers.Independent.Extend50.P22.FullAction

For natural numbers d,nd,nd,n, let ccc specify d>0d>0d>0, n>0n>0n>0, positive site dimensions did_idi​, and an isometry V:Cd→CBV:\mathbb C^d\to\mathbb C^{\mathcal B}V:Cd→CB satisfying V†V=IdV^\dagger V=I_dV†V=Id​, where B=∏i=0n−1{0,…,di−1}\mathcal B=\prod_{i=0}^{n-1}\{0,\ldots,d_i-1\}B=∏i=0n−1​{0,…,di​−1}. An object of this structure consists of a group homomorphism ri:U⁡(d)→U⁡(di)r_i:\operatorname U(d)\to\operatorname U(d_i)ri​:U(d)→U(di​) for each site iii, proofs that all these homomorphisms are continuous, and a proof that for every U∈U⁡(d)U\in\operatorname U(d)U∈U(d),

R(U)V=VU,R(U)y,z=∏i=0n−1(ri(U))yi,zi.R(U)V=VU, \qquad R(U)_{y,z}=\prod_{i=0}^{n-1}(r_i(U))_{y_i,z_i}.R(U)V=VU,R(U)y,z​=i=0∏n−1​(ri​(U))yi​,zi​​.

Each homomorphism preserves multiplication and identity; the equation is required for every logical unitary.

QAlgorithms.Papers.Independent.Extend50.P22.SUCovariant

For natural numbers d,nd,nd,n, let ccc specify d>0d>0d>0, n>0n>0n>0, positive site dimensions did_idi​, and a complex isometry V:Cd→CBV:\mathbb C^d\to\mathbb C^{\mathcal B}V:Cd→CB with V†V=IdV^\dagger V=I_dV†V=Id​, where B=∏i=0n−1{0,…,di−1}\mathcal B=\prod_{i=0}^{n-1}\{0,\ldots,d_i-1\}B=∏i=0n−1​{0,…,di​−1}. This predicate means that for every site iii there is a continuous group homomorphism ri:SU⁡(d)→U⁡(di)r_i:\operatorname{SU}(d)\to\operatorname U(d_i)ri​:SU(d)→U(di​), preserving multiplication and identity, such that for every unitary d×dd\times dd×d matrix UUU of determinant 111,

R(U)V=VU,R(U)y,z=∏i=0n−1(ri(U))yi,zi.R(U)V=VU, \qquad R(U)_{y,z}=\prod_{i=0}^{n-1}(r_i(U))_{y_i,z_i}.R(U)V=VU,R(U)y,z​=i=0∏n−1​(ri​(U))yi​,zi​​.

The allowed dimensions include d=1d=1d=1, for which SU⁡(1)\operatorname{SU}(1)SU(1) is the trivial group.

QAlgorithms.Papers.Independent.Extend50.P22.TensorBasis

For any natural number nnn and any assignment of natural numbers did_idi​ to indices i∈{0,…,n−1}i\in\{0,\ldots,n-1\}i∈{0,…,n−1}, this is the type

∏i=0n−1{0,…,di−1}.\prod_{i=0}^{n-1}\{0,\ldots,d_i-1\}.i=0∏n−1​{0,…,di​−1}.

Its elements choose one valid coordinate at every site. If n=0n=0n=0, it contains exactly the empty assignment; if any di=0d_i=0di​=0, it is empty.

QAlgorithms.Papers.Independent.Extend50.P22.Transversal

For every natural number nnn, every family of natural dimensions (di)i=0n−1(d_i)_{i=0}^{n-1}(di​)i=0n−1​, and every complex matrix UUU indexed by B=∏i=0n−1{0,…,di−1}\mathcal B=\prod_{i=0}^{n-1}\{0,\ldots,d_i-1\}B=∏i=0n−1​{0,…,di​−1}, this predicate means that there exist unitary complex di×did_i\times d_idi​×di​ matrices uiu_iui​, one for each site, such that

Uy,z=∏i=0n−1(ui)yi,zifor all y,z∈B.U_{y,z}=\prod_{i=0}^{n-1}(u_i)_{y_i,z_i} \quad\text{for all }y,z\in\mathcal B.Uy,z​=i=0∏n−1​(ui​)yi​,zi​​for all y,z∈B.

There is no additional overall phase in this equality. For n=0n=0n=0, the predicate holds exactly when UUU is the 1×11\times11×1 matrix [1][1][1]; 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 GGG and natural number kkk, this defines a complex matrix with rows indexed by arrays y:{0,…,k}2→Gy:\{0,\ldots,k\}^2\to Gy:{0,…,k}2→G and columns indexed by g∈Gg\in Gg∈G, with entries

Vy,g={∣G∣−k/2,yi,j=yi,0 for all i,jandy0,0y1,0⋯yk,0=g,0,otherwise.V_{y,g}= \begin{cases} |G|^{-k/2}, &\displaystyle y_{i,j}=y_{i,0}\ \text{for all }i,j \quad\text{and}\quad y_{0,0}y_{1,0}\cdots y_{k,0}=g,\\ 0,&\text{otherwise}. \end{cases}Vy,g​={∣G∣−k/2,0,​yi,j​=yi,0​ for all i,jandy0,0​y1,0​⋯yk,0​=g,otherwise.​

Thus the product of the row values is ordered by increasing row index. The definition permits noncommutative and trivial groups. For k=0k=0k=0, it is the matrix with entry 111 exactly when y0,0=gy_{0,0}=gy0,0​=g.

QAlgorithms.Papers.Independent.Extend50.P22.basisMapMatrix

For every type III and every function f:I→If:I\to If:I→I, this defines the complex matrix PfP_fPf​, with rows and columns indexed by III, by

(Pf)y,x={1y=f(x),0y≠f(x).(P_f)_{y,x}= \begin{cases} 1&y=f(x),\\ 0&y\ne f(x). \end{cases}(Pf​)y,x​={10​y=f(x),y=f(x).​

There is no finiteness, nonemptiness, injectivity, or surjectivity assumption on III or fff.

QAlgorithms.Papers.Independent.Extend50.P22.bitEncoding

For every group GGG, this defines a complex matrix with rows indexed by triples y∈G3y\in G^3y∈G3 and columns indexed by g∈Gg\in Gg∈G, with entries

Vy,g={1,y0=y1=y2=g,0,otherwise.V_{y,g}= \begin{cases} 1,&y_0=y_1=y_2=g,\\ 0,&\text{otherwise}. \end{cases}Vy,g​={1,0,​y0​=y1​=y2​=g,otherwise.​

Neither finiteness nor commutativity of GGG is assumed.

QAlgorithms.Papers.Independent.Extend50.P22.chargeEvolution

For any finite index type III equipped with decidable equality, any complex matrix TTT indexed by I×II\times II×I, and any real number θ\thetaθ, this definition assigns the matrix

chargeEvolution⁡(T,θ)=exp⁡(−iθT),\operatorname{chargeEvolution}(T,\theta)=\exp(-i\theta T),chargeEvolution(T,θ)=exp(−iθT),

where the exponential is the matrix exponential. There is no Hermiticity assumption on TTT, and III may be empty.

QAlgorithms.Papers.Independent.Extend50.P22.chargeRange

For any finite index type III with decidable equality and any complex matrix TTT indexed by I×II\times II×I, define a list of ∣I∣|I|∣I∣ real numbers λj(T)\lambda_j(T)λj​(T) to be the eigenvalues of TTT in ascending order, with multiplicities, when TTT is Hermitian, and to be identically zero otherwise. This definition returns

sup⁡{λj(T):0≤j<∣I∣}−inf⁡{λj(T):0≤j<∣I∣}.\sup\{\lambda_j(T):0\le j<|I|\} - \inf\{\lambda_j(T):0\le j<|I|\}.sup{λj​(T):0≤j<∣I∣}−inf{λj​(T):0≤j<∣I∣}.

For nonempty III and Hermitian TTT, this is the largest eigenvalue minus the smallest. For non-Hermitian TTT it is zero, and for empty III 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 NNN, this defines a complex matrix VVV with rows indexed by triples y∈(Z/NZ)3y\in(\mathbb Z/N\mathbb Z)^3y∈(Z/NZ)3 and columns indexed by g∈Z/NZg\in\mathbb Z/N\mathbb Zg∈Z/NZ, by

Vy,g=1N∑h∈Z/NZ1{y=(h, g−h, g−2h)}.V_{y,g}=\frac{1}{\sqrt N}\sum_{h\in\mathbb Z/N\mathbb Z} \mathbf 1_{\{y=(h,\ g-h,\ g-2h)\}}.Vy,g​=N​1​h∈Z/NZ∑​1{y=(h, g−h, g−2h)}​.

All arithmetic inside the triple is modulo NNN. Since its first coordinate determines hhh, the entry is 1/N1/\sqrt N1/N​ when y=(y0,g−y0,g−2y0)y=(y_0,g-y_0,g-2y_0)y=(y0​,g−y0​,g−2y0​), and zero otherwise. No primality assumption is imposed; N=1N=1N=1 is included.

QAlgorithms.Papers.Independent.Extend50.P22.diagonalError

For every type GGG, coordinate i∈{0,1,2}i\in\{0,1,2\}i∈{0,1,2}, and arbitrary function f:G→Cf:G\to\mathbb Cf:G→C, this defines the diagonal complex matrix on G3G^3G3 given by

(Di(f))y,z={f(yi),y=z,0,y≠z.(D_i(f))_{y,z}= \begin{cases} f(y_i),&y=z,\\ 0,&y\ne z. \end{cases}(Di​(f))y,z​={f(yi​),0,​y=z,y=z.​

No group structure, finiteness, normalization, or restriction on the values of fff is assumed.

QAlgorithms.Papers.Independent.Extend50.P22.dickeMarginalRootFidelity

For every pair of natural numbers N,dN,dN,d and integer mmm, this defines

FN,d(m)=∑k=0dpN,d,m(k) pN,d,0(k),F_{N,d}(m)=\sum_{k=0}^{d} \sqrt{p_{N,d,m}(k)\,p_{N,d,0}(k)},FN,d​(m)=k=0∑d​pN,d,m​(k)pN,d,0​(k)​,

where, for any integer ttt, setting ut=max⁡(⌊(N+t)/2⌋,0)u_t=\max(\lfloor(N+t)/2\rfloor,0)ut​=max(⌊(N+t)/2⌋,0),

pN,d,t(k)={(dk)(N−dut−k)(Nut),k≤ut,0,k>ut.p_{N,d,t}(k)= \begin{cases} \displaystyle\frac{\binom dk\binom{N-d}{u_t-k}}{\binom N{u_t}},&k\le u_t,\\[6pt] 0,&k>u_t. \end{cases}pN,d,t​(k)=⎩⎨⎧​(ut​N​)(kd​)(ut​−kN−d​)​,0,​k≤ut​,k>ut​.​

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 N,d,mN,d,mN,d,m, and normalization of these weights is not a hypothesis. When d=0d=0d=0, the sum still contains its k=0k=0k=0 term.

QAlgorithms.Papers.Independent.Extend50.P22.dickeMarginalWeight

For every pair of natural numbers N,dN,dN,d, integer mmm, and integer index kkk with 0≤k≤d0\le k\le d0≤k≤d, let u=max⁡(⌊(N+m)/2⌋,0)u=\max(\lfloor(N+m)/2\rfloor,0)u=max(⌊(N+m)/2⌋,0). This defines the real number

pN,d,m(k)={(dk)(N−du−k)(Nu),k≤u,0,k>u.p_{N,d,m}(k)= \begin{cases} \displaystyle\frac{\binom dk\binom{N-d}{u-k}}{\binom Nu},&k\le u,\\[6pt] 0,&k>u. \end{cases}pN,d,m​(k)=⎩⎨⎧​(uN​)(kd​)(u−kN−d​)​,0,​k≤u,k>u.​

Here N−dN-dN−d and u−ku-ku−k are natural-number subtractions, truncated at zero. No assumption requires d≤Nd\le Nd≤N, u≤Nu\le Nu≤N, or any parity relation. Binomial coefficients outside their natural range are zero, and division by zero gives zero; thus if u>Nu>Nu>N, every value is zero. The definition includes N=0N=0N=0 and d=0d=0d=0.

QAlgorithms.Papers.Independent.Extend50.P22.entangledInputRootFidelity

For any natural number ddd, any function KKK from complex d×dd\times dd×d matrices to complex d×dd\times dd×d matrices, and any vector ψ∈C{0,…,d−1}2\psi\in\mathbb C^{\{0,\ldots,d-1\}^2}ψ∈C{0,…,d−1}2, put Dψ=ψψ†D_\psi=\psi\psi^\daggerDψ​=ψψ† and define the action on the second register by

[(id⊗K)(X)](a,b),(a′,b′)=[K ⁣((X(a,i),(a′,j))i,j)]b,b′.[(\mathrm{id}\otimes K)(X)]_{(a,b),(a',b')} = \left[K\!\left((X_{(a,i),(a',j)})_{i,j}\right)\right]_{b,b'}.[(id⊗K)(X)](a,b),(a′,b′)​=[K((X(a,i),(a′,j)​)i,j​)]b,b′​.

The declaration defines the real number

Re⁡Tr⁡S ⁣(S(Dψ) (id⊗K)(Dψ) S(Dψ)),\operatorname{Re}\operatorname{Tr} \mathcal S\!\left(\mathcal S(D_\psi)\,(\mathrm{id}\otimes K)(D_\psi)\,\mathcal S(D_\psi)\right),ReTrS(S(Dψ​)(id⊗K)(Dψ​)S(Dψ​)),

where S(A)\mathcal S(A)S(A) is the continuous functional calculus of the real square-root function: on a Hermitian matrix it applies max⁡(t,0)\sqrt{\max(t,0)}max(t,0)​ to each eigenvalue, and on a non-Hermitian matrix it is zero. Neither normalization of ψ\psiψ nor any channel, linearity, or positivity condition on KKK is assumed. The case d=0d=0d=0 is included, and its value is 000.

QAlgorithms.Papers.Independent.Extend50.P22.erase

For any natural number nnn, natural local dimensions did_idi​, finite subset SSS of the sites, and reset assignment r∈∏i{0,…,di−1}r\in\prod_i\{0,\ldots,d_i-1\}r∈∏i​{0,…,di​−1}, this defines a function on complex matrices indexed by T=∏i{0,…,di−1}T=\prod_i\{0,\ldots,d_i-1\}T=∏i​{0,…,di​−1} by

[ES,r(X)]y,z={∑a∈∏i∈S{0,…,di−1}Xy[S←a], z[S←a],yi=zi=ri for every i∈S,0,otherwise.[\mathcal E_{S,r}(X)]_{y,z}= \begin{cases} \displaystyle\sum_{a\in\prod_{i\in S}\{0,\ldots,d_i-1\}} X_{y[S\leftarrow a],\,z[S\leftarrow a]}, & y_i=z_i=r_i\ \text{for every }i\in S,\\ 0,&\text{otherwise}. \end{cases}[ES,r​(X)]y,z​=⎩⎨⎧​a∈∏i∈S​{0,…,di​−1}∑​Xy[S←a],z[S←a]​,0,​yi​=zi​=ri​ for every i∈S,otherwise.​

Here y[S←a]y[S\leftarrow a]y[S←a] replaces yiy_iyi​ by aia_iai​ on SSS and retains yiy_iyi​ elsewhere. The input XXX is an arbitrary matrix. The reset assignment cannot exist if any di=0d_i=0di​=0. Empty SSS gives the identity function on matrices; taking SSS to be every site gives Tr⁡(X)∣r⟩⟨r∣\operatorname{Tr}(X)\lvert r\rangle\langle r\rvertTr(X)∣r⟩⟨r∣. The case n=0n=0n=0 is included.

QAlgorithms.Papers.Independent.Extend50.P22.errorE

For every natural number ddd, every finite type BBB with decidable equality, and every function CCC from complex d×dd\times dd×d matrices to complex matrices indexed by BBB, let Φd\Phi_dΦd​ have coordinates

Φd(a,b)={1/d,a=b,0,a≠b.\Phi_d(a,b)= \begin{cases} 1/\sqrt d,&a=b,\\ 0,&a\ne b. \end{cases}Φd​(a,b)={1/d​,0,​a=b,a=b.​

For each recovery function R(Y)=∑j=0r−1EjYEj†R(Y)=\sum_{j=0}^{r-1}E_jYE_j^\daggerR(Y)=∑j=0r−1​Ej​YEj†​ satisfying ∑jEj†Ej=IB\sum_jE_j^\dagger E_j=I_B∑j​Ej†​Ej​=IB​, set D=ΦdΦd†D=\Phi_d\Phi_d^\daggerD=Φd​Φd†​ and

fR=Re⁡Tr⁡S ⁣(S(D) (id⊗(R∘C))(D) S(D)).f_R=\operatorname{Re}\operatorname{Tr} \mathcal S\!\left(\mathcal S(D)\,(\mathrm{id}\otimes(R\circ C))(D)\,\mathcal S(D)\right).fR​=ReTrS(S(D)(id⊗(R∘C))(D)S(D)).

The declaration defines 1−(sup⁡RfR)2\sqrt{1-(\sup_R f_R)^2}1−(supR​fR​)2​. Here rrr is any natural number, EjE_jEj​ is a complex d×Bd\times Bd×B matrix, id⊗F\mathrm{id}\otimes Fid⊗F applies FFF to each block with fixed first-register indices, and S\mathcal SS is real-square-root continuous functional calculus, assigning zero to non-Hermitian matrices and mapping negative eigenvalues to zero. The function CCC is unrestricted; the real supremum is 000 if its set is empty or unbounded above, and the real square root is 000 for a negative argument. The case d=0d=0d=0 is included: Φd\Phi_dΦd​ is then the zero vector and the defined error is 111.

QAlgorithms.Papers.Independent.Extend50.P22.errorWorst

For every natural number ddd, every finite type BBB with decidable equality, and every function CCC from complex d×dd\times dd×d matrices to complex matrices indexed by BBB, define

w=sup⁡Rinf⁡ψ∈C{0,…,d−1}2∥ψ∥=1Re⁡Tr⁡S ⁣(S(Dψ) (id⊗(R∘C))(Dψ) S(Dψ)),Dψ=ψψ†.w=\sup_R\inf_{\substack{\psi\in\mathbb C^{\{0,\ldots,d-1\}^2}\\\|\psi\|=1}} \operatorname{Re}\operatorname{Tr} \mathcal S\!\left(\mathcal S(D_\psi)\,(\mathrm{id}\otimes(R\circ C))(D_\psi)\,\mathcal S(D_\psi)\right), \qquad D_\psi=\psi\psi^\dagger.w=Rsup​ψ∈C{0,…,d−1}2∥ψ∥=1​inf​ReTrS(S(Dψ​)(id⊗(R∘C))(Dψ​)S(Dψ​)),Dψ​=ψψ†.

The declaration defines 1−w2\sqrt{1-w^2}1−w2​. The outer supremum ranges over functions R(Y)=∑j=0r−1EjYEj†R(Y)=\sum_{j=0}^{r-1}E_jYE_j^\daggerR(Y)=∑j=0r−1​Ej​YEj†​, for any natural number rrr, where the complex d×Bd\times Bd×B matrices EjE_jEj​ satisfy ∑jEj†Ej=IB\sum_jE_j^\dagger E_j=I_B∑j​Ej†​Ej​=IB​. The operation id⊗F\mathrm{id}\otimes Fid⊗F applies FFF to each block with fixed first-register indices, and S\mathcal SS 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 CCC. The extrema use the real conventions assigning 000 to empty sets and to the respective unbounded extrema, and a negative square-root argument gives 000. When d=0d=0d=0, the unit-vector set is empty, w=0w=0w=0, and the defined error is 111.

QAlgorithms.Papers.Independent.Extend50.P22.evenEncoding

For every finite group GGG and every natural number kkk, including k=0k=0k=0, put N=2k+4N=2k+4N=2k+4 and L=2k+2L=2k+2L=2k+2. This defines a complex matrix with rows indexed by y∈GNy\in G^Ny∈GN and columns indexed by x∈GLx\in G^Lx∈GL, whose entries are

Vy,x=1∣G∣∑g∈G1{yj=g wj(x) for every 0≤j<N},wj(x)={1G,j=0,xN−3,j=N−1,x0,j=1,xj−1xj−2,2≤j<N−1, j even,xj−2xj−1,2≤j<N−1, j odd.V_{y,x}=\frac{1}{\sqrt{|G|}}\sum_{g\in G}\mathbf 1_{\{y_j=g\,w_j(x)\text{ for every }0\le j<N\}}, \qquad w_j(x)= \begin{cases} 1_G,&j=0,\\ x_{N-3},&j=N-1,\\ x_0,&j=1,\\ x_{j-1}x_{j-2},&2\le j<N-1,\ j\text{ even},\\ x_{j-2}x_{j-1},&2\le j<N-1,\ j\text{ odd}. \end{cases}Vy,x​=∣G∣​1​g∈G∑​1{yj​=gwj​(x) for every 0≤j<N}​,wj​(x)=⎩⎨⎧​1G​,xN−3​,x0​,xj−1​xj−2​,xj−2​xj−1​,​j=0,j=N−1,j=1,2≤j<N−1, j even,2≤j<N−1, j odd.​

Here 1\mathbf 11 is 111 when its condition holds and 000 otherwise, and all products retain the displayed order. No commutativity or nontriviality assumption is imposed on GGG.

QAlgorithms.Papers.Independent.Extend50.P22.evenLogical

For every group GGG, natural number kkk, tuple r∈Gk+1r\in G^{k+1}r∈Gk+1, and tuple x∈G2k+2x\in G^{2k+2}x∈G2k+2, this defines a tuple of the same length by

(Hr(x))j={xj rj/2−1,j even,xj,j odd.\bigl(H_r(x)\bigr)_j= \begin{cases} x_j\,r_{j/2}^{-1},&j\text{ even},\\ x_j,&j\text{ odd}. \end{cases}(Hr​(x))j​={xj​rj/2−1​,xj​,​j even,j odd.​

Here j/2j/2j/2 is an integer when the first case applies. The definition includes k=0k=0k=0 and assumes neither finiteness nor commutativity of GGG.

QAlgorithms.Papers.Independent.Extend50.P22.evenPhysical

For every group GGG, natural number kkk, tuple r∈Gk+1r\in G^{k+1}r∈Gk+1, and tuple y∈G2k+4y\in G^{2k+4}y∈G2k+4, this defines another tuple of the same length by

(Fr(y))j={yj r⌊(j−1)/2⌋−1,0<j<2k+3,yj,j=0 or j=2k+3.\bigl(F_r(y)\bigr)_j= \begin{cases} y_j\,r_{\lfloor(j-1)/2\rfloor}^{-1},&0<j<2k+3,\\ y_j,&j=0\text{ or }j=2k+3. \end{cases}(Fr​(y))j​={yj​r⌊(j−1)/2⌋−1​,yj​,​0<j<2k+3,j=0 or j=2k+3.​

Thus the two endpoint coordinates remain fixed, while each consecutive interior pair 2a+1,2a+22a+1,2a+22a+1,2a+2, for 0≤a≤k0\le a\le k0≤a≤k, is right multiplied by ra−1r_a^{-1}ra−1​. Finiteness and commutativity of GGG are not assumed; k=0k=0k=0 is included.

QAlgorithms.Papers.Independent.Extend50.P22.evenWord

For every group GGG, natural number k≥0k\ge0k≥0, and tuple x∈G 2(k+2)−2x\in G^{\,2(k+2)-2}x∈G2(k+2)−2, this defines a tuple y∈G 2(k+2)y\in G^{\,2(k+2)}y∈G2(k+2). Put L=2(k+2)L=2(k+2)L=2(k+2), and define ut=xtu_t=x_tut​=xt​ for t<L−2t<L-2t<L−2 and ut=1Gu_t=1_Gut​=1G​ otherwise. For 0≤j<L0\le j<L0≤j<L, the coordinates are

yj={1Gj=0,uL−3j=L−1,u0j=1,uj−1uj−2j∉{0,1,L−1} and j is even,uj−2uj−1otherwise.y_j= \begin{cases} 1_G&j=0,\\ u_{L-3}&j=L-1,\\ u_0&j=1,\\ u_{j-1}u_{j-2}&j\notin\{0,1,L-1\}\text{ and }j\text{ is even},\\ u_{j-2}u_{j-1}&\text{otherwise}. \end{cases}yj​=⎩⎨⎧​1G​uL−3​u0​uj−1​uj−2​uj−2​uj−1​​j=0,j=L−1,j=1,j∈/{0,1,L−1} and j is even,otherwise.​

Natural-number subtractions are truncated at zero, and the cases are tested in the displayed order. No finiteness or commutativity of GGG is assumed; k=0k=0k=0 is included and gives y=(1G,x0,x1x0,x1)y=(1_G,x_0,x_1x_0,x_1)y=(1G​,x0​,x1​x0​,x1​).

QAlgorithms.Papers.Independent.Extend50.P22.finiteMax

For any type BBB equipped with a linear order, any natural number nnn with a supplied hypothesis n>0n>0n>0, and any function f:{0,…,n−1}→Bf:\{0,\ldots,n-1\}\to Bf:{0,…,n−1}→B, this definition returns the maximum max⁡0≤i<nf(i)\max_{0\le i<n}f(i)max0≤i<n​f(i). The positivity hypothesis ensures that the set of values is nonempty; the definition has no case with n=0n=0n=0.

QAlgorithms.Papers.Independent.Extend50.P22.firstLogicalX

This defines a complex matrix LLL whose rows and columns are indexed by pairs of Boolean values. For row (c,d)(c,d)(c,d) and column (a,b)(a,b)(a,b),

L(c,d),(a,b)={1,(c,d)=(¬a,b),0,otherwise.L_{(c,d),(a,b)}= \begin{cases} 1,&(c,d)=(\neg a,b),\\ 0,&\text{otherwise}. \end{cases}L(c,d),(a,b)​={1,0,​(c,d)=(¬a,b),otherwise.​

Thus its action on a computational basis vector flips the first component.

QAlgorithms.Papers.Independent.Extend50.P22.fiveQuditEncoding

For every nonzero natural number DDD and every complex number ω\omegaω, this defines a complex matrix VVV with rows y∈(Z/DZ)5y\in(\mathbb Z/D\mathbb Z)^5y∈(Z/DZ)5 and columns x∈Z/DZx\in\mathbb Z/D\mathbb Zx∈Z/DZ, by

Vy,x={D−2ω val⁡(∑i=04yiyi+1 mod 5),∑i=04yi=x in Z/DZ,0,otherwise.V_{y,x}= \begin{cases} D^{-2}\omega^{\,\operatorname{val}(\sum_{i=0}^{4}y_i y_{i+1\bmod5})}, &\sum_{i=0}^{4}y_i=x\text{ in }\mathbb Z/D\mathbb Z,\\ 0,&\text{otherwise}. \end{cases}Vy,x​={D−2ωval(∑i=04​yi​yi+1mod5​),0,​∑i=04​yi​=x in Z/DZ,otherwise.​

Here the quadratic sum is first computed modulo DDD, and val⁡\operatorname{val}val then selects its representative in {0,…,D−1}\{0,\ldots,D-1\}{0,…,D−1} as the natural-number exponent. The definition assumes neither primality of DDD nor any root-of-unity property of ω\omegaω; ω=0\omega=0ω=0 is allowed, with 00=10^0=100=1. For D=1D=1D=1, the matrix has one entry, equal to 111.

QAlgorithms.Papers.Independent.Extend50.P22.fixedFidelity

For every natural number ddd, every finite type BBB with decidable equality, every function CCC from complex d×dd\times dd×d matrices to complex matrices indexed by BBB, and every ψ∈C{0,…,d−1}2\psi\in\mathbb C^{\{0,\ldots,d-1\}^2}ψ∈C{0,…,d−1}2, this defines

sup⁡RRe⁡Tr⁡S ⁣(S(Dψ) (id⊗(R∘C))(Dψ) S(Dψ)).\sup_R\operatorname{Re}\operatorname{Tr} \mathcal S\!\left(\mathcal S(D_\psi)\,(\mathrm{id}\otimes(R\circ C))(D_\psi)\,\mathcal S(D_\psi)\right).Rsup​ReTrS(S(Dψ​)(id⊗(R∘C))(Dψ​)S(Dψ​)).

Here Dψ=ψψ†D_\psi=\psi\psi^\daggerDψ​=ψψ†, and RRR ranges over functions admitting a finite Kraus representation

R(Y)=∑j=0r−1EjYEj†,∑j=0r−1Ej†Ej=IB,R(Y)=\sum_{j=0}^{r-1}E_jYE_j^\dagger,\qquad \sum_{j=0}^{r-1}E_j^\dagger E_j=I_B,R(Y)=j=0∑r−1​Ej​YEj†​,j=0∑r−1​Ej†​Ej​=IB​,

for some natural number rrr and complex matrices EjE_jEj​ with rows indexed by {0,…,d−1}\{0,\ldots,d-1\}{0,…,d−1} and columns indexed by BBB. For a function FFF, (id⊗F)(X)(\mathrm{id}\otimes F)(X)(id⊗F)(X) applies FFF separately to each block (X(a,i),(a′,j))i,j(X_{(a,i),(a',j)})_{i,j}(X(a,i),(a′,j)​)i,j​. The operation S\mathcal SS applies the real square-root function through continuous functional calculus, with negative eigenvalues mapped to zero and non-Hermitian matrices assigned zero. The function CCC is unrestricted, and ψ\psiψ need not have norm one. The supremum is the real supremum used in the code, which is 000 for an empty or unbounded-above set; an admissible RRR need not exist, for example when BBB is empty and d>0d>0d>0. The value is 000 when d=0d=0d=0.

QAlgorithms.Papers.Independent.Extend50.P22.gaussianNormalization

For every real number www, this defines the real number

Z(w)=∑y∈Zexp⁡ ⁣(−y22w2).Z(w)=\sum_{y\in\mathbb Z}\exp\!\left(-\frac{y^2}{2w^2}\right).Z(w)=y∈Z∑​exp(−2w2y2​).

There is no assumption that www is positive or nonzero. Division uses the total real-field convention a/0=0a/0=0a/0=0, and the infinite sum has value 000 when the family is not summable. In particular, at w=0w=0w=0 every summand is 111, so this definition gives Z(0)=0Z(0)=0Z(0)=0.

QAlgorithms.Papers.Independent.Extend50.P22.groupAt

For every group GGG, natural number kkk, function x:{0,…,k−1}→Gx:\{0,\ldots,k-1\}\to Gx:{0,…,k−1}→G, and natural number jjj, this defines

groupAt(x,j)={xjj<k,1Gj≥k.\mathrm{groupAt}(x,j)= \begin{cases} x_j&j<k,\\ 1_G&j\ge k. \end{cases}groupAt(x,j)={xj​1G​​j<k,j≥k.​

No finiteness or commutativity of GGG is assumed. In particular, when k=0k=0k=0, the value is 1G1_G1G​ for every jjj.

QAlgorithms.Papers.Independent.Extend50.P22.groupErase

For a finite type JJJ, a finite group GGG, and a finite subset S⊆JS\subseteq JS⊆J, this defines a function ES\mathcal E_SES​ on complex matrices indexed by J→GJ\to GJ→G. Writing 1G1_G1G​ for the group identity and y[S←a]y[S\leftarrow a]y[S←a] for replacement of the coordinates in SSS by a:S→Ga:S\to Ga:S→G, its entries are

ES(X)y,z={∑a:S→GXy[S←a], z[S←a]∀i∈S, y(i)=z(i)=1G,0otherwise.\mathcal E_S(X)_{y,z}= \begin{cases} \displaystyle\sum_{a:S\to G}X_{y[S\leftarrow a],\,z[S\leftarrow a]} &\forall i\in S,\ y(i)=z(i)=1_G,\\ 0&\text{otherwise}. \end{cases}ES​(X)y,z​=⎩⎨⎧​a:S→G∑​Xy[S←a],z[S←a]​0​∀i∈S, y(i)=z(i)=1G​,otherwise.​

No positivity or normalization of XXX, or commutativity of GGG, is required. The type JJJ and subset SSS may be empty; for S=∅S=\varnothingS=∅, this is the identity function on matrices.

QAlgorithms.Papers.Independent.Extend50.P22.groupFourEncoding

For every finite group GGG, this defines a complex matrix VVV with rows indexed by four-tuples y∈G4y\in G^4y∈G4 and columns by pairs (a,b)∈G×G(a,b)\in G\times G(a,b)∈G×G, by

Vy,(a,b)=1∣G∣∑g∈G1{y=(g, g−1a, gb, g−1ab)}.V_{y,(a,b)} =\frac1{\sqrt{|G|}}\sum_{g\in G} \mathbf 1_{\{y=(g,\ g^{-1}a,\ gb,\ g^{-1}ab)\}}.Vy,(a,b)​=∣G∣​1​g∈G∑​1{y=(g, g−1a, gb, g−1ab)}​.

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 GGG, this defines a complex matrix with rows indexed by triples y∈G3y\in G^3y∈G3 and columns indexed by g∈Gg\in Gg∈G, with entries

Vy,g={∣G∣−1,y0y1y2=g,0,otherwise.V_{y,g}= \begin{cases} |G|^{-1},&y_0y_1y_2=g,\\ 0,&\text{otherwise}. \end{cases}Vy,g​={∣G∣−1,0,​y0​y1​y2​=g,otherwise.​

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 HHH be a complete complex inner product space with its compatible normed additive group structure, let III be any index type, and let (bi)i∈I(b_i)_{i\in I}(bi​)i∈I​ be a Hilbert basis of HHH. For arbitrary bounded complex-linear operators ρ,σ:H→H\rho,\sigma:H\to Hρ,σ:H→H, put S=cfc⁡(⋅,ρ)S=\operatorname{cfc}(\sqrt{\cdot},\rho)S=cfc(⋅​,ρ), where cfc⁡\operatorname{cfc}cfc denotes the total continuous functional calculus. The definition assigns the real number

Fb(ρ,σ)=Re⁡∑i∈I⟨bi, cfc⁡ ⁣(⋅,S∘σ∘S)bi⟩.F_b(\rho,\sigma) = \operatorname{Re}\sum_{i\in I} \left\langle b_i,\, \operatorname{cfc}\!\left(\sqrt{\cdot},S\circ\sigma\circ S\right)b_i \right\rangle.Fb​(ρ,σ)=Rei∈I∑​⟨bi​,cfc(⋅​,S∘σ∘S)bi​⟩.

There are no positivity, trace-class, normalization, or summability hypotheses on ρ\rhoρ and σ\sigmaσ, and no countability assumption on III. 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 nnn, any family of natural dimensions (dj)j=0n−1(d_j)_{j=0}^{n-1}(dj​)j=0n−1​, a chosen index i<ni<ni<n, and any complex di×did_i\times d_idi​×di​ matrix TTT, this definition produces a matrix on the basis B=∏j=0n−1{0,…,dj−1}\mathcal B=\prod_{j=0}^{n-1}\{0,\ldots,d_j-1\}B=∏j=0n−1​{0,…,dj​−1} with entries

Li(T)y,z=Tyi,zi∏0≤j<nj≠i1{yj=zj}.L_i(T)_{y,z}=T_{y_i,z_i}\prod_{\substack{0\le j<n\\j\ne i}}\mathbf1_{\{y_j=z_j\}}.Li​(T)y,z​=Tyi​,zi​​0≤j<nj=i​∏​1{yj​=zj​}​.

Thus its entry is Tyi,ziT_{y_i,z_i}Tyi​,zi​​ when yyy and zzz agree outside site iii, and zero otherwise. The supplied index excludes n=0n=0n=0; individual dimensions may be zero, in which case B\mathcal BB is empty. When n=1n=1n=1, the displayed product is empty and equals 111.

QAlgorithms.Papers.Independent.Extend50.P22.localTensorProduct

For every natural number nnn, every family of natural dimensions (di)i=0n−1(d_i)_{i=0}^{n-1}(di​)i=0n−1​, and every family of complex di×did_i\times d_idi​×di​ matrices UiU_iUi​, this definition produces the matrix indexed by B=∏i=0n−1{0,…,di−1}\mathcal B=\prod_{i=0}^{n-1}\{0,\ldots,d_i-1\}B=∏i=0n−1​{0,…,di​−1} whose entries are

Uy,z=∏i=0n−1(Ui)yi,zi.U_{y,z}=\prod_{i=0}^{n-1}(U_i)_{y_i,z_i}.Uy,z​=i=0∏n−1​(Ui​)yi​,zi​​.

No positivity or unitarity assumptions are imposed. For n=0n=0n=0, B\mathcal BB has one element and the empty product gives the 1×11\times11×1 matrix [1][1][1]; if any site dimension is zero, B\mathcal BB is empty.

QAlgorithms.Papers.Independent.Extend50.P22.locationFlaggedChannel

For arbitrary types K,A,BK,A,BK,A,B, with a finite enumeration of KKK, any real function q:K→Rq:K\to\mathbb Rq:K→R, and any family of functions CiC_iCi​ taking complex matrices indexed by AAA to complex matrices indexed by BBB, this defines a function into matrices indexed by K×BK\times BK×B through

[F(X)](i,b),(j,b′)={qi[Ci(X)]b,b′,i=j,0,i≠j.[\mathcal F(X)]_{(i,b),(j,b')}= \begin{cases} q_i[C_i(X)]_{b,b'},&i=j,\\ 0,&i\ne j. \end{cases}[F(X)](i,b),(j,b′)​={qi​[Ci​(X)]b,b′​,0,​i=j,i=j.​

Thus the output has diagonal blocks qiCi(X)q_iC_i(X)qi​Ci​(X) 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 AAA and BBB need not be finite or nonempty; empty KKK is also allowed and gives a matrix with an empty index type.

QAlgorithms.Papers.Independent.Extend50.P22.meanSpread

For every natural number ddd, including d=0d=0d=0, and every complex d×dd\times dd×d matrix TTT, put A=T−tr⁡TdIdA=T-\frac{\operatorname{tr}T}{d}I_dA=T−dtrT​Id​. This definition returns

Re⁡tr⁡A†A2d,\frac{\operatorname{Re}\operatorname{tr}\sqrt{A^\dagger A}}{2d},2dRetrA†A​​,

where the square root is defined by functional calculus. No Hermitian hypothesis is imposed on TTT. Division by zero uses the total field convention x/0=0x/0=0x/0=0, so the value at d=0d=0d=0 is zero.

QAlgorithms.Papers.Independent.Extend50.P22.normalizedWeylDimension

For every natural number ddd and every function λ:{0,…,d−1}→N\lambda:\{0,\ldots,d-1\}\to\mathbb Nλ:{0,…,d−1}→N, this defines

Dd(λ)=∏0≤a<d ∏a<b<dλa−λb+b−ab−a,D_d(\lambda)= \prod_{0\le a<d}\ \prod_{a<b<d} \frac{\lambda_a-\lambda_b+b-a}{b-a},Dd​(λ)=0≤a<d∏​ a<b<d∏​b−aλa​−λb​+b−a​,

where all arithmetic inside the fractions takes place in R\mathbb RR. The definition extends λ\lambdaλ by zero beyond its domain before evaluating this product, but the displayed product only uses indices below ddd. No monotonicity or partition condition is assumed. Empty products equal 111, so D0(λ)=D1(λ)=1D_0(\lambda)=D_1(\lambda)=1D0​(λ)=D1​(λ)=1.

QAlgorithms.Papers.Independent.Extend50.P22.orbitEncoding

For finite types G,JG,JG,J, an arbitrary type LLL, and a function word:G→L→(J→G)\mathrm{word}:G\to L\to(J\to G)word:G→L→(J→G), this defines a complex matrix VVV with rows indexed by J→GJ\to GJ→G and columns by LLL, whose entries are

Vy,x=1∣G∣∑g∈G{1y=word(g,x),0otherwise.V_{y,x}=\frac{1}{\sqrt{|G|}}\sum_{g\in G} \begin{cases} 1&y=\mathrm{word}(g,x),\\ 0&\text{otherwise}. \end{cases}Vy,x​=∣G∣​1​g∈G∑​{10​y=word(g,x),otherwise.​

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 GGG 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 DDD, this defines the diagonal complex matrix QDQ_DQD​ indexed by Z/DZ\mathbb Z/D\mathbb ZZ/DZ, with

(QD)x,y={val⁡(x),x=y,0,x≠y,(Q_D)_{x,y}= \begin{cases} \operatorname{val}(x),&x=y,\\ 0,&x\ne y, \end{cases}(QD​)x,y​={val(x),0,​x=y,x=y,​

where val⁡(x)∈{0,…,D−1}\operatorname{val}(x)\in\{0,\ldots,D-1\}val(x)∈{0,…,D−1} is regarded as a complex number. Thus the diagonal uses the chosen nonnegative integer representatives, rather than residues as complex numbers. The case D=1D=1D=1 is included and gives the zero matrix.

QAlgorithms.Papers.Independent.Extend50.P22.schurCartan

For natural numbers d,nd,nd,n and a Young diagram λ\lambdaλ with exactly nnn cells and first-column length at most ddd, this defines a continuous complex-linear operator on the following subspace SλS_\lambdaSλ​ of the Euclidean space with coordinates indexed by words x:{0,…,n−1}→{0,…,d−1}x:\{0,\ldots,n-1\}\to\{0,\ldots,d-1\}x:{0,…,n−1}→{0,…,d−1}: number the cells using the finite-enumeration bijection in the definition, let RλR_\lambdaRλ​ and CλC_\lambdaCλ​ consist respectively of permutations preserving each numbered cell’s row and column, let (Pπ)y,x=1(P_\pi)_{y,x}=1(Pπ​)y,x​=1 when y=x∘π−1y=x\circ\pi^{-1}y=x∘π−1 and zero otherwise, and set

Yλ=∑a∈Rλ∑b∈Cλsgn⁡(b)Pab,Sλ=range⁡(Yλ).Y_\lambda=\sum_{a\in R_\lambda}\sum_{b\in C_\lambda}\operatorname{sgn}(b)P_{ab}, \qquad S_\lambda=\operatorname{range}(Y_\lambda).Yλ​=a∈Rλ​∑​b∈Cλ​∑​sgn(b)Pab​,Sλ​=range(Yλ​).

The defined operator sends v∈Sλv\in S_\lambdav∈Sλ​ to the orthogonal projection onto SλS_\lambdaSλ​ of Cd,nvC_{d,n}vCd,n​v, where Cd,nC_{d,n}Cd,n​ is diagonal with entry #{i:xi=0}−#{i:xi=d−1}\#\{i:x_i=0\}-\#\{i:x_i=d-1\}#{i:xi​=0}−#{i:xi​=d−1} at word xxx, using natural-number subtraction for d−1d-1d−1. No positivity assumption on ddd or nnn is imposed; for n=0n=0n=0 the operator is zero, and d=0d=0d=0 permits only the empty diagram.

QAlgorithms.Papers.Independent.Extend50.P22.sharpDims

For arbitrary natural numbers h,mh,mh,m, this defines the three site dimensions as the function on {0,1,2}\{0,1,2\}{0,1,2} given by

d0=6m+1,d1=2(m+h)+1,d2=4(m+h)+1.d_0=6m+1,\qquad d_1=2(m+h)+1,\qquad d_2=4(m+h)+1.d0​=6m+1,d1​=2(m+h)+1,d2​=4(m+h)+1.

There is no assumption that h≤mh\le mh≤m, and zero values of either parameter are permitted; all three resulting dimensions are positive.

QAlgorithms.Papers.Independent.Extend50.P22.sharpEncoding

For arbitrary natural numbers h,mh,mh,m, put d0=6m+1d_0=6m+1d0​=6m+1, d1=2(m+h)+1d_1=2(m+h)+1d1​=2(m+h)+1, and d2=4(m+h)+1d_2=4(m+h)+1d2​=4(m+h)+1. This defines a complex matrix VVV with rows y=(y0,y1,y2)y=(y_0,y_1,y_2)y=(y0​,y1​,y2​), where 0≤yi<di0\le y_i<d_i0≤yi​<di​, and columns x∈{0,…,2h}x\in\{0,\ldots,2h\}x∈{0,…,2h}. Define the integers a0=y0−3ma_0=y_0-3ma0​=y0​−3m, a1=y1−(m+h)a_1=y_1-(m+h)a1​=y1​−(m+h), a2=y2−2(m+h)a_2=y_2-2(m+h)a2​=y2​−2(m+h), and ℓ=x−h\ell=x-hℓ=x−h. Then

Vy,x={(2m+1)−1/2,if some t∈Z satisfies −m≤t≤m,a0=−3t,a1=t−ℓ,a2=2(t+ℓ),0,otherwise.V_{y,x}= \begin{cases} (2m+1)^{-1/2}, &\text{if some }t\in\mathbb Z\text{ satisfies } -m\le t\le m,\quad a_0=-3t,\quad a_1=t-\ell,\quad a_2=2(t+\ell),\\ 0,&\text{otherwise}. \end{cases}Vy,x​={(2m+1)−1/2,0,​if some t∈Z satisfies −m≤t≤m,a0​=−3t,a1​=t−ℓ,a2​=2(t+ℓ),otherwise.​

The subtractions defining aia_iai​ and ℓ\ellℓ are integer subtractions, so negative values are allowed. No assumption h≤mh\le mh≤m is included in the definition; h=0h=0h=0 and m=0m=0m=0 are allowed, and the normalization denominator is always positive.

QAlgorithms.Papers.Independent.Extend50.P22.shiftError

For every group GGG, coordinate i∈{0,1,2}i\in\{0,1,2\}i∈{0,1,2}, and element g∈Gg\in Gg∈G, this defines a complex matrix on triples from GGG by

(Si(g))z,y={1,zi=g yi and zj=yj for every j≠i,0,otherwise.(S_i(g))_{z,y}= \begin{cases} 1,&z_i=g\,y_i\text{ and }z_j=y_j\text{ for every }j\ne i,\\ 0,&\text{otherwise}. \end{cases}(Si​(g))z,y​={1,0,​zi​=gyi​ and zj​=yj​ for every j=i,otherwise.​

Thus its column indexed by yyy has its 111 in the row obtained by left multiplying coordinate iii by ggg. No finiteness or commutativity assumption is made.

QAlgorithms.Papers.Independent.Extend50.P22.splice

For any natural number nnn, any natural local dimensions did_idi​, any finite subset S⊆{0,…,n−1}S\subseteq\{0,\ldots,n-1\}S⊆{0,…,n−1}, any assignment y∈∏i{0,…,di−1}y\in\prod_i\{0,\ldots,d_i-1\}y∈∏i​{0,…,di​−1}, and any assignment a∈∏i∈S{0,…,di−1}a\in\prod_{i\in S}\{0,\ldots,d_i-1\}a∈∏i∈S​{0,…,di​−1}, this defines the assignment

splice⁡S(y,a)i={ai,i∈S,yi,i∉S.\operatorname{splice}_S(y,a)_i= \begin{cases} a_i,&i\in S,\\ y_i,&i\notin S. \end{cases}spliceS​(y,a)i​={ai​,yi​,​i∈S,i∈/S.​

When SSS is empty the result is yyy, and when SSS is all sites the result uses aaa everywhere. No positivity of the dimensions is separately assumed, although the supplied yyy cannot exist if any local dimension is zero; n=0n=0n=0 is allowed.

QAlgorithms.Papers.Independent.Extend50.P22.stabilizedFourEncoding

For every finite group GGG, this defines a complex matrix VVV with rows indexed by y∈G4y\in G^4y∈G4 and columns by (a,b)∈G×G(a,b)\in G\times G(a,b)∈G×G, by

Vy,(a,b)=1∣G∣∑g∈G1{y=(g, ga, gba, gb)}.V_{y,(a,b)} =\frac1{\sqrt{|G|}}\sum_{g\in G} \mathbf 1_{\{y=(g,\ ga,\ gba,\ gb)\}}.Vy,(a,b)​=∣G∣​1​g∈G∑​1{y=(g, ga, gba, gb)}​.

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 d,ld,ld,l, this defines a function r:{0,…,d−1}→Nr:\{0,\ldots,d-1\}\to\mathbb Nr:{0,…,d−1}→N by

ri={l,i=0,0,i≠0.r_i= \begin{cases} l,&i=0,\\ 0,&i\ne0. \end{cases}ri​={l,0,​i=0,i=0.​

Thus d=0d=0d=0 gives the unique function on the empty index set, and l=0l=0l=0 gives the zero function.

QAlgorithms.Papers.Independent.Extend50.P22.tensorCartan

For every pair of natural numbers d,nd,nd,n, this defines a diagonal complex matrix Cd,nC_{d,n}Cd,n​ indexed by words w:{0,…,n−1}→{0,…,d−1}w:\{0,\ldots,n-1\}\to\{0,\ldots,d-1\}w:{0,…,n−1}→{0,…,d−1}, with

(Cd,n)w,w=#{i:wi=0}−#{i:wi=d−1},(C_{d,n})_{w,w} =\#\{i:w_i=0\}-\#\{i:w_i=d-1\},(Cd,n​)w,w​=#{i:wi​=0}−#{i:wi​=d−1},

and all off-diagonal entries zero. The subtraction d−1d-1d−1 in the symbol being counted is natural-number subtraction, so it equals zero when d=0d=0d=0. If n=0n=0n=0, the sole word is empty and its diagonal entry is zero; if d=0<nd=0<nd=0<n, there are no indexing words; and if d=1d=1d=1, the two counts coincide, so the matrix is zero.

QAlgorithms.Papers.Independent.Extend50.P22.theta2Zero

For every real number qqq, this defines

Θ2(q)=∑k∈Zexp⁡ ⁣((k+12)2log⁡q).\Theta_2(q)=\sum_{k\in\mathbb Z} \exp\!\left(\left(k+\tfrac12\right)^2\log q\right).Θ2​(q)=k∈Z∑​exp((k+21​)2logq).

There is no restriction on qqq. The real logarithm is total, with log⁡0=0\log0=0log0=0, and the infinite sum has value 000 for a nonsummable family; in particular, this definition gives Θ2(0)=Θ2(1)=0\Theta_2(0)=\Theta_2(1)=0Θ2​(0)=Θ2​(1)=0.

QAlgorithms.Papers.Independent.Extend50.P22.theta3Imaginary

For every pair of real numbers b,qb,qb,q, this defines

Θ3(b,q)=∑k∈Zexp⁡ ⁣(k2log⁡q−2kb).\Theta_3(b,q)=\sum_{k\in\mathbb Z} \exp\!\left(k^2\log q-2kb\right).Θ3​(b,q)=k∈Z∑​exp(k2logq−2kb).

No positivity or convergence assumption is imposed on qqq or bbb. Here the real logarithm is the total real logarithm, with log⁡0=0\log0=0log0=0, and the real infinite sum is assigned value 000 when its family is not summable; for example, Θ3(0,1)=0\Theta_3(0,1)=0Θ3​(0,1)=0.

QAlgorithms.Papers.Independent.Extend50.P22.twoLocalEncoding

This defines a complex matrix VVV with rows indexed by four-bit strings y∈{0,1}4y\in\{0,1\}^4y∈{0,1}4 and columns indexed by pairs of bits x=(x1,x2)x=(x_1,x_2)x=(x1​,x2​). For each column, put w=(0,x2,x1,x1⊕x2)w=(0,x_2,x_1,x_1\mathbin{\oplus}x_2)w=(0,x2​,x1​,x1​⊕x2​), where ⊕\oplus⊕ is Boolean exclusive-or. Then

Vy,x={1/2,y=w or y=w‾,0,otherwise,V_{y,x}= \begin{cases} 1/\sqrt2,&y=w\text{ or }y=\overline w,\\ 0,&\text{otherwise}, \end{cases}Vy,x​={1/2​,0,​y=w or y=w,otherwise,​

where w‾\overline ww flips all four bits. The condition is a disjunction assigning the single value 1/21/\sqrt21/2​; its two alternatives are distinct because their first bits differ.

QAlgorithms.Papers.Independent.Extend50.P22.twoLocalQ

This defines a complex matrix QQQ whose rows and columns are indexed by four-bit strings. For row zzz and column yyy,

Qz,y={1,z=(¬y0,¬y1,y2,y3),0,otherwise.Q_{z,y}= \begin{cases} 1,&z=(\neg y_0,\neg y_1,y_2,y_3),\\ 0,&\text{otherwise}. \end{cases}Qz,y​={1,0,​z=(¬y0​,¬y1​,y2​,y3​),otherwise.​

Thus its action on a computational basis vector flips the first two bits.

QAlgorithms.Papers.Independent.Extend50.P22.uniformErase

For finite types J,AJ,AJ,A, a finite subset S⊆JS\subseteq JS⊆J, and a function reset:J→A\mathrm{reset}:J\to Areset:J→A, this defines a function ES,reset\mathcal E_{S,\mathrm{reset}}ES,reset​ from complex matrices indexed by J→AJ\to AJ→A to matrices with the same indices. For a:S→Aa:S\to Aa:S→A, let y[S←a]y[S\leftarrow a]y[S←a] equal a(i)a(i)a(i) on SSS and y(i)y(i)y(i) outside SSS. Then

ES,reset(X)y,z={∑a:S→AXy[S←a], z[S←a]∀i∈S, y(i)=z(i)=reset(i),0otherwise.\mathcal E_{S,\mathrm{reset}}(X)_{y,z}= \begin{cases} \displaystyle\sum_{a:S\to A}X_{y[S\leftarrow a],\,z[S\leftarrow a]} &\forall i\in S,\ y(i)=z(i)=\mathrm{reset}(i),\\ 0&\text{otherwise}. \end{cases}ES,reset​(X)y,z​=⎩⎨⎧​a:S→A∑​Xy[S←a],z[S←a]​0​∀i∈S, y(i)=z(i)=reset(i),otherwise.​

This applies to every matrix XXX, with no positivity or normalization assumption. Empty types and S=∅S=\varnothingS=∅ are included; when S=∅S=\varnothingS=∅, the resulting function is the identity.

QAlgorithms.Papers.Independent.Extend50.P22.upSpins

For every natural number NNN and integer mmm, this defines

uN(m)=max⁡ ⁣(⌊N+m2⌋,0),u_N(m)=\max\!\left(\left\lfloor\frac{N+m}{2}\right\rfloor,0\right),uN​(m)=max(⌊2N+m​⌋,0),

as a natural number: first N+mN+mN+m is divided by 222 using integer division, then negative results are converted to 000. There is no parity condition on N+mN+mN+m and no bound on mmm; in particular, the result need not be at most NNN.

QAlgorithms.Papers.Independent.Extend50.P22.wEncoding

For arbitrary natural numbers d,nd,nd,n, this defines a complex matrix VVV whose rows are words y:{0,…,n−1}→{0,…,d}y:\{0,\ldots,n-1\}\to\{0,\ldots,d\}y:{0,…,n−1}→{0,…,d} and whose columns are x∈{0,…,d−1}x\in\{0,\ldots,d-1\}x∈{0,…,d−1}, by

Vy,x=1n∑i=0n−1∏j=0n−1{1{yj=x},j=i,1{yj=d},j≠i.V_{y,x}=\frac{1}{\sqrt n}\sum_{i=0}^{n-1} \prod_{j=0}^{n-1} \begin{cases} \mathbf 1_{\{y_j=x\}},&j=i,\\ \mathbf 1_{\{y_j=d\}},&j\ne i. \end{cases}Vy,x​=n​1​i=0∑n−1​j=0∏n−1​{1{yj​=x}​,1{yj​=d}​,​j=i,j=i.​

Thus, for n>0n>0n>0, an entry is 1/n1/\sqrt n1/n​ exactly when yyy has the value xxx at one coordinate and the value ddd at every other coordinate, and is zero otherwise. No positivity assumptions are part of this definition: when n=0n=0n=0, the sum is empty and every existing entry is zero, with the inverse of 0\sqrt00​ defined as zero; when d=0d=0d=0, there are no columns.

QAlgorithms.Papers.Independent.Extend50.P22.worstFidelity

For every natural number ddd, every finite type BBB with decidable equality, and every function CCC from complex d×dd\times dd×d matrices to complex matrices indexed by BBB, this defines

sup⁡R inf⁡∥ψ∥=1Re⁡Tr⁡S ⁣(S(Dψ) (id⊗(R∘C))(Dψ) S(Dψ)),ψ∈C{0,…,d−1}2.\sup_R\ \inf_{\|\psi\|=1} \operatorname{Re}\operatorname{Tr} \mathcal S\!\left(\mathcal S(D_\psi)\,(\mathrm{id}\otimes(R\circ C))(D_\psi)\,\mathcal S(D_\psi)\right), \qquad \psi\in\mathbb C^{\{0,\ldots,d-1\}^2}.Rsup​ ∥ψ∥=1inf​ReTrS(S(Dψ​)(id⊗(R∘C))(Dψ​)S(Dψ​)),ψ∈C{0,…,d−1}2.

Here Dψ=ψψ†D_\psi=\psi\psi^\daggerDψ​=ψψ†, and RRR ranges over functions of the form R(Y)=∑j=0r−1EjYEj†R(Y)=\sum_{j=0}^{r-1}E_jYE_j^\daggerR(Y)=∑j=0r−1​Ej​YEj†​ for some natural number rrr, with EjE_jEj​ complex d×Bd\times Bd×B matrices satisfying ∑jEj†Ej=IB\sum_jE_j^\dagger E_j=I_B∑j​Ej†​Ej​=IB​. The operation id⊗F\mathrm{id}\otimes Fid⊗F applies FFF to each matrix block with fixed first-register row and column, and S\mathcal SS 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 RRR is chosen before taking the infimum over all unit vectors ψ\psiψ. No condition is imposed on CCC. Both extrema are taken in R\mathbb RR, where the empty-set infimum or supremum is 000, as are the corresponding unbounded extrema. When d=0d=0d=0 there are no unit vectors, and the resulting value is 000; the outer set can also be empty, for example if BBB is empty and d>0d>0d>0.

Human review
  • Endorsed by Shuze Chen · Oct 29, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 29, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me