Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Definitions for Which Quantum Evolutions Can Be Reversed by Local Unitary Operations? Algebraic Classification and Gradient-Flow-Based Numerical Checks

Definition
QAlgorithms_Papers_Independent_Intake100_P95

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

prove2quantum

The objects the formalized statements of Which Quantum Evolutions Can Be Reversed by Local Unitary Operations? Algebraic Classification and Gradient-Flow-Based Numerical Checks (arXiv:quant-ph/0610061) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • LocalSU
  • localMatrix: The actual local special-unitary matrix, PDF p.3.
  • adjointConjugation: Conjugation, specialized to unitaries whenever inverse means dagger.
  • localAd: Local adjoint action, PDF pp.3–4.
  • IsHamiltonian: Hermitian traceless Hamiltonian, iH in su(2^n); PDF p.3.
  • TypeI: One local K precedes the universal time quantifier; PDF pp.2,4.
  • embeddedPauli: A single embedded Pauli matrix, identities at all other positions; (27).
  • IsLocalHamiltonian: Hermitian local generators, identified with the skew algebra by -i; p.3.
  • CentralizerPerp: Intrinsic real orthocomplement of the traceless Hermitian centralizer; PDF p.3, (6)–(8), interpreted through the Hermitian/skew identification.
  • productEigenoperator: Tensor outer products of one-qubit eigenvectors; PDF p.4.
  • productEigenvalue: Exact product eigenvalue, including all branch choices in (23).
  • SelectedPairs: The genuinely selected -1 branch, not the erroneous subtype unions.
  • collectiveZ: Collective F_z=sum Z_l/2, (27), (34), (86).
  • individualZRotation: Independent local z angles, (38).
  • jointZ: Joint z-rotation, (35).
  • OddPi: Odd-pi congruence uses integer lifts, with no real-modulo convention.
  • HasOrder: Quantum order through the commutator in (32).
  • tensorFactor: 1, J_z, J_+, J_- from (32),(37); raising is (X+iY)/2.
  • factorOrder: Orders of 1,J_z,J_+,J_- are 0,0,+1,-1.
  • tensorMonomial: Tensor monomial (37), not necessarily Hermitian.
  • tensorOperatorSum: Linear combinations in (40) may have repeated terms or zero coefficients.
  • orderMatrix: Real order matrix in (40).
  • supportComponent: Canonical full Pauli expansion grouped by exact support; (28).
  • xyz: Two-qubit diagonal interaction a XX+b YY+c ZZ, (24).
  • axisPulse: Axis pulse exp(-i theta sigma_axis/2), Table II.
  • pairPauli: Pair Pauli embedding, identities on all remaining qubits; (25),(26).
  • couplingGraph: Real couplings are specified only for k<l; adjacency ignores unused entries.
  • BipartiteCouplings: Bipartiteness by a two-coloring; weights may be positive or negative.
  • isingZZ: Ising coupling Hamiltonian, including the source's pi/2 factor, (25).
  • networkXY: Uniform anisotropy kappa, endpoints included; (26).
  • entryOrder: Row Z/2 weight minus column Z/2 weight, fixing the sign in (45),(50).
  • matrixUnitSum: Linear combination of matrix units (51).
  • torus: Weyl-torus representative; the angles sum to zero at use, (47).
  • concurrenceInvolution: The concurrence Cartan involution (57), including conjugation.
  • distanceSq: Squared distance objective; no default matrix norm, (63).
  • reversalOverlap: Negative real trace overlap to maximize, (64).
  • toLocalIndex: Basis relabelling Bool to Fin 2 for the accepted local Lie algebra, PDF p.11. No wire order is changed.
  • fromLocalIndex: Inverse basis relabelling, PDF p.11.
  • localSkewProjection: The accepted real Hilbert--Schmidt local projection with only a basis relabelling; PDF p.11, (65). The accepted Y-generator has opposite sign, which cancels between its real coefficient and generator.
  • localNumericalRange: Formula (69), for arbitrary complex A,C.
  • realVec: Column-stacked real and imaginary coordinates, (71).
  • realRepresentation: Real representation of a complex-linear superoperator, (75).
  • adjoiningReal: Real matrix of adjoining, diag(transpose,-transpose), (72)–(74).
  • twoSidedDistanceSq: Two-sided distance, testing all local pairs, (4),(80).
  • twoSidedObjective: The minimization objective in (81), with its printed minus sign.
Definition code
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Gates
import Definitions.Def_QAlgorithms_Defs_BinaryStabilizer
import Definitions.Def_QAlgorithms_Papers_Independent_Advance50_P38
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P10
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P32
import Definitions.Def_QAlgorithms_Papers_Independent_Claimed50_P03
import Definitions.Def_QAlgorithms_Papers_Independent_Next46_P21

/-! Statements from quant-ph/0610061v1. Qubit 0 is the most significant bit.
All norms explicitly called `frobNorm` are Frobenius norms. Local operations
are products of independent SU(2) factors, with no wire permutations.
Theorems are statements only; compilation is delegated to the batch worker. -/

namespace QAlgorithms.Papers.Independent.Intake100.P95

open scoped BigOperators

open QAlgorithms.Papers.Independent.Information100.P32 (Op evolution)
open QAlgorithms.Papers.Independent.Advance50.P38 (comm realHSPairing)
open QAlgorithms.Papers.Independent.Information100.P10 (pauli)
open QAlgorithms.Papers.Independent.Claimed50.P03 (wordMatrix wordSupport)

noncomputable section

abbrev LocalSU (n : ℕ) := Fin n → Matrix.specialUnitaryGroup Bool ℂ

/-- The actual local special-unitary matrix, PDF p.3. -/
def localMatrix {n : ℕ} (K : LocalSU n) : Op (QAlgorithms.Qubits n) :=
  QAlgorithms.kronAll (fun l => (K l : Matrix Bool Bool ℂ))

/-- Conjugation, specialized to unitaries whenever inverse means dagger. -/
def adjointConjugation {ι : Type*} [Fintype ι] (K A : Matrix ι ι ℂ) :=
  K * A * K.conjTranspose

/-- Local adjoint action, PDF pp.3–4. -/
def localAd {n : ℕ} (K : LocalSU n) (A : Op (QAlgorithms.Qubits n)) : Op (QAlgorithms.Qubits n) :=
  adjointConjugation (localMatrix K) A

/-- Hermitian traceless Hamiltonian, iH in su(2^n); PDF p.3. -/
def IsHamiltonian {n : ℕ} (H : Op (QAlgorithms.Qubits n)) : Prop :=
  H.IsHermitian ∧ Matrix.trace H = 0

/-- One local K precedes the universal time quantifier; PDF pp.2,4. -/
def TypeI {n : ℕ} (H : Op (QAlgorithms.Qubits n)) : Prop :=
  ∃ K : LocalSU n, ∀ t : ℝ, localAd K (evolution H t) = evolution H (-t)

/-- A single embedded Pauli matrix, identities at all other positions; (27). -/
def embeddedPauli {n : ℕ} (k : Fin n) (a : Fin 3) : Op (QAlgorithms.Qubits n) :=
  QAlgorithms.kronAll (fun l => if l = k then pauli a else 1)

/-- Hermitian local generators, identified with the skew algebra by -i; p.3. -/
def IsLocalHamiltonian {n : ℕ} (k : Op (QAlgorithms.Qubits n)) : Prop :=
  ∃ c : Fin n → Fin 3 → ℝ, k = ∑ l, ∑ a, (c l a : ℂ) • embeddedPauli l a

/-- Intrinsic real orthocomplement of the traceless Hermitian centralizer;
PDF p.3, (6)–(8), interpreted through the Hermitian/skew identification. -/
def CentralizerPerp {n : ℕ} (H k : Op (QAlgorithms.Qubits n)) : Prop :=
  ∀ A : Op (QAlgorithms.Qubits n), IsHamiltonian A → comm A H = 0 → realHSPairing k A = 0

/-- Tensor outer products of one-qubit eigenvectors; PDF p.4. -/
def productEigenoperator {n : ℕ} (V : Fin n → Matrix.unitaryGroup Bool ℂ)
    (a b : QAlgorithms.Qubits n) : Op (QAlgorithms.Qubits n) :=
  fun i j =>
    QAlgorithms.kronAll (fun l => (V l : Matrix Bool Bool ℂ)) i a *
      star (QAlgorithms.kronAll (fun l => (V l : Matrix Bool Bool ℂ)) j b)

/-- Exact product eigenvalue, including all branch choices in (23). -/
def productEigenvalue {n : ℕ} (lam : Fin n → Bool → ℂ)
    (a b : QAlgorithms.Qubits n) : ℂ :=
  ∏ l, lam l (a l) * star (lam l (b l))

/-- The genuinely selected -1 branch, not the erroneous subtype unions. -/
def SelectedPairs {n : ℕ} (lam : Fin n → Bool → ℂ) :=
  {q : QAlgorithms.Qubits n × QAlgorithms.Qubits n //
    productEigenvalue lam q.1 q.2 = -1}

/-- Collective F_z=sum Z_l/2, (27), (34), (86). -/
def collectiveZ (n : ℕ) : Op (QAlgorithms.Qubits n) :=
  (1 / 2 : ℂ) • ∑ k : Fin n, embeddedPauli k 2

/-- Independent local z angles, (38). -/
def individualZRotation {n : ℕ} (phi : Fin n → ℝ) : Op (QAlgorithms.Qubits n) :=
  QAlgorithms.kronAll (fun l => QAlgorithms.Papers.Independent.Next46.P21.zRotation (phi l))

/-- Joint z-rotation, (35). -/
def jointZ (n : ℕ) (phi : ℝ) : Op (QAlgorithms.Qubits n) := individualZRotation (fun _ => phi)

/-- Odd-pi congruence uses integer lifts, with no real-modulo convention. -/
def OddPi (x : ℝ) : Prop := ∃ z : ℤ, x = (2 * (z : ℝ) + 1) * Real.pi

/-- Quantum order through the commutator in (32). -/
def HasOrder {n : ℕ} (T : Op (QAlgorithms.Qubits n)) (p : ℤ) : Prop :=
  comm (collectiveZ n) T = (p : ℂ) • T

/-- 1, J_z, J_+, J_- from (32),(37); raising is (X+iY)/2. -/
def tensorFactor (nu : Fin 4) : Matrix Bool Bool ℂ :=
  if nu = 0 then 1
  else if nu = 1 then (1 / 2 : ℂ) • QAlgorithms.pauliZ
  else if nu = 2 then (1 / 2 : ℂ) • (QAlgorithms.pauliX + Complex.I • QAlgorithms.pauliY)
  else (1 / 2 : ℂ) • (QAlgorithms.pauliX - Complex.I • QAlgorithms.pauliY)

/-- Orders of 1,J_z,J_+,J_- are 0,0,+1,-1. -/
def factorOrder (nu : Fin 4) : ℤ := if nu = 2 then 1 else if nu = 3 then -1 else 0

/-- Tensor monomial (37), not necessarily Hermitian. -/
def tensorMonomial {n : ℕ} (nu : Fin n → Fin 4) : Op (QAlgorithms.Qubits n) := QAlgorithms.kronAll (fun l => tensorFactor (nu l))

/-- Linear combinations in (40) may have repeated terms or zero coefficients. -/
def tensorOperatorSum {n m : ℕ} (nu : Fin m → Fin n → Fin 4) (c : Fin m → ℂ) : Op (QAlgorithms.Qubits n) :=
  ∑ a, c a • tensorMonomial (nu a)

/-- Real order matrix in (40). -/
def orderMatrix {n m : ℕ} (nu : Fin m → Fin n → Fin 4) : Matrix (Fin m) (Fin n) ℝ :=
  fun a l => (factorOrder (nu a l) : ℝ)

/-- Canonical full Pauli expansion grouped by exact support; (28). -/
def supportComponent {n : ℕ} (H : Op (QAlgorithms.Qubits n)) (S : Finset (Fin n)) : Op (QAlgorithms.Qubits n) :=
  ∑ s : Fin n → Fin 4, if wordSupport s = S then
    (((2 : ℂ) ^ n)⁻¹ * Matrix.trace ((wordMatrix s).conjTranspose * H)) • wordMatrix s
  else 0

/-- Two-qubit diagonal interaction a XX+b YY+c ZZ, (24). -/
def xyz (a b c : ℝ) : Op (QAlgorithms.Qubits 2) :=
  (a : ℂ) • QAlgorithms.kronAll (fun _ => QAlgorithms.pauliX) +
  (b : ℂ) • QAlgorithms.kronAll (fun _ => QAlgorithms.pauliY) +
  (c : ℂ) • QAlgorithms.kronAll (fun _ => QAlgorithms.pauliZ)

/-- Axis pulse exp(-i theta sigma_axis/2), Table II. -/
def axisPulse {n : ℕ} (a : Fin 3) (phi : Fin n → ℝ) : Op (QAlgorithms.Qubits n) :=
  QAlgorithms.kronAll (fun l => NormedSpace.exp ((-Complex.I * (phi l : ℂ) / 2) • pauli a))

/-- Pair Pauli embedding, identities on all remaining qubits; (25),(26). -/
def pairPauli {n : ℕ} (i j : Fin n) (a : Fin 3) : Op (QAlgorithms.Qubits n) :=
  QAlgorithms.kronAll (fun l => if l = i ∨ l = j then pauli a else 1)

/-- Real couplings are specified only for k<l; adjacency ignores unused entries. -/
def couplingGraph {n : ℕ} (J : Fin n → Fin n → ℝ) : SimpleGraph (Fin n) where
  Adj i j := i ≠ j ∧ J (min i j) (max i j) ≠ 0
  symm := ⟨by
    intro i j h
    exact ⟨h.1.symm, by simpa [min_comm, max_comm] using h.2⟩⟩
  loopless := ⟨by
    intro i h
    exact h.1 rfl⟩

/-- Bipartiteness by a two-coloring; weights may be positive or negative. -/
def BipartiteCouplings {n : ℕ} (J : Fin n → Fin n → ℝ) : Prop :=
  ∃ color : Fin n → Bool, ∀ i j, (couplingGraph J).Adj i j → color i ≠ color j

/-- Ising coupling Hamiltonian, including the source's pi/2 factor, (25). -/
def isingZZ {n : ℕ} (J : Fin n → Fin n → ℝ) : Op (QAlgorithms.Qubits n) :=
  (Real.pi / 2 : ℂ) • ∑ i, ∑ j, if i < j then (J i j : ℂ) • pairPauli i j 2 else 0

/-- Uniform anisotropy kappa, endpoints included; (26). -/
def networkXY {n : ℕ} (J : Fin n → Fin n → ℝ) (kappa : ℝ) : Op (QAlgorithms.Qubits n) :=
  (Real.pi / 2 : ℂ) • ∑ i, ∑ j, if i < j then
    (J i j : ℂ) • (pairPauli i j 0 + (kappa : ℂ) • pairPauli i j 1) else 0

/-- Row Z/2 weight minus column Z/2 weight, fixing the sign in (45),(50). -/
def entryOrder {n : ℕ} (i j : QAlgorithms.Qubits n) (l : Fin n) : ℝ :=
  (if i l then (-1 / 2 : ℝ) else 1 / 2) - (if j l then (-1 / 2 : ℝ) else 1 / 2)

/-- Linear combination of matrix units (51). -/
def matrixUnitSum {n m : ℕ} (i j : Fin m → QAlgorithms.Qubits n) (c : Fin m → ℂ) : Op (QAlgorithms.Qubits n) :=
  ∑ a, c a • Matrix.single (i a) (j a) (1 : ℂ)

/-- Weyl-torus representative; the angles sum to zero at use, (47). -/
def torus {n : ℕ} (theta : QAlgorithms.Qubits n → ℝ) : Op (QAlgorithms.Qubits n) :=
  Matrix.diagonal (fun i => Complex.exp (-Complex.I * (theta i : ℂ)))

/-- The concurrence Cartan involution (57), including conjugation. -/
def concurrenceInvolution {n : ℕ} (A : Op (QAlgorithms.Qubits n)) : Op (QAlgorithms.Qubits n) :=
  adjointConjugation (QAlgorithms.kronAll (fun _ => (-Complex.I) • QAlgorithms.pauliY)) (fun i j => star (A i j))

/-- Squared distance objective; no default matrix norm, (63). -/
def distanceSq {n : ℕ} (H : Op (QAlgorithms.Qubits n)) (K : LocalSU n) : ℝ :=
  QAlgorithms.frobNorm (localAd K H + H) ^ 2

/-- Negative real trace overlap to maximize, (64). -/
def reversalOverlap {n : ℕ} (H : Op (QAlgorithms.Qubits n)) (K : Op (QAlgorithms.Qubits n)) : ℝ :=
  QAlgorithms.Papers.Independent.Advance50.P38.realTraceOverlap H (-H) K

/-- Basis relabelling Bool to Fin 2 for the accepted local Lie algebra, PDF p.11.
No wire order is changed. -/
def toLocalIndex {n : ℕ} (A : Op (QAlgorithms.Qubits n)) :
    Matrix (QAlgorithms.Papers.Independent.Advance50.P38.LocalQubitIndex n)
      (QAlgorithms.Papers.Independent.Advance50.P38.LocalQubitIndex n) ℂ :=
  fun i j => A (fun l => finTwoEquiv (i l)) (fun l => finTwoEquiv (j l))

/-- Inverse basis relabelling, PDF p.11. -/
def fromLocalIndex {n : ℕ}
    (A : Matrix (QAlgorithms.Papers.Independent.Advance50.P38.LocalQubitIndex n)
      (QAlgorithms.Papers.Independent.Advance50.P38.LocalQubitIndex n) ℂ) :
    Op (QAlgorithms.Qubits n) :=
  fun i j => A (fun l => finTwoEquiv.symm (i l)) (fun l => finTwoEquiv.symm (j l))

/-- The accepted real Hilbert--Schmidt local projection with only a basis relabelling;
PDF p.11, (65). The accepted Y-generator has opposite sign, which cancels
between its real coefficient and generator. -/
def localSkewProjection {n : ℕ} (A : Op (QAlgorithms.Qubits n)) :
    Op (QAlgorithms.Qubits n) :=
  fromLocalIndex (QAlgorithms.Papers.Independent.Advance50.P38.localProjection (toLocalIndex A))

example {n : ℕ} (A : Op (QAlgorithms.Qubits n)) :
    fromLocalIndex (toLocalIndex A) = A := by
  ext i j
  simp [fromLocalIndex, toLocalIndex]

example {n : ℕ} : localSkewProjection (0 : Op (QAlgorithms.Qubits n)) = 0 := by
  have hzero : toLocalIndex (0 : Op (QAlgorithms.Qubits n)) = 0 := rfl
  unfold localSkewProjection
  rw [hzero]
  simp only [QAlgorithms.Papers.Independent.Advance50.P38.localProjection,
    QAlgorithms.Papers.Independent.Advance50.P38.realHSPairing,
    Matrix.conjTranspose_zero, zero_mul, Matrix.trace_zero, Complex.zero_re,
    zero_smul, Finset.sum_const_zero, smul_zero]
  rfl

/-- Formula (69), for arbitrary complex A,C. -/
def localNumericalRange {n : ℕ} (C A : Op (QAlgorithms.Qubits n)) : Set ℂ :=
  Set.range (fun K : LocalSU n => Matrix.trace (C.conjTranspose * localAd K A))

/-- Column-stacked real and imaginary coordinates, (71). -/
def realVec {ι : Type*} (A : Matrix ι ι ℂ) : Bool × (ι × ι) → ℝ :=
  fun q => if q.1 then (Matrix.vec A q.2).im else (Matrix.vec A q.2).re

/-- Real representation of a complex-linear superoperator, (75). -/
def realRepresentation {ι : Type*} (B : Matrix ι ι ℂ) :
    Matrix (Bool × ι) (Bool × ι) ℝ :=
  fun i j => if i.1 then (if j.1 then (B i.2 j.2).re else (B i.2 j.2).im)
    else (if j.1 then -(B i.2 j.2).im else (B i.2 j.2).re)

/-- Real matrix of adjoining, diag(transpose,-transpose), (72)–(74). -/
def adjoiningReal {ι : Type*} [DecidableEq ι] :
    Matrix (Bool × (ι × ι)) (Bool × (ι × ι)) ℝ :=
  fun i j => if i.1 = j.1 ∧ i.2.1 = j.2.2 ∧ i.2.2 = j.2.1
    then (if i.1 then -1 else 1) else 0

/-- Two-sided distance, testing all local pairs, (4),(80). -/
def twoSidedDistanceSq {n : ℕ} (U : Op (QAlgorithms.Qubits n)) (K L : LocalSU n) : ℝ :=
  QAlgorithms.frobNorm (localMatrix K * U * localMatrix L - U.conjTranspose) ^ 2

/-- The minimization objective in (81), with its printed minus sign. -/
def twoSidedObjective {n : ℕ} (U : Op (QAlgorithms.Qubits n)) (K L : LocalSU n) : ℝ :=
  -(Matrix.trace (localMatrix K * U * localMatrix L * U)).re

example : tensorFactor 2 false true = 1 := by
  change (1 / 2 : ℂ) * (1 + Complex.I * (-Complex.I)) = 1
  norm_num [mul_neg, Complex.I_mul_I]

example : factorOrder 2 = 1 ∧ factorOrder 3 = -1 := by
  constructor <;> rfl

example {n : ℕ} : tensorOperatorSum (fun _ : Fin 0 => fun _ : Fin n => (0 : Fin 4))
    (fun a : Fin 0 => Fin.elim0 a) = 0 := by
  simp [tensorOperatorSum]

example (x : ℂ) : realRepresentation (fun _ _ : Unit => x)
    (false, ()) (true, ()) = -x.im := rfl

example (J : Fin 1 → Fin 1 → ℝ) : isingZZ J = 0 := by
  simp [isingZZ]

example {n : ℕ} (H : Op (QAlgorithms.Qubits n)) : evolution H 0 = 1 := by
  simp [evolution]

example (i j : QAlgorithms.Qubits 0) : QAlgorithms.kronAll (fun l : Fin 0 => Fin.elim0 l) i j = 1 := by
  simp [QAlgorithms.kronAll]

example : OddPi Real.pi := by
  exact ⟨0, by simp⟩

example {n : ℕ} (i j : QAlgorithms.Qubits n) : Matrix.single i j (1 : ℂ) i j = 1 := by
  simp

example {n : ℕ} : wordSupport (fun _ : Fin n => (0 : Fin 4)) = ∅ := by
  simp [wordSupport]

example {n : ℕ} (l : Fin n) :
    entryOrder (fun _ => false) (fun _ => true) l = 1 := by
  norm_num [entryOrder]

example {n : ℕ} (i : QAlgorithms.Qubits n × QAlgorithms.Qubits n) :
    (adjoiningReal : Matrix (Bool × (QAlgorithms.Qubits n × QAlgorithms.Qubits n))
      (Bool × (QAlgorithms.Qubits n × QAlgorithms.Qubits n)) ℝ)
      (true, i) (true, (i.2, i.1)) = -1 := by
  simp [adjoiningReal]

example {n : ℕ} (K L : LocalSU n) : twoSidedObjective (0 : Op (QAlgorithms.Qubits n)) K L = 0 := by
  simp [twoSidedObjective]

end

end QAlgorithms.Papers.Independent.Intake100.P95
Source
Which Quantum Evolutions Can Be Reversed by Local Unitary Operations? Algebraic Classification and Gradient-Flow-Based Numerical Checks, arXiv:quant-ph/0610061v1, https://arxiv.org/abs/quant-ph/0610061v1
Read-back

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

QAlgorithms.Papers.Independent.Intake100.P95.BipartiteCouplings

For every natural number nnn and arbitrary real array J:{0,…,n−1}2→RJ:\{0,\ldots,n-1\}^2\to\mathbb RJ:{0,…,n−1}2→R, this is the proposition that there exists a Boolean coloring c:{0,…,n−1}→{false,true}c:\{0,\ldots,n-1\}\to\{\mathrm{false},\mathrm{true}\}c:{0,…,n−1}→{false,true} such that, for every pair i,ji,ji,j,

i≠j and Jmin⁡(i,j),max⁡(i,j)≠0⟹ci≠cj.i\ne j\ \text{and}\ J_{\min(i,j),\max(i,j)}\ne0 \quad\Longrightarrow\quad c_i\ne c_j.i=j and Jmin(i,j),max(i,j)​=0⟹ci​=cj​.

Neither color is required to occur. In particular, for n=0n=0n=0 or n=1n=1n=1, the condition holds vacuously.

QAlgorithms.Papers.Independent.Intake100.P95.CentralizerPerp

For every natural number nnn and all complex matrices H,kH,kH,k indexed by Boolean strings of length nnn, this predicate means that every matrix AAA on the same index set satisfying A†=AA^\dagger=AA†=A, tr⁡(A)=0\operatorname{tr}(A)=0tr(A)=0, and AH−HA=0AH-HA=0AH−HA=0 also satisfies Re⁡tr⁡(k†A)=0\operatorname{Re}\operatorname{tr}(k^\dagger A)=0Retr(k†A)=0. No Hermitian or trace condition is imposed on HHH or kkk. When n=0n=0n=0, the only Hermitian trace-zero 1×11\times11×1 matrix AAA is zero, so the predicate holds for every H,kH,kH,k.

QAlgorithms.Papers.Independent.Intake100.P95.HasOrder

For every natural number nnn, arbitrary complex matrix TTT indexed by nnn-bit strings, and integer ppp, this predicate is the matrix equality

ZnT−TZn=pT,(Zn)y,z={12∑l=0n−1(1−2 1{zl=true}),y=z,0,y≠z.Z_nT-TZ_n=pT, \qquad (Z_n)_{y,z}= \begin{cases} \frac12\sum_{l=0}^{n-1}(1-2\,\mathbf1_{\{z_l=\mathrm{true}\}}),&y=z,\\ 0,&y\ne z. \end{cases}Zn​T−TZn​=pT,(Zn​)y,z​={21​∑l=0n−1​(1−21{zl​=true}​),0,​y=z,y=z.​

No nonzero, Hermitian, or normalization condition is imposed on TTT; in particular, T=0T=0T=0 satisfies the predicate for every ppp. When n=0n=0n=0, Zn=0Z_n=0Zn​=0, so the condition is pT=0pT=0pT=0.

QAlgorithms.Papers.Independent.Intake100.P95.IsHamiltonian

For every natural number nnn and every complex matrix HHH indexed by Boolean strings of length nnn, this predicate means exactly that H†=HH^\dagger=HH†=H and tr⁡(H)=0\operatorname{tr}(H)=0tr(H)=0. When n=0n=0n=0, the matrix has size 1×11\times11×1, and these conditions require its sole entry to be zero.

QAlgorithms.Papers.Independent.Intake100.P95.IsLocalHamiltonian

For every natural number nnn and every complex matrix kkk indexed by Boolean strings of length nnn, this predicate means that there exist real coefficients cl,ac_{l,a}cl,a​, for 0≤l<n0\le l<n0≤l<n and a∈{0,1,2}a\in\{0,1,2\}a∈{0,1,2}, such that k=∑l=0n−1∑a=02cl,aEl,ak=\sum_{l=0}^{n-1}\sum_{a=0}^{2}c_{l,a}E_{l,a}k=∑l=0n−1​∑a=02​cl,a​El,a​. Here (El,a)x,y=(σa)xl,yl∏j≠lδxj,yj(E_{l,a})_{x,y}=(\sigma_a)_{x_l,y_l}\prod_{j\ne l}\delta_{x_j,y_j}(El,a​)x,y​=(σa​)xl​,yl​​∏j=l​δxj​,yj​​, with σ0=(0110)\sigma_0=\begin{pmatrix}0&1\\1&0\end{pmatrix}σ0​=(01​10​), σ1=(0−ii0)\sigma_1=\begin{pmatrix}0&-i\\i&0\end{pmatrix}σ1​=(0i​−i0​), and σ2=(100−1)\sigma_2=\begin{pmatrix}1&0\\0&-1\end{pmatrix}σ2​=(10​0−1​) in Boolean order (false,true)(\mathrm{false},\mathrm{true})(false,true). When n=0n=0n=0, the sum is empty, so the predicate means k=0k=0k=0.

QAlgorithms.Papers.Independent.Intake100.P95.LocalSU

For every natural number nnn, LocalSU(n)\mathrm{LocalSU}(n)LocalSU(n) is the type of families (Kl)l=0n−1(K_l)_{l=0}^{n-1}(Kl​)l=0n−1​ of complex 2×22\times22×2 matrices indexed by the Boolean values, where each KlK_lKl​ is unitary and has determinant 111. When n=0n=0n=0, this is the type containing the unique empty family.

QAlgorithms.Papers.Independent.Intake100.P95.OddPi

For a real number xxx, this predicate means that there exists an integer zzz such that

x=(2z+1)π.x=(2z+1)\pi.x=(2z+1)π.

The integer may be negative, zero, or positive, so the predicate includes all positive and negative odd integer multiples of π\piπ.

QAlgorithms.Papers.Independent.Intake100.P95.SelectedPairs

For every natural number nnn and every family of arbitrary complex numbers λl(b)\lambda_l(b)λl​(b) indexed by 0≤l<n0\le l<n0≤l<n and Boolean values bbb, this defines the type of ordered pairs (a,b)(a,b)(a,b) of Boolean strings of length nnn satisfying ∏l=0n−1λl(al)λl(bl)‾=−1\prod_{l=0}^{n-1}\lambda_l(a_l)\overline{\lambda_l(b_l)}=-1∏l=0n−1​λl​(al​)λl​(bl​)​=−1. The equality is exact, and no requirement that a≠ba\ne ba=b is separately imposed. When n=0n=0n=0, the product is 111, so this type is empty.

QAlgorithms.Papers.Independent.Intake100.P95.TypeI

For every natural number nnn and every complex matrix HHH indexed by Boolean strings of length nnn, this predicate means that there exists a family (Kl)l=0n−1(K_l)_{l=0}^{n-1}(Kl​)l=0n−1​ of complex 2×22\times22×2 special unitary matrices such that, for every real number ttt, LKexp⁡(−itH)LK†=exp⁡(itH)L_K\exp(-itH)L_K^\dagger=\exp(itH)LK​exp(−itH)LK†​=exp(itH), where (LK)x,y=∏l=0n−1(Kl)xl,yl(L_K)_{x,y}=\prod_{l=0}^{n-1}(K_l)_{x_l,y_l}(LK​)x,y​=∏l=0n−1​(Kl​)xl​,yl​​ and exp⁡\expexp is the matrix exponential. The same family must work for all ttt; no Hermitian or trace condition is assumed on HHH. When n=0n=0n=0, the local matrix is [1][1][1], so the condition becomes exp⁡(−itH)=exp⁡(itH)\exp(-itH)=\exp(itH)exp(−itH)=exp(itH) for every real ttt.

QAlgorithms.Papers.Independent.Intake100.P95.adjoiningReal

For any type ι\iotaι equipped with decidable equality, this defines a real matrix indexed by Bool×(ι×ι)\mathrm{Bool}\times(\iota\times\iota)Bool×(ι×ι), with entries

J(b,(i,j)),(c,(k,ℓ))={1,b=c=false, i=ℓ, j=k,−1,b=c=true, i=ℓ, j=k,0,otherwise.J_{(b,(i,j)),(c,(k,\ell))} = \begin{cases} 1,&b=c=\mathrm{false},\ i=\ell,\ j=k,\\ -1,&b=c=\mathrm{true},\ i=\ell,\ j=k,\\ 0,&\text{otherwise}. \end{cases}J(b,(i,j)),(c,(k,ℓ))​=⎩⎨⎧​1,−1,0,​b=c=false, i=ℓ, j=k,b=c=true, i=ℓ, j=k,otherwise.​

No finiteness or nonemptiness assumption on ι\iotaι is imposed.

QAlgorithms.Papers.Independent.Intake100.P95.adjointConjugation

For every finite index type ι\iotaι, equipped with its finite enumeration, and all complex square matrices K,AK,AK,A indexed by ι\iotaι, this defines their adjoint conjugation to be KAK†KAK^\daggerKAK†, where K†K^\daggerK† is the conjugate transpose of KKK. There is no assumption that KKK is unitary or invertible. The definition also permits an empty index type.

QAlgorithms.Papers.Independent.Intake100.P95.axisPulse

For every natural number nnn, axis index a∈{0,1,2}a\in\{0,1,2\}a∈{0,1,2}, and collection of real angles (ϕl)l=0n−1(\phi_l)_{l=0}^{n-1}(ϕl​)l=0n−1​, this defines a complex matrix indexed by nnn-bit strings as

P=⨂l=0n−1exp⁡ ⁣(−iϕl2σa),Pxy=∏l=0n−1[exp⁡ ⁣(−iϕl2σa)]xlyl,P=\bigotimes_{l=0}^{n-1}\exp\!\left(-\frac{\mathrm{i}\phi_l}{2}\sigma_a\right), \qquad P_{xy}=\prod_{l=0}^{n-1}\left[\exp\!\left(-\frac{\mathrm{i}\phi_l}{2}\sigma_a\right)\right]_{x_l y_l},P=l=0⨂n−1​exp(−2iϕl​​σa​),Pxy​=l=0∏n−1​[exp(−2iϕl​​σa​)]xl​yl​​,

where bits are ordered false, true and

σ0=(0110),σ1=(0−ii0),σ2=(100−1).\sigma_0=\begin{pmatrix}0&1\\1&0\end{pmatrix},\quad \sigma_1=\begin{pmatrix}0&-\mathrm{i}\\\mathrm{i}&0\end{pmatrix},\quad \sigma_2=\begin{pmatrix}1&0\\0&-1\end{pmatrix}.σ0​=(01​10​),σ1​=(0i​−i0​),σ2​=(10​0−1​).

The exponential is the matrix exponential. When n=0n=0n=0, the empty product gives the 1×11\times11×1 identity matrix.

QAlgorithms.Papers.Independent.Intake100.P95.collectiveZ

For every natural number nnn, this defines a complex matrix ZnZ_nZn​ indexed by pairs of nnn-bit strings. Writing Z=(100−1)Z=\begin{pmatrix}1&0\\0&-1\end{pmatrix}Z=(10​0−1​) in the basis ordered as false, true, it is

Zn=12∑k=0n−1I⊗k⊗Z⊗I⊗(n−1−k).Z_n=\frac12\sum_{k=0}^{n-1}I^{\otimes k}\otimes Z\otimes I^{\otimes(n-1-k)}.Zn​=21​k=0∑n−1​I⊗k⊗Z⊗I⊗(n−1−k).

Equivalently, its entry at bit strings y,zy,zy,z is zero unless y=zy=zy=z, and its diagonal entry at zzz is 12∑k=0n−1(1−2 1{zk=true})\frac12\sum_{k=0}^{n-1}(1-2\,\mathbf1_{\{z_k=\mathrm{true}\}})21​∑k=0n−1​(1−21{zk​=true}​). For n=0n=0n=0, the sum is empty and the resulting matrix on the single empty bit string is zero.

QAlgorithms.Papers.Independent.Intake100.P95.concurrenceInvolution

For every natural number nnn and arbitrary complex matrix AAA indexed by nnn-bit strings, this defines

A⟼B A‾ B†,B=⨂l=0n−1(−iY),A\longmapsto B\,\overline A\,B^\dagger, \qquad B=\bigotimes_{l=0}^{n-1}(-\mathrm{i}Y),A⟼BAB†,B=l=0⨂n−1​(−iY),

where A‾\overline AA is entrywise complex conjugation, B†B^\daggerB† is the conjugate transpose, and Y=(0−ii0)Y=\begin{pmatrix}0&-\mathrm{i}\\\mathrm{i}&0\end{pmatrix}Y=(0i​−i0​) in the false, true basis. Explicitly, Bxy=∏l(−iY)xlylB_{xy}=\prod_l(-\mathrm{i}Y)_{x_l y_l}Bxy​=∏l​(−iY)xl​yl​​. No Hermiticity or normalization condition is imposed on AAA. When n=0n=0n=0, BBB is the 1×11\times11×1 identity and the operation conjugates the sole entry of AAA.

QAlgorithms.Papers.Independent.Intake100.P95.couplingGraph

For every natural number nnn and arbitrary real array J:{0,…,n−1}2→RJ:\{0,\ldots,n-1\}^2\to\mathbb RJ:{0,…,n−1}2→R, this defines an undirected simple graph on {0,…,n−1}\{0,\ldots,n-1\}{0,…,n−1} by declaring iii and jjj adjacent exactly when

i≠jandJmin⁡(i,j),max⁡(i,j)≠0.i\ne j\quad\text{and}\quad J_{\min(i,j),\max(i,j)}\ne0.i=jandJmin(i,j),max(i,j)​=0.

No symmetry assumption is imposed on JJJ; its diagonal and entries below the diagonal do not affect the graph. For n=0n=0n=0 or n=1n=1n=1, the graph has no edges.

QAlgorithms.Papers.Independent.Intake100.P95.distanceSq

For every natural number nnn, arbitrary complex matrix HHH indexed by nnn-bit strings, and collection K=(Kl)l=0n−1K=(K_l)_{l=0}^{n-1}K=(Kl​)l=0n−1​ of 2×22\times22×2 complex unitary matrices of determinant 111, this defines the real number

∥LHL†+H∥F 2=∑x,y∣(LHL†+H)xy∣2,Lxy=∏l=0n−1(Kl)xlyl,\left\|LHL^\dagger+H\right\|_{\mathrm F}^{\,2} =\sum_{x,y}\left|(LHL^\dagger+H)_{xy}\right|^2, \qquad L_{xy}=\prod_{l=0}^{n-1}(K_l)_{x_l y_l},​LHL†+H​F2​=x,y∑​​(LHL†+H)xy​​2,Lxy​=l=0∏n−1​(Kl​)xl​yl​​,

where ∥⋅∥F\|\cdot\|_{\mathrm F}∥⋅∥F​ is the Frobenius norm and x,yx,yx,y range over all nnn-bit strings. No Hermiticity or trace condition is imposed on HHH. For n=0n=0n=0, LLL is the 1×11\times11×1 identity and the value is 4∣H∅,∅∣24|H_{\varnothing,\varnothing}|^24∣H∅,∅​∣2.

QAlgorithms.Papers.Independent.Intake100.P95.embeddedPauli

For every natural number nnn, every position k∈{0,…,n−1}k\in\{0,\ldots,n-1\}k∈{0,…,n−1}, and every a∈{0,1,2}a\in\{0,1,2\}a∈{0,1,2}, this defines the matrix with entries ∏l=0n−1Bl(xl,yl)\prod_{l=0}^{n-1}B_l(x_l,y_l)∏l=0n−1​Bl​(xl​,yl​) on Boolean strings x,yx,yx,y of length nnn, where Bk=σaB_k=\sigma_aBk​=σa​ and Bl=I2B_l=I_2Bl​=I2​ for l≠kl\ne kl=k. In the Boolean order (false,true)(\mathrm{false},\mathrm{true})(false,true), the matrices are σ0=(0110)\sigma_0=\begin{pmatrix}0&1\\1&0\end{pmatrix}σ0​=(01​10​), σ1=(0−ii0)\sigma_1=\begin{pmatrix}0&-i\\i&0\end{pmatrix}σ1​=(0i​−i0​), and σ2=(100−1)\sigma_2=\begin{pmatrix}1&0\\0&-1\end{pmatrix}σ2​=(10​0−1​). When n=0n=0n=0, there is no position kkk, so there are no inputs to this definition.

QAlgorithms.Papers.Independent.Intake100.P95.entryOrder

For every natural number nnn, two nnn-bit strings i,ji,ji,j, and an index l∈{0,…,n−1}l\in\{0,\ldots,n-1\}l∈{0,…,n−1}, this defines the real number

s(il)−s(jl),s(false)=12,s(true)=−12.s(i_l)-s(j_l),\qquad s(\mathrm{false})=\frac12,\quad s(\mathrm{true})=-\frac12.s(il​)−s(jl​),s(false)=21​,s(true)=−21​.

Its value is 000 when the two bits agree, 111 when il=falsei_l=\mathrm{false}il​=false and jl=truej_l=\mathrm{true}jl​=true, and −1-1−1 when il=truei_l=\mathrm{true}il​=true and jl=falsej_l=\mathrm{false}jl​=false. For n=0n=0n=0, there is no possible index lll.

QAlgorithms.Papers.Independent.Intake100.P95.factorOrder

For a label ν∈{0,1,2,3}\nu\in\{0,1,2,3\}ν∈{0,1,2,3}, this defines the integer

o(ν)={1,ν=2,−1,ν=3,0,ν=0 or ν=1.o(\nu)= \begin{cases} 1,&\nu=2,\\ -1,&\nu=3,\\ 0,&\nu=0\text{ or }\nu=1. \end{cases}o(ν)=⎩⎨⎧​1,−1,0,​ν=2,ν=3,ν=0 or ν=1.​

QAlgorithms.Papers.Independent.Intake100.P95.fromLocalIndex

For every natural number nnn and every complex matrix AAA indexed by functions {0,…,n−1}→{0,1}\{0,\ldots,n-1\}\to\{0,1\}{0,…,n−1}→{0,1}, this defines a matrix indexed by Boolean strings of length nnn by

Bx,y=Aτ−1∘x,τ−1∘y,τ−1(false)=0,τ−1(true)=1.B_{x,y}=A_{\tau^{-1}\circ x,\tau^{-1}\circ y}, \qquad \tau^{-1}(\mathrm{false})=0,\quad \tau^{-1}(\mathrm{true})=1.Bx,y​=Aτ−1∘x,τ−1∘y​,τ−1(false)=0,τ−1(true)=1.

Both indices are converted coordinatewise. The definition also applies when n=0n=0n=0, in which case these are one-entry matrices.

QAlgorithms.Papers.Independent.Intake100.P95.individualZRotation

For every natural number nnn and every family of real numbers (ϕl)l=0n−1(\phi_l)_{l=0}^{n-1}(ϕl​)l=0n−1​, this defines the complex matrix indexed by nnn-bit strings

R(ϕ)=⨂l=0n−1(e−iϕl/200eiϕl/2),R(\phi)=\bigotimes_{l=0}^{n-1} \begin{pmatrix} e^{-i\phi_l/2}&0\\ 0&e^{i\phi_l/2} \end{pmatrix},R(ϕ)=l=0⨂n−1​(e−iϕl​/20​0eiϕl​/2​),

where each one-bit basis is ordered as false, true, and the entry of the tensor product at y,zy,zy,z is the product of the corresponding one-bit entries. Thus the matrix is diagonal, with diagonal entry ∏le iϕl(21{zl=true}−1)/2\prod_l e^{\,i\phi_l(2\mathbf1_{\{z_l=\mathrm{true}\}}-1)/2}∏l​eiϕl​(21{zl​=true}​−1)/2. For n=0n=0n=0, the empty product gives the identity matrix on the single empty bit string.

QAlgorithms.Papers.Independent.Intake100.P95.isingZZ

For every natural number nnn and arbitrary real array J:{0,…,n−1}2→RJ:\{0,\ldots,n-1\}^2\to\mathbb RJ:{0,…,n−1}2→R, this defines a complex matrix indexed by nnn-bit strings as

H=π2∑0≤i<j<nJij⨂l=0n−1Mlij,Mlij={diag⁡(1,−1)l=i or l=j,I2otherwise.H=\frac{\pi}{2}\sum_{0\le i<j<n}J_{ij}\bigotimes_{l=0}^{n-1}M_l^{ij}, \qquad M_l^{ij}=\begin{cases}\operatorname{diag}(1,-1)&l=i\text{ or }l=j,\\I_2&\text{otherwise}.\end{cases}H=2π​0≤i<j<n∑​Jij​l=0⨂n−1​Mlij​,Mlij​={diag(1,−1)I2​​l=i or l=j,otherwise.​

Here each tensor product has entry ∏l(Mlij)xlyl\prod_l(M_l^{ij})_{x_l y_l}∏l​(Mlij​)xl​yl​​, with bits ordered false, true. Only entries JijJ_{ij}Jij​ with i<ji<ji<j contribute; no symmetry of JJJ is assumed. For n=0n=0n=0 or n=1n=1n=1, the sum is empty and the resulting matrix is zero.

QAlgorithms.Papers.Independent.Intake100.P95.jointZ

For every natural number nnn and real number ϕ\phiϕ, this defines a complex matrix indexed by nnn-bit strings by using the same angle on every bit:

Rn(ϕ)=⨂l=0n−1(e−iϕ/200eiϕ/2),R_n(\phi)=\bigotimes_{l=0}^{n-1} \begin{pmatrix} e^{-i\phi/2}&0\\ 0&e^{i\phi/2} \end{pmatrix},Rn​(ϕ)=l=0⨂n−1​(e−iϕ/20​0eiϕ/2​),

with false preceding true in each one-bit basis. Its off-diagonal entries vanish, and its diagonal entry at zzz is e iϕ(2 ∣{l:zl=true}∣−n)/2e^{\,i\phi(2\,|\{l:z_l=\mathrm{true}\}|-n)/2}eiϕ(2∣{l:zl​=true}∣−n)/2. For n=0n=0n=0, it is the identity on the single empty bit string.

QAlgorithms.Papers.Independent.Intake100.P95.localAd

For every natural number nnn, every family (Kl)l=0n−1(K_l)_{l=0}^{n-1}(Kl​)l=0n−1​ of complex 2×22\times22×2 special unitary matrices, and every complex matrix AAA indexed by Boolean strings of length nnn, this defines localAd(K,A)=LKALK†\mathrm{localAd}(K,A)=L_KAL_K^\daggerlocalAd(K,A)=LK​ALK†​, where (LK)x,y=∏l=0n−1(Kl)xl,yl(L_K)_{x,y}=\prod_{l=0}^{n-1}(K_l)_{x_l,y_l}(LK​)x,y​=∏l=0n−1​(Kl​)xl​,yl​​. No Hermitian or trace condition is imposed on AAA. When n=0n=0n=0, LK=[1]L_K=[1]LK​=[1], so this operation leaves AAA unchanged.

QAlgorithms.Papers.Independent.Intake100.P95.localMatrix

For every natural number nnn and every family (Kl)l=0n−1(K_l)_{l=0}^{n-1}(Kl​)l=0n−1​ of complex 2×22\times22×2 special unitary matrices, this defines a complex matrix LKL_KLK​ indexed by Boolean strings x,yx,yx,y of length nnn, with entries (LK)x,y=∏l=0n−1(Kl)xl,yl(L_K)_{x,y}=\prod_{l=0}^{n-1}(K_l)_{x_l,y_l}(LK​)x,y​=∏l=0n−1​(Kl​)xl​,yl​​. When n=0n=0n=0, there is one empty Boolean string, and the empty product makes LKL_KLK​ the 1×11\times11×1 matrix [1][1][1].

QAlgorithms.Papers.Independent.Intake100.P95.localNumericalRange

For every natural number nnn and arbitrary complex matrices C,AC,AC,A indexed by Boolean strings of length nnn, this defines the following set of complex numbers:

{tr⁡(C†WKAWK†):Kℓ∈SU(2) for every 0≤ℓ<n},(WK)x,y=∏ℓ=0n−1(Kℓ)xℓ,yℓ.\left\{\operatorname{tr}(C^\dagger W_K A W_K^\dagger): K_\ell\in\mathrm{SU}(2)\text{ for every }0\le\ell<n\right\}, \qquad (W_K)_{x,y}=\prod_{\ell=0}^{n-1}(K_\ell)_{x_\ell,y_\ell}.{tr(C†WK​AWK†​):Kℓ​∈SU(2) for every 0≤ℓ<n},(WK​)x,y​=ℓ=0∏n−1​(Kℓ​)xℓ​,yℓ​​.

Here each KℓK_\ellKℓ​ is indexed by false,true\mathrm{false},\mathrm{true}false,true, and SU(2)\mathrm{SU}(2)SU(2) means unitary matrices with determinant one. For n=0n=0n=0, the empty product gives WK=[1]W_K=[1]WK​=[1], so the set is the singleton containing tr⁡(C†A)\operatorname{tr}(C^\dagger A)tr(C†A).

QAlgorithms.Papers.Independent.Intake100.P95.localSkewProjection

For every natural number nnn and every complex matrix AAA indexed by Boolean strings of length nnn, let A~\widetilde AA be its reindexing to functions into {0,1}\{0,1\}{0,1}, using 0↦false0\mapsto\mathrm{false}0↦false and 1↦true1\mapsto\mathrm{true}1↦true. For 0≤k<n0\le k<n0≤k<n and a∈{0,1,2}a\in\{0,1,2\}a∈{0,1,2}, define Gk,aG_{k,a}Gk,a​ by

(Gk,a)i,j=(Sa)ik,jk∏ℓ≠kδiℓ,jℓ,S0=(0ii0),S1=(0−110),S2=(i00−i).(G_{k,a})_{i,j}=(S_a)_{i_k,j_k}\prod_{\ell\ne k}\delta_{i_\ell,j_\ell}, \qquad S_0=\begin{pmatrix}0&\mathrm i\\ \mathrm i&0\end{pmatrix},\quad S_1=\begin{pmatrix}0&-1\\1&0\end{pmatrix},\quad S_2=\begin{pmatrix}\mathrm i&0\\0&-\mathrm i\end{pmatrix}.(Gk,a​)i,j​=(Sa​)ik​,jk​​ℓ=k∏​δiℓ​,jℓ​​,S0​=(0i​i0​),S1​=(01​−10​),S2​=(i0​0−i​).

The defined output is the Boolean-indexed reindexing of

2−n∑k=0n−1∑a=02Re⁡tr⁡(A~†Gk,a) Gk,a.2^{-n}\sum_{k=0}^{n-1}\sum_{a=0}^{2} \operatorname{Re}\operatorname{tr}(\widetilde A^\dagger G_{k,a})\,G_{k,a}.2−nk=0∑n−1​a=0∑2​Retr(A†Gk,a​)Gk,a​.

No assumption on AAA is required; for n=0n=0n=0, the empty sum makes the output zero.

QAlgorithms.Papers.Independent.Intake100.P95.matrixUnitSum

For every pair of natural numbers n,mn,mn,m, collections of nnn-bit strings (ia)a=0m−1(i_a)_{a=0}^{m-1}(ia​)a=0m−1​ and (ja)a=0m−1(j_a)_{a=0}^{m-1}(ja​)a=0m−1​, and complex coefficients (ca)a=0m−1(c_a)_{a=0}^{m-1}(ca​)a=0m−1​, this defines the complex matrix

M=∑a=0m−1caEia,ja,Mxy=∑0≤a<mia=x, ja=yca,M=\sum_{a=0}^{m-1}c_a E_{i_a,j_a}, \qquad M_{xy}=\sum_{\substack{0\le a<m\\i_a=x,\ j_a=y}}c_a,M=a=0∑m−1​ca​Eia​,ja​​,Mxy​=0≤a<mia​=x, ja​=y​∑​ca​,

where Eu,vE_{u,v}Eu,v​ has entry 111 at row uuu, column vvv, and zero elsewhere. Repeated pairs are allowed and their coefficients add. If m=0m=0m=0, the matrix is zero; if n=0n=0n=0, there is one empty bit string and the matrix is the 1×11\times11×1 matrix with entry ∑aca\sum_a c_a∑a​ca​.

QAlgorithms.Papers.Independent.Intake100.P95.networkXY

For every natural number nnn, arbitrary real array J:{0,…,n−1}2→RJ:\{0,\ldots,n-1\}^2\to\mathbb RJ:{0,…,n−1}2→R, and real number κ\kappaκ, this defines a complex matrix indexed by nnn-bit strings as

H=π2∑0≤i<j<nJij(PijX+κPijY),H=\frac{\pi}{2}\sum_{0\le i<j<n}J_{ij}\left(P_{ij}^{X}+\kappa P_{ij}^{Y}\right),H=2π​0≤i<j<n∑​Jij​(PijX​+κPijY​),

where PijX=⨂lMlXP_{ij}^{X}=\bigotimes_l M_l^XPijX​=⨂l​MlX​ and PijY=⨂lMlYP_{ij}^{Y}=\bigotimes_l M_l^YPijY​=⨂l​MlY​, with MlX=XM_l^X=XMlX​=X and MlY=YM_l^Y=YMlY​=Y when l=il=il=i or l=jl=jl=j, and both factors equal to I2I_2I2​ otherwise. In the false, true basis, X=(0110)X=\begin{pmatrix}0&1\\1&0\end{pmatrix}X=(01​10​) and Y=(0−ii0)Y=\begin{pmatrix}0&-\mathrm{i}\\\mathrm{i}&0\end{pmatrix}Y=(0i​−i0​); tensor-product entries are products of the corresponding single-bit entries. No symmetry of JJJ or restriction on κ\kappaκ is assumed, and only entries JijJ_{ij}Jij​ with i<ji<ji<j contribute. For n=0n=0n=0 or n=1n=1n=1, the resulting matrix is zero.

QAlgorithms.Papers.Independent.Intake100.P95.orderMatrix

For every pair of natural numbers n,mn,mn,m and label family ν:{0,…,m−1}×{0,…,n−1}→{0,1,2,3}\nu:\{0,\ldots,m-1\}\times\{0,\ldots,n-1\}\to\{0,1,2,3\}ν:{0,…,m−1}×{0,…,n−1}→{0,1,2,3}, this defines the real m×nm\times nm×n matrix

Aa,l={1,νa,l=2,−1,νa,l=3,0,νa,l=0 or νa,l=1.A_{a,l}= \begin{cases} 1,&\nu_{a,l}=2,\\ -1,&\nu_{a,l}=3,\\ 0,&\nu_{a,l}=0\text{ or }\nu_{a,l}=1. \end{cases}Aa,l​=⎩⎨⎧​1,−1,0,​νa,l​=2,νa,l​=3,νa,l​=0 or νa,l​=1.​

Either dimension may be zero, in which case the matrix has no entries.

QAlgorithms.Papers.Independent.Intake100.P95.pairPauli

For every natural number nnn, indices i,j∈{0,…,n−1}i,j\in\{0,\ldots,n-1\}i,j∈{0,…,n−1}, and a∈{0,1,2}a\in\{0,1,2\}a∈{0,1,2}, this defines the complex matrix on nnn-bit strings whose entries are

Pxy=∏l=0n−1(Ml)xlyl,Ml={σal=i or l=j,I2otherwise,P_{xy}=\prod_{l=0}^{n-1}(M_l)_{x_l y_l}, \qquad M_l=\begin{cases}\sigma_a&l=i\text{ or }l=j,\\I_2&\text{otherwise},\end{cases}Pxy​=l=0∏n−1​(Ml​)xl​yl​​,Ml​={σa​I2​​l=i or l=j,otherwise,​

where bits are ordered false, true and σ0=(0110)\sigma_0=\begin{pmatrix}0&1\\1&0\end{pmatrix}σ0​=(01​10​), σ1=(0−ii0)\sigma_1=\begin{pmatrix}0&-\mathrm{i}\\\mathrm{i}&0\end{pmatrix}σ1​=(0i​−i0​), and σ2=diag⁡(1,−1)\sigma_2=\operatorname{diag}(1,-1)σ2​=diag(1,−1). The indices need not be distinct: if i=ji=ji=j, there is just one factor σa\sigma_aσa​ at that index. For n=0n=0n=0, there are no possible choices of iii and jjj.

QAlgorithms.Papers.Independent.Intake100.P95.productEigenoperator

For every natural number nnn, every family (Vl)l=0n−1(V_l)_{l=0}^{n-1}(Vl​)l=0n−1​ of complex 2×22\times22×2 unitary matrices, and every pair of Boolean strings a,ba,ba,b of length nnn, this defines a complex matrix EEE on Boolean strings i,ji,ji,j of length nnn by Ei,j=(∏l=0n−1(Vl)il,al)(∏l=0n−1(Vl)jl,bl)‾E_{i,j}=\left(\prod_{l=0}^{n-1}(V_l)_{i_l,a_l}\right)\overline{\left(\prod_{l=0}^{n-1}(V_l)_{j_l,b_l}\right)}Ei,j​=(∏l=0n−1​(Vl​)il​,al​​)(∏l=0n−1​(Vl​)jl​,bl​​)​. No determinant-one condition or relation to any other operator is assumed. When n=0n=0n=0, both products are empty and E=[1]E=[1]E=[1].

QAlgorithms.Papers.Independent.Intake100.P95.productEigenvalue

For every natural number nnn, every family of complex numbers λl(b)\lambda_l(b)λl​(b) indexed by 0≤l<n0\le l<n0≤l<n and Boolean values bbb, and every pair of Boolean strings a,ba,ba,b of length nnn, this defines the complex number ∏l=0n−1λl(al)λl(bl)‾\prod_{l=0}^{n-1}\lambda_l(a_l)\overline{\lambda_l(b_l)}∏l=0n−1​λl​(al​)λl​(bl​)​. The numbers λl(b)\lambda_l(b)λl​(b) are arbitrary; no modulus or eigenvalue condition is assumed. When n=0n=0n=0, the empty product is 111.

QAlgorithms.Papers.Independent.Intake100.P95.realRepresentation

For any type ι\iotaι, without a finiteness assumption, and any complex matrix BBB indexed by ι×ι\iota\times\iotaι×ι, this defines a real matrix indexed by Bool×ι\mathrm{Bool}\times\iotaBool×ι. With the Boolean components ordered as false,true\mathrm{false},\mathrm{true}false,true, its block form is

(Re⁡B−Im⁡BIm⁡BRe⁡B).\begin{pmatrix} \operatorname{Re}B&-\operatorname{Im}B\\ \operatorname{Im}B&\operatorname{Re}B \end{pmatrix}.(ReBImB​−ImBReB​).

The real and imaginary parts are taken entrywise. This definition also applies to an empty indexing type.

QAlgorithms.Papers.Independent.Intake100.P95.realVec

For any type ι\iotaι, without a finiteness assumption, and any complex matrix AAA indexed by ι×ι\iota\times\iotaι×ι, this defines a real-valued function on Bool×(ι×ι)\mathrm{Bool}\times(\iota\times\iota)Bool×(ι×ι) by separating the real and imaginary parts of its column vectorization:

r(false,(j,i))=Re⁡Ai,j,r(true,(j,i))=Im⁡Ai,j.r(\mathrm{false},(j,i))=\operatorname{Re}A_{i,j}, \qquad r(\mathrm{true},(j,i))=\operatorname{Im}A_{i,j}.r(false,(j,i))=ReAi,j​,r(true,(j,i))=ImAi,j​.

If ι\iotaι is empty, the resulting function has empty domain.

QAlgorithms.Papers.Independent.Intake100.P95.reversalOverlap

For every natural number nnn and arbitrary complex matrices H,KH,KH,K indexed by nnn-bit strings, this defines the real number

Re⁡tr⁡ ⁣((−H)†KHK†).\operatorname{Re}\operatorname{tr}\!\left((-H)^\dagger KHK^\dagger\right).Retr((−H)†KHK†).

Here †\dagger† denotes conjugate transpose; no unitarity assumption is imposed on KKK, and no Hermiticity or trace condition is imposed on HHH. For n=0n=0n=0, writing hhh and kkk for their sole entries, the value is −∣h∣2∣k∣2-|h|^2|k|^2−∣h∣2∣k∣2.

QAlgorithms.Papers.Independent.Intake100.P95.supportComponent

For every natural number nnn, arbitrary complex matrix HHH indexed by nnn-bit strings, and finite subset S⊆{0,…,n−1}S\subseteq\{0,\ldots,n-1\}S⊆{0,…,n−1}, this defines

HS=∑s:{0,…,n−1}→{0,1,2,3}{l:sl≠0}=S2−ntr⁡(Ps†H) Ps,(Ps)y,z=∏l=0n−1(σsl)yl,zl,H_S=\sum_{\substack{s:\{0,\ldots,n-1\}\to\{0,1,2,3\}\\ \{l:s_l\ne0\}=S}} 2^{-n}\operatorname{tr}(P_s^\dagger H)\,P_s, \qquad (P_s)_{y,z}=\prod_{l=0}^{n-1}(\sigma_{s_l})_{y_l,z_l},HS​=s:{0,…,n−1}→{0,1,2,3}{l:sl​=0}=S​∑​2−ntr(Ps†​H)Ps​,(Ps​)y,z​=l=0∏n−1​(σsl​​)yl​,zl​​,

where †\dagger† denotes conjugate transpose and, in the false, true basis,

σ0=(1001),σ1=(0110),σ2=(0−ii0),σ3=(100−1).\sigma_0=\begin{pmatrix}1&0\\0&1\end{pmatrix},\quad \sigma_1=\begin{pmatrix}0&1\\1&0\end{pmatrix},\quad \sigma_2=\begin{pmatrix}0&-i\\i&0\end{pmatrix},\quad \sigma_3=\begin{pmatrix}1&0\\0&-1\end{pmatrix}.σ0​=(10​01​),σ1​=(01​10​),σ2​=(0i​−i0​),σ3​=(10​0−1​).

The support must equal SSS exactly, and the trace coefficient is complex, with no real-part operation or Hermitian assumption on HHH. For S=∅S=\varnothingS=∅, the result is 2−ntr⁡(H)I2^{-n}\operatorname{tr}(H)I2−ntr(H)I; for n=0n=0n=0, this is HHH itself.

QAlgorithms.Papers.Independent.Intake100.P95.tensorFactor

For a label ν∈{0,1,2,3}\nu\in\{0,1,2,3\}ν∈{0,1,2,3}, this defines the following complex matrix, with rows and columns ordered as false, true:

Fν={(1001),ν=0,(1200−12),ν=1,(0100),ν=2,(0010),ν=3.F_\nu= \begin{cases} \begin{pmatrix}1&0\\0&1\end{pmatrix},&\nu=0,\\[3pt] \begin{pmatrix}\frac12&0\\0&-\frac12\end{pmatrix},&\nu=1,\\[3pt] \begin{pmatrix}0&1\\0&0\end{pmatrix},&\nu=2,\\[3pt] \begin{pmatrix}0&0\\1&0\end{pmatrix},&\nu=3. \end{cases}Fν​=⎩⎨⎧​(10​01​),(21​0​0−21​​),(00​10​),(01​00​),​ν=0,ν=1,ν=2,ν=3.​

QAlgorithms.Papers.Independent.Intake100.P95.tensorMonomial

For every natural number nnn and label assignment ν:{0,…,n−1}→{0,1,2,3}\nu:\{0,\ldots,n-1\}\to\{0,1,2,3\}ν:{0,…,n−1}→{0,1,2,3}, this defines the complex matrix MνM_\nuMν​ indexed by nnn-bit strings through

(Mν)y,z=∏l=0n−1(Fνl)yl,zl,F0=(1001),F1=(1200−12),F2=(0100),F3=(0010),(M_\nu)_{y,z}=\prod_{l=0}^{n-1}(F_{\nu_l})_{y_l,z_l}, \qquad F_0=\begin{pmatrix}1&0\\0&1\end{pmatrix},\quad F_1=\begin{pmatrix}\frac12&0\\0&-\frac12\end{pmatrix},\quad F_2=\begin{pmatrix}0&1\\0&0\end{pmatrix},\quad F_3=\begin{pmatrix}0&0\\1&0\end{pmatrix},(Mν​)y,z​=l=0∏n−1​(Fνl​​)yl​,zl​​,F0​=(10​01​),F1​=(21​0​0−21​​),F2​=(00​10​),F3​=(01​00​),

where each one-bit basis is ordered as false, true. For n=0n=0n=0, the empty product makes this the identity on the single empty bit string.

QAlgorithms.Papers.Independent.Intake100.P95.tensorOperatorSum

For every pair of natural numbers n,mn,mn,m, family of labels νa,l∈{0,1,2,3}\nu_{a,l}\in\{0,1,2,3\}νa,l​∈{0,1,2,3} for 0≤a<m0\le a<m0≤a<m and 0≤l<n0\le l<n0≤l<n, and complex coefficients cac_aca​, this defines a complex matrix indexed by nnn-bit strings:

Ty,z=∑a=0m−1ca∏l=0n−1(Fνa,l)yl,zl,F0=(1001),F1=(1200−12),F2=(0100),F3=(0010),T_{y,z}=\sum_{a=0}^{m-1}c_a\prod_{l=0}^{n-1}(F_{\nu_{a,l}})_{y_l,z_l}, \qquad F_0=\begin{pmatrix}1&0\\0&1\end{pmatrix},\quad F_1=\begin{pmatrix}\frac12&0\\0&-\frac12\end{pmatrix},\quad F_2=\begin{pmatrix}0&1\\0&0\end{pmatrix},\quad F_3=\begin{pmatrix}0&0\\1&0\end{pmatrix},Ty,z​=a=0∑m−1​ca​l=0∏n−1​(Fνa,l​​)yl​,zl​​,F0​=(10​01​),F1​=(21​0​0−21​​),F2​=(00​10​),F3​=(01​00​),

with false preceding true in each one-bit basis. There are no restrictions on the coefficients or repeated label assignments. For m=0m=0m=0 the result is zero; for n=0n=0n=0 it is the one-by-one matrix with entry ∑aca\sum_a c_a∑a​ca​.

QAlgorithms.Papers.Independent.Intake100.P95.toLocalIndex

For every natural number nnn and every complex matrix AAA whose rows and columns are indexed by Boolean strings of length nnn, this defines a matrix indexed by functions {0,…,n−1}→{0,1}\{0,\ldots,n-1\}\to\{0,1\}{0,…,n−1}→{0,1} by

A~i,j=Aτ∘i,τ∘j,τ(0)=false,τ(1)=true.\widetilde A_{i,j}=A_{\tau\circ i,\tau\circ j}, \qquad \tau(0)=\mathrm{false},\quad \tau(1)=\mathrm{true}.Ai,j​=Aτ∘i,τ∘j​,τ(0)=false,τ(1)=true.

Thus both indices are converted coordinatewise from two-element numerical indices to Boolean indices. This includes n=0n=0n=0, when each indexing set has exactly one element.

QAlgorithms.Papers.Independent.Intake100.P95.torus

For every natural number nnn and arbitrary real-valued function θ\thetaθ on nnn-bit strings, this defines the diagonal complex matrix

Txy={exp⁡(−iθ(x))x=y,0x≠y.T_{xy}= \begin{cases} \exp(-\mathrm{i}\theta(x))&x=y,\\ 0&x\ne y. \end{cases}Txy​={exp(−iθ(x))0​x=y,x=y.​

No restriction is imposed on the values of θ\thetaθ. For n=0n=0n=0, this is the 1×11\times11×1 matrix with entry exp⁡(−iθ(∅))\exp(-\mathrm{i}\theta(\varnothing))exp(−iθ(∅)), where ∅\varnothing∅ denotes the empty bit string.

QAlgorithms.Papers.Independent.Intake100.P95.twoSidedDistanceSq

For every natural number nnn, every complex matrix UUU indexed by Boolean strings of length nnn, and every two families K,LK,LK,L of determinant-one unitary two-by-two matrices, one matrix per coordinate, define

(WK)x,y=∏ℓ=0n−1(Kℓ)xℓ,yℓ,(WL)x,y=∏ℓ=0n−1(Lℓ)xℓ,yℓ.(W_K)_{x,y}=\prod_{\ell=0}^{n-1}(K_\ell)_{x_\ell,y_\ell}, \qquad (W_L)_{x,y}=\prod_{\ell=0}^{n-1}(L_\ell)_{x_\ell,y_\ell}.(WK​)x,y​=ℓ=0∏n−1​(Kℓ​)xℓ​,yℓ​​,(WL​)x,y​=ℓ=0∏n−1​(Lℓ​)xℓ​,yℓ​​.

The defined real number is

∥WKUWL−U†∥F 2=∑x,y∣(WKUWL−U†)x,y∣2,\|W_KUW_L-U^\dagger\|_{\mathrm F}^{\,2} =\sum_{x,y}|(W_KUW_L-U^\dagger)_{x,y}|^2,∥WK​UWL​−U†∥F2​=x,y∑​∣(WK​UWL​−U†)x,y​∣2,

where ∥⋅∥F\|\cdot\|_{\mathrm F}∥⋅∥F​ is the Frobenius norm. There is no unitarity assumption on UUU. When n=0n=0n=0, this becomes ∣u−u‾∣2|u-\overline u|^2∣u−u∣2 for the sole entry uuu of UUU.

QAlgorithms.Papers.Independent.Intake100.P95.twoSidedObjective

For every natural number nnn, every complex matrix UUU indexed by Boolean strings of length nnn, and every two families K,LK,LK,L of determinant-one unitary two-by-two matrices, define (WK)x,y=∏ℓ<n(Kℓ)xℓ,yℓ(W_K)_{x,y}=\prod_{\ell<n}(K_\ell)_{x_\ell,y_\ell}(WK​)x,y​=∏ℓ<n​(Kℓ​)xℓ​,yℓ​​ and (WL)x,y=∏ℓ<n(Lℓ)xℓ,yℓ(W_L)_{x,y}=\prod_{\ell<n}(L_\ell)_{x_\ell,y_\ell}(WL​)x,y​=∏ℓ<n​(Lℓ​)xℓ​,yℓ​​. This defines the real number

−Re⁡tr⁡(WKUWLU).-\operatorname{Re}\operatorname{tr}(W_KUW_LU).−Retr(WK​UWL​U).

No unitarity assumption on UUU is imposed. For n=0n=0n=0, the value is −Re⁡(u2)-\operatorname{Re}(u^2)−Re(u2), where uuu is its sole entry.

QAlgorithms.Papers.Independent.Intake100.P95.xyz

For arbitrary real numbers a,b,ca,b,ca,b,c, this defines the complex matrix on two-bit strings

a(X⊗X)+b(Y⊗Y)+c(Z⊗Z)=(c00a−b0−ca+b00a+b−c0a−b00c),a(X\otimes X)+b(Y\otimes Y)+c(Z\otimes Z) = \begin{pmatrix} c&0&0&a-b\\ 0&-c&a+b&0\\ 0&a+b&-c&0\\ a-b&0&0&c \end{pmatrix},a(X⊗X)+b(Y⊗Y)+c(Z⊗Z)=​c00a−b​0−ca+b0​0a+b−c0​a−b00c​​,

where the displayed basis is (false,false),(false,true),(true,false),(true,true)(\mathrm{false},\mathrm{false}),(\mathrm{false},\mathrm{true}),(\mathrm{true},\mathrm{false}),(\mathrm{true},\mathrm{true})(false,false),(false,true),(true,false),(true,true), and X=(0110)X=\begin{pmatrix}0&1\\1&0\end{pmatrix}X=(01​10​), Y=(0−ii0)Y=\begin{pmatrix}0&-i\\i&0\end{pmatrix}Y=(0i​−i0​), and Z=(100−1)Z=\begin{pmatrix}1&0\\0&-1\end{pmatrix}Z=(10​0−1​).

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