Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Definitions for Graphical calculus for Gaussian pure states

Definition
QAlgorithms_Papers_Independent_Intake100_P30

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

prove2quantum

The objects the formalized statements of Graphical calculus for Gaussian pure states (arXiv:1007.0725) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • realPart: Entrywise real part, PDF p.6, (2.22).
  • imagPart: Entrywise imaginary part, PDF p.6, (2.22).
  • ValidGraph: Physical finite Gaussian graph domain, PDF pp.6,19–20.
  • graphCovariance: Graph covariance, in grouped order and hbar=1, PDF p.6, (2.19).
  • targetError: Fixed-A real nullifier covariance, computed by congruence from Sigma, PDF pp.3–4,8, (2.3),(2.41). The target A need not equal Re Z.
  • graphError: Scalar approximation error, PDF p.8, (2.42).
  • graphBlockSymplectic: Symplecticity in the source's grouped order, PDF p.5, (2.11).
  • mobius: General Gaussian graph update, PDF p.6, (2.24). All theorems using inverse assert denominator invertibility as a conclusion.
  • graphLocalMobius: n-local operation extended by the identity on untouched nodes, p.9 (3.2).
  • oneGraph: One distinguished node and its neighborhood, PDF p.10 (3.9).
  • oneAction: One-node symplectic action, PDF pp.9–10 (3.8)–(3.9).
  • graphPhaseMobius: Phase-plane rotation with the source sign, PDF pp.11,13 (3.17),(4.1).
  • phaseError: Error as a function of local phases, PDF p.13 (4.2).
  • phaseHessian: The Hessian of one-half tr Im Z under phase shifts, PDF p.22 (B15).
  • canonicalGraph: Canonical finite-squeezing graph, PDF p.7 (2.29).
  • sechGraph: The second cluster family, PDF p.7 (2.31).
  • hGraph: H-graph coordinate, PDF p.7 (2.32). This is a matrix definition; the separate Hamiltonian-generation assertion is deferred.
  • NormalizedWave: Actual L2 normalization of a wavefunction, PDF pp.4–6.
  • NormalizedGaussian: Centered Gaussian shape is a quadratic exponential, not a graph tuple; normalization excludes the zero vector, PDF p.6 (2.21).
  • HasQuadratureForms: First and second quadrature form integrability on the concrete Gaussian function domain, PDF pp.5–7. No unbounded CCR operator is made bounded.
  • secondMoment: Ordered second moment as a quadratic form, PDF p.7 (2.27).
  • qMoment: Q=<qq^T>, PDF p.7 (2.27), vacuum Q=I/2.
  • qpMoment: P=<qp^T>, PDF p.7 (2.27), vacuum P=iI/2.
  • symQpMoment: Symmetrized <{q,p^T}>, PDF p.7 (2.27).
  • extractedGraph: Expectation-defined graph; no outer one-half on Q^{-1}P, PDF pp.7,19.
  • centeredGraph: Centered extraction for displaced states, PDF p.11 displacement rule.
  • IsGaussianVector: A normalized centered Gaussian vector in the actual oscillator L2 space.
  • GaussianGraphRepresents: Representation ties graph to actual expectation values on an L2 vector, not to a stipulated matrix-state correspondence, PDF pp.19–20.
  • nullifier: Concrete nullifier or its formal adjoint on smooth functions, PDF p.8.
  • complexNullifierCovariance: Symmetrized complex nullifier covariance, PDF p.8 (2.40). Adjoint coefficients are conjugated; the second form has reversed indices.
  • realNullifierCovariance: Real nullifier quadratic form, PDF p.8 (2.41)–(2.42).
  • HasIsotropicMarginals: Single-mode marginal isotropy in the source's resource sense, PDF p.15 (4.12), not computational efficiency.
  • twoEdge: Two-mode unweighted edge, PDF p.14 (4.7).
  • beamRotation: Beamsplitter convention, PDF p.10 (3.10).
  • siegelDiscCoordinate: Cayley/Siegel-disc coordinate, PDF p.21 (B1); K^{-1} is never used.
  • HasSymplecticSpectrum: Symplectic spectrum with multiplicity: the characteristic polynomial of Sigma Omega is product_j (X^2+sigma_j^2), PDF pp.17–18, (4.35),(4.38). For an empty subsystem the product and characteristic polynomial are both 1.
  • FactorsAt: Pure-wave product structure across one node versus the rest, PDF p.18. The factors are genuine square-integrable functions.
  • nodeSpectrum: One-node symplectic eigenvalue, PDF p.18 (4.41); self-loop excluded.
  • gaussianSpectralEntropy: Entropy of a one-mode Gaussian marginal from its symplectic eigenvalue, PDF p.18 (background entropy characterization). Logarithm base b>1 is a parameter, so no unstated choice of bits versus nats is imposed. At sigma=1/2 the convention 0 log 0=0 gives zero entropy.
  • clusterStabilizer: Concrete ordered finite-squeezing stabilizer X_j(s)Z_j(i eps_j s) product_neighbor Z_l(s), including its nonunit Gaussian scalar, PDF p.23 (C7). Translation is performed after the multiplication factors, as operator order requires; A is hollow in the theorem below.
  • passiveA: Passive-optics nullifier coefficient A=X+i D Y, with row squeezing D on the LEFT, PDF p.23 (C15).
  • passiveB: Passive-optics coefficient B=i D X-Y, PDF p.23 (C16).
  • covarianceGraph: Covariance-based centered graph extraction for a PURE covariance. For the Appendix-D mixed family, first divide the covariance by kappa, PDF pp.7,24. Direct extraction on the mixed covariance would be wrong.
  • qConditionedCovariance: Conditioning covariance on the measured q of the distinguished first mode, retaining both quadratures of every unmeasured mode, Appendix D p.24 in the Section III.D measurement context.
Definition code
import Mathlib
import Definitions.Def_QAlgorithms_Papers_Independent_Claimed50_P41

/-!
Menicucci–Flammia–van Loock, arXiv:1007.0725v3. Grouped q,p order,
hbar=1, vacuum covariance I/2. Actual normalized Gaussian functions and L2
vectors are used for state assertions; graph algebra uses the Siegel domain.
Ideal limits are matrix limits, never normalized infinite-squeezing vectors.
Accepted P41 has gaussianWave(u,v) with v=-V in this paper's convention.
Compilation is pending the separate mechanical stage. Explicit deferrals are
in this paper's HARD.md; no deferred result is silently replaced by a lemma.
-/

noncomputable section

open MeasureTheory Filter
open scoped BigOperators ENNReal ComplexOrder Matrix.Norms.Frobenius Topology

open QAlgorithms.Papers.Independent.Dependency50.P10 (Phase complexify sigma)

namespace QAlgorithms.Papers.Independent.Intake100.P30

open QAlgorithms.Papers.Independent.Claimed50.P41
  (Schrodinger gaussianWave IsCenteredGaussianFunction quadratureFunction waveMean waveCovariance displacedFunction IsImplementer)

/-- Entrywise real part, PDF p.6, (2.22). -/
def realPart {I J : Type*} (Z : Matrix I J ℂ) : Matrix I J ℝ := fun i j => (Z i j).re

/-- Entrywise imaginary part, PDF p.6, (2.22). -/
def imagPart {I J : Type*} (Z : Matrix I J ℂ) : Matrix I J ℝ := fun i j => (Z i j).im

/-- Physical finite Gaussian graph domain, PDF pp.6,19–20. -/
def ValidGraph {I : Type*} [Fintype I] [DecidableEq I] (Z : Matrix I I ℂ) : Prop :=
  Z.IsSymm ∧ (imagPart Z).PosDef

/-- Graph covariance, in grouped order and hbar=1, PDF p.6, (2.19). -/
def graphCovariance {I : Type*} [Fintype I] [DecidableEq I]
    (Z : Matrix I I ℂ) : Matrix (I ⊕ I) (I ⊕ I) ℝ :=
  let U := imagPart Z
  let V := realPart Z
  (1 / 2 : ℝ) • Matrix.fromBlocks U⁻¹ (U⁻¹ * V) (V * U⁻¹) (U + V * U⁻¹ * V)

/-- Fixed-A real nullifier covariance, computed by congruence from Sigma,
PDF pp.3–4,8, (2.3),(2.41). The target A need not equal Re Z. -/
def targetError {I : Type*} [Fintype I] [DecidableEq I]
    (Z : Matrix I I ℂ) (A : Matrix I I ℝ) : Matrix I I ℝ :=
  let S := graphCovariance Z
  S.submatrix Sum.inr Sum.inr - A * S.submatrix Sum.inl Sum.inr -
    S.submatrix Sum.inr Sum.inl * A.transpose +
    A * S.submatrix Sum.inl Sum.inl * A.transpose

/-- Scalar approximation error, PDF p.8, (2.42). -/
def graphError {I : Type*} [Fintype I] (Z : Matrix I I ℂ) : ℝ :=
  Matrix.trace (imagPart Z) / 2

/-- Symplecticity in the source's grouped order, PDF p.5, (2.11). -/
def graphBlockSymplectic {I : Type*} [Fintype I] [DecidableEq I]
    (A B C D : Matrix I I ℝ) : Prop :=
  let S := Matrix.fromBlocks A B C D
  S * Matrix.fromBlocks 0 1 (-1) 0 * S.transpose = Matrix.fromBlocks 0 1 (-1) 0

/-- General Gaussian graph update, PDF p.6, (2.24).
All theorems using inverse assert denominator invertibility as a conclusion. -/
def mobius {I : Type*} [Fintype I] [DecidableEq I]
    (A B C D : Matrix I I ℝ) (Z : Matrix I I ℂ) : Matrix I I ℂ :=
  (complexify C + complexify D * Z) * (complexify A + complexify B * Z)⁻¹

