Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Definitions for Representation Learning via Quantum Neural Tangent Kernels

Definition
QAlgorithms_Papers_Independent_Intakenext100_P88

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

prove2quantum

The objects the formalized statements of Representation Learning via Quantum Neural Tangent Kernels (arXiv:2111.04225) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • Ansatz: PDF pp.2,19 Eqs.(1),(54): fixed unitary gates and Hermitian generators.
  • writtenProd: PDF p.2 Eq.(1): increasing written order; the rightmost factor acts first. The frozen orderedProd has the opposite convention and is not used.
  • qntkFactor: PDF p.2 Eq.(1): W_l exp(+i theta_l X_l).
  • qntkCircuit: PDF p.2 Eq.(1): the actual ordered circuit.
  • circuitPrefix: PDF p.3 Eq.(6): circuitPrefix excluding layer l.
  • circuitSuffix: PDF p.3 Eq.(6): circuitSuffix excluding layer l.
  • coordinateDerivative: PDF p.23: coordinate derivative with respect to a real trainable angle.
  • second: PDF p.25: mixed derivative of the actual output, not a free tensor.
  • ExpectationNetwork: PDF p.5 Eq.(23): normalized feature states and Hermitian observables.
  • expectationOutput: PDF p.5 Eq.(23): real expectation, with first-slot-conjugate inner product.
  • expectationKernel: PDF p.23 Eq.(90): the full real expectation-value QNTK.
  • scaledOutput: PDF pp.3,24: absorb theta-star into W and rescale by delta.
  • jet: PDF p.26 Eq.(111): linear jet at the expansion point.
  • expectationHessian: PDF p.26 Eq.(111): mixed quadratic jet at the expansion point.
  • frozenKernel: PDF p.24 Eq.(97): frozen Gram kernel with delta-squared scaling.
  • quadraticOutput: PDF p.25 Eq.(105): retained quadratic Taylor polynomial, including 1/2.
  • deltaKernel: PDF p.26 Eq.(114): cubic cross terms of the Taylor-jet Gram matrix.
  • thetaCoefficient: PDF p.3 Eq.(5), p.19 Eq.(59): imaginary commutator expectation.
  • gCoefficient: PDF p.7 Eq.(40), SM p.26 Eq.(109), corrected to match Eq.(126). Printed: nested interval conjugations include an extra W_l conjugation even for k=l. Changed: use the suffix-conjugated generators Y_l=S_l^dagger X_l S_l and A=U(0)^dagger O U(0), with the larger index in the outer commutator. Why: differentiating the original ordered circuit gives this coefficient; for one layer W=H, X=Z, O=Z and phi=|+>, the printed coefficient is -4 whereas -z''(0)=4. This body contains only matrices and inner products, not the derivative it evaluates.
  • metaKernel: PDF p.7 Eq.(45): derivative definition of the meta-kernel.
  • l2Action: Euclidean L2 action, used in every norm estimate.
  • frozenResidual: PDF pp.24,30 Eqs.(98),(152): frozen residual recurrence before it is solved.
  • retainedResidual: PDF pp.26-27,33: retain degree zero and one in an auxiliary kernel perturbation K+sD. This coefficient recurrence omits higher delta orders and does not describe exact nonlinear GD.
  • prediction: PDF p.25 Eq.(102): unsolved general-data prediction recurrence.
  • logRate: PDF p.6 Eq.(32): norm of -log(I-step K), through its convergent power series. This is the paper's norm-log statistic, not the slowest-eigenmode convergence rate.
  • AmplitudeModel: PDF p.28 Eq.(128): normalized amplitude model.
  • basisAmplitude: PDF p.28 Eq.(128): all computational-basis output coordinates.
  • doubledAmplitude: PDF p.29 Eq.(138): false denotes z, true denotes conjugate z.
  • amplitudeKernel: PDF p.29 Eq.(135): all four blocks of the complex Gram matrix.
  • amplitudeJet: PDF pp.30-32: linear jet directly from the original circuit.
  • amplitudeHessian: PDF pp.31-32: mixed quadratic jet, including equal layer indices.
  • frozenAmplitudeKernel: PDF p.30 Eq.(150): frozen doubled kernel with rescaled angles.
  • deltaAmplitudeKernel: PDF p.32 Eqs.(167)-(169): cubic cross terms computed from the actual jets. The inconsistent G^(1), G^(2) shorthands are not used.
  • quadraticAmplitude: PDF p.31 Eq.(161): quadratic amplitude polynomial using correct circuit derivatives.
  • QuantumLayer: PDF p.36 Eqs.(190),(195): incoming quantum ensemble with normalized feature states. Observables are independent over the reals, so m is the dimension of their real span.
  • incomingQuantumOutput: PDF p.36: the actual incoming quantum expectation.
  • HybridLayer: PDF p.36 Eqs.(193)-(194): centered Gaussian coordinates, jointly independent of incoming outputs. Finite fourth moments prevent default nonintegrable integrals.
  • preactivation: PDF p.36 Eq.(193): affine preactivation, before any nonlinear activation.
  • connectedFour: PDF p.37 Eq.(197): subtract all three disconnected Wick pairings.
  • productCovariance: PDF p.38 Eq.(201): covariance of products, subtracting only one paired product.
  • kd: PDF p.37 Eq.(200): Kronecker delta for classical output coordinates.
  • fourContraction: PDF p.37 Eq.(200): three paired-product covariance contractions.
  • OptimizationModel: PDF p.2 Eq.(2): the scalar optimization target is the known minimum eigenvalue.
  • linearOutput: PDF p.24: the first Taylor polynomial in rescaled angles.
  • trainingIndex: PDF p.5: training indices are precisely the finite training data times observables.
  • trainingKernel: PDF pp.6,25: restrict the frozen kernel to training indices before taking any inverse.
Definition code
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Basic

/-! Statements for arXiv:2111.04225v3. Page numbers are PDF pages.
Dynamics mean frozen/retained coefficient dynamics, not exact nonlinear GD.
Incompatible source packages are recorded in HARD.md. -/

noncomputable section

namespace QAlgorithms.Papers.Independent.Intakenext100.P88

open scoped BigOperators ComplexConjugate Topology NNReal ComplexOrder
open MeasureTheory ProbabilityTheory Filter

/-- PDF pp.2,19 Eqs.(1),(54): fixed unitary gates and Hermitian generators. -/
structure Ansatz (h L : ℕ) where
  dim_pos : 0 < h
  W : Fin L → Matrix.unitaryGroup (Fin h) ℂ
  X : Fin L → Matrix (Fin h) (Fin h) ℂ
  hermitian : ∀ l, (X l).IsHermitian

/-- PDF p.2 Eq.(1): increasing written order; the rightmost factor acts first.
The frozen `orderedProd` has the opposite convention and is not used. -/
def writtenProd {h L : ℕ} (F : Fin L → Matrix (Fin h) (Fin h) ℂ) :=
  (List.ofFn F).prod

/-- PDF p.2 Eq.(1): W_l exp(+i theta_l X_l). -/
def qntkFactor {h L : ℕ} (c : Ansatz h L) (theta : Fin L → ℝ) (l : Fin L) :=
  (c.W l : Matrix (Fin h) (Fin h) ℂ) *
    NormedSpace.exp (((theta l : ℂ) * Complex.I) • c.X l)

/-- PDF p.2 Eq.(1): the actual ordered circuit. -/
def qntkCircuit {h L : ℕ} (c : Ansatz h L) (theta : Fin L → ℝ) :=
  writtenProd (qntkFactor c theta)

/-- PDF p.3 Eq.(6): circuitPrefix excluding layer l. -/
def circuitPrefix {h L : ℕ} (c : Ansatz h L) (theta : Fin L → ℝ) (l : Fin L) :=
  writtenProd (fun k => if k < l then qntkFactor c theta k else 1)

/-- PDF p.3 Eq.(6): circuitSuffix excluding layer l. -/
def circuitSuffix {h L : ℕ} (c : Ansatz h L) (theta : Fin L → ℝ) (l : Fin L) :=
  writtenProd (fun k => if l < k then qntkFactor c theta k else 1)

/-- PDF p.23: coordinate derivative with respect to a real trainable angle. -/
def coordinateDerivative {L : ℕ} {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    (f : (Fin L → ℝ) → E) (theta : Fin L → ℝ) (l : Fin L) : E :=
  deriv (fun s : ℝ => f (Function.update theta l s)) (theta l)

/-- PDF p.25: mixed derivative of the actual output, not a free tensor. -/
def second {L : ℕ} {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    (f : (Fin L → ℝ) → E) (theta : Fin L → ℝ) (k l : Fin L) : E :=
  coordinateDerivative (fun u => coordinateDerivative f u l) theta k

/-- PDF p.5 Eq.(23): normalized feature states and Hermitian observables. -/
structure ExpectationNetwork (D I : Type*) (h L : ℕ) where
  ansatz : Ansatz h L
  phi : D → EuclideanSpace ℂ (Fin h)
  normalized : ∀ x, QAlgorithms.IsState (phi x)
  observable : I → Matrix (Fin h) (Fin h) ℂ
  hermitian : ∀ i, (observable i).IsHermitian

/-- PDF p.5 Eq.(23): real expectation, with first-slot-conjugate inner product. -/
def expectationOutput {D I : Type*} {h L : ℕ} (M : ExpectationNetwork D I h L)
    (theta : Fin L → ℝ) (a : D × I) : ℝ :=
  (inner ℂ (QAlgorithms.act (qntkCircuit M.ansatz theta) (M.phi a.1))
    (QAlgorithms.act (M.observable a.2)
      (QAlgorithms.act (qntkCircuit M.ansatz theta) (M.phi a.1)))).re

/-- PDF p.23 Eq.(90): the full real expectation-value QNTK. -/
def expectationKernel {D I : Type*} {h L : ℕ} (M : ExpectationNetwork D I h L)
    (theta : Fin L → ℝ) (a b : D × I) : ℝ :=
  ∑ l, coordinateDerivative (fun u => expectationOutput M u a) theta l * coordinateDerivative (fun u => expectationOutput M u b) theta l

/-- PDF pp.3,24: absorb theta-star into W and rescale by delta. -/
def scaledOutput {D I : Type*} {h L : ℕ} (M : ExpectationNetwork D I h L)
    (delta : ℝ) (v : Fin L → ℝ) (a : D × I) : ℝ :=
  expectationOutput M (fun l => delta * v l) a

/-- PDF p.26 Eq.(111): linear jet at the expansion point. -/
def jet {D I : Type*} {h L : ℕ} (M : ExpectationNetwork D I h L)
    (delta : ℝ) (a : D × I) (l : Fin L) : ℝ :=
  coordinateDerivative (fun v => scaledOutput M delta v a) 0 l

/-- PDF p.26 Eq.(111): mixed quadratic jet at the expansion point. -/
def expectationHessian {D I : Type*} {h L : ℕ} (M : ExpectationNetwork D I h L)
    (delta : ℝ) (a : D × I) (k l : Fin L) : ℝ :=
  second (fun v => scaledOutput M delta v a) 0 k l

/-- PDF p.24 Eq.(97): frozen Gram kernel with delta-squared scaling. -/
def frozenKernel {D I : Type*} {h L : ℕ} (M : ExpectationNetwork D I h L)
    (delta : ℝ) (a b : D × I) : ℝ :=
  ∑ l, jet M delta a l * jet M delta b l

/-- PDF p.25 Eq.(105): retained quadratic Taylor polynomial, including 1/2. -/
def quadraticOutput {D I : Type*} {h L : ℕ} (M : ExpectationNetwork D I h L)
    (delta : ℝ) (v : Fin L → ℝ) (a : D × I) : ℝ :=
  expectationOutput M 0 a + (∑ l, jet M delta a l * v l) +
    (1 / 2 : ℝ) * ∑ k, ∑ l, expectationHessian M delta a k l * v k * v l

/-- PDF p.26 Eq.(114): cubic cross terms of the Taylor-jet Gram matrix. -/
def deltaKernel {D I : Type*} {h L : ℕ} (M : ExpectationNetwork D I h L)
    (delta : ℝ) (v : Fin L → ℝ) (a b : D × I) : ℝ :=
  ∑ l, (jet M delta a l * (∑ k, expectationHessian M delta b k l * v k) +
    (∑ k, expectationHessian M delta a k l * v k) * jet M delta b l)

/-- PDF p.3 Eq.(5), p.19 Eq.(59): imaginary commutator expectation. -/
def thetaCoefficient {D I : Type*} {h L : ℕ} (M : ExpectationNetwork D I h L)
    (theta : Fin L → ℝ) (a : D × I) (l : Fin L) : ℂ :=
  let P := circuitPrefix M.ansatz theta l
  let S := circuitSuffix M.ansatz theta l
  let F := qntkFactor M.ansatz theta l
  let A := F.conjTranspose * P.conjTranspose * M.observable a.2 * P * F
  inner ℂ (M.phi a.1)
    (QAlgorithms.act (S.conjTranspose * (M.ansatz.X l * A - A * M.ansatz.X l) * S)
      (M.phi a.1))

/-- PDF p.7 Eq.(40), SM p.26 Eq.(109), corrected to match Eq.(126).
Printed: nested interval conjugations include an extra W_l conjugation even for k=l.
Changed: use the suffix-conjugated generators Y_l=S_l^dagger X_l S_l and
A=U(0)^dagger O U(0), with the larger index in the outer commutator.
Why: differentiating the original ordered circuit gives this coefficient; for one layer
W=H, X=Z, O=Z and phi=|+>, the printed coefficient is -4 whereas -z''(0)=4.
This body contains only matrices and inner products, not the derivative it evaluates. -/
def gCoefficient {D I : Type*} {h L : ℕ} (M : ExpectationNetwork D I h L)
    (a : D × I) (k l : Fin L) : ℂ :=
  let U := qntkCircuit M.ansatz 0
  let A := U.conjTranspose * M.observable a.2 * U
  let Sk := circuitSuffix M.ansatz 0 k
  let Sl := circuitSuffix M.ansatz 0 l
  let Yk := Sk.conjTranspose * M.ansatz.X k * Sk
  let Yl := Sl.conjTranspose * M.ansatz.X l * Sl
  let C := if k ≤ l then
      Yl * (Yk * A - A * Yk) - (Yk * A - A * Yk) * Yl
    else
      Yk * (Yl * A - A * Yl) - (Yl * A - A * Yl) * Yk
  inner ℂ (M.phi a.1) (QAlgorithms.act C (M.phi a.1))

/-- PDF p.7 Eq.(45): derivative definition of the meta-kernel. -/
def metaKernel {D I : Type*} {h L : ℕ} (M : ExpectationNetwork D I h L)
    (delta : ℝ) (a b c : D × I) : ℝ :=
  ∑ k, ∑ l, expectationHessian M delta a k l * jet M delta b k * jet M delta c l

/-- Euclidean L2 action, used in every norm estimate. -/
def l2Action {𝕜 T : Type*} [RCLike 𝕜] [Fintype T]
    (A : Matrix T T 𝕜) (v : EuclideanSpace 𝕜 T) : EuclideanSpace 𝕜 T :=
  WithLp.toLp 2 (A.mulVec (WithLp.ofLp v))

/-- PDF pp.24,30 Eqs.(98),(152): frozen residual recurrence before it is solved. -/
def frozenResidual {𝕜 T : Type*} [RCLike 𝕜] [Fintype T] [DecidableEq T]
    (K : Matrix T T 𝕜) (step : ℝ) (e : EuclideanSpace 𝕜 T) : ℕ → EuclideanSpace 𝕜 T
  | 0 => e
  | t + 1 => l2Action (1 - step • K) (frozenResidual K step e t)

/-- PDF pp.26-27,33: retain degree zero and one in an auxiliary kernel perturbation K+sD.
This coefficient recurrence omits higher delta orders and does not describe exact nonlinear GD. -/
def retainedResidual {𝕜 T : Type*} [RCLike 𝕜] [Fintype T] [DecidableEq T]
    (K D : Matrix T T 𝕜) (step : ℝ) (e : EuclideanSpace 𝕜 T) :
    ℕ → EuclideanSpace 𝕜 T × EuclideanSpace 𝕜 T
  | 0 => (e, 0)
  | t + 1 =>
    let prev := retainedResidual K D step e t
    (l2Action (1 - step • K) prev.1,
      l2Action (1 - step • K) prev.2 - step • l2Action D prev.1)

/-- PDF p.25 Eq.(102): unsolved general-data prediction recurrence. -/
def prediction {D T : Type*} [Fintype T] [DecidableEq T]
    (K : D → D → ℝ) (embed : T → D) (step : ℝ) (z : D → ℝ)
    (e : EuclideanSpace ℝ T) : ℕ → D → ℝ
  | 0 => z
  | t + 1 => fun a => prediction K embed step z e t a -
      step * ∑ b, K a (embed b) * frozenResidual (fun i j => K (embed i) (embed j)) step e t b

/-- PDF p.6 Eq.(32): norm of -log(I-step K), through its convergent power series.
This is the paper's norm-log statistic, not the slowest-eigenmode convergence rate. -/
def logRate {T : Type*} [Fintype T] [DecidableEq T] (K : Matrix T T ℝ) (step : ℝ) : ℝ :=
  QAlgorithms.specNorm (∑' n : ℕ, (1 / ((n : ℝ) + 1)) • ((step • K) ^ (n + 1)))

/-- PDF p.28 Eq.(128): normalized amplitude model. -/
structure AmplitudeModel (D : Type*) (h L : ℕ) where
  ansatz : Ansatz h L
  phi : D → EuclideanSpace ℂ (Fin h)
  normalized : ∀ x, QAlgorithms.IsState (phi x)

/-- PDF p.28 Eq.(128): all computational-basis output coordinates. -/
def basisAmplitude {D : Type*} {h L : ℕ} (M : AmplitudeModel D h L)
    (theta : Fin L → ℝ) (a : D × Fin h) : ℂ :=
  QAlgorithms.act (qntkCircuit M.ansatz theta) (M.phi a.1) a.2

/-- PDF p.29 Eq.(138): false denotes z, true denotes conjugate z. -/
def doubledAmplitude {D : Type*} {h L : ℕ} (M : AmplitudeModel D h L)
    (theta : Fin L → ℝ) (a : D × Bool × Fin h) : ℂ :=
  if a.2.1 then star (basisAmplitude M theta (a.1, a.2.2))
  else basisAmplitude M theta (a.1, a.2.2)

/-- PDF p.29 Eq.(135): all four blocks of the complex Gram matrix. -/
def amplitudeKernel {D : Type*} {h L : ℕ} (M : AmplitudeModel D h L)
    (theta : Fin L → ℝ) (a b : D × Bool × Fin h) : ℂ :=
  ∑ l, coordinateDerivative (fun u => doubledAmplitude M u a) theta l *
    star (coordinateDerivative (fun u => doubledAmplitude M u b) theta l)

/-- PDF pp.30-32: linear jet directly from the original circuit. -/
def amplitudeJet {D : Type*} {h L : ℕ} (M : AmplitudeModel D h L)
    (delta : ℝ) (a : D × Bool × Fin h) (l : Fin L) : ℂ :=
  coordinateDerivative (fun v => doubledAmplitude M (fun k => delta * v k) a) 0 l

/-- PDF pp.31-32: mixed quadratic jet, including equal layer indices. -/
def amplitudeHessian {D : Type*} {h L : ℕ} (M : AmplitudeModel D h L)
    (delta : ℝ) (a : D × Bool × Fin h) (k l : Fin L) : ℂ :=
  second (fun v => doubledAmplitude M (fun j => delta * v j) a) 0 k l

/-- PDF p.30 Eq.(150): frozen doubled kernel with rescaled angles. -/
def frozenAmplitudeKernel {D : Type*} {h L : ℕ} (M : AmplitudeModel D h L)
    (delta : ℝ) (a b : D × Bool × Fin h) : ℂ :=
  ∑ l, amplitudeJet M delta a l * star (amplitudeJet M delta b l)

/-- PDF p.32 Eqs.(167)-(169): cubic cross terms computed from the actual jets.
The inconsistent G^(1), G^(2) shorthands are not used. -/
def deltaAmplitudeKernel {D : Type*} {h L : ℕ} (M : AmplitudeModel D h L)
    (delta : ℝ) (v : Fin L → ℝ) (a b : D × Bool × Fin h) : ℂ :=
  ∑ l, (amplitudeJet M delta a l *
      star (∑ k, (v k : ℂ) * amplitudeHessian M delta b k l) +
    (∑ k, (v k : ℂ) * amplitudeHessian M delta a k l) * star (amplitudeJet M delta b l))

/-- PDF p.31 Eq.(161): quadratic amplitude polynomial using correct circuit derivatives. -/
def quadraticAmplitude {D : Type*} {h L : ℕ} (M : AmplitudeModel D h L)
    (delta : ℝ) (v : Fin L → ℝ) (a : D × Bool × Fin h) : ℂ :=
  doubledAmplitude M 0 a + (∑ l, amplitudeJet M delta a l * (v l : ℂ)) +
    (1 / 2 : ℂ) * ∑ k, ∑ l, amplitudeHessian M delta a k l * (v k : ℂ) * (v l : ℂ)

/-- PDF p.36 Eqs.(190),(195): incoming quantum ensemble with normalized feature states.
Observables are independent over the reals, so m is the dimension of their real span. -/
structure QuantumLayer (Ω D : Type*) (h L m : ℕ) where
  ansatz : Ω → Ansatz h L
  theta : Ω → Fin L → ℝ
  phi : Ω → D → EuclideanSpace ℂ (Fin h)
  normalized : ∀ w a, QAlgorithms.IsState (phi w a)
  observable : Ω → Fin m → Matrix (Fin h) (Fin h) ℂ
  hermitian : ∀ w j, (observable w j).IsHermitian
  independent : ∀ w, LinearIndependent ℝ (observable w)

/-- PDF p.36: the actual incoming quantum expectation. -/
def incomingQuantumOutput {Ω D : Type*} {h L m : ℕ} (q : QuantumLayer Ω D h L m)
    (a : D) (j : Fin m) (w : Ω) : ℝ :=
  (inner ℂ (QAlgorithms.act (qntkCircuit (q.ansatz w) (q.theta w)) (q.phi w a))
    (QAlgorithms.act (q.observable w j)
      (QAlgorithms.act (qntkCircuit (q.ansatz w) (q.theta w)) (q.phi w a)))).re

/-- PDF p.36 Eqs.(193)-(194): centered Gaussian coordinates, jointly independent of
incoming outputs. Finite fourth moments prevent default nonintegrable integrals. -/
structure HybridLayer {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω)
    (D R : Type*) [Fintype R] (h L m : ℕ) (CW CB : ℝ≥0) where
  width_pos : 0 < m
  quantum : QuantumLayer Ω D h L m
  noise : (R × Fin m) ⊕ R → Ω → ℝ
  measurable_noise : ∀ i, Measurable (noise i)
  gaussian : ∀ i, Measure.map (noise i) μ = gaussianReal 0
    (match i with | Sum.inl _ => CW / (m : ℝ≥0) | Sum.inr _ => CB)
  independent_noise : iIndepFun noise μ
  independent_quantum : IndepFun
    (fun w => fun i => noise i w)
    (fun w => fun a => fun j => incomingQuantumOutput quantum a j w) μ
  measurable_quantum : ∀ a j, Measurable (incomingQuantumOutput quantum a j)
  fourth_moment : ∀ a j, MemLp (incomingQuantumOutput quantum a j) 4 μ

/-- PDF p.36 Eq.(193): affine preactivation, before any nonlinear activation. -/
def preactivation {Ω D R : Type*} [MeasurableSpace Ω] [Fintype R] {μ : Measure Ω}
    {h L m : ℕ} {CW CB : ℝ≥0} (S : HybridLayer μ D R h L m CW CB)
    (a : D) (r : R) (w : Ω) : ℝ :=
  (∑ j, S.noise (Sum.inl (r, j)) w * incomingQuantumOutput S.quantum a j w) +
    S.noise (Sum.inr r) w

/-- PDF p.37 Eq.(197): subtract all three disconnected Wick pairings. -/
def connectedFour {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω)
    (f1 f2 f3 f4 : Ω → ℝ) : ℝ :=
  (∫ w, f1 w * f2 w * f3 w * f4 w ∂μ) -
    (∫ w, f1 w * f2 w ∂μ) * (∫ w, f3 w * f4 w ∂μ) -
    (∫ w, f1 w * f3 w ∂μ) * (∫ w, f2 w * f4 w ∂μ) -
    (∫ w, f1 w * f4 w ∂μ) * (∫ w, f2 w * f3 w ∂μ)

/-- PDF p.38 Eq.(201): covariance of products, subtracting only one paired product. -/
def productCovariance {Ω D : Type*} [MeasurableSpace Ω] (μ : Measure Ω)
    {h L m : ℕ} (q : QuantumLayer Ω D h L m)
    (a b c d : D) (j k : Fin m) : ℝ :=
  (∫ w, incomingQuantumOutput q a j w * incomingQuantumOutput q b j w *
    incomingQuantumOutput q c k w * incomingQuantumOutput q d k w ∂μ) -
  (∫ w, incomingQuantumOutput q a j w * incomingQuantumOutput q b j w ∂μ) *
    (∫ w, incomingQuantumOutput q c k w * incomingQuantumOutput q d k w ∂μ)

/-- PDF p.37 Eq.(200): Kronecker delta for classical output coordinates. -/
def kd {R : Type*} [DecidableEq R] (r s : R) : ℝ := if r = s then 1 else 0

/-- PDF p.37 Eq.(200): three paired-product covariance contractions. -/
def fourContraction {Ω D R : Type*} [MeasurableSpace Ω] [Fintype R] [DecidableEq R]
    {μ : Measure Ω} {h L m : ℕ} {CW CB : ℝ≥0}
    (S : HybridLayer μ D R h L m CW CB) (a b c d : D) (r s t u : R) : ℝ :=
  ((CW : ℝ) / (m : ℝ)) ^ 2 *
    (kd r s * kd t u * (∑ j, ∑ k, productCovariance μ S.quantum a b c d j k) +
     kd r t * kd s u * (∑ j, ∑ k, productCovariance μ S.quantum a c b d j k) +
     kd r u * kd s t * (∑ j, ∑ k, productCovariance μ S.quantum a d b c j k))

/-! Sanity checks for the local constructions, with no admitted proofs. -/

example {h : ℕ} (F : Fin 0 → Matrix (Fin h) (Fin h) ℂ) : writtenProd F = 1 := by
  simp [writtenProd]

example {h : ℕ} (F : Fin 2 → Matrix (Fin h) (Fin h) ℂ) :
    writtenProd F = F 0 * F 1 := by
  simp [writtenProd, List.ofFn_succ]

example {𝕜 T : Type*} [RCLike 𝕜] [Fintype T] [DecidableEq T]
    (K D : Matrix T T 𝕜) (s : ℝ) (e : EuclideanSpace 𝕜 T) :
    retainedResidual K D s e 0 = (e, 0) := rfl

example {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) :
    connectedFour μ (fun _ => 0) (fun _ => 0) (fun _ => 0) (fun _ => 0) = 0 := by
  simp [connectedFour]

/-- PDF p.2 Eq.(2): the scalar optimization target is the known minimum eigenvalue. -/
structure OptimizationModel (h L : ℕ) where
  model : ExpectationNetwork Unit Unit h L
  minimum : ℝ
  minimum_eigenvalue :
    (∃ v : EuclideanSpace ℂ (Fin h), QAlgorithms.IsState v ∧
      QAlgorithms.act (model.observable ()) v = (minimum : ℂ) • v) ∧
    ∀ v : EuclideanSpace ℂ (Fin h), QAlgorithms.IsState v →
      minimum ≤ (inner ℂ v (QAlgorithms.act (model.observable ()) v)).re

/-- PDF p.24: the first Taylor polynomial in rescaled angles. -/
def linearOutput {D I : Type*} {h L : ℕ} (M : ExpectationNetwork D I h L)
    (delta : ℝ) (v : Fin L → ℝ) (a : D × I) : ℝ :=
  expectationOutput M 0 a + ∑ l, jet M delta a l * v l

/-- PDF p.5: training indices are precisely the finite training data times observables. -/
def trainingIndex {D T I : Type*} (embed : T ↪ D) (a : T × I) : D × I :=
  (embed a.1, a.2)

/-- PDF pp.6,25: restrict the frozen kernel to training indices before taking any inverse. -/
def trainingKernel {D T I : Type*} {h L : ℕ}
    (M : ExpectationNetwork D I h L) (delta : ℝ) (embed : T ↪ D) :
    Matrix (T × I) (T × I) ℝ :=
  fun a b => frozenKernel M delta (trainingIndex embed a) (trainingIndex embed b)

end QAlgorithms.Papers.Independent.Intakenext100.P88

end
Source
Representation Learning via Quantum Neural Tangent Kernels, arXiv:2111.04225v3, https://arxiv.org/abs/2111.04225v3
Read-back

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

QAlgorithms.Papers.Independent.Intakenext100.P88.AmplitudeModel

For any type DDD and natural numbers h,Lh,Lh,L, an amplitude model consists of a proof that h>0h>0h>0, a family of unitary complex h×hh\times hh×h matrices WrW_rWr​ indexed by 0≤r<L0\le r<L0≤r<L, a family of complex h×hh\times hh×h matrices XrX_rXr​ with Xr∗=XrX_r^*=X_rXr∗​=Xr​ for every rrr, and a function ϕ:D→Ch\phi:D\to\mathbb C^hϕ:D→Ch satisfying

∥ϕ(x)∥2=1for every x∈D.\|\phi(x)\|_2=1\qquad\text{for every }x\in D.∥ϕ(x)∥2​=1for every x∈D.

The positivity proof and the matrix families together form the stored ansatz. The type DDD may be empty, making the normalization requirement vacuous. The case L=0L=0L=0 is allowed and has empty matrix families, whereas h=0h=0h=0 admits no such model, even when DDD is empty.

QAlgorithms.Papers.Independent.Intakenext100.P88.Ansatz

For natural numbers h,Lh,Lh,L, an element of Ansatz(h,L)\mathrm{Ansatz}(h,L)Ansatz(h,L) consists of a proof that h>0h>0h>0, a family of unitary complex h×hh\times hh×h matrices WlW_lWl​, and a family of complex h×hh\times hh×h matrices XlX_lXl​, together with a proof that every XlX_lXl​ is Hermitian, where lll ranges over 0,…,L−10,\ldots,L-10,…,L−1. Thus h=0h=0h=0 admits no such element. The value L=0L=0L=0 is allowed; in that case both matrix families are empty and the Hermitian condition is vacuous.

QAlgorithms.Papers.Independent.Intakenext100.P88.ExpectationNetwork

For arbitrary types D,ID,ID,I and natural numbers h,Lh,Lh,L, an element of ExpectationNetwork(D,I,h,L)\mathrm{ExpectationNetwork}(D,I,h,L)ExpectationNetwork(D,I,h,L) consists of an ansatz with h>0h>0h>0, unitary complex h×hh\times hh×h matrices WlW_lWl​, and Hermitian complex h×hh\times hh×h matrices XlX_lXl​ for 0≤l<L0\leq l<L0≤l<L; a map ϕ:D→Ch\phi:D\to\mathbb C^hϕ:D→Ch, with the Euclidean norm, together with a proof that ∥ϕ(x)∥=1\|\phi(x)\|=1∥ϕ(x)∥=1 for every x∈Dx\in Dx∈D; and a family of complex h×hh\times hh×h matrices OiO_iOi​, indexed by i∈Ii\in Ii∈I, together with a proof that every OiO_iOi​ is Hermitian. Neither DDD nor III is required to be finite or nonempty. No such network exists for h=0h=0h=0; L=0L=0L=0 is allowed, with empty ansatz matrix families.

QAlgorithms.Papers.Independent.Intakenext100.P88.HybridLayer

For a measurable space Ω\OmegaΩ, a measure μ\muμ on Ω\OmegaΩ, arbitrary types DDD and RRR with RRR finite, natural numbers h,L,mh,L,mh,L,m, and nonnegative real numbers CW,CBC_W,C_BCW​,CB​, this structure contains the following data and requirements. It requires m>0m>0m>0 and a family of quantum layers indexed by w∈Ωw\in\Omegaw∈Ω: at each www, an ansatz supplies h>0h>0h>0, unitary complex h×hh\times hh×h matrices Wl(w)W_l(w)Wl​(w), and Hermitian complex h×hh\times hh×h matrices Xl(w)X_l(w)Xl​(w), for 0≤l<L0\le l<L0≤l<L; there are real parameters θl(w)\theta_l(w)θl​(w), vectors ϕ(w,a)∈Ch\phi(w,a)\in\mathbb C^hϕ(w,a)∈Ch of Euclidean norm 111 for every a∈Da\in Da∈D, and Hermitian matrices Oj(w)O_j(w)Oj​(w), 0≤j<m0\le j<m0≤j<m, whose family is linearly independent over R\mathbb RR. Write

U(w)=∏l=0L−1(Wl(w)exp⁡ ⁣(iθl(w)Xl(w))),qa,j(w)=Re⁡⟨U(w)ϕ(w,a), Oj(w)U(w)ϕ(w,a)⟩,U(w)=\prod_{l=0}^{L-1}\left(W_l(w)\exp\!\bigl(i\theta_l(w)X_l(w)\bigr)\right), \qquad q_{a,j}(w)=\operatorname{Re}\left\langle U(w)\phi(w,a),\,O_j(w)U(w)\phi(w,a)\right\rangle,U(w)=l=0∏L−1​(Wl​(w)exp(iθl​(w)Xl​(w))),qa,j​(w)=Re⟨U(w)ϕ(w,a),Oj​(w)U(w)ϕ(w,a)⟩,

where the product has increasing indices from left to right, the empty product is the identity, matrix action is ordinary matrix–vector multiplication, and the inner product is the standard complex Euclidean inner product. The structure also supplies real functions ξα:Ω→R\xi_\alpha:\Omega\to\mathbb Rξα​:Ω→R, indexed by the disjoint union (R×{0,…,m−1})⊔R(R\times\{0,\ldots,m-1\})\sqcup R(R×{0,…,m−1})⊔R. Each ξα\xi_\alphaξα​ is measurable; its pushforward of μ\muμ is the centered real Gaussian measure of variance CW/mC_W/mCW​/m for an index (r,j)(r,j)(r,j) in the first summand and of variance CBC_BCB​ for an index rrr in the second summand. These functions are mutually independent under μ\muμ, and the entire random family (ξα)α(\xi_\alpha)_\alpha(ξα​)α​ is independent of the entire random family (qa,j)a,j(q_{a,j})_{a,j}(qa,j​)a,j​. Every qa,jq_{a,j}qa,j​ is measurable and belongs to L4(μ)L^4(\mu)L4(μ), meaning it is almost everywhere strongly measurable and has finite fourth absolute moment. No probability-measure assumption on μ\muμ is separately supplied. Zero variances are allowed and give point masses at zero; L=0L=0L=0 is allowed; and RRR may be empty, in which case there are no noise coordinates. The requirements imposed separately at each www are vacuous when Ω\OmegaΩ is empty.

QAlgorithms.Papers.Independent.Intakenext100.P88.OptimizationModel

For natural numbers h,Lh,Lh,L, this structure supplies a model whose data and observable index types are both singletons, together with a real number λ\lambdaλ. Explicitly, the model contains h>0h>0h>0, unitary complex h×hh\times hh×h matrices WlW_lWl​ and Hermitian complex h×hh\times hh×h matrices XlX_lXl​, for 0≤l<L0\le l<L0≤l<L, one vector ϕ∈Ch\phi\in\mathbb C^hϕ∈Ch of Euclidean norm 111, and one Hermitian complex h×hh\times hh×h matrix OOO. Its additional requirement is the conjunction

(∃v∈Ch, ∥v∥2=1 and Ov=λv)∧(∀v∈Ch, ∥v∥2=1 ⟹ λ≤Re⁡⟨v,Ov⟩).\left(\exists v\in\mathbb C^h,\ \|v\|_2=1\ \text{and}\ Ov=\lambda v\right) \quad\land\quad \left(\forall v\in\mathbb C^h,\ \|v\|_2=1\ \Longrightarrow\ \lambda\le \operatorname{Re}\langle v,Ov\rangle\right).(∃v∈Ch, ∥v∥2​=1 and Ov=λv)∧(∀v∈Ch, ∥v∥2​=1 ⟹ λ≤Re⟨v,Ov⟩).

In the eigenvector equation, the real number λ\lambdaλ acts through its inclusion in C\mathbb CC; matrix action and the inner product are standard. The existentially quantified vector need not be unique and need not equal ϕ\phiϕ. The case L=0L=0L=0 is allowed, whereas h=0h=0h=0 cannot support such a structure.

QAlgorithms.Papers.Independent.Intakenext100.P88.QuantumLayer

For any types Ω,D\Omega,DΩ,D and natural numbers h,L,mh,L,mh,L,m, a quantum layer consists of the following data and requirements: for every w∈Ωw\in\Omegaw∈Ω, an ansatz providing h>0h>0h>0, unitary complex h×hh\times hh×h matrices Wr(w)W_r(w)Wr​(w), and Hermitian complex h×hh\times hh×h matrices Xr(w)X_r(w)Xr​(w) for 0≤r<L0\le r<L0≤r<L; real parameters θr(w)\theta_r(w)θr​(w); vectors ϕ(w,a)∈Ch\phi(w,a)\in\mathbb C^hϕ(w,a)∈Ch satisfying ∥ϕ(w,a)∥2=1\|\phi(w,a)\|_2=1∥ϕ(w,a)∥2​=1 for every w∈Ωw\in\Omegaw∈Ω and a∈Da\in Da∈D; and matrices Oj(w)∈Ch×hO_j(w)\in\mathbb C^{h\times h}Oj​(w)∈Ch×h, for 0≤j<m0\le j<m0≤j<m, satisfying Oj(w)∗=Oj(w)O_j(w)^*=O_j(w)Oj​(w)∗=Oj​(w). For each www, the matrices Oj(w)O_j(w)Oj​(w) must be linearly independent over R\mathbb RR, meaning

∀(cj)j<m∈Rm,∑j=0m−1cjOj(w)=0 ⟹ ∀j<m, cj=0.\forall(c_j)_{j<m}\in\mathbb R^m,\qquad \sum_{j=0}^{m-1}c_jO_j(w)=0 \ \Longrightarrow\ \forall j<m,\ c_j=0.∀(cj​)j<m​∈Rm,j=0∑m−1​cj​Oj​(w)=0 ⟹ ∀j<m, cj​=0.

The cases L=0L=0L=0 and m=0m=0m=0 are permitted; when m=0m=0m=0, the Hermitian and linear-independence requirements concern the empty family. If DDD is empty, normalization is vacuous. If Ω\OmegaΩ is empty, all the indexed data and requirements are vacuous, so h=0h=0h=0 is permitted; if Ω\OmegaΩ is nonempty, the ansatz requirement forces h>0h>0h>0.

QAlgorithms.Papers.Independent.Intakenext100.P88.amplitudeHessian

For any type DDD, natural numbers h,Lh,Lh,L, amplitude model MMM, real number δ\deltaδ, index a=(x,ε,z)∈D×{false,true}×{0,…,h−1}a=(x,\varepsilon,z)\in D\times\{\mathrm{false},\mathrm{true}\}\times\{0,\ldots,h-1\}a=(x,ε,z)∈D×{false,true}×{0,…,h−1}, and coordinates 0≤k,l<L0\le k,l<L0≤k,l<L, the model supplies h>0h>0h>0, unitary matrices WrW_rWr​, Hermitian matrices XrX_rXr​, and unit vectors ϕ(x)∈Ch\phi(x)\in\mathbb C^hϕ(x)∈Ch. Form U(u)=∏r=0L−1(WreiurXr)U(u)=\prod_{r=0}^{L-1}(W_re^{iu_rX_r})U(u)=∏r=0L−1​(Wr​eiur​Xr​), in increasing index order from left to right, and define Aa(u)A_a(u)Aa​(u) as (U(u)ϕ(x))z(U(u)\phi(x))_z(U(u)ϕ(x))z​, conjugated when ε\varepsilonε is true. Put Fa(v)=Aa(δv)F_a(v)=A_a(\delta v)Fa​(v)=Aa​(δv), where (δv)r=δvr(\delta v)_r=\delta v_r(δv)r​=δvr​. For any f:RL→Cf:\mathbb R^L\to\mathbb Cf:RL→C, let Drf(u)D_rf(u)Dr​f(u) be the real-variable derivative at s=urs=u_rs=ur​ of s↦f(u[r←s])s\mapsto f(u[r\leftarrow s])s↦f(u[r←s]), assigned zero if this derivative does not exist. This defines

Hδ,a,k,l:=amplitudeHessian⁡(M,δ,a,k,l)=Dk(u↦DlFa(u))(0).H_{\delta,a,k,l}:=\operatorname{amplitudeHessian}(M,\delta,a,k,l) = D_k\bigl(u\mapsto D_lF_a(u)\bigr)(0).Hδ,a,k,l​:=amplitudeHessian(M,δ,a,k,l)=Dk​(u↦Dl​Fa​(u))(0).

The lll-coordinate derivative is taken first and the kkk-coordinate derivative second, both ultimately evaluated at the zero vector; k=lk=lk=l is allowed. Every real δ\deltaδ, including zero, is permitted, and δ=0\delta=0δ=0 gives zero. If L=0L=0L=0, no k,lk,lk,l can be supplied; if DDD is empty, no aaa can be supplied.

QAlgorithms.Papers.Independent.Intakenext100.P88.amplitudeJet

For any type DDD, natural numbers h,Lh,Lh,L, amplitude model MMM, real number δ\deltaδ, index a=(x,ε,z)∈D×{false,true}×{0,…,h−1}a=(x,\varepsilon,z)\in D\times\{\mathrm{false},\mathrm{true}\}\times\{0,\ldots,h-1\}a=(x,ε,z)∈D×{false,true}×{0,…,h−1}, and coordinate 0≤l<L0\le l<L0≤l<L, the model supplies h>0h>0h>0, unitary matrices WrW_rWr​, Hermitian matrices XrX_rXr​, and unit vectors ϕ(x)∈Ch\phi(x)\in\mathbb C^hϕ(x)∈Ch. Let U(u)=∏r=0L−1(WreiurXr)U(u)=\prod_{r=0}^{L-1}(W_re^{iu_rX_r})U(u)=∏r=0L−1​(Wr​eiur​Xr​), with increasing indices from left to right and identity as the empty product, and let Aa(u)A_a(u)Aa​(u) be (U(u)ϕ(x))z(U(u)\phi(x))_z(U(u)ϕ(x))z​, conjugated when ε\varepsilonε is true. With ele_lel​ the lll-th standard coordinate vector in RL\mathbb R^LRL, this defines

Jδ,a,l:=amplitudeJet⁡(M,δ,a,l)=ddsAa(δsel)∣s=0.J_{\delta,a,l}:=\operatorname{amplitudeJet}(M,\delta,a,l) = \left.\frac{d}{ds}A_a(\delta s e_l)\right|_{s=0}.Jδ,a,l​:=amplitudeJet(M,δ,a,l)=dsd​Aa​(δsel​)​s=0​.

The derivative is taken with respect to the real variable sss and is assigned zero if it does not exist. There is no sign or nonzero restriction on δ\deltaδ; when δ=0\delta=0δ=0, the differentiated function is constant and the value is zero. If L=0L=0L=0, there is no admissible coordinate lll; if DDD is empty, there is no admissible aaa.

QAlgorithms.Papers.Independent.Intakenext100.P88.amplitudeKernel

For any type DDD, natural numbers h,Lh,Lh,L, amplitude model MMM, real parameter vector θ∈RL\theta\in\mathbb R^Lθ∈RL, and indices a,b∈D×{false,true}×{0,…,h−1}a,b\in D\times\{\mathrm{false},\mathrm{true}\}\times\{0,\ldots,h-1\}a,b∈D×{false,true}×{0,…,h−1}, the model supplies h>0h>0h>0, unitary matrices WrW_rWr​, Hermitian matrices XrX_rXr​, and unit vectors ϕ(x)∈Ch\phi(x)\in\mathbb C^hϕ(x)∈Ch. Set U(u)=∏r=0L−1(WreiurXr)U(u)=\prod_{r=0}^{L-1}(W_re^{iu_rX_r})U(u)=∏r=0L−1​(Wr​eiur​Xr​), in increasing index order from left to right, and let A(x,ε,z)(u)A_{(x,\varepsilon,z)}(u)A(x,ε,z)​(u) be (U(u)ϕ(x))z(U(u)\phi(x))_z(U(u)ϕ(x))z​ when ε\varepsilonε is false and its complex conjugate when ε\varepsilonε is true. For a function f:RL→Cf:\mathbb R^L\to\mathbb Cf:RL→C, define Drf(u)D_rf(u)Dr​f(u) to be the derivative at s=urs=u_rs=ur​ of the real-variable function s↦f(u[r←s])s\mapsto f(u[r\leftarrow s])s↦f(u[r←s]), where u[r←s]u[r\leftarrow s]u[r←s] replaces only coordinate rrr. This derivative operation returns zero when that function is not differentiable at the specified point. The defined complex kernel is

KM(θ;a,b)=∑r=0L−1DrAa(θ) DrAb(θ)‾.K_M(\theta;a,b) = \sum_{r=0}^{L-1}D_rA_a(\theta)\, \overline{D_rA_b(\theta)}.KM​(θ;a,b)=r=0∑L−1​Dr​Aa​(θ)Dr​Ab​(θ)​.

The case L=0L=0L=0 is allowed and gives zero by the empty-sum convention. If DDD is empty, no such a,ba,ba,b exist.

QAlgorithms.Papers.Independent.Intakenext100.P88.basisAmplitude

For any type DDD, natural numbers h,Lh,Lh,L, amplitude model MMM, real parameter vector θ=(θr)r<L\theta=(\theta_r)_{r<L}θ=(θr​)r<L​, and pair a=(x,z)a=(x,z)a=(x,z) with x∈Dx\in Dx∈D and 0≤z<h0\le z<h0≤z<h, this defines a complex number as follows. The model supplies h>0h>0h>0, unitary matrices WrW_rWr​, Hermitian matrices XrX_rXr​, and vectors ϕ(x)∈Ch\phi(x)\in\mathbb C^hϕ(x)∈Ch of Euclidean norm one. Form the matrix product in increasing index order, with the smaller indices on the left,

U(θ)=(W0eiθ0X0)⋯(WL−1eiθL−1XL−1).U(\theta)= \bigl(W_0e^{i\theta_0X_0}\bigr)\cdots \bigl(W_{L-1}e^{i\theta_{L-1}X_{L-1}}\bigr).U(θ)=(W0​eiθ0​X0​)⋯(WL−1​eiθL−1​XL−1​).

Then the defined amplitude is

basisAmplitude⁡(M,θ,(x,z))=(U(θ)ϕ(x))z=∑y=0h−1U(θ)zyϕ(x)y.\operatorname{basisAmplitude}(M,\theta,(x,z)) =(U(\theta)\phi(x))_z =\sum_{y=0}^{h-1}U(\theta)_{zy}\phi(x)_y.basisAmplitude(M,θ,(x,z))=(U(θ)ϕ(x))z​=y=0∑h−1​U(θ)zy​ϕ(x)y​.

The exponentials are matrix exponentials. If L=0L=0L=0, the product is the identity and the amplitude is ϕ(x)z\phi(x)_zϕ(x)z​. If DDD is empty, there is no admissible pair aaa.

QAlgorithms.Papers.Independent.Intakenext100.P88.circuitPrefix

For natural numbers h,Lh,Lh,L, an ansatz ccc consisting of h>0h>0h>0, unitary complex h×hh\times hh×h matrices WkW_kWk​, and Hermitian complex h×hh\times hh×h matrices XkX_kXk​ for 0≤k<L0\leq k<L0≤k<L, a real parameter vector θ∈RL\theta\in\mathbb R^Lθ∈RL, and an index 0≤l<L0\leq l<L0≤l<L, this definition takes the product, in increasing order of kkk, whose factor is Wkexp⁡(iθkXk)W_k\exp(i\theta_kX_k)Wk​exp(iθk​Xk​) when k<lk<lk<l and the identity matrix otherwise. Equivalently, it is (W0exp⁡(iθ0X0))⋯(Wl−1exp⁡(iθl−1Xl−1))(W_0\exp(i\theta_0X_0))\cdots(W_{l-1}\exp(i\theta_{l-1}X_{l-1}))(W0​exp(iθ0​X0​))⋯(Wl−1​exp(iθl−1​Xl−1​)). Here iii is the imaginary unit and exp⁡\expexp is the matrix exponential. For l=0l=0l=0 the result is the identity; supplying lll requires L>0L>0L>0.

QAlgorithms.Papers.Independent.Intakenext100.P88.circuitSuffix

For natural numbers h,Lh,Lh,L, an ansatz ccc consisting of h>0h>0h>0, unitary complex h×hh\times hh×h matrices WkW_kWk​, and Hermitian complex h×hh\times hh×h matrices XkX_kXk​ for 0≤k<L0\leq k<L0≤k<L, a real parameter vector θ∈RL\theta\in\mathbb R^Lθ∈RL, and an index 0≤l<L0\leq l<L0≤l<L, this definition takes the product, in increasing order of kkk, whose factor is Wkexp⁡(iθkXk)W_k\exp(i\theta_kX_k)Wk​exp(iθk​Xk​) when l<kl<kl<k and the identity matrix otherwise. Equivalently, it is (Wl+1exp⁡(iθl+1Xl+1))⋯(WL−1exp⁡(iθL−1XL−1))(W_{l+1}\exp(i\theta_{l+1}X_{l+1}))\cdots(W_{L-1}\exp(i\theta_{L-1}X_{L-1}))(Wl+1​exp(iθl+1​Xl+1​))⋯(WL−1​exp(iθL−1​XL−1​)). Here iii is the imaginary unit and exp⁡\expexp is the matrix exponential. For l=L−1l=L-1l=L−1 the result is the identity; supplying lll requires L>0L>0L>0.

QAlgorithms.Papers.Independent.Intakenext100.P88.connectedFour

For every measurable space Ω\OmegaΩ, every measure μ\muμ on it, and every four functions f1,f2,f3,f4:Ω→Rf_1,f_2,f_3,f_4:\Omega\to\mathbb Rf1​,f2​,f3​,f4​:Ω→R, this definition gives the real number

∫Ωf1(w)f2(w)f3(w)f4(w) dμ(w)−(∫Ωf1(w)f2(w) dμ(w))(∫Ωf3(w)f4(w) dμ(w))−(∫Ωf1(w)f3(w) dμ(w))(∫Ωf2(w)f4(w) dμ(w))−(∫Ωf1(w)f4(w) dμ(w))(∫Ωf2(w)f3(w) dμ(w)).\begin{aligned} &\int_\Omega f_1(w)f_2(w)f_3(w)f_4(w)\,d\mu(w)\\ &\quad-\left(\int_\Omega f_1(w)f_2(w)\,d\mu(w)\right) \left(\int_\Omega f_3(w)f_4(w)\,d\mu(w)\right)\\ &\quad-\left(\int_\Omega f_1(w)f_3(w)\,d\mu(w)\right) \left(\int_\Omega f_2(w)f_4(w)\,d\mu(w)\right)\\ &\quad-\left(\int_\Omega f_1(w)f_4(w)\,d\mu(w)\right) \left(\int_\Omega f_2(w)f_3(w)\,d\mu(w)\right). \end{aligned}​∫Ω​f1​(w)f2​(w)f3​(w)f4​(w)dμ(w)−(∫Ω​f1​(w)f2​(w)dμ(w))(∫Ω​f3​(w)f4​(w)dμ(w))−(∫Ω​f1​(w)f3​(w)dμ(w))(∫Ω​f2​(w)f4​(w)dμ(w))−(∫Ω​f1​(w)f4​(w)dμ(w))(∫Ω​f2​(w)f3​(w)dμ(w)).​

There are no assumptions that μ\muμ is a probability measure, that the functions are measurable or integrable, or that they have zero mean. Each integral is the total real-valued integral used in the declaration: an integrand that is not integrable contributes zero for that integral. An empty underlying space is allowed.

QAlgorithms.Papers.Independent.Intakenext100.P88.coordinateDerivative

For any natural number LLL, any normed additive commutative group EEE equipped with a compatible normed real vector-space structure, any function f:RL→Ef:\mathbb R^L\to Ef:RL→E, any θ∈RL\theta\in\mathbb R^Lθ∈RL, and any index 0≤l<L0\leq l<L0≤l<L, this definition is the one-variable derivative at s=θls=\theta_ls=θl​ of s↦f(θ[l←s])s\mapsto f(\theta^{[l\leftarrow s]})s↦f(θ[l←s]), where θ[l←s]\theta^{[l\leftarrow s]}θ[l←s] agrees with θ\thetaθ except that its lll-th coordinate is sss. This uses the total derivative operation, which returns 0∈E0\in E0∈E if no derivative exists at that point; no differentiability assumption is imposed. Supplying lll requires L>0L>0L>0.

QAlgorithms.Papers.Independent.Intakenext100.P88.deltaAmplitudeKernel

For any type DDD, natural numbers h,Lh,Lh,L, amplitude model MMM, real number δ\deltaδ, vector v∈RLv\in\mathbb R^Lv∈RL, and indices a,b∈D×{false,true}×{0,…,h−1}a,b\in D\times\{\mathrm{false},\mathrm{true}\}\times\{0,\ldots,h-1\}a,b∈D×{false,true}×{0,…,h−1}, the model supplies h>0h>0h>0, unitary matrices WrW_rWr​, Hermitian matrices XrX_rXr​, and unit vectors ϕ(x)∈Ch\phi(x)\in\mathbb C^hϕ(x)∈Ch. Let U(u)=∏r=0L−1(WreiurXr)U(u)=\prod_{r=0}^{L-1}(W_re^{iu_rX_r})U(u)=∏r=0L−1​(Wr​eiur​Xr​), in increasing index order from left to right with identity as the empty product, and let A(x,ε,z)(u)A_{(x,\varepsilon,z)}(u)A(x,ε,z)​(u) be (U(u)ϕ(x))z(U(u)\phi(x))_z(U(u)ϕ(x))z​, conjugated when ε\varepsilonε is true. Set Fa(u)=Aa(δu)F_a(u)=A_a(\delta u)Fa​(u)=Aa​(δu). For f:RL→Cf:\mathbb R^L\to\mathbb Cf:RL→C, write Drf(u)D_rf(u)Dr​f(u) for the derivative at s=urs=u_rs=ur​ of s↦f(u[r←s])s\mapsto f(u[r\leftarrow s])s↦f(u[r←s]), assigned zero if it does not exist, and set Ja,l=DlFa(0)J_{a,l}=D_lF_a(0)Ja,l​=Dl​Fa​(0) and Ha,k,l=Dk(u↦DlFa(u))(0)H_{a,k,l}=D_k(u\mapsto D_lF_a(u))(0)Ha,k,l​=Dk​(u↦Dl​Fa​(u))(0). This defines the complex number

ΔKM,δ,v(a,b)=∑l=0L−1[Ja,l ∑k=0L−1vkHb,k,l‾+(∑k=0L−1vkHa,k,l)Jb,l‾],\Delta K_{M,\delta,v}(a,b) = \sum_{l=0}^{L-1} \left[ J_{a,l}\, \overline{\sum_{k=0}^{L-1}v_kH_{b,k,l}} + \left(\sum_{k=0}^{L-1}v_kH_{a,k,l}\right) \overline{J_{b,l}} \right],ΔKM,δ,v​(a,b)=l=0∑L−1​​Ja,l​k=0∑L−1​vk​Hb,k,l​​+(k=0∑L−1​vk​Ha,k,l​)Jb,l​​​,

where each real vkv_kvk​ is regarded as a complex number in the products. Repeated indices k=lk=lk=l are included. The value is zero when L=0L=0L=0, when δ=0\delta=0δ=0, or when v=0v=0v=0. If DDD is empty, no a,ba,ba,b exist.

QAlgorithms.Papers.Independent.Intakenext100.P88.deltaKernel

For arbitrary types D,ID,ID,I, natural numbers h,Lh,Lh,L, and an expectation network MMM, the network carries h>0h>0h>0, unitary complex h×hh\times hh×h matrices WjW_jWj​, Hermitian matrices XjX_jXj​ for 0≤j<L0\le j<L0≤j<L, unit vectors ϕx∈Ch\phi_x\in\mathbb C^hϕx​∈Ch for x∈Dx\in Dx∈D, and Hermitian matrices OiO_iOi​ for i∈Ii\in Ii∈I. Define U(θ)=∏j=0L−1Wjexp⁡(iθjXj)U(\theta)=\prod_{j=0}^{L-1}W_j\exp(\mathrm i\theta_jX_j)U(θ)=∏j=0L−1​Wj​exp(iθj​Xj​), in increasing index order with empty product the identity, and f(x,i)(θ)=Re⁡⟨U(θ)ϕx,OiU(θ)ϕx⟩f_{(x,i)}(\theta)=\operatorname{Re}\langle U(\theta)\phi_x,O_iU(\theta)\phi_x\ranglef(x,i)​(θ)=Re⟨U(θ)ϕx​,Oi​U(θ)ϕx​⟩. For any real δ\deltaδ, any v∈RLv\in\mathbb R^Lv∈RL, and a,b∈D×Ia,b\in D\times Ia,b∈D×I, let gc(u)=fc(δu)g_c(u)=f_c(\delta u)gc​(u)=fc​(δu), Jc,l=Dlgc(0)J_{c,l}=D_lg_c(0)Jc,l​=Dl​gc​(0), and Hc,kl=Dk(Dlgc)(0)H_{c,kl}=D_k(D_lg_c)(0)Hc,kl​=Dk​(Dl​gc​)(0), where Djg(u)=ddsg(u[j←s])∣s=ujD_jg(u)=\left.\frac{d}{ds}g(u[j\leftarrow s])\right|_{s=u_j}Dj​g(u)=dsd​g(u[j←s])​s=uj​​, with zero returned where differentiability fails. The real number defined is deltaKernel⁡(M,δ,v,a,b)=∑l=0L−1[Ja,l(∑k=0L−1Hb,klvk)+(∑k=0L−1Ha,klvk)Jb,l]\operatorname{deltaKernel}(M,\delta,v,a,b)=\sum_{l=0}^{L-1}\left[J_{a,l}\left(\sum_{k=0}^{L-1}H_{b,kl}v_k\right)+\left(\sum_{k=0}^{L-1}H_{a,kl}v_k\right)J_{b,l}\right]deltaKernel(M,δ,v,a,b)=∑l=0L−1​[Ja,l​(∑k=0L−1​Hb,kl​vk​)+(∑k=0L−1​Ha,kl​vk​)Jb,l​]. The parameters δ,v\delta,vδ,v are unrestricted, and the value is zero when L=0L=0L=0.

QAlgorithms.Papers.Independent.Intakenext100.P88.doubledAmplitude

For any type DDD, natural numbers h,Lh,Lh,L, amplitude model MMM, real parameter vector θ∈RL\theta\in\mathbb R^Lθ∈RL, and index a=(x,ε,z)a=(x,\varepsilon,z)a=(x,ε,z) with x∈Dx\in Dx∈D, ε∈{false,true}\varepsilon\in\{\mathrm{false},\mathrm{true}\}ε∈{false,true}, and 0≤z<h0\le z<h0≤z<h, the model supplies h>0h>0h>0, unitary matrices WrW_rWr​, Hermitian matrices XrX_rXr​, and unit vectors ϕ(x)∈Ch\phi(x)\in\mathbb C^hϕ(x)∈Ch. Write U(θ)=∏r=0L−1(WreiθrXr)U(\theta)=\prod_{r=0}^{L-1}(W_re^{i\theta_rX_r})U(θ)=∏r=0L−1​(Wr​eiθr​Xr​), with factors in increasing index order from left to right and the empty product equal to the identity. This defines

Aa(θ):=doubledAmplitude⁡(M,θ,a)={(U(θ)ϕ(x))z‾,ε=true,(U(θ)ϕ(x))z,ε=false.A_a(\theta):=\operatorname{doubledAmplitude}(M,\theta,a) = \begin{cases} \overline{(U(\theta)\phi(x))_z},&\varepsilon=\mathrm{true},\\ (U(\theta)\phi(x))_z,&\varepsilon=\mathrm{false}. \end{cases}Aa​(θ):=doubledAmplitude(M,θ,a)={(U(θ)ϕ(x))z​​,(U(θ)ϕ(x))z​,​ε=true,ε=false.​

Thus L=0L=0L=0 gives the selected coordinate of ϕ(x)\phi(x)ϕ(x), conjugated precisely when ε\varepsilonε is true. The type DDD may be empty, in which case there is no admissible index aaa.

QAlgorithms.Papers.Independent.Intakenext100.P88.expectationHessian

For arbitrary types D,ID,ID,I, natural numbers h,Lh,Lh,L, and an expectation network MMM, the network supplies h>0h>0h>0, unitary complex h×hh\times hh×h matrices WjW_jWj​, Hermitian matrices XjX_jXj​ for 0≤j<L0\le j<L0≤j<L, unit vectors ϕx∈Ch\phi_x\in\mathbb C^hϕx​∈Ch for x∈Dx\in Dx∈D, and Hermitian matrices OiO_iOi​ for i∈Ii\in Ii∈I. Put U(θ)=∏j=0L−1Wjexp⁡(iθjXj)U(\theta)=\prod_{j=0}^{L-1}W_j\exp(\mathrm i\theta_jX_j)U(θ)=∏j=0L−1​Wj​exp(iθj​Xj​), with factors in increasing index order and empty product the identity, and f(x,i)(θ)=Re⁡⟨U(θ)ϕx,OiU(θ)ϕx⟩f_{(x,i)}(\theta)=\operatorname{Re}\langle U(\theta)\phi_x,O_iU(\theta)\phi_x\ranglef(x,i)​(θ)=Re⟨U(θ)ϕx​,Oi​U(θ)ϕx​⟩. For a function g:RL→Rg:\mathbb R^L\to\mathbb Rg:RL→R, write Djg(v)=ddsg(v[j←s])∣s=vjD_jg(v)=\left.\frac{d}{ds}g(v[j\leftarrow s])\right|_{s=v_j}Dj​g(v)=dsd​g(v[j←s])​s=vj​​, where v[j←s]v[j\leftarrow s]v[j←s] replaces coordinate jjj by sss. For every real δ\deltaδ, a∈D×Ia\in D\times Ia∈D×I, and 0≤k,l<L0\le k,l<L0≤k,l<L, the real number expectationHessian⁡(M,δ,a,k,l)\operatorname{expectationHessian}(M,\delta,a,k,l)expectationHessian(M,δ,a,k,l) is Dk(Dlga)(0)D_k(D_lg_a)(0)Dk​(Dl​ga​)(0), where ga(v)=fa(δv)g_a(v)=f_a(\delta v)ga​(v)=fa​(δv): the lll-th coordinate derivative is taken first, followed by the kkk-th. Each derivative is the total derivative operation, returning zero where differentiability fails. The indices may coincide, δ\deltaδ is unrestricted, and when L=0L=0L=0 there are no such indices.

QAlgorithms.Papers.Independent.Intakenext100.P88.expectationKernel

For arbitrary types D,ID,ID,I, natural numbers h,Lh,Lh,L, and a network MMM comprising h>0h>0h>0, unitary complex h×hh\times hh×h matrices WlW_lWl​, Hermitian complex h×hh\times hh×h matrices XlX_lXl​ for 0≤l<L0\leq l<L0≤l<L, unit Euclidean vectors ϕ(x)∈Ch\phi(x)\in\mathbb C^hϕ(x)∈Ch for every x∈Dx\in Dx∈D, and Hermitian complex h×hh\times hh×h matrices OjO_jOj​ for every j∈Ij\in Ij∈I, define f(x,j)(u)=Re⁡⟨U(u)ϕ(x),OjU(u)ϕ(x)⟩f_{(x,j)}(u)=\operatorname{Re}\langle U(u)\phi(x),O_jU(u)\phi(x)\ranglef(x,j)​(u)=Re⟨U(u)ϕ(x),Oj​U(u)ϕ(x)⟩, where U(u)=∏r=0L−1(Wrexp⁡(iurXr))U(u)=\prod_{r=0}^{L-1}(W_r\exp(iu_rX_r))U(u)=∏r=0L−1​(Wr​exp(iur​Xr​)) in increasing index order, iii is the imaginary unit, exp⁡\expexp is the matrix exponential, matrix action is ordinary multiplication, and ⟨v,w⟩=∑p=0h−1vp‾wp\langle v,w\rangle=\sum_{p=0}^{h-1}\overline{v_p}w_p⟨v,w⟩=∑p=0h−1​vp​​wp​. For any θ∈RL\theta\in\mathbb R^Lθ∈RL and a,b∈D×Ia,b\in D\times Ia,b∈D×I, this definition gives ∑l=0L−1dlfa(θ) dlfb(θ)\sum_{l=0}^{L-1}d_lf_a(\theta)\,d_lf_b(\theta)∑l=0L−1​dl​fa​(θ)dl​fb​(θ), where dlf(θ)d_lf(\theta)dl​f(θ) is the derivative at s=θls=\theta_ls=θl​ of s↦f(θ[l←s])s\mapsto f(\theta^{[l\leftarrow s]})s↦f(θ[l←s]), and coordinate replacement leaves all other coordinates unchanged. This derivative operation returns zero if the derivative does not exist; no separate differentiability hypothesis is supplied. When L=0L=0L=0, the sum is empty and the kernel is zero.

QAlgorithms.Papers.Independent.Intakenext100.P88.expectationOutput

For arbitrary types D,ID,ID,I, natural numbers h,Lh,Lh,L, and a network MMM comprising h>0h>0h>0, unitary complex h×hh\times hh×h matrices WlW_lWl​, Hermitian complex h×hh\times hh×h matrices XlX_lXl​ for 0≤l<L0\leq l<L0≤l<L, vectors ϕ(x)∈Ch\phi(x)\in\mathbb C^hϕ(x)∈Ch satisfying ∥ϕ(x)∥=1\|\phi(x)\|=1∥ϕ(x)∥=1 for every x∈Dx\in Dx∈D, and Hermitian complex h×hh\times hh×h matrices OjO_jOj​ for every j∈Ij\in Ij∈I, this definition assigns to any θ∈RL\theta\in\mathbb R^Lθ∈RL and a=(x,j)∈D×Ia=(x,j)\in D\times Ia=(x,j)∈D×I the real number Re⁡⟨U(θ)ϕ(x), OjU(θ)ϕ(x)⟩\operatorname{Re}\langle U(\theta)\phi(x),\,O_jU(\theta)\phi(x)\rangleRe⟨U(θ)ϕ(x),Oj​U(θ)ϕ(x)⟩. Here U(θ)=∏l=0L−1(Wlexp⁡(iθlXl))U(\theta)=\prod_{l=0}^{L-1}(W_l\exp(i\theta_lX_l))U(θ)=∏l=0L−1​(Wl​exp(iθl​Xl​)), with factors in increasing index order, iii is the imaginary unit, exp⁡\expexp is the matrix exponential, matrix action is ordinary matrix-vector multiplication, and the Euclidean complex inner product is ⟨v,w⟩=∑r=0h−1vr‾wr\langle v,w\rangle=\sum_{r=0}^{h-1}\overline{v_r}w_r⟨v,w⟩=∑r=0h−1​vr​​wr​. When L=0L=0L=0, U(θ)U(\theta)U(θ) is the identity, so the value is Re⁡⟨ϕ(x),Ojϕ(x)⟩\operatorname{Re}\langle\phi(x),O_j\phi(x)\rangleRe⟨ϕ(x),Oj​ϕ(x)⟩.

QAlgorithms.Papers.Independent.Intakenext100.P88.fourContraction

For arbitrary types Ω,D,R\Omega,D,RΩ,D,R, with a measurable structure on Ω\OmegaΩ and with RRR finite and equipped with decidable equality, take a measure μ\muμ, natural numbers h,L,mh,L,mh,L,m, nonnegative real numbers CW,CBC_W,C_BCW​,CB​, a layer SSS, points a,b,c,d∈Da,b,c,d\in Da,b,c,d∈D, and indices r,s,t,u∈Rr,s,t,u\in Rr,s,t,u∈R. The layer requires m>0m>0m>0 and supplies, at each w∈Ωw\in\Omegaw∈Ω, h>0h>0h>0, unitary matrices Wl(w)W_l(w)Wl​(w), Hermitian matrices Xl(w)X_l(w)Xl​(w), real parameters θl(w)\theta_l(w)θl​(w), norm-one vectors ϕ(w,x)∈Ch\phi(w,x)\in\mathbb C^hϕ(w,x)∈Ch, and Hermitian matrices Oj(w)O_j(w)Oj​(w) linearly independent over R\mathbb RR. Write

U(w)=∏l=0L−1Wl(w)exp⁡ ⁣(iθl(w)Xl(w)),Qx,j(w)=Re⁡⟨U(w)ϕ(w,x), Oj(w)U(w)ϕ(w,x)⟩,U(w)=\prod_{l=0}^{L-1}W_l(w)\exp\!\bigl(i\theta_l(w)X_l(w)\bigr), \qquad Q_{x,j}(w)=\operatorname{Re}\left\langle U(w)\phi(w,x),\,O_j(w)U(w)\phi(w,x)\right\rangle,U(w)=l=0∏L−1​Wl​(w)exp(iθl​(w)Xl​(w)),Qx,j​(w)=Re⟨U(w)ϕ(w,x),Oj​(w)U(w)ϕ(w,x)⟩,

using increasing product order, the identity for an empty product, and ordinary complex Euclidean matrix action and inner product. The layer additionally supplies measurable, mutually independent real noise functions indexed by (R×{0,…,m−1})⊔R(R\times\{0,\ldots,m-1\})\sqcup R(R×{0,…,m−1})⊔R, with centered Gaussian pushforwards of variances CW/mC_W/mCW​/m and CBC_BCB​ on the respective summands; the entire noise family is independent of the entire family QQQ, and each Qx,jQ_{x,j}Qx,j​ is measurable with finite fourth absolute moment. For x,y,z,v∈Dx,y,z,v\in Dx,y,z,v∈D, put

Cxy;zvjk=∫ΩQx,jQy,jQz,kQv,k dμ−(∫ΩQx,jQy,j dμ)(∫ΩQz,kQv,k dμ),C_{xy;zv}^{jk} =\int_\Omega Q_{x,j}Q_{y,j}Q_{z,k}Q_{v,k}\,d\mu -\left(\int_\Omega Q_{x,j}Q_{y,j}\,d\mu\right) \left(\int_\Omega Q_{z,k}Q_{v,k}\,d\mu\right),Cxy;zvjk​=∫Ω​Qx,j​Qy,j​Qz,k​Qv,k​dμ−(∫Ω​Qx,j​Qy,j​dμ)(∫Ω​Qz,k​Qv,k​dμ),

and let δp,q\delta_{p,q}δp,q​ be 111 when p=qp=qp=q and 000 otherwise. The definition gives exactly

(CWm)2[δr,sδt,u∑j=0m−1∑k=0m−1Cab;cdjk+δr,tδs,u∑j=0m−1∑k=0m−1Cac;bdjk+δr,uδs,t∑j=0m−1∑k=0m−1Cad;bcjk].\left(\frac{C_W}{m}\right)^2 \left[ \delta_{r,s}\delta_{t,u}\sum_{j=0}^{m-1}\sum_{k=0}^{m-1}C_{ab;cd}^{jk} +\delta_{r,t}\delta_{s,u}\sum_{j=0}^{m-1}\sum_{k=0}^{m-1}C_{ac;bd}^{jk} +\delta_{r,u}\delta_{s,t}\sum_{j=0}^{m-1}\sum_{k=0}^{m-1}C_{ad;bc}^{jk} \right].(mCW​​)2[δr,s​δt,u​j=0∑m−1​k=0∑m−1​Cab;cdjk​+δr,t​δs,u​j=0∑m−1​k=0∑m−1​Cac;bdjk​+δr,u​δs,t​j=0∑m−1​k=0∑m−1​Cad;bcjk​].

All repeated choices among the data points and row indices are permitted. No probability-measure assumption is separately supplied. Here m=0m=0m=0 is excluded, L=0L=0L=0 and zero variances are allowed, and RRR may be empty, although then no r,s,t,ur,s,t,ur,s,t,u can be chosen.

QAlgorithms.Papers.Independent.Intakenext100.P88.frozenAmplitudeKernel

For any type DDD, natural numbers h,Lh,Lh,L, amplitude model MMM, real number δ\deltaδ, and indices a,b∈D×{false,true}×{0,…,h−1}a,b\in D\times\{\mathrm{false},\mathrm{true}\}\times\{0,\ldots,h-1\}a,b∈D×{false,true}×{0,…,h−1}, the model supplies h>0h>0h>0, unitary matrices WrW_rWr​, Hermitian matrices XrX_rXr​, and unit vectors ϕ(x)∈Ch\phi(x)\in\mathbb C^hϕ(x)∈Ch. Define U(u)=∏r=0L−1(WreiurXr)U(u)=\prod_{r=0}^{L-1}(W_re^{iu_rX_r})U(u)=∏r=0L−1​(Wr​eiur​Xr​), with increasing indices from left to right and identity as the empty product, and let A(x,ε,z)(u)A_{(x,\varepsilon,z)}(u)A(x,ε,z)​(u) be (U(u)ϕ(x))z(U(u)\phi(x))_z(U(u)ϕ(x))z​, conjugated exactly when ε\varepsilonε is true. For each coordinate l<Ll<Ll<L, put

Jδ,a,l=ddsAa(δsel)∣s=0,KM,δfrozen(a,b)=∑l=0L−1Jδ,a,l Jδ,b,l‾,J_{\delta,a,l}=\left.\frac{d}{ds}A_a(\delta s e_l)\right|_{s=0}, \qquad K^{\mathrm{frozen}}_{M,\delta}(a,b) = \sum_{l=0}^{L-1}J_{\delta,a,l}\, \overline{J_{\delta,b,l}},Jδ,a,l​=dsd​Aa​(δsel​)​s=0​,KM,δfrozen​(a,b)=l=0∑L−1​Jδ,a,l​Jδ,b,l​​,

where ele_lel​ is the lll-th standard coordinate vector and a derivative is assigned zero if it does not exist. The second expression is the defined complex number. There is no restriction on δ\deltaδ; δ=0\delta=0δ=0 gives zero. The case L=0L=0L=0 also gives zero by the empty-sum convention. If DDD is empty, no a,ba,ba,b exist.

QAlgorithms.Papers.Independent.Intakenext100.P88.frozenKernel

For arbitrary types D,ID,ID,I, natural numbers h,Lh,Lh,L, and an expectation network MMM, assume the data carried by MMM: h>0h>0h>0, unitary complex h×hh\times hh×h matrices WjW_jWj​, Hermitian matrices XjX_jXj​ for 0≤j<L0\le j<L0≤j<L, unit vectors ϕx∈Ch\phi_x\in\mathbb C^hϕx​∈Ch, and Hermitian matrices OiO_iOi​, indexed respectively by x∈Dx\in Dx∈D and i∈Ii\in Ii∈I. Define U(θ)=∏j=0L−1Wjexp⁡(iθjXj)U(\theta)=\prod_{j=0}^{L-1}W_j\exp(\mathrm i\theta_jX_j)U(θ)=∏j=0L−1​Wj​exp(iθj​Xj​), in increasing index order with empty product the identity, and f(x,i)(θ)=Re⁡⟨U(θ)ϕx,OiU(θ)ϕx⟩f_{(x,i)}(\theta)=\operatorname{Re}\langle U(\theta)\phi_x,O_iU(\theta)\phi_x\ranglef(x,i)​(θ)=Re⟨U(θ)ϕx​,Oi​U(θ)ϕx​⟩. For every real δ\deltaδ and a,b∈D×Ia,b\in D\times Ia,b∈D×I, set Ja,l=ddsfa(δsel)∣s=0J_{a,l}=\left.\frac{d}{ds}f_a(\delta s e_l)\right|_{s=0}Ja,l​=dsd​fa​(δsel​)​s=0​, using the total derivative operation, which is zero where differentiability fails. The definition assigns the real number frozenKernel⁡(M,δ,a,b)=∑l=0L−1Ja,lJb,l\operatorname{frozenKernel}(M,\delta,a,b)=\sum_{l=0}^{L-1}J_{a,l}J_{b,l}frozenKernel(M,δ,a,b)=∑l=0L−1​Ja,l​Jb,l​. There is no restriction on δ\deltaδ, and for L=0L=0L=0 this empty sum is zero.

QAlgorithms.Papers.Independent.Intakenext100.P88.frozenResidual

For any scalar field k\mathbb kk equipped with a real-or-complex-like structure, any finite index type TTT with decidable equality, any matrix K∈kT×TK\in\mathbb k^{T\times T}K∈kT×T, any real number η\etaη, and any Euclidean vector e∈kTe\in\mathbb k^Te∈kT, frozenResidual⁡(K,η,e)\operatorname{frozenResidual}(K,\eta,e)frozenResidual(K,η,e) is the sequence r:N→kTr:\mathbb N\to\mathbb k^Tr:N→kT defined by r0=er_0=er0​=e and rt+1=(I−ηK)rtr_{t+1}=(I-\eta K)r_trt+1​=(I−ηK)rt​ for every natural number ttt, where III is the identity matrix, ηK\eta KηK uses real scalar multiplication, and matrix–vector multiplication means (Av)i=∑j∈TAijvj(Av)_i=\sum_{j\in T}A_{ij}v_j(Av)i​=∑j∈T​Aij​vj​. No positivity restriction is imposed on η\etaη, and no symmetry or positivity restriction is imposed on KKK. The time 000 is included; if TTT is empty, every term is the unique vector in the zero-dimensional space.

QAlgorithms.Papers.Independent.Intakenext100.P88.gCoefficient

For arbitrary types D,ID,ID,I, natural numbers h,Lh,Lh,L, and a network MMM, where h>0h>0h>0, the network supplies unitary complex h×hh\times hh×h matrices WjW_jWj​ and Hermitian complex h×hh\times hh×h matrices XjX_jXj​ for every 0≤j<L0\le j<L0≤j<L, vectors ϕx∈Ch\phi_x\in\mathbb C^hϕx​∈Ch with ∥ϕx∥=1\|\phi_x\|=1∥ϕx​∥=1 for every x∈Dx\in Dx∈D, and Hermitian complex h×hh\times hh×h matrices OiO_iOi​ for every i∈Ii\in Ii∈I. For a=(x,i)∈D×Ia=(x,i)\in D\times Ia=(x,i)∈D×I and indices k,l∈{0,…,L−1}k,l\in\{0,\ldots,L-1\}k,l∈{0,…,L−1}, define U=W0W1⋯WL−1U=W_0W_1\cdots W_{L-1}U=W0​W1​⋯WL−1​, A=U†OiUA=U^\dagger O_iUA=U†Oi​U, and Sj=Wj+1⋯WL−1S_j=W_{j+1}\cdots W_{L-1}Sj​=Wj+1​⋯WL−1​, with factors in increasing index order and any empty product equal to the identity; these are the circuit and its suffixes at the zero parameter vector, since each factor Wjexp⁡((0i)Xj)W_j\exp((0\mathrm{i})X_j)Wj​exp((0i)Xj​) equals WjW_jWj​. Set Yj=Sj†XjSjY_j=S_j^\dagger X_jS_jYj​=Sj†​Xj​Sj​, and write [B,E]=BE−EB[B,E]=BE-EB[B,E]=BE−EB. The definition assigns the complex number gM(a;k,l)=⟨ϕx,Cϕx⟩=∑p=0h−1ϕx(p)‾∑q=0h−1Cpqϕx(q)g_M(a;k,l)=\langle\phi_x,C\phi_x\rangle=\sum_{p=0}^{h-1}\overline{\phi_x(p)}\sum_{q=0}^{h-1}C_{pq}\phi_x(q)gM​(a;k,l)=⟨ϕx​,Cϕx​⟩=∑p=0h−1​ϕx​(p)​∑q=0h−1​Cpq​ϕx​(q), where C=[Yl,[Yk,A]]C=[Y_l,[Y_k,A]]C=[Yl​,[Yk​,A]] if k≤lk\le lk≤l, and C=[Yk,[Yl,A]]C=[Y_k,[Y_l,A]]C=[Yk​,[Yl​,A]] otherwise; †\dagger† denotes conjugate transpose. The case k=lk=lk=l uses the first branch, giving C=[Yk,[Yk,A]]C=[Y_k,[Y_k,A]]C=[Yk​,[Yk​,A]]. When L=0L=0L=0, there are no indices k,lk,lk,l at which this definition can be evaluated.

QAlgorithms.Papers.Independent.Intakenext100.P88.incomingQuantumOutput

For any types Ω,D\Omega,DΩ,D, natural numbers h,L,mh,L,mh,L,m, quantum layer qqq, input a∈Da\in Da∈D, coordinate 0≤j<m0\le j<m0≤j<m, and element w∈Ωw\in\Omegaw∈Ω, the layer supplies at each www an ansatz with h>0h>0h>0, unitary matrices Wr(w)W_r(w)Wr​(w), Hermitian matrices Xr(w)X_r(w)Xr​(w), real parameters θr(w)\theta_r(w)θr​(w), unit vectors ϕ(w,a)∈Ch\phi(w,a)\in\mathbb C^hϕ(w,a)∈Ch, and Hermitian matrices Oj(w)O_j(w)Oj​(w) whose family is linearly independent over R\mathbb RR, meaning that a real linear combination is zero only when all its coefficients are zero. Form

Uw=∏r=0L−1(Wr(w)eiθr(w)Xr(w)),ψw,a=Uwϕ(w,a),U_w= \prod_{r=0}^{L-1} \left(W_r(w)e^{i\theta_r(w)X_r(w)}\right), \qquad \psi_{w,a}=U_w\phi(w,a),Uw​=r=0∏L−1​(Wr​(w)eiθr​(w)Xr​(w)),ψw,a​=Uw​ϕ(w,a),

where the factors occur in increasing index order from left to right and the empty product is the identity. This defines the real number

incomingQuantumOutput⁡(q,a,j,w)=Re⁡⟨ψw,a,Oj(w)ψw,a⟩=Re⁡∑z=0h−1ψw,a,z‾(∑y=0h−1Oj(w)zyψw,a,y).\operatorname{incomingQuantumOutput}(q,a,j,w) = \operatorname{Re}\langle\psi_{w,a},O_j(w)\psi_{w,a}\rangle = \operatorname{Re} \sum_{z=0}^{h-1}\overline{\psi_{w,a,z}} \left(\sum_{y=0}^{h-1}O_j(w)_{zy}\psi_{w,a,y}\right).incomingQuantumOutput(q,a,j,w)=Re⟨ψw,a​,Oj​(w)ψw,a​⟩=Rez=0∑h−1​ψw,a,z​​(y=0∑h−1​Oj​(w)zy​ψw,a,y​).

When L=0L=0L=0, ψw,a=ϕ(w,a)\psi_{w,a}=\phi(w,a)ψw,a​=ϕ(w,a). If m=0m=0m=0, no coordinate jjj exists; if DDD or Ω\OmegaΩ is empty, no corresponding input aaa or element www exists.

QAlgorithms.Papers.Independent.Intakenext100.P88.jet

For arbitrary types D,ID,ID,I, natural numbers h,Lh,Lh,L, and an expectation network MMM, the network data comprise h>0h>0h>0, unitary complex h×hh\times hh×h matrices WjW_jWj​, Hermitian complex h×hh\times hh×h matrices XjX_jXj​ for 0≤j<L0\le j<L0≤j<L, unit vectors ϕx∈Ch\phi_x\in\mathbb C^hϕx​∈Ch for x∈Dx\in Dx∈D, and Hermitian matrices OiO_iOi​ for i∈Ii\in Ii∈I. Define U(θ)=∏j=0L−1(Wjexp⁡(iθjXj))U(\theta)=\prod_{j=0}^{L-1}\bigl(W_j\exp(\mathrm i\theta_jX_j)\bigr)U(θ)=∏j=0L−1​(Wj​exp(iθj​Xj​)), with factors written in increasing index order and the empty product equal to the identity, and define f(x,i)(θ)=Re⁡⟨U(θ)ϕx,OiU(θ)ϕx⟩f_{(x,i)}(\theta)=\operatorname{Re}\langle U(\theta)\phi_x,O_iU(\theta)\phi_x\ranglef(x,i)​(θ)=Re⟨U(θ)ϕx​,Oi​U(θ)ϕx​⟩. For every real δ\deltaδ, every a∈D×Ia\in D\times Ia∈D×I, and every index 0≤l<L0\le l<L0≤l<L, jet⁡(M,δ,a,l)\operatorname{jet}(M,\delta,a,l)jet(M,δ,a,l) is the real number ddsfa(δsel)∣s=0\left.\frac{d}{ds}f_a(\delta s e_l)\right|_{s=0}dsd​fa​(δsel​)​s=0​, where ele_lel​ is the lll-th coordinate vector. This uses the total derivative operation, whose value is zero when the function is not differentiable at the specified point. No restriction is placed on δ\deltaδ; when L=0L=0L=0, there is no index lll to supply.

QAlgorithms.Papers.Independent.Intakenext100.P88.kd

For any type RRR equipped with decidable equality and any r,s∈Rr,s\in Rr,s∈R, this definition gives the real number

δr,s={1,r=s,0,r≠s.\delta_{r,s}= \begin{cases} 1,&r=s,\\ 0,&r\ne s. \end{cases}δr,s​={1,0,​r=s,r=s.​

The type RRR need not be finite or nonempty; if it is empty, there are no arguments r,sr,sr,s.

QAlgorithms.Papers.Independent.Intakenext100.P88.l2Action

For any scalar field k\mathbb kk equipped with a real-or-complex-like structure, any finite index type TTT, any matrix A∈kT×TA\in\mathbb k^{T\times T}A∈kT×T, and any vector vvv in the Euclidean space kT\mathbb k^TkT, l2Action⁡(A,v)\operatorname{l2Action}(A,v)l2Action(A,v) is the vector in that same Euclidean space whose coordinate at i∈Ti\in Ti∈T is ∑j∈TAijvj\sum_{j\in T}A_{ij}v_j∑j∈T​Aij​vj​. Thus it is ordinary matrix–vector multiplication, with the result equipped with the Euclidean norm. The finite type TTT may be empty, in which case both input and output are the unique vector in the zero-dimensional space.

QAlgorithms.Papers.Independent.Intakenext100.P88.linearOutput

For arbitrary types D,ID,ID,I, natural numbers h,Lh,Lh,L, and a model MMM containing h>0h>0h>0, unitary complex h×hh\times hh×h matrices WlW_lWl​, Hermitian complex h×hh\times hh×h matrices XlX_lXl​, unit vectors ϕx∈Ch\phi_x\in\mathbb C^hϕx​∈Ch for every x∈Dx\in Dx∈D, and Hermitian matrices OiO_iOi​ for every i∈Ii\in Ii∈I, take a real number δ\deltaδ, a real vector v=(vl)0≤l<Lv=(v_l)_{0\le l<L}v=(vl​)0≤l<L​, and a=(x,i)∈D×Ia=(x,i)\in D\times Ia=(x,i)∈D×I. Define

U(θ)=∏l=0L−1Wlexp⁡(iθlXl),Fa(θ)=Re⁡⟨U(θ)ϕx, OiU(θ)ϕx⟩,U(\theta)=\prod_{l=0}^{L-1}W_l\exp(i\theta_lX_l), \qquad F_a(\theta)=\operatorname{Re}\langle U(\theta)\phi_x,\,O_iU(\theta)\phi_x\rangle,U(θ)=l=0∏L−1​Wl​exp(iθl​Xl​),Fa​(θ)=Re⟨U(θ)ϕx​,Oi​U(θ)ϕx​⟩,

with increasing product order, identity empty product, and standard matrix action and complex Euclidean inner product. For each lll, let

Ja,l=dds Fa ⁣(δ update⁡(0,l,s))∣s=0,J_{a,l} =\left.\frac{d}{ds}\, F_a\!\left(\delta\,\operatorname{update}(0,l,s)\right)\right|_{s=0},Ja,l​=dsd​Fa​(δupdate(0,l,s))​s=0​,

where update⁡(0,l,s)\operatorname{update}(0,l,s)update(0,l,s) has coordinate sss at lll and zero at every other coordinate, and multiplication by δ\deltaδ acts on each coordinate. The defined real output is

Fa(0)+∑l=0L−1Ja,lvl.F_a(0)+\sum_{l=0}^{L-1}J_{a,l}v_l.Fa​(0)+l=0∑L−1​Ja,l​vl​.

The derivative is the ordinary real one-variable derivative used as a total operation, returning zero if differentiability fails. No restriction is imposed on δ\deltaδ or vvv. The case L=0L=0L=0 gives an empty sum and U=IhU=I_hU=Ih​; δ=0\delta=0δ=0 gives zero derivative coefficients. Neither DDD nor III is required to be finite or nonempty.

QAlgorithms.Papers.Independent.Intakenext100.P88.logRate

For any finite type TTT with decidable equality, any real matrix KKK indexed by T×TT\times TT×T, and any real number s=steps=\mathrm{step}s=step, this defines the real number

logRate⁡(K,s)=∥∑n=0∞(sK)n+1n+1∥op,2,\operatorname{logRate}(K,s) = \left\| \sum_{n=0}^{\infty}\frac{(sK)^{n+1}}{n+1} \right\|_{\mathrm{op},2},logRate(K,s)=​n=0∑∞​n+1(sK)n+1​​op,2​,

where the norm is the operator norm induced by the Euclidean norms on the domain and codomain. No restriction on sss or convergence hypothesis is imposed. The infinite sum is the totalized sum: if the matrix series is not summable, its value is the zero matrix, so the defined rate is zero. The denominator n+1n+1n+1 is always positive. The type TTT may be empty, in which case the value is zero; the value is also zero when s=0s=0s=0.

QAlgorithms.Papers.Independent.Intakenext100.P88.metaKernel

For arbitrary types D,ID,ID,I, natural numbers h,Lh,Lh,L, and an expectation network MMM, the network supplies h>0h>0h>0, unitary complex h×hh\times hh×h matrices WjW_jWj​, Hermitian matrices XjX_jXj​ for 0≤j<L0\le j<L0≤j<L, unit vectors ϕx∈Ch\phi_x\in\mathbb C^hϕx​∈Ch for x∈Dx\in Dx∈D, and Hermitian matrices OiO_iOi​ for i∈Ii\in Ii∈I. Put U(θ)=∏j=0L−1Wjexp⁡(iθjXj)U(\theta)=\prod_{j=0}^{L-1}W_j\exp(\mathrm i\theta_jX_j)U(θ)=∏j=0L−1​Wj​exp(iθj​Xj​), in increasing index order with empty product the identity, and f(x,i)(θ)=Re⁡⟨U(θ)ϕx,OiU(θ)ϕx⟩f_{(x,i)}(\theta)=\operatorname{Re}\langle U(\theta)\phi_x,O_iU(\theta)\phi_x\ranglef(x,i)​(θ)=Re⟨U(θ)ϕx​,Oi​U(θ)ϕx​⟩. For any real δ\deltaδ and a,b,c∈D×Ia,b,c\in D\times Ia,b,c∈D×I, define gd(v)=fd(δv)g_d(v)=f_d(\delta v)gd​(v)=fd​(δv), Jd,j=Djgd(0)J_{d,j}=D_jg_d(0)Jd,j​=Dj​gd​(0), and Hd,kl=Dk(Dlgd)(0)H_{d,kl}=D_k(D_lg_d)(0)Hd,kl​=Dk​(Dl​gd​)(0), where Djg(v)=ddsg(v[j←s])∣s=vjD_jg(v)=\left.\frac{d}{ds}g(v[j\leftarrow s])\right|_{s=v_j}Dj​g(v)=dsd​g(v[j←s])​s=vj​​, using total derivatives that return zero where differentiability fails. The real number defined is metaKernel⁡(M,δ,a,b,c)=∑k=0L−1∑l=0L−1Ha,klJb,kJc,l\operatorname{metaKernel}(M,\delta,a,b,c)=\sum_{k=0}^{L-1}\sum_{l=0}^{L-1}H_{a,kl}J_{b,k}J_{c,l}metaKernel(M,δ,a,b,c)=∑k=0L−1​∑l=0L−1​Ha,kl​Jb,k​Jc,l​. The parameter δ\deltaδ is unrestricted, the three arguments may coincide, and when L=0L=0L=0 the value is zero.

QAlgorithms.Papers.Independent.Intakenext100.P88.preactivation

For arbitrary types Ω,D,R\Omega,D,RΩ,D,R, with Ω\OmegaΩ a measurable space and RRR finite, a measure μ\muμ, natural numbers h,L,mh,L,mh,L,m, nonnegative real numbers CW,CBC_W,C_BCW​,CB​, and a layer SSS as follows, this definition assigns a real number to every a∈Da\in Da∈D, r∈Rr\in Rr∈R, and w∈Ωw\in\Omegaw∈Ω. The layer requires m>0m>0m>0; at every www, it supplies h>0h>0h>0, unitary matrices Wl(w)W_l(w)Wl​(w), Hermitian matrices Xl(w)X_l(w)Xl​(w), real parameters θl(w)\theta_l(w)θl​(w), unit vectors ϕ(w,a)∈Ch\phi(w,a)\in\mathbb C^hϕ(w,a)∈Ch, and Hermitian matrices Oj(w)O_j(w)Oj​(w) that are linearly independent over R\mathbb RR. Set

U(w)=∏l=0L−1Wl(w)exp⁡ ⁣(iθl(w)Xl(w)),qa,j(w)=Re⁡⟨U(w)ϕ(w,a), Oj(w)U(w)ϕ(w,a)⟩,U(w)=\prod_{l=0}^{L-1}W_l(w)\exp\!\bigl(i\theta_l(w)X_l(w)\bigr), \qquad q_{a,j}(w)=\operatorname{Re}\left\langle U(w)\phi(w,a),\,O_j(w)U(w)\phi(w,a)\right\rangle,U(w)=l=0∏L−1​Wl​(w)exp(iθl​(w)Xl​(w)),qa,j​(w)=Re⟨U(w)ϕ(w,a),Oj​(w)U(w)ϕ(w,a)⟩,

using increasing order in the matrix product and the identity for an empty product. The layer also supplies measurable real functions ξr,j\xi_{r,j}ξr,j​ and βr\beta_rβr​, all mutually independent under μ\muμ, whose pushforward measures are respectively centered Gaussians of variances CW/mC_W/mCW​/m and CBC_BCB​. Their entire family is independent of the entire family of quantum outputs qa,jq_{a,j}qa,j​, and each quantum output is measurable and has finite fourth absolute moment. The defined preactivation is exactly

za,r(w)=∑j=0m−1ξr,j(w) Re⁡⟨U(w)ϕ(w,a), Oj(w)U(w)ϕ(w,a)⟩+βr(w).z_{a,r}(w)=\sum_{j=0}^{m-1}\xi_{r,j}(w)\, \operatorname{Re}\left\langle U(w)\phi(w,a),\,O_j(w)U(w)\phi(w,a)\right\rangle+\beta_r(w).za,r​(w)=j=0∑m−1​ξr,j​(w)Re⟨U(w)ϕ(w,a),Oj​(w)U(w)ϕ(w,a)⟩+βr​(w).

Matrix action and the inner product here are the usual ones on Ch\mathbb C^hCh. The definition permits L=0L=0L=0 and zero noise variances; no probability-measure assumption is separately imposed on μ\muμ. If DDD, RRR, or Ω\OmegaΩ is empty, there are no corresponding choices of aaa, rrr, or www at which to evaluate this expression.

QAlgorithms.Papers.Independent.Intakenext100.P88.prediction

For any type DDD, any finite type TTT with decidable equality, any function K:D×D→RK:D\times D\to\mathbb RK:D×D→R, any function ι:T→D\iota:T\to Dι:T→D, any real number η\etaη, any function z:D→Rz:D\to\mathbb Rz:D→R, and any Euclidean vector e∈RTe\in\mathbb R^Te∈RT, prediction⁡(K,ι,η,z,e)\operatorname{prediction}(K,\iota,\eta,z,e)prediction(K,ι,η,z,e) is a sequence of functions pt:D→Rp_t:D\to\mathbb Rpt​:D→R. Define the auxiliary vector sequence by r0=er_0=er0​=e and rt+1,i=rt,i−η∑j∈TK(ι(i),ι(j))rt,jr_{t+1,i}=r_{t,i}-\eta\sum_{j\in T}K(\iota(i),\iota(j))r_{t,j}rt+1,i​=rt,i​−η∑j∈T​K(ι(i),ι(j))rt,j​ for every i∈Ti\in Ti∈T and natural number ttt. Then p0=zp_0=zp0​=z, and for every natural number ttt and a∈Da\in Da∈D, pt+1(a)=pt(a)−η∑b∈TK(a,ι(b))rt,bp_{t+1}(a)=p_t(a)-\eta\sum_{b\in T}K(a,\iota(b))r_{t,b}pt+1​(a)=pt​(a)−η∑b∈T​K(a,ι(b))rt,b​. The function ι\iotaι need not be injective, KKK has no assumed symmetry or positivity, η\etaη is unrestricted, and eee has no assumed relation to zzz. If TTT is empty, the update sum is zero and pt=zp_t=zpt​=z for every ttt.

QAlgorithms.Papers.Independent.Intakenext100.P88.productCovariance

For a measurable space Ω\OmegaΩ, an arbitrary type DDD, a measure μ\muμ on Ω\OmegaΩ, natural numbers h,L,mh,L,mh,L,m, and a quantum layer qqq, take a,b,c,d∈Da,b,c,d\in Da,b,c,d∈D and indices 0≤j,k<m0\le j,k<m0≤j,k<m. The quantum layer supplies, for each w∈Ωw\in\Omegaw∈Ω, a positive dimension hhh, unitary matrices Wl(w)W_l(w)Wl​(w), Hermitian matrices Xl(w)X_l(w)Xl​(w), real parameters θl(w)\theta_l(w)θl​(w), norm-one vectors ϕ(w,x)∈Ch\phi(w,x)\in\mathbb C^hϕ(w,x)∈Ch for x∈Dx\in Dx∈D, and Hermitian matrices Op(w)O_p(w)Op​(w), 0≤p<m0\le p<m0≤p<m, linearly independent over R\mathbb RR. Define

U(w)=∏l=0L−1Wl(w)exp⁡ ⁣(iθl(w)Xl(w)),Qx,p(w)=Re⁡⟨U(w)ϕ(w,x), Op(w)U(w)ϕ(w,x)⟩,U(w)=\prod_{l=0}^{L-1}W_l(w)\exp\!\bigl(i\theta_l(w)X_l(w)\bigr), \qquad Q_{x,p}(w)=\operatorname{Re}\left\langle U(w)\phi(w,x),\,O_p(w)U(w)\phi(w,x)\right\rangle,U(w)=l=0∏L−1​Wl​(w)exp(iθl​(w)Xl​(w)),Qx,p​(w)=Re⟨U(w)ϕ(w,x),Op​(w)U(w)ϕ(w,x)⟩,

where products run in increasing order, an empty product is the identity, and matrix action and inner products are standard. The defined real number is

∫ΩQa,jQb,jQc,kQd,k dμ−(∫ΩQa,jQb,j dμ)(∫ΩQc,kQd,k dμ).\int_\Omega Q_{a,j}Q_{b,j}Q_{c,k}Q_{d,k}\,d\mu -\left(\int_\Omega Q_{a,j}Q_{b,j}\,d\mu\right) \left(\int_\Omega Q_{c,k}Q_{d,k}\,d\mu\right).∫Ω​Qa,j​Qb,j​Qc,k​Qd,k​dμ−(∫Ω​Qa,j​Qb,j​dμ)(∫Ω​Qc,k​Qd,k​dμ).

No measurability, integrability, moment, or probability-measure hypotheses are imposed here; any nonintegrable integrand has total integral zero. The choices of a,b,c,da,b,c,da,b,c,d and of j,kj,kj,k need not be distinct. The case L=0L=0L=0 is allowed; if m=0m=0m=0, there are no choices of j,kj,kj,k.

QAlgorithms.Papers.Independent.Intakenext100.P88.qntkCircuit

For natural numbers h,Lh,Lh,L, an ansatz ccc consisting of h>0h>0h>0, unitary complex h×hh\times hh×h matrices WlW_lWl​, and Hermitian complex h×hh\times hh×h matrices XlX_lXl​ for 0≤l<L0\leq l<L0≤l<L, and any real parameter vector θ∈RL\theta\in\mathbb R^Lθ∈RL, this definition gives U(θ)=(W0exp⁡(iθ0X0))(W1exp⁡(iθ1X1))⋯(WL−1exp⁡(iθL−1XL−1))U(\theta)=(W_0\exp(i\theta_0X_0))(W_1\exp(i\theta_1X_1))\cdots(W_{L-1}\exp(i\theta_{L-1}X_{L-1}))U(θ)=(W0​exp(iθ0​X0​))(W1​exp(iθ1​X1​))⋯(WL−1​exp(iθL−1​XL−1​)), with factors in increasing index order. Here iii is the imaginary unit and exp⁡\expexp is the matrix exponential. When L=0L=0L=0, the product is the h×hh\times hh×h identity matrix.

QAlgorithms.Papers.Independent.Intakenext100.P88.qntkFactor

For natural numbers h,Lh,Lh,L, an ansatz ccc consisting of h>0h>0h>0, unitary complex h×hh\times hh×h matrices WkW_kWk​, and Hermitian complex h×hh\times hh×h matrices XkX_kXk​ for 0≤k<L0\leq k<L0≤k<L, a real parameter vector θ=(θ0,…,θL−1)\theta=(\theta_0,\ldots,\theta_{L-1})θ=(θ0​,…,θL−1​), and an index 0≤l<L0\leq l<L0≤l<L, this definition gives the complex matrix Wlexp⁡(iθlXl)W_l\exp(i\theta_lX_l)Wl​exp(iθl​Xl​), where iii is the imaginary unit and exp⁡\expexp is the matrix exponential. The supplied index requires L>0L>0L>0.

QAlgorithms.Papers.Independent.Intakenext100.P88.quadraticAmplitude

For any type DDD, natural numbers h,Lh,Lh,L, amplitude model MMM, real number δ\deltaδ, vector v∈RLv\in\mathbb R^Lv∈RL, and index a=(x,ε,z)∈D×{false,true}×{0,…,h−1}a=(x,\varepsilon,z)\in D\times\{\mathrm{false},\mathrm{true}\}\times\{0,\ldots,h-1\}a=(x,ε,z)∈D×{false,true}×{0,…,h−1}, the model supplies h>0h>0h>0, unitary matrices WrW_rWr​, Hermitian matrices XrX_rXr​, and unit vectors ϕ(x)∈Ch\phi(x)\in\mathbb C^hϕ(x)∈Ch. Let U(u)=∏r=0L−1(WreiurXr)U(u)=\prod_{r=0}^{L-1}(W_re^{iu_rX_r})U(u)=∏r=0L−1​(Wr​eiur​Xr​), with increasing indices from left to right and identity as the empty product, and let Aa(u)A_a(u)Aa​(u) be (U(u)ϕ(x))z(U(u)\phi(x))_z(U(u)ϕ(x))z​, conjugated when ε\varepsilonε is true. Define Fa(u)=Aa(δu)F_a(u)=A_a(\delta u)Fa​(u)=Aa​(δu), and let Drf(u)D_rf(u)Dr​f(u) denote the real-variable derivative at s=urs=u_rs=ur​ of s↦f(u[r←s])s\mapsto f(u[r\leftarrow s])s↦f(u[r←s]), assigned zero when it does not exist. Set Ja,l=DlFa(0)J_{a,l}=D_lF_a(0)Ja,l​=Dl​Fa​(0) and Ha,k,l=Dk(u↦DlFa(u))(0)H_{a,k,l}=D_k(u\mapsto D_lF_a(u))(0)Ha,k,l​=Dk​(u↦Dl​Fa​(u))(0). This defines

QM,δ(v,a)=Aa(0)+∑l=0L−1Ja,lvl+12∑k=0L−1∑l=0L−1Ha,k,lvkvl,Q_{M,\delta}(v,a) = A_a(0) +\sum_{l=0}^{L-1}J_{a,l}v_l +\frac12\sum_{k=0}^{L-1}\sum_{l=0}^{L-1} H_{a,k,l}v_kv_l,QM,δ​(v,a)=Aa​(0)+l=0∑L−1​Ja,l​vl​+21​k=0∑L−1​l=0∑L−1​Ha,k,l​vk​vl​,

with real coordinates embedded in C\mathbb CC. The double sum includes all ordered pairs, including k=lk=lk=l. For δ=0\delta=0δ=0 or v=0v=0v=0, the value is Aa(0)A_a(0)Aa​(0). When L=0L=0L=0, both sums are empty and Aa(0)A_a(0)Aa​(0) is ϕ(x)z\phi(x)_zϕ(x)z​, conjugated when ε\varepsilonε is true. If DDD is empty, no aaa exists.

QAlgorithms.Papers.Independent.Intakenext100.P88.quadraticOutput

For arbitrary types D,ID,ID,I, natural numbers h,Lh,Lh,L, and an expectation network MMM, its data include h>0h>0h>0, unitary complex h×hh\times hh×h matrices WjW_jWj​, Hermitian matrices XjX_jXj​ for 0≤j<L0\le j<L0≤j<L, unit vectors ϕx∈Ch\phi_x\in\mathbb C^hϕx​∈Ch for x∈Dx\in Dx∈D, and Hermitian matrices OiO_iOi​ for i∈Ii\in Ii∈I. Let U(θ)=∏j=0L−1Wjexp⁡(iθjXj)U(\theta)=\prod_{j=0}^{L-1}W_j\exp(\mathrm i\theta_jX_j)U(θ)=∏j=0L−1​Wj​exp(iθj​Xj​), in increasing index order with empty product the identity, and f(x,i)(θ)=Re⁡⟨U(θ)ϕx,OiU(θ)ϕx⟩f_{(x,i)}(\theta)=\operatorname{Re}\langle U(\theta)\phi_x,O_iU(\theta)\phi_x\ranglef(x,i)​(θ)=Re⟨U(θ)ϕx​,Oi​U(θ)ϕx​⟩. Given any real δ\deltaδ, vector v∈RLv\in\mathbb R^Lv∈RL, and a∈D×Ia\in D\times Ia∈D×I, put ga(u)=fa(δu)g_a(u)=f_a(\delta u)ga​(u)=fa​(δu), Ja,l=Dlga(0)J_{a,l}=D_lg_a(0)Ja,l​=Dl​ga​(0), and Ha,kl=Dk(Dlga)(0)H_{a,kl}=D_k(D_lg_a)(0)Ha,kl​=Dk​(Dl​ga​)(0), where Djg(u)=ddsg(u[j←s])∣s=ujD_jg(u)=\left.\frac{d}{ds}g(u[j\leftarrow s])\right|_{s=u_j}Dj​g(u)=dsd​g(u[j←s])​s=uj​​; these are total derivatives, returning zero where differentiability fails. The definition assigns quadraticOutput⁡(M,δ,v,a)=fa(0)+∑l=0L−1Ja,lvl+12∑k=0L−1∑l=0L−1Ha,klvkvl\operatorname{quadraticOutput}(M,\delta,v,a)=f_a(0)+\sum_{l=0}^{L-1}J_{a,l}v_l+\frac12\sum_{k=0}^{L-1}\sum_{l=0}^{L-1}H_{a,kl}v_kv_lquadraticOutput(M,δ,v,a)=fa​(0)+∑l=0L−1​Ja,l​vl​+21​∑k=0L−1​∑l=0L−1​Ha,kl​vk​vl​. Neither δ\deltaδ nor vvv is restricted. When L=0L=0L=0, both sums vanish and the value is fa(0)f_a(0)fa​(0).

QAlgorithms.Papers.Independent.Intakenext100.P88.retainedResidual

For any scalar field k\mathbb kk equipped with a real-or-complex-like structure, any finite index type TTT with decidable equality, any matrices K,D∈kT×TK,D\in\mathbb k^{T\times T}K,D∈kT×T, any real number η\etaη, and any Euclidean vector e∈kTe\in\mathbb k^Te∈kT, retainedResidual⁡(K,D,η,e)\operatorname{retainedResidual}(K,D,\eta,e)retainedResidual(K,D,η,e) is the sequence of ordered pairs (rt,st)∈kT×kT(r_t,s_t)\in\mathbb k^T\times\mathbb k^T(rt​,st​)∈kT×kT defined by (r0,s0)=(e,0)(r_0,s_0)=(e,0)(r0​,s0​)=(e,0) and, for every natural number ttt, rt+1=(I−ηK)rtr_{t+1}=(I-\eta K)r_trt+1​=(I−ηK)rt​ and st+1=(I−ηK)st−ηDrts_{t+1}=(I-\eta K)s_t-\eta Dr_tst+1​=(I−ηK)st​−ηDrt​. Here III is the identity matrix, multiplication by η\etaη is real scalar multiplication, and (Av)i=∑j∈TAijvj(Av)_i=\sum_{j\in T}A_{ij}v_j(Av)i​=∑j∈T​Aij​vj​; both updates use the pair at time ttt. The matrices and step η\etaη are unrestricted. If TTT is empty, every term is the unique pair of zero-dimensional vectors.

QAlgorithms.Papers.Independent.Intakenext100.P88.scaledOutput

For arbitrary types D,ID,ID,I, natural numbers h,Lh,Lh,L, and a network MMM comprising h>0h>0h>0, unitary complex h×hh\times hh×h matrices WlW_lWl​, Hermitian complex h×hh\times hh×h matrices XlX_lXl​ for 0≤l<L0\leq l<L0≤l<L, unit Euclidean vectors ϕ(x)∈Ch\phi(x)\in\mathbb C^hϕ(x)∈Ch for every x∈Dx\in Dx∈D, and Hermitian complex h×hh\times hh×h matrices OjO_jOj​ for every j∈Ij\in Ij∈I, this definition assigns to any real δ\deltaδ, any v∈RLv\in\mathbb R^Lv∈RL, and any a=(x,j)∈D×Ia=(x,j)\in D\times Ia=(x,j)∈D×I the real number Re⁡⟨Uδ(v)ϕ(x),OjUδ(v)ϕ(x)⟩\operatorname{Re}\langle U_\delta(v)\phi(x),O_jU_\delta(v)\phi(x)\rangleRe⟨Uδ​(v)ϕ(x),Oj​Uδ​(v)ϕ(x)⟩, where Uδ(v)=∏l=0L−1(Wlexp⁡(iδvlXl))U_\delta(v)=\prod_{l=0}^{L-1}(W_l\exp(i\delta v_lX_l))Uδ​(v)=∏l=0L−1​(Wl​exp(iδvl​Xl​)), with factors in increasing index order, iii is the imaginary unit, exp⁡\expexp is the matrix exponential, matrix action is ordinary multiplication, and ⟨p,q⟩=∑r=0h−1pr‾qr\langle p,q\rangle=\sum_{r=0}^{h-1}\overline{p_r}q_r⟨p,q⟩=∑r=0h−1​pr​​qr​. No sign or nonzero restriction is imposed on δ\deltaδ. At δ=0\delta=0δ=0, the circuit product is W0⋯WL−1W_0\cdots W_{L-1}W0​⋯WL−1​; when L=0L=0L=0, it is the identity and the value is Re⁡⟨ϕ(x),Ojϕ(x)⟩\operatorname{Re}\langle\phi(x),O_j\phi(x)\rangleRe⟨ϕ(x),Oj​ϕ(x)⟩.

QAlgorithms.Papers.Independent.Intakenext100.P88.second

For any natural number LLL, any normed additive commutative group EEE equipped with a compatible normed real vector-space structure, any function f:RL→Ef:\mathbb R^L\to Ef:RL→E, any θ∈RL\theta\in\mathbb R^Lθ∈RL, and indices 0≤k,l<L0\leq k,l<L0≤k,l<L, first define g(u)g(u)g(u) to be the one-variable derivative at s=uls=u_ls=ul​ of s↦f(u[l←s])s\mapsto f(u^{[l\leftarrow s]})s↦f(u[l←s]), where coordinate replacement leaves every other coordinate unchanged. This definition then takes the one-variable derivative at t=θkt=\theta_kt=θk​ of t↦g(θ[k←t])t\mapsto g(\theta^{[k\leftarrow t]})t↦g(θ[k←t]). Thus the lll-coordinate derivative is taken first and the kkk-coordinate derivative second, allowing k=lk=lk=l. Each derivative operation returns zero wherever its derivative does not exist; no first- or second-differentiability assumption is imposed. Supplying these indices requires L>0L>0L>0.

QAlgorithms.Papers.Independent.Intakenext100.P88.thetaCoefficient

For arbitrary types D,ID,ID,I, natural numbers h,Lh,Lh,L, and an expectation network MMM, the network supplies h>0h>0h>0, unitary complex h×hh\times hh×h matrices WjW_jWj​, Hermitian matrices XjX_jXj​ for 0≤j<L0\le j<L0≤j<L, unit vectors ϕx∈Ch\phi_x\in\mathbb C^hϕx​∈Ch for x∈Dx\in Dx∈D, and Hermitian matrices OiO_iOi​ for i∈Ii\in Ii∈I. Given any θ∈RL\theta\in\mathbb R^Lθ∈RL, a=(x,i)∈D×Ia=(x,i)\in D\times Ia=(x,i)∈D×I, and 0≤l<L0\le l<L0≤l<L, set Fj=Wjexp⁡(iθjXj)F_j=W_j\exp(\mathrm i\theta_jX_j)Fj​=Wj​exp(iθj​Xj​), P=∏j<lFjP=\prod_{j<l}F_jP=∏j<l​Fj​, S=∏j>lFjS=\prod_{j>l}F_jS=∏j>l​Fj​, and A=Fl∗P∗OiPFlA=F_l^*P^*O_iPF_lA=Fl∗​P∗Oi​PFl​, where each product is in increasing index order, empty products are the identity, and ∗^*∗ denotes conjugate transpose. The complex number defined by thetaCoefficient⁡(M,θ,a,l)\operatorname{thetaCoefficient}(M,\theta,a,l)thetaCoefficient(M,θ,a,l) is ⟨ϕx,S∗(XlA−AXl)Sϕx⟩\langle\phi_x,S^*(X_lA-AX_l)S\phi_x\rangle⟨ϕx​,S∗(Xl​A−AXl​)Sϕx​⟩, with the complex inner product conjugate-linear in its first argument. The prefix is the identity for l=0l=0l=0, the suffix is the identity for l=L−1l=L-1l=L−1, and when L=0L=0L=0 there is no index lll to supply.

QAlgorithms.Papers.Independent.Intakenext100.P88.trainingIndex

For arbitrary types D,T,ID,T,ID,T,I, an injective map e:T→De:T\to De:T→D, and a pair a=(t,i)∈T×Ia=(t,i)\in T\times Ia=(t,i)∈T×I, this definition gives the pair

(e(t),i)∈D×I.(e(t),i)\in D\times I.(e(t),i)∈D×I.

There are no finiteness or nonemptiness assumptions on these types. If T×IT\times IT×I is empty, there is no argument aaa; the map eee is nevertheless required to be injective.

QAlgorithms.Papers.Independent.Intakenext100.P88.trainingKernel

For arbitrary types D,T,ID,T,ID,T,I, natural numbers h,Lh,Lh,L, a model MMM, a real number δ\deltaδ, and an injective map e:T→De:T\to De:T→D, this definition gives a real matrix indexed in both directions by T×IT\times IT×I. The model supplies h>0h>0h>0, unitary complex h×hh\times hh×h matrices WlW_lWl​, Hermitian complex h×hh\times hh×h matrices XlX_lXl​, unit vectors ϕx∈Ch\phi_x\in\mathbb C^hϕx​∈Ch for x∈Dx\in Dx∈D, and Hermitian matrices OiO_iOi​ for i∈Ii\in Ii∈I. Put

U(θ)=∏l=0L−1Wlexp⁡(iθlXl),Fx,i(θ)=Re⁡⟨U(θ)ϕx, OiU(θ)ϕx⟩,U(\theta)=\prod_{l=0}^{L-1}W_l\exp(i\theta_lX_l), \qquad F_{x,i}(\theta)=\operatorname{Re}\langle U(\theta)\phi_x,\,O_iU(\theta)\phi_x\rangle,U(θ)=l=0∏L−1​Wl​exp(iθl​Xl​),Fx,i​(θ)=Re⟨U(θ)ϕx​,Oi​U(θ)ϕx​⟩,

where the product has increasing indices from left to right, an empty product is the identity, and matrix action and the complex Euclidean inner product are standard. For 0≤l<L0\le l<L0≤l<L, define

Jx,i,l=dds Fx,i ⁣(δ update⁡(0,l,s))∣s=0,J_{x,i,l} =\left.\frac{d}{ds}\, F_{x,i}\!\left(\delta\,\operatorname{update}(0,l,s)\right)\right|_{s=0},Jx,i,l​=dsd​Fx,i​(δupdate(0,l,s))​s=0​,

where the updated vector has value sss at coordinate lll and zero elsewhere. Then the matrix entry at (t,i),(t′,i′)∈T×I(t,i),(t',i')\in T\times I(t,i),(t′,i′)∈T×I is exactly

K(t,i),(t′,i′)=∑l=0L−1Je(t),i,l Je(t′),i′,l.K_{(t,i),(t',i')}=\sum_{l=0}^{L-1}J_{e(t),i,l}\,J_{e(t'),i',l}.K(t,i),(t′,i′)​=l=0∑L−1​Je(t),i,l​Je(t′),i′,l​.

The derivatives are total real one-variable derivatives, assigned zero when differentiability fails. No finiteness assumptions on D,T,ID,T,ID,T,I are present, so “matrix” here permits arbitrary index types. The case L=0L=0L=0 gives the zero matrix, as does δ=0\delta=0δ=0; if T×IT\times IT×I is empty, the matrix has no entries.

QAlgorithms.Papers.Independent.Intakenext100.P88.writtenProd

For any natural numbers h,Lh,Lh,L and any family F0,…,FL−1F_0,\ldots,F_{L-1}F0​,…,FL−1​ of complex h×hh\times hh×h matrices, writtenProd(F)\mathrm{writtenProd}(F)writtenProd(F) is the matrix product F0F1⋯FL−1F_0F_1\cdots F_{L-1}F0​F1​⋯FL−1​, in increasing index order. When L=0L=0L=0, this is the identity matrix. There is no positivity assumption on hhh, so matrices indexed by the empty set when h=0h=0h=0 are included.

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

    Confirmed by the moderator at approval.

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