Definitions for Rotationally-Invariant Circuits: Universality with the exchange interaction and two ancilla qubits
DefinitionQAlgorithms_Papers_Independent_Advance50_P49The objects the formalized statements of Rotationally-Invariant Circuits: Universality with the exchange interaction and two ancilla qubits (arXiv:2202.01963) are stated in. Each was checked against the paper by a blind read-back and a moderator.
Spinspin: PDF p.8, A1–A2: the physical spin indexed in decreasing order.spinMultiplicity: PDF p.8, A9; zero outside the allowed spectrum. The argument d is twice the spin.RotationInvariant: PDF p.1: invariance under every one-qubit unitary, equivalently SU(2).SymUnitary: PDF p.1: a rotationally invariant physical unitary.onWire: PDF p.1: a one-qubit operator on a named physical wire.heisenbergExchange: PDF pp.1–2, B2: R_ab=(X_a X_b+Y_a Y_b+Z_a Z_b)/2. Uses require a≠b.angular: PDF p.8: physical Cartesian angular momentum.casimir: PDF p.8: the actual squared total angular momentum.spinProjector: PDF pp.2,8: the spectral projector of J², constructed by Lagrange interpolation. Distinct legal spins have distinct j(j+1); no projector family is assumed as input.highest: PDF p.8, A3: the physical highest-weight slice of sector j, one copy of its multiplicity space.blockDet: PDF p.17: determinant of the multiplicity block y_j, computed on the highest-weight slice and extended by identity on its orthogonal complement. Not the full-sector determinant.sectorDet: PDF p.24, G3: determinant on the full physical sector H_j.localSum: PDF p.22: finite sums of terms supported on at most k wires.localGroup: PDF p.1: exact finite composition of k-local invariant gates.localLie: PDF p.16, C3: the real Lie algebra generated by local invariant skew-Hermitians.specialLie: PDF p.18, C16: sector-traceless part of the local Lie algebra.Special: PDF p.17: special means determinant one on every multiplicity block.evolve: PDF pp.1–2: exp(-itH), with real control time.ChainNeighbors: PDF p.31: nearest-neighbor edges. The definition safely covers 0 and 1 wires.exchangeGenerators: PDF p.31, I1/I5: exchange generators, with optional identity generator.exchangeLie: PDF p.31: the real exchange-generated Lie algebra; scalar=true adjoins iI.exchangeGroup: PDF p.31: finite exchange circuits, with optional arbitrary global phases.wirePermutation: PDF p.9, A11: physical qubit permutation.wireSwap: PDF p.31, I3: the actual transposition of wires.monomial: PDF p.10, B1: ordered product of disjoint exchanges for an injective l-tuple.central: PDF p.10, B1 and Remark 1: all ordered injective tuples, divided by (l/2)!. For even l>n the tuple type is empty, giving zero; l=0 gives I. Odd indices are unused.standardQ: PDF p.11, B18: Q_l=R_12 R_34 ... R_(l-1),l, zero outside l≤n.centralEigenvalue: PDF p.10, B4: the actual central eigenvalue, calculated from physical sector traces.eigenInt: PDF pp.11,24: integer phase weight. The integrality theorem identifies this floor with the physical eigenvalue, rather than assuming integer eigenvalues as input.centralSpace: PDF p.17, Proposition 1: the proposed real central span.dualCentral: PDF p.25, G9: the dual central operator. Statements only divide at physical indices.energyCoeff: PDF pp.3,22: coefficients in the central expansion.sectorMeanEnergy: PDF p.22, E1: average energy on the physical spin sector.registerTensor: PDF p.25: regroup the first n and last m physical wires.registerSplit: PDF p.10, B7: the same physical operator in product-register coordinates.tensorState: PDF pp.31–36: tensor vectors in the fixed physical wire ordering.sectorAngle: PDF p.24, G3: sector determinant angle, in the quotient modulo 2π.phaseMap: PDF p.25: integer linear map on the physical sector-phase torus.bodyPhase: PDF p.24, G5 and Remark 2: l-body phase, extended by zero beyond the physical range.chargeOperator: PDF p.24, G2: the general integer-weight observable and phase.chargePhase: PDF p.24, G2: an integer-weighted sum of full-sector determinant angles.SchrodingerPropagator: PDF p.24, G1: the entrywise integral form of the Schrödinger propagator. Every entry of H and -iHU is integrable on [0,T]. The integral equation gives an absolutely continuous unitary path from I, including piecewise continuous controls. In finite dimension this is equivalent to the matrix-valued integral equation.finitePhaseGroup: PDF p.26, G17, corrected to include every physical even index: fixed generators and their integer powers. Integer powers include inverses, so closure is the group.centralPhaseFactor: PDF p.26, G18: the phase factor with the source's principal representatives.sectorPhases: PDF p.18, C17: independent scalar phases on physical spin sectors.oddPauliSpace: PDF p.23, F1: the complex span of phase-free odd-weight Pauli strings.reverseTime: PDF p.23, F4: conjugation by spin-half time reversal (Y tensor ... tensor Y) K. The omitted scalar i^n cancels under conjugation.multiSwap: PDF p.29, H1: the swap of the odd and even r-qubit registers.swapSum: PDF pp.29–30, H5, with the necessary empty product B_0=I.permutationSumCoefficient: PDF p.30, H9/H11: only l≤m is evaluated; negative factorials never occur.triplet: PDF pp.4,31: the ancillary triplet projector, on two physical qubits.twoQubitSinglet: PDF pp.11,31: the frozen normalized singlet, relabelled from a pair of Fin 2 indices to the fixed two-wire Bool register. The p.4 typo is corrected by p.31.liftQ: PDF p.32, I8: prescribed monomial lift. The sum is over even s=4,...,l.averageData: PDF p.32, I13: permutation averaging over data wires only.liftCentral: PDF p.32, I17: the prescribed, rather than existential, central lift.liftHamiltonian: PDF p.33, I21: prescribed Hamiltonian including removal of its scalar trace.comm: PDF p.34, I32: ordinary matrix commutator.commutatorTemplate: PDF pp.34–35, I33/I36: four nested-commutator terms with their first arguments supplied separately, allowing the source's recursive substitution.templateSeeds: PDF p.34, I32: the four initial exchanges used by the template.templateComplements: PDF p.34, I35: complementary disjoint exchanges for the four first brackets. Each complement avoids all three wires in the first bracket.ExchangeExpr: PDF p.35: finite real Lie syntax in exchange generators; evaluation is skew-Hermitian.ExchangeExpr.eval: PDF p.35: evaluate the actual finite expression, not an unconstrained cost or label.monomialHamiltonian: PDF p.33, I25: no arbitrary scalar term is included.extendTuple: PDF pp.33–35: extend a partial injection to a permutation, independently of reachability. For nonextendible input use identity; on a finite injective tuple an extension exists.liftTuple: PDF pp.33–35: prescribed lift of every tuple by permutation of the explicit Q lift.liftMonomialHamiltonian: PDF p.35: linear extension of the prescribed lifts, with no scalar loss.assistedLieSet: PDF p.36: matrices whose tensor-identity lift lies in the (n+1)-qubit local Lie algebra.OneAncillaReachable: PDF p.36: targets admitting fixed pure ancillary input and output in V_k.ValidBody: Physical even body indices; PDF p.10, including l=0.assistedLie: PDF p.36: the real vector space underlying the assisted tangent algebra.
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Gates
import Definitions.Def_QAlgorithms_Defs_Information
import Definitions.Def_QAlgorithms_Defs_Stabilizer
import Definitions.Def_QAlgorithms_Defs_Measurement
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P21
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P69
import Definitions.Def_QAlgorithms_Papers_Independent_Frontier18_P14
import Definitions.Def_QAlgorithms_Defs_LocalHamiltonian
/-!
Statements from Marvian, Liu and Hulse, arXiv:2202.01963v1.
All page references are PDF pages. New physical objects are local to this paper.
Wires are zero based. A spin is indexed by r=0,...,floor(n/2), with j=n/2-r.
Products of matrices use ordered lists, including the empty product I.
Compilation and independent moderation are pending the next pipeline stages.
-/
noncomputable section
namespace QAlgorithms.Papers.Independent.Advance50.P49
open scoped Classical Matrix ComplexConjugate Matrix.Norms.Frobenius
open MeasureTheory
attribute [local instance 100] LieRing.ofAssociativeRing
-- Specialize the frozen generic aliases without declaring new aliases.
local notation "Op" => (fun n : ℕ => QAlgorithms.Papers.Independent.Information100.P21.Op (Qubits n))
local notation "Vec" => (fun n : ℕ => QAlgorithms.Papers.Independent.Information100.P21.Vec (Qubits n))
-- The frozen support predicate takes the support before the operator.
local notation "WireSupported" => QAlgorithms.Papers.Independent.Information100.P69.Supported
abbrev Spin (n : ℕ) := Fin (n / 2 + 1)
/-- PDF p.8, A1–A2: the physical spin indexed in decreasing order. -/
def spin (n : ℕ) (r : Spin n) : ℝ := (n : ℝ) / 2 - r.val
/-- PDF p.8, A9; zero outside the allowed spectrum. The argument d is twice the spin. -/
def spinMultiplicity (n d : ℕ) : ℕ :=
if d ≤ n ∧ (n - d) % 2 = 0 then
Nat.choose n ((n - d) / 2) * (d + 1) / ((n + d) / 2 + 1)
else 0
/-- PDF p.1: invariance under every one-qubit unitary, equivalently SU(2). -/
def RotationInvariant {n : ℕ} (A : Op n) : Prop :=
∀ U : Matrix Bool Bool ℂ, U ∈ Matrix.unitaryGroup Bool ℂ →
A * QAlgorithms.Papers.Independent.Information100.P69.matrixPower U n = QAlgorithms.Papers.Independent.Information100.P69.matrixPower U n * A
/-- PDF p.1: a rotationally invariant physical unitary. -/
def SymUnitary {n : ℕ} (U : Op n) : Prop :=
U ∈ Matrix.unitaryGroup (Qubits n) ℂ ∧ RotationInvariant U
/-- PDF p.1: a one-qubit operator on a named physical wire. -/
def onWire {n : ℕ} (q : Fin n) (A : Matrix Bool Bool ℂ) : Op n :=
fun x y => A (x q) (y q) * ∏ r ∈ Finset.univ.erase q, if x r = y r then 1 else 0
/-- PDF pp.1–2, B2: R_ab=(X_a X_b+Y_a Y_b+Z_a Z_b)/2. Uses require a≠b. -/
def heisenbergExchange {n : ℕ} (a b : Fin n) : Op n :=
(1 / 2 : ℂ) • (onWire a pauliX * onWire b pauliX +
onWire a pauliY * onWire b pauliY + onWire a pauliZ * onWire b pauliZ)
/-- PDF p.8: physical Cartesian angular momentum. -/
def angular (n : ℕ) (A : Matrix Bool Bool ℂ) : Op n :=
(1 / 2 : ℂ) • ∑ q : Fin n, onWire q A
/-- PDF p.8: the actual squared total angular momentum. -/
def casimir (n : ℕ) : Op n :=
angular n pauliX ^ 2 + angular n pauliY ^ 2 + angular n pauliZ ^ 2
/-- PDF pp.2,8: the spectral projector of J², constructed by Lagrange interpolation.
Distinct legal spins have distinct j(j+1); no projector family is assumed as input. -/
def spinProjector (n : ℕ) (j : Spin n) : Op n :=
((List.ofFn fun r : Spin n => r).filter (fun r => r ≠ j)).map
(fun r => ((spin n j * (spin n j + 1) - spin n r * (spin n r + 1) : ℝ)⁻¹ : ℂ) •
(casimir n - (spin n r * (spin n r + 1) : ℂ) • (1 : Op n))) |>.prod
/-- PDF p.8, A3: the physical highest-weight slice of sector j, one copy of its multiplicity space. -/
def highest (n : ℕ) (j : Spin n) : Op n :=
spinProjector n j * Matrix.diagonal (fun x : Qubits n =>
if (Finset.univ.filter fun q : Fin n => x q = true).card = j.val then 1 else 0)
/-- PDF p.17: determinant of the multiplicity block y_j, computed on the highest-weight
slice and extended by identity on its orthogonal complement. Not the full-sector determinant. -/
def blockDet {n : ℕ} (U : Op n) (j : Spin n) : ℂ :=
Matrix.det (U * highest n j + (1 - highest n j))
/-- PDF p.24, G3: determinant on the full physical sector H_j. -/
def sectorDet {n : ℕ} (U : Op n) (j : Spin n) : ℂ :=
Matrix.det (U * spinProjector n j + (1 - spinProjector n j))
/-- PDF p.22: finite sums of terms supported on at most k wires. -/
def localSum (n k : ℕ) : Submodule ℂ (Op n) :=
Submodule.span ℂ {A | ∃ s : Finset (Fin n), s.card ≤ k ∧ WireSupported s A}
/-- PDF p.1: exact finite composition of k-local invariant gates. -/
def localGroup (n k : ℕ) : Submonoid (Op n) :=
Submonoid.closure {U | SymUnitary U ∧
∃ s : Finset (Fin n), s.card ≤ k ∧ WireSupported s U}
/-- PDF p.16, C3: the real Lie algebra generated by local invariant skew-Hermitians. -/
def localLie (n k : ℕ) : LieSubalgebra ℝ (Op n) :=
LieSubalgebra.lieSpan ℝ (Op n) {A | A + Aᴴ = 0 ∧ RotationInvariant A ∧
∃ s : Finset (Fin n), s.card ≤ k ∧ WireSupported s A}
/-- PDF p.18, C16: sector-traceless part of the local Lie algebra. -/
def specialLie (n k : ℕ) : Submodule ℝ (Op n) :=
Submodule.span ℝ {A | A ∈ localLie n k ∧ ∀ j : Spin n, Matrix.trace (A * spinProjector n j) = 0}
/-- PDF p.17: special means determinant one on every multiplicity block. -/
def Special {n : ℕ} (U : Op n) : Prop :=
SymUnitary U ∧ ∀ j : Spin n, blockDet U j = 1
/-- PDF pp.1–2: exp(-itH), with real control time. -/
def evolve {n : ℕ} (H : Op n) (t : ℝ) : Op n :=
NormedSpace.exp ((-Complex.I * (t : ℂ)) • H)
/-- PDF p.31: nearest-neighbor edges. The definition safely covers 0 and 1 wires. -/
def ChainNeighbors {n : ℕ} (a b : Fin n) : Prop := a.val + 1 = b.val
/-- PDF p.31, I1/I5: exchange generators, with optional identity generator. -/
def exchangeGenerators (n : ℕ) (chain scalar : Bool) : Set (Op n) :=
{A | (scalar = true ∧ A = Complex.I • (1 : Op n)) ∨
∃ a b : Fin n, a ≠ b ∧ (chain = true → ChainNeighbors a b) ∧ A = Complex.I • heisenbergExchange a b}
/-- PDF p.31: the real exchange-generated Lie algebra; scalar=true adjoins iI. -/
def exchangeLie (n : ℕ) (chain : Bool := false) (scalar : Bool := false) : LieSubalgebra ℝ (Op n) :=
LieSubalgebra.lieSpan ℝ (Op n) (exchangeGenerators n chain scalar)
/-- PDF p.31: finite exchange circuits, with optional arbitrary global phases. -/
def exchangeGroup (n : ℕ) (chain : Bool := false) (scalar : Bool := false) : Submonoid (Op n) :=
Submonoid.closure {U | (scalar = true ∧ ∃ t : ℝ, U = Complex.exp (Complex.I * t) • (1 : Op n)) ∨
∃ a b : Fin n, a ≠ b ∧ (chain = true → ChainNeighbors a b) ∧ ∃ t : ℝ, U = evolve (heisenbergExchange a b) t}
/-- PDF p.9, A11: physical qubit permutation. -/
def wirePermutation {n : ℕ} (p : Equiv.Perm (Fin n)) : Op n :=
fun x y => if x = fun q => y (p.symm q) then 1 else 0
/-- PDF p.31, I3: the actual transposition of wires. -/
def wireSwap {n : ℕ} (a b : Fin n) : Op n := wirePermutation (Equiv.swap a b)
/-- PDF p.10, B1: ordered product of disjoint exchanges for an injective l-tuple. -/
def monomial {n l : ℕ} (i : Fin l ↪ Fin n) : Op n :=
(List.ofFn fun r : Fin (l / 2) =>
heisenbergExchange (i ⟨2 * r.val, by omega⟩) (i ⟨2 * r.val + 1, by omega⟩)).prod
/-- PDF p.10, B1 and Remark 1: all ordered injective tuples, divided by (l/2)!.
For even l>n the tuple type is empty, giving zero; l=0 gives I. Odd indices are unused. -/
def central (n l : ℕ) : Op n :=
if Even l then ((Nat.factorial (l / 2) : ℂ)⁻¹) • ∑ i : Fin l ↪ Fin n, monomial i else 0
/-- PDF p.11, B18: Q_l=R_12 R_34 ... R_(l-1),l, zero outside l≤n. -/
def standardQ (n l : ℕ) : Op n :=
if h : l ≤ n then monomial ⟨fun q => ⟨q.val, lt_of_lt_of_le q.isLt h⟩,
by
intro a b hab
have hval : a.val = b.val := congrArg (fun z : Fin n => z.val) hab
exact Fin.ext hval⟩ else 0
/-- PDF p.10, B4: the actual central eigenvalue, calculated from physical sector traces. -/
def centralEigenvalue (n l : ℕ) (j : Spin n) : ℝ :=
(Matrix.trace (central n l * spinProjector n j) / Matrix.trace (spinProjector n j)).re
/-- PDF pp.11,24: integer phase weight. The integrality theorem identifies this floor
with the physical eigenvalue, rather than assuming integer eigenvalues as input. -/
def eigenInt (n l : ℕ) (j : Spin n) : ℤ := Int.floor (centralEigenvalue n l j)
/-- PDF p.17, Proposition 1: the proposed real central span. -/
def centralSpace (n k : ℕ) : Submodule ℝ (Op n) :=
Submodule.span ℝ {A | ∃ r : Fin (k / 2 + 1), A = Complex.I • central n (2 * r.val)}
/-- PDF p.25, G9: the dual central operator. Statements only divide at physical indices. -/
def dualCentral (n l : ℕ) : Op n :=
(Matrix.trace (central n l ^ 2))⁻¹ • central n l
/-- PDF pp.3,22: coefficients in the central expansion. -/
def energyCoeff {n : ℕ} (H : Op n) (l : ℕ) : ℝ :=
(Matrix.trace (H * central n l) / Matrix.trace (central n l ^ 2)).re
/-- PDF p.22, E1: average energy on the physical spin sector. -/
def sectorMeanEnergy {n : ℕ} (H : Op n) (j : Spin n) : ℝ :=
(Matrix.trace (H * spinProjector n j) / Matrix.trace (spinProjector n j)).re
/-- PDF p.25: regroup the first n and last m physical wires. -/
def registerTensor {n m : ℕ} (A : Op n) (B : Op m) : Op (n + m) :=
fun x y => let e := (Fin.appendEquiv (α := Bool) n m).symm
A (e x).1 (e y).1 * B (e x).2 (e y).2
/-- PDF p.10, B7: the same physical operator in product-register coordinates. -/
def registerSplit {n m : ℕ} (A : Op (n + m)) :
Matrix (Qubits n × Qubits m) (Qubits n × Qubits m) ℂ :=
fun x y => A (Fin.appendEquiv n m x) (Fin.appendEquiv n m y)
/-- PDF pp.31–36: tensor vectors in the fixed physical wire ordering. -/
def tensorState {n m : ℕ} (v : Vec n) (w : Vec m) : Vec (n + m) :=
WithLp.toLp 2 (fun x => let e := (Fin.appendEquiv (α := Bool) n m).symm
v (e x).1 * w (e x).2)
/-- PDF p.24, G3: sector determinant angle, in the quotient modulo 2π. -/
def sectorAngle {n : ℕ} (U : Op n) (j : Spin n) : Real.Angle :=
(Complex.arg (sectorDet U j) : ℝ)
/-- PDF p.25: integer linear map on the physical sector-phase torus. -/
def phaseMap (n : ℕ) (theta : Spin n → Real.Angle) : Spin n → Real.Angle :=
fun r => ∑ j : Spin n, eigenInt n (2 * r.val) j • theta j
/-- PDF p.24, G5 and Remark 2: l-body phase, extended by zero beyond the physical range. -/
def bodyPhase {n : ℕ} (U : Op n) (l : ℕ) : Real.Angle :=
if Even l ∧ l ≤ 2 * (n / 2) then ∑ j : Spin n, eigenInt n l j • sectorAngle U j else 0
/-- PDF p.24, G2: the general integer-weight observable and phase. -/
def chargeOperator (n : ℕ) (c : Spin n → ℤ) : Op n :=
∑ j : Spin n, (c j : ℂ) • spinProjector n j
/-- PDF p.24, G2: an integer-weighted sum of full-sector determinant angles. -/
def chargePhase {n : ℕ} (U : Op n) (c : Spin n → ℤ) : Real.Angle :=
∑ j : Spin n, c j • sectorAngle U j
/-- PDF p.24, G1: the entrywise integral form of the Schrödinger propagator.
Every entry of H and -iHU is integrable on [0,T]. The integral equation gives an
absolutely continuous unitary path from I, including piecewise continuous controls.
In finite dimension this is equivalent to the matrix-valued integral equation. -/
def SchrodingerPropagator {n : ℕ} (H U : ℝ → Op n) (T : ℝ) : Prop :=
0 ≤ T ∧
(∀ x y : Qubits n, IntegrableOn (fun t => H t x y) (Set.Icc 0 T)) ∧
(∀ x y : Qubits n,
IntegrableOn (fun t => ((-Complex.I) • (H t * U t)) x y) (Set.Icc 0 T)) ∧
(∀ t ∈ Set.Icc 0 T, (H t).IsHermitian ∧ RotationInvariant (H t) ∧ SymUnitary (U t)) ∧
∀ t ∈ Set.Icc 0 T, ∀ x y : Qubits n,
U t x y = (1 : Op n) x y +
∫ s in (0 : ℝ)..t, ((-Complex.I) • (H s * U s)) x y
/-- PDF p.26, G17, corrected to include every physical even index: fixed generators
and their integer powers. Integer powers include inverses, so closure is the group. -/
def finitePhaseGroup (n : ℕ) : Submonoid (Op n) :=
Submonoid.closure {U |
(∃ (r : Spin n) (z : ℤ), U = NormedSpace.exp
((Complex.I * (2 * Real.pi : ℝ) * (z : ℂ)) • dualCentral n (2 * r.val))) ∨
(∃ (j : Spin n) (z : ℤ), U = NormedSpace.exp
((Complex.I * (2 * Real.pi : ℝ) * (z : ℂ) / Matrix.trace (spinProjector n j)) • spinProjector n j))}
/-- PDF p.26, G18: the phase factor with the source's principal representatives. -/
def centralPhaseFactor {n : ℕ} (U : Op n) : Op n :=
(List.ofFn fun r : Spin n => NormedSpace.exp
((Complex.I * ((bodyPhase U (2 * r.val)).toReal : ℂ)) • dualCentral n (2 * r.val))).prod
/-- PDF p.18, C17: independent scalar phases on physical spin sectors. -/
def sectorPhases (n : ℕ) (theta : Spin n → ℝ) : Op n :=
∑ j : Spin n, Complex.exp (Complex.I * theta j) • spinProjector n j
/-- PDF p.23, F1: the complex span of phase-free odd-weight Pauli strings. -/
def oddPauliSpace (n : ℕ) : Submodule ℂ (Op n) :=
Submodule.span ℂ {A | ∃ P : Stabilizer.PauliString n, P.phase = 0 ∧
Odd ((Finset.univ.filter fun q : Fin n => P.ops q ≠ Stabilizer.Pauli.I).card) ∧
A = P.toMatrix}
/-- PDF p.23, F4: conjugation by spin-half time reversal (Y tensor ... tensor Y) K.
The omitted scalar i^n cancels under conjugation. -/
def reverseTime {n : ℕ} (A : Op n) : Op n :=
QAlgorithms.Papers.Independent.Information100.P69.matrixPower pauliY n * (A.map conj : Op n) * (QAlgorithms.Papers.Independent.Information100.P69.matrixPower pauliY n)ᴴ
/-- PDF p.29, H1: the swap of the odd and even r-qubit registers. -/
def multiSwap (r : ℕ) : Op (2 * r) :=
(List.ofFn fun q : Fin r => wireSwap
(⟨2 * q.val, by omega⟩ : Fin (2 * r)) ⟨2 * q.val + 1, by omega⟩).prod
/-- PDF pp.29–30, H5, with the necessary empty product B_0=I. -/
def swapSum (n m : ℕ) : Op n :=
if Even m then (Nat.factorial (m / 2) : ℂ)⁻¹ •
∑ i : Fin m ↪ Fin n, (List.ofFn fun q : Fin (m / 2) =>
wireSwap (i ⟨2 * q.val, by omega⟩) (i ⟨2 * q.val + 1, by omega⟩)).prod else 0
/-- PDF p.30, H9/H11: only l≤m is evaluated; negative factorials never occur. -/
def permutationSumCoefficient (n m l : ℕ) : ℝ :=
(2 : ℝ) ^ ((l : ℤ) / 2 - (m : ℤ) / 2) * (Nat.factorial (n-l) : ℝ) /
((Nat.factorial (n-m) : ℝ) * (Nat.factorial ((m-l)/2) : ℝ))
/-- PDF pp.4,31: the ancillary triplet projector, on two physical qubits. -/
def triplet : Op 2 := (1 / 2 : ℂ) • (heisenbergExchange (0 : Fin 2) 1 + (3 / 2 : ℂ) • (1 : Op 2))
/-- PDF pp.11,31: the frozen normalized singlet, relabelled from a pair of
Fin 2 indices to the fixed two-wire Bool register. The p.4 typo is corrected by p.31. -/
def twoQubitSinglet : Vec 2 :=
WithLp.toLp 2 (fun x : Qubits 2 =>
QAlgorithms.Papers.Independent.Frontier18.P14.singlet
((if x 0 then 1 else 0), (if x 1 then 1 else 0)))
/-- PDF p.32, I8: prescribed monomial lift. The sum is over even s=4,...,l. -/
def liftQ (n l : ℕ) : Op (n + 2) :=
((2 : ℂ) ^ (l/2))⁻¹ • ((2 : ℂ) • registerTensor (standardQ n 2) (1 : Op 2) +
∑ r ∈ (Finset.range (l/2+1)).filter (fun r => 2 ≤ r),
(2 : ℂ) ^ r • (registerTensor (standardQ n (2*r)) (1 : Op 2) -
registerTensor (standardQ n (2*r-2)) (heisenbergExchange (0 : Fin 2) 1)))
/-- PDF p.32, I13: permutation averaging over data wires only. -/
def averageData {n : ℕ} (A : Op (n + 2)) : Op (n + 2) :=
(Nat.factorial n : ℂ)⁻¹ • ∑ p : Equiv.Perm (Fin n),
registerTensor (wirePermutation p) (1 : Op 2) * A * (registerTensor (wirePermutation p) (1 : Op 2))ᴴ
/-- PDF p.32, I17: the prescribed, rather than existential, central lift. -/
def liftCentral (n l : ℕ) : Op (n + 2) :=
((Nat.factorial n : ℂ) /
((Nat.factorial (n-l) : ℂ) * (Nat.factorial (l/2) : ℂ))) • averageData (liftQ n l)
/-- PDF p.33, I21: prescribed Hamiltonian including removal of its scalar trace. -/
def liftHamiltonian {n : ℕ} (H : Op n) : Op (n + 2) :=
registerTensor (H - (Matrix.trace H / (2 : ℂ)^n) • (1 : Op n)) (1 : Op 2) +
∑ r : Fin (n/2),
(energyCoeff H (2*(r.val+1)) : ℂ) •
(liftCentral n (2*(r.val+1)) - registerTensor (central n (2*(r.val+1))) (1 : Op 2))
/-- PDF p.34, I32: ordinary matrix commutator. -/
def comm {n : ℕ} (A B : Op n) : Op n := A * B - B * A
/-- PDF pp.34–35, I33/I36: four nested-commutator terms with their first
arguments supplied separately, allowing the source's recursive substitution. -/
def commutatorTemplate {n : ℕ} (w : Fin 6 ↪ Fin n) (F : Fin 4 → Op n) : Op n :=
let R := fun a b : Fin 6 => heisenbergExchange (w a) (w b);
-comm (comm (comm (comm (F 0) (R 1 2)) (R 2 3)) (R 3 4)) (R 4 0) -
comm (comm (comm (comm (F 1) (R 2 3)) (R 3 4)) (R 4 5)) (R 5 1) -
comm (comm (F 2) (R 1 2)) (R 1 3) + comm (comm (F 3) (R 3 4)) (R 3 5)
/-- PDF p.34, I32: the four initial exchanges used by the template. -/
def templateSeeds {n : ℕ} (w : Fin 6 ↪ Fin n) : Fin 4 → Op n :=
![heisenbergExchange (w 0) (w 1), heisenbergExchange (w 1) (w 2),
heisenbergExchange (w 0) (w 2), heisenbergExchange (w 2) (w 4)]
/-- PDF p.34, I35: complementary disjoint exchanges for the four first brackets.
Each complement avoids all three wires in the first bracket. -/
def templateComplements {n : ℕ} (w : Fin 6 ↪ Fin n) : Fin 4 → Op n :=
![heisenbergExchange (w 3) (w 4), heisenbergExchange (w 0) (w 4),
heisenbergExchange (w 3) (w 4), heisenbergExchange (w 0) (w 1)]
/-- PDF p.35: finite real Lie syntax in exchange generators; evaluation is skew-Hermitian. -/
inductive ExchangeExpr (n : ℕ) where
| zero
| generator (a b : Fin n) (distinct : a ≠ b)
| add (a b : ExchangeExpr n)
| scale (r : ℝ) (a : ExchangeExpr n)
| bracket (a b : ExchangeExpr n)
/-- PDF p.35: evaluate the actual finite expression, not an unconstrained cost or label. -/
def ExchangeExpr.eval {n : ℕ} : ExchangeExpr n → Op n
| .zero => 0
| .generator a b _ => Complex.I • heisenbergExchange a b
| .add a b => a.eval + b.eval
| .scale r a => r • a.eval
| .bracket a b => comm a.eval b.eval
/-- PDF p.33, I25: no arbitrary scalar term is included. -/
def monomialHamiltonian (n : ℕ)
(h : (l : ℕ) → (Fin l ↪ Fin n) → ℝ) : Op n :=
∑ r : Fin (n/2), ∑ i : Fin (2*(r.val+1)) ↪ Fin n,
(h (2*(r.val+1)) i : ℂ) • monomial i
/-- PDF pp.33–35: extend a partial injection to a permutation, independently of reachability.
For nonextendible input use identity; on a finite injective tuple an extension exists. -/
def extendTuple {n l : ℕ} (i : Fin l ↪ Fin n) : Equiv.Perm (Fin n) :=
if h : ∃ p : Equiv.Perm (Fin n),
∀ q : Fin l, ∀ hq : q.val < n, p ⟨q.val,hq⟩ = i q then h.choose else Equiv.refl _
/-- PDF pp.33–35: prescribed lift of every tuple by permutation of the explicit Q lift. -/
def liftTuple {n l : ℕ} (i : Fin l ↪ Fin n) : Op (n+2) :=
registerTensor (wirePermutation (extendTuple i)) (1 : Op 2) * liftQ n l *
(registerTensor (wirePermutation (extendTuple i)) (1 : Op 2))ᴴ
/-- PDF p.35: linear extension of the prescribed lifts, with no scalar loss. -/
def liftMonomialHamiltonian (n : ℕ)
(h : (l : ℕ) → (Fin l ↪ Fin n) → ℝ) : Op (n+2) :=
∑ r : Fin (n/2), ∑ i : Fin (2*(r.val+1)) ↪ Fin n,
(h (2*(r.val+1)) i : ℂ) • liftTuple i
/-- PDF p.36: matrices whose tensor-identity lift lies in the (n+1)-qubit local Lie algebra. -/
def assistedLieSet (n k : ℕ) : Set (Op n) :=
{A | registerTensor A (1 : Op 1) ∈ localLie (n+1) k}
/-- PDF p.36: targets admitting fixed pure ancillary input and output in V_k. -/
def OneAncillaReachable {n : ℕ} (k : ℕ) (V : Op n) : Prop :=
∃ (W : Op (n+1)) (eta etaOut : Vec 1), W ∈ localGroup (n+1) k ∧
IsState eta ∧ IsState etaOut ∧
∀ psi : Vec n, IsState psi →
act W (tensorState psi eta) = tensorState (act V psi) etaOut
example : spinMultiplicity 0 0 = 1 := by norm_num [spinMultiplicity]
example (n : ℕ) (r : Spin n) : spin n r = (n : ℝ)/2-r.val := by rfl
example (U : Matrix Bool Bool ℂ) (x y : Qubits 0) : QAlgorithms.Papers.Independent.Information100.P69.matrixPower U 0 x y = 1 := by
simp [QAlgorithms.Papers.Independent.Information100.P69.matrixPower]
example (n k : ℕ) : (1 : Op n) ∈ localGroup n k := (localGroup n k).one_mem
example (n : ℕ) : phaseMap n (fun _ => 0) = 0 := by
funext r
simp [phaseMap]
example (n : ℕ) : ExchangeExpr.eval (ExchangeExpr.zero : ExchangeExpr n) = 0 := by rfl
example : WireSupported ∅ (1 : Op 0) := by
refine ⟨1, ?_⟩
intro x y
have hxy : x = y := Subsingleton.elim _ _
subst y
simp
/-- Physical even body indices; PDF p.10, including l=0. -/
def ValidBody (n l : ℕ) : Prop := Even l ∧ l ≤ 2 * (n / 2)
/-- PDF p.36: the real vector space underlying the assisted tangent algebra. -/
def assistedLie (n k : ℕ) : Submodule ℝ (Op n) :=
Submodule.span ℝ (assistedLieSet n k)
/-- The singlet adapter preserves the |01> coefficient of the frozen vector. -/
example : twoQubitSinglet (![false, true] : Qubits 2) =
QAlgorithms.Papers.Independent.Frontier18.P14.singlet (0, 1) := by rfl
/-- PDF p.8: the single spin-zero and spin-one multiplicities on two qubits. -/
example : spinMultiplicity 2 0 = 1 ∧ spinMultiplicity 2 2 = 1 := by
norm_num [spinMultiplicity]
/-- PDF p.30, H9 at n=m=2: B_2=C_0+C_2, fixing the tuple normalization. -/
example : permutationSumCoefficient 2 2 0 = 1 ∧ permutationSumCoefficient 2 2 2 = 1 := by
norm_num [permutationSumCoefficient]
/-- PDF p.34: the zero exchange expression has zero bracket with any operator. -/
example (n : ℕ) (A : Op n) : comm A (0 : Op n) = 0 := by
simp [comm]
end QAlgorithms.Papers.Independent.Advance50.P49
end
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
QAlgorithms.Papers.Independent.Advance50.P49.ChainNeighbors
For any natural number and indices , this predicate means exactly . It is directed: must immediately follow , with no wraparound. No such pair exists when , and when there are no indices to supply.
QAlgorithms.Papers.Independent.Advance50.P49.ExchangeExpr.eval
For every natural number , this defines an evaluation from the formal expressions generated by zero, distinct-wire generators, addition, real scaling, and brackets to complex matrices on . Writing for the evaluation of an expression , its recursive rules are
where a generator requires , is any real number, and
The Pauli operators act on wire and as the identity elsewhere. For or , all available expressions evaluate to zero because no distinct-wire generator is available.
QAlgorithms.Papers.Independent.Advance50.P49.ExchangeExpr
For every natural number , this defines a type of finite formal expressions with five constructors: a zero expression; a generator specified by two indices together with a proof that ; the sum of two expressions; a real scalar multiplying an expression; and a bracket of two expressions. These are formal constructors: this definition does not identify expressions using linearity, antisymmetry, or other algebraic identities. The cases and are included, but then no generator with distinct indices exists.
QAlgorithms.Papers.Independent.Advance50.P49.OneAncillaReachable
For every natural number , natural number , and complex matrix on , this proposition says that there exist a complex matrix on qubits and one-qubit vectors , both of norm one, such that belongs to the submonoid generated by all unitary matrices on qubits that commute with for every one-qubit unitary and satisfy for some set of at most wires, and such that
The submonoid consists of finite products of the indicated generators, including the empty product; no topological closure is specified. The definition of is not included in the supplied code. Tensor-vector amplitudes are , and all operator actions are ordinary matrix-vector multiplication. The vectors are fixed independently of , and they are not required to be equal. There is no separate unitarity hypothesis on ; and are allowed.
QAlgorithms.Papers.Independent.Advance50.P49.RotationInvariant
For every natural number and every complex matrix indexed by Boolean strings , the predicate means that, for every unitary complex matrix indexed by the two Boolean values, commutes with the matrix whose entries are
The quantifier ranges over all such unitary . When , the empty product is , the string index set has one element, and every satisfies this predicate.
QAlgorithms.Papers.Independent.Advance50.P49.SchrodingerPropagator
For every natural number , two functions , and every real , this predicate requires ; Lebesgue integrability on of every entry of and every entry of ; and, for every , that is Hermitian, is unitary, and each of and commutes with for every unitary matrix , where . It further requires, for every such and every pair of -bit strings ,
There are no conditions on values outside . The cases and are included; when , the integral equation requires , while the pointwise Hermiticity, commutation, and unitarity requirements still apply at zero.
QAlgorithms.Papers.Independent.Advance50.P49.Special
For any natural number , including zero, and any complex matrix indexed by -bit strings, this predicate means that is unitary, commutes with for every unitary complex matrix , and satisfies
Here , , and is diagonal with entry at a bit string exactly when has true bits, and entry otherwise. Writing , the matrix is the increasing-order product over of , where , , and for the usual Pauli matrices . All determinants are on the full space, and empty products equal . For , the predicate requires the sole entry of to equal .
QAlgorithms.Papers.Independent.Advance50.P49.Spin--65e6b15f82fc
For every natural number , is the finite index set , containing elements. In particular, .
QAlgorithms.Papers.Independent.Advance50.P49.SymUnitary
For every natural number and every complex matrix indexed by , the predicate means that is unitary and, for every unitary complex matrix indexed by the two Boolean values, commutes with the matrix having entries . For , the commutation condition is automatic, and the predicate requires the sole complex entry of to have modulus .
QAlgorithms.Papers.Independent.Advance50.P49.ValidBody
For any natural numbers , this proposition means exactly that is even and
Thus zero is an allowed value of for every , including ; for odd , the upper bound is , and for even , it is .
QAlgorithms.Papers.Independent.Advance50.P49.angular
For every natural number and every complex matrix indexed by the two Boolean values, define
as a matrix indexed by Boolean strings of length , where when and agree at all wires other than , and otherwise. There is no assumption on . When , the sum is empty and the resulting matrix is zero.
QAlgorithms.Papers.Independent.Advance50.P49.assistedLie
For every pair of natural numbers , this defines the real linear span of all complex matrices on for which belongs to the real Lie subalgebra on qubits generated by matrices satisfying , commuting with for every one-qubit unitary , and satisfying for some set of at most wires. The definition of is not included in the supplied code. Here the Lie bracket is , , and acts as on the first qubits and as the identity on the final qubit. Consequently the defined submodule consists of finite real linear combinations of such , including the zero combination; the cases and are included.
QAlgorithms.Papers.Independent.Advance50.P49.assistedLieSet
For all natural numbers , this defines the set of complex matrices on for which , acting on the first qubits and one final qubit, belongs to the smallest real Lie subalgebra of matrices on containing every matrix satisfying
and for which there exists a set of at most wires satisfying the predicate . The definition of this last predicate is not included in the supplied code. Here is the one-qubit identity, , and the Lie bracket is the matrix commutator. The tensor product has entries . The cases and are included.
QAlgorithms.Papers.Independent.Advance50.P49.averageData
For every natural number and every complex matrix on -bit strings, with no Hermiticity or other assumption on , this defines
Here is the matrix on -bit strings with entry at row , column exactly when for every bit position , and entry otherwise; is the identity on the final two bits, tensor products use concatenation of the first bits with those final two bits, and denotes conjugate transpose. For , there is one permutation of the empty register and the defined matrix is .
QAlgorithms.Papers.Independent.Advance50.P49.blockDet
For every natural number , every complex matrix indexed by Boolean strings of length , and every , define
Here , where is diagonal with entry exactly on strings having true coordinates, and is the increasing-index product, over with , of , with in real arithmetic. The scalar inverse is embedded into , and , using , , in Boolean order false, true, and when agree outside , and zero otherwise. Empty products equal . The matrix is arbitrary; for , this determinant is its sole complex entry.
QAlgorithms.Papers.Independent.Advance50.P49.bodyPhase
For every natural number , every complex matrix on -bit strings, and every natural number , this defines an angle to be zero unless is even and ; when both conditions hold, it is
with the sum taken in . Here are the Pauli matrices on wire , , , and ; is the increasing-order product over in of . For even , is times the sum over injections of . Empty products equal ; division by zero and the argument of zero are defined as zero. There is no unitarity assumption on , and and are included.
QAlgorithms.Papers.Independent.Advance50.P49.casimir
For every natural number , define the matrix
on Boolean strings of length , where squares are matrix squares, , , and in the order false, true, and equals if agree outside wire , and zero otherwise. For , all three sums are empty and .
QAlgorithms.Papers.Independent.Advance50.P49.central
For every pair of natural numbers , this defines a complex matrix on length- Boolean strings by
The products are ordered by increasing , are the Pauli matrices, and
The sum ranges over all injections, without identifying injections that give the same product. For , this sum is empty, so . For , there is one empty injection and its product is the identity, so , including when .
QAlgorithms.Papers.Independent.Advance50.P49.centralEigenvalue
For all natural numbers and every integer index with , this defines the real number
All matrices act on length- Boolean strings. To specify the matrices in this expression, let be the Pauli matrices and define
For even , set
for odd , set . Also put
Each product is ordered by increasing index, and empty products equal . Thus , while when . The final quotient uses complex division, which gives zero if its denominator is zero. The definition includes , when .
QAlgorithms.Papers.Independent.Advance50.P49.centralPhaseFactor
For every natural number and every complex matrix on -bit strings, this defines the increasing-order product
where , the sum defining is in , and selects its real representative in . Here are the Pauli matrices on wire , , , and ; is the increasing-order product over of . Also, times the sum over injections of . Empty products equal , division by zero and the argument of zero are zero, no unitarity is assumed of , and is included.
QAlgorithms.Papers.Independent.Advance50.P49.centralSpace
For all natural numbers , this defines the real linear subspace of complex matrices on length- Boolean strings
where is the imaginary unit and
Here are the Pauli matrices and
Products are ordered by increasing . For , the unique empty injection contributes the identity, so is always among the generators. For , the injection sum is empty and contributes zero. In particular and both give ; is also allowed.
QAlgorithms.Papers.Independent.Advance50.P49.chargeOperator
For every natural number and every integer-valued function on , this defines the complex matrix
on -bit strings. Here , , with the Pauli matrices on wire , and is the increasing-order product over of
An empty product is , and the integer is regarded as a complex scalar. The definition allows arbitrary integers, including negative ones, and includes , when the result is .
QAlgorithms.Papers.Independent.Advance50.P49.chargePhase
For every natural number , every complex matrix indexed by -bit strings, and every integer-valued function on , this defines
Integer multiplication means repeated addition or subtraction of angles. Here , , where the Pauli matrices act on the indicated wire, and is the increasing-order product over in of . Empty products equal . No unitarity or invariance is required of ; a zero determinant contributes argument zero. The definition includes .
QAlgorithms.Papers.Independent.Advance50.P49.comm
For every natural number , including , and every pair of complex matrices indexed by -bit strings, this defines their commutator to be
There are no Hermiticity, unitarity, or symmetry assumptions on either matrix. When , the matrices have one row and one column, so the defined commutator is zero.
QAlgorithms.Papers.Independent.Advance50.P49.commutatorTemplate
For every natural number , every injection , and every collection of complex matrices on -bit strings, define
where the standard Pauli matrices act on the indicated bits and as identities on the remaining bits. The declaration defines the matrix
where each bracket means . The matrices have no additional assumptions. An injection of the required type exists only when .
QAlgorithms.Papers.Independent.Advance50.P49.dualCentral
For all natural numbers , this defines a complex matrix on length- Boolean strings by
where
and are the Pauli matrices. Products are ordered by increasing , empty products equal , and an empty injection sum is zero. Thus , and for odd or . The square is the matrix product . The inverse of its complex trace is defined to be zero when that trace is zero, in which case the resulting matrix is zero. No positivity or nonzero-trace assumption is required, and is included.
QAlgorithms.Papers.Independent.Advance50.P49.eigenInt
For all natural numbers and every index , this defines the integer
Here the matrices act on length- Boolean strings. Using the Pauli matrices , define
For even ,
and for odd . Further, with , , and , set
Products are ordered by increasing index; empty products equal , and empty sums equal zero. In particular , and for . Complex division by zero gives zero. The floor is the greatest integer less than or equal to the displayed real number; no integrality hypothesis is imposed. The case is included.
QAlgorithms.Papers.Independent.Advance50.P49.energyCoeff
For every natural number , every complex matrix on length- Boolean strings, and every natural number , this defines the real number
where
The pair-indexed matrices in this formula are specified independently of the input matrix . Here are the Pauli matrices, with
Products are ordered by increasing . Empty products equal , so ; empty injection sums are zero, so for . The denominator uses the matrix square , and complex division by zero gives zero. No Hermitian or rotation-invariance assumption is imposed on , and is allowed.
QAlgorithms.Papers.Independent.Advance50.P49.evolve
For any natural number , including zero, any complex matrix indexed by -bit strings, and any real number , this defines , using the matrix exponential. There is no assumption that is Hermitian or that is nonnegative. In particular, gives , and gives the exponential of a matrix.
QAlgorithms.Papers.Independent.Advance50.P49.exchangeGenerators
For any natural number and Boolean flags , this defines the set of complex matrices indexed by -bit strings such that either is true and , or there exist distinct wire indices such that, if is true, , and
Here are the usual Pauli matrices and . When is false, distinctness is the only restriction on . When , there are no exchange generators, so the set is empty if is false and is if it is true.
QAlgorithms.Papers.Independent.Advance50.P49.exchangeGroup
For any natural number and Boolean flags , each defaulting to false when omitted, this defines the multiplicative submonoid consisting of finite products of matrices of the following forms: for arbitrary real , permitted when is true; and
for arbitrary real and distinct wire indices , with the additional requirement when is true. Here are the usual Pauli matrices and . The empty product is included, and no topological closure is taken. For , the submonoid is when is false and consists of all when it is true.
QAlgorithms.Papers.Independent.Advance50.P49.exchangeLie
For any natural number and Boolean flags , each defaulting to false when omitted, this defines the smallest real Lie subalgebra of complex matrices indexed by -bit strings containing when is true and containing
for every pair of distinct wire indices , restricted to when is true. Here are the usual Pauli matrices, with . Generation permits real linear combinations and brackets , without topological closure. For , the result is when is false and the real span of when it is true.
QAlgorithms.Papers.Independent.Advance50.P49.extendTuple
For every pair of natural numbers and injection , this defines a permutation of as follows: if there exists a permutation such that, for every and every proof that , , it chooses one such permutation; otherwise it returns the identity permutation. No particular choice among qualifying permutations is specified. An admissible injection already forces . In particular, when , the condition on is vacuous, so the definition chooses a permutation without requiring that choice to be the identity.
QAlgorithms.Papers.Independent.Advance50.P49.finitePhaseGroup
For every natural number , this defines the smallest multiplicative submonoid of complex matrices on -bit strings containing all matrices of either form
where . To define these matrices, let be the Pauli matrices on wire , , , and . Then is the increasing-order product over in of , while is times the sum over injections of . Empty products equal , and division by zero is zero. Submonoid generation consists of finite products, including the empty product ; it does not take topological closure or assert that the resulting set is finite. The definition includes .
QAlgorithms.Papers.Independent.Advance50.P49.heisenbergExchange
For every natural number and every pair of wire indices , define
where matrix multiplication is used, , , and , with Boolean indices ordered false, true; is if the Boolean strings agree at every wire other than , and is zero otherwise. The definition does not require : when , it gives . For , no such indices exist.
QAlgorithms.Papers.Independent.Advance50.P49.highest
For every natural number and every , define the matrix , with this multiplication order, where is diagonal and its entry at a Boolean string is if exactly coordinates of are true, and otherwise. Here
where scalar division means multiplication by the real inverse, embedded into , and . In Boolean order false, true, , , , and if agree outside , and zero otherwise. Empty products equal ; in particular, for , the sole index is and .
QAlgorithms.Papers.Independent.Advance50.P49.liftCentral
For all natural numbers , this defines a complex matrix on bits by
where , sends a basis string to , and is the identity on the last two bits. To specify , put , define using standard Pauli matrices on the indicated bits, and set for , otherwise in increasing order, with empty product the identity; then
with the final acting on the last two bits. Every tensor product uses the first bits followed by the last two bits. The definition includes odd , , and ; no parity test or requirement is imposed, and all factorial denominators remain nonzero.
QAlgorithms.Papers.Independent.Advance50.P49.liftHamiltonian
For every natural number and arbitrary complex matrix on -bit strings, this defines a complex matrix on bits by
Here are the identities on bits and two bits respectively, and tensor products concatenate those registers. All the quantities in the formula are specified as follows: , using standard Pauli matrices acting on their indicated bits; if , and otherwise; and
Furthermore, with for a permutation of the bit positions, define
where the last acts on the two added bits, and
Products indexed by are ordered increasingly, empty products are identities, and empty sums are zero. No Hermiticity or rotation-invariance assumption is imposed on . A zero denominator in the complex quotient defining gives quotient zero. For or , the outer sum is empty; for , the entire defined matrix is zero.
QAlgorithms.Papers.Independent.Advance50.P49.liftMonomialHamiltonian
For every natural number and every real coefficient family , defined for each natural number and each injection , this defines the operator on qubits
where
Here is the identity on the last two qubits; , with standard Pauli operators on the indicated wires; and for , while otherwise , in increasing order, with empty product the identity. For each injection , choose a permutation extending its prescribed images of the initial wire indices when one exists, and use the identity otherwise; is one exactly when for all , and is zero otherwise. Tensor products put the -qubit register first and the two additional qubits last. Every injection is included in the inner sum. For or , the outer sum is empty and the resulting operator is zero.
QAlgorithms.Papers.Independent.Advance50.P49.liftQ
For every pair of natural numbers , this defines a complex matrix on bits as follows. Write , let on any specified register, where each Pauli matrix acts on its indicated bit and as the identity elsewhere, and define when , while for define , with factors in increasing order and an empty product equal to the identity. Then the defined matrix is
Here the tensor products put the -bit register first and the two-bit register last, is the identity on the two-bit register, and the in the final tensor factor acts on that last register. There are no parity or size restrictions on ; the sum is empty for , and out-of-range are zero by definition. In particular, and both give .
QAlgorithms.Papers.Independent.Advance50.P49.liftTuple
For all natural numbers and injections , this defines an operator on qubits by
Here is the identity on the final two qubits, , and the Pauli operators act on their indicated wires. For any natural number , is zero if , and otherwise is the increasing-order product on the first qubits; an empty product is the identity. The permutation underlying is chosen to extend when such a permutation exists, with the identity as the fallback, and its matrix entries are when for every wire , and zero otherwise. Tensor products use the first and final two wires in that order, and denotes conjugate transpose. The formula imposes no evenness or positivity requirement on ; in particular its leading term is present even when or .
QAlgorithms.Papers.Independent.Advance50.P49.localGroup
For any natural numbers , including zero, this defines as the smallest multiplicative submonoid of complex matrices indexed by -bit strings containing every matrix that is unitary, commutes with for every unitary complex matrix , and satisfies for some subset with . Here , with empty product . Membership means being a finite product of these generators, including the empty product ; no topological closure is taken. The definition of is not supplied. Empty subsets are allowed, and permits only the empty subset.
QAlgorithms.Papers.Independent.Advance50.P49.localLie
For any natural numbers , including zero, this defines as the smallest real Lie subalgebra of complex matrices indexed by -bit strings containing every such that , commutes with for every unitary complex matrix , and holds for some subset with . Here , with empty product . The generated Lie algebra is closed under real linear combinations and the bracket , without taking a topological closure. The definition of is not supplied; the empty subset is allowed and is the only possible subset when .
QAlgorithms.Papers.Independent.Advance50.P49.localSum
For any natural numbers , including zero, this defines as the complex linear span of all complex matrices indexed by -bit strings for which there exists a subset with satisfying . Thus its elements are finite complex linear combinations of matrices satisfying that condition, including the empty combination . The definition of the predicate is not supplied. The subset may be empty, and when it must be empty.
QAlgorithms.Papers.Independent.Advance50.P49.monomial
For all natural numbers and every injection , this defines a complex matrix on length- Boolean strings by the ordered product
with factors written from left to right in increasing . Here are the Pauli matrices, and, for ,
When is odd, the position is unused. For or , the product is empty and equals the identity. An injection of the required kind exists only when .
QAlgorithms.Papers.Independent.Advance50.P49.monomialHamiltonian
For every natural number and every family of real coefficients , specified for each natural number and each injection , this defines the complex matrix
on , where products are taken in increasing order of and
with each Pauli operator acting on its indicated wire and as the identity elsewhere. Thus only coefficient families with even lengths are used, and the inner sum includes every injection, including different orderings of the same wires. When or , the outer sum is empty and the result is zero.
QAlgorithms.Papers.Independent.Advance50.P49.multiSwap
For every natural number , this defines a complex matrix on the basis of all -bit strings by
where permutes basis strings by exchanging bits and : its entry at row , column is if is obtained from by that exchange, and otherwise. The factors appear in increasing order of the pair index. For , the product is empty and equals the identity matrix on the single empty bit string.
QAlgorithms.Papers.Independent.Advance50.P49.oddPauliSpace
For every natural number , this defines the complex linear span of all matrices
where each is one of the usual matrices , and the number of positions with is odd. Equivalently, the generators are precisely the tensor products of Pauli matrices having an odd number of nonidentity factors and having the specified Pauli-string phase equal to zero modulo four, so their scalar phase factor is . The span permits arbitrary finite complex linear combinations of these generators. For , there are no generators satisfying the oddness condition, and the span is the zero subspace.
QAlgorithms.Papers.Independent.Advance50.P49.onWire
For every natural number , every wire index , and every complex matrix indexed by the two Boolean values, define a matrix on Boolean strings by
Thus its entry is when and agree on every other wire, and zero otherwise. There is no restriction on . For , the product over other wires is the empty product ; for , there is no available wire index .
QAlgorithms.Papers.Independent.Advance50.P49.permutationSumCoefficient
For all natural numbers , without any ordering or parity assumptions, this defines the real number
where denotes truncated natural-number subtraction. The exponent is an integer and may be negative; its two halves are computed separately before subtraction. In particular, the formula also applies when , , or , using the indicated truncated differences. All factorial denominators are positive, with .
QAlgorithms.Papers.Independent.Advance50.P49.phaseMap
For every natural number and every assignment , where , this defines another assignment by
The integer coefficients act by repeated addition or subtraction of angles. To specify the matrices, let be the Pauli matrices on wire , set , , and . Then is the increasing-order product, over , of , and
Empty products equal , and division by zero is defined as zero. The definition includes .
QAlgorithms.Papers.Independent.Advance50.P49.registerSplit
For all natural numbers and every complex matrix on length- Boolean strings, this defines a matrix indexed by pairs consisting of a length- Boolean string and a length- Boolean string:
Here concatenation satisfies for and for . No additional assumption on is imposed. The definition includes , , and both zero, using the unique empty string for each zero-length register.
QAlgorithms.Papers.Independent.Advance50.P49.registerTensor
For all natural numbers , every complex matrix indexed by length- Boolean strings, and every complex matrix indexed by length- Boolean strings, this defines a matrix on length- Boolean strings by
where for , and for , with the same splitting for . No assumptions on or are required. Either register may have length zero; its set of Boolean strings then consists of the single empty string.
QAlgorithms.Papers.Independent.Advance50.P49.reverseTime
For every natural number and every complex matrix indexed by -bit strings, this defines
where is entrywise complex conjugation, is conjugate transpose, and, in the bit order ,
There is no Hermiticity, unitarity, or invariance requirement on . For , the empty tensor product is the one-dimensional identity, so the operation is complex conjugation of the single matrix entry.
QAlgorithms.Papers.Independent.Advance50.P49.sectorAngle
For every natural number , every complex matrix indexed by -bit strings, and every , this defines the angle
Here , with real division in , and
where are the usual Pauli matrices acting on wire , with identity on the other wires. Empty products equal . No unitarity or invariance hypothesis is imposed on ; the determinant may be zero, in which case its complex argument is defined to be zero. The definition includes .
QAlgorithms.Papers.Independent.Advance50.P49.sectorDet
For any natural number , any complex matrix indexed by -bit strings, and any integer index with , this defines . Here, writing , the matrix is the product, in increasing order of , of
where are the usual Pauli matrices and . The determinant is taken on the entire -dimensional space. No unitarity or invariance hypothesis is imposed on . Empty products equal ; in particular, when , and the definition gives .
QAlgorithms.Papers.Independent.Advance50.P49.sectorMeanEnergy
For every natural number , every complex matrix on length- Boolean strings, and every index , this defines
Explicitly, using the Pauli matrices , put
and define
The product runs from left to right in increasing , and an empty product is . The trace quotient is taken in before extracting its real part; it is zero if the denominator is zero. There is no Hermitian or rotation-invariance assumption on . The case is included.
QAlgorithms.Papers.Independent.Advance50.P49.sectorPhases
For every natural number and every real-valued function on , this defines
as a complex matrix on -bit strings. Here , , with the Pauli matrices acting on the indicated wire, and is the increasing-order product over of
Empty products equal . The parameters are arbitrary real numbers. In particular, is allowed and gives .
QAlgorithms.Papers.Independent.Advance50.P49.specialLie
For any natural numbers , including zero, this defines as the real linear span of those matrices for which for every ; these are complex trace equalities. Here is the real Lie algebra generated by matrices satisfying , commuting with every matrix whose -entry is for a unitary matrix , and satisfying for some subset of at most wires; the predicate is not defined in the supplied code. To specify , put , , and , where are the usual Pauli matrices and . Then
in increasing index order, with empty product . The outer real span includes the empty linear combination .
QAlgorithms.Papers.Independent.Advance50.P49.spin--728d437eb9f9
For every natural number and every index , define , where the division and subtraction in this expression are real arithmetic. Thus its values run from down to when is even, and down to when is odd; for , its sole value is .
QAlgorithms.Papers.Independent.Advance50.P49.spinMultiplicity
For all natural numbers , define the natural number
All arithmetic in the defining calculation is natural-number arithmetic: subtraction is truncated at zero and division takes the integer quotient. In the first branch, prevents subtraction from truncating, is an integer, and the final denominator is positive. This includes , for which the value is .
QAlgorithms.Papers.Independent.Advance50.P49.spinProjector
For every natural number and every , put , using real arithmetic, and define
The real scalar inverse is embedded into . Here is the identity on Boolean strings of length , and , where , , in Boolean order false, true, and equals when agree outside , and zero otherwise. The product omits ; its scalar denominators are nonzero for the permitted distinct indices. When or , the product is empty and equals .
QAlgorithms.Papers.Independent.Advance50.P49.standardQ
For all natural numbers , this defines a complex matrix on length- Boolean strings by
Factors occur from left to right in increasing . Here are the Pauli matrices, with their action on position defined by
For odd , position is unused. The product is empty when or , giving the identity whenever the condition holds; in particular .
QAlgorithms.Papers.Independent.Advance50.P49.swapSum
For all natural numbers , this defines a complex matrix on -bit strings. If is odd, the matrix is zero; if is even, it is
where the sum runs over all injections, the product is ordered by increasing , and has entry at row , column exactly when is obtained from by exchanging bits , with all other entries zero. Thus gives the identity, including when ; even gives zero because there are no injections.
QAlgorithms.Papers.Independent.Advance50.P49.templateComplements
For every natural number and injection , this defines a four-entry family of complex matrices on the -qubit basis , with entries indexed by , as
Here are the standard Pauli matrices acting on wire and the identity on every other wire. The first and third entries are identical. The injection requires six distinct wires, so there are no admissible arguments when .
QAlgorithms.Papers.Independent.Advance50.P49.templateSeeds
For every natural number and injection , this defines a four-entry collection of complex matrices on -bit strings by
where
and the standard Pauli matrices act on the indicated bits and as identities on all remaining bits. Although these four entries do not use , the argument still requires an injection of all six indices, so there is no such argument when .
QAlgorithms.Papers.Independent.Advance50.P49.tensorState
For all natural numbers , including zero, and all complex vectors indexed by -bit strings and indexed by -bit strings, this defines a vector on -bit strings by
where consists of the first bits of and consists of its remaining bits. No normalization is required. A zero-length register has one possible bit string, so its vector contributes its single complex coordinate as a scalar factor.
QAlgorithms.Papers.Independent.Advance50.P49.triplet
This defines the complex matrix on two-bit strings
where apply the respective standard Pauli matrix to bit and the identity to the other bit. Explicitly, in basis order , the defined matrix is
QAlgorithms.Papers.Independent.Advance50.P49.twoQubitSinglet
This defines a vector in the complex Euclidean space indexed by two-bit strings whose amplitude at is when and , is when and , and is zero for the other two strings. Equivalently, the vector is
where denotes the coordinate vector with amplitude at the bit string and zero elsewhere.
QAlgorithms.Papers.Independent.Advance50.P49.wirePermutation
For any natural number , including zero, and any permutation of , this defines the complex matrix indexed by -bit strings whose entry is exactly when for every wire , and is otherwise. Equivalently, it sends the coordinate basis vector labeled by to the one labeled by . When , there is one empty bit string and the matrix is the identity.
QAlgorithms.Papers.Independent.Advance50.P49.wireSwap
For every natural number and indices , this defines a complex matrix on the Boolean strings of length . If exchanges and , its entries are
Thus it permutes basis strings by exchanging these two positions. The indices need not be distinct: when , the matrix is the identity. For , no such indices exist.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.