/-- n-local operation extended by the identity on untouched nodes, p.9 (3.2). -/
def graphLocalMobius {I J : Type*} [Fintype I] [DecidableEq I]
    [Fintype J] [DecidableEq J] (A B C D : Matrix I I ℝ)
    (Z : Matrix (I ⊕ J) (I ⊕ J) ℂ) : Matrix (I ⊕ J) (I ⊕ J) ℂ :=
  mobius (Matrix.fromBlocks A 0 0 1) (Matrix.fromBlocks B 0 0 0)
    (Matrix.fromBlocks C 0 0 0) (Matrix.fromBlocks D 0 0 1) Z

/-- One distinguished node and its neighborhood, PDF p.10 (3.9). -/
def oneGraph {J : Type*} (t : ℂ) (r : J → ℂ) (W : Matrix J J ℂ) :
    Matrix (Unit ⊕ J) (Unit ⊕ J) ℂ :=
  Matrix.fromBlocks (fun _ _ => t) (fun _ j => r j) (fun j _ => r j) W

/-- One-node symplectic action, PDF pp.9–10 (3.8)–(3.9). -/
def oneAction {J : Type*} [Fintype J] [DecidableEq J] (a b c d : ℝ)
    (Z : Matrix (Unit ⊕ J) (Unit ⊕ J) ℂ) : Matrix (Unit ⊕ J) (Unit ⊕ J) ℂ :=
  graphLocalMobius (fun _ _ => a) (fun _ _ => b) (fun _ _ => c) (fun _ _ => d) Z

/-- Phase-plane rotation with the source sign, PDF pp.11,13 (3.17),(4.1). -/
def graphPhaseMobius {I : Type*} [Fintype I] [DecidableEq I]
    (Z : Matrix I I ℂ) (theta : I → ℝ) : Matrix I I ℂ :=
  mobius (Matrix.diagonal (fun j => Real.cos (theta j)))
    (Matrix.diagonal (fun j => Real.sin (theta j)))
    (Matrix.diagonal (fun j => -Real.sin (theta j)))
    (Matrix.diagonal (fun j => Real.cos (theta j))) Z

/-- Error as a function of local phases, PDF p.13 (4.2). -/
def phaseError {I : Type*} [Fintype I] [DecidableEq I]
    (Z : Matrix I I ℂ) (theta : I → ℝ) : ℝ := graphError (graphPhaseMobius Z theta)

/-- The Hessian of one-half tr Im Z under phase shifts, PDF p.22 (B15). -/
def phaseHessian {I : Type*} [Fintype I] [DecidableEq I]
    (Z : Matrix I I ℂ) : Matrix I I ℝ :=
  imagPart (fun j k => ((1 : Matrix I I ℂ) + Z * Z) j k * Z j k)

/-- Canonical finite-squeezing graph, PDF p.7 (2.29). -/
def canonicalGraph {I : Type*} [DecidableEq I] (A : Matrix I I ℝ) (r : ℝ) : Matrix I I ℂ :=
  complexify A + (Complex.I * (Real.exp (-2 * r) : ℂ)) • 1

/-- The second cluster family, PDF p.7 (2.31). -/
def sechGraph {I : Type*} [DecidableEq I] (A : Matrix I I ℝ) (alpha : ℝ) : Matrix I I ℂ :=
  (Real.tanh (2 * alpha) : ℂ) • complexify A +
    (Complex.I * ((Real.cosh (2 * alpha))⁻¹ : ℂ)) • 1

/-- H-graph coordinate, PDF p.7 (2.32). This is a matrix definition;
the separate Hamiltonian-generation assertion is deferred. -/
def hGraph {I : Type*} [Fintype I] [DecidableEq I] (G : Matrix I I ℝ) (alpha : ℝ) : Matrix I I ℂ :=
  Complex.I • complexify (NormedSpace.exp ((-2 * alpha) • G))

/-- Actual L2 normalization of a wavefunction, PDF pp.4–6. -/
def NormalizedWave {n : ℕ} (f : (Fin n → ℝ) → ℂ) : Prop :=
  MemLp f 2 volume ∧ (∫ q, Complex.normSq (f q)) = 1

/-- Centered Gaussian shape is a quadratic exponential, not a graph tuple;
normalization excludes the zero vector, PDF p.6 (2.21). -/
def NormalizedGaussian {n : ℕ} (f : (Fin n → ℝ) → ℂ) : Prop :=
  IsCenteredGaussianFunction f ∧ NormalizedWave f

/-- First and second quadrature form integrability on the concrete Gaussian
function domain, PDF pp.5–7. No unbounded CCR operator is made bounded. -/
def HasQuadratureForms {n : ℕ} (f : (Fin n → ℝ) → ℂ) : Prop :=
  (∀ a : Phase n, Integrable (fun q => star (f q) * quadratureFunction a f q)) ∧
  ∀ a b : Phase n, Integrable (fun q =>
    star (quadratureFunction a f q) * quadratureFunction b f q)

/-- Ordered second moment as a quadratic form, PDF p.7 (2.27). -/
def secondMoment {n : ℕ} (f : (Fin n → ℝ) → ℂ) (a b : Phase n) : ℂ :=
  ∫ q, star (quadratureFunction a f q) * quadratureFunction b f q

/-- Q=<qq^T>, PDF p.7 (2.27), vacuum Q=I/2. -/
def qMoment {n : ℕ} (f : (Fin n → ℝ) → ℂ) : Matrix (Fin n) (Fin n) ℂ :=
  fun j k => secondMoment f (Sum.inl j) (Sum.inl k)

/-- P=<qp^T>, PDF p.7 (2.27), vacuum P=iI/2. -/
def qpMoment {n : ℕ} (f : (Fin n → ℝ) → ℂ) : Matrix (Fin n) (Fin n) ℂ :=
  fun j k => secondMoment f (Sum.inl j) (Sum.inr k)

/-- Symmetrized <{q,p^T}>, PDF p.7 (2.27). -/
def symQpMoment {n : ℕ} (f : (Fin n → ℝ) → ℂ) : Matrix (Fin n) (Fin n) ℝ :=
  fun j k => 2 * (qpMoment f j k).re

/-- Expectation-defined graph; no outer one-half on Q^{-1}P, PDF pp.7,19. -/
def extractedGraph {n : ℕ} (f : (Fin n → ℝ) → ℂ) : Matrix (Fin n) (Fin n) ℂ :=
  (qMoment f)⁻¹ * qpMoment f

/-- Centered extraction for displaced states, PDF p.11 displacement rule. -/
def centeredGraph {n : ℕ} (f : (Fin n → ℝ) → ℂ) : Matrix (Fin n) (Fin n) ℂ :=
  let S := waveCovariance f
  (complexify (S.submatrix Sum.inl Sum.inl))⁻¹ *
    (complexify (S.submatrix Sum.inl Sum.inr) + (Complex.I / 2) • 1)

/-- A normalized centered Gaussian vector in the actual oscillator L2 space. -/
def IsGaussianVector {n : ℕ} (psi : Schrodinger n) : Prop :=
  ∃ f : (Fin n → ℝ) → ℂ, NormalizedGaussian f ∧ (fun q => psi q) =ᵐ[volume] f

/-- Representation ties graph to actual expectation values on an L2 vector,
not to a stipulated matrix-state correspondence, PDF pp.19–20. -/
def GaussianGraphRepresents {n : ℕ} (Z : Matrix (Fin n) (Fin n) ℂ) (psi : Schrodinger n) : Prop :=
  ∃ f : (Fin n → ℝ) → ℂ, NormalizedGaussian f ∧
    (fun q => psi q) =ᵐ[volume] f ∧ Z = extractedGraph f

/-- Concrete nullifier or its formal adjoint on smooth functions, PDF p.8. -/
def nullifier {n : ℕ} (Z : Matrix (Fin n) (Fin n) ℂ)
    (f : (Fin n → ℝ) → ℂ) (j : Fin n) (q : Fin n → ℝ) : ℂ :=
  quadratureFunction (Sum.inr j) f q -
    ∑ k, Z j k * quadratureFunction (Sum.inl k) f q

/-- Symmetrized complex nullifier covariance, PDF p.8 (2.40).
Adjoint coefficients are conjugated; the second form has reversed indices. -/
def complexNullifierCovariance {n : ℕ} (Z : Matrix (Fin n) (Fin n) ℂ)
    (f : (Fin n → ℝ) → ℂ) : Matrix (Fin n) (Fin n) ℂ := fun j k =>
  (1 / 2 : ℂ) * ((∫ q, star (nullifier Z f j q) * nullifier Z f k q) +
    ∫ q, star (nullifier (fun a b => star (Z a b)) f k q) *
      nullifier (fun a b => star (Z a b)) f j q)

/-- Real nullifier quadratic form, PDF p.8 (2.41)–(2.42). -/
def realNullifierCovariance {n : ℕ} (A : Matrix (Fin n) (Fin n) ℝ)
    (f : (Fin n → ℝ) → ℂ) : Matrix (Fin n) (Fin n) ℝ := fun j k =>
  (∫ q, star (nullifier (complexify A) f j q) * nullifier (complexify A) f k q).re

/-- Single-mode marginal isotropy in the source's resource sense,
PDF p.15 (4.12), not computational efficiency. -/
def HasIsotropicMarginals {I : Type*} [Fintype I] [DecidableEq I] (Z : Matrix I I ℂ) : Prop :=
  ∀ j, graphCovariance Z (Sum.inl j) (Sum.inl j) =
      graphCovariance Z (Sum.inr j) (Sum.inr j) ∧
    graphCovariance Z (Sum.inl j) (Sum.inr j) = 0

/-- Two-mode unweighted edge, PDF p.14 (4.7). -/
def twoEdge : Matrix (Fin 2) (Fin 2) ℝ := !![0, 1; 1, 0]

/-- Beamsplitter convention, PDF p.10 (3.10). -/
def beamRotation (theta : ℝ) : Matrix (Fin 2) (Fin 2) ℝ :=
  !![Real.cos theta, -Real.sin theta; Real.sin theta, Real.cos theta]

/-- Cayley/Siegel-disc coordinate, PDF p.21 (B1); K^{-1} is never used. -/
def siegelDiscCoordinate {I : Type*} [Fintype I] [DecidableEq I] (Z : Matrix I I ℂ) : Matrix I I ℂ :=
  (1 + Complex.I • Z) * (1 - Complex.I • Z)⁻¹

example {I J : Type*} (Z : Matrix I J ℂ) (i : I) (j : J) : realPart Z i j = (Z i j).re := rfl

example {J : Type*} (t : ℂ) (r : J → ℂ) (W : Matrix J J ℂ) :
    oneGraph t r W (Sum.inl ()) (Sum.inl ()) = t := rfl

example {I : Type*} [DecidableEq I] (A : Matrix I I ℝ) :
    canonicalGraph A 0 = complexify A + Complex.I • 1 := by
  simp [canonicalGraph]

example : beamRotation 0 = 1 := by
  ext i j
  fin_cases i <;> fin_cases j <;> simp [beamRotation, Matrix.one_apply]

example {n : ℕ} (f : (Fin n → ℝ) → ℂ) : qMoment f =
    (fun j k => secondMoment f (Sum.inl j) (Sum.inl k)) := rfl

example : twoEdge 0 1 = 1 := rfl

/-- Symplectic spectrum with multiplicity: the characteristic polynomial
of Sigma Omega is product_j (X^2+sigma_j^2), PDF pp.17–18, (4.35),(4.38).
For an empty subsystem the product and characteristic polynomial are both 1. -/
def HasSymplecticSpectrum {n : ℕ} (S : Matrix (Phase n) (Phase n) ℝ) (s : Fin n → ℝ) : Prop :=
  (∀ j, 0 < s j) ∧ (S * sigma n).charpoly =
    ∏ j, (Polynomial.X^2 + Polynomial.C ((s j)^2))

/-- Pure-wave product structure across one node versus the rest,
PDF p.18. The factors are genuine square-integrable functions. -/
def FactorsAt {n : ℕ} (f : (Fin n → ℝ) → ℂ) (k : Fin n) : Prop :=
  ∃ a : ℝ → ℂ, ∃ b : ({i : Fin n // i ≠ k} → ℝ) → ℂ,
    MemLp a 2 volume ∧ MemLp b 2 volume ∧
    ∀ᵐ q ∂volume, f q = a (q k) * b (fun i => q i.val)

/-- One-node symplectic eigenvalue, PDF p.18 (4.41); self-loop excluded. -/
def nodeSpectrum {n : ℕ} (V : Matrix (Fin n) (Fin n) ℝ) (r : ℝ) (k : Fin n) : ℝ :=
  Real.sqrt (1 + Real.exp (4*r) * ∑ l ∈ Finset.univ.erase k, (V k l)^2) / 2

/-- Entropy of a one-mode Gaussian marginal from its symplectic eigenvalue,
PDF p.18 (background entropy characterization). Logarithm base b>1 is a
parameter, so no unstated choice of bits versus nats is imposed. At sigma=1/2
the convention 0 log 0=0 gives zero entropy. -/
def gaussianSpectralEntropy (b s : ℝ) : ℝ :=
  ((s + 1/2) * Real.log (s + 1/2) - (s - 1/2) * Real.log (s - 1/2)) / Real.log b

example (r : ℝ) : nodeSpectrum (0 : Matrix (Fin 1) (Fin 1) ℝ) r 0 = 1/2 := by
  simp [nodeSpectrum]

example (b : ℝ) : gaussianSpectralEntropy b (1/2) = 0 := by
  norm_num [gaussianSpectralEntropy]

/-- Concrete ordered finite-squeezing stabilizer X_j(s)Z_j(i eps_j s)
product_neighbor Z_l(s), including its nonunit Gaussian scalar, PDF p.23 (C7).
Translation is performed after the multiplication factors, as operator order
requires; A is hollow in the theorem below. -/
def clusterStabilizer {n : ℕ} (A : Matrix (Fin n) (Fin n) ℝ) (eps : Fin n → ℝ)
    (j : Fin n) (s : ℝ) (f : (Fin n → ℝ) → ℂ) (q : Fin n → ℝ) : ℂ :=
  let qShift := Function.update q j (q j - s)
  (Real.exp (-(eps j)*s^2/2) : ℂ) *
    Complex.exp (-((eps j * s * qShift j : ℝ) : ℂ)) *
    Complex.exp (Complex.I * ((s * ∑ l, A j l * qShift l : ℝ) : ℂ)) * f qShift

example {n : ℕ} (A : Matrix (Fin n) (Fin n) ℝ) (eps : Fin n → ℝ)
    (j : Fin n) (f : (Fin n → ℝ) → ℂ) : clusterStabilizer A eps j 0 f = f := by
  funext q
  simp [clusterStabilizer]

/-- Passive-optics nullifier coefficient A=X+i D Y, with row squeezing D
on the LEFT, PDF p.23 (C15). -/
def passiveA {n : ℕ} (r : Fin n → ℝ) (X Y : Matrix (Fin n) (Fin n) ℝ) : Matrix (Fin n) (Fin n) ℂ :=
  complexify X + Complex.I • complexify (Matrix.diagonal (fun j => Real.exp (-2*r j)) * Y)

/-- Passive-optics coefficient B=i D X-Y, PDF p.23 (C16). -/
def passiveB {n : ℕ} (r : Fin n → ℝ) (X Y : Matrix (Fin n) (Fin n) ℝ) : Matrix (Fin n) (Fin n) ℂ :=
  Complex.I • complexify (Matrix.diagonal (fun j => Real.exp (-2*r j)) * X) - complexify Y

example {n : ℕ} (r : Fin n → ℝ) (X : Matrix (Fin n) (Fin n) ℝ) :
    passiveA r X 0 = complexify X := by
  have hz : complexify (0 : Matrix (Fin n) (Fin n) ℝ) = 0 := by
    ext i j
    simp [complexify]
  simp only [passiveA, Matrix.mul_zero, hz, smul_zero, add_zero]

/-- Covariance-based centered graph extraction for a PURE covariance.
For the Appendix-D mixed family, first divide the covariance by kappa,
PDF pp.7,24. Direct extraction on the mixed covariance would be wrong. -/
def covarianceGraph {n : ℕ} (S : Matrix (Phase n) (Phase n) ℝ) : Matrix (Fin n) (Fin n) ℂ :=
  (complexify (S.submatrix Sum.inl Sum.inl))⁻¹ *
    (complexify (S.submatrix Sum.inl Sum.inr) + (Complex.I / 2) • 1)

/-- Conditioning covariance on the measured q of the distinguished first
mode, retaining both quadratures of every unmeasured mode, Appendix D p.24
in the Section III.D measurement context. -/
def qConditionedCovariance {J : Type*} [Fintype J] [DecidableEq J]
    (S : Matrix ((Unit ⊕ J) ⊕ (Unit ⊕ J)) ((Unit ⊕ J) ⊕ (Unit ⊕ J)) ℝ) :
    Matrix (J ⊕ J) (J ⊕ J) ℝ :=
  let e : J ⊕ J → (Unit ⊕ J) ⊕ (Unit ⊕ J) := Sum.map Sum.inr Sum.inr
  let a : (Unit ⊕ J) ⊕ (Unit ⊕ J) := Sum.inl (Sum.inl ())
  fun i j => S (e i) (e j) - S (e i) a * S a (e j) / S a a

example {n : ℕ} (f : (Fin n → ℝ) → ℂ) :
    centeredGraph f = covarianceGraph (waveCovariance f) := rfl

end QAlgorithms.Papers.Independent.Intake100.P30
Source
Graphical calculus for Gaussian pure states, arXiv:1007.0725v3, https://arxiv.org/abs/1007.0725v3
Read-back

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

QAlgorithms.Papers.Independent.Intake100.P30.FactorsAt

For a natural number nnn, an arbitrary function f:Rn→Cf:\mathbb R^{n}\to\mathbb Cf:Rn→C, and an index k∈{0,…,n−1}k\in\{0,\ldots,n-1\}k∈{0,…,n−1}, this predicate means that there exist functions a:R→Ca:\mathbb R\to\mathbb Ca:R→C and b:R{j:j≠k}→Cb:\mathbb R^{\{j:j\ne k\}}\to\mathbb Cb:R{j:j=k}→C, both belonging to L2L^{2}L2 with respect to the corresponding Lebesgue measures, such that

f(q)=a(qk) b((qj)j≠k)f(q)=a(q_k)\,b\bigl((q_j)_{j\ne k}\bigr)f(q)=a(qk​)b((qj​)j=k​)

for Lebesgue-almost every q∈Rnq\in\mathbb R^{n}q∈Rn. No normalization or nonzero condition is imposed on either factor. Supplying kkk requires n>0n>0n>0; when n=1n=1n=1, the domain of bbb is the zero-dimensional space indexed by the empty set.

QAlgorithms.Papers.Independent.Intake100.P30.GaussianGraphRepresents

For every natural number nnn, including 000, every complex n×nn\times nn×n matrix ZZZ, and every ψ∈L2(Rn,dq;C)\psi\in L^2(\mathbb R^n,dq;\mathbb C)ψ∈L2(Rn,dq;C), this predicate means that there exist f:Rn→Cf:\mathbb R^n\to\mathbb Cf:Rn→C, real n×nn\times nn×n matrices u,vu,vu,v, and c∈C∖{0}c\in\mathbb C\setminus\{0\}c∈C∖{0}, with uuu positive definite and vvv symmetric, such that

f(q)=cexp⁡ ⁣(−12∑j,k=0n−1qj(ujk+ivjk)qk)for every q,∫Rn∣f(q)∣2 dq=1,f(q)=c\exp\!\left(-\frac12\sum_{j,k=0}^{n-1}q_j(u_{jk}+iv_{jk})q_k\right) \quad\text{for every }q, \qquad \int_{\mathbb R^n}|f(q)|^2\,dq=1,f(q)=cexp​−21​j,k=0∑n−1​qj​(ujk​+ivjk​)qk​​for every q,∫Rn​∣f(q)∣2dq=1,

fff belongs to L2L^2L2, a representative of ψ\psiψ equals fff Lebesgue almost everywhere, and Z=Q−1MZ=Q^{-1}MZ=Q−1M, where

Qjk=∫Rnqjf(q)‾ qkf(q) dq,Mjk=∫Rnqjf(q)‾(−i DRf(q)[ek]) dq.Q_{jk}=\int_{\mathbb R^n}\overline{q_jf(q)}\,q_kf(q)\,dq, \qquad M_{jk}=\int_{\mathbb R^n}\overline{q_jf(q)} \left(-i\,D_{\mathbb R}f(q)[e_k]\right)\,dq.Qjk​=∫Rn​qj​f(q)​qk​f(q)dq,Mjk​=∫Rn​qj​f(q)​(−iDR​f(q)[ek​])dq.

Here eke_kek​ is the kkk-th coordinate vector; the matrix inverse uses the total convention that a singular matrix has inverse zero. For n=0n=0n=0, Z,Q,M,u,vZ,Q,M,u,vZ,Q,M,u,v are empty matrices and the exponent is zero.

QAlgorithms.Papers.Independent.Intake100.P30.HasIsotropicMarginals

For every finite index type III equipped with decidable equality and every complex matrix ZZZ indexed by I×II\times II×I, let U=(Im⁡Zjk)jkU=(\operatorname{Im}Z_{jk})_{jk}U=(ImZjk​)jk​, V=(Re⁡Zjk)jkV=(\operatorname{Re}Z_{jk})_{jk}V=(ReZjk​)jk​, and define the real matrix on two copies of III by

S=12(U−1U−1VVU−1U+VU−1V).S=\frac12 \begin{pmatrix} U^{-1}&U^{-1}V\\ VU^{-1}&U+VU^{-1}V \end{pmatrix}.S=21​(U−1VU−1​U−1VU+VU−1V​).

The predicate means that, for every j∈Ij\in Ij∈I, the two diagonal entries SqjqjS_{q_jq_j}Sqj​qj​​ and SpjpjS_{p_jp_j}Spj​pj​​ are equal and Sqjpj=0S_{q_jp_j}=0Sqj​pj​​=0, where qj,pjq_j,p_jqj​,pj​ label the first and second copies of jjj. No symmetry or positivity of ZZZ, or invertibility of UUU, is assumed; if UUU is singular its inverse is zero. If III is empty, the predicate holds vacuously.

QAlgorithms.Papers.Independent.Intake100.P30.HasQuadratureForms

For any natural number nnn, including 000, and any function f:Rn→Cf:\mathbb R^n\to\mathbb Cf:Rn→C, index 2n2n2n functions by the disjoint union of two copies of {0,…,n−1}\{0,\ldots,n-1\}{0,…,n−1}, defining Qjf(q)=qjf(q)Q_jf(q)=q_jf(q)Qj​f(q)=qj​f(q) on the first copy and Pjf(q)=−i Df(q)[ej]P_jf(q)=-i\,Df(q)[e_j]Pj​f(q)=−iDf(q)[ej​] on the second, where Df(q)Df(q)Df(q) is the real Fréchet derivative and eje_jej​ is the jjj-th coordinate vector. Writing RafR_a fRa​f for the corresponding function, the predicate requires that q↦f(q)‾Raf(q)q\mapsto\overline{f(q)}R_a f(q)q↦f(q)​Ra​f(q) be Lebesgue integrable for every index aaa, and that q↦Raf(q)‾Rbf(q)q\mapsto\overline{R_a f(q)}R_b f(q)q↦Ra​f(q)​Rb​f(q) be Lebesgue integrable for every pair a,ba,ba,b. The derivative is total, taking the zero linear map wherever fff is not differentiable. No differentiability or normalization hypothesis is separately required. For n=0n=0n=0, both families of requirements are vacuous.

QAlgorithms.Papers.Independent.Intake100.P30.HasSymplecticSpectrum

For every natural number nnn, every real matrix SSS indexed by two disjoint copies of {0,…,n−1}\{0,\ldots,n-1\}{0,…,n−1}, and every function s:{0,…,n−1}→Rs:\{0,\ldots,n-1\}\to\mathbb Rs:{0,…,n−1}→R, this predicate means precisely that every sjs_jsj​ is strictly positive and

charpoly⁡ ⁣(S(0In−In0))=∏j=0n−1(X2+sj2)\operatorname{charpoly}\!\left( S\begin{pmatrix}0&I_n\\-I_n&0\end{pmatrix} \right) = \prod_{j=0}^{n-1}(X^{2}+s_j^{2})charpoly(S(0−In​​In​0​))=j=0∏n−1​(X2+sj2​)

as polynomials over R\mathbb RR. It imposes no separate symmetry or positive definiteness condition on SSS. When n=0n=0n=0, the positivity condition is vacuous and the polynomial equality is between the characteristic polynomial of the empty matrix and the empty product 111.

QAlgorithms.Papers.Independent.Intake100.P30.IsGaussianVector

For every natural number nnn, including 000, and every vector ψ\psiψ in the complex space L2(Rn,dq)L^2(\mathbb R^n,dq)L2(Rn,dq), this predicate means that there exist a function f:Rn→Cf:\mathbb R^n\to\mathbb Cf:Rn→C, real n×nn\times nn×n matrices u,vu,vu,v, and a complex number c≠0c\ne0c=0, such that uuu is positive definite, vvv is symmetric,

f(q)=cexp⁡ ⁣(−12∑j,k=0n−1qj(ujk+ivjk)qk)for every q∈Rn,f(q)=c\exp\!\left(-\frac12\sum_{j,k=0}^{n-1}q_j(u_{jk}+iv_{jk})q_k\right) \quad\text{for every }q\in\mathbb R^n,f(q)=cexp​−21​j,k=0∑n−1​qj​(ujk​+ivjk​)qk​​for every q∈Rn,

fff belongs to L2L^2L2, ∫Rn∣f(q)∣2 dq=1\int_{\mathbb R^n}|f(q)|^2\,dq=1∫Rn​∣f(q)∣2dq=1, and a representative of ψ\psiψ equals fff Lebesgue almost everywhere. For n=0n=0n=0, the matrices and sum are empty and R0\mathbb R^0R0 is a singleton.

QAlgorithms.Papers.Independent.Intake100.P30.NormalizedGaussian

For any natural number nnn, including 000, and any function f:Rn→Cf:\mathbb R^n\to\mathbb Cf:Rn→C, the predicate holds precisely when there exist real n×nn\times nn×n matrices u,vu,vu,v and a complex number ccc, with uuu positive definite, vvv symmetric, and c≠0c\ne0c=0, such that for every q∈Rnq\in\mathbb R^nq∈Rn,

f(q)=cexp⁡ ⁣(−12∑j=0n−1∑k=0n−1qj(ujk+ivjk)qk),f(q)=c\exp\!\left(-\frac12\sum_{j=0}^{n-1}\sum_{k=0}^{n-1} q_j(u_{jk}+iv_{jk})q_k\right),f(q)=cexp(−21​j=0∑n−1​k=0∑n−1​qj​(ujk​+ivjk​)qk​),

and fff is almost everywhere strongly measurable with finite L2L^2L2 seminorm and satisfies ∫Rn∣f(q)∣2 dq=1\int_{\mathbb R^n}|f(q)|^2\,dq=1∫Rn​∣f(q)∣2dq=1, using Lebesgue measure. For n=0n=0n=0, the sums are empty and the pointwise formula is f(q)=cf(q)=cf(q)=c.

QAlgorithms.Papers.Independent.Intake100.P30.NormalizedWave

For any natural number nnn, including 000, and any function f:Rn→Cf:\mathbb R^n\to\mathbb Cf:Rn→C, the predicate holds precisely when fff belongs to L2L^2L2 with respect to Lebesgue measure—meaning it is almost everywhere strongly measurable and has finite L2L^2L2 seminorm—and

∫Rn∣f(q)∣2 dq=1.\int_{\mathbb R^n}|f(q)|^2\,dq=1.∫Rn​∣f(q)∣2dq=1.

The squared modulus is the complex norm squared. When n=0n=0n=0, the domain is the singleton zero-dimensional real space.

QAlgorithms.Papers.Independent.Intake100.P30.ValidGraph

For any finite index type III with decidable equality and any complex matrix ZZZ indexed by I×II\times II×I, ValidGraph⁡(Z)\operatorname{ValidGraph}(Z)ValidGraph(Z) means that ZZZ is symmetric, ZT=ZZ^{\mathsf T}=ZZT=Z, and its entrywise imaginary part Uij=Im⁡(Zij)U_{ij}=\operatorname{Im}(Z_{ij})Uij​=Im(Zij​) is positive definite: UUU is real symmetric and xTUx>0x^{\mathsf T}Ux>0xTUx>0 for every nonzero real vector xxx indexed by III. Symmetry of ZZZ uses transpose without complex conjugation. The index type may be empty; in that case both conditions hold vacuously.

QAlgorithms.Papers.Independent.Intake100.P30.beamRotation

For every real number θ\thetaθ, this definition is the real 2×22\times22×2 matrix, with rows and columns indexed by 0,10,10,1,

(cos⁡θ−sin⁡θsin⁡θcos⁡θ).\begin{pmatrix} \cos\theta&-\sin\theta\\ \sin\theta&\cos\theta \end{pmatrix}.(cosθsinθ​−sinθcosθ​).

QAlgorithms.Papers.Independent.Intake100.P30.canonicalGraph

For any index type III with decidable equality, any real matrix AAA indexed by I×II\times II×I, and any real number rrr, the definition assigns the complex matrix

Zjk=Ajk+ie−2rδjk(j,k∈I),Z_{jk}=A_{jk}+i e^{-2r}\delta_{jk}\qquad(j,k\in I),Zjk​=Ajk​+ie−2rδjk​(j,k∈I),

where real entries are embedded in C\mathbb CC and δjk\delta_{jk}δjk​ is the identity-matrix entry. The type III may be infinite or empty, and no symmetry or positivity condition is imposed on AAA.

QAlgorithms.Papers.Independent.Intake100.P30.centeredGraph

For every natural number nnn, including 000, and every function f:Rn→Cf:\mathbb R^n\to\mathbb Cf:Rn→C, use the index set consisting of two copies of {0,…,n−1}\{0,\ldots,n-1\}{0,…,n−1}, labeled qjq_jqj​ and pjp_jpj​, and set

Rqjf(q)=qjf(q),Rpjf(q)=−i DRf(q)[ej].R_{q_j}f(q)=q_jf(q),\qquad R_{p_j}f(q)=-i\,D_{\mathbb R}f(q)[e_j].Rqj​​f(q)=qj​f(q),Rpj​​f(q)=−iDR​f(q)[ej​].

Define real numbers and a real 2n×2n2n\times2n2n×2n matrix by

μa=∫RnRe⁡ ⁣(f(q)‾ Raf(q)) dq,Sab=∫RnRe⁡ ⁣(Raf(q)‾ Rbf(q)) dq−μaμb.\mu_a=\int_{\mathbb R^n}\operatorname{Re}\!\left(\overline{f(q)}\,R_af(q)\right)\,dq, \qquad S_{ab}=\int_{\mathbb R^n}\operatorname{Re}\!\left(\overline{R_af(q)}\,R_bf(q)\right)\,dq-\mu_a\mu_b.μa​=∫Rn​Re(f(q)​Ra​f(q))dq,Sab​=∫Rn​Re(Ra​f(q)​Rb​f(q))dq−μa​μb​.

Writing Sqq=(Sqjqk)jkS_{qq}=(S_{q_jq_k})_{jk}Sqq​=(Sqj​qk​​)jk​ and Sqp=(Sqjpk)jkS_{qp}=(S_{q_jp_k})_{jk}Sqp​=(Sqj​pk​​)jk​, the centered graph is

(Sqq)C−1((Sqp)C+i2In),(S_{qq})_{\mathbb C}^{-1} \left((S_{qp})_{\mathbb C}+\frac{i}{2}I_n\right),(Sqq​)C−1​((Sqp​)C​+2i​In​),

where the subscript C\mathbb CC means entrywise inclusion of a real matrix into the complex matrices. There are no regularity, normalization, or invertibility assumptions; derivatives at points of nondifferentiability and integrals of nonintegrable integrands are assigned zero, and singular matrix inverses are zero. When n=0n=0n=0, all these matrices are empty.

QAlgorithms.Papers.Independent.Intake100.P30.clusterStabilizer

For any natural number nnn, real n×nn\times nn×n matrix AAA, function ε:{0,…,n−1}→R\varepsilon:\{0,\ldots,n-1\}\to\mathbb Rε:{0,…,n−1}→R, index j<nj<nj<n, real sss, function f:Rn→Cf:\mathbb R^n\to\mathbb Cf:Rn→C, and point q∈Rnq\in\mathbb R^nq∈Rn, let q′q'q′ equal qqq except that qj′=qj−sq'_j=q_j-sqj′​=qj​−s. This definition assigns the complex number

e−εjs2/2 e−εjsqj′ exp⁡ ⁣(is∑lAjlql′)f(q′).e^{-\varepsilon_j s^2/2}\, e^{-\varepsilon_j s q'_j}\, \exp\!\left(is\sum_lA_{jl}q'_l\right)f(q').e−εj​s2/2e−εj​sqj′​exp(isl∑​Ajl​ql′​)f(q′).

It imposes no symmetry condition on AAA, no positivity condition on ε\varepsilonε, and no regularity or integrability condition on fff; sss may be any real number. The presence of the index jjj requires n>0n>0n>0.

QAlgorithms.Papers.Independent.Intake100.P30.complexNullifierCovariance

For every natural number nnn, including 000, every complex n×nn\times nn×n matrix ZZZ, and every function f:Rn→Cf:\mathbb R^n\to\mathbb Cf:Rn→C, this definition gives the complex n×nn\times nn×n matrix with entries

Cjk=12(∫RnNZ,f,j(q)‾ NZ,f,k(q) dq+∫RnNZ‾,f,k(q)‾ NZ‾,f,j(q) dq),C_{jk}=\frac12\left( \int_{\mathbb R^n}\overline{N_{Z,f,j}(q)}\,N_{Z,f,k}(q)\,dq + \int_{\mathbb R^n}\overline{N_{\overline Z,f,k}(q)}\,N_{\overline Z,f,j}(q)\,dq \right),Cjk​=21​(∫Rn​NZ,f,j​(q)​NZ,f,k​(q)dq+∫Rn​NZ,f,k​(q)​NZ,f,j​(q)dq),

where Z‾\overline ZZ is entrywise complex conjugation and, for any complex matrix WWW,

NW,f,j(q)=−i DRf(q)[ej]−∑ℓ=0n−1Wjℓqℓf(q).N_{W,f,j}(q) =-i\,D_{\mathbb R}f(q)[e_j]-\sum_{\ell=0}^{n-1}W_{j\ell}q_\ell f(q).NW,f,j​(q)=−iDR​f(q)[ej​]−ℓ=0∑n−1​Wjℓ​qℓ​f(q).

Here eje_jej​ is the jjj-th coordinate vector. No regularity, integrability, normalization, or symmetry assumptions are imposed; derivatives at points of nondifferentiability and integrals of nonintegrable integrands are assigned zero. For n=0n=0n=0, the matrix is empty.

QAlgorithms.Papers.Independent.Intake100.P30.covarianceGraph

For every natural number nnn and every real matrix SSS indexed by two disjoint copies of {0,…,n−1}\{0,\ldots,n-1\}{0,…,n−1}, write its blocks as

S=(QRTP).S=\begin{pmatrix}Q&R\\ T&P\end{pmatrix}.S=(QT​RP​).

This defines the complex n×nn\times nn×n matrix

Q−1(R+i2In),Q^{-1}\left(R+\frac{i}{2}I_n\right),Q−1(R+2i​In​),

where Q,RQ,RQ,R are first included entrywise into the complex matrices and the inverse is taken there. There is no assumption that SSS is symmetric or positive, or that QQQ is invertible; the matrix inverse is total and equals the zero matrix when QQQ is singular. The definition also includes n=0n=0n=0, yielding the empty matrix.

QAlgorithms.Papers.Independent.Intake100.P30.extractedGraph

For every natural number nnn, including 000, and every function f:Rn→Cf:\mathbb R^n\to\mathbb Cf:Rn→C, define complex n×nn\times nn×n matrices QQQ and MMM by

Qjk=∫Rnqjf(q)‾ qkf(q) dq,Mjk=∫Rnqjf(q)‾(−i DRf(q)[ek]) dq,Q_{jk}=\int_{\mathbb R^n}\overline{q_jf(q)}\,q_kf(q)\,dq, \qquad M_{jk}=\int_{\mathbb R^n}\overline{q_jf(q)} \left(-i\,D_{\mathbb R}f(q)[e_k]\right)\,dq,Qjk​=∫Rn​qj​f(q)​qk​f(q)dq,Mjk​=∫Rn​qj​f(q)​(−iDR​f(q)[ek​])dq,

where j,k∈{0,…,n−1}j,k\in\{0,\ldots,n-1\}j,k∈{0,…,n−1}, eke_kek​ is the kkk-th coordinate vector, and DRD_{\mathbb R}DR​ denotes the real Fréchet derivative. The extracted graph is the complex matrix Q−1MQ^{-1}MQ−1M. No measurability, integrability, differentiability, normalization, or invertibility hypothesis is imposed: the derivative is assigned zero where fff is not differentiable, a nonintegrable integrand has integral zero, and the matrix inverse is zero when the matrix is singular. For n=0n=0n=0, the resulting matrix is empty.

QAlgorithms.Papers.Independent.Intake100.P30.gaussianSpectralEntropy

For arbitrary real numbers bbb and sss, this definition assigns

(s+12)log⁡(s+12)−(s−12)log⁡(s−12)log⁡b.\frac{ (s+\tfrac12)\log(s+\tfrac12) - (s-\tfrac12)\log(s-\tfrac12) }{\log b}.logb(s+21​)log(s+21​)−(s−21​)log(s−21​)​.

There are no assumptions that b>1b>1b>1, that bbb is positive, or that s≥1/2s\ge1/2s≥1/2. The logarithm is the total real logarithm: log⁡0=0\log0=0log0=0, and for negative inputs it equals the logarithm of the absolute value. Division by zero is also total and gives zero; in particular, the displayed value is zero whenever log⁡b=0\log b=0logb=0, including b=0,1,−1b=0,1,-1b=0,1,−1. A factor 0log⁡00\log00log0 is therefore zero.

QAlgorithms.Papers.Independent.Intake100.P30.graphBlockSymplectic

For any finite index type III with decidable equality and any four real matrices A,B,C,DA,B,C,DA,B,C,D indexed by I×II\times II×I, define

S=(ABCD),JI=(01I−1I0),S=\begin{pmatrix}A&B\\C&D\end{pmatrix}, \qquad J_I=\begin{pmatrix}0&1_I\\-1_I&0\end{pmatrix},S=(AC​BD​),JI​=(0−1I​​1I​0​),

where 1I1_I1I​ is the identity matrix indexed by III. The proposition graphBlockSymplectic⁡(A,B,C,D)\operatorname{graphBlockSymplectic}(A,B,C,D)graphBlockSymplectic(A,B,C,D) means exactly

SJIST=JI.SJ_IS^{\mathsf T}=J_I.SJI​ST=JI​.

Empty III is permitted, in which case this equality holds for the unique empty matrices.

QAlgorithms.Papers.Independent.Intake100.P30.graphCovariance

For any finite index type III with decidable equality and any complex matrix ZZZ indexed by I×II\times II×I, let Uij=Im⁡(Zij)U_{ij}=\operatorname{Im}(Z_{ij})Uij​=Im(Zij​) and Vij=Re⁡(Zij)V_{ij}=\operatorname{Re}(Z_{ij})Vij​=Re(Zij​). The real matrix graphCovariance⁡(Z)\operatorname{graphCovariance}(Z)graphCovariance(Z), indexed by two disjoint copies of III, is

graphCovariance⁡(Z)=12(U−1U−1VVU−1U+VU−1V).\operatorname{graphCovariance}(Z) =\frac12 \begin{pmatrix} U^{-1}&U^{-1}V\\ VU^{-1}&U+VU^{-1}V \end{pmatrix}.graphCovariance(Z)=21​(U−1VU−1​U−1VU+VU−1V​).

This definition applies to every ZZZ, without a symmetry or positivity hypothesis. The matrix inverse is total, taking the value zero when UUU is singular. The empty index type is also permitted.

QAlgorithms.Papers.Independent.Intake100.P30.graphError

For any finite index type III, including the empty type, and any complex matrix ZZZ indexed by I×II\times II×I, the real number graphError⁡(Z)\operatorname{graphError}(Z)graphError(Z) is half the trace of the entrywise imaginary part of ZZZ:

graphError⁡(Z)=12∑j∈IIm⁡(Zjj).\operatorname{graphError}(Z) =\frac12\sum_{j\in I}\operatorname{Im}(Z_{jj}).graphError(Z)=21​j∈I∑​Im(Zjj​).

No symmetry or positivity hypothesis is imposed, so this number need not be nonnegative. For empty III, the sum and hence the value are zero.

QAlgorithms.Papers.Independent.Intake100.P30.graphLocalMobius

For any finite index types I,JI,JI,J, each with decidable equality, any real matrices A,B,C,DA,B,C,DA,B,C,D indexed by I×II\times II×I, and any complex matrix ZZZ indexed by (I⊔J)×(I⊔J)(I\sqcup J)\times(I\sqcup J)(I⊔J)×(I⊔J), regard real matrix entries as complex numbers and define

A^=(A001J),B^=(B000),C^=(C000),D^=(D001J).\widehat A=\begin{pmatrix}A&0\\0&1_J\end{pmatrix}, \quad \widehat B=\begin{pmatrix}B&0\\0&0\end{pmatrix}, \quad \widehat C=\begin{pmatrix}C&0\\0&0\end{pmatrix}, \quad \widehat D=\begin{pmatrix}D&0\\0&1_J\end{pmatrix}.A=(A0​01J​​),B=(B0​00​),C=(C0​00​),D=(D0​01J​​).

The complex matrix graphLocalMobius⁡(A,B,C,D,Z)\operatorname{graphLocalMobius}(A,B,C,D,Z)graphLocalMobius(A,B,C,D,Z) is

(C^+D^Z)(A^+B^Z)−1.(\widehat C+\widehat D Z)(\widehat A+\widehat B Z)^{-1}.(C+DZ)(A+BZ)−1.

Here 1J1_J1J​ is the identity on the JJJ indices. No further hypotheses are imposed; the inverse is total, equal to zero for a singular denominator matrix. Either index type may be empty.

QAlgorithms.Papers.Independent.Intake100.P30.graphPhaseMobius

For any finite index type III with decidable equality, any complex matrix ZZZ indexed by I×II\times II×I, and any real-valued function θ:I→R\theta:I\to\mathbb Rθ:I→R, let

Cθ=diag⁡j∈I(cos⁡θj),Tθ=diag⁡j∈I(sin⁡θj),C_\theta=\operatorname{diag}_{j\in I}(\cos\theta_j), \qquad T_\theta=\operatorname{diag}_{j\in I}(\sin\theta_j),Cθ​=diagj∈I​(cosθj​),Tθ​=diagj∈I​(sinθj​),

regarded as complex matrices. Then

graphPhaseMobius⁡(Z,θ)=(−Tθ+CθZ)(Cθ+TθZ)−1.\operatorname{graphPhaseMobius}(Z,\theta) =(-T_\theta+C_\theta Z)(C_\theta+T_\theta Z)^{-1}.graphPhaseMobius(Z,θ)=(−Tθ​+Cθ​Z)(Cθ​+Tθ​Z)−1.

No symmetry or positivity hypothesis is imposed on ZZZ, and the inverse is total, equal to zero when Cθ+TθZC_\theta+T_\theta ZCθ​+Tθ​Z is singular. The definition includes empty III.

QAlgorithms.Papers.Independent.Intake100.P30.hGraph

For any finite index type III with decidable equality, any real matrix GGG indexed by I×II\times II×I, and any real number α\alphaα, the definition assigns the complex matrix

Z=iexp⁡(−2αG)=i∑m=0∞(−2αG)mm!,Z=i\exp(-2\alpha G) =i\sum_{m=0}^{\infty}\frac{(-2\alpha G)^m}{m!},Z=iexp(−2αG)=im=0∑∞​m!(−2αG)m​,

where the exponential is the real matrix exponential and its entries are then embedded in C\mathbb CC. No symmetry or positivity hypothesis is imposed on GGG. Empty III is permitted and gives the empty matrix.

QAlgorithms.Papers.Independent.Intake100.P30.imagPart

For any index types I,JI,JI,J, which need not be finite or nonempty, and any complex matrix Z=(Zij)i∈I,j∈JZ=(Z_{ij})_{i\in I,j\in J}Z=(Zij​)i∈I,j∈J​, imagPart⁡(Z)\operatorname{imagPart}(Z)imagPart(Z) is the real matrix with the same indices defined entrywise by

imagPart⁡(Z)ij=Im⁡(Zij).\operatorname{imagPart}(Z)_{ij}=\operatorname{Im}(Z_{ij}).imagPart(Z)ij​=Im(Zij​).

QAlgorithms.Papers.Independent.Intake100.P30.isotropic_mixed_graph_calculus

For every real number κ≥1\kappa\ge1κ≥1, the following two assertions hold. For a complex symmetric matrix ZZZ with positive definite entrywise imaginary part H=Im⁡ZH=\operatorname{Im}ZH=ImZ, write V=Re⁡ZV=\operatorname{Re}ZV=ReZ and define

Γ(Z)=12(H−1H−1VVH−1H+VH−1V).\Gamma(Z)=\frac12 \begin{pmatrix} H^{-1}&H^{-1}V\\ VH^{-1}&H+VH^{-1}V \end{pmatrix}.Γ(Z)=21​(H−1VH−1​H−1VH+VH−1V​).

First, for every natural number nnn, every such n×nn\times nn×n matrix ZZZ, and all real n×nn\times nn×n matrices A,B,C,DA,B,C,DA,B,C,D for which

S=(ABCD),S(0In−In0)ST=(0In−In0),S=\begin{pmatrix}A&B\\C&D\end{pmatrix}, \qquad S\begin{pmatrix}0&I_n\\-I_n&0\end{pmatrix}S^T =\begin{pmatrix}0&I_n\\-I_n&0\end{pmatrix},S=(AC​BD​),S(0−In​​In​0​)ST=(0−In​​In​0​),

one has det⁡(A+BZ)≠0\det(A+BZ)\ne0det(A+BZ)=0, the matrix

Z′=(C+DZ)(A+BZ)−1Z'=(C+DZ)(A+BZ)^{-1}Z′=(C+DZ)(A+BZ)−1

is symmetric with positive definite imaginary part, and

S(κΓ(Z))ST=κΓ(Z′).S\bigl(\kappa\Gamma(Z)\bigr)S^T=\kappa\Gamma(Z').S(κΓ(Z))ST=κΓ(Z′).

Real coefficients in these complex matrix expressions are included entrywise into C\mathbb CC. Second, for every natural number ppp, complex scalar ttt, complex vector r=(rj)j<pr=(r_j)_{j<p}r=(rj​)j<p​, and complex p×pp\times pp×p matrix WWW, if

Z0=(trTrW)Z_0=\begin{pmatrix}t&r^T\\r&W\end{pmatrix}Z0​=(tr​rTW​)

is symmetric with positive definite imaginary part, then WWW is symmetric with positive definite imaginary part. Set K=κΓ(Z0)K=\kappa\Gamma(Z_0)K=κΓ(Z0​), let aaa denote its first position index, and let eee embed the remaining position and momentum indices into those of KKK, preserving their two copies. For every pair i,ji,ji,j of remaining indices,

Ke(i),e(j)−Ke(i),aKa,e(j)Ka,a=(κΓ(W))ij.K_{e(i),e(j)} -\frac{K_{e(i),a}K_{a,e(j)}}{K_{a,a}} =\bigl(\kappa\Gamma(W)\bigr)_{ij}.Ke(i),e(j)​−Ka,a​Ke(i),a​Ka,e(j)​​=(κΓ(W))ij​.

Here rTr^TrT is an ordinary transpose, without conjugation. Both n=0n=0n=0 and p=0p=0p=0 are included; for p=0p=0p=0, the last equality is an equality of empty matrices.

QAlgorithms.Papers.Independent.Intake100.P30.mobius

For any finite index type III with decidable equality, any real matrices A,B,C,DA,B,C,DA,B,C,D indexed by I×II\times II×I, and any complex matrix ZZZ with those indices, regard the real matrices as complex matrices by embedding each entry into C\mathbb CC. Then

mobius⁡(A,B,C,D,Z)=(C+DZ)(A+BZ)−1.\operatorname{mobius}(A,B,C,D,Z) =(C+DZ)(A+BZ)^{-1}.mobius(A,B,C,D,Z)=(C+DZ)(A+BZ)−1.

The multiplication order is as displayed. There is no symplectic, symmetry, positivity, or invertibility hypothesis; the inverse is total and is zero when A+BZA+BZA+BZ is singular. Empty III is included.

QAlgorithms.Papers.Independent.Intake100.P30.nodeSpectrum

For any natural number nnn, any real n×nn\times nn×n matrix VVV, any real number rrr, and any index k<nk<nk<n, this definition assigns the real number

12 1+e4r∑0≤l<nl≠kVkl2 .\frac12\sqrt{\,1+e^{4r}\sum_{\substack{0\le l<n\\l\ne k}}V_{kl}^{2}\,}.21​1+e4r0≤l<nl=k​∑​Vkl2​​.

There are no symmetry or diagonal restrictions on VVV, and no restriction on rrr. The supplied index requires n>0n>0n>0. The diagonal entry VkkV_{kk}Vkk​ does not enter the sum; when n=1n=1n=1, the sum is empty and the value is 1/21/21/2. The square root is the nonnegative real square root, and its argument here is always at least 111.

QAlgorithms.Papers.Independent.Intake100.P30.nullifier

For every natural number nnn, every complex n×nn\times nn×n matrix ZZZ, every function f:Rn→Cf:\mathbb R^n\to\mathbb Cf:Rn→C, every index j∈{0,…,n−1}j\in\{0,\ldots,n-1\}j∈{0,…,n−1}, and every q∈Rnq\in\mathbb R^nq∈Rn, the nullifier is the complex number

NZ,f,j(q)=−i DRf(q)[ej]−∑k=0n−1Zjk qkf(q),N_{Z,f,j}(q) =-i\,D_{\mathbb R}f(q)[e_j] -\sum_{k=0}^{n-1}Z_{jk}\,q_kf(q),NZ,f,j​(q)=−iDR​f(q)[ej​]−k=0∑n−1​Zjk​qk​f(q),

where eje_jej​ is the jjj-th coordinate vector. No symmetry, positivity, or regularity is required of ZZZ or fff; the derivative is assigned zero where fff is not differentiable. When n=0n=0n=0, there is no index jjj at which this expression can be evaluated.

QAlgorithms.Papers.Independent.Intake100.P30.oneAction

For any finite index type JJJ with decidable equality, any real numbers a,b,c,da,b,c,da,b,c,d, and any complex matrix ZZZ indexed by one distinguished index together with JJJ, oneAction⁡(a,b,c,d,Z)\operatorname{oneAction}(a,b,c,d,Z)oneAction(a,b,c,d,Z) is

((c000)+(d001J)Z)((a001J)+(b000)Z)−1,\left( \begin{pmatrix}c&0\\0&0\end{pmatrix} +\begin{pmatrix}d&0\\0&1_J\end{pmatrix}Z \right) \left( \begin{pmatrix}a&0\\0&1_J\end{pmatrix} +\begin{pmatrix}b&0\\0&0\end{pmatrix}Z \right)^{-1},((c0​00​)+(d0​01J​​)Z)((a0​01J​​)+(b0​00​)Z)−1,

where real entries are embedded into C\mathbb CC, the upper-left blocks have size one, and 1J1_J1J​ is the identity on JJJ. No condition such as ad−bc=1ad-bc=1ad−bc=1 is required. The inverse is total and equals zero when its matrix is singular. Empty JJJ is permitted, in which case this is the scalar expression (c+dz)/(a+bz)(c+dz)/(a+bz)(c+dz)/(a+bz), with division by zero defined to give zero.

QAlgorithms.Papers.Independent.Intake100.P30.oneGraph

For any index type JJJ, any complex number ttt, any function r:J→Cr:J\to\mathbb Cr:J→C, and any complex matrix WWW indexed by J×JJ\times JJ×J, oneGraph⁡(t,r,W)\operatorname{oneGraph}(t,r,W)oneGraph(t,r,W) is the complex matrix indexed by one distinguished index ∗*∗ together with the indices in JJJ, with entries

Z∗∗=t,Z∗j=rj,Zj∗=rj,Zjk=Wjk.Z_{**}=t,\qquad Z_{*j}=r_j,\qquad Z_{j*}=r_j,\qquad Z_{jk}=W_{jk}.Z∗∗​=t,Z∗j​=rj​,Zj∗​=rj​,Zjk​=Wjk​.

The two off-diagonal blocks use the same values rjr_jrj​, without complex conjugation. No symmetry condition is imposed on WWW, and JJJ need not be finite or nonempty; if JJJ is empty, the resulting matrix is the single entry ttt.

QAlgorithms.Papers.Independent.Intake100.P30.passiveA

For every natural number nnn, every function r:{0,…,n−1}→Rr:\{0,\ldots,n-1\}\to\mathbb Rr:{0,…,n−1}→R, and every pair of real n×nn\times nn×n matrices X,YX,YX,Y, this definition assigns the complex matrix

X+i diag⁡(e−2rj)Y,X+i\,\operatorname{diag}(e^{-2r_j})Y,X+idiag(e−2rj​)Y,

where real matrix entries are embedded in C\mathbb CC. Thus its (j,k)(j,k)(j,k)-entry is Xjk+ie−2rjYjkX_{jk}+ie^{-2r_j}Y_{jk}Xjk​+ie−2rj​Yjk​. No positivity assumption on rrr or algebraic condition on X,YX,YX,Y is imposed. When n=0n=0n=0, this is the empty complex matrix.

QAlgorithms.Papers.Independent.Intake100.P30.passiveB

For every natural number nnn, real vector r=(rj)j<nr=(r_j)_{j<n}r=(rj​)j<n​, and real n×nn\times nn×n matrices X,YX,YX,Y, this defines the complex matrix

B=i diag⁡(e−2rj)X−Y,Bjk=ie−2rjXjk−Yjk,B=i\,\operatorname{diag}(e^{-2r_j})X-Y, \qquad B_{jk}=i e^{-2r_j}X_{jk}-Y_{jk},B=idiag(e−2rj​)X−Y,Bjk​=ie−2rj​Xjk​−Yjk​,

where real matrices are regarded as complex matrices by entrywise inclusion. No restrictions are imposed on r,X,Yr,X,Yr,X,Y. The definition includes n=0n=0n=0, when the resulting matrix is empty.

QAlgorithms.Papers.Independent.Intake100.P30.phaseError

For any finite index type III with decidable equality, any complex matrix ZZZ indexed by I×II\times II×I, and any function θ:I→R\theta:I\to\mathbb Rθ:I→R, let C=diag⁡(cos⁡θj)C=\operatorname{diag}(\cos\theta_j)C=diag(cosθj​) and S=diag⁡(sin⁡θj)S=\operatorname{diag}(\sin\theta_j)S=diag(sinθj​), regarded as complex matrices. The definition assigns the real number

phaseError⁡(Z,θ)=12∑j∈IIm⁡ ⁣[(−S+CZ)(C+SZ)−1]jj.\operatorname{phaseError}(Z,\theta) =\frac12\sum_{j\in I}\operatorname{Im}\!\left[(-S+CZ)(C+SZ)^{-1}\right]_{jj}.phaseError(Z,θ)=21​j∈I∑​Im[(−S+CZ)(C+SZ)−1]jj​.

No symmetry, positivity, or invertibility hypothesis is imposed. The inverse is the total matrix inverse, which is the zero matrix when C+SZC+SZC+SZ is singular. If III is empty, the value is 000.

QAlgorithms.Papers.Independent.Intake100.P30.phaseHessian

For any finite index type III with decidable equality and any complex matrix ZZZ indexed by I×II\times II×I, the definition assigns the real matrix HHH whose entries, for every j,k∈Ij,k\in Ij,k∈I, are

Hjk=Im⁡ ⁣[(δjk+∑ℓ∈IZjℓZℓk)Zjk],H_{jk}=\operatorname{Im}\!\left[\left(\delta_{jk}+\sum_{\ell\in I}Z_{j\ell}Z_{\ell k}\right)Z_{jk}\right],Hjk​=Im[(δjk​+ℓ∈I∑​Zjℓ​Zℓk​)Zjk​],

where δjk\delta_{jk}δjk​ is 111 when j=kj=kj=k and 000 otherwise. There are no symmetry or positivity assumptions on ZZZ. For empty III, this is the empty matrix.

QAlgorithms.Papers.Independent.Intake100.P30.qConditionedCovariance

For every finite index type JJJ with decidable equality and every real matrix SSS whose rows and columns consist of a first copy and a second copy of {∗}⊔J\{\ast\}\sqcup J{∗}⊔J, let aaa be the distinguished index ∗\ast∗ in the first copy. Let e:J⊔J→({∗}⊔J)⊔({∗}⊔J)e:J\sqcup J\to(\{\ast\}\sqcup J)\sqcup(\{\ast\}\sqcup J)e:J⊔J→({∗}⊔J)⊔({∗}⊔J) send an index jjj in the first copy of JJJ to jjj in the first larger copy, and likewise for the second copy. This defines the real matrix indexed by J⊔JJ\sqcup JJ⊔J with entries

Se(i),e(j)−Se(i),aSa,e(j)Sa,a(i,j∈J⊔J).S_{e(i),e(j)}-\frac{S_{e(i),a}S_{a,e(j)}}{S_{a,a}} \qquad(i,j\in J\sqcup J).Se(i),e(j)​−Sa,a​Se(i),a​Sa,e(j)​​(i,j∈J⊔J).

No symmetry, positivity, or nonzero-denominator hypothesis is imposed on SSS. If Sa,a=0S_{a,a}=0Sa,a​=0, real division by zero is 000, so the result has entries Se(i),e(j)S_{e(i),e(j)}Se(i),e(j)​. The index type JJJ may be empty, in which case the result is an empty matrix.

QAlgorithms.Papers.Independent.Intake100.P30.qMoment

For any natural number nnn, including 000, and any function f:Rn→Cf:\mathbb R^n\to\mathbb Cf:Rn→C, the definition assigns the complex n×nn\times nn×n matrix with entries

Qjk=∫Rnqjf(q)‾ qkf(q) dq(0≤j,k<n),Q_{jk}=\int_{\mathbb R^n}\overline{q_jf(q)}\,q_kf(q)\,dq \qquad(0\le j,k<n),Qjk​=∫Rn​qj​f(q)​qk​f(q)dq(0≤j,k<n),

where real coordinates are embedded in C\mathbb CC and integration uses Lebesgue measure. No integrability or normalization assumption is imposed; each entry uses the total Bochner integral and is zero if its integrand is not integrable. For n=0n=0n=0, the matrix is empty.

QAlgorithms.Papers.Independent.Intake100.P30.qpMoment

For any natural number nnn, including 000, and any function f:Rn→Cf:\mathbb R^n\to\mathbb Cf:Rn→C, the definition assigns the complex n×nn\times nn×n matrix with entries

Mjk=∫Rnqjf(q)‾ (−i Df(q)[ek]) dq(0≤j,k<n),M_{jk}=\int_{\mathbb R^n}\overline{q_jf(q)}\,\bigl(-i\,Df(q)[e_k]\bigr)\,dq \qquad(0\le j,k<n),Mjk​=∫Rn​qj​f(q)​(−iDf(q)[ek​])dq(0≤j,k<n),

where Df(q)Df(q)Df(q) is the real Fréchet derivative and eke_kek​ is the kkk-th coordinate vector. The derivative takes the zero linear map where fff is not differentiable. No differentiability, integrability, or normalization assumption is imposed; the total Bochner integral is zero when its integrand is not integrable. For n=0n=0n=0, the matrix is empty.

QAlgorithms.Papers.Independent.Intake100.P30.realNullifierCovariance

For every natural number nnn, including 000, every real n×nn\times nn×n matrix AAA, and every function f:Rn→Cf:\mathbb R^n\to\mathbb Cf:Rn→C, this definition gives the real matrix

Cjk=Re⁡∫RnNj(q)‾ Nk(q) dq,Nj(q)=−i DRf(q)[ej]−∑ℓ=0n−1Ajℓqℓf(q),C_{jk}=\operatorname{Re}\int_{\mathbb R^n}\overline{N_j(q)}\,N_k(q)\,dq, \qquad N_j(q)=-i\,D_{\mathbb R}f(q)[e_j]-\sum_{\ell=0}^{n-1}A_{j\ell}q_\ell f(q),Cjk​=Re∫Rn​Nj​(q)​Nk​(q)dq,Nj​(q)=−iDR​f(q)[ej​]−ℓ=0∑n−1​Ajℓ​qℓ​f(q),

where real coefficients are regarded as complex numbers and eje_jej​ is the jjj-th coordinate vector. No symmetry, normalization, differentiability, or integrability hypothesis is required; derivatives at points of nondifferentiability and integrals of nonintegrable integrands are assigned zero. For n=0n=0n=0, this is an empty matrix.

QAlgorithms.Papers.Independent.Intake100.P30.realPart

For any index types I,JI,JI,J, which need not be finite or nonempty, and any complex matrix Z=(Zij)i∈I,j∈JZ=(Z_{ij})_{i\in I,j\in J}Z=(Zij​)i∈I,j∈J​, realPart⁡(Z)\operatorname{realPart}(Z)realPart(Z) is the real matrix with the same indices defined entrywise by

realPart⁡(Z)ij=Re⁡(Zij).\operatorname{realPart}(Z)_{ij}=\operatorname{Re}(Z_{ij}).realPart(Z)ij​=Re(Zij​).

QAlgorithms.Papers.Independent.Intake100.P30.sechGraph

For any index type III with decidable equality, any real matrix AAA indexed by I×II\times II×I, and any real number α\alphaα, the definition assigns the complex matrix

Zjk=tanh⁡(2α)Ajk+i1cosh⁡(2α)δjk(j,k∈I).Z_{jk}=\tanh(2\alpha)A_{jk} +i\frac{1}{\cosh(2\alpha)}\delta_{jk}\qquad(j,k\in I).Zjk​=tanh(2α)Ajk​+icosh(2α)1​δjk​(j,k∈I).

Here real numbers are embedded in C\mathbb CC, and δjk\delta_{jk}δjk​ is 111 when j=kj=kj=k and 000 otherwise. The denominator is nonzero for every real α\alphaα. The index type may be infinite or empty, and AAA is unrestricted.

QAlgorithms.Papers.Independent.Intake100.P30.secondMoment

For any natural number nnn, any function f:Rn→Cf:\mathbb R^n\to\mathbb Cf:Rn→C, and any two indices a,ba,ba,b in the disjoint union of two copies of {0,…,n−1}\{0,\ldots,n-1\}{0,…,n−1}, define Raf(q)R_a f(q)Ra​f(q) to be qjf(q)q_jf(q)qj​f(q) if aaa is jjj in the first copy, and −i Df(q)[ej]-i\,Df(q)[e_j]−iDf(q)[ej​] if aaa is jjj in the second copy, with the same convention for bbb. The definition assigns the complex number

secondMoment⁡(f,a,b)=∫RnRaf(q)‾ Rbf(q) dq.\operatorname{secondMoment}(f,a,b) =\int_{\mathbb R^n}\overline{R_a f(q)}\,R_b f(q)\,dq.secondMoment(f,a,b)=∫Rn​Ra​f(q)​Rb​f(q)dq.

The derivative is the total real Fréchet derivative, zero where fff is not differentiable; the integral is the total Bochner integral, zero if its integrand is not integrable. No regularity, integrability, or normalization assumption is imposed. Although n=0n=0n=0 is allowed, there are then no indices a,ba,ba,b.

QAlgorithms.Papers.Independent.Intake100.P30.siegelDiscCoordinate

For every finite index type III equipped with decidable equality and every complex matrix ZZZ indexed by I×II\times II×I, this definition gives the complex matrix

(II+iZ)(II−iZ)−1,(I_I+iZ)(I_I-iZ)^{-1},(II​+iZ)(II​−iZ)−1,

where III_III​ is the identity matrix. There is no symmetry, positivity, or invertibility hypothesis on ZZZ; the inverse is the total matrix inverse, which is zero when II−iZI_I-iZII​−iZ is singular. The definition also applies when III is empty, producing the empty matrix.

QAlgorithms.Papers.Independent.Intake100.P30.symQpMoment

For any natural number nnn, including 000, and any function f:Rn→Cf:\mathbb R^n\to\mathbb Cf:Rn→C, the definition assigns the real n×nn\times nn×n matrix with entries

Tjk=2Re⁡ ⁣(∫Rnqjf(q)‾ (−i Df(q)[ek]) dq)(0≤j,k<n).T_{jk}=2\operatorname{Re}\!\left( \int_{\mathbb R^n}\overline{q_jf(q)}\,\bigl(-i\,Df(q)[e_k]\bigr)\,dq \right) \qquad(0\le j,k<n).Tjk​=2Re(∫Rn​qj​f(q)​(−iDf(q)[ek​])dq)(0≤j,k<n).

Here Df(q)Df(q)Df(q) is the total real Fréchet derivative, zero where fff is not differentiable, and eke_kek​ is the kkk-th coordinate vector. Integration uses Lebesgue measure and the total Bochner integral, which is zero for a nonintegrable integrand. No regularity, integrability, or normalization hypothesis is imposed. For n=0n=0n=0, the matrix is empty.

QAlgorithms.Papers.Independent.Intake100.P30.targetError

For any finite index type III with decidable equality, any complex matrix ZZZ indexed by I×II\times II×I, and any real matrix AAA with those indices, let Uij=Im⁡(Zij)U_{ij}=\operatorname{Im}(Z_{ij})Uij​=Im(Zij​) and Vij=Re⁡(Zij)V_{ij}=\operatorname{Re}(Z_{ij})Vij​=Re(Zij​). The real matrix targetError⁡(Z,A)\operatorname{targetError}(Z,A)targetError(Z,A) is

targetError⁡(Z,A)=12(U+VU−1V−AU−1V−VU−1AT+AU−1AT).\operatorname{targetError}(Z,A) =\frac12\left( U+VU^{-1}V-AU^{-1}V-VU^{-1}A^{\mathsf T} +AU^{-1}A^{\mathsf T} \right).targetError(Z,A)=21​(U+VU−1V−AU−1V−VU−1AT+AU−1AT).

There are no symmetry, positivity, or invertibility hypotheses on these matrices; U−1U^{-1}U−1 is the total matrix inverse, equal to zero when UUU is singular. The definition includes empty III.

QAlgorithms.Papers.Independent.Intake100.P30.twoEdge

This definition is the real 2×22\times22×2 matrix, with rows and columns indexed by 0,10,10,1,

(0110).\begin{pmatrix} 0&1\\ 1&0 \end{pmatrix}.(01​10​).
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