Definitions for Representation Learning via Quantum Neural Tangent Kernels
DefinitionQAlgorithms_Papers_Independent_Intakenext100_P88The 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 frozenorderedProdhas 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.
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
Read-back
What the Lean code literally says, in plain math · gpt-6.1-sol
QAlgorithms.Papers.Independent.Intakenext100.P88.AmplitudeModel
For any type and natural numbers , an amplitude model consists of a proof that , a family of unitary complex matrices indexed by , a family of complex matrices with for every , and a function satisfying
The positivity proof and the matrix families together form the stored ansatz. The type may be empty, making the normalization requirement vacuous. The case is allowed and has empty matrix families, whereas admits no such model, even when is empty.
QAlgorithms.Papers.Independent.Intakenext100.P88.Ansatz
For natural numbers , an element of consists of a proof that , a family of unitary complex matrices , and a family of complex matrices , together with a proof that every is Hermitian, where ranges over . Thus admits no such element. The value 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 and natural numbers , an element of consists of an ansatz with , unitary complex matrices , and Hermitian complex matrices for ; a map , with the Euclidean norm, together with a proof that for every ; and a family of complex matrices , indexed by , together with a proof that every is Hermitian. Neither nor is required to be finite or nonempty. No such network exists for ; is allowed, with empty ansatz matrix families.
QAlgorithms.Papers.Independent.Intakenext100.P88.HybridLayer
For a measurable space , a measure on , arbitrary types and with finite, natural numbers , and nonnegative real numbers , this structure contains the following data and requirements. It requires and a family of quantum layers indexed by : at each , an ansatz supplies , unitary complex matrices , and Hermitian complex matrices , for ; there are real parameters , vectors of Euclidean norm for every , and Hermitian matrices , , whose family is linearly independent over . Write
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 , indexed by the disjoint union . Each is measurable; its pushforward of is the centered real Gaussian measure of variance for an index in the first summand and of variance for an index in the second summand. These functions are mutually independent under , and the entire random family is independent of the entire random family . Every is measurable and belongs to , meaning it is almost everywhere strongly measurable and has finite fourth absolute moment. No probability-measure assumption on is separately supplied. Zero variances are allowed and give point masses at zero; is allowed; and may be empty, in which case there are no noise coordinates. The requirements imposed separately at each are vacuous when is empty.
QAlgorithms.Papers.Independent.Intakenext100.P88.OptimizationModel
For natural numbers , this structure supplies a model whose data and observable index types are both singletons, together with a real number . Explicitly, the model contains , unitary complex matrices and Hermitian complex matrices , for , one vector of Euclidean norm , and one Hermitian complex matrix . Its additional requirement is the conjunction
In the eigenvector equation, the real number acts through its inclusion in ; matrix action and the inner product are standard. The existentially quantified vector need not be unique and need not equal . The case is allowed, whereas cannot support such a structure.
QAlgorithms.Papers.Independent.Intakenext100.P88.QuantumLayer
For any types and natural numbers , a quantum layer consists of the following data and requirements: for every , an ansatz providing , unitary complex matrices , and Hermitian complex matrices for ; real parameters ; vectors satisfying for every and ; and matrices , for , satisfying . For each , the matrices must be linearly independent over , meaning
The cases and are permitted; when , the Hermitian and linear-independence requirements concern the empty family. If is empty, normalization is vacuous. If is empty, all the indexed data and requirements are vacuous, so is permitted; if is nonempty, the ansatz requirement forces .
QAlgorithms.Papers.Independent.Intakenext100.P88.amplitudeHessian
For any type , natural numbers , amplitude model , real number , index , and coordinates , the model supplies , unitary matrices , Hermitian matrices , and unit vectors . Form , in increasing index order from left to right, and define as , conjugated when is true. Put , where . For any , let be the real-variable derivative at of , assigned zero if this derivative does not exist. This defines
The -coordinate derivative is taken first and the -coordinate derivative second, both ultimately evaluated at the zero vector; is allowed. Every real , including zero, is permitted, and gives zero. If , no can be supplied; if is empty, no can be supplied.
QAlgorithms.Papers.Independent.Intakenext100.P88.amplitudeJet
For any type , natural numbers , amplitude model , real number , index , and coordinate , the model supplies , unitary matrices , Hermitian matrices , and unit vectors . Let , with increasing indices from left to right and identity as the empty product, and let be , conjugated when is true. With the -th standard coordinate vector in , this defines
The derivative is taken with respect to the real variable and is assigned zero if it does not exist. There is no sign or nonzero restriction on ; when , the differentiated function is constant and the value is zero. If , there is no admissible coordinate ; if is empty, there is no admissible .
QAlgorithms.Papers.Independent.Intakenext100.P88.amplitudeKernel
For any type , natural numbers , amplitude model , real parameter vector , and indices , the model supplies , unitary matrices , Hermitian matrices , and unit vectors . Set , in increasing index order from left to right, and let be when is false and its complex conjugate when is true. For a function , define to be the derivative at of the real-variable function , where replaces only coordinate . This derivative operation returns zero when that function is not differentiable at the specified point. The defined complex kernel is
The case is allowed and gives zero by the empty-sum convention. If is empty, no such exist.
QAlgorithms.Papers.Independent.Intakenext100.P88.basisAmplitude
For any type , natural numbers , amplitude model , real parameter vector , and pair with and , this defines a complex number as follows. The model supplies , unitary matrices , Hermitian matrices , and vectors of Euclidean norm one. Form the matrix product in increasing index order, with the smaller indices on the left,
Then the defined amplitude is
The exponentials are matrix exponentials. If , the product is the identity and the amplitude is . If is empty, there is no admissible pair .
QAlgorithms.Papers.Independent.Intakenext100.P88.circuitPrefix
For natural numbers , an ansatz consisting of , unitary complex matrices , and Hermitian complex matrices for , a real parameter vector , and an index , this definition takes the product, in increasing order of , whose factor is when and the identity matrix otherwise. Equivalently, it is . Here is the imaginary unit and is the matrix exponential. For the result is the identity; supplying requires .
QAlgorithms.Papers.Independent.Intakenext100.P88.circuitSuffix
For natural numbers , an ansatz consisting of , unitary complex matrices , and Hermitian complex matrices for , a real parameter vector , and an index , this definition takes the product, in increasing order of , whose factor is when and the identity matrix otherwise. Equivalently, it is . Here is the imaginary unit and is the matrix exponential. For the result is the identity; supplying requires .
QAlgorithms.Papers.Independent.Intakenext100.P88.connectedFour
For every measurable space , every measure on it, and every four functions , this definition gives the real number
There are no assumptions that 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 , any normed additive commutative group equipped with a compatible normed real vector-space structure, any function , any , and any index , this definition is the one-variable derivative at of , where agrees with except that its -th coordinate is . This uses the total derivative operation, which returns if no derivative exists at that point; no differentiability assumption is imposed. Supplying requires .
QAlgorithms.Papers.Independent.Intakenext100.P88.deltaAmplitudeKernel
For any type , natural numbers , amplitude model , real number , vector , and indices , the model supplies , unitary matrices , Hermitian matrices , and unit vectors . Let , in increasing index order from left to right with identity as the empty product, and let be , conjugated when is true. Set . For , write for the derivative at of , assigned zero if it does not exist, and set and . This defines the complex number
where each real is regarded as a complex number in the products. Repeated indices are included. The value is zero when , when , or when . If is empty, no exist.
QAlgorithms.Papers.Independent.Intakenext100.P88.deltaKernel
For arbitrary types , natural numbers , and an expectation network , the network carries , unitary complex matrices , Hermitian matrices for , unit vectors for , and Hermitian matrices for . Define , in increasing index order with empty product the identity, and . For any real , any , and , let , , and , where , with zero returned where differentiability fails. The real number defined is . The parameters are unrestricted, and the value is zero when .
QAlgorithms.Papers.Independent.Intakenext100.P88.doubledAmplitude
For any type , natural numbers , amplitude model , real parameter vector , and index with , , and , the model supplies , unitary matrices , Hermitian matrices , and unit vectors . Write , with factors in increasing index order from left to right and the empty product equal to the identity. This defines
Thus gives the selected coordinate of , conjugated precisely when is true. The type may be empty, in which case there is no admissible index .
QAlgorithms.Papers.Independent.Intakenext100.P88.expectationHessian
For arbitrary types , natural numbers , and an expectation network , the network supplies , unitary complex matrices , Hermitian matrices for , unit vectors for , and Hermitian matrices for . Put , with factors in increasing index order and empty product the identity, and . For a function , write , where replaces coordinate by . For every real , , and , the real number is , where : the -th coordinate derivative is taken first, followed by the -th. Each derivative is the total derivative operation, returning zero where differentiability fails. The indices may coincide, is unrestricted, and when there are no such indices.
QAlgorithms.Papers.Independent.Intakenext100.P88.expectationKernel
For arbitrary types , natural numbers , and a network comprising , unitary complex matrices , Hermitian complex matrices for , unit Euclidean vectors for every , and Hermitian complex matrices for every , define , where in increasing index order, is the imaginary unit, is the matrix exponential, matrix action is ordinary multiplication, and . For any and , this definition gives , where is the derivative at of , 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 , the sum is empty and the kernel is zero.
QAlgorithms.Papers.Independent.Intakenext100.P88.expectationOutput
For arbitrary types , natural numbers , and a network comprising , unitary complex matrices , Hermitian complex matrices for , vectors satisfying for every , and Hermitian complex matrices for every , this definition assigns to any and the real number . Here , with factors in increasing index order, is the imaginary unit, is the matrix exponential, matrix action is ordinary matrix-vector multiplication, and the Euclidean complex inner product is . When , is the identity, so the value is .
QAlgorithms.Papers.Independent.Intakenext100.P88.fourContraction
For arbitrary types , with a measurable structure on and with finite and equipped with decidable equality, take a measure , natural numbers , nonnegative real numbers , a layer , points , and indices . The layer requires and supplies, at each , , unitary matrices , Hermitian matrices , real parameters , norm-one vectors , and Hermitian matrices linearly independent over . Write
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 , with centered Gaussian pushforwards of variances and on the respective summands; the entire noise family is independent of the entire family , and each is measurable with finite fourth absolute moment. For , put
and let be when and otherwise. The definition gives exactly
All repeated choices among the data points and row indices are permitted. No probability-measure assumption is separately supplied. Here is excluded, and zero variances are allowed, and may be empty, although then no can be chosen.
QAlgorithms.Papers.Independent.Intakenext100.P88.frozenAmplitudeKernel
For any type , natural numbers , amplitude model , real number , and indices , the model supplies , unitary matrices , Hermitian matrices , and unit vectors . Define , with increasing indices from left to right and identity as the empty product, and let be , conjugated exactly when is true. For each coordinate , put
where is the -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 ; gives zero. The case also gives zero by the empty-sum convention. If is empty, no exist.
QAlgorithms.Papers.Independent.Intakenext100.P88.frozenKernel
For arbitrary types , natural numbers , and an expectation network , assume the data carried by : , unitary complex matrices , Hermitian matrices for , unit vectors , and Hermitian matrices , indexed respectively by and . Define , in increasing index order with empty product the identity, and . For every real and , set , using the total derivative operation, which is zero where differentiability fails. The definition assigns the real number . There is no restriction on , and for this empty sum is zero.
QAlgorithms.Papers.Independent.Intakenext100.P88.frozenResidual
For any scalar field equipped with a real-or-complex-like structure, any finite index type with decidable equality, any matrix , any real number , and any Euclidean vector , is the sequence defined by and for every natural number , where is the identity matrix, uses real scalar multiplication, and matrix–vector multiplication means . No positivity restriction is imposed on , and no symmetry or positivity restriction is imposed on . The time is included; if is empty, every term is the unique vector in the zero-dimensional space.
QAlgorithms.Papers.Independent.Intakenext100.P88.gCoefficient
For arbitrary types , natural numbers , and a network , where , the network supplies unitary complex matrices and Hermitian complex matrices for every , vectors with for every , and Hermitian complex matrices for every . For and indices , define , , and , 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 equals . Set , and write . The definition assigns the complex number , where if , and otherwise; denotes conjugate transpose. The case uses the first branch, giving . When , there are no indices at which this definition can be evaluated.
QAlgorithms.Papers.Independent.Intakenext100.P88.incomingQuantumOutput
For any types , natural numbers , quantum layer , input , coordinate , and element , the layer supplies at each an ansatz with , unitary matrices , Hermitian matrices , real parameters , unit vectors , and Hermitian matrices whose family is linearly independent over , meaning that a real linear combination is zero only when all its coefficients are zero. Form
where the factors occur in increasing index order from left to right and the empty product is the identity. This defines the real number
When , . If , no coordinate exists; if or is empty, no corresponding input or element exists.
QAlgorithms.Papers.Independent.Intakenext100.P88.jet
For arbitrary types , natural numbers , and an expectation network , the network data comprise , unitary complex matrices , Hermitian complex matrices for , unit vectors for , and Hermitian matrices for . Define , with factors written in increasing index order and the empty product equal to the identity, and define . For every real , every , and every index , is the real number , where is the -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 ; when , there is no index to supply.
QAlgorithms.Papers.Independent.Intakenext100.P88.kd
For any type equipped with decidable equality and any , this definition gives the real number
The type need not be finite or nonempty; if it is empty, there are no arguments .
QAlgorithms.Papers.Independent.Intakenext100.P88.l2Action
For any scalar field equipped with a real-or-complex-like structure, any finite index type , any matrix , and any vector in the Euclidean space , is the vector in that same Euclidean space whose coordinate at is . Thus it is ordinary matrix–vector multiplication, with the result equipped with the Euclidean norm. The finite type 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 , natural numbers , and a model containing , unitary complex matrices , Hermitian complex matrices , unit vectors for every , and Hermitian matrices for every , take a real number , a real vector , and . Define
with increasing product order, identity empty product, and standard matrix action and complex Euclidean inner product. For each , let
where has coordinate at and zero at every other coordinate, and multiplication by acts on each coordinate. The defined real output is
The derivative is the ordinary real one-variable derivative used as a total operation, returning zero if differentiability fails. No restriction is imposed on or . The case gives an empty sum and ; gives zero derivative coefficients. Neither nor is required to be finite or nonempty.
QAlgorithms.Papers.Independent.Intakenext100.P88.logRate
For any finite type with decidable equality, any real matrix indexed by , and any real number , this defines the real number
where the norm is the operator norm induced by the Euclidean norms on the domain and codomain. No restriction on 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 is always positive. The type may be empty, in which case the value is zero; the value is also zero when .
QAlgorithms.Papers.Independent.Intakenext100.P88.metaKernel
For arbitrary types , natural numbers , and an expectation network , the network supplies , unitary complex matrices , Hermitian matrices for , unit vectors for , and Hermitian matrices for . Put , in increasing index order with empty product the identity, and . For any real and , define , , and , where , using total derivatives that return zero where differentiability fails. The real number defined is . The parameter is unrestricted, the three arguments may coincide, and when the value is zero.
QAlgorithms.Papers.Independent.Intakenext100.P88.preactivation
For arbitrary types , with a measurable space and finite, a measure , natural numbers , nonnegative real numbers , and a layer as follows, this definition assigns a real number to every , , and . The layer requires ; at every , it supplies , unitary matrices , Hermitian matrices , real parameters , unit vectors , and Hermitian matrices that are linearly independent over . Set
using increasing order in the matrix product and the identity for an empty product. The layer also supplies measurable real functions and , all mutually independent under , whose pushforward measures are respectively centered Gaussians of variances and . Their entire family is independent of the entire family of quantum outputs , and each quantum output is measurable and has finite fourth absolute moment. The defined preactivation is exactly
Matrix action and the inner product here are the usual ones on . The definition permits and zero noise variances; no probability-measure assumption is separately imposed on . If , , or is empty, there are no corresponding choices of , , or at which to evaluate this expression.
QAlgorithms.Papers.Independent.Intakenext100.P88.prediction
For any type , any finite type with decidable equality, any function , any function , any real number , any function , and any Euclidean vector , is a sequence of functions . Define the auxiliary vector sequence by and for every and natural number . Then , and for every natural number and , . The function need not be injective, has no assumed symmetry or positivity, is unrestricted, and has no assumed relation to . If is empty, the update sum is zero and for every .
QAlgorithms.Papers.Independent.Intakenext100.P88.productCovariance
For a measurable space , an arbitrary type , a measure on , natural numbers , and a quantum layer , take and indices . The quantum layer supplies, for each , a positive dimension , unitary matrices , Hermitian matrices , real parameters , norm-one vectors for , and Hermitian matrices , , linearly independent over . Define
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
No measurability, integrability, moment, or probability-measure hypotheses are imposed here; any nonintegrable integrand has total integral zero. The choices of and of need not be distinct. The case is allowed; if , there are no choices of .
QAlgorithms.Papers.Independent.Intakenext100.P88.qntkCircuit
For natural numbers , an ansatz consisting of , unitary complex matrices , and Hermitian complex matrices for , and any real parameter vector , this definition gives , with factors in increasing index order. Here is the imaginary unit and is the matrix exponential. When , the product is the identity matrix.
QAlgorithms.Papers.Independent.Intakenext100.P88.qntkFactor
For natural numbers , an ansatz consisting of , unitary complex matrices , and Hermitian complex matrices for , a real parameter vector , and an index , this definition gives the complex matrix , where is the imaginary unit and is the matrix exponential. The supplied index requires .
QAlgorithms.Papers.Independent.Intakenext100.P88.quadraticAmplitude
For any type , natural numbers , amplitude model , real number , vector , and index , the model supplies , unitary matrices , Hermitian matrices , and unit vectors . Let , with increasing indices from left to right and identity as the empty product, and let be , conjugated when is true. Define , and let denote the real-variable derivative at of , assigned zero when it does not exist. Set and . This defines
with real coordinates embedded in . The double sum includes all ordered pairs, including . For or , the value is . When , both sums are empty and is , conjugated when is true. If is empty, no exists.
QAlgorithms.Papers.Independent.Intakenext100.P88.quadraticOutput
For arbitrary types , natural numbers , and an expectation network , its data include , unitary complex matrices , Hermitian matrices for , unit vectors for , and Hermitian matrices for . Let , in increasing index order with empty product the identity, and . Given any real , vector , and , put , , and , where ; these are total derivatives, returning zero where differentiability fails. The definition assigns . Neither nor is restricted. When , both sums vanish and the value is .
QAlgorithms.Papers.Independent.Intakenext100.P88.retainedResidual
For any scalar field equipped with a real-or-complex-like structure, any finite index type with decidable equality, any matrices , any real number , and any Euclidean vector , is the sequence of ordered pairs defined by and, for every natural number , and . Here is the identity matrix, multiplication by is real scalar multiplication, and ; both updates use the pair at time . The matrices and step are unrestricted. If is empty, every term is the unique pair of zero-dimensional vectors.
QAlgorithms.Papers.Independent.Intakenext100.P88.scaledOutput
For arbitrary types , natural numbers , and a network comprising , unitary complex matrices , Hermitian complex matrices for , unit Euclidean vectors for every , and Hermitian complex matrices for every , this definition assigns to any real , any , and any the real number , where , with factors in increasing index order, is the imaginary unit, is the matrix exponential, matrix action is ordinary multiplication, and . No sign or nonzero restriction is imposed on . At , the circuit product is ; when , it is the identity and the value is .
QAlgorithms.Papers.Independent.Intakenext100.P88.second
For any natural number , any normed additive commutative group equipped with a compatible normed real vector-space structure, any function , any , and indices , first define to be the one-variable derivative at of , where coordinate replacement leaves every other coordinate unchanged. This definition then takes the one-variable derivative at of . Thus the -coordinate derivative is taken first and the -coordinate derivative second, allowing . Each derivative operation returns zero wherever its derivative does not exist; no first- or second-differentiability assumption is imposed. Supplying these indices requires .
QAlgorithms.Papers.Independent.Intakenext100.P88.thetaCoefficient
For arbitrary types , natural numbers , and an expectation network , the network supplies , unitary complex matrices , Hermitian matrices for , unit vectors for , and Hermitian matrices for . Given any , , and , set , , , and , where each product is in increasing index order, empty products are the identity, and denotes conjugate transpose. The complex number defined by is , with the complex inner product conjugate-linear in its first argument. The prefix is the identity for , the suffix is the identity for , and when there is no index to supply.
QAlgorithms.Papers.Independent.Intakenext100.P88.trainingIndex
For arbitrary types , an injective map , and a pair , this definition gives the pair
There are no finiteness or nonemptiness assumptions on these types. If is empty, there is no argument ; the map is nevertheless required to be injective.
QAlgorithms.Papers.Independent.Intakenext100.P88.trainingKernel
For arbitrary types , natural numbers , a model , a real number , and an injective map , this definition gives a real matrix indexed in both directions by . The model supplies , unitary complex matrices , Hermitian complex matrices , unit vectors for , and Hermitian matrices for . Put
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 , define
where the updated vector has value at coordinate and zero elsewhere. Then the matrix entry at is exactly
The derivatives are total real one-variable derivatives, assigned zero when differentiability fails. No finiteness assumptions on are present, so “matrix” here permits arbitrary index types. The case gives the zero matrix, as does ; if is empty, the matrix has no entries.
QAlgorithms.Papers.Independent.Intakenext100.P88.writtenProd
For any natural numbers and any family of complex matrices, is the matrix product , in increasing index order. When , this is the identity matrix. There is no positivity assumption on , so matrices indexed by the empty set when are included.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.