Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Definitions for Testing symmetry on quantum computers

Definition
QAlgorithms_Papers_Independent_Extend50_P47

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

prove2quantum

The objects the formalized statements of Testing symmetry on quantum computers (arXiv:2105.12758) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • IsProjectiveUnitaryLift: pp.3–4: unitary projective lift; scalar multipliers have modulus one.
  • symmetryControlAverage: pp.3–4, (1),(19): raw average, used as a projector only with an ordinary law.
  • Bose: p.7, (40): normalized Bose states, with support in P.
  • Sym: p.8, (46): normalized states invariant under conjugation.
  • Extension: pp.3–4: normalized extension, tracing out exactly R.
  • BSE: p.4, Definition 2.2.
  • SE: p.3, Definition 2.1.
  • conjugateTensorAction: p.5, (22): phases cancel in U tensor conjugate U.
  • controlReturnProbability: pp.6–7: control preparation, controlled U, and return-to-control amplitude K have acceptance Tr(K† K rho). This definition also applies to weighted controls.
  • firstChannel: pp.8–12: N acts on the purifying register only, preserving all S blocks.
  • proverValues: pp.8–12: all allowed prover operations; private environments are discarded.
  • symmetryFidelityValues: p.7: attained comparison values, with normalized comparison states in Q.
  • TestIdentity: pp.9–12: equality of attained operational and squared-fidelity maxima.
  • symTest: p.9: returned S-hat first, retained S second.
  • seTest: p.11: returned R,R-hat,S-hat first; retained S second.
  • hsChannelAdjoint: pp.33–36: Hilbert–Schmidt adjoint in the computational matrix-unit basis.
  • BoseChannel: p.33, Definition 7.1: CPTP and N†(Qout) ≥ Qin in Löwner order.
  • IsOperatorCovariant: p.15, (110): covariance as equality on every operator.
  • ChannelExtension: p.35, (233): a channel extension includes the marginal identity on all operators.
  • SEChannel: pp.34–35, Definition 7.2, with the fixed reference representations retained.
  • BSEChannel: p.36, Definition 7.3, with the adjoint inequality, rather than covariance.
  • densityPreparation: p.33: the preparation channel from a fully trivial input.
  • replaceReference: p.35: replace R with its normalized identity and retain S, also on entangled inputs.
  • StandardStep: p.5: placed gates from H,CNOT,T and the replacement T†.
  • conjugateStep: p.5: replace T by T†; real H,CNOT are unchanged.
  • standardStepOperator: p.5: actual matrices of the placed gates.
  • standardCircuit: p.5: head is applied first, hence reverse product.
  • incoherentClock: pp.9–10, (55): cyclic phase-shift family in the incoherent basis.
  • symmetryTensorCopies: p.13: independent copies of a density in their computational basis.
  • permutation: p.13: the frozen tensor-permutation matrix, transported from a finite basis labeling. Its convention sends |x> to |x composed with pi inverse>.
  • tensorSymmetrizer: p.13, (15): symmetric-subspace projection.
  • pureBipFamily: p.13, (79)–(80): permute only the B shares of k copies of AB.
  • bipartiteAcceptance: p.13: actual control-return acceptance on k pure AB copies.
  • kFamily: pp.4,14: full extension basis is (remaining B copies, retained AB).
  • separableExtension: p.14, (94): the extension computed from the pure-product mixture.
  • multiPureFamily: p.14, (89): independent permutations of each party's k copies.
  • multiCopies: p.14: regroup k copies so each party's copies are adjacent.
  • multiProjector: p.14: tensor product of the local symmetric projections.
  • multiFamily: p.15, (97)–(107): remaining copies first, first copy of every party retained.
  • choiFamily: p.16, (121): conjugate input representation tensor output representation.
  • outcomeMatrix: p.16: the supplied outcome-label permutation representation.
  • povmOutcomeChannel: p.16, (124): the quantum-to-classical measurement channel.
  • qcBlockMatrix: p.17: quantum-classical blocks are subnormalized; only their sum has trace one.
  • rootValues: p.18: root-fidelity values, distinct from the squared operational values.
  • stateSDP: p.18, (142)–(143): every SDP block and constraint, including the orientation of X†.
  • extensionSDP: p.18, (144)–(145): X,rho act on S, omega on RS, with Tr_R omega in the block.
  • IsIrreducibleUnitaryLift: pp.18–19: irreducibility means no nontrivial invariant subspace, expressed by its orthogonal projector. No scalar-commutant conclusion is assumed.
  • InequivalentFamilies: pp.18–19: inequivalent irreducible unitary families have no unitary intertwiner.
  • IsotypicData: pp.18–19, (146)–(148): isotypic data defined through unitary intertwining and inequivalent irreducibility, rather than the desired state parameterization. The block families inherit the actual project's multiplier through intertwining.
  • isotypicDensity: p.18, (154): the state computed from multiplicity blocks.
  • schurBlocks: p.18, (153): trace out the irrep factor, retaining the multiplicity factor.
  • TrivialBlock: p.19, (155)–(157): a multiplicity block is Bose-allowed only for the trivial irrep.
  • booleanSinglet: p.23: normalized two-qubit singlet in the computational basis.
  • collectiveSU2Average: p.23, (160): normalized Haar average of the collective SU(2) action.
  • pauliAxisRotation: p.23, (165): rotation about the Pauli axis a by theta.
  • bilateral: p.23, (163): bilateral rotation at the paper's sign convention.
  • twelveRotations: p.23, (166): literal list of twelve products, retaining their matrix phases.
  • bitHammingWeight: pp.26–28: the number of one bits.
  • weightProjector: pp.26–28: projector onto the entire weight-k sector.
  • collectiveZRotation: p.26, (175)–(178): collective phase; subtraction takes place in the reals.
  • collectiveZAverage: p.26, (174): normalized integral over the complete 4pi period.
  • finitePhase: p.26, (183): the literal finite unitary family; no odd-n group law is asserted.
  • collectiveZTwirl: p.27, (197): continuous collective dephasing.
  • KChannel: p.35, (244)–(245): k-extendible channels through their actual copy permutations.
  • KBoseChannel: p.36, (255)–(258): k-Bose channels use symmetric support, not covariance.
Definition code
import Mathlib
import Definitions.Def_QAlgorithms_Defs_QuantumInformation
import Definitions.Def_QAlgorithms_Defs_Channel
import Definitions.Def_QAlgorithms_Defs_Measurement
import Definitions.Def_QAlgorithms_Defs_TensorPermutationRepresentations
import Definitions.Def_QAlgorithms_Defs_Circuit
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P56
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P60

/-!
Statements from LaBorde–Rethinasamy–Wilde, arXiv:2105.12758v3.
Paper-specific objects are local; identical Mat, copies, and normalizedChoi
objects are imported from the pinned accepted library. All page references are PDF pages.
The operational model uses all CPTP maps on the purifying register, equivalently
all prover isometries with a discarded private environment. No operation acts on
retained S. Maxima are expressed by IsGreatest, which includes attainment.
Raw Bose averages require an ordinary representation; conjugation results permit
projective lifts. Fidelity always means rootFidelity squared unless explicitly root.
-/

noncomputable section

namespace QAlgorithms.Papers.Independent.Extend50.P47

open scoped ComplexConjugate ComplexOrder Matrix Matrix.Norms.L2Operator Manifold ContDiff
open MeasureTheory

open QAlgorithms.Papers.Independent.Information100.P60 (Mat)
open QAlgorithms.Papers.Independent.Information100.P56 (normalizedChoi)

variable {G S R P T A B C D R2 S2 : Type*}
variable [Fintype G] [Group G] [DecidableEq G]
variable [Fintype S] [DecidableEq S] [Nonempty S]
variable [Fintype R] [DecidableEq R] [Nonempty R]
variable [Fintype P] [DecidableEq P] [Nonempty P]
variable [Fintype T] [DecidableEq T] [Nonempty T]
variable [Fintype A] [DecidableEq A] [Nonempty A]
variable [Fintype B] [DecidableEq B] [Nonempty B]
variable [Fintype C] [DecidableEq C] [Nonempty C]
variable [Fintype D] [DecidableEq D] [Nonempty D]
variable [Fintype R2] [DecidableEq R2] [Nonempty R2]
variable [Fintype S2] [DecidableEq S2] [Nonempty S2]

/-- pp.3–4: unitary projective lift; scalar multipliers have modulus one. -/
def IsProjectiveUnitaryLift (U : G → Matrix.unitaryGroup S ℂ) : Prop :=
  ∀ g h, ∃ z : ℂ, ‖z‖ = 1 ∧
    (U (g * h) : Mat S) = z • ((U g : Mat S) * (U h : Mat S))

/-- pp.3–4, (1),(19): raw average, used as a projector only with an ordinary law. -/
def symmetryControlAverage (U : G → Mat S) : Mat S :=
  (Fintype.card G : ℂ)⁻¹ • ∑ g, U g

/-- p.7, (40): normalized Bose states, with support in P. -/
def Bose (Q : Mat S) (rho : Mat S) : Prop :=
  IsDensityMatrix rho ∧ rho = Q * rho * Q

/-- p.8, (46): normalized states invariant under conjugation. -/
def Sym (U : G → Mat S) (rho : Mat S) : Prop :=
  IsDensityMatrix rho ∧ ∀ g, rho = U g * rho * (U g)ᴴ

/-- pp.3–4: normalized extension, tracing out exactly R. -/
def Extension (Q : Mat (R × S) → Prop) (rho : Mat S) : Prop :=
  IsDensityMatrix rho ∧ ∃ omega, Q omega ∧ traceLeft omega = rho

/-- p.4, Definition 2.2. -/
def BSE (U : G → Mat (R × S)) (rho : Mat S) : Prop :=
  Extension (Bose (symmetryControlAverage U)) rho

/-- p.3, Definition 2.1. -/
def SE (U : G → Mat (R × S)) (rho : Mat S) : Prop :=
  Extension (Sym U) rho

/-- p.5, (22): phases cancel in U tensor conjugate U. -/
def conjugateTensorAction (U : G → Mat S) (g : G) : Mat (S × S) :=
  Matrix.kronecker (U g) ((U g).map conj)

/-- pp.6–7: control preparation, controlled U, and return-to-control amplitude K
have acceptance Tr(K† K rho). This definition also applies to weighted controls. -/
def controlReturnProbability (K rho : Mat S) : ℝ := effectProb (Kᴴ * K) rho

/-- pp.8–12: N acts on the purifying register only, preserving all S blocks. -/
def firstChannel (N : Superop P T) : Superop (P × S) (T × S) :=
  fun X => Matrix.of fun a b =>
    N (Matrix.of fun p q => X (p, a.2) (q, b.2)) a.1 b.1

/-- pp.8–12: all allowed prover operations; private environments are discarded. -/
def proverValues (psi : EuclideanSpace ℂ (P × S)) (K : Mat (T × S)) : Set ℝ :=
  {v | ∃ N : Superop P T, IsChannel N ∧
    v = controlReturnProbability K (firstChannel N (pureDensity psi))}

/-- p.7: attained comparison values, with normalized comparison states in Q. -/
def symmetryFidelityValues (rho : Mat S) (Q : Mat S → Prop) : Set ℝ :=
  {v | ∃ sigma, Q sigma ∧ v = rootFidelity rho sigma ^ 2}

/-- pp.9–12: equality of attained operational and squared-fidelity maxima. -/
def TestIdentity (psi : EuclideanSpace ℂ (P × S)) (K : Mat (T × S))
    (rho : Mat S) (Q : Mat S → Prop) : Prop :=
  ∃ v, IsGreatest (proverValues psi K) v ∧ IsGreatest (symmetryFidelityValues rho Q) v

/-- p.9: returned S-hat first, retained S second. -/
def symTest (U : G → Mat S) : Mat (S × S) :=
  symmetryControlAverage fun g => (conjugateTensorAction U g).submatrix Prod.swap Prod.swap

/-- p.11: returned R,R-hat,S-hat first; retained S second. -/
def seTest (U : G → Mat (R × S)) : Mat ((R × (R × S)) × S) :=
  (symmetryControlAverage (conjugateTensorAction U)).submatrix
    (fun p => ((p.1.1, p.2), p.1.2)) (fun p => ((p.1.1, p.2), p.1.2))

/-- pp.33–36: Hilbert–Schmidt adjoint in the computational matrix-unit basis. -/
def hsChannelAdjoint (N : Superop A B) (Y : Mat B) : Mat A :=
  Matrix.of fun i j => ∑ a, ∑ b, conj (N (Matrix.single i j 1) a b) * Y a b

/-- p.33, Definition 7.1: CPTP and N†(Qout) ≥ Qin in Löwner order. -/
def BoseChannel (Qin : Mat A) (Qout : Mat B) (N : Superop A B) : Prop :=
  IsChannel N ∧ (hsChannelAdjoint N Qout - Qin).PosSemidef

/-- p.15, (110): covariance as equality on every operator. -/
def IsOperatorCovariant (U : G → Mat A) (V : G → Mat B) (N : Superop A B) : Prop :=
  ∀ g X, N (U g * X * (U g)ᴴ) = V g * N X * (V g)ᴴ

/-- p.35, (233): a channel extension includes the marginal identity on all operators. -/
def ChannelExtension (N : Superop S S2) (M : Superop (R × S) (R2 × S2)) : Prop :=
  IsChannel M ∧ ∀ X, traceLeft (M X) = N (traceLeft X)

/-- pp.34–35, Definition 7.2, with the fixed reference representations retained. -/
def SEChannel (U : G → Mat (R × S)) (V : G → Mat (R2 × S2))
    (N : Superop S S2) : Prop :=
  IsChannel N ∧ ∃ M, ChannelExtension N M ∧ IsOperatorCovariant U V M

/-- p.36, Definition 7.3, with the adjoint inequality, rather than covariance. -/
def BSEChannel (U : G → Mat (R × S)) (V : G → Mat (R2 × S2))
    (N : Superop S S2) : Prop :=
  IsChannel N ∧ ∃ M, ChannelExtension N M ∧
    (hsChannelAdjoint M (symmetryControlAverage V) - symmetryControlAverage U).PosSemidef

/-- p.33: the preparation channel from a fully trivial input. -/
def densityPreparation (rho : Mat S) : Superop Unit S := fun X => X.trace • rho

/-- p.35: replace R with its normalized identity and retain S, also on entangled inputs. -/
def replaceReference (X : Mat (R × S)) : Mat (R × S) :=
  Matrix.kronecker ((Fintype.card R : ℂ)⁻¹ • (1 : Mat R)) (traceLeft X)

example (Q rho : Mat S) : Bose Q rho ↔
    IsDensityMatrix rho ∧ rho = Q * rho * Q := Iff.rfl

example (rho : Mat S) (X : Mat Unit) : densityPreparation rho X = X.trace • rho := rfl

example (N : Superop P T) (X : Mat (P × S)) (a b : T × S) :
    firstChannel N X a b = N (fun p q => X (p, a.2) (q, b.2)) a.1 b.1 := rfl

/-- p.5: placed gates from H,CNOT,T and the replacement T†. -/
inductive StandardStep (n : ℕ) where
  | h (q : Fin n)
  | t (q : Fin n)
  | td (q : Fin n)
  | cx (w : Fin 2 ↪ Fin n)

/-- p.5: replace T by T†; real H,CNOT are unchanged. -/
def conjugateStep {n : ℕ} : StandardStep n → StandardStep n
  | .h q => .h q
  | .t q => .td q
  | .td q => .t q
  | .cx w => .cx w

/-- p.5: actual matrices of the placed gates. -/
def standardStepOperator {n : ℕ} : StandardStep n → Mat (Qubits n)
  | .h q => embedOp (Gate.ofMatrix1 hadamard).mat
      (show Fin 1 ↪ Fin n from
        ⟨fun _ => q, fun _ _ _ => Subsingleton.elim _ _⟩)
  | .t q => embedOp (Gate.ofMatrix1 gateT).mat
      (show Fin 1 ↪ Fin n from
        ⟨fun _ => q, fun _ _ _ => Subsingleton.elim _ _⟩)
  | .td q => embedOp (Gate.ofMatrix1 gateTᴴ).mat
      (show Fin 1 ↪ Fin n from
        ⟨fun _ => q, fun _ _ _ => Subsingleton.elim _ _⟩)
  | .cx w => embedOp (Gate.ofMatrix2 cnot).mat w

/-- p.5: head is applied first, hence reverse product. -/
def standardCircuit {n : ℕ} (c : List (StandardStep n)) : Mat (Qubits n) :=
  (c.map standardStepOperator).reverse.prod

example {n : ℕ} (q : Fin n) : conjugateStep (.t q) = .td q := rfl

example (n : ℕ) : standardCircuit ([] : List (StandardStep n)) = 1 := rfl

/-- pp.9–10, (55): cyclic phase-shift family in the incoherent basis. -/
def incoherentClock (d : ℕ) (z : Fin d) : Mat (Fin d) :=
  Matrix.diagonal fun j => Complex.exp (2 * Real.pi * Complex.I * j.val * z.val / d)

/-- p.13: independent copies of a density in their computational basis. -/
def symmetryTensorCopies (rho : Mat S) (k : ℕ) : Mat (Fin k → S) :=
  QAlgorithms.Papers.Independent.Information100.P60.copies k rho

/-- p.13: the frozen tensor-permutation matrix, transported from a finite basis
labeling. Its convention sends |x> to |x composed with pi inverse>. -/
def permutation (k : ℕ) (pi : Equiv.Perm (Fin k)) : Mat (Fin k → S) :=
  (Schur.tensorPermutation (Fintype.card S) k pi).submatrix
    (fun x i => Fintype.equivFin S (x i)) (fun x i => Fintype.equivFin S (x i))

/-- p.13, (15): symmetric-subspace projection. -/
def tensorSymmetrizer (S : Type*) [Fintype S] [DecidableEq S] (k : ℕ) :
    Mat (Fin k → S) := symmetryControlAverage (permutation (S := S) k)

/-- p.13, (79)–(80): permute only the B shares of k copies of AB. -/
def pureBipFamily (k : ℕ) (pi : Equiv.Perm (Fin k)) : Mat (Fin k → A × B) :=
  Matrix.of fun y x =>
    if (∀ i, (y i).1 = (x i).1) ∧ (∀ i, (y i).2 = (x (pi.symm i)).2) then 1 else 0

/-- p.13: actual control-return acceptance on k pure AB copies. -/
def bipartiteAcceptance (psi : EuclideanSpace ℂ (A × B)) (k : ℕ) : ℝ :=
  controlReturnProbability (symmetryControlAverage (pureBipFamily (A := A) (B := B) k)) (symmetryTensorCopies (pureDensity psi) k)

example (rho : Mat S) (x y : Fin 1 → S) : symmetryTensorCopies rho 1 x y = rho (x 0) (y 0) := by
  simp [symmetryTensorCopies, QAlgorithms.Papers.Independent.Information100.P60.copies]

/-- pp.4,14: full extension basis is (remaining B copies, retained AB). -/
def kFamily (n : ℕ) (pi : Equiv.Perm (Fin (n + 1))) :
    Mat ((Fin n → B) × (A × B)) :=
  Matrix.of fun y x =>
    if y.2.1 = x.2.1 ∧ Fin.cases y.2.2 y.1 = (Fin.cases x.2.2 x.1) ∘ pi.symm
      then 1 else 0

/-- p.14, (94): the extension computed from the pure-product mixture. -/
def separableExtension {X : Type*} [Fintype X] (p : X → ℝ)
    (a : X → EuclideanSpace ℂ A) (b : X → EuclideanSpace ℂ B) (n : ℕ) :
    Mat ((Fin n → B) × (A × B)) :=
  Matrix.of fun y z => ∑ x, (p x : ℂ) * pureDensity (a x) y.2.1 z.2.1 *
    ∏ i : Fin (n + 1), pureDensity (b x) (Fin.cases y.2.2 y.1 i) (Fin.cases z.2.2 z.1 i)

/-- p.14, (89): independent permutations of each party's k copies. -/
def multiPureFamily {m : ℕ} (d : Fin m → ℕ) (k : ℕ)
    (pi : Fin m → Equiv.Perm (Fin k)) : Mat ((i : Fin m) → Fin k → Fin (d i)) :=
  Matrix.of fun y x => if ∀ i, y i = x i ∘ (pi i).symm then 1 else 0

/-- p.14: regroup k copies so each party's copies are adjacent. -/
def multiCopies {m : ℕ} {d : Fin m → ℕ} (rho : Mat ((i : Fin m) → Fin (d i)))
    (k : ℕ) : Mat ((i : Fin m) → Fin k → Fin (d i)) :=
  Matrix.of fun x y => ∏ t, rho (fun i => x i t) (fun i => y i t)

/-- p.14: tensor product of the local symmetric projections. -/
def multiProjector {m : ℕ} (d : Fin m → ℕ) (k : ℕ) :
    Mat ((i : Fin m) → Fin k → Fin (d i)) :=
  Matrix.of fun x y => ∏ i, tensorSymmetrizer (Fin (d i)) k (x i) (y i)

/-- p.15, (97)–(107): remaining copies first, first copy of every party retained. -/
def multiFamily {m : ℕ} (d n : Fin m → ℕ)
    (pi : (i : Fin m) → Equiv.Perm (Fin (n i + 1))) :
    Mat (((i : Fin m) → Fin (n i) → Fin (d i)) × ((i : Fin m) → Fin (d i))) :=
  Matrix.of fun y x =>
    if ∀ i, Fin.cases (y.2 i) (y.1 i) = (Fin.cases (x.2 i) (x.1 i)) ∘ (pi i).symm
      then 1 else 0

/-- p.16, (121): conjugate input representation tensor output representation. -/
def choiFamily (U : G → Mat A) (V : G → Mat B) (g : G) : Mat (A × B) :=
  Matrix.kronecker ((U g).map conj) (V g)

/-- p.16: the supplied outcome-label permutation representation. -/
def outcomeMatrix {X : Type*} [DecidableEq X] (pi : Equiv.Perm X) : Mat X :=
  Matrix.of fun y x => if y = pi x then 1 else 0

/-- p.16, (124): the quantum-to-classical measurement channel. -/
def povmOutcomeChannel {X : Type*} [Fintype X] [DecidableEq X]
    (L : X → Mat S) : Superop S X :=
  fun rho => Matrix.diagonal fun x => (L x * rho).trace

/-- p.17: quantum-classical blocks are subnormalized; only their sum has trace one. -/
def qcBlockMatrix {X : Type*} [DecidableEq X] (b : X → Mat S) : Mat (S × X) :=
  Matrix.of fun x y => if x.2 = y.2 then b x.2 x.1 y.1 else 0

/-- p.18: root-fidelity values, distinct from the squared operational values. -/
def rootValues (rho : Mat S) (Q : Mat S → Prop) : Set ℝ :=
  {v | ∃ sigma, Q sigma ∧ v = rootFidelity rho sigma}

/-- p.18, (142)–(143): every SDP block and constraint, including the orientation of X†. -/
def stateSDP (rho : Mat S) (Q : Mat S → Prop) : Set ℝ :=
  {v | ∃ (X sigma : Mat S), sigma.PosSemidef ∧ sigma.trace = 1 ∧ Q sigma ∧
    (Matrix.fromBlocks rho Xᴴ X sigma).PosSemidef ∧ v = X.trace.re}

/-- p.18, (144)–(145): X,rho act on S, omega on RS, with Tr_R omega in the block. -/
def extensionSDP (rho : Mat S) (Q : Mat (R × S) → Prop) : Set ℝ :=
  {v | ∃ (X : Mat S) (omega : Mat (R × S)), omega.PosSemidef ∧ omega.trace = 1 ∧
    Q omega ∧ (Matrix.fromBlocks rho Xᴴ X (traceLeft omega)).PosSemidef ∧ v = X.trace.re}

example (rho : Mat S) (Q : Mat S → Prop) (v : ℝ) : v ∈ stateSDP rho Q ↔
    ∃ X sigma, sigma.PosSemidef ∧ sigma.trace = 1 ∧ Q sigma ∧
      (Matrix.fromBlocks rho Xᴴ X sigma).PosSemidef ∧ v = X.trace.re := Iff.rfl

/-- pp.18–19: irreducibility means no nontrivial invariant subspace, expressed
by its orthogonal projector. No scalar-commutant conclusion is assumed. -/
def IsIrreducibleUnitaryLift {d : ℕ} (U : G → Matrix.unitaryGroup (Fin d) ℂ) : Prop :=
  ∀ Q : Mat (Fin d), Qᴴ = Q → Q * Q = Q →
    (∀ g, Q * (U g : Mat (Fin d)) = (U g : Mat (Fin d)) * Q) → Q = 0 ∨ Q = 1

/-- pp.18–19: inequivalent irreducible unitary families have no unitary intertwiner. -/
def InequivalentFamilies {d e : ℕ}
    (U : G → Matrix.unitaryGroup (Fin d) ℂ) (V : G → Matrix.unitaryGroup (Fin e) ℂ) : Prop :=
  ¬ ∃ X : Matrix (Fin d) (Fin e) ℂ, Xᴴ * X = 1 ∧ X * Xᴴ = 1 ∧
    ∀ g, (U g : Mat (Fin d)) * X = X * (V g : Mat (Fin e))

/-- pp.18–19, (146)–(148): isotypic data defined through unitary intertwining
and inequivalent irreducibility, rather than the desired state parameterization.
The block families inherit the actual project's multiplier through intertwining. -/
structure IsotypicData (U : G → Mat S) where
  count : ℕ
  mult : Fin count → ℕ
  dim : Fin count → ℕ
  mult_pos : ∀ l, 0 < mult l
  dim_pos : ∀ l, 0 < dim l
  rep : (l : Fin count) → G → Matrix.unitaryGroup (Fin (dim l)) ℂ
  irreducible : ∀ l, IsIrreducibleUnitaryLift (rep l)
  inequivalent : ∀ l k, l ≠ k → InequivalentFamilies (rep l) (rep k)
  W : Matrix S (Σ l : Fin count, Fin (mult l) × Fin (dim l)) ℂ
  left_unitary : Wᴴ * W = 1
  right_unitary : W * Wᴴ = 1
  intertwines : ∀ g, U g = W *
    (Matrix.blockDiagonal' fun l => Matrix.kronecker (1 : Mat (Fin (mult l)))
      (rep l g : Mat (Fin (dim l)))) * Wᴴ

/-- p.18, (154): the state computed from multiplicity blocks. -/
def isotypicDensity {U : G → Mat S} (E : IsotypicData U)
    (b : (l : Fin E.count) → Mat (Fin (E.mult l))) : Mat S :=
  E.W * (Matrix.blockDiagonal' fun l => Matrix.kronecker (b l)
    ((E.dim l : ℂ)⁻¹ • (1 : Mat (Fin (E.dim l))))) * E.Wᴴ

/-- p.18, (153): trace out the irrep factor, retaining the multiplicity factor. -/
def schurBlocks {U : G → Mat S} (E : IsotypicData U) (rho : Mat S)
    (l : Fin E.count) : Mat (Fin (E.mult l)) :=
  traceRight ((E.Wᴴ * rho * E.W).submatrix (fun x => ⟨l, x⟩) (fun x => ⟨l, x⟩))

/-- p.19, (155)–(157): a multiplicity block is Bose-allowed only for the trivial irrep. -/
def TrivialBlock {U : G → Mat S} (E : IsotypicData U) (l : Fin E.count) : Prop :=
  ∀ g, (E.rep l g : Mat (Fin (E.dim l))) = 1

/-- p.23: normalized two-qubit singlet in the computational basis. -/
def booleanSinglet : EuclideanSpace ℂ (Bool × Bool) :=
  WithLp.toLp 2 fun p => if p = (false, true) then ((Real.sqrt 2)⁻¹ : ℂ)
    else if p = (true, false) then -((Real.sqrt 2)⁻¹ : ℂ) else 0

/-- PDF p.23, (160): SU(2) Haar integration uses the Borel sigma-algebra. -/
local instance su2MeasurableSpace : MeasurableSpace (Matrix.specialUnitaryGroup Bool ℂ) :=
  borel (Matrix.specialUnitaryGroup Bool ℂ)

/-- PDF p.23, (160): the chosen SU(2) sigma-algebra is Borel by construction. -/
local instance su2BorelSpace : BorelSpace (Matrix.specialUnitaryGroup Bool ℂ) :=
  ⟨rfl⟩

/-- PDF p.24, (171): U(2) Haar integration uses the Borel sigma-algebra. -/
local instance u2MeasurableSpace : MeasurableSpace (Matrix.unitaryGroup Bool ℂ) :=
  borel (Matrix.unitaryGroup Bool ℂ)

/-- PDF p.24, (171): the chosen U(2) sigma-algebra is Borel by construction. -/
local instance u2BorelSpace : BorelSpace (Matrix.unitaryGroup Bool ℂ) :=
  ⟨rfl⟩

example : su2MeasurableSpace = borel (Matrix.specialUnitaryGroup Bool ℂ) := rfl

example : u2MeasurableSpace = borel (Matrix.unitaryGroup Bool ℂ) := rfl

/-- p.23, (160): normalized Haar average of the collective SU(2) action. -/
def collectiveSU2Average (mu : Measure (Matrix.specialUnitaryGroup Bool ℂ)) : Mat (Bool × Bool) :=
  ∫ U, Matrix.kronecker (U : Mat Bool) (U : Mat Bool) ∂mu

/-- p.23, (165): rotation about the Pauli axis a by theta. -/
def pauliAxisRotation (a : Mat Bool) (theta : ℝ) : Mat Bool :=
  (Real.cos (theta / 2) : ℂ) • 1 - (Complex.I * Real.sin (theta / 2)) • a

/-- p.23, (163): bilateral rotation at the paper's sign convention. -/
def bilateral (a : Mat Bool) : Mat (Bool × Bool) :=
  Matrix.kronecker (pauliAxisRotation a (-Real.pi / 2)) (pauliAxisRotation a (-Real.pi / 2))

/-- p.23, (166): literal list of twelve products, retaining their matrix phases. -/
def twelveRotations : List (Mat (Bool × Bool)) :=
  let x := bilateral pauliX
  let y := bilateral pauliY
  let z := bilateral pauliZ
  [1, x*x, y*y, z*z, x*y, y*z, z*x, y*x,
    x*y*x*y, y*z*y*z, z*x*z*x, y*x*y*x]

example : twelveRotations.length = 12 := rfl

/-- pp.26–28: the number of one bits. -/
def bitHammingWeight {n : ℕ} (x : Qubits n) : ℕ := (Finset.univ.filter fun i => x i = true).card

/-- pp.26–28: projector onto the entire weight-k sector. -/
def weightProjector (n k : ℕ) : Mat (Qubits n) :=
  Matrix.diagonal fun x => if bitHammingWeight x = k then 1 else 0

/-- p.26, (175)–(178): collective phase; subtraction takes place in the reals. -/
def collectiveZRotation (n : ℕ) (phi : ℝ) : Mat (Qubits n) :=
  Matrix.diagonal fun x => Complex.exp
    (Complex.I * (((2 * (bitHammingWeight x : ℝ) - (n : ℝ)) * phi / 2 : ℝ) : ℂ))

/-- p.26, (174): normalized integral over the complete 4pi period. -/
def collectiveZAverage (n : ℕ) : Mat (Qubits n) :=
  (4 * Real.pi : ℂ)⁻¹ • ∫ phi in (0 : ℝ)..(4 * Real.pi), collectiveZRotation n phi

/-- p.26, (183): the literal finite unitary family; no odd-n group law is asserted. -/
def finitePhase (n : ℕ) (y : Fin (n + 1)) : Mat (Qubits n) :=
  Matrix.diagonal fun x => Complex.exp (Complex.I *
    ((Real.pi * (2 * (y.val : ℝ) - (n : ℝ)) *
      (2 * (bitHammingWeight x : ℝ) - (n : ℝ)) / ((n : ℝ) + 1) : ℝ) : ℂ))

/-- p.27, (197): continuous collective dephasing. -/
def collectiveZTwirl (n : ℕ) (rho : Mat (Qubits n)) : Mat (Qubits n) :=
  (4 * Real.pi : ℂ)⁻¹ • ∫ phi in (0 : ℝ)..(4 * Real.pi),
    collectiveZRotation n phi * rho * (collectiveZRotation n phi)ᴴ

example : bitHammingWeight (fun _ : Fin 0 => false) = 0 := rfl

example (n k : ℕ) (x : Qubits n) : weightProjector n k x x =
    (if bitHammingWeight x = k then 1 else 0) := by simp [weightProjector]

/-- p.35, (244)–(245): k-extendible channels through their actual copy permutations. -/
def KChannel (n : ℕ) (N : Superop (A × B) (C × D)) : Prop :=
  IsChannel N ∧ ∃ M : Superop ((Fin n → B) × (A × B)) ((Fin n → D) × (C × D)),
    IsChannel M ∧ (∀ X, traceLeft (M X) = N (traceLeft X)) ∧
    ∀ pi X, M (kFamily (A := A) (B := B) n pi * X * (kFamily (A := A) (B := B) n pi)ᴴ) =
      kFamily (A := C) (B := D) n pi * M X * (kFamily (A := C) (B := D) n pi)ᴴ

/-- p.36, (255)–(258): k-Bose channels use symmetric support, not covariance. -/
def KBoseChannel (n : ℕ) (N : Superop (A × B) (C × D)) : Prop :=
  IsChannel N ∧ ∃ M : Superop ((Fin n → B) × (A × B)) ((Fin n → D) × (C × D)),
    IsChannel M ∧ (∀ X, traceLeft (M X) = N (traceLeft X)) ∧
    (hsChannelAdjoint M (symmetryControlAverage (kFamily (A := C) (B := D) n)) -
      symmetryControlAverage (kFamily (A := A) (B := B) n)).PosSemidef

/-- Small definition checks, separate from the admitted source statements. -/

example : symmetryControlAverage (fun _ : Unit => (1 : Mat Bool)) = 1 := by simp [symmetryControlAverage]

example (rho : Mat S) : controlReturnProbability (1 : Mat S) rho = rho.trace.re := by
  simp [controlReturnProbability, effectProb]

example (X : Mat (P × S)) : firstChannel (fun Y : Mat P => Y) X = X := by
  ext a b
  rfl

example (Y : Mat Bool) : hsChannelAdjoint (fun X : Mat Bool => X) Y false true = Y false true := by
  simp [hsChannelAdjoint, Matrix.single_apply]

example : normalizedChoi (fun X : Mat Unit => X) ((), ()) ((), ()) = 1 := by
  simp [QAlgorithms.Papers.Independent.Information100.P56.normalizedChoi]

example {X : Type*} [Fintype X] [DecidableEq X] (L : X → Mat S) (rho : Mat S) (x : X) :
    povmOutcomeChannel L rho x x = (L x * rho).trace := by
  simp [povmOutcomeChannel]

example (b : Bool → Mat S) (i j : S) : qcBlockMatrix b (i, false) (j, true) = 0 := rfl

example (rho : Mat S) (x y : Fin 0 → S) : symmetryTensorCopies rho 0 x y = 1 := by simp [symmetryTensorCopies, QAlgorithms.Papers.Independent.Information100.P60.copies]

example : booleanSinglet (false, false) = 0 := by simp [booleanSinglet]

example (a : Mat Bool) : pauliAxisRotation a 0 = 1 := by simp [pauliAxisRotation]

example (phi : ℝ) : collectiveZRotation 0 phi = 1 := by
  ext x y
  have h : x = y := Subsingleton.elim _ _
  subst y
  simp [collectiveZRotation, bitHammingWeight]

example : finitePhase 0 0 = 1 := by
  ext x y
  have h : x = y := Subsingleton.elim _ _
  subst y
  simp [finitePhase, bitHammingWeight]

end QAlgorithms.Papers.Independent.Extend50.P47
Source
Testing symmetry on quantum computers, arXiv:2105.12758v3, https://arxiv.org/abs/2105.12758v3
Read-back

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

QAlgorithms.Papers.Independent.Extend50.P47.BSE

For finite index types G,R,SG,R,SG,R,S, a family of complex square matrices UgU_gUg​ indexed by R×SR\times SR×S, and a complex square matrix ρ\rhoρ indexed by SSS, put A=∣G∣−1∑g∈GUgA=|G|^{-1}\sum_{g\in G}U_gA=∣G∣−1∑g∈G​Ug​. This predicate means that ρ\rhoρ is positive semidefinite with trace 111, and there exists a positive semidefinite matrix ω\omegaω indexed by R×SR\times SR×S, also of trace 111, such that

ω=AωA,∑r∈Rω(r,s),(r,s′)=ρs,s′for all s,s′∈S.\omega=A\omega A,\qquad \sum_{r\in R}\omega_{(r,s),(r,s')}=\rho_{s,s'} \quad\text{for all }s,s'\in S.ω=AωA,r∈R∑​ω(r,s),(r,s′)​=ρs,s′​for all s,s′∈S.

No unitary or representation conditions are imposed on UUU. If any of G,R,SG,R,SG,R,S is empty, the predicate cannot hold; for empty GGG, the average AAA is zero.

QAlgorithms.Papers.Independent.Extend50.P47.BSEChannel

For finite index types G,R,S,R2,S2G,R,S,R_2,S_2G,R,S,R2​,S2​, with decidable equality on R,SR,SR,S, arbitrary matrix families UgU_gUg​ on R×SR\times SR×S and VgV_gVg​ on R2×S2R_2\times S_2R2​×S2​, and a function NNN from matrices on SSS to matrices on S2S_2S2​, this predicate requires that NNN admit a finite normalized Kraus representation and that there exist a function MMM from matrices on R×SR\times SR×S to matrices on R2×S2R_2\times S_2R2​×S2​ admitting such a representation, satisfying

Tr⁡R2M(X)=N(Tr⁡RX)for every X,M♯(V‾)−U‾⪰0.\operatorname{Tr}_{R_2}M(X)=N(\operatorname{Tr}_R X) \quad\text{for every }X, \qquad M^\sharp(\overline V)-\overline U\succeq0.TrR2​​M(X)=N(TrR​X)for every X,M♯(V)−U⪰0.

Here a finite normalized Kraus representation means F(X)=∑ℓKℓXKℓ†F(X)=\sum_\ell K_\ell XK_\ell^\daggerF(X)=∑ℓ​Kℓ​XKℓ†​ for every XXX, with ∑ℓKℓ†Kℓ=I\sum_\ell K_\ell^\dagger K_\ell=I∑ℓ​Kℓ†​Kℓ​=I; partial trace means summing entries with equal reference indices; U‾=∣G∣−1∑gUg\overline U=|G|^{-1}\sum_gU_gU=∣G∣−1∑g​Ug​ and V‾=∣G∣−1∑gVg\overline V=|G|^{-1}\sum_gV_gV=∣G∣−1∑g​Vg​; and

(M♯(Y))ij=∑a,b∈R2×S2M(Eij)ab‾ Yab.(M^\sharp(Y))_{ij} = \sum_{a,b\in R_2\times S_2}\overline{M(E_{ij})_{ab}}\,Y_{ab}.(M♯(Y))ij​=a,b∈R2​×S2​∑​M(Eij​)ab​​Yab​.

No unitarity, representation, or projector conditions are imposed on the families or their averages. If GGG is empty, both averages vanish and the positive-semidefinite condition is automatically satisfied.

QAlgorithms.Papers.Independent.Extend50.P47.Bose

For a finite index type SSS and arbitrary complex square matrices Q,ρQ,\rhoQ,ρ indexed by SSS, this predicate means that ρ\rhoρ is positive semidefinite, has trace 111, and satisfies

ρ=QρQ.\rho=Q\rho Q.ρ=QρQ.

The matrix QQQ is not required to be Hermitian or idempotent. If SSS is empty, the trace condition cannot hold.

QAlgorithms.Papers.Independent.Extend50.P47.BoseChannel

For finite index types A,BA,BA,B, with decidable equality on AAA, matrices Qin∈CA×AQ_{\mathrm{in}}\in\mathbb C^{A\times A}Qin​∈CA×A and Qout∈CB×BQ_{\mathrm{out}}\in\mathbb C^{B\times B}Qout​∈CB×B, and a function N:CA×A→CB×BN:\mathbb C^{A\times A}\to\mathbb C^{B\times B}N:CA×A→CB×B, this predicate requires both a finite Kraus representation

N(X)=∑ℓ=0m−1EℓXEℓ†,∑ℓ=0m−1Eℓ†Eℓ=IA,Eℓ∈CB×A,N(X)=\sum_{\ell=0}^{m-1}E_\ell XE_\ell^\dagger, \qquad \sum_{\ell=0}^{m-1}E_\ell^\dagger E_\ell=I_A, \qquad E_\ell\in\mathbb C^{B\times A},N(X)=ℓ=0∑m−1​Eℓ​XEℓ†​,ℓ=0∑m−1​Eℓ†​Eℓ​=IA​,Eℓ​∈CB×A,

for some natural number mmm, and positive semidefiniteness of the matrix whose (i,j)(i,j)(i,j) entry is

∑a,b∈BN(Eij)ab‾ (Qout)ab−(Qin)ij.\sum_{a,b\in B}\overline{N(E_{ij})_{ab}}\,(Q_{\mathrm{out}})_{ab} -(Q_{\mathrm{in}})_{ij}.a,b∈B∑​N(Eij​)ab​​(Qout​)ab​−(Qin​)ij​.

Here EijE_{ij}Eij​ is the matrix unit on AAA. Neither QinQ_{\mathrm{in}}Qin​ nor QoutQ_{\mathrm{out}}Qout​ is assumed to be a projector, positive semidefinite, or normalized; the Kraus sum may be empty when its normalization equation permits this.

QAlgorithms.Papers.Independent.Extend50.P47.ChannelExtension

Let R,S,R2,S2R,S,R_2,S_2R,S,R2​,S2​ be finite index types, with decidable equality on R,SR,SR,S, and let N:CS×S→CS2×S2N:\mathbb C^{S\times S}\to\mathbb C^{S_2\times S_2}N:CS×S→CS2​×S2​ and M:C(R×S)×(R×S)→C(R2×S2)×(R2×S2)M:\mathbb C^{(R\times S)\times(R\times S)}\to\mathbb C^{(R_2\times S_2)\times(R_2\times S_2)}M:C(R×S)×(R×S)→C(R2​×S2​)×(R2​×S2​) be functions. This predicate means that MMM admits a finite Kraus representation M(X)=∑ℓ=0m−1FℓXFℓ†M(X)=\sum_{\ell=0}^{m-1}F_\ell XF_\ell^\daggerM(X)=∑ℓ=0m−1​Fℓ​XFℓ†​, with ∑ℓFℓ†Fℓ=IR×S\sum_\ell F_\ell^\dagger F_\ell=I_{R\times S}∑ℓ​Fℓ†​Fℓ​=IR×S​, and that, for every complex matrix XXX on R×SR\times SR×S,

(∑r2∈R2(M(X))(r2,s2),(r2,t2))s2,t2=N ⁣((∑r∈RX(r,s),(r,t))s,t).\left(\sum_{r_2\in R_2}(M(X))_{(r_2,s_2),(r_2,t_2)}\right)_{s_2,t_2} = N\!\left( \left(\sum_{r\in R}X_{(r,s),(r,t)}\right)_{s,t} \right).(r2​∈R2​∑​(M(X))(r2​,s2​),(r2​,t2​)​)s2​,t2​​=N​(r∈R∑​X(r,s),(r,t)​)s,t​​.

The equality applies to all matrices XXX. There is no separate channel assumption on NNN; empty index types and an empty Kraus family are included wherever the displayed requirements hold.

QAlgorithms.Papers.Independent.Extend50.P47.Extension

For finite index types R,SR,SR,S, a predicate QQQ on complex square matrices indexed by R×SR\times SR×S, and a complex square matrix ρ\rhoρ indexed by SSS, this predicate means that ρ\rhoρ is positive semidefinite with trace 111, and there exists a complex square matrix ω\omegaω indexed by R×SR\times SR×S such that Q(ω)Q(\omega)Q(ω) holds and

∑r∈Rω(r,s),(r,s′)=ρs,s′for all s,s′∈S.\sum_{r\in R}\omega_{(r,s),(r,s')}=\rho_{s,s'} \qquad\text{for all }s,s'\in S.r∈R∑​ω(r,s),(r,s′)​=ρs,s′​for all s,s′∈S.

There is no separate density matrix requirement on ω\omegaω beyond whatever QQQ asserts. If RRR or SSS is empty, these conditions cannot hold.

QAlgorithms.Papers.Independent.Extend50.P47.InequivalentFamilies

For natural numbers d,ed,ed,e, an index type GGG, and families UgU_gUg​ and VgV_gVg​ of unitary matrices of sizes ddd and eee, respectively, this property means that there does not exist a complex d×ed\times ed×e matrix XXX such that

X†X=Ie,XX†=Id,UgX=XVgfor every g∈G.X^\dagger X=I_e,\qquad XX^\dagger=I_d,\qquad U_gX=XV_g\quad\text{for every }g\in G.X†X=Ie​,XX†=Id​,Ug​X=XVg​for every g∈G.

No multiplication law for either family is required by this definition. The dimensions may be zero; unequal dimensions automatically preclude such an XXX, while for d=e=0d=e=0d=e=0 the unique empty matrix satisfies all the displayed equations, so the property is false.

QAlgorithms.Papers.Independent.Extend50.P47.IsIrreducibleUnitaryLift

For a natural number ddd, an index type GGG, and a family UgU_gUg​ of unitary d×dd\times dd×d complex matrices, this property means that every d×dd\times dd×d complex matrix QQQ satisfying Q†=QQ^\dagger=QQ†=Q, Q2=QQ^2=QQ2=Q, and QUg=UgQQU_g=U_gQQUg​=Ug​Q for every g∈Gg\in Gg∈G must satisfy Q=0Q=0Q=0 or Q=IdQ=I_dQ=Id​. No multiplication law for the family UgU_gUg​ is included in this property. The case d=0d=0d=0 is allowed: the unique empty matrix is both zero and the identity, so the property holds in that case.

QAlgorithms.Papers.Independent.Extend50.P47.IsOperatorCovariant

For an index type GGG, finite index types A,BA,BA,B, arbitrary matrix families Ug∈CA×AU_g\in\mathbb C^{A\times A}Ug​∈CA×A and Vg∈CB×BV_g\in\mathbb C^{B\times B}Vg​∈CB×B, and any function N:CA×A→CB×BN:\mathbb C^{A\times A}\to\mathbb C^{B\times B}N:CA×A→CB×B, this predicate means

N(UgXUg†)=VgN(X)Vg†N(U_g XU_g^\dagger)=V_gN(X)V_g^\daggerN(Ug​XUg†​)=Vg​N(X)Vg†​

for every g∈Gg\in Gg∈G and every complex A×AA\times AA×A matrix XXX. No group structure on GGG, representation or unitarity condition on the families, or linearity or channel condition on NNN is required. If GGG is empty, the condition is vacuous.

QAlgorithms.Papers.Independent.Extend50.P47.IsProjectiveUnitaryLift

For a group GGG, a finite index type SSS with decidable equality, and a family of unitary complex matrices UgU_gUg​ indexed by g∈Gg\in Gg∈G, this predicate means that for every g,h∈Gg,h\in Gg,h∈G, there exists a complex number zzz, possibly depending on g,hg,hg,h, such that

∣z∣=1,Ugh=z UgUh.|z|=1,\qquad U_{gh}=z\,U_gU_h.∣z∣=1,Ugh​=zUg​Uh​.

QAlgorithms.Papers.Independent.Extend50.P47.IsotypicData

For an index type GGG, a finite index type SSS with the required decidable equality, and an arbitrary family UgU_gUg​ of complex matrices on SSS, an object of this structure consists of a natural number ccc; positive natural numbers mℓ,dℓm_\ell,d_\ellmℓ​,dℓ​ for each 0≤ℓ<c0\le\ell<c0≤ℓ<c; unitary matrices Rℓ,gR_{\ell,g}Rℓ,g​ of size dℓd_\elldℓ​ for every ℓ,g\ell,gℓ,g; and a complex matrix WWW whose rows are indexed by SSS and columns by triples (ℓ,a,b)(\ell,a,b)(ℓ,a,b) with a<mℓa<m_\ella<mℓ​ and b<dℓb<d_\ellb<dℓ​. These data must satisfy: every Hermitian idempotent matrix commuting with all Rℓ,gR_{\ell,g}Rℓ,g​ is either zero or the identity; for any distinct ℓ,k\ell,kℓ,k, there is no complex dℓ×dkd_\ell\times d_kdℓ​×dk​ matrix XXX satisfying X†X=IdkX^\dagger X=I_{d_k}X†X=Idk​​, XX†=IdℓXX^\dagger=I_{d_\ell}XX†=Idℓ​​, and Rℓ,gX=XRk,gR_{\ell,g}X=XR_{k,g}Rℓ,g​X=XRk,g​ for every ggg; and

W†W=I,WW†=IS,Ug=W(⨁ℓ=0c−1Imℓ⊗Rℓ,g)W†for every g∈G.W^\dagger W=I,\qquad WW^\dagger=I_S,\qquad U_g=W\left(\bigoplus_{\ell=0}^{c-1}I_{m_\ell}\otimes R_{\ell,g}\right)W^\dagger \quad\text{for every }g\in G.W†W=I,WW†=IS​,Ug​=W(ℓ=0⨁c−1​Imℓ​​⊗Rℓ,g​)W†for every g∈G.

No multiplication law in ggg is separately imposed on UUU or the families RℓR_\ellRℓ​. The value c=0c=0c=0 is allowed syntactically; then the equation WW†=ISWW^\dagger=I_SWW†=IS​ forces SSS to be empty.

QAlgorithms.Papers.Independent.Extend50.P47.KBoseChannel

Let A,B,C,DA,B,C,DA,B,C,D be finite index types with decidable equality, let n≥0n\geq0n≥0 be an integer, and let NNN be a function from complex matrices indexed by A×BA\times BA×B to those indexed by C×DC\times DC×D. Write Hin=B{0,…,n−1}×(A×B)H_{\mathrm{in}}=B^{\{0,\ldots,n-1\}}\times(A\times B)Hin​=B{0,…,n−1}×(A×B) and Hout=D{0,…,n−1}×(C×D)H_{\mathrm{out}}=D^{\{0,\ldots,n-1\}}\times(C\times D)Hout​=D{0,…,n−1}×(C×D). For each permutation π\piπ of {0,…,n}\{0,\ldots,n\}{0,…,n}, define a matrix Fin(π)F_{\mathrm{in}}(\pi)Fin​(π) on HinH_{\mathrm{in}}Hin​ as follows: for x=(b,(a,b0))x=(\mathbf b,(a,b_0))x=(b,(a,b0​)), form the list b^x=(b0,b1,…,bn)\widehat b_x=(b_0,b_1,\ldots,b_n)bx​=(b0​,b1​,…,bn​), where the last nnn entries are b\mathbf bb; then Fin(π)y,x=1F_{\mathrm{in}}(\pi)_{y,x}=1Fin​(π)y,x​=1 if yyy has the same AAA-coordinate as xxx and b^y(i)=b^x(π−1(i))\widehat b_y(i)=\widehat b_x(\pi^{-1}(i))by​(i)=bx​(π−1(i)) for every iii, and it is 000 otherwise. Define Fout(π)F_{\mathrm{out}}(\pi)Fout​(π) by replacing A,BA,BA,B with C,DC,DC,D, and set

Qin=1(n+1)!∑πFin(π),Qout=1(n+1)!∑πFout(π).Q_{\mathrm{in}}=\frac1{(n+1)!}\sum_\pi F_{\mathrm{in}}(\pi), \qquad Q_{\mathrm{out}}=\frac1{(n+1)!}\sum_\pi F_{\mathrm{out}}(\pi).Qin​=(n+1)!1​π∑​Fin​(π),Qout​=(n+1)!1​π∑​Fout​(π).

The predicate asserts that NNN is a channel and there exists a channel MMM from matrices on HinH_{\mathrm{in}}Hin​ to matrices on HoutH_{\mathrm{out}}Hout​ such that, for every complex matrix XXX on HinH_{\mathrm{in}}Hin​, Tr⁡Dn(M(X))=N(Tr⁡BnX)\operatorname{Tr}_{D^n}(M(X))=N(\operatorname{Tr}_{B^n}X)TrDn​(M(X))=N(TrBn​X), and H−QinH-Q_{\mathrm{in}}H−Qin​ is positive semidefinite, where

Hij=∑u,v∈HoutM(Eij)uv‾ (Qout)uv(i,j∈Hin)H_{ij}=\sum_{u,v\in H_{\mathrm{out}}} \overline{M(E_{ij})_{uv}}\,(Q_{\mathrm{out}})_{uv} \quad(i,j\in H_{\mathrm{in}})Hij​=u,v∈Hout​∑​M(Eij​)uv​​(Qout​)uv​(i,j∈Hin​)

and EijE_{ij}Eij​ is the matrix with its sole nonzero entry equal to 111 at (i,j)(i,j)(i,j). Here a channel Φ\PhiΦ means a function admitting finitely many rectangular complex matrices L1,…,LsL_1,\ldots,L_sL1​,…,Ls​, with s≥0s\geq0s≥0, such that ∑jLj†Lj=I\sum_jL_j^\dagger L_j=I∑j​Lj†​Lj​=I and Φ(X)=∑jLjXLj†\Phi(X)=\sum_jL_jXL_j^\daggerΦ(X)=∑j​Lj​XLj†​ for every XXX; and (Tr⁡RX)u,v=∑r∈RX(r,u),(r,v)(\operatorname{Tr}_R X)_{u,v}=\sum_{r\in R}X_{(r,u),(r,v)}(TrR​X)u,v​=∑r∈R​X(r,u),(r,v)​. No nonemptiness of A,B,C,DA,B,C,DA,B,C,D is stipulated. When n=0n=0n=0, the extra registers are singletons and the permutation sum contains only the identity permutation.

QAlgorithms.Papers.Independent.Extend50.P47.KChannel

For every natural number nnn, including 000, and every map NNN from complex matrices indexed by A×BA\times BA×B to those indexed by C×DC\times DC×D, where A,B,C,DA,B,C,DA,B,C,D are the ambient finite index types with decidable equality, this predicate means the following. The map NNN is a channel, and there exists a channel MMM from matrices indexed by Bn×(A×B)B^n\times(A\times B)Bn×(A×B) to matrices indexed by Dn×(C×D)D^n\times(C\times D)Dn×(C×D), such that for every input matrix XXX,

Tr⁡DnM(X)=N(Tr⁡BnX),\operatorname{Tr}_{D^n}M(X)=N(\operatorname{Tr}_{B^n}X),TrDn​M(X)=N(TrBn​X),

and, for every permutation π\piπ of {0,…,n}\{0,\ldots,n\}{0,…,n} and every matrix XXX,

M(KπA,BX(KπA,B)†)=KπC,DM(X)(KπC,D)†.M(K_\pi^{A,B}X(K_\pi^{A,B})^\dagger) = K_\pi^{C,D}M(X)(K_\pi^{C,D})^\dagger.M(KπA,B​X(KπA,B​)†)=KπC,D​M(X)(KπC,D​)†.

Here a channel Φ\PhiΦ means that some finite collection of complex matrices EjE_jEj​ satisfies ∑jEj†Ej=I\sum_jE_j^\dagger E_j=I∑j​Ej†​Ej​=I and Φ(X)=∑jEjXEj†\Phi(X)=\sum_jE_jXE_j^\daggerΦ(X)=∑j​Ej​XEj†​ for all matrices XXX, and partial trace sums entries over equal auxiliary indices. To define KπA,BK_\pi^{A,B}KπA,B​, write a basis label as x=(b,(a,b))x=(\mathbf b,(a,b))x=(b,(a,b)) with b∈Bn\mathbf b\in B^nb∈Bn, and form the sequence b^=(b,b0,…,bn−1)\widehat b=(b,\mathbf b_0,\ldots,\mathbf b_{n-1})b=(b,b0​,…,bn−1​); its matrix entry at row y=(b′,(a′,b′))y=(\mathbf b',(a',b'))y=(b′,(a′,b′)), column xxx, is 111 exactly when a′=aa'=aa′=a and b^′=b^∘π−1\widehat b'=\widehat b\circ\pi^{-1}b′=b∘π−1, and is 000 otherwise. Define KπC,DK_\pi^{C,D}KπC,D​ by the same rule with C,DC,DC,D. The matrices XXX are unrestricted, and no nonemptiness assumptions on A,B,C,DA,B,C,DA,B,C,D are included. When n=0n=0n=0, each auxiliary function type has one element and the sole permutation makes the covariance condition automatic.

QAlgorithms.Papers.Independent.Extend50.P47.SE

For an indexing type GGG, finite index types R,SR,SR,S, a family of complex square matrices UgU_gUg​ indexed by R×SR\times SR×S, and a complex square matrix ρ\rhoρ indexed by SSS, this predicate means that ρ\rhoρ is positive semidefinite with trace 111, and there exists a positive semidefinite matrix ω\omegaω indexed by R×SR\times SR×S, of trace 111, satisfying

ω=UgωUg†for every g∈G,∑r∈Rω(r,s),(r,s′)=ρs,s′for all s,s′∈S.\omega=U_g\omega U_g^\dagger\quad\text{for every }g\in G, \qquad \sum_{r\in R}\omega_{(r,s),(r,s')}=\rho_{s,s'} \quad\text{for all }s,s'\in S.ω=Ug​ωUg†​for every g∈G,r∈R∑​ω(r,s),(r,s′)​=ρs,s′​for all s,s′∈S.

No unitary or representation conditions are imposed on UUU. For empty GGG, the invariance condition is vacuous; for empty RRR or SSS, no such extension exists.

QAlgorithms.Papers.Independent.Extend50.P47.SEChannel

For an index type GGG, finite index types R,S,R2,S2R,S,R_2,S_2R,S,R2​,S2​, with decidable equality on R,SR,SR,S, arbitrary matrix families UgU_gUg​ on R×SR\times SR×S and VgV_gVg​ on R2×S2R_2\times S_2R2​×S2​, and a function N:CS×S→CS2×S2N:\mathbb C^{S\times S}\to\mathbb C^{S_2\times S_2}N:CS×S→CS2​×S2​, this predicate requires that NNN admit a finite normalized Kraus representation and that there exist a function MMM on the enlarged matrix spaces also admitting a finite normalized Kraus representation. A finite normalized Kraus representation of a map FFF means F(X)=∑ℓKℓXKℓ†F(X)=\sum_\ell K_\ell XK_\ell^\daggerF(X)=∑ℓ​Kℓ​XKℓ†​ for every XXX, with ∑ℓKℓ†Kℓ\sum_\ell K_\ell^\dagger K_\ell∑ℓ​Kℓ†​Kℓ​ equal to the input identity. The required MMM must satisfy, for every matrix XXX on R×SR\times SR×S,

Tr⁡R2M(X)=N(Tr⁡RX),M(UgXUg†)=VgM(X)Vg†for every g∈G,\operatorname{Tr}_{R_2}M(X)=N(\operatorname{Tr}_R X), \qquad M(U_gXU_g^\dagger)=V_gM(X)V_g^\dagger \quad\text{for every }g\in G,TrR2​​M(X)=N(TrR​X),M(Ug​XUg†​)=Vg​M(X)Vg†​for every g∈G,

where (Tr⁡RX)s,t=∑r∈RX(r,s),(r,t)(\operatorname{Tr}_R X)_{s,t}=\sum_{r\in R}X_{(r,s),(r,t)}(TrR​X)s,t​=∑r∈R​X(r,s),(r,t)​, and similarly for R2R_2R2​. No unitarity or representation condition on U,VU,VU,V is imposed, and the covariance condition is vacuous for empty GGG.

QAlgorithms.Papers.Independent.Extend50.P47.StandardStep

For every natural number nnn, this defines a type of instructions with exactly four constructors: an instruction labelled hhh carrying an index q∈{0,…,n−1}q\in\{0,\ldots,n-1\}q∈{0,…,n−1}; an instruction labelled ttt carrying such an index; an instruction labelled tdtdtd carrying such an index; and an instruction labelled cxcxcx carrying an injection w:{0,1}↪{0,…,n−1}w:\{0,1\}\hookrightarrow\{0,\ldots,n-1\}w:{0,1}↪{0,…,n−1}, so that its two ordered wire indices are distinct. The definition itself assigns no matrix to these instructions. For n=0n=0n=0 there are no instructions, and for n=1n=1n=1 there are no cxcxcx instructions.

QAlgorithms.Papers.Independent.Extend50.P47.Sym

For an indexing type GGG, a finite index type SSS, a family of complex square matrices UgU_gUg​ indexed by SSS, and a complex square matrix ρ\rhoρ indexed by SSS, this predicate means that ρ\rhoρ is positive semidefinite, has trace 111, and satisfies

ρ=UgρUg†for every g∈G.\rho=U_g\rho U_g^\dagger\qquad\text{for every }g\in G.ρ=Ug​ρUg†​for every g∈G.

The matrices UgU_gUg​ are not assumed to be unitary or to obey a multiplication law. If GGG is empty, the invariance condition is vacuous; if SSS is empty, the trace condition is impossible.

QAlgorithms.Papers.Independent.Extend50.P47.TestIdentity

Let P,T,SP,T,SP,T,S be finite index types, with decidable equality on PPP and SSS, let ψ∈CP×S\psi\in\mathbb C^{P\times S}ψ∈CP×S, let KKK be a complex matrix indexed by T×ST\times ST×S, let ρ\rhoρ be a complex matrix indexed by SSS, and let QQQ be any predicate on such matrices. This predicate means that two sets of real numbers have a common attained greatest value vvv. The first set consists of

Re⁡tr⁡ ⁣(K†K ZN),(ZN)(t,s),(t′,s′)=N ⁣((ψ(p,s)ψ(q,s′)‾)p,q∈P)t,t′,\operatorname{Re}\operatorname{tr}\!\left(K^\dagger K\,Z_N\right), \qquad (Z_N)_{(t,s),(t',s')} = N\!\left((\psi_{(p,s)}\overline{\psi_{(q,s')}})_{p,q\in P}\right)_{t,t'},Retr(K†KZN​),(ZN​)(t,s),(t′,s′)​=N((ψ(p,s)​ψ(q,s′)​​)p,q∈P​)t,t′​,

as NNN ranges over all maps admitting a finite Kraus representation

N(X)=∑ℓ=0m−1EℓXEℓ†,∑ℓ=0m−1Eℓ†Eℓ=IP,Eℓ∈CT×P,N(X)=\sum_{\ell=0}^{m-1}E_\ell XE_\ell^\dagger, \qquad \sum_{\ell=0}^{m-1}E_\ell^\dagger E_\ell=I_P, \qquad E_\ell\in\mathbb C^{T\times P},N(X)=ℓ=0∑m−1​Eℓ​XEℓ†​,ℓ=0∑m−1​Eℓ†​Eℓ​=IP​,Eℓ​∈CT×P,

for some natural number mmm, including m=0m=0m=0. The second set consists of

[Re⁡tr⁡ρ σρ]2\left[ \operatorname{Re}\operatorname{tr} \sqrt{\sqrt{\rho}\,\sigma\sqrt{\rho}} \right]^2[Retrρ​σρ​​]2

as σ\sigmaσ ranges over all matrices satisfying Q(σ)Q(\sigma)Q(σ), where each square root is the matrix continuous functional calculus for the real square-root function. Thus some such NNN and some such σ\sigmaσ attain vvv, and every value in either set is at most vvv. No normalization of ψ\psiψ, density-matrix condition on ρ\rhoρ or σ\sigmaσ, or nonemptiness of the index types is assumed.

QAlgorithms.Papers.Independent.Extend50.P47.TrivialBlock

Let UgU_gUg​ be a family of complex matrices on a finite index set SSS, and let EEE provide finitely many blocks with positive multiplicities mjm_jmj​, positive dimensions djd_jdj​, unitary families Rj(g)R_j(g)Rj​(g), and a unitary WWW satisfying Ug=W(⨁jImj⊗Rj(g))W†U_g=W(\bigoplus_j I_{m_j}\otimes R_j(g))W^\daggerUg​=W(⨁j​Imj​​⊗Rj​(g))W†. The data require that the only Hermitian idempotents commuting with each family are zero and identity, and that distinct families have no two-sided unitary intertwiner. For a chosen block index lll, the proposition defined here is exactly

Rl(g)=Idlfor every g∈G.R_l(g)=I_{d_l}\qquad\text{for every }g\in G.Rl​(g)=Idl​​for every g∈G.

It imposes this condition on the entire family in that block. An empty collection of blocks supplies no possible lll.

QAlgorithms.Papers.Independent.Extend50.P47.bilateral

For any complex 2×22\times22×2 matrix aaa, indexed by the Boolean values, this definition returns the matrix on Boolean pairs

(cos⁡(−π/4)I−isin⁡(−π/4)a)⊗(cos⁡(−π/4)I−isin⁡(−π/4)a)=I+ia2⊗I+ia2.\left(\cos(-\pi/4)I-i\sin(-\pi/4)a\right) \otimes \left(\cos(-\pi/4)I-i\sin(-\pi/4)a\right) = \frac{I+ia}{\sqrt2}\otimes\frac{I+ia}{\sqrt2}.(cos(−π/4)I−isin(−π/4)a)⊗(cos(−π/4)I−isin(−π/4)a)=2​I+ia​⊗2​I+ia​.

No condition is imposed on aaa.

QAlgorithms.Papers.Independent.Extend50.P47.bipartiteAcceptance

For finite index types A,BA,BA,B, any vector ψ∈CA×B\psi\in\mathbb C^{A\times B}ψ∈CA×B, and any natural number kkk, this defines the real number

ak(ψ)=Re⁡Tr⁡ ⁣[Kk†Kk Dk],Kk=1k!∑π∈Sym⁡(k)Vπ,(Dk)x,y=∏i=0k−1ψxiψyi‾,a_k(\psi)=\operatorname{Re}\operatorname{Tr}\!\left[ K_k^\dagger K_k\,D_k\right], \qquad K_k=\frac1{k!}\sum_{\pi\in\operatorname{Sym}(k)}V_\pi, \qquad (D_k)_{x,y}=\prod_{i=0}^{k-1}\psi_{x_i}\overline{\psi_{y_i}},ak​(ψ)=ReTr[Kk†​Kk​Dk​],Kk​=k!1​π∈Sym(k)∑​Vπ​,(Dk​)x,y​=i=0∏k−1​ψxi​​ψyi​​​,

where Vπ(y,x)=1V_\pi(y,x)=1Vπ​(y,x)=1 exactly when (yi)A=(xi)A(y_i)_A=(x_i)_A(yi​)A​=(xi​)A​ and (yi)B=(xπ−1(i))B(y_i)_B=(x_{\pi^{-1}(i)})_B(yi​)B​=(xπ−1(i)​)B​ for all iii, and is zero otherwise. No normalization assumption is imposed on ψ\psiψ. For k=0k=0k=0, the matrices in this formula have their unique entry equal to 111, so the defined value is 111.

QAlgorithms.Papers.Independent.Extend50.P47.bitHammingWeight

For every natural number nnn and every Boolean string x:{0,…,n−1}→{false,true}x:\{0,\ldots,n-1\}\to\{\mathrm{false},\mathrm{true}\}x:{0,…,n−1}→{false,true}, the value bitHammingWeight⁡(x)\operatorname{bitHammingWeight}(x)bitHammingWeight(x) is the number of indices iii for which xi=truex_i=\mathrm{true}xi​=true. For n=0n=0n=0, the index set is empty, there is one empty string, and its weight is 000.

QAlgorithms.Papers.Independent.Extend50.P47.booleanSinglet

This definition gives the vector ψ∈C{false,true}2\psi\in\mathbb C^{\{\mathrm{false},\mathrm{true}\}^2}ψ∈C{false,true}2 with coordinates

ψ(false,true)=12,ψ(true,false)=−12,ψ(false,false)=ψ(true,true)=0.\psi_{(\mathrm{false},\mathrm{true})}=\frac1{\sqrt2}, \qquad \psi_{(\mathrm{true},\mathrm{false})}=-\frac1{\sqrt2}, \qquad \psi_{(\mathrm{false},\mathrm{false})} =\psi_{(\mathrm{true},\mathrm{true})}=0.ψ(false,true)​=2​1​,ψ(true,false)​=−2​1​,ψ(false,false)​=ψ(true,true)​=0.

QAlgorithms.Papers.Independent.Extend50.P47.choiFamily

For index types G,A,BG,A,BG,A,B, matrix families U:G→CA×AU:G\to\mathbb C^{A\times A}U:G→CA×A and V:G→CB×BV:G\to\mathbb C^{B\times B}V:G→CB×B, and g∈Gg\in Gg∈G, this defines the matrix CgC_gCg​ on A×BA\times BA×B by

Cg=Ug‾⊗Vg,(Cg)(a,b),(a′,b′)=(Ug)a,a′‾(Vg)b,b′.C_g=\overline{U_g}\otimes V_g, \qquad (C_g)_{(a,b),(a',b')} =\overline{(U_g)_{a,a'}}(V_g)_{b,b'}.Cg​=Ug​​⊗Vg​,(Cg​)(a,b),(a′,b′)​=(Ug​)a,a′​​(Vg​)b,b′​.

The bar denotes entrywise complex conjugation. The definition imposes no unitarity or representation condition on either family.

QAlgorithms.Papers.Independent.Extend50.P47.collectiveSU2Average

For any measure μ\muμ on the group of complex 2×22\times22×2 unitary matrices of determinant one, with rows and columns indexed by the Boolean values, this definition returns the complex matrix on Boolean pairs

∫SU(2)U⊗U dμ(U).\int_{\mathrm{SU}(2)} U\otimes U\,d\mu(U).∫SU(2)​U⊗Udμ(U).

Its entry at ((a,b),(c,d))((a,b),(c,d))((a,b),(c,d)) is the corresponding matrix-valued integral of Ua,cUb,dU_{a,c}U_{b,d}Ua,c​Ub,d​. No Haar, probability, or integrability assumption is imposed by this definition; the integral uses the total Bochner-integral convention, which returns zero when its integrand is not integrable.

QAlgorithms.Papers.Independent.Extend50.P47.collectiveZAverage

For every natural number nnn, collectiveZAverage⁡(n)\operatorname{collectiveZAverage}(n)collectiveZAverage(n) is the complex matrix

Qn=14π∫04πCn(ϕ) dϕ,Q_n=\frac1{4\pi}\int_0^{4\pi} C_n(\phi)\,d\phi,Qn​=4π1​∫04π​Cn​(ϕ)dϕ,

where Cn(ϕ)C_n(\phi)Cn​(ϕ) is indexed by Boolean strings of length nnn, is zero off the diagonal, and has diagonal entry exp⁡(i(2w(x)−n)ϕ/2)\exp(i(2w(x)-n)\phi/2)exp(i(2w(x)−n)ϕ/2), with w(x)w(x)w(x) the number of true coordinates of xxx. The integral is with respect to the usual real volume measure. This definition includes n=0n=0n=0, for which Q0Q_0Q0​ is the one-dimensional identity.

QAlgorithms.Papers.Independent.Extend50.P47.collectiveZRotation

For every natural number nnn and real number ϕ\phiϕ, collectiveZRotation⁡(n,ϕ)\operatorname{collectiveZRotation}(n,\phi)collectiveZRotation(n,ϕ) is the diagonal complex matrix indexed by Boolean strings of length nnn, with diagonal entry

Cn(ϕ)x,x=exp⁡ ⁣(i (2w(x)−n)ϕ2),C_n(\phi)_{x,x}=\exp\!\left(i\,\frac{(2w(x)-n)\phi}{2}\right),Cn​(ϕ)x,x​=exp(i2(2w(x)−n)ϕ​),

where w(x)w(x)w(x) counts the true coordinates of xxx; all off-diagonal entries are zero. For n=0n=0n=0, this is the one-dimensional identity for every ϕ\phiϕ.

QAlgorithms.Papers.Independent.Extend50.P47.collectiveZTwirl

For every natural number nnn and every complex matrix ρ\rhoρ indexed by Boolean strings of length nnn, with no positivity or normalization assumption, the definition is

collectiveZTwirl⁡(n,ρ)=14π∫04πCn(ϕ)ρCn(ϕ)† dϕ,\operatorname{collectiveZTwirl}(n,\rho)=\frac1{4\pi}\int_0^{4\pi}C_n(\phi)\rho C_n(\phi)^\dagger\,d\phi,collectiveZTwirl(n,ρ)=4π1​∫04π​Cn​(ϕ)ρCn​(ϕ)†dϕ,

where Cn(ϕ)C_n(\phi)Cn​(ϕ) is diagonal with entry exp⁡(i(2w(x)−n)ϕ/2)\exp(i(2w(x)-n)\phi/2)exp(i(2w(x)−n)ϕ/2), and w(x)w(x)w(x) counts the true coordinates of xxx. The integral uses the usual real volume measure. For n=0n=0n=0, the result is ρ\rhoρ.

QAlgorithms.Papers.Independent.Extend50.P47.conjugateStep

For every natural number nnn, this defines a function on instructions of the four forms h(q),t(q),td(q)h(q),t(q),td(q)h(q),t(q),td(q), with 0≤q<n0\le q<n0≤q<n, and cx(w)cx(w)cx(w), with w:{0,1}↪{0,…,n−1}w:\{0,1\}\hookrightarrow\{0,\ldots,n-1\}w:{0,1}↪{0,…,n−1} injective. It fixes h(q)h(q)h(q) and cx(w)cx(w)cx(w), sends t(q)t(q)t(q) to td(q)td(q)td(q), and sends td(q)td(q)td(q) to t(q)t(q)t(q), preserving every wire index and injection. This also defines the unique function on the empty instruction type when n=0n=0n=0.

QAlgorithms.Papers.Independent.Extend50.P47.conjugateTensorAction

For index types G,SG,SG,S, a family UgU_gUg​ of complex square matrices indexed by SSS, and g∈Gg\in Gg∈G, this definition returns Ug⊗Ug‾U_g\otimes\overline{U_g}Ug​⊗Ug​​, where the bar denotes entrywise complex conjugation. Explicitly, its entries are

(Ug⊗Ug‾)(s1,s2),(t1,t2)=(Ug)s1,t1 (Ug)s2,t2‾.\bigl(U_g\otimes\overline{U_g}\bigr)_{(s_1,s_2),(t_1,t_2)} =(U_g)_{s_1,t_1}\,\overline{(U_g)_{s_2,t_2}}.(Ug​⊗Ug​​)(s1​,s2​),(t1​,t2​)​=(Ug​)s1​,t1​​(Ug​)s2​,t2​​​.

No unitarity or multiplication law is required of UUU.

QAlgorithms.Papers.Independent.Extend50.P47.controlReturnProbability

For a finite index type SSS and arbitrary complex square matrices K,ρK,\rhoK,ρ indexed by SSS, this definition returns the real number

Re⁡tr⁡(K†Kρ).\operatorname{Re}\operatorname{tr}(K^\dagger K\rho).Retr(K†Kρ).

Neither a density matrix condition on ρ\rhoρ nor a bound on K†KK^\dagger KK†K is required, so the definition does not require this number to lie in [0,1][0,1][0,1]. For empty SSS, it is zero.

QAlgorithms.Papers.Independent.Extend50.P47.densityPreparation

For an index type SSS and any complex matrix ρ\rhoρ indexed by SSS, this defines the function from complex matrices on the singleton type {∗}\{\ast\}{∗} to matrices on SSS given by

X⟼tr⁡(X)ρ=X∗,∗ρ.X\longmapsto \operatorname{tr}(X)\rho=X_{\ast,\ast}\rho.X⟼tr(X)ρ=X∗,∗​ρ.

No density-matrix condition on ρ\rhoρ is assumed.

QAlgorithms.Papers.Independent.Extend50.P47.extensionSDP

For finite index types R,SR,SR,S with the required decidable equalities, an arbitrary complex matrix ρ\rhoρ on SSS, and an arbitrary predicate QQQ on matrices indexed by R×SR\times SR×S, this defines

{Re⁡tr⁡X:X∈CS×S, ω∈C(R×S)×(R×S), ω⪰0, tr⁡ω=1, Q(ω), (ρX†XTr⁡Rω)⪰0},(Tr⁡Rω)st=∑r∈Rω(r,s),(r,t).\left\{\operatorname{Re}\operatorname{tr}X: X\in\mathbb C^{S\times S},\ \omega\in\mathbb C^{(R\times S)\times(R\times S)},\ \omega\succeq0,\ \operatorname{tr}\omega=1,\ Q(\omega),\ \begin{pmatrix}\rho&X^\dagger\\ X&\operatorname{Tr}_R\omega\end{pmatrix}\succeq0 \right\}, \qquad (\operatorname{Tr}_R\omega)_{st}=\sum_{r\in R}\omega_{(r,s),(r,t)}.{RetrX:X∈CS×S, ω∈C(R×S)×(R×S), ω⪰0, trω=1, Q(ω), (ρX​X†TrR​ω​)⪰0},(TrR​ω)st​=r∈R∑​ω(r,s),(r,t)​.

The trace equation is a complex equality, and no density-matrix hypothesis on ρ\rhoρ is imposed. The variable XXX is an arbitrary complex matrix subject to the displayed block positivity condition. The set is empty if the constraints are infeasible, including whenever RRR or SSS is empty.

QAlgorithms.Papers.Independent.Extend50.P47.finitePhase

For every natural number nnn and every integer index y∈{0,…,n}y\in\{0,\ldots,n\}y∈{0,…,n}, finitePhase⁡(n,y)\operatorname{finitePhase}(n,y)finitePhase(n,y) is the diagonal complex matrix indexed by Boolean strings of length nnn, with entries

Fn,y(x,x)=exp⁡ ⁣(i π(2y−n)(2w(x)−n)n+1),F_{n,y}(x,x)=\exp\!\left(i\,\frac{\pi(2y-n)(2w(x)-n)}{n+1}\right),Fn,y​(x,x)=exp(in+1π(2y−n)(2w(x)−n)​),

where w(x)w(x)w(x) counts the true coordinates of xxx; all off-diagonal entries are zero. The denominator n+1n+1n+1 is always positive. For n=0n=0n=0, the only index is y=0y=0y=0, and the matrix is the one-dimensional identity.

QAlgorithms.Papers.Independent.Extend50.P47.firstChannel

For index types P,T,SP,T,SP,T,S and an arbitrary function NNN from complex square matrices indexed by PPP to complex square matrices indexed by TTT, this definition returns a function from matrices indexed by P×SP\times SP×S to matrices indexed by T×ST\times ST×S. For an input matrix XXX, its output YYY is specified by

Y(t,s),(t′,s′)=[N ⁣([X(p,s),(q,s′)]p,q∈P)]t,t′.Y_{(t,s),(t',s')} =\left[N\!\left(\bigl[X_{(p,s),(q,s')}\bigr]_{p,q\in P}\right)\right]_{t,t'}.Y(t,s),(t′,s′)​=[N([X(p,s),(q,s′)​]p,q∈P​)]t,t′​.

The function NNN is not required to be linear or to be a channel.

QAlgorithms.Papers.Independent.Extend50.P47.hsChannelAdjoint

Let AAA be an index type with decidable equality, let BBB be a finite index type, let NNN be any function from complex A×AA\times AA×A matrices to complex B×BB\times BB×B matrices, and let Y∈CB×BY\in\mathbb C^{B\times B}Y∈CB×B. This defines the A×AA\times AA×A matrix

(hsChannelAdjoint⁡(N,Y))ij=∑a,b∈BN(Eij)ab‾ Yab,\bigl(\operatorname{hsChannelAdjoint}(N,Y)\bigr)_{ij} = \sum_{a,b\in B}\overline{N(E_{ij})_{ab}}\,Y_{ab},(hsChannelAdjoint(N,Y))ij​=a,b∈B∑​N(Eij​)ab​​Yab​,

where EijE_{ij}Eij​ has entry 111 at (i,j)(i,j)(i,j) and zero elsewhere. The definition imposes no linearity or channel condition on NNN. If BBB is empty, every entry of the resulting matrix is zero.

QAlgorithms.Papers.Independent.Extend50.P47.incoherentClock

For every natural number ddd and every index z∈{0,…,d−1}z\in\{0,\ldots,d-1\}z∈{0,…,d−1}, this defines the complex diagonal matrix Cd,zC_{d,z}Cd,z​, indexed by j,k∈{0,…,d−1}j,k\in\{0,\ldots,d-1\}j,k∈{0,…,d−1}, with entries

(Cd,z)j,k={exp⁡ ⁣(2πi jzd),j=k,0,j≠k.(C_{d,z})_{j,k}= \begin{cases} \exp\!\left(\dfrac{2\pi i\,jz}{d}\right),&j=k,\\ 0,&j\ne k. \end{cases}(Cd,z​)j,k​=⎩⎨⎧​exp(d2πijz​),0,​j=k,j=k.​

The indices are interpreted as natural numbers inside the complex exponential. Although ddd ranges over all natural numbers, no argument zzz exists when d=0d=0d=0; for d=1d=1d=1, the only resulting matrix is the 1×11\times11×1 identity.

QAlgorithms.Papers.Independent.Extend50.P47.isotypicDensity

Let UgU_gUg​ be a family of complex matrices on a finite index set SSS, and let EEE consist of a natural number ccc, positive integers ml,dlm_l,d_lml​,dl​ for 0≤l<c0\le l<c0≤l<c, unitary families Rl(g)R_l(g)Rl​(g) on Cdl\mathbb C^{d_l}Cdl​, and a unitary matrix W:⨁l(Cml⊗Cdl)→CSW:\bigoplus_l(\mathbb C^{m_l}\otimes\mathbb C^{d_l})\to\mathbb C^SW:⨁l​(Cml​⊗Cdl​)→CS, such that Ug=W(⨁lIml⊗Rl(g))W†U_g=W\bigl(\bigoplus_l I_{m_l}\otimes R_l(g)\bigr)W^\daggerUg​=W(⨁l​Iml​​⊗Rl​(g))W†. The data require that every Hermitian idempotent commuting with all Rl(g)R_l(g)Rl​(g) is either zero or the identity, and that for distinct l,kl,kl,k there is no rectangular matrix XXX satisfying X†X=IX^\dagger X=IX†X=I, XX†=IXX^\dagger=IXX†=I, and Rl(g)X=XRk(g)R_l(g)X=XR_k(g)Rl​(g)X=XRk​(g) for every ggg. For any family of complex matrices blb_lbl​ of size ml×mlm_l\times m_lml​×ml​, this definition returns

W(⨁l=0c−1bl⊗Idldl)W†.W\left(\bigoplus_{l=0}^{c-1}b_l\otimes\frac{I_{d_l}}{d_l}\right)W^\dagger.W(l=0⨁c−1​bl​⊗dl​Idl​​​)W†.

No positivity or trace condition is imposed on the blb_lbl​. The number ccc may be zero when the unitary-matrix requirements permit an empty decomposition.

QAlgorithms.Papers.Independent.Extend50.P47.kFamily

For index types A,BA,BA,B, any natural number nnn, and a permutation π\piπ of {0,…,n}\{0,\ldots,n\}{0,…,n}, this defines a complex matrix indexed by (Bn)×(A×B)(B^n)\times(A\times B)(Bn)×(A×B). Write an index as x=(b,a,b0)x=(\mathbf b,a,b_0)x=(b,a,b0​), and form its ordered BBB-tuple b^\widehat bb of length n+1n+1n+1 by b^0=b0\widehat b_0=b_0b0​=b0​ and b^i+1=bi\widehat b_{i+1}=\mathbf b_ibi+1​=bi​. For y=(c,a′,c0)y=(\mathbf c,a',c_0)y=(c,a′,c0​), form c^\widehat cc in the same way. The matrix entry is

Vπ(y,x)={1,a′=a and c^i=b^π−1(i) for every i,0,otherwise.V_\pi(y,x)= \begin{cases} 1,&a'=a\text{ and }\widehat c_i=\widehat b_{\pi^{-1}(i)} \text{ for every }i,\\ 0,&\text{otherwise}. \end{cases}Vπ​(y,x)={1,0,​a′=a and ci​=bπ−1(i)​ for every i,otherwise.​

This includes n=0n=0n=0, when the only permutation is the identity and the resulting matrix is the identity on A×BA\times BA×B.

QAlgorithms.Papers.Independent.Extend50.P47.multiCopies

For any natural number mmm, any dimensions di∈Nd_i\in\mathbb Ndi​∈N, any complex matrix ρ\rhoρ indexed by H=∏i=0m−1{0,…,di−1}H=\prod_{i=0}^{m-1}\{0,\ldots,d_i-1\}H=∏i=0m−1​{0,…,di​−1}, and any natural number kkk, this defines a matrix ρ[k]\rho^{[k]}ρ[k] indexed by arrays xi:{0,…,k−1}→{0,…,di−1}x_i:\{0,\ldots,k-1\}\to\{0,\ldots,d_i-1\}xi​:{0,…,k−1}→{0,…,di​−1}, with entries

ρx,y[k]=∏t=0k−1ρ(xi(t))i, (yi(t))i.\rho^{[k]}_{x,y} =\prod_{t=0}^{k-1} \rho_{(x_i(t))_i,\,(y_i(t))_i}.ρx,y[k]​=t=0∏k−1​ρ(xi​(t))i​,(yi​(t))i​​.

There is no assumption that ρ\rhoρ is Hermitian, positive semidefinite, or normalized. For k=0k=0k=0, the index set is a singleton and the empty product gives its sole matrix entry the value 111. Zero dimensions and m=0m=0m=0 are also allowed; when m=0m=0m=0, the sole entry is the kkk-th power of the sole entry of ρ\rhoρ.

QAlgorithms.Papers.Independent.Extend50.P47.multiFamily

For any natural number mmm, any natural-number families di,nid_i,n_idi​,ni​ indexed by i=0,…,m−1i=0,\ldots,m-1i=0,…,m−1, and any permutations πi\pi_iπi​ of {0,…,ni}\{0,\ldots,n_i\}{0,…,ni​}, this defines a complex matrix FπF_{\boldsymbol\pi}Fπ​ on R×HR\times HR×H, where R=∏i({0,…,ni−1}→{0,…,di−1})R=\prod_i(\{0,\ldots,n_i-1\}\to\{0,\ldots,d_i-1\})R=∏i​({0,…,ni​−1}→{0,…,di​−1}) and H=∏i{0,…,di−1}H=\prod_i\{0,\ldots,d_i-1\}H=∏i​{0,…,di​−1}. For a row y=(yR,yH)y=(y_R,y_H)y=(yR​,yH​) and column x=(xR,xH)x=(x_R,x_H)x=(xR​,xH​), form the length-ni+1n_i+1ni​+1 lists y^i\widehat y_iy​i​ and x^i\widehat x_ixi​ by putting yH(i)y_H(i)yH​(i), respectively xH(i)x_H(i)xH​(i), at coordinate 000, followed by the coordinates of yR(i)y_R(i)yR​(i), respectively xR(i)x_R(i)xR​(i). The entries are

(Fπ)y,x={1,y^i=x^i∘πi−1 for every i,0,otherwise.(F_{\boldsymbol\pi})_{y,x} = \begin{cases} 1,&\widehat y_i=\widehat x_i\circ\pi_i^{-1}\text{ for every }i,\\ 0,&\text{otherwise}. \end{cases}(Fπ​)y,x​={1,0,​y​i​=xi​∘πi−1​ for every i,otherwise.​

No positivity assumptions are imposed. In particular, ni=0n_i=0ni​=0 gives a one-coordinate permutation condition for subsystem iii; m=0m=0m=0 gives a singleton index set and sole entry 111; and if some di=0d_i=0di​=0, the matrix index set is empty.

QAlgorithms.Papers.Independent.Extend50.P47.multiProjector

For any natural numbers m,km,km,k and any dimensions di∈Nd_i\in\mathbb Ndi​∈N, this defines a complex matrix JJJ indexed by arrays xi:{0,…,k−1}→{0,…,di−1}x_i:\{0,\ldots,k-1\}\to\{0,\ldots,d_i-1\}xi​:{0,…,k−1}→{0,…,di​−1}, by

Jx,y=∏i=0m−1(1k!∑π∈Sk1{xi=yi∘π−1}),J_{x,y} =\prod_{i=0}^{m-1} \left( \frac1{k!}\sum_{\pi\in S_k} \mathbf 1_{\{x_i=y_i\circ\pi^{-1}\}} \right),Jx,y​=i=0∏m−1​(k!1​π∈Sk​∑​1{xi​=yi​∘π−1}​),

where SkS_kSk​ is the set of all permutations of {0,…,k−1}\{0,\ldots,k-1\}{0,…,k−1} and the indicator is 111 when its condition holds and 000 otherwise. Thus each factor is the corresponding entry of the average of all permutation matrices on the kkk coordinates of the iii-th subsystem. No dimensions or counts are required to be positive. For m=0m=0m=0, the empty product is 111; for k=0k=0k=0, each permutation average has its sole entry equal to 111; and if k>0k>0k>0 and some di=0d_i=0di​=0, the matrix index set is empty.

QAlgorithms.Papers.Independent.Extend50.P47.multiPureFamily

For any natural number mmm, any dimensions di∈Nd_i\in\mathbb Ndi​∈N indexed by i∈{0,…,m−1}i\in\{0,\ldots,m-1\}i∈{0,…,m−1}, any natural number kkk, and any choice of a permutation πi\pi_iπi​ of {0,…,k−1}\{0,\ldots,k-1\}{0,…,k−1} for each iii, this defines a complex matrix FπF_{\boldsymbol\pi}Fπ​ whose rows and columns are arrays x=(xi)ix=(x_i)_ix=(xi​)i​ with xi:{0,…,k−1}→{0,…,di−1}x_i:\{0,\ldots,k-1\}\to\{0,\ldots,d_i-1\}xi​:{0,…,k−1}→{0,…,di​−1}, by

(Fπ)y,x={1,if yi(t)=xi(πi−1(t)) for every i,t,0,otherwise.(F_{\boldsymbol\pi})_{y,x} = \begin{cases} 1,&\text{if }y_i(t)=x_i(\pi_i^{-1}(t))\text{ for every }i,t,\\ 0,&\text{otherwise}. \end{cases}(Fπ​)y,x​={1,0,​if yi​(t)=xi​(πi−1​(t)) for every i,t,otherwise.​

No positivity assumptions on m,k,dim,k,d_im,k,di​ are imposed. If m=0m=0m=0 or k=0k=0k=0, the array index set is a singleton and this matrix has its sole entry equal to 111; if k>0k>0k>0 and some di=0d_i=0di​=0, the array index set is empty.

QAlgorithms.Papers.Independent.Extend50.P47.outcomeMatrix

For any index type XXX with decidable equality and any permutation π:X→X\pi:X\to Xπ:X→X, this defines a complex matrix OπO_\piOπ​ with entries

(Oπ)y,x={1,y=π(x),0,y≠π(x).(O_\pi)_{y,x} = \begin{cases} 1,&y=\pi(x),\\ 0,&y\ne\pi(x). \end{cases}(Oπ​)y,x​={1,0,​y=π(x),y=π(x).​

No finiteness or nonemptiness assumption on XXX is required; the empty index type is included.

QAlgorithms.Papers.Independent.Extend50.P47.pauliAxisRotation

For any complex 2×22\times22×2 matrix aaa, indexed by the Boolean values, and any real number θ\thetaθ, this definition returns

cos⁡(θ/2) I−isin⁡(θ/2) a.\cos(\theta/2)\,I-i\sin(\theta/2)\,a.cos(θ/2)I−isin(θ/2)a.

No assumption that aaa is a Pauli matrix, Hermitian, or unitary is imposed.

QAlgorithms.Papers.Independent.Extend50.P47.permutation

For a finite type SSS, a natural number kkk, and a permutation π\piπ of {0,…,k−1}\{0,\ldots,k-1\}{0,…,k−1}, this defines the complex matrix indexed by SkS^kSk whose entries are

Pπ(y,x)={1,yi=xπ−1(i) for every i,0,otherwise.P_\pi(y,x)= \begin{cases} 1,&y_i=x_{\pi^{-1}(i)}\text{ for every }i,\\ 0,&\text{otherwise}. \end{cases}Pπ​(y,x)={1,0,​yi​=xπ−1(i)​ for every i,otherwise.​

The construction identifies SSS with {0,…,∣S∣−1}\{0,\ldots,|S|-1\}{0,…,∣S∣−1} using its finite enumeration and restricts the corresponding permutation matrix along that identification. For k=0k=0k=0, this is the one-entry matrix [1][1][1], including when SSS is empty.

QAlgorithms.Papers.Independent.Extend50.P47.povmOutcomeChannel

For a finite index type SSS, a finite index type XXX with decidable equality, and any family of complex matrices LxL_xLx​ on SSS, this defines a map from complex matrices on SSS to complex matrices on XXX by

ΦL(ρ)x,y={Tr⁡(Lxρ),x=y,0,x≠y.\Phi_L(\rho)_{x,y} = \begin{cases} \operatorname{Tr}(L_x\rho),&x=y,\\ 0,&x\ne y. \end{cases}ΦL​(ρ)x,y​={Tr(Lx​ρ),0,​x=y,x=y.​

The trace here is complex-valued. There is no assumption that the LxL_xLx​ are positive semidefinite or sum to the identity, or that ρ\rhoρ is a density matrix; the definition itself asserts no channel property. Empty index types are allowed.

QAlgorithms.Papers.Independent.Extend50.P47.proverValues

For finite index types P,T,SP,T,SP,T,S, with the decidable equality needed on PPP, a complex vector ψ\psiψ indexed by P×SP\times SP×S, and a complex square matrix KKK indexed by T×ST\times ST×S, this definition is the set of real numbers vvv for which there exists a function NNN from matrices indexed by PPP to matrices indexed by TTT having a finite Kraus representation: there exist m∈Nm\in\mathbb Nm∈N and matrices Ej∈CT×PE_j\in\mathbb C^{T\times P}Ej​∈CT×P, 0≤j<m0\le j<m0≤j<m, such that ∑jEj†Ej=IP\sum_jE_j^\dagger E_j=I_P∑j​Ej†​Ej​=IP​ and N(X)=∑jEjXEj†N(X)=\sum_jE_jXE_j^\daggerN(X)=∑j​Ej​XEj†​ for every matrix XXX. The required value is

v=Re⁡tr⁡(K†KY),Y(t,s),(t′,s′)=[N ⁣([ψ(p,s)ψ(q,s′)‾]p,q∈P)]t,t′.v=\operatorname{Re}\operatorname{tr}(K^\dagger KY),\qquad Y_{(t,s),(t',s')} =\left[N\!\left(\bigl[\psi_{(p,s)}\overline{\psi_{(q,s')}}\bigr]_{p,q\in P}\right)\right]_{t,t'}.v=Retr(K†KY),Y(t,s),(t′,s′)​=[N([ψ(p,s)​ψ(q,s′)​​]p,q∈P​)]t,t′​.

No normalization condition on ψ\psiψ or contraction condition on KKK is imposed. The Kraus count m=0m=0m=0 is included, with empty sums interpreted as zero.

QAlgorithms.Papers.Independent.Extend50.P47.pureBipFamily

For index types A,BA,BA,B, a natural number kkk, and a permutation π\piπ of {0,…,k−1}\{0,\ldots,k-1\}{0,…,k−1}, this defines a complex matrix indexed by kkk-tuples of pairs from A×BA\times BA×B, with

Vπ(y,x)={1,(yi)A=(xi)A and (yi)B=(xπ−1(i))B for every i,0,otherwise.V_\pi(y,x)= \begin{cases} 1,&(y_i)_A=(x_i)_A\text{ and }(y_i)_B=(x_{\pi^{-1}(i)})_B \text{ for every }i,\\ 0,&\text{otherwise}. \end{cases}Vπ​(y,x)={1,0,​(yi​)A​=(xi​)A​ and (yi​)B​=(xπ−1(i)​)B​ for every i,otherwise.​

The AAA-coordinates remain at their original positions, while the BBB-coordinates are permuted as displayed. When k=0k=0k=0, both coordinate conditions are vacuous and the unique entry is 111.

QAlgorithms.Papers.Independent.Extend50.P47.qcBlockMatrix

For index types S,XS,XS,X, with decidable equality on XXX, and any family bxb_xbx​ of complex matrices on SSS, this defines a complex matrix BBB on S×XS\times XS×X by

B(s,x),(t,y)={(bx)s,t,x=y,0,x≠y.B_{(s,x),(t,y)} = \begin{cases} (b_x)_{s,t},&x=y,\\ 0,&x\ne y. \end{cases}B(s,x),(t,y)​={(bx​)s,t​,0,​x=y,x=y.​

No positivity, normalization, finiteness, or nonemptiness condition is imposed.

QAlgorithms.Papers.Independent.Extend50.P47.replaceReference

For finite index types R,SR,SR,S, with decidable equality on RRR, and any complex matrix XXX indexed by R×SR\times SR×S, this defines

replaceReference⁡(X)=IR∣R∣⊗(∑r∈RX(r,s),(r,t))s,t∈S.\operatorname{replaceReference}(X) = \frac{I_R}{|R|}\otimes \left(\sum_{r\in R}X_{(r,s),(r,t)}\right)_{s,t\in S}.replaceReference(X)=∣R∣IR​​⊗(r∈R∑​X(r,s),(r,t)​)s,t∈S​.

Thus its ((r,s),(r′,t))((r,s),(r',t))((r,s),(r′,t)) entry is ∣R∣−1δr,r′∑u∈RX(u,s),(u,t)|R|^{-1}\delta_{r,r'}\sum_{u\in R}X_{(u,s),(u,t)}∣R∣−1δr,r′​∑u∈R​X(u,s),(u,t)​. The inverse of ∣R∣|R|∣R∣ is taken in C\mathbb CC, with 0−1=00^{-1}=00−1=0. No positivity or trace normalization of XXX, and no nonemptiness of RRR, is required.

QAlgorithms.Papers.Independent.Extend50.P47.rootValues

For a finite index type SSS with decidable equality, an arbitrary complex matrix ρ\rhoρ on SSS, and an arbitrary predicate QQQ on such matrices, this defines the set of real numbers

{Re⁡tr⁡[f ⁣(f(ρ)σf(ρ))]:σ is a complex matrix on S, Q(σ)},f(A)=cfc⁡(t↦t,A).\left\{\operatorname{Re}\operatorname{tr} \left[f\!\left(f(\rho)\sigma f(\rho)\right)\right]: \sigma\text{ is a complex matrix on }S,\ Q(\sigma)\right\}, \qquad f(A)=\operatorname{cfc}(t\mapsto\sqrt t,A).{Retr[f(f(ρ)σf(ρ))]:σ is a complex matrix on S, Q(σ)},f(A)=cfc(t↦t​,A).

Here cfc⁡\operatorname{cfc}cfc is the total continuous functional calculus, and the real square root is zero on negative inputs. Neither ρ\rhoρ nor σ\sigmaσ is required by this definition to be a density matrix or positive semidefinite. The set can be empty if no matrix satisfies QQQ; if SSS is empty, it is {0}\{0\}{0} when QQQ holds of the unique empty matrix, and otherwise is empty.

QAlgorithms.Papers.Independent.Extend50.P47.schurBlocks

Let UgU_gUg​ be a family of complex matrices on a finite index set SSS, and let EEE provide a natural number ccc, positive multiplicities mjm_jmj​, positive dimensions djd_jdj​, unitary families Rj(g)R_j(g)Rj​(g), and a unitary matrix W:⨁j(Cmj⊗Cdj)→CSW:\bigoplus_j(\mathbb C^{m_j}\otimes\mathbb C^{d_j})\to\mathbb C^SW:⨁j​(Cmj​⊗Cdj​)→CS, with Ug=W(⨁jImj⊗Rj(g))W†U_g=W(\bigoplus_j I_{m_j}\otimes R_j(g))W^\daggerUg​=W(⨁j​Imj​​⊗Rj​(g))W†. These families have only zero and identity as commuting Hermitian idempotents, and distinct families admit no intertwiner that is unitary on both sides. For any complex matrix ρ\rhoρ on SSS and any block index 0≤l<c0\le l<c0≤l<c, this definition takes the l,ll,ll,l diagonal block of W†ρWW^\dagger\rho WW†ρW and traces out its dld_ldl​-dimensional factor. Explicitly, its ml×mlm_l\times m_lml​×ml​ output has entries

(schurBlocks⁡(E,ρ,l))a,b=∑h=0dl−1(W†ρW)(l,(a,h)),(l,(b,h)).\bigl(\operatorname{schurBlocks}(E,\rho,l)\bigr)_{a,b} =\sum_{h=0}^{d_l-1} (W^\dagger\rho W)_{(l,(a,h)),(l,(b,h))}.(schurBlocks(E,ρ,l))a,b​=h=0∑dl​−1​(W†ρW)(l,(a,h)),(l,(b,h))​.

The input ρ\rhoρ need not be positive, Hermitian, or normalized; if c=0c=0c=0, there is no possible block index lll.

QAlgorithms.Papers.Independent.Extend50.P47.seTest

For a finite index type GGG, index types R,SR,SR,S, and any family UgU_gUg​ of complex matrices indexed by R×SR\times SR×S, this defines a matrix indexed by (R×(R×S))×S(R\times(R\times S))\times S(R×(R×S))×S. It averages Ug⊗Ug‾U_g\otimes\overline{U_g}Ug​⊗Ug​​ and reindexes a basis label ((r,(r′,s′)),s)((r,(r',s')),s)((r,(r′,s′)),s) as ((r,s),(r′,s′))((r,s),(r',s'))((r,s),(r′,s′)). Consequently,

seTest⁡(U)((r,(r′,s′)),s), ((u,(u′,t′)),t)=∣G∣−1∑g∈G(Ug)(r,s),(u,t) (Ug)(r′,s′),(u′,t′)‾.\operatorname{seTest}(U)_{((r,(r',s')),s),\,((u,(u',t')),t)} = |G|^{-1}\sum_{g\in G} (U_g)_{(r,s),(u,t)} \,\overline{(U_g)_{(r',s'),(u',t')}}.seTest(U)((r,(r′,s′)),s),((u,(u′,t′)),t)​=∣G∣−1g∈G∑​(Ug​)(r,s),(u,t)​(Ug​)(r′,s′),(u′,t′)​​.

No unitarity or representation property is assumed. An empty GGG gives the zero matrix.

QAlgorithms.Papers.Independent.Extend50.P47.separableExtension

For index types A,BA,BA,B, a finite type XXX, arbitrary real weights pxp_xpx​, vectors ax∈CAa_x\in\mathbb C^Aax​∈CA and bx∈CBb_x\in\mathbb C^Bbx​∈CB, and any natural number nnn, this defines a matrix on Bn×(A×B)B^n\times(A\times B)Bn×(A×B) as follows. For indices y=(c,u,c0)y=(\mathbf c,u,c_0)y=(c,u,c0​) and z=(d,v,d0)z=(\mathbf d,v,d_0)z=(d,v,d0​), set c^0=c0, c^i+1=ci\widehat c_0=c_0,\ \widehat c_{i+1}=\mathbf c_ic0​=c0​, ci+1​=ci​ and d^0=d0, d^i+1=di\widehat d_0=d_0,\ \widehat d_{i+1}=\mathbf d_id0​=d0​, di+1​=di​; then

Ωy,z=∑x∈Xpx ax(u)ax(v)‾∏i=0nbx(c^i)bx(d^i)‾.\Omega_{y,z} =\sum_{x\in X}p_x\,a_x(u)\overline{a_x(v)} \prod_{i=0}^{n}b_x(\widehat c_i)\overline{b_x(\widehat d_i)}.Ωy,z​=x∈X∑​px​ax​(u)ax​(v)​i=0∏n​bx​(ci​)bx​(di​)​.

There are no assumptions that the weights are nonnegative or sum to 111, or that the vectors are normalized. If XXX is empty, the matrix is zero. When n=0n=0n=0, the product still contains the distinguished BBB-coordinate, so Ω=∑xpx∣ax⟩⟨ax∣⊗∣bx⟩⟨bx∣\Omega=\sum_xp_x|a_x\rangle\langle a_x|\otimes|b_x\rangle\langle b_x|Ω=∑x​px​∣ax​⟩⟨ax​∣⊗∣bx​⟩⟨bx​∣.

QAlgorithms.Papers.Independent.Extend50.P47.standardCircuit

For every natural number nnn and every finite list c=[s1,…,sℓ]c=[s_1,\ldots,s_\ell]c=[s1​,…,sℓ​] of instructions on nnn wires, this defines the complex matrix

Circuit⁡(c)=Msℓ⋯Ms1\operatorname{Circuit}(c)=M_{s_\ell}\cdots M_{s_1}Circuit(c)=Msℓ​​⋯Ms1​​

indexed by nnn-bit strings, with the empty list giving the identity matrix. The instruction matrices apply H=12(111−1)H=\frac1{\sqrt2}\left(\begin{smallmatrix}1&1\\1&-1\end{smallmatrix}\right)H=2​1​(11​1−1​), T=diag⁡(1,eiπ/4)T=\operatorname{diag}(1,e^{i\pi/4})T=diag(1,eiπ/4), or T†T^\daggerT† at the specified wire for instructions h,t,tdh,t,tdh,t,td, respectively, with entries zero unless all other bits agree; a cx(w)cx(w)cx(w) instruction, for an injection w:{0,1}↪{0,…,n−1}w:\{0,1\}\hookrightarrow\{0,\ldots,n-1\}w:{0,1}↪{0,…,n−1}, has entry 111 exactly when the output preserves all bits except that the bit at w(1)w(1)w(1) becomes the exclusive-or of the input bits at w(1)w(1)w(1) and w(0)w(0)w(0), and has entry 000 otherwise. When n=0n=0n=0, only the empty instruction list exists, and its matrix is the identity on the singleton set of empty bit strings.

QAlgorithms.Papers.Independent.Extend50.P47.standardStepOperator

For every natural number nnn, this assigns to each instruction a complex matrix whose rows and columns are indexed by nnn-bit strings y,z:{0,…,n−1}→{false,true}y,z:\{0,\ldots,n-1\}\to\{\mathrm{false},\mathrm{true}\}y,z:{0,…,n−1}→{false,true}. For a one-wire instruction at qqq, its entry is 000 unless ya=zay_a=z_aya​=za​ for every a≠qa\ne qa=q; otherwise it is Myq,zqM_{y_q,z_q}Myq​,zq​​, where M=HM=HM=H for h(q)h(q)h(q), M=TM=TM=T for t(q)t(q)t(q), and M=T†M=T^\daggerM=T† for td(q)td(q)td(q), with

H=12(111−1),T=(100eiπ/4)H=\frac1{\sqrt2}\begin{pmatrix}1&1\\1&-1\end{pmatrix}, \qquad T=\begin{pmatrix}1&0\\0&e^{i\pi/4}\end{pmatrix}H=2​1​(11​1−1​),T=(10​0eiπ/4​)

in the order (false,true)(\mathrm{false},\mathrm{true})(false,true). For cx(w)cx(w)cx(w), where w:{0,1}↪{0,…,n−1}w:\{0,1\}\hookrightarrow\{0,\ldots,n-1\}w:{0,1}↪{0,…,n−1} is injective, the entry is 111 precisely when ya=zay_a=z_aya​=za​ outside the image of www, yw(0)=zw(0)y_{w(0)}=z_{w(0)}yw(0)​=zw(0)​, and yw(1)=zw(1)⊕zw(0)y_{w(1)}=z_{w(1)}\mathbin{\oplus}z_{w(0)}yw(1)​=zw(1)​⊕zw(0)​, and is 000 otherwise. Here ⊕\oplus⊕ denotes Boolean exclusive-or. There is no instruction argument when n=0n=0n=0.

QAlgorithms.Papers.Independent.Extend50.P47.stateSDP

For a finite index type SSS with the required decidable equality, an arbitrary complex matrix ρ\rhoρ on SSS, and an arbitrary predicate QQQ on such matrices, this defines the set

{Re⁡tr⁡X:X,σ∈CS×S, σ⪰0, tr⁡σ=1, Q(σ), (ρX†Xσ)⪰0}.\left\{\operatorname{Re}\operatorname{tr}X: X,\sigma\in\mathbb C^{S\times S},\ \sigma\succeq0,\ \operatorname{tr}\sigma=1,\ Q(\sigma),\ \begin{pmatrix}\rho&X^\dagger\\ X&\sigma\end{pmatrix}\succeq0 \right\}.{RetrX:X,σ∈CS×S, σ⪰0, trσ=1, Q(σ), (ρX​X†σ​)⪰0}.

The trace equation is a complex equality. No hypothesis on ρ\rhoρ is imposed in the definition, and XXX need not itself be Hermitian or positive semidefinite. Infeasible constraints give the empty set; in particular, the set is empty when SSS is empty because then every matrix has trace zero.

QAlgorithms.Papers.Independent.Extend50.P47.symTest

For a finite index type GGG, an index type SSS, and any family Ug∈CS×SU_g\in\mathbb C^{S\times S}Ug​∈CS×S, this defines a matrix on S×SS\times SS×S by averaging Ug⊗Ug‾U_g\otimes\overline{U_g}Ug​⊗Ug​​ and swapping the two factors in both matrix indices. Explicitly,

symTest⁡(U)(s1,s2),(t1,t2)=∣G∣−1∑g∈G(Ug)s2,t2 (Ug)s1,t1‾.\operatorname{symTest}(U)_{(s_1,s_2),(t_1,t_2)} = |G|^{-1}\sum_{g\in G} (U_g)_{s_2,t_2}\,\overline{(U_g)_{s_1,t_1}}.symTest(U)(s1​,s2​),(t1​,t2​)​=∣G∣−1g∈G∑​(Ug​)s2​,t2​​(Ug​)s1​,t1​​​.

The inverse of ∣G∣|G|∣G∣ is taken in C\mathbb CC. No unitarity or representation property of UUU is required. If GGG is empty, the average is the zero matrix, using 0−1=00^{-1}=00−1=0.

QAlgorithms.Papers.Independent.Extend50.P47.symmetryControlAverage

For a finite indexing type GGG and a family UgU_gUg​ of complex square matrices indexed by SSS, this definition returns the matrix

1∣G∣∑g∈GUg.\frac{1}{|G|}\sum_{g\in G}U_g.∣G∣1​g∈G∑​Ug​.

There are no conditions on the matrices UgU_gUg​. If GGG is empty, the sum and the result are zero, using the convention 0−1=00^{-1}=00−1=0.

QAlgorithms.Papers.Independent.Extend50.P47.symmetryFidelityValues

For a finite index type SSS with decidable equality, an arbitrary complex square matrix ρ\rhoρ indexed by SSS, and an arbitrary predicate QQQ on such matrices, this definition is the set

{(Re⁡tr⁡C⋅ ⁣(C⋅(ρ) σ C⋅(ρ)))2  |  Q(σ)},\left\{ \left(\operatorname{Re}\operatorname{tr} \mathcal C_{\sqrt{\cdot}}\!\left( \mathcal C_{\sqrt{\cdot}}(\rho)\,\sigma\, \mathcal C_{\sqrt{\cdot}}(\rho) \right)\right)^2 \;\middle|\; Q(\sigma) \right\},{(RetrC⋅​​(C⋅​​(ρ)σC⋅​​(ρ)))2​Q(σ)},

where C⋅\mathcal C_{\sqrt{\cdot}}C⋅​​ denotes the real continuous functional calculus for the real square-root function, using its total convention when its applicability conditions fail. Neither ρ\rhoρ nor the matrices σ\sigmaσ satisfying QQQ are separately required to be density matrices. If no matrix satisfies QQQ, this set is empty.

QAlgorithms.Papers.Independent.Extend50.P47.symmetryTensorCopies

For an index type SSS, a complex matrix ρ\rhoρ indexed by SSS, and any natural number kkk, this defines a matrix indexed by functions {0,…,k−1}→S\{0,\ldots,k-1\}\to S{0,…,k−1}→S, with entries

(ρ⊗k)x,y=∏i=0k−1ρxi,yi.(\rho^{\otimes k})_{x,y}=\prod_{i=0}^{k-1}\rho_{x_i,y_i}.(ρ⊗k)x,y​=i=0∏k−1​ρxi​,yi​​.

No positivity, trace, or normalization condition is imposed on ρ\rhoρ. When k=0k=0k=0, the indexing type contains the unique empty function and the single matrix entry is the empty product 111.

QAlgorithms.Papers.Independent.Extend50.P47.tensorSymmetrizer

For any finite type SSS with decidable equality and any natural number kkk, this defines the complex matrix on SkS^kSk

QS,k=1k!∑π∈Sym⁡(k)Pπ,Pπ(y,x)={1,yi=xπ−1(i) for all i,0,otherwise.Q_{S,k}=\frac1{k!}\sum_{\pi\in\operatorname{Sym}(k)}P_\pi, \qquad P_\pi(y,x)= \begin{cases} 1,&y_i=x_{\pi^{-1}(i)}\text{ for all }i,\\ 0,&\text{otherwise}. \end{cases}QS,k​=k!1​π∈Sym(k)∑​Pπ​,Pπ​(y,x)={1,0,​yi​=xπ−1(i)​ for all i,otherwise.​

Thus its entries are the averages of these explicitly specified permutation-matrix entries. The definition includes k=0k=0k=0, when QS,0=[1]Q_{S,0}=[1]QS,0​=[1], and includes empty SSS.

QAlgorithms.Papers.Independent.Extend50.P47.twelveRotations

In the ordered Boolean basis (false,true)(\mathrm{false},\mathrm{true})(false,true), put

X=(0110),Y=(0−ii0),Z=(100−1),X=\begin{pmatrix}0&1\\1&0\end{pmatrix},\qquad Y=\begin{pmatrix}0&-i\\i&0\end{pmatrix},\qquad Z=\begin{pmatrix}1&0\\0&-1\end{pmatrix},X=(01​10​),Y=(0i​−i0​),Z=(10​0−1​),

and define x=((I+iX)/2)⊗((I+iX)/2)x=((I+iX)/\sqrt2)\otimes((I+iX)/\sqrt2)x=((I+iX)/2​)⊗((I+iX)/2​), y=((I+iY)/2)⊗((I+iY)/2)y=((I+iY)/\sqrt2)\otimes((I+iY)/\sqrt2)y=((I+iY)/2​)⊗((I+iY)/2​), and z=((I+iZ)/2)⊗((I+iZ)/2)z=((I+iZ)/\sqrt2)\otimes((I+iZ)/\sqrt2)z=((I+iZ)/2​)⊗((I+iZ)/2​). This definition returns the following ordered list of twelve matrices on Boolean pairs:

[ I, xx, yy, zz, xy, yz, zx, yx, xyxy, yzyz, zxzx, yxyx ].[\,I,\ xx,\ yy,\ zz,\ xy,\ yz,\ zx,\ yx,\ xyxy,\ yzyz,\ zxzx,\ yxyx\,].[I, xx, yy, zz, xy, yz, zx, yx, xyxy, yzyz, zxzx, yxyx].

All products are matrix products in the displayed order; the definition specifies a list and makes no distinctness assertion about its entries.

QAlgorithms.Papers.Independent.Extend50.P47.weightProjector

For every pair of natural numbers n,kn,kn,k, weightProjector⁡(n,k)\operatorname{weightProjector}(n,k)weightProjector(n,k) is the complex matrix indexed by Boolean strings of length nnn whose entries are

Dn,k(x,y)={1,x=y and exactly k coordinates of x are true,0,otherwise.D_{n,k}(x,y)= \begin{cases} 1,&x=y\ \text{and exactly }k\text{ coordinates of }x\text{ are true},\\ 0,&\text{otherwise}. \end{cases}Dn,k​(x,y)={1,0,​x=y and exactly k coordinates of x are true,otherwise.​

In particular, it is zero when k>nk>nk>n; for n=0n=0n=0, it is the one-dimensional identity when k=0k=0k=0 and zero otherwise.

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

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 30, 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