Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Definitions for Classical Shadow Tomography with Locally Scrambled Quantum Dynamics

Definition
QAlgorithms_Papers_Independent_Intakethird100_P71

by Gohan · Nov 1, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

The objects the formalized statements of Classical Shadow Tomography with Locally Scrambled Quantum Dynamics (arXiv:2107.04817) are stated in. Each was checked against the paper by a blind read-back and a moderator.

  • localMatrix: Tensor product of local unitaries, with no permutation of sites.
  • localConj: Conjugating an operator by a local basis change, PDF p.3 Eq.(5).
  • ProjectiveEnsemble: A measurement ensemble is fixed independently of the unknown state, PDF pp.1–3.
  • raw: Raw rank-one snapshot U†|b><b|U, PDF p.2 Eq.(1).
  • prior: Prior law: independent uniform computational outcome, PDF p.3 Eq.(2).
  • posteriorOf: Posterior snapshot law with the Born likelihood D Tr(S rho), PDF Eqs.(1)–(3).
  • partialTrace: Partial trace in region A. No density-matrix normalization is applied to X, PDF p.3 Eq.(8), p.6 Eq.(29), and Appendix B p.19.
  • reducedSnapshot: X_A: partial trace on the complement, then normalized identity there, in original site order; includes empty/full regions, PDF p.3 and p.18 Appendix A.
  • partialPurity: Unnormalized partial purity Tr((Tr_complement X)^2), PDF Eq.(8).
  • feature: Second entanglement feature, PDF p.3 Eq.(8).
  • channelCoefficient: Coefficients of the constructed measurement channel, PDF p.3 Eq.(3). Integration precedes linear extension, so the map acts on every complex operator.
  • snapshotMeasurementMap: Measurement channel D E[S Tr(S X)], PDF p.3 Eq.(3).
  • Complete: Tomographic completeness, PDF p.3 preceding Eq.(9).
  • snapshotInverse: The actual inverse of the constructed measurement channel; no reconstruction certificate is an input, PDF p.3 Eq.(9).
  • LocallyScrambled: Exact local conjugation invariance of the prior law, PDF p.3 Eq.(5).
  • regionalWg: Two-copy regional Weingarten coefficient, PDF p.3 Eq.(7).
  • fusion: Fusion coefficient, PDF p.4 Eq.(11), p.22 Eq.(C9). Negative exponents use reciprocals, not truncated natural subtraction.
  • CoefficientSystem: The coefficient solve, PDF p.4 Eq.(12), not an assumed inverse identity.
  • efReconstruct: EF reconstruction from coefficients, PDF pp.3–4 Eq.(9). Signed coefficients are allowed; complete positivity is not required of reconstruction.
  • snapshotMoment: Moments of the prior snapshot law, PDF p.12 Eq.(43).
  • SnapshotPolynomialIntegrable: Polynomial integrability, stated as a conclusion for the constructed ensembles. This prevents default-zero Bochner integrals from supplying the identities.
  • shadowEstimate: Single-shot linear observable estimator, PDF p.4 Eq.(13).
  • secondMoment: State-dependent second moment Q, PDF p.4 Eq.(14).
  • shotVariance: Single-shot variance, PDF p.4 Eq.(14).
  • snapshotSampleLaw: Independent snapshots on identical copies, PDF p.5 preceding Eq.(18).
  • shadowSampleMean: Arithmetic mean of m single-shot predictions, PDF p.5.
  • averagedSecondMoment: Local-Haar state average of Q, PDF p.5 Eq.(20). H is a normalized left-invariant measure on the compact local group, hence Haar.
  • observableFeature: Observable EF from its local Haar orbit, PDF pp.5,19 Eq.(22), (B4).
  • varianceCoefficient: Coefficient in Eq.(22). The signed power multiplies, and the exponent of d is an integer difference expressed by division, PDF pp.5,19.
  • Permutations: The source product group (S_t)^N, never S_(tN), PDF p.4.
  • copyPermutation: Copy permutations act independently at each original site, PDF Eq.(17).
  • wgThree: Unitary three-copy Weingarten function in character form. At d=2, the three-row partition is omitted: this is the Moore–Penrose/spectral extension, not the inverse of the singular permutation Gram matrix, PDF p.4 Eq.(15).
  • productWgThree: Three-copy coefficients factor over sites, PDF p.4 Eq.(15).
  • featureThree: Third EF; individual permutation traces can be complex, PDF p.5 Eq.(17).
  • observableThree: Generalized operator term d^N Tr((R[O] ⊗ R[O] ⊗ rho) chi_g), Eq.(16).
  • ToyFeature: Toy-model feature vector (1,w,w,1), PDF p.5 Eq.(24).
  • toyCoefficients: Two-qudit reconstruction coefficients, source order empty, first, second, full, PDF p.5 Eq.(26).
  • oneSiteInverse: Local inverse superoperator, Eq.(27) extended linearly to arbitrary inputs.
  • twoSiteProduct: Product input in original site order, used only for the Eq.(27) product-input specialization, PDF p.6.
  • localityNumerator: Sum of the two unnormalized partial purities. This avoids dividing by Tr(O²), so the undivided Eq.(31) also includes O=0.
  • hsSquare: Hilbert–Schmidt square for Hermitian O.
  • localObservable: Local observable A ⊗ I, PDF p.6 Eq.(32).
  • gueOperator: Trace-removed GUE, constructed from independent standard real Gaussians. Overall GUE scaling cancels from Eq.(34); diagonal and off-diagonal variances have the invariant GUE ratio. PDF p.6, interpreted in ensemble expectation.
  • gueCoordinates: Independent Gaussian coordinates for the trace-removed GUE.
  • twirled: Local twirling of a snapshot law, joint in V and snapshot, PDF p.12 Eq.(43).
  • framePotential: Second frame potential with two independent snapshots, PDF p.12 Eq.(42).
  • frameGap: Frame-potential gap, PDF p.12 Eq.(45).
  • localMomentAction: Moment twirl of local-unitary law; t-design means equality of these superoperators for every X, PDF pp.2,11 (Clifford at the 3-design level).
  • IsLocalDesign: Design equality at the specified moment order, not equality of laws.
  • sandwichRaw: The prior snapshot from the fixed sandwich L U0 R, PDF p.11.
  • sandwichPrior: Independent end factors and uniform prior b, with U0 fixed before rho.
  • fusionSite: Scalar site tensor with axes (a,b,c); the displayed Eq.(C10) is a 2x2 array of 2-vectors, PDF p.22.
  • DualTableau: Signed dual simulation tableau: stabilizers T and destabilizers D, with D_i anticommuting precisely with T_i. Appendix C.2 PDF pp.20–21.
  • tableauInput: Input bits for the standard tableau postprocessor; header n, stabilizers, duals, then the signed Pauli. Preprocessing an arbitrary generator list is not charged as free work. PDF p.21 quadratic scalar routine.
  • pauliFactor: Bond-one local factors in Eq.(C7), including identity Paulis.
  • scalarCode: Signed scalar encoding: zero=0, +1=1, -1=2. It is a specification, not a primitive machine instruction for a dense trace.
  • tableauRecord: Serialized bond-one MPS record: one scalar code and exactly two entries per site. Its target is computed by the charged machine in Proposition I.
Definition code
import Mathlib
import Definitions.Def_QAlgorithms_Defs_Channel
import Definitions.Def_QAlgorithms_Defs_Stabilizer
import Definitions.Def_QAlgorithms_Defs_ClassicalDecoderMachines
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P21
import Definitions.Def_QAlgorithms_Papers_Independent_Information100_P63
import Definitions.Def_QAlgorithms_Defs_LocalHamiltonian

/-!
Statements from Hu–Choi–You, arXiv:2107.04817v4. All page numbers are PDF pages.
Paper-specific definitions below are local to this paper. Configuration and
operator carriers and matrix tensor powers reuse pinned accepted definitions. In particular, a squared shadow
norm here is a second moment, never a supremum over input states.
-/

noncomputable section

open MeasureTheory
open scoped Matrix ComplexConjugate ENNReal Matrix.Norms.Elementwise

namespace QAlgorithms.Papers.Independent.Intakethird100.P71

attribute [local instance] Classical.propDecidable

/- Computational configurations, PDF pp.2–3. -/
local notation "Config" n:max d:max =>
  QAlgorithms.Papers.Independent.Information100.P21.Config (P := Fin n) (fun _ => d)

/- Operators in the original site order, PDF p.3. -/
local notation "Op" n:max d:max =>
  QAlgorithms.Papers.Independent.Information100.P21.Op (Config n d)

/-- Continuous extended norm for the finite operator spaces in PDF pp.2–3.
Use the nested function-space instance underlying the elementwise matrix norm
and product topology, including tensor-copy registers. This is local instance
plumbing, not an extra regularity hypothesis on a snapshot ensemble. -/
local instance matrixContinuousENorm {ι κ : Type*} [Fintype ι] [Fintype κ] :
    ContinuousENorm (Matrix ι κ ℂ) :=
  inferInstanceAs (ContinuousENorm (ι → κ → ℂ))

/-- Sanity: the snapshot operator carrier has a continuous extended norm. -/
example {n d : ℕ} : ContinuousENorm (Op n d) := inferInstance

/-- Sanity: the accepted tensor-power output carrier has the same instance. -/
example {n d t : ℕ} : ContinuousENorm
    (QAlgorithms.Papers.Independent.Information100.P63.Mat (Fin t → Config n d)) :=
  inferInstance

/-- Borel sigma algebra on finite-dimensional snapshot operators, PDF pp.2–3.
The prior pushforward and Born posterior use this measurable structure. -/
instance operatorMeasurable {n d : ℕ} : MeasurableSpace (Op n d) := borel _

/-- The operator measurable structure is the Borel structure, PDF pp.2–3. -/
instance operatorBorel {n d : ℕ} : BorelSpace (Op n d) := ⟨rfl⟩

/- Global measurement unitaries, PDF p.2. -/
local notation "Unitary" n:max d:max => Matrix.unitaryGroup (Config n d) ℂ

/-- The Borel sigma algebra on any finite unitary group, PDF pp.2–3. -/
instance unitaryMeasurable {ι : Type*} [Fintype ι] [DecidableEq ι] :
    MeasurableSpace (Matrix.unitaryGroup ι ℂ) := borel _

/-- The unitary ensemble carries its Borel measurable structure. -/
instance unitaryBorel {ι : Type*} [Fintype ι] [DecidableEq ι] :
    BorelSpace (Matrix.unitaryGroup ι ℂ) := ⟨rfl⟩

/- Local basis transformations, PDF p.3 Eq.(5). -/
local notation "Local" n:max d:max => Fin n → Matrix.unitaryGroup (Fin d) ℂ

/-- Tensor product of local unitaries, with no permutation of sites. -/
def localMatrix {n d : ℕ} (V : Local n d) : Op n d :=
  Matrix.of fun x y => ∏ i, (V i : Matrix (Fin d) (Fin d) ℂ) (x i) (y i)

/-- Conjugating an operator by a local basis change, PDF p.3 Eq.(5). -/
def localConj {n d : ℕ} (V : Local n d) (X : Op n d) : Op n d :=
  (localMatrix V)ᴴ * X * localMatrix V

/-- A measurement ensemble is fixed independently of the unknown state, PDF pp.1–3. -/
structure ProjectiveEnsemble (n d : ℕ) where
  law : Measure (Unitary n d)
  probability : IsProbabilityMeasure law

/-- Raw rank-one snapshot U†|b><b|U, PDF p.2 Eq.(1). -/
def raw {n d : ℕ} (U : Unitary n d) (b : Config n d) : Op n d :=
  (U : Op n d)ᴴ * Matrix.single b b 1 * (U : Op n d)

/-- Prior law: independent uniform computational outcome, PDF p.3 Eq.(2). -/
def prior {n d : ℕ} (E : ProjectiveEnsemble n d) : Measure (Op n d) :=
  (ENNReal.ofReal ((d : ℝ) ^ n)⁻¹) • ∑ b : Config n d, E.law.map (fun U => raw U b)

/-- Posterior snapshot law with the Born likelihood D Tr(S rho), PDF Eqs.(1)–(3). -/
def posteriorOf {n d : ℕ} (nu : Measure (Op n d)) (rho : Op n d) : Measure (Op n d) :=
  nu.withDensity (fun S => ENNReal.ofReal (((d : ℝ) ^ n) * (S * rho).trace.re))

/-- Partial trace in region A. No density-matrix normalization is applied to X,
PDF p.3 Eq.(8), p.6 Eq.(29), and Appendix B p.19. -/
def partialTrace {n : ℕ} {α : Type*} [Fintype α] [DecidableEq α]
    (A : Finset (Fin n)) (X : Matrix (Fin n → α) (Fin n → α) ℂ) :
    Matrix (A → α) (A → α) ℂ :=
  Matrix.of fun x y => ∑ z : (Aᶜ : Finset (Fin n)) → α,
    X (fun i => if h : i ∈ A then x ⟨i,h⟩ else z ⟨i,by simpa using h⟩)
      (fun i => if h : i ∈ A then y ⟨i,h⟩ else z ⟨i,by simpa using h⟩)

/-- X_A: partial trace on the complement, then normalized identity there, in
original site order; includes empty/full regions, PDF p.3 and p.18 Appendix A. -/
def reducedSnapshot {n : ℕ} {α : Type*} [Fintype α] [DecidableEq α]
    (A : Finset (Fin n)) (X : Matrix (Fin n → α) (Fin n → α) ℂ) :
    Matrix (Fin n → α) (Fin n → α) ℂ :=
  Matrix.of fun x y =>
    if ∀ i, i ∉ A → x i = y i then
      partialTrace A X (fun i => x i) (fun i => y i) /
        ((Fintype.card α : ℂ) ^ (n - A.card))
    else 0

/-- Unnormalized partial purity Tr((Tr_complement X)^2), PDF Eq.(8). -/
def partialPurity {n d : ℕ} (A : Finset (Fin n)) (X : Op n d) : ℝ :=
  ((partialTrace A X) * (partialTrace A X)).trace.re

/-- Second entanglement feature, PDF p.3 Eq.(8). -/
def feature {n d : ℕ} (nu : Measure (Op n d)) (A : Finset (Fin n)) : ℝ :=
  ∫ S, partialPurity A S ∂nu

/-- Coefficients of the constructed measurement channel, PDF p.3 Eq.(3).
Integration precedes linear extension, so the map acts on every complex operator. -/
def channelCoefficient {n d : ℕ} (nu : Measure (Op n d))
    (i j k l : Config n d) : ℂ :=
  ∫ S, ((d : ℂ) ^ n) * S i j * S l k ∂nu

/-- Measurement channel D E[S Tr(S X)], PDF p.3 Eq.(3). -/
def snapshotMeasurementMap {n d : ℕ} (nu : Measure (Op n d)) : Op n d →ₗ[ℂ] Op n d where
  toFun X := Matrix.of fun i j => ∑ k, ∑ l, channelCoefficient nu i j k l * X k l
  map_add' X Y := by ext i j; simp [mul_add, Finset.sum_add_distrib]
  map_smul' a X := by ext i j; simp [Finset.mul_sum, mul_left_comm]

/-- Tomographic completeness, PDF p.3 preceding Eq.(9). -/
def Complete {n d : ℕ} (nu : Measure (Op n d)) : Prop :=
  Function.Injective (snapshotMeasurementMap nu)

/-- The actual inverse of the constructed measurement channel; no reconstruction
certificate is an input, PDF p.3 Eq.(9). -/
def snapshotInverse {n d : ℕ} (nu : Measure (Op n d)) (h : Complete nu) : Op n d ≃ₗ[ℂ] Op n d :=
  (LinearEquiv.ofBijective (snapshotMeasurementMap nu)
    ⟨(show Function.Injective (snapshotMeasurementMap nu) from h),
      LinearMap.injective_iff_surjective.mp
        (show Function.Injective (snapshotMeasurementMap nu) from h)⟩).symm

/-- Exact local conjugation invariance of the prior law, PDF p.3 Eq.(5). -/
def LocallyScrambled {n d : ℕ} (nu : Measure (Op n d)) : Prop :=
  ∀ V : Local n d, nu.map (localConj V) = nu

/-- Two-copy regional Weingarten coefficient, PDF p.3 Eq.(7). -/
def regionalWg (n d : ℕ) (A B : Finset (Fin n)) : ℝ :=
  ((d : ℝ)^2 - 1)⁻¹ ^ n * (-1 / (d : ℝ)) ^ (symmDiff A B).card

/-- Fusion coefficient, PDF p.4 Eq.(11), p.22 Eq.(C9).
Negative exponents use reciprocals, not truncated natural subtraction. -/
def fusion (n d : ℕ) (A B C : Finset (Fin n)) : ℝ :=
  ((d : ℝ)^3 / ((d : ℝ)^2 - 1)) ^ n *
    ∑ D : Finset (Fin n), if B = A ∩ D then
      ((d : ℝ) ^ D.card)⁻¹ * (-1 / (d : ℝ)) ^ (symmDiff C D).card else 0

/-- The coefficient solve, PDF p.4 Eq.(12), not an assumed inverse identity. -/
def CoefficientSystem {n d : ℕ} (nu : Measure (Op n d))
    (r : Finset (Fin n) → ℝ) : Prop :=
  ∀ B : Finset (Fin n),
    (∑ A : Finset (Fin n), ∑ C : Finset (Fin n),
      r A * fusion n d A B C * feature nu C) = if B = Finset.univ then 1 else 0

/-- EF reconstruction from coefficients, PDF pp.3–4 Eq.(9). Signed coefficients
are allowed; complete positivity is not required of reconstruction. -/
def efReconstruct {n d : ℕ} (r : Finset (Fin n) → ℝ) (X : Op n d) : Op n d :=
  ((d : ℂ) ^ n) • ∑ A : Finset (Fin n), (r A : ℂ) • reducedSnapshot A X

-- The accepted matrix tensor power has exactly the copy-first coordinate formula.
open QAlgorithms.Papers.Independent.Information100.P63 (tensorPower)

/-- Moments of the prior snapshot law, PDF p.12 Eq.(43). -/
def snapshotMoment {n d : ℕ} (nu : Measure (Op n d)) (t : ℕ) :=
  ∫ S, tensorPower t S ∂nu

/-- Polynomial integrability, stated as a conclusion for the constructed ensembles.
This prevents default-zero Bochner integrals from supplying the identities. -/
def SnapshotPolynomialIntegrable {n d : ℕ} (nu : Measure (Op n d)) : Prop :=
  (∀ t : ℕ, Integrable (fun S => tensorPower t S) nu) ∧
  (∀ X : Op n d, Integrable (fun S => (S * X).trace • S) nu) ∧
  (∀ X Y : Op n d, Integrable (fun S => (X * S).trace.re ^ 2 * (S * Y).trace.re) nu)

/-- Single-shot linear observable estimator, PDF p.4 Eq.(13). -/
def shadowEstimate {n d : ℕ} (nu : Measure (Op n d)) (h : Complete nu)
    (O S : Op n d) : ℝ := (O * snapshotInverse nu h S).trace.re

/-- State-dependent second moment Q, PDF p.4 Eq.(14). -/
def secondMoment {n d : ℕ} (nu : Measure (Op n d)) (h : Complete nu)
    (rho O : Op n d) : ℝ :=
  ∫ S, shadowEstimate nu h O S ^ 2 ∂posteriorOf nu rho

/-- Single-shot variance, PDF p.4 Eq.(14). -/
def shotVariance {n d : ℕ} (nu : Measure (Op n d)) (h : Complete nu)
    (rho O : Op n d) : ℝ :=
  secondMoment nu h rho O - (∫ S, shadowEstimate nu h O S ∂posteriorOf nu rho) ^ 2

/-- Independent snapshots on identical copies, PDF p.5 preceding Eq.(18). -/
def snapshotSampleLaw {n d : ℕ} (nu : Measure (Op n d)) (rho : Op n d) (m : ℕ) :
    Measure (Fin m → Op n d) := Measure.pi fun _ => posteriorOf nu rho

/-- Arithmetic mean of m single-shot predictions, PDF p.5. -/
def shadowSampleMean {n d m : ℕ} (nu : Measure (Op n d)) (h : Complete nu)
    (O : Op n d) (shots : Fin m → Op n d) : ℝ :=
  (m : ℝ)⁻¹ * ∑ k, shadowEstimate nu h O (shots k)

/-- Local-Haar state average of Q, PDF p.5 Eq.(20).
H is a normalized left-invariant measure on the compact local group, hence Haar. -/
def averagedSecondMoment {n d : ℕ} (H : Measure (Local n d))
    (nu : Measure (Op n d)) (h : Complete nu) (rho O : Op n d) : ℝ :=
  ∫ V, secondMoment nu h (localConj V rho) O ∂H

/-- Observable EF from its local Haar orbit, PDF pp.5,19 Eq.(22), (B4). -/
def observableFeature {n d : ℕ} (H : Measure (Local n d))
    (O : Op n d) (A : Finset (Fin n)) : ℝ :=
  ∫ V, partialPurity A (localConj V O) ∂H

/-- Coefficient in Eq.(22). The signed power multiplies, and the exponent of d
is an integer difference expressed by division, PDF pp.5,19. -/
def varianceCoefficient {n : ℕ} (d : ℕ) (r : Finset (Fin n) → ℝ)
    (A B C D : Finset (Fin n)) : ℝ :=
  r A * r B * ((d : ℝ)^2 / ((d : ℝ)^2 - 1)) ^ n *
    ((d : ℝ) ^ (A ∩ B ∩ C).card / (d : ℝ) ^ C.card) *
    (-1 / (d : ℝ)) ^ (symmDiff C D).card

/-- The source product group (S_t)^N, never S_(tN), PDF p.4. -/
abbrev Permutations (n t : ℕ) := Fin n → Equiv.Perm (Fin t)

/-- Copy permutations act independently at each original site, PDF Eq.(17). -/
def copyPermutation {n d t : ℕ} (g : Permutations n t) :
    Matrix (Fin t → Config n d) (Fin t → Config n d) ℂ :=
  Matrix.of fun x y => if ∀ i k, x k i = y (g i k) i then 1 else 0

/-- Unitary three-copy Weingarten function in character form. At d=2, the
three-row partition is omitted: this is the Moore–Penrose/spectral extension,
not the inverse of the singular permutation Gram matrix, PDF p.4 Eq.(15). -/
def wgThree (d : ℕ) (p : Equiv.Perm (Fin 3)) : ℝ :=
  let a := (d : ℝ)
  let chi := ((Finset.univ.filter fun i : Fin 3 => p i = i).card : ℝ) - 1
  (1 / 6) * ((a * (a+1) * (a+2))⁻¹ +
    2 * chi / (a * (a+1) * (a-1)) +
    if 3 ≤ d then (((Equiv.Perm.sign p : ℤˣ) : ℤ) : ℝ) /
      (a * (a-1) * (a-2)) else 0)

/-- Three-copy coefficients factor over sites, PDF p.4 Eq.(15). -/
def productWgThree {n : ℕ} (d : ℕ) (g h : Permutations n 3) : ℝ :=
  ∏ i, wgThree d (g i * (h i)⁻¹)

/-- Third EF; individual permutation traces can be complex, PDF p.5 Eq.(17). -/
def featureThree {n d : ℕ} (nu : Measure (Op n d)) (h : Permutations n 3) : ℂ :=
  ∫ S, (tensorPower 3 S * copyPermutation h).trace ∂nu

/-- Generalized operator term d^N Tr((R[O] ⊗ R[O] ⊗ rho) chi_g), Eq.(16). -/
def observableThree {n d : ℕ} (nu : Measure (Op n d)) (hc : Complete nu)
    (rho O : Op n d) (g : Permutations n 3) : ℂ :=
  let R := snapshotInverse nu hc O
  let T : Matrix (Fin 3 → Config n d) (Fin 3 → Config n d) ℂ :=
    Matrix.of fun x y => R (x 0) (y 0) * R (x 1) (y 1) * rho (x 2) (y 2)
  ((d : ℂ)^n) * (T * copyPermutation g).trace

/-- Toy-model feature vector (1,w,w,1), PDF p.5 Eq.(24). -/
def ToyFeature {d : ℕ} (nu : Measure (Op 2 d)) (w : ℝ) : Prop :=
  ∀ A : Finset (Fin 2), feature nu A = if A.card = 1 then w else 1

/-- Two-qudit reconstruction coefficients, source order empty, first, second,
full, PDF p.5 Eq.(26). -/
def toyCoefficients (d : ℕ) (w : ℝ) (A : Finset (Fin 2)) : ℝ :=
  let a := (d : ℝ)
  if A.card = 0 then (a^3*w - 3*a^2 + 3*a*w - 2*w^2 + 1) /
    ((a*w-1)*(a^2-2*a*w+1))
  else if A.card = 1 then (-a^4*w + 2*a^3 - 2*a + w) /
    (a*(a*w-1)*(a^2-2*a*w+1))
  else (a^2-1)^2 / (a^2*(a^2-2*a*w+1))

/-- Local inverse superoperator, Eq.(27) extended linearly to arbitrary inputs. -/
def oneSiteInverse (d : ℕ) (X : Matrix (Fin d) (Fin d) ℂ) : Matrix (Fin d) (Fin d) ℂ :=
  ((d : ℂ)+1) • X - X.trace • 1

/-- Product input in original site order, used only for the Eq.(27)
product-input specialization, PDF p.6. -/
def twoSiteProduct {d : ℕ} (X Y : Matrix (Fin d) (Fin d) ℂ) : Op 2 d :=
  Matrix.of fun x y => X (x 0) (y 0) * Y (x 1) (y 1)

/-- Sum of the two unnormalized partial purities. This avoids dividing by
Tr(O²), so the undivided Eq.(31) also includes O=0. -/
def localityNumerator {d : ℕ} (O : Op 2 d) : ℝ :=
  partialPurity {0} O + partialPurity {1} O

/-- Hilbert–Schmidt square for Hermitian O. -/
def hsSquare {n d : ℕ} (O : Op n d) : ℝ := (O * O).trace.re

/-- Local observable A ⊗ I, PDF p.6 Eq.(32). -/
def localObservable {d : ℕ} (A : Matrix (Fin d) (Fin d) ℂ) : Op 2 d :=
  twoSiteProduct A 1

/-- Trace-removed GUE, constructed from independent standard real Gaussians.
Overall GUE scaling cancels from Eq.(34); diagonal and off-diagonal variances
have the invariant GUE ratio. PDF p.6, interpreted in ensemble expectation. -/
def gueOperator (d : ℕ) (z : Config 2 d × Config 2 d × Bool → ℝ) : Op 2 d :=
  let Z : Op 2 d := Matrix.of fun i j => (z (i,j,false) : ℂ) + Complex.I * z (i,j,true)
  let G := (2 : ℂ)⁻¹ • (Z + Zᴴ)
  G - (G.trace / ((d : ℂ)^2)) • 1

/-- Independent Gaussian coordinates for the trace-removed GUE. -/
def gueCoordinates (d : ℕ) : Measure (Config 2 d × Config 2 d × Bool → ℝ) :=
  Measure.pi fun _ => ProbabilityTheory.gaussianReal 0 1

/-- Local twirling of a snapshot law, joint in V and snapshot, PDF p.12 Eq.(43). -/
def twirled {n d : ℕ} (H : Measure (Local n d)) (nu : Measure (Op n d)) : Measure (Op n d) :=
  (H.prod nu).map (fun p => localConj p.1 p.2)

/-- Second frame potential with two independent snapshots, PDF p.12 Eq.(42). -/
def framePotential {n d : ℕ} (nu : Measure (Op n d)) : ℝ :=
  ∫ p, (p.1 * p.2).trace.re ^ 2 ∂nu.prod nu

/-- Frame-potential gap, PDF p.12 Eq.(45). -/
def frameGap {n d : ℕ} (H : Measure (Local n d)) (nu : Measure (Op n d)) : ℝ :=
  framePotential nu - framePotential (twirled H nu)

/-- Moment twirl of local-unitary law; t-design means equality of these
superoperators for every X, PDF pp.2,11 (Clifford at the 3-design level). -/
def localMomentAction {n d : ℕ} (mu : Measure (Local n d)) (t : ℕ)
    (X : Matrix (Fin t → Config n d) (Fin t → Config n d) ℂ) :=
  ∫ V, (tensorPower t (localMatrix V))ᴴ * X * tensorPower t (localMatrix V) ∂mu

/-- Design equality at the specified moment order, not equality of laws. -/
def IsLocalDesign {n d : ℕ} (mu H : Measure (Local n d)) (t : ℕ) : Prop :=
  ∀ X, localMomentAction mu t X = localMomentAction H t X

/-- The prior snapshot from the fixed sandwich L U0 R, PDF p.11. -/
def sandwichRaw {n d : ℕ} (U0 : Unitary n d) (L R : Local n d) (b : Config n d) : Op n d :=
  let U := localMatrix L * (U0 : Op n d) * localMatrix R
  Uᴴ * Matrix.single b b 1 * U

/-- Independent end factors and uniform prior b, with U0 fixed before rho. -/
def sandwichPrior {n d : ℕ} (U0 : Unitary n d) (muL muR : Measure (Local n d)) :
    Measure (Op n d) :=
  ENNReal.ofReal ((d : ℝ)^n)⁻¹ • ∑ b : Config n d,
    (muL.prod muR).map (fun p => sandwichRaw U0 p.1 p.2 b)

/-- Scalar site tensor with axes (a,b,c); the displayed Eq.(C10) is a 2x2
array of 2-vectors, PDF p.22. -/
def fusionSite (d : ℕ) (a b c : Bool) : ℝ :=
  if a then
    if b then if c then (d : ℝ)^2 / ((d : ℝ)^2-1) else -(d : ℝ) / ((d : ℝ)^2-1)
    else if c then -(d : ℝ)^2 / ((d : ℝ)^2-1) else (d : ℝ)^3 / ((d : ℝ)^2-1)
  else if b then 0 else if c then 0 else d

/-- Signed dual simulation tableau: stabilizers T and destabilizers D, with
D_i anticommuting precisely with T_i. Appendix C.2 PDF pp.20–21. -/
def DualTableau {n : ℕ} (T D : QAlgorithms.Stabilizer.Tableau n) : Prop :=
  QAlgorithms.Stabilizer.IsValidTableau T ∧ QAlgorithms.Stabilizer.IsValidTableau D ∧
  ∀ i j, (D i).toMatrix * (T j).toMatrix =
    (if i = j then (-1 : ℂ) else 1) • ((T j).toMatrix * (D i).toMatrix)

/-- Input bits for the standard tableau postprocessor; header n, stabilizers,
duals, then the signed Pauli. Preprocessing an arbitrary generator list is not
charged as free work. PDF p.21 quadratic scalar routine. -/
def tableauInput {n : ℕ} (T D : QAlgorithms.Stabilizer.Tableau n)
    (O : QAlgorithms.Stabilizer.PauliString n) : List ℕ :=
  [n] ++ ((QAlgorithms.Stabilizer.encodeTableau T ++ QAlgorithms.Stabilizer.encodeTableau D ++
    QAlgorithms.Stabilizer.encPhase O.phase ++
    (List.ofFn fun i => QAlgorithms.Stabilizer.encPauli (O.ops i)).flatten).map Bool.toNat)

/-- Bond-one local factors in Eq.(C7), including identity Paulis. -/
def pauliFactor {n : ℕ} (O : QAlgorithms.Stabilizer.PauliString n) (i : Fin n) (a : Bool) : ℂ :=
  if O.ops i = .I ∨ a = true then 1 else 0

/-- Signed scalar encoding: zero=0, +1=1, -1=2. It is a specification, not a
primitive machine instruction for a dense trace. -/
def scalarCode (z : ℂ) : ℕ := if z = 1 then 1 else if z = -1 then 2 else 0

/-- Serialized bond-one MPS record: one scalar code and exactly two entries
per site. Its target is computed by the charged machine in Proposition I. -/
def tableauRecord {n : ℕ} (T : QAlgorithms.Stabilizer.Tableau n)
    (O : QAlgorithms.Stabilizer.PauliString n) : List ℕ :=
  [scalarCode (O.toMatrix * QAlgorithms.Stabilizer.tableauProjector T).trace] ++
    (List.ofFn fun i => [if O.ops i = .I then 1 else 0, 1]).flatten

/-- Sanity: partial trace/reduction of zero is zero (normalization cannot create mass). -/
example {n d : ℕ} (A : Finset (Fin n)) : reducedSnapshot A (0 : Op n d) = 0 := by
  ext x y
  simp [reducedSnapshot, partialTrace]

/-- Sanity: the constructed channel maps zero to zero. -/
example {n d : ℕ} (nu : Measure (Op n d)) : snapshotMeasurementMap nu 0 = 0 := map_zero _

/-- Sanity: the scalar-register fusion coefficient is one. -/
example (d : ℕ) : fusion 0 d ∅ ∅ ∅ = 1 := by
  simp [fusion, Finset.eq_empty_of_isEmpty]

/-- Sanity: the two branches of the site tensor agree with the displayed
upper-left 2-vector (d,0), without a nonzero denominator assumption. -/
example (d : ℕ) : fusionSite d false false false = d ∧
    fusionSite d false false true = 0 := by simp [fusionSite]

/-- Sanity: no Gaussian input produces a spurious nonzero operator at zero. -/
example (d : ℕ) : gueOperator d (fun _ => 0) = 0 := by
  have hz : (Matrix.of (fun i j : Config 2 d =>
      ((0 : ℝ) : ℂ) + Complex.I * (0 : ℝ))) = (0 : Op 2 d) := by
    ext i j
    simp
  unfold gueOperator
  rw [hz]
  simp

/-- Sanity: Eq.(C7)'s included-site factor is one, even for a zero MPS scalar. -/
example {n : ℕ} (O : QAlgorithms.Stabilizer.PauliString n) (i : Fin n) :
    pauliFactor O i true = 1 := by simp [pauliFactor]

end QAlgorithms.Papers.Independent.Intakethird100.P71
Source
Classical Shadow Tomography with Locally Scrambled Quantum Dynamics, arXiv:2107.04817v4, https://arxiv.org/abs/2107.04817v4
Read-back

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

QAlgorithms.Papers.Independent.Intakethird100.P71.CoefficientSystem

For arbitrary natural numbers n,dn,dn,d, any measure ν\nuν on complex matrices indexed by C={0,…,d−1}{0,…,n−1}\mathcal C=\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}C={0,…,d−1}{0,…,n−1}, and any real-valued function rrr on subsets of U={0,…,n−1}U=\{0,\ldots,n-1\}U={0,…,n−1}, this property requires, for every B⊆UB\subseteq UB⊆U,

∑A,C⊆Ur(A)(d3d2−1)n[∑D⊆UB=A∩D(d∣D∣)−1(−1d)∣C△D∣][∫Re⁡tr⁡(RC(S)2) dν(S)]={1,B=U,0,B≠U,\sum_{A,C\subseteq U} r(A) \left(\frac{d^3}{d^2-1}\right)^n \left[ \sum_{\substack{D\subseteq U\\B=A\cap D}} (d^{|D|})^{-1} \left(\frac{-1}{d}\right)^{|C\triangle D|} \right] \left[ \int \operatorname{Re}\operatorname{tr}(R_C(S)^2)\,d\nu(S) \right] = \begin{cases} 1,&B=U,\\ 0,&B\ne U, \end{cases}A,C⊆U∑​r(A)(d2−1d3​)n​D⊆UB=A∩D​∑​(d∣D∣)−1(d−1​)∣C△D∣​[∫Retr(RC​(S)2)dν(S)]={1,0,​B=U,B=U,​

where RC(S)(x,y)=∑z∈{0,…,d−1}CcS(x⊕Cz,y⊕Cz)R_C(S)(x,y)=\sum_{z\in\{0,\ldots,d-1\}^{C^c}}S(x\oplus_C z,y\oplus_C z)RC​(S)(x,y)=∑z∈{0,…,d−1}Cc​S(x⊕C​z,y⊕C​z), and ⊕C\oplus_C⊕C​ combines configurations on CCC and its complement. There are no probability, support, or integrability assumptions on ν\nuν; nonintegrable integrals are zero. Division by zero is zero and zeroth powers are one. In particular, when n>0n>0n>0 and ddd is zero or one, every fusion factor vanishes, so no rrr can satisfy the required equation for B=UB=UB=U. When n=0n=0n=0, the system is the single equation r(∅)∫Re⁡tr⁡(S2) dν(S)=1r(\varnothing)\int\operatorname{Re}\operatorname{tr}(S^2)\,d\nu(S)=1r(∅)∫Retr(S2)dν(S)=1.

QAlgorithms.Papers.Independent.Intakethird100.P71.Complete

For arbitrary natural numbers n,dn,dn,d and any measure ν\nuν on complex matrices indexed by C={0,…,d−1}{0,…,n−1}\mathcal C=\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}C={0,…,d−1}{0,…,n−1}, this property means that the complex-linear map

(Mν(X))ij=∑k,l∈C(∫dnSijSlk dν(S))Xkl(\mathcal M_\nu(X))_{ij} = \sum_{k,l\in\mathcal C} \left(\int d^n S_{ij}S_{lk}\,d\nu(S)\right)X_{kl}(Mν​(X))ij​=k,l∈C∑​(∫dnSij​Slk​dν(S))Xkl​

is injective: for every pair of complex matrices X,YX,YX,Y, equality Mν(X)=Mν(Y)\mathcal M_\nu(X)=\mathcal M_\nu(Y)Mν​(X)=Mν​(Y) implies X=YX=YX=Y. This concerns all matrices, without positivity or trace restrictions. No probability or integrability assumption is imposed on ν\nuν, and nonintegrable coefficient integrals are zero. When d=0<nd=0<nd=0<n, the matrix space has only one element, so injectivity holds vacuously; when n=0n=0n=0, the configuration set instead has one element.

QAlgorithms.Papers.Independent.Intakethird100.P71.DualTableau

For any natural number nnn, let T,DT,DT,D each be an nnn-tuple of Pauli strings on nnn qubits. A string with phase c∈Z/4Zc\in\mathbb Z/4\mathbb Zc∈Z/4Z and factors Pq∈{I,X,Y,Z}P_q\in\{I,X,Y,Z\}Pq​∈{I,X,Y,Z} represents the matrix icˉ⨂q<nPqi^{\bar c}\bigotimes_{q<n}P_qicˉ⨂q<n​Pq​, where cˉ∈{0,1,2,3}\bar c\in\{0,1,2,3\}cˉ∈{0,1,2,3}, and the single-qubit matrices are III, X=(0110)X=\begin{pmatrix}0&1\\1&0\end{pmatrix}X=(01​10​), Y=(0−ii0)Y=\begin{pmatrix}0&-i\\i&0\end{pmatrix}Y=(0i​−i0​), and Z=diag⁡(1,−1)Z=\operatorname{diag}(1,-1)Z=diag(1,−1). This predicate requires each of T,DT,DT,D separately to satisfy all of the following: every phase is 000 or 222; all represented matrices commute; for every index jjj, every subset sss of indices excluding jjj, and every c∈Z/4Zc\in\mathbb Z/4\mathbb Zc∈Z/4Z, its jjj-th matrix differs from icˉi^{\bar c}icˉ times the product of its matrices indexed by sss; and no such subset product equals minus the identity. Subset products are taken in increasing index order, with empty product the identity. In addition, for every i,j<ni,j<ni,j<n, DiTj=−TjDiD_iT_j=-T_jD_iDi​Tj​=−Tj​Di​ if i=ji=ji=j, and DiTj=TjDiD_iT_j=T_jD_iDi​Tj​=Tj​Di​ otherwise. The definition includes n=0n=0n=0, with empty tuples and empty products.

QAlgorithms.Papers.Independent.Intakethird100.P71.IsLocalDesign

For any natural numbers n,d,tn,d,tn,d,t and any two measures μ,H\mu,Hμ,H on tuples V=(Vi)i<nV=(V_i)_{i<n}V=(Vi​)i<n​ of d×dd\times dd×d unitary matrices, this predicate means that, for every complex matrix XXX indexed by ttt-tuples of configurations in C=({0,…,d−1}){0,…,n−1}\mathcal C=(\{0,\ldots,d-1\})^{\{0,\ldots,n-1\}}C=({0,…,d−1}){0,…,n−1},

∫Bt(V)†XBt(V) dμ(V)=∫Bt(V)†XBt(V) dH(V),Bt(V)xy=∏k<t∏i<n(Vi)xk(i),yk(i).\int B_t(V)^\dagger X B_t(V)\,d\mu(V) = \int B_t(V)^\dagger X B_t(V)\,dH(V), \qquad B_t(V)_{xy}=\prod_{k<t}\prod_{i<n}(V_i)_{x_k(i),y_k(i)}.∫Bt​(V)†XBt​(V)dμ(V)=∫Bt​(V)†XBt​(V)dH(V),Bt​(V)xy​=k<t∏​i<n∏​(Vi​)xk​(i),yk​(i)​.

Neither measure is assumed to be normalized or Haar, and integrability is not part of the predicate; each nonintegrable Bochner integral is zero. The case t=0t=0t=0, as well as n=0n=0n=0 or d=0d=0d=0, is included.

QAlgorithms.Papers.Independent.Intakethird100.P71.LocallyScrambled

For arbitrary natural numbers n,dn,dn,d and any measure ν\nuν on complex matrices indexed by C={0,…,d−1}{0,…,n−1}\mathcal C=\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}C={0,…,d−1}{0,…,n−1}, this property requires invariance under every family V=(Va)a=0n−1V=(V_a)_{a=0}^{n-1}V=(Va​)a=0n−1​ of unitary d×dd\times dd×d matrices. Explicitly, let

LV(x,y)=∏a=0n−1(Va)xaya.L_V(x,y)=\prod_{a=0}^{n-1}(V_a)_{x_a y_a}.LV​(x,y)=a=0∏n−1​(Va​)xa​ya​​.

Then the pushforward of ν\nuν under X↦LV†XLVX\mapsto L_V^\dagger X L_VX↦LV†​XLV​ must equal ν\nuν, for every such family VVV. No probability, positivity, normalization, or injectivity condition is included. The definition allows n=0n=0n=0, with the empty product equal to one, and d=0d=0d=0; in either case these conjugations are identity maps, so every measure satisfies the property.

QAlgorithms.Papers.Independent.Intakethird100.P71.Permutations

For any natural numbers n,tn,tn,t, this abbreviation denotes the set of assignments of a permutation of {0,…,t−1}\{0,\ldots,t-1\}{0,…,t−1} to each site in {0,…,n−1}\{0,\ldots,n-1\}{0,…,n−1}. Thus an element is a family (gi)i=0n−1(g_i)_{i=0}^{n-1}(gi​)i=0n−1​, with each gig_igi​ a bijection of the ttt copy indices. Both parameters may be zero: when n=0n=0n=0 there is one empty family, and when t=0t=0t=0 each site is assigned the unique permutation of the empty set.

QAlgorithms.Papers.Independent.Intakethird100.P71.ProjectiveEnsemble

For each pair of natural numbers n,dn,dn,d, a projective ensemble consists of a measure λ\lambdaλ on the type Unitary⁡(n,d)\operatorname{Unitary}(n,d)Unitary(n,d), together with a proof that λ\lambdaλ is a probability measure, meaning that its total mass is 111. There are no positivity restrictions on nnn or ddd. The definition of Unitary⁡(n,d)\operatorname{Unitary}(n,d)Unitary(n,d) is not included in the supplied excerpt.

QAlgorithms.Papers.Independent.Intakethird100.P71.SnapshotPolynomialIntegrable

For any natural numbers n,dn,dn,d, including zero, let C={0,…,d−1}{0,…,n−1}\mathcal C=\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}C={0,…,d−1}{0,…,n−1} and let ν\nuν be any measure on the complex matrices indexed by C\mathcal CC. This predicate requires all three of the following: for every natural number ttt, the matrix-valued function S↦S⊗tS\mapsto S^{\otimes t}S↦S⊗t is integrable with respect to ν\nuν, where its entry at configurations x,y:{0,…,t−1}→Cx,y:\{0,\ldots,t-1\}\to\mathcal Cx,y:{0,…,t−1}→C is ∏i=0t−1Sxi,yi\prod_{i=0}^{t-1}S_{x_i,y_i}∏i=0t−1​Sxi​,yi​​; for every complex matrix XXX indexed by C\mathcal CC, the matrix-valued function S↦tr⁡(SX)SS\mapsto\operatorname{tr}(SX)SS↦tr(SX)S is integrable; and for every pair of such matrices X,YX,YX,Y, the real-valued function S↦(Re⁡tr⁡(XS))2Re⁡tr⁡(SY)S\mapsto(\operatorname{Re}\operatorname{tr}(XS))^2\operatorname{Re}\operatorname{tr}(SY)S↦(Retr(XS))2Retr(SY) is integrable. The first requirement includes t=0t=0t=0, for which the empty product gives the constant one-dimensional matrix [1][1][1]. No positivity, trace normalization, or probability-measure assumption is imposed.

QAlgorithms.Papers.Independent.Intakethird100.P71.ToyFeature

For any natural number ddd, any measure ν\nuν on complex matrices indexed by pairs in {0,…,d−1}2\{0,\ldots,d-1\}^2{0,…,d−1}2, and any real number www, this predicate requires

∫Re⁡tr⁡ ⁣[(Tr⁡AcS)2] dν(S)={w,∣A∣=1,1,∣A∣=0 or 2\int \operatorname{Re}\operatorname{tr}\!\left[(\operatorname{Tr}_{A^c}S)^2\right]\,d\nu(S) = \begin{cases} w,&|A|=1,\\ 1,&|A|=0\text{ or }2 \end{cases}∫Retr[(TrAc​S)2]dν(S)={w,1,​∣A∣=1,∣A∣=0 or 2​

for every subset A⊆{0,1}A\subseteq\{0,1\}A⊆{0,1}. Here the matrix Tr⁡AcS\operatorname{Tr}_{A^c}STrAc​S, indexed by assignments x,y:A→{0,…,d−1}x,y:A\to\{0,\ldots,d-1\}x,y:A→{0,…,d−1}, has entry ∑zSx∪z,y∪z\sum_z S_{x\cup z,y\cup z}∑z​Sx∪z,y∪z​, summing over all assignments zzz on the complementary sites. The square is ordinary matrix multiplication. No probability, positivity, or integrability assumptions are imposed; a nonintegrable real integrand has integral zero. For d=0d=0d=0, all the integrands are zero, so the required value 111 for A=∅A=\varnothingA=∅ cannot hold.

QAlgorithms.Papers.Independent.Intakethird100.P71.averagedSecondMoment

For any natural numbers n,dn,dn,d, put C={0,…,d−1}{0,…,n−1}\mathcal C=\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}C={0,…,d−1}{0,…,n−1}. Let HHH be any measure on tuples V=(Vi)i=0n−1V=(V_i)_{i=0}^{n-1}V=(Vi​)i=0n−1​ of unitary d×dd\times dd×d matrices, let ν\nuν be any measure on complex matrices indexed by C\mathcal CC, and assume that the map

(LνX)ij=∑k,l∈C(∫dnTijTlk dν(T))Xkl(\mathcal L_\nu X)_{ij} =\sum_{k,l\in\mathcal C} \left(\int d^n T_{ij}T_{lk}\,d\nu(T)\right)X_{kl}(Lν​X)ij​=k,l∈C∑​(∫dnTij​Tlk​dν(T))Xkl​

is injective. For arbitrary matrices ρ,O\rho,Oρ,O, define UVU_VUV​ by (UV)xy=∏i(Vi)xi,yi(U_V)_{xy}=\prod_i(V_i)_{x_i,y_i}(UV​)xy​=∏i​(Vi​)xi​,yi​​ and set ρV=UV†ρUV\rho_V=U_V^\dagger\rho U_VρV​=UV†​ρUV​. Let νρV\nu_{\rho_V}νρV​​ be ν\nuν weighted by max⁡{dnRe⁡tr⁡(SρV),0}\max\{d^n\operatorname{Re}\operatorname{tr}(S\rho_V),0\}max{dnRetr(SρV​),0}. The averaged second moment is

∫[∫(Re⁡tr⁡(OLν−1(S)))2 dνρV(S)]dH(V).\int\left[ \int\bigl(\operatorname{Re}\operatorname{tr}(O\mathcal L_\nu^{-1}(S))\bigr)^2 \,d\nu_{\rho_V}(S)\right]dH(V).∫[∫(Retr(OLν−1​(S)))2dνρV​​(S)]dH(V).

No probability, positivity, normalization, or integrability conditions are imposed beyond injectivity; zero dimensions are included, and all integrals use the total integral convention.

QAlgorithms.Papers.Independent.Intakethird100.P71.channelCoefficient

For arbitrary natural numbers n,dn,dn,d, any measure ν\nuν on complex matrices indexed by configurations C={0,…,d−1}{0,…,n−1}\mathcal C=\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}C={0,…,d−1}{0,…,n−1}, and four configurations i,j,k,l∈Ci,j,k,l\in\mathcal Ci,j,k,l∈C, this defines the complex number

∫dnSijSlk dν(S).\int d^n S_{ij}S_{lk}\,d\nu(S).∫dnSij​Slk​dν(S).

The two matrix entries are multiplied without complex conjugation, and the second entry has indices l,kl,kl,k, in that order. No normalization, positivity, support, or integrability condition is required of ν\nuν; a nonintegrable integrand has integral zero. The parameters include n=0n=0n=0, when C\mathcal CC has one element and d0=1d^0=1d0=1, and d=0<nd=0<nd=0<n, when no configurations i,j,k,li,j,k,li,j,k,l exist.

QAlgorithms.Papers.Independent.Intakethird100.P71.copyPermutation

For any natural numbers n,d,tn,d,tn,d,t and any family (gi)i=0n−1(g_i)_{i=0}^{n-1}(gi​)i=0n−1​ of permutations of {0,…,t−1}\{0,\ldots,t-1\}{0,…,t−1}, this definition gives a complex matrix whose rows and columns are indexed by ttt-tuples of configurations in {0,…,d−1}{0,…,n−1}\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}{0,…,d−1}{0,…,n−1}. Its entry at row xxx and column yyy is

Px,y={1,xk(i)=ygi(k)(i) for every site i and copy k,0,otherwise.P_{x,y}= \begin{cases} 1,&x_k(i)=y_{g_i(k)}(i)\text{ for every site }i\text{ and copy }k,\\ 0,&\text{otherwise}. \end{cases}Px,y​={1,0,​xk​(i)=ygi​(k)​(i) for every site i and copy k,otherwise.​

All three parameters may be zero. For t=0t=0t=0 the index set is a singleton and the matrix is [1][1][1]; for n=0n=0n=0 it is also [1][1][1]. If d=0d=0d=0 while n,t>0n,t>0n,t>0, the matrix has an empty index set.

QAlgorithms.Papers.Independent.Intakethird100.P71.efReconstruct

For arbitrary natural numbers n,dn,dn,d, any real-valued function rrr on subsets of U={0,…,n−1}U=\{0,\ldots,n-1\}U={0,…,n−1}, and any complex matrix XXX indexed by C={0,…,d−1}U\mathcal C=\{0,\ldots,d-1\}^{U}C={0,…,d−1}U, this defines the matrix

Rr(X)=dn∑A⊆Ur(A) TA(X),TA(X)xy={∑z∈{0,…,d−1}AcX((x∣A)⊕Az,(y∣A)⊕Az)d n−∣A∣,x∣Ac=y∣Ac,0,otherwise.\mathcal R_r(X)=d^n\sum_{A\subseteq U}r(A)\,T_A(X), \qquad T_A(X)_{xy}= \begin{cases} \displaystyle \frac{\sum_{z\in\{0,\ldots,d-1\}^{A^c}} X((x|_A)\oplus_A z,(y|_A)\oplus_A z)} {d^{\,n-|A|}}, &x|_{A^c}=y|_{A^c},\\[6pt] 0,&\text{otherwise}. \end{cases}Rr​(X)=dnA⊆U∑​r(A)TA​(X),TA​(X)xy​=⎩⎨⎧​dn−∣A∣∑z∈{0,…,d−1}Ac​X((x∣A​)⊕A​z,(y∣A​)⊕A​z)​,0,​x∣Ac​=y∣Ac​,otherwise.​

Here ⊕A\oplus_A⊕A​ combines configurations on AAA and its complement, and real scalars are regarded as complex scalars. No equation or other condition on rrr, and no positivity or normalization condition on XXX, is required. All subsets, including the empty and full subsets, are used. Zero parameters are allowed, division by zero is zero, and zeroth powers are one; when n=0n=0n=0, the formula reduces to r(∅)Xr(\varnothing)Xr(∅)X.

QAlgorithms.Papers.Independent.Intakethird100.P71.feature

For arbitrary natural numbers n,dn,dn,d, any measure ν\nuν on the space of complex matrices indexed by C={0,…,d−1}{0,…,n−1}\mathcal C=\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}C={0,…,d−1}{0,…,n−1}, and any subset A⊆{0,…,n−1}A\subseteq\{0,\ldots,n-1\}A⊆{0,…,n−1}, this defines

∫Re⁡tr⁡(RA(S)2) dν(S),RA(S)(x,y)=∑z∈{0,…,d−1}AcS(x⊕Az,y⊕Az),\int \operatorname{Re}\operatorname{tr}(R_A(S)^2)\,d\nu(S), \qquad R_A(S)(x,y)= \sum_{z\in\{0,\ldots,d-1\}^{A^c}} S(x\oplus_A z,y\oplus_A z),∫Retr(RA​(S)2)dν(S),RA​(S)(x,y)=z∈{0,…,d−1}Ac∑​S(x⊕A​z,y⊕A​z),

where x,yx,yx,y are configurations on AAA, and x⊕Azx\oplus_A zx⊕A​z combines the indicated configurations on AAA and AcA^cAc. The measure need not be a probability measure or be supported on density matrices, and no integrability hypothesis is imposed; the integral is zero when its integrand is not integrable. Empty regions and zero values of nnn or ddd are allowed.

QAlgorithms.Papers.Independent.Intakethird100.P71.featureThree

For any natural numbers n,dn,dn,d, let C={0,…,d−1}{0,…,n−1}C=\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}C={0,…,d−1}{0,…,n−1}. Given any measure ν\nuν on the complex matrices indexed by CCC, and a family hih_ihi​ of permutations of {0,1,2}\{0,1,2\}{0,1,2}, this defines

∫tr⁡ ⁣(S⊗3Ph) dν(S)∈C,\int \operatorname{tr}\!\left(S^{\otimes3}P_h\right)\,d\nu(S)\in\mathbb C,∫tr(S⊗3Ph​)dν(S)∈C,

where both matrices are indexed by triples x=(x0,x1,x2)∈C3x=(x_0,x_1,x_2)\in C^3x=(x0​,x1​,x2​)∈C3, with entries

(S⊗3)x,y=∏k=02Sxk,yk,(Ph)x,y={1,∀i,k, xk(i)=yhi(k)(i),0,otherwise.(S^{\otimes3})_{x,y}=\prod_{k=0}^{2}S_{x_k,y_k}, \qquad (P_h)_{x,y}= \begin{cases} 1,&\forall i,k,\ x_k(i)=y_{h_i(k)}(i),\\ 0,&\text{otherwise}. \end{cases}(S⊗3)x,y​=k=0∏2​Sxk​,yk​​,(Ph​)x,y​={1,0,​∀i,k, xk​(i)=yhi​(k)​(i),otherwise.​

No probability, positivity, normalization, or integrability hypothesis is imposed on ν\nuν or its matrices; the complex integral is defined to be zero when its integrand is not integrable. If n=0n=0n=0, CCC is a singleton and the conditions defining PhP_hPh​ are vacuous; if d=0<nd=0<nd=0<n, the matrix index set is empty and the result is zero.

QAlgorithms.Papers.Independent.Intakethird100.P71.frameGap

For any natural numbers n,dn,dn,d, any measure HHH on tuples V=(Vi)i<nV=(V_i)_{i<n}V=(Vi​)i<n​ of d×dd\times dd×d unitary matrices, and any measure ν\nuν on complex operators indexed by C=({0,…,d−1}){0,…,n−1}\mathcal C=(\{0,\ldots,d-1\})^{\{0,\ldots,n-1\}}C=({0,…,d−1}){0,…,n−1}, let ν~\widetilde\nuν be the pushforward of H⊗νH\otimes\nuH⊗ν by (V,S)↦L(V)†SL(V)(V,S)\mapsto L(V)^\dagger S L(V)(V,S)↦L(V)†SL(V), with L(V)xy=∏i<n(Vi)xiyiL(V)_{xy}=\prod_{i<n}(V_i)_{x_i y_i}L(V)xy​=∏i<n​(Vi​)xi​yi​​. This defines

∫(Re⁡tr⁡(ST))2 d(ν⊗ν)(S,T)−∫(Re⁡tr⁡(ST))2 d(ν~⊗ν~)(S,T).\int\bigl(\operatorname{Re}\operatorname{tr}(ST)\bigr)^2\,d(\nu\otimes\nu)(S,T) - \int\bigl(\operatorname{Re}\operatorname{tr}(ST)\bigr)^2\,d(\widetilde\nu\otimes\widetilde\nu)(S,T).∫(Retr(ST))2d(ν⊗ν)(S,T)−∫(Retr(ST))2d(ν⊗ν)(S,T).

No normalization, integrability, or positivity hypotheses are imposed, and no sign for this difference is asserted. Each nonintegrable Bochner integral is assigned zero. The definition includes n=0n=0n=0 and d=0d=0d=0.

QAlgorithms.Papers.Independent.Intakethird100.P71.framePotential

For any natural numbers n,dn,dn,d and any measure ν\nuν on complex matrices indexed by C=({0,…,d−1}){0,…,n−1}\mathcal C=(\{0,\ldots,d-1\})^{\{0,\ldots,n-1\}}C=({0,…,d−1}){0,…,n−1}, this defines the real number

∫(Re⁡tr⁡(ST))2 d(ν⊗ν)(S,T).\int \bigl(\operatorname{Re}\operatorname{tr}(ST)\bigr)^2\,d(\nu\otimes\nu)(S,T).∫(Retr(ST))2d(ν⊗ν)(S,T).

There is no assumption that ν\nuν is normalized or that S,TS,TS,T are Hermitian, positive, or trace one; the real part is taken before squaring. This is the total real-valued Bochner integral, which is defined to be zero when its integrand is not integrable. Zero values of nnn or ddd are included.

QAlgorithms.Papers.Independent.Intakethird100.P71.fusion

For arbitrary natural numbers n,dn,dn,d and subsets A,B,C⊆{0,…,n−1}A,B,C\subseteq\{0,\ldots,n-1\}A,B,C⊆{0,…,n−1}, this defines

(d3d2−1)n∑D⊆{0,…,n−1}B=A∩D(d∣D∣)−1(−1d)∣C△D∣.\left(\frac{d^3}{d^2-1}\right)^n \sum_{\substack{D\subseteq\{0,\ldots,n-1\}\\B=A\cap D}} (d^{|D|})^{-1} \left(\frac{-1}{d}\right)^{|C\triangle D|}.(d2−1d3​)nD⊆{0,…,n−1}B=A∩D​∑​(d∣D∣)−1(d−1​)∣C△D∣.

The sum ranges over every subset DDD satisfying the displayed equality; if none exists, it is zero. No positive lower bound on ddd is assumed, so all zero denominators use the value zero, and zeroth powers have value one. For n=0n=0n=0, all three subsets are empty and the value is one for every ddd. For n>0n>0n>0 and d=0d=0d=0 or d=1d=1d=1, the value is zero.

QAlgorithms.Papers.Independent.Intakethird100.P71.fusionSite

For every natural number ddd and every three Boolean values a,b,ca,b,ca,b,c, this defines the following real number, with ddd interpreted as a real number in the formulas:

(a,b,c)value(true,true,true)d2/(d2−1)(true,true,false)−d/(d2−1)(true,false,true)−d2/(d2−1)(true,false,false)d3/(d2−1)(false,false,false)d(false,true,true)0(false,true,false)0(false,false,true)0\begin{array}{c|c} (a,b,c)&\text{value}\\ \hline (\mathrm{true},\mathrm{true},\mathrm{true})&d^2/(d^2-1)\\ (\mathrm{true},\mathrm{true},\mathrm{false})&-d/(d^2-1)\\ (\mathrm{true},\mathrm{false},\mathrm{true})&-d^2/(d^2-1)\\ (\mathrm{true},\mathrm{false},\mathrm{false})&d^3/(d^2-1)\\ (\mathrm{false},\mathrm{false},\mathrm{false})&d\\ (\mathrm{false},\mathrm{true},\mathrm{true})&0\\ (\mathrm{false},\mathrm{true},\mathrm{false})&0\\ (\mathrm{false},\mathrm{false},\mathrm{true})&0 \end{array}(a,b,c)(true,true,true)(true,true,false)(true,false,true)(true,false,false)(false,false,false)(false,true,true)(false,true,false)(false,false,true)​valued2/(d2−1)−d/(d2−1)−d2/(d2−1)d3/(d2−1)d000​​

There is no lower bound on ddd. Division by zero is defined to be zero, so at d=1d=1d=1 every branch with a=truea=\mathrm{true}a=true has value zero; at d=0d=0d=0, every branch has value zero.

QAlgorithms.Papers.Independent.Intakethird100.P71.gueCoordinates

For every natural number ddd, including zero, let C={0,…,d−1}2C=\{0,\ldots,d-1\}^2C={0,…,d−1}2. This defines the product measure on real arrays

z:C×C×{false,true}→Rz:C\times C\times\{\mathrm{false},\mathrm{true}\}\to\mathbb Rz:C×C×{false,true}→R

whose coordinate measures are all Gaussian with mean 000 and variance 111. Thus the 2d42d^42d4 coordinates are independent standard real Gaussian variables. When d=0d=0d=0, the coordinate set is empty and the measure assigns probability one to the unique empty array.

QAlgorithms.Papers.Independent.Intakethird100.P71.gueOperator

For any natural number ddd, let C={0,…,d−1}2C=\{0,\ldots,d-1\}^2C={0,…,d−1}2. Given any real array z:C×C×{false,true}→Rz:C\times C\times\{\mathrm{false},\mathrm{true}\}\to\mathbb Rz:C×C×{false,true}→R, form

Zij=z(i,j,false)+i z(i,j,true),G=Z+Z†2.Z_{ij}=z(i,j,\mathrm{false})+\mathrm i\,z(i,j,\mathrm{true}), \qquad G=\frac{Z+Z^\dagger}{2}.Zij​=z(i,j,false)+iz(i,j,true),G=2Z+Z†​.

This defines the complex C×CC\times CC×C matrix

G−tr⁡(G)d2IC,G-\frac{\operatorname{tr}(G)}{d^2}I_C,G−d2tr(G)​IC​,

where Z†Z^\daggerZ† is the conjugate transpose. Equivalently, its entries are

z(i,j,false)+z(j,i,false)2+i2(z(i,j,true)−z(j,i,true))−∑k∈Cz(k,k,false)d2δij.\frac{z(i,j,\mathrm{false})+z(j,i,\mathrm{false})}{2} +\frac{\mathrm i}{2}\bigl(z(i,j,\mathrm{true})-z(j,i,\mathrm{true})\bigr) -\frac{\sum_{k\in C}z(k,k,\mathrm{false})}{d^2}\delta_{ij}.2z(i,j,false)+z(j,i,false)​+2i​(z(i,j,true)−z(j,i,true))−d2∑k∈C​z(k,k,false)​δij​.

The input array is unrestricted. Division by zero is defined to be zero; for d=0d=0d=0, CCC is empty and the output is the unique empty matrix.

QAlgorithms.Papers.Independent.Intakethird100.P71.hsSquare

For arbitrary natural numbers n,dn,dn,d, including zero, and any complex matrix OOO indexed by C={0,…,d−1}{0,…,n−1}C=\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}C={0,…,d−1}{0,…,n−1}, this defines

Re⁡tr⁡(O2)=Re⁡∑x,y∈COx,yOy,x.\operatorname{Re}\operatorname{tr}(O^2) =\operatorname{Re}\sum_{x,y\in C}O_{x,y}O_{y,x}.Retr(O2)=Rex,y∈C∑​Ox,y​Oy,x​.

No Hermiticity or positivity hypothesis is required. If d=0<nd=0<nd=0<n, the value is zero; if n=0n=0n=0, CCC has one element and the value is the real part of the square of the sole matrix entry.

QAlgorithms.Papers.Independent.Intakethird100.P71.localConj

For all natural numbers n,dn,dn,d, every V∈Local⁡(n,d)V\in\operatorname{Local}(n,d)V∈Local(n,d), and every X∈Op⁡(n,d)X\in\operatorname{Op}(n,d)X∈Op(n,d), define

localConj⁡(V,X)=LV†XLV,(LV)x,y=∏i(Vi)xi,yi,\operatorname{localConj}(V,X)=L_V^\dagger X L_V, \qquad (L_V)_{x,y}=\prod_i(V_i)_{x_i,y_i},localConj(V,X)=LV†​XLV​,(LV​)x,y​=i∏​(Vi​)xi​,yi​​,

where †\dagger† denotes conjugate transpose and each ViV_iVi​ is viewed as a complex d×dd\times dd×d matrix. No positivity, trace, or normalization hypothesis is imposed on XXX. The types Local⁡(n,d)\operatorname{Local}(n,d)Local(n,d) and Op⁡(n,d)\operatorname{Op}(n,d)Op(n,d), and the product’s site index type, are not defined in the supplied excerpt; an empty product equals 111.

QAlgorithms.Papers.Independent.Intakethird100.P71.localMatrix

For all natural numbers n,dn,dn,d and every VVV of type Local⁡(n,d)\operatorname{Local}(n,d)Local(n,d), define an operator LV∈Op⁡(n,d)L_V\in\operatorname{Op}(n,d)LV​∈Op(n,d) by the entry formula

(LV)x,y=∏i(Vi)xi,yi,(L_V)_{x,y}=\prod_i (V_i)_{x_i,y_i},(LV​)x,y​=i∏​(Vi​)xi​,yi​​,

where each ViV_iVi​ is viewed as a complex matrix indexed by Fin⁡(d)×Fin⁡(d)\operatorname{Fin}(d)\times\operatorname{Fin}(d)Fin(d)×Fin(d). An empty product equals 111. The supplied excerpt does not define Local⁡(n,d)\operatorname{Local}(n,d)Local(n,d), Op⁡(n,d)\operatorname{Op}(n,d)Op(n,d), or their configuration and site index types.

QAlgorithms.Papers.Independent.Intakethird100.P71.localMomentAction

For any natural numbers n,d,tn,d,tn,d,t, any measure μ\muμ on tuples V=(Vi)i<nV=(V_i)_{i<n}V=(Vi​)i<n​ of d×dd\times dd×d unitary matrices, and any complex matrix XXX indexed by ttt-tuples of configurations from C=({0,…,d−1}){0,…,n−1}\mathcal C=(\{0,\ldots,d-1\})^{\{0,\ldots,n-1\}}C=({0,…,d−1}){0,…,n−1}, this defines the matrix-valued Bochner integral

∫Bt(V)†XBt(V) dμ(V),Bt(V)xy=∏k<t∏i<n(Vi)xk(i),yk(i).\int B_t(V)^\dagger X B_t(V)\,d\mu(V), \qquad B_t(V)_{xy}=\prod_{k<t}\prod_{i<n}(V_i)_{x_k(i),y_k(i)}.∫Bt​(V)†XBt​(V)dμ(V),Bt​(V)xy​=k<t∏​i<n∏​(Vi​)xk​(i),yk​(i)​.

No normalization of μ\muμ, integrability hypothesis, or restriction on XXX is required; the integral is zero if the matrix-valued integrand is not integrable. All three natural numbers may be zero. In particular, for t=0t=0t=0 the matrix Bt(V)B_t(V)Bt​(V) is the 1×11\times11×1 identity.

QAlgorithms.Papers.Independent.Intakethird100.P71.localObservable

For any natural number ddd, including zero, and any complex d×dd\times dd×d matrix AAA, this defines the matrix indexed by pairs from {0,…,d−1}2\{0,\ldots,d-1\}^2{0,…,d−1}2 with entries

O(a,b),(c,e)=Aa,cδb,e.O_{(a,b),(c,e)}=A_{a,c}\delta_{b,e}.O(a,b),(c,e)​=Aa,c​δb,e​.

Equivalently, it is A⊗IdA\otimes I_dA⊗Id​, with the first coordinate carrying AAA. No assumptions are imposed on AAA. For d=0d=0d=0, the matrix is empty.

QAlgorithms.Papers.Independent.Intakethird100.P71.localityNumerator

For any natural number ddd, including zero, and any complex matrix OOO indexed by pairs from {0,…,d−1}2\{0,\ldots,d-1\}^2{0,…,d−1}2, define d×dd\times dd×d matrices

(R0)a,b=∑cO(a,c),(b,c),(R1)a,b=∑cO(c,a),(c,b).(R_0)_{a,b}=\sum_c O_{(a,c),(b,c)}, \qquad (R_1)_{a,b}=\sum_c O_{(c,a),(c,b)}.(R0​)a,b​=c∑​O(a,c),(b,c)​,(R1​)a,b​=c∑​O(c,a),(c,b)​.

This defines the real number

Re⁡tr⁡(R02)+Re⁡tr⁡(R12).\operatorname{Re}\operatorname{tr}(R_0^2) +\operatorname{Re}\operatorname{tr}(R_1^2).Retr(R02​)+Retr(R12​).

The squares are ordinary matrix products, and no assumptions are imposed on OOO. For d=0d=0d=0, both traces are empty sums and the value is zero.

QAlgorithms.Papers.Independent.Intakethird100.P71.observableFeature

For any natural numbers n,dn,dn,d, let C={0,…,d−1}{0,…,n−1}\mathcal C=\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}C={0,…,d−1}{0,…,n−1}, let HHH be any measure on tuples V=(Vi)i=0n−1V=(V_i)_{i=0}^{n-1}V=(Vi​)i=0n−1​ of unitary d×dd\times dd×d matrices, let OOO be any complex matrix indexed by C\mathcal CC, and let A⊆{0,…,n−1}A\subseteq\{0,\ldots,n-1\}A⊆{0,…,n−1}. Define (UV)xy=∏i(Vi)xi,yi(U_V)_{xy}=\prod_i(V_i)_{x_i,y_i}(UV​)xy​=∏i​(Vi​)xi​,yi​​ and XV=UV†OUVX_V=U_V^\dagger O U_VXV​=UV†​OUV​. For assignments x,yx,yx,y on AAA, define the matrix RA(XV)R_A(X_V)RA​(XV​) by

RA(XV)xy=∑z:Ac→{0,…,d−1}(XV)x∪z, y∪z,R_A(X_V)_{xy}=\sum_{z:A^c\to\{0,\ldots,d-1\}}(X_V)_{x\cup z,\,y\cup z},RA​(XV​)xy​=z:Ac→{0,…,d−1}∑​(XV​)x∪z,y∪z​,

where x∪zx\cup zx∪z denotes the configuration taking its coordinates from xxx on AAA and from zzz elsewhere. The observable feature is defined as ∫Re⁡tr⁡(RA(XV)2) dH(V)\int\operatorname{Re}\operatorname{tr}(R_A(X_V)^2)\,dH(V)∫Retr(RA​(XV​)2)dH(V). The square is ordinary matrix multiplication. No Hermiticity, positivity, normalization, or integrability assumption is imposed; zero dimensions, empty AAA, and full AAA are included, and a nonintegrable integrand has integral zero.

QAlgorithms.Papers.Independent.Intakethird100.P71.observableThree

For any natural numbers n,dn,dn,d, put C={0,…,d−1}{0,…,n−1}C=\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}C={0,…,d−1}{0,…,n−1}. Let ν\nuν be any measure on complex C×CC\times CC×C matrices, subject to the hypothesis that the complex linear map

(MνX)ij=∑k,l∈C(∫dnSijSlk dν(S))Xkl(\mathcal M_\nu X)_{ij} =\sum_{k,l\in C} \left(\int d^n S_{ij}S_{lk}\,d\nu(S)\right)X_{kl}(Mν​X)ij​=k,l∈C∑​(∫dnSij​Slk​dν(S))Xkl​

is injective. For arbitrary complex C×CC\times CC×C matrices ρ,O\rho,Oρ,O, and a family gig_igi​ of permutations of {0,1,2}\{0,1,2\}{0,1,2}, this defines

dntr⁡(TPg)∈C,Tx,y=Rx0,y0Rx1,y1ρx2,y2,d^n\operatorname{tr}(TP_g)\in\mathbb C, \qquad T_{x,y}=R_{x_0,y_0}R_{x_1,y_1}\rho_{x_2,y_2},dntr(TPg​)∈C,Tx,y​=Rx0​,y0​​Rx1​,y1​​ρx2​,y2​​,

where RRR is the unique matrix satisfying MνR=O\mathcal M_\nu R=OMν​R=O, and

(Pg)x,y={1,∀i,k, xk(i)=ygi(k)(i),0,otherwise(x,y∈C3).(P_g)_{x,y}= \begin{cases} 1,&\forall i,k,\ x_k(i)=y_{g_i(k)}(i),\\ 0,&\text{otherwise} \end{cases} \quad(x,y\in C^3).(Pg​)x,y​={1,0,​∀i,k, xk​(i)=ygi​(k)​(i),otherwise​(x,y∈C3).

The inverse exists because the injective linear map acts on a finite dimensional space of equal input and output dimension. There are no density matrix or Hermiticity assumptions on ρ,O\rho,Oρ,O, and nonintegrable coefficient integrands have integral zero. Zero values of n,dn,dn,d are included, with d0=1d^0=1d0=1; when d=0<nd=0<nd=0<n, all these matrices are empty and the result is zero.

QAlgorithms.Papers.Independent.Intakethird100.P71.oneSiteInverse

For every natural number ddd, including zero, and every complex d×dd\times dd×d matrix XXX, this defines the matrix

(d+1)X−tr⁡(X)Id.(d+1)X-\operatorname{tr}(X)I_d.(d+1)X−tr(X)Id​.

Equivalently, its (i,j)(i,j)(i,j) entry is (d+1)Xij−tr⁡(X)δij(d+1)X_{ij}-\operatorname{tr}(X)\delta_{ij}(d+1)Xij​−tr(X)δij​. No positivity, Hermiticity, trace, or invertibility hypothesis is required. For d=0d=0d=0, it is the unique empty matrix.

QAlgorithms.Papers.Independent.Intakethird100.P71.operatorBorel

For every pair of natural numbers n,dn,dn,d, including zero, the measurable structure on Op⁡(n,d)\operatorname{Op}(n,d)Op(n,d) coincides with the Borel measurable structure generated by its topology. The definition of Op⁡(n,d)\operatorname{Op}(n,d)Op(n,d) is not included in the supplied excerpt.

QAlgorithms.Papers.Independent.Intakethird100.P71.operatorMeasurable

For every pair of natural numbers n,dn,dn,d, including zero, the type Op⁡(n,d)\operatorname{Op}(n,d)Op(n,d) is equipped with the Borel measurable structure generated by its topology. The definition of the operator type Op⁡(n,d)\operatorname{Op}(n,d)Op(n,d) is not included in the supplied excerpt.

QAlgorithms.Papers.Independent.Intakethird100.P71.partialPurity

For arbitrary natural numbers n,dn,dn,d, a subset A⊆{0,…,n−1}A\subseteq\{0,\ldots,n-1\}A⊆{0,…,n−1}, and any complex matrix XXX indexed by configurations C={0,…,d−1}{0,…,n−1}\mathcal C=\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}C={0,…,d−1}{0,…,n−1}, define a matrix RAR_ARA​ indexed by configurations on AAA by

RA(x,y)=∑z∈{0,…,d−1}AcX(x⊕Az,y⊕Az),R_A(x,y)=\sum_{z\in\{0,\ldots,d-1\}^{A^c}}X(x\oplus_A z,y\oplus_A z),RA​(x,y)=z∈{0,…,d−1}Ac∑​X(x⊕A​z,y⊕A​z),

where x⊕Azx\oplus_A zx⊕A​z agrees with xxx on AAA and with zzz on its complement. The defined quantity is

Re⁡tr⁡(RA2)=Re⁡∑x,yRA(x,y)RA(y,x).\operatorname{Re}\operatorname{tr}(R_A^2) =\operatorname{Re}\sum_{x,y}R_A(x,y)R_A(y,x).Retr(RA2​)=Rex,y∑​RA​(x,y)RA​(y,x).

There is no assumption that XXX is Hermitian, positive, or normalized; the square is matrix multiplication, with no conjugate transpose. Empty AAA, n=0n=0n=0, and d=0d=0d=0 are included, with empty sums equal to zero.

QAlgorithms.Papers.Independent.Intakethird100.P71.partialTrace

For every natural number nnn, every finite type α\alphaα equipped with decidable equality, every subset A⊆{0,…,n−1}A\subseteq\{0,\ldots,n-1\}A⊆{0,…,n−1}, and every complex matrix XXX indexed by functions {0,…,n−1}→α\{0,\ldots,n-1\}\to\alpha{0,…,n−1}→α, define a matrix indexed by functions A→αA\to\alphaA→α through

(partialTrace⁡AX)x,y=∑z:A∁→αXx∪z,  y∪z,(\operatorname{partialTrace}_A X)_{x,y} =\sum_{z:A^{\complement}\to\alpha} X_{x\cup z,\;y\cup z},(partialTraceA​X)x,y​=z:A∁→α∑​Xx∪z,y∪z​,

where x∪zx\cup zx∪z is the function equal to xxx on AAA and to zzz on its complement. No condition is imposed on XXX. Empty index sets and an empty α\alphaα are allowed: an empty sum is zero, and there is exactly one function from an empty domain to α\alphaα; in particular, A=∅A=\varnothingA=∅ gives the trace as the sole matrix entry, while A={0,…,n−1}A=\{0,\ldots,n-1\}A={0,…,n−1} gives XXX under restriction of indices.

QAlgorithms.Papers.Independent.Intakethird100.P71.pauliFactor

For any natural number nnn, any Pauli string OOO consisting of a phase in Z/4Z\mathbb Z/4\mathbb ZZ/4Z and one factor from {I,X,Y,Z}\{I,X,Y,Z\}{I,X,Y,Z} at each of the nnn qubits, any index i<ni<ni<n, and any Boolean aaa, this defines the complex number 111 if the factor of OOO at iii is III or aaa is true, and 000 otherwise. The phase of OOO does not affect the value. When n=0n=0n=0, no index iii exists.

QAlgorithms.Papers.Independent.Intakethird100.P71.posteriorOf

For all natural numbers n,dn,dn,d, every measure ν\nuν on Op⁡(n,d)\operatorname{Op}(n,d)Op(n,d), and every operator ρ∈Op⁡(n,d)\rho\in\operatorname{Op}(n,d)ρ∈Op(n,d), define a measure by weighting ν\nuν with the nonnegative extended-real density

S⟼ofReal⁡ ⁣(dnRe⁡tr⁡(Sρ)).S\longmapsto \operatorname{ofReal}\!\left(d^n\operatorname{Re}\operatorname{tr}(S\rho)\right).S⟼ofReal(dnRetr(Sρ)).

Here ofReal⁡\operatorname{ofReal}ofReal replaces negative real values by zero. Neither ν\nuν nor ρ\rhoρ is required to be normalized, and ρ\rhoρ is not required to be positive or Hermitian. Both nnn and ddd may be zero; when d=0<nd=0<nd=0<n, the density is identically zero. The operator type Op⁡(n,d)\operatorname{Op}(n,d)Op(n,d) is not defined in the supplied excerpt.

QAlgorithms.Papers.Independent.Intakethird100.P71.prior

For all natural numbers n,dn,dn,d and every projective ensemble EEE, whose law λ\lambdaλ is a probability measure on Unitary⁡(n,d)\operatorname{Unitary}(n,d)Unitary(n,d), define a measure on Op⁡(n,d)\operatorname{Op}(n,d)Op(n,d) by

νE=ofReal⁡((dn)−1)∑b∈Config⁡(n,d)(U↦U†Eb,bU)∗λ,\nu_E=\operatorname{ofReal}\bigl((d^n)^{-1}\bigr) \sum_{b\in\operatorname{Config}(n,d)} \bigl(U\mapsto U^\dagger E_{b,b}U\bigr)_*\lambda,νE​=ofReal((dn)−1)b∈Config(n,d)∑​(U↦U†Eb,b​U)∗​λ,

where Eb,bE_{b,b}Eb,b​ has its sole nonzero entry 111 at (b,b)(b,b)(b,b), the subscript ∗*∗ denotes pushforward of a measure, and ofReal⁡(r)=max⁡(r,0)\operatorname{ofReal}(r)=\max(r,0)ofReal(r)=max(r,0) viewed as a nonnegative extended real. The inverse is taken in R\mathbb RR, where 0−1=00^{-1}=00−1=0; consequently the scaling factor is zero when d=0<nd=0<nd=0<n, whereas d0=1d^0=1d0=1, including when d=0d=0d=0. The types Config⁡\operatorname{Config}Config, Unitary⁡\operatorname{Unitary}Unitary, and Op⁡\operatorname{Op}Op are not defined in the supplied excerpt.

QAlgorithms.Papers.Independent.Intakethird100.P71.productWgThree

For any natural numbers n,dn,dn,d, including zero, and families g=(gi)i=0n−1g=(g_i)_{i=0}^{n-1}g=(gi​)i=0n−1​ and h=(hi)i=0n−1h=(h_i)_{i=0}^{n-1}h=(hi​)i=0n−1​ of permutations of {0,1,2}\{0,1,2\}{0,1,2}, this defines the real number

∏i=0n−1Wd(gihi−1),\prod_{i=0}^{n-1} W_d(g_i h_i^{-1}),i=0∏n−1​Wd​(gi​hi−1​),

where permutation multiplication is composition and, writing a=da=da=d as a real number and χ(π)=∣{j∈{0,1,2}:π(j)=j}∣−1\chi(\pi)=|\{j\in\{0,1,2\}:\pi(j)=j\}|-1χ(π)=∣{j∈{0,1,2}:π(j)=j}∣−1,

Wd(π)=16(1a(a+1)(a+2)+2χ(π)a(a+1)(a−1)+{sgn⁡(π)a(a−1)(a−2),d≥3,0,d<3.).W_d(\pi)=\frac16\left( \frac1{a(a+1)(a+2)} +\frac{2\chi(\pi)}{a(a+1)(a-1)} +\begin{cases} \dfrac{\operatorname{sgn}(\pi)}{a(a-1)(a-2)},&d\ge3,\\ 0,&d<3. \end{cases} \right).Wd​(π)=61​​a(a+1)(a+2)1​+a(a+1)(a−1)2χ(π)​+⎩⎨⎧​a(a−1)(a−2)sgn(π)​,0,​d≥3,d<3.​​.

Every division is total, with division by zero equal to zero. For n=0n=0n=0, the product is 111.

QAlgorithms.Papers.Independent.Intakethird100.P71.raw

For all natural numbers n,dn,dn,d, every U∈Unitary⁡(n,d)U\in\operatorname{Unitary}(n,d)U∈Unitary(n,d), and every b∈Config⁡(n,d)b\in\operatorname{Config}(n,d)b∈Config(n,d), define

raw⁡(U,b)=U†Eb,bU,\operatorname{raw}(U,b)=U^\dagger E_{b,b}U,raw(U,b)=U†Eb,b​U,

where UUU is viewed as an operator in Op⁡(n,d)\operatorname{Op}(n,d)Op(n,d), and Eb,bE_{b,b}Eb,b​ has entry 111 at (b,b)(b,b)(b,b) and entry 000 everywhere else. Equivalently, its (x,y)(x,y)(x,y)-entry is Ub,x‾Ub,y\overline{U_{b,x}}U_{b,y}Ub,x​​Ub,y​. The definitions of the three named types are not supplied, and no positive lower bound on nnn or ddd is assumed.

QAlgorithms.Papers.Independent.Intakethird100.P71.reducedSnapshot

For every natural number nnn, every finite type α\alphaα equipped with decidable equality, every subset A⊆{0,…,n−1}A\subseteq\{0,\ldots,n-1\}A⊆{0,…,n−1}, and every complex matrix XXX indexed by functions {0,…,n−1}→α\{0,\ldots,n-1\}\to\alpha{0,…,n−1}→α, define a matrix on the same index set by

(reducedSnapshot⁡AX)x,y={∑z:A∁→αX(x∣A)∪z,  (y∣A)∪z∣α∣ n−∣A∣,xi=yi for every i∉A,0,otherwise.(\operatorname{reducedSnapshot}_A X)_{x,y} = \begin{cases} \displaystyle \frac{\sum_{z:A^\complement\to\alpha} X_{(x|_A)\cup z,\;(y|_A)\cup z}} {|\alpha|^{\,n-|A|}}, & x_i=y_i\text{ for every }i\notin A,\\[6pt] 0,&\text{otherwise}. \end{cases}(reducedSnapshotA​X)x,y​=⎩⎨⎧​∣α∣n−∣A∣∑z:A∁→α​X(x∣A​)∪z,(y∣A​)∪z​​,0,​xi​=yi​ for every i∈/A,otherwise.​

The unions here combine functions on complementary domains. No positivity, Hermiticity, or normalization is assumed for XXX. The exponent uses natural-number subtraction, and ∣A∣≤n|A|\le n∣A∣≤n; empty sums equal zero, 00=10^0=100=1, and complex division by zero is defined to be zero. The definition includes n=0n=0n=0, empty AAA, and empty α\alphaα.

QAlgorithms.Papers.Independent.Intakethird100.P71.regionalWg

For arbitrary natural numbers n,dn,dn,d and subsets A,B⊆{0,…,n−1}A,B\subseteq\{0,\ldots,n-1\}A,B⊆{0,…,n−1}, this defines the real number

(d2−1)−n(−1d)∣A△B∣,(d^2-1)^{-n}\left(\frac{-1}{d}\right)^{|A\triangle B|},(d2−1)−n(d−1​)∣A△B∣,

where A△BA\triangle BA△B is their symmetric difference and the first factor means ((d2−1)−1)n\bigl((d^2-1)^{-1}\bigr)^n((d2−1)−1)n. There is no restriction d>1d>1d>1: reciprocals of zero and division by zero have value zero, and a zeroth power, including 000^000, has value one. Consequently the value is one when n=0n=0n=0, and it is zero when d=1d=1d=1 and n>0n>0n>0.

QAlgorithms.Papers.Independent.Intakethird100.P71.sandwichPrior

For any natural numbers n,dn,dn,d, any unitary U0U_0U0​ on configurations C=({0,…,d−1}){0,…,n−1}\mathcal C=(\{0,\ldots,d-1\})^{\{0,\ldots,n-1\}}C=({0,…,d−1}){0,…,n−1}, and any measures μL,μR\mu_L,\mu_RμL​,μR​ on tuples of d×dd\times dd×d unitary matrices, this defines the measure

ofReal⁡ ⁣((dn)−1)∑b∈C(Fb)∗(μL⊗μR),Fb(L,R)=U†∣b⟩⟨b∣U,U=LallU0Rall,\operatorname{ofReal}\!\bigl((d^n)^{-1}\bigr) \sum_{b\in\mathcal C}(F_b)_*(\mu_L\otimes\mu_R), \qquad F_b(L,R)=U^\dagger|b\rangle\langle b|U, \quad U=L_{\mathrm{all}}U_0R_{\mathrm{all}},ofReal((dn)−1)b∈C∑​(Fb​)∗​(μL​⊗μR​),Fb​(L,R)=U†∣b⟩⟨b∣U,U=Lall​U0​Rall​,

where (Lall)xy=∏i<n(Li)xiyi(L_{\mathrm{all}})_{xy}=\prod_{i<n}(L_i)_{x_i y_i}(Lall​)xy​=∏i<n​(Li​)xi​yi​​, similarly for RallR_{\mathrm{all}}Rall​, and ofReal⁡\operatorname{ofReal}ofReal converts a nonnegative real scalar to an extended nonnegative real scalar. Neither input measure is required to be a probability measure. If d=0<nd=0<nd=0<n, the configuration set is empty and the resulting measure is zero; if n=0n=0n=0, there is one configuration and the scalar is 111, including when d=0d=0d=0.

QAlgorithms.Papers.Independent.Intakethird100.P71.sandwichRaw

For any natural numbers n,dn,dn,d, any unitary matrix U0U_0U0​ indexed by C=({0,…,d−1}){0,…,n−1}\mathcal C=(\{0,\ldots,d-1\})^{\{0,\ldots,n-1\}}C=({0,…,d−1}){0,…,n−1}, any two tuples L=(Li)i<nL=(L_i)_{i<n}L=(Li​)i<n​ and R=(Ri)i<nR=(R_i)_{i<n}R=(Ri​)i<n​ of d×dd\times dd×d unitary matrices, and any configuration b∈Cb\in\mathcal Cb∈C, this defines

U†∣b⟩⟨b∣U,U=LallU0Rall,(Lall)xy=∏i<n(Li)xiyi,(Rall)xy=∏i<n(Ri)xiyi.U^\dagger |b\rangle\langle b|U, \qquad U=L_{\mathrm{all}}U_0R_{\mathrm{all}}, \quad (L_{\mathrm{all}})_{xy}=\prod_{i<n}(L_i)_{x_i y_i}, \quad (R_{\mathrm{all}})_{xy}=\prod_{i<n}(R_i)_{x_i y_i}.U†∣b⟩⟨b∣U,U=Lall​U0​Rall​,(Lall​)xy​=i<n∏​(Li​)xi​yi​​,(Rall​)xy​=i<n∏​(Ri​)xi​yi​​.

Here ∣b⟩⟨b∣|b\rangle\langle b|∣b⟩⟨b∣ has its only nonzero entry, equal to 111, at (b,b)(b,b)(b,b). For n=0n=0n=0, configurations form a singleton and both local products are 111; for d=0<nd=0<nd=0<n, there is no configuration bbb to supply.

QAlgorithms.Papers.Independent.Intakethird100.P71.scalarCode

For every complex number zzz, this defines a natural number equal to 111 when z=1z=1z=1, equal to 222 when z=−1z=-1z=−1, and equal to 000 for every other complex number.

QAlgorithms.Papers.Independent.Intakethird100.P71.secondMoment

For any natural numbers n,dn,dn,d, let C={0,…,d−1}{0,…,n−1}\mathcal C=\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}C={0,…,d−1}{0,…,n−1}, let ν\nuν be any measure on complex matrices indexed by C\mathcal CC, and assume that the map

(LνX)ij=∑k,l∈C(∫dnTijTlk dν(T))Xkl(\mathcal L_\nu X)_{ij} =\sum_{k,l\in\mathcal C} \left(\int d^n T_{ij}T_{lk}\,d\nu(T)\right)X_{kl}(Lν​X)ij​=k,l∈C∑​(∫dnTij​Tlk​dν(T))Xkl​

is injective, so that its inverse exists. For arbitrary matrices ρ,O\rho,Oρ,O, define the measure νρ\nu_\rhoνρ​ by weighting ν\nuν with the nonnegative extended-real density max⁡{dnRe⁡tr⁡(Sρ),0}\max\{d^n\operatorname{Re}\operatorname{tr}(S\rho),0\}max{dnRetr(Sρ),0}. The second moment is defined by

∫(Re⁡tr⁡(OLν−1(S)))2 dνρ(S).\int \bigl(\operatorname{Re}\operatorname{tr}(O\mathcal L_\nu^{-1}(S))\bigr)^2\,d\nu_\rho(S).∫(Retr(OLν−1​(S)))2dνρ​(S).

Neither ρ\rhoρ nor OOO is required to be a density matrix or Hermitian, νρ\nu_\rhoνρ​ need not be a probability measure, and no integrability assumption is imposed. All integrals are total integrals, returning zero for nonintegrable integrands; zero dimensions are included.

QAlgorithms.Papers.Independent.Intakethird100.P71.shadowEstimate

For any natural numbers n,dn,dn,d, let C={0,…,d−1}{0,…,n−1}\mathcal C=\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}C={0,…,d−1}{0,…,n−1}, let ν\nuν be any measure on complex matrices indexed by C\mathcal CC, and suppose the complex-linear map Lν\mathcal L_\nuLν​ defined by

(LνX)ij=∑k,l∈C(∫dnTijTlk dν(T))Xkl(\mathcal L_\nu X)_{ij} =\sum_{k,l\in\mathcal C} \left(\int d^n T_{ij}T_{lk}\,d\nu(T)\right)X_{kl}(Lν​X)ij​=k,l∈C∑​(∫dnTij​Tlk​dν(T))Xkl​

is injective. Since its domain and codomain are the same finite-dimensional space, it has an inverse. For arbitrary matrices O,SO,SO,S indexed by C\mathcal CC, the shadow estimate is defined as Re⁡tr⁡(OLν−1(S))\operatorname{Re}\operatorname{tr}(O\mathcal L_\nu^{-1}(S))Retr(OLν−1​(S)). The dimensions may be zero, and no Hermiticity, positivity, normalization, or integrability hypotheses are added; the coefficient integrals use the total integral, which is zero for a nonintegrable integrand.

QAlgorithms.Papers.Independent.Intakethird100.P71.shadowSampleMean

For any natural numbers n,d,mn,d,mn,d,m, let C={0,…,d−1}{0,…,n−1}\mathcal C=\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}C={0,…,d−1}{0,…,n−1}, let ν\nuν be any measure on complex matrices indexed by C\mathcal CC, and assume the complex-linear map

(LνX)ij=∑k,l∈C(∫dnTijTlk dν(T))Xkl(\mathcal L_\nu X)_{ij} =\sum_{k,l\in\mathcal C} \left(\int d^n T_{ij}T_{lk}\,d\nu(T)\right)X_{kl}(Lν​X)ij​=k,l∈C∑​(∫dnTij​Tlk​dν(T))Xkl​

is injective. For any matrix OOO and any prescribed tuple of matrices (S0,…,Sm−1)(S_0,\ldots,S_{m-1})(S0​,…,Sm−1​), the shadow sample mean is defined as

m−1∑k=0m−1Re⁡tr⁡(OLν−1(Sk)).m^{-1}\sum_{k=0}^{m-1} \operatorname{Re}\operatorname{tr}(O\mathcal L_\nu^{-1}(S_k)).m−1k=0∑m−1​Retr(OLν−1​(Sk​)).

The tuple is arbitrary and is not assumed to have been sampled from a measure. When m=0m=0m=0, the empty sum and the convention 0−1=00^{-1}=00−1=0 give value zero. Zero dimensions are allowed, and the coefficient integrals use the total integral convention.

QAlgorithms.Papers.Independent.Intakethird100.P71.shotVariance

For any natural numbers n,dn,dn,d, put C={0,…,d−1}{0,…,n−1}\mathcal C=\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}C={0,…,d−1}{0,…,n−1}. Let ν\nuν be any measure on complex matrices indexed by C\mathcal CC, and suppose the map

(LνX)ij=∑k,l∈C(∫dnTijTlk dν(T))Xkl(\mathcal L_\nu X)_{ij} =\sum_{k,l\in\mathcal C} \left(\int d^n T_{ij}T_{lk}\,d\nu(T)\right)X_{kl}(Lν​X)ij​=k,l∈C∑​(∫dnTij​Tlk​dν(T))Xkl​

is injective. For arbitrary matrices ρ,O\rho,Oρ,O, let νρ\nu_\rhoνρ​ be ν\nuν weighted by max⁡{dnRe⁡tr⁡(Sρ),0}\max\{d^n\operatorname{Re}\operatorname{tr}(S\rho),0\}max{dnRetr(Sρ),0} and write a(S)=Re⁡tr⁡(OLν−1(S))a(S)=\operatorname{Re}\operatorname{tr}(O\mathcal L_\nu^{-1}(S))a(S)=Retr(OLν−1​(S)). The shot variance is defined as

∫a(S)2 dνρ(S)−(∫a(S) dνρ(S))2.\int a(S)^2\,d\nu_\rho(S) -\left(\int a(S)\,d\nu_\rho(S)\right)^2.∫a(S)2dνρ​(S)−(∫a(S)dνρ​(S))2.

There are no positivity, normalization, or integrability hypotheses beyond the stated injectivity condition, and this definition does not assert nonnegativity. Zero dimensions are allowed, and each integral uses the total convention that assigns zero to a nonintegrable integrand.

QAlgorithms.Papers.Independent.Intakethird100.P71.snapshotInverse

For arbitrary natural numbers n,dn,dn,d, any measure ν\nuν on complex matrices indexed by C={0,…,d−1}{0,…,n−1}\mathcal C=\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}C={0,…,d−1}{0,…,n−1}, and the hypothesis that

(Mν(X))ij=∑k,l∈C(∫dnSijSlk dν(S))Xkl(\mathcal M_\nu(X))_{ij} = \sum_{k,l\in\mathcal C} \left(\int d^n S_{ij}S_{lk}\,d\nu(S)\right)X_{kl}(Mν​(X))ij​=k,l∈C∑​(∫dnSij​Slk​dν(S))Xkl​

is injective on all complex matrices, this defines the inverse complex-linear equivalence Mν−1\mathcal M_\nu^{-1}Mν−1​. Surjectivity is obtained from injectivity because the domain and codomain are the same finite-dimensional space, so the defined inverse satisfies both Mν−1(Mν(X))=X\mathcal M_\nu^{-1}(\mathcal M_\nu(X))=XMν−1​(Mν​(X))=X and Mν(Mν−1(X))=X\mathcal M_\nu(\mathcal M_\nu^{-1}(X))=XMν​(Mν−1​(X))=X for every matrix XXX. No additional probability or integrability hypothesis is required; nonintegrable coefficient integrals are zero. The construction includes the zero-dimensional matrix space arising when d=0<nd=0<nd=0<n, as well as the one-dimensional matrix space arising when n=0n=0n=0.

QAlgorithms.Papers.Independent.Intakethird100.P71.snapshotMeasurementMap

For arbitrary natural numbers n,dn,dn,d and any measure ν\nuν on complex matrices indexed by C={0,…,d−1}{0,…,n−1}\mathcal C=\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}C={0,…,d−1}{0,…,n−1}, this defines a complex-linear map Mν\mathcal M_\nuMν​ on that entire matrix space by

(Mν(X))ij=∑k,l∈C(∫dnSijSlk dν(S))Xkl.(\mathcal M_\nu(X))_{ij} = \sum_{k,l\in\mathcal C} \left(\int d^n S_{ij}S_{lk}\,d\nu(S)\right)X_{kl}.(Mν​(X))ij​=k,l∈C∑​(∫dnSij​Slk​dν(S))Xkl​.

Thus its coefficients are separately defined integrals, with no conjugation of the entries of SSS. No assumption says that ν\nuν is a probability measure or supported on positive or normalized matrices, or that these integrands are integrable; each nonintegrable coefficient integral is zero. The map acts on arbitrary complex matrices. Zero parameters are included: n=0n=0n=0 gives a one-dimensional matrix space, while d=0<nd=0<nd=0<n gives the zero-dimensional matrix space.

QAlgorithms.Papers.Independent.Intakethird100.P71.snapshotMoment

For arbitrary natural numbers n,dn,dn,d, any measure ν\nuν on complex matrices indexed by C={0,…,d−1}{0,…,n−1}\mathcal C=\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}C={0,…,d−1}{0,…,n−1}, and any natural number ttt, this defines the matrix-valued integral

∫S⊗t dν(S),(S⊗t)ab=∏q=0t−1Sa(q),b(q),\int S^{\otimes t}\,d\nu(S), \qquad (S^{\otimes t})_{ab} = \prod_{q=0}^{t-1}S_{a(q),b(q)},∫S⊗tdν(S),(S⊗t)ab​=q=0∏t−1​Sa(q),b(q)​,

whose row and column indices a,ba,ba,b are functions {0,…,t−1}→C\{0,\ldots,t-1\}\to\mathcal C{0,…,t−1}→C. Thus coordinates are grouped by copy, with one full configuration per copy. No probability, positivity, normalization, or integrability hypothesis is imposed; if the matrix-valued integrand is not integrable, its integral is the zero matrix. The case t=0t=0t=0 is included: its index set has one element and its integrand is the 1×11\times11×1 matrix with entry one, so its integral is not stipulated to equal one for an arbitrary measure.

QAlgorithms.Papers.Independent.Intakethird100.P71.snapshotSampleLaw

For any natural numbers n,d,mn,d,mn,d,m, let C={0,…,d−1}{0,…,n−1}\mathcal C=\{0,\ldots,d-1\}^{\{0,\ldots,n-1\}}C={0,…,d−1}{0,…,n−1}, let ν\nuν be any measure on complex matrices indexed by C\mathcal CC, and let ρ\rhoρ be any such matrix. Weight ν\nuν by the nonnegative extended-real density max⁡{dnRe⁡tr⁡(Sρ),0}\max\{d^n\operatorname{Re}\operatorname{tr}(S\rho),0\}max{dnRetr(Sρ),0} to obtain a measure νρ\nu_\rhoνρ​. The snapshot sample law is defined as the finite product measure ⨂k=0m−1νρ\bigotimes_{k=0}^{m-1}\nu_\rho⨂k=0m−1​νρ​ on mmm-tuples of matrices. No density-matrix or probability-measure assumption is imposed. In particular, m=0m=0m=0 is included and gives the empty product measure on the singleton set of empty tuples; nnn and ddd may also be zero.

QAlgorithms.Papers.Independent.Intakethird100.P71.tableauInput

For any natural number nnn, any two nnn-tuples T,DT,DT,D of Pauli strings on nnn qubits, and any Pauli string OOO on nnn qubits, this defines a list of natural numbers beginning with the single entry nnn, followed by the encodings of TTT, then DDD, then OOO, with every Boolean encoding bit converted to 000 for false or 111 for true. A string of phase c∈Z/4Zc\in\mathbb Z/4\mathbb Zc∈Z/4Z, represented by cˉ∈{0,1,2,3}\bar c\in\{0,1,2,3\}cˉ∈{0,1,2,3}, is encoded by the two bits [cˉ≥2, cˉ mod 2=1][\bar c\ge2,\ \bar c\bmod2=1][cˉ≥2, cˉmod2=1], followed by its Pauli factors in increasing qubit order, using I↦[0,0]I\mapsto[0,0]I↦[0,0], X↦[1,0]X\mapsto[1,0]X↦[1,0], Y↦[1,1]Y\mapsto[1,1]Y↦[1,1], and Z↦[0,1]Z\mapsto[0,1]Z↦[0,1]. A tableau encoding concatenates its string encodings in increasing row order. No validity or commutation conditions are required. For n=0n=0n=0, both tableau encodings are empty, so the output is 000 followed by the two phase bits of OOO.

QAlgorithms.Papers.Independent.Intakethird100.P71.tableauRecord

For every natural number nnn, every list T0,…,Tn−1T_0,\ldots,T_{n-1}T0​,…,Tn−1​ of nnn-qubit Pauli strings, and every nnn-qubit Pauli string OOO, this defines a list of 2n+12n+12n+1 natural numbers. A Pauli string PPP consists of a phase cP∈Z/4Zc_P\in\mathbb Z/4\mathbb ZcP​∈Z/4Z and factors Pi∈{I,X,Y,Z}P_i\in\{I,X,Y,Z\}Pi​∈{I,X,Y,Z}, and represents the matrix AP=icP⨂i=0n−1PiA_P=i^{c_P}\bigotimes_{i=0}^{n-1}P_iAP​=icP​⨂i=0n−1​Pi​, using the representative cP∈{0,1,2,3}c_P\in\{0,1,2,3\}cP​∈{0,1,2,3}. Put ΠT=∏j=0n−1(I+ATj)/2\Pi_T=\prod_{j=0}^{n-1}(I+A_{T_j})/2ΠT​=∏j=0n−1​(I+ATj​​)/2, with factors in increasing index order, and τ=tr⁡(AOΠT)\tau=\operatorname{tr}(A_O\Pi_T)τ=tr(AO​ΠT​). The first list entry is 111 if τ=1\tau=1τ=1, 222 if τ=−1\tau=-1τ=−1, and 000 for every other complex value of τ\tauτ. It is followed, in increasing order of iii, by the pair (1,1)(1,1)(1,1) when Oi=IO_i=IOi​=I, and (0,1)(0,1)(0,1) otherwise. There are no validity, commutativity, or phase restrictions on TTT or OOO. The case n=0n=0n=0 is included: the empty product ΠT\Pi_TΠT​ is the identity on the one-dimensional space, and the output has just the first entry.

QAlgorithms.Papers.Independent.Intakethird100.P71.toyCoefficients

For any natural number ddd, real number www, and subset A⊆{0,1}A\subseteq\{0,1\}A⊆{0,1}, writing a=da=da=d as a real number, this defines

{a3w−3a2+3aw−2w2+1(aw−1)(a2−2aw+1),∣A∣=0,−a4w+2a3−2a+wa(aw−1)(a2−2aw+1),∣A∣=1,(a2−1)2a2(a2−2aw+1),∣A∣=2.\begin{cases} \dfrac{a^3w-3a^2+3aw-2w^2+1} {(aw-1)(a^2-2aw+1)},&|A|=0,\\[6pt] \dfrac{-a^4w+2a^3-2a+w} {a(aw-1)(a^2-2aw+1)},&|A|=1,\\[6pt] \dfrac{(a^2-1)^2} {a^2(a^2-2aw+1)},&|A|=2. \end{cases}⎩⎨⎧​(aw−1)(a2−2aw+1)a3w−3a2+3aw−2w2+1​,a(aw−1)(a2−2aw+1)−a4w+2a3−2a+w​,a2(a2−2aw+1)(a2−1)2​,​∣A∣=0,∣A∣=1,∣A∣=2.​

There are no restrictions on d,wd,wd,w and no nonzero denominator hypotheses. Each fraction whose denominator is zero has value zero.

QAlgorithms.Papers.Independent.Intakethird100.P71.twirled

For any natural numbers n,dn,dn,d, let C=({0,…,d−1}){0,…,n−1}\mathcal C=(\{0,\ldots,d-1\})^{\{0,\ldots,n-1\}}C=({0,…,d−1}){0,…,n−1}, and let operators be complex matrices indexed by C\mathcal CC. Given any measure HHH on tuples V=(Vi)i<nV=(V_i)_{i<n}V=(Vi​)i<n​ of d×dd\times dd×d unitary matrices and any measure ν\nuν on operators, this defines the pushforward of H⊗νH\otimes\nuH⊗ν under (V,S)↦L(V)†SL(V)(V,S)\mapsto L(V)^\dagger S L(V)(V,S)↦L(V)†SL(V), where L(V)xy=∏i<n(Vi)xiyiL(V)_{xy}=\prod_{i<n}(V_i)_{x_i y_i}L(V)xy​=∏i<n​(Vi​)xi​yi​​. Neither measure is required to be a probability measure, and SSS is not required to be a density matrix. The definition includes n=0n=0n=0, when C\mathcal CC is a singleton and the empty product defining L(V)L(V)L(V) is 111, and d=0d=0d=0.

QAlgorithms.Papers.Independent.Intakethird100.P71.twoSiteProduct

For any natural number ddd, including zero, and arbitrary complex d×dd\times dd×d matrices X,YX,YX,Y, this defines a matrix indexed by functions x,y:{0,1}→{0,…,d−1}x,y:\{0,1\}\to\{0,\ldots,d-1\}x,y:{0,1}→{0,…,d−1}, whose entries are

Zx,y=Xx(0),y(0)Yx(1),y(1).Z_{x,y}=X_{x(0),y(0)}Y_{x(1),y(1)}.Zx,y​=Xx(0),y(0)​Yx(1),y(1)​.

Thus, identifying each function with its ordered pair of values, Z(a,b),(c,e)=Xa,cYb,eZ_{(a,b),(c,e)}=X_{a,c}Y_{b,e}Z(a,b),(c,e)​=Xa,c​Yb,e​. For d=0d=0d=0, the index set is empty.

QAlgorithms.Papers.Independent.Intakethird100.P71.unitaryBorel

For every finite type ι\iotaι equipped with decidable equality, the measurable structure on the group of complex unitary matrices indexed by ι×ι\iota\times\iotaι×ι coincides with the Borel measurable structure generated by its topology. This includes the case where ι\iotaι is empty.

QAlgorithms.Papers.Independent.Intakethird100.P71.unitaryMeasurable

For every finite type ι\iotaι equipped with decidable equality, the group of complex unitary matrices indexed by ι×ι\iota\times\iotaι×ι is equipped with the Borel measurable structure generated by its topology. The index type ι\iotaι is allowed to be empty.

QAlgorithms.Papers.Independent.Intakethird100.P71.varianceCoefficient

For any natural numbers n,dn,dn,d, any real-valued function rrr on the subsets of {0,…,n−1}\{0,\ldots,n-1\}{0,…,n−1}, and any four such subsets A,B,C,DA,B,C,DA,B,C,D, the variance coefficient is defined as

r(A)r(B)(d2d2−1)nd∣A∩B∩C∣d∣C∣(−1d)∣C△D∣,r(A)r(B) \left(\frac{d^2}{d^2-1}\right)^n \frac{d^{|A\cap B\cap C|}}{d^{|C|}} \left(-\frac1d\right)^{|C\triangle D|},r(A)r(B)(d2−1d2​)nd∣C∣d∣A∩B∩C∣​(−d1​)∣C△D∣,

with all arithmetic performed in the real numbers and C△DC\triangle DC△D denoting symmetric difference. There are no restrictions on rrr or the subsets, and n=0n=0n=0, d=0d=0d=0, and d=1d=1d=1 are included. Division by zero has value zero, and every zeroth power, including 000^000, has value one.

QAlgorithms.Papers.Independent.Intakethird100.P71.wgThree

For every natural number ddd, including zero, and every permutation ppp of {0,1,2}\{0,1,2\}{0,1,2}, let a=da=da=d as a real number and let χ=∣{i∈{0,1,2}:p(i)=i}∣−1\chi=|\{i\in\{0,1,2\}:p(i)=i\}|-1χ=∣{i∈{0,1,2}:p(i)=i}∣−1. This definition assigns the real number

16[1a(a+1)(a+2)+2χa(a+1)(a−1)+{sgn⁡(p)a(a−1)(a−2),d≥3,0,d<3,],\frac16\left[ \frac1{a(a+1)(a+2)} +\frac{2\chi}{a(a+1)(a-1)} + \begin{cases} \displaystyle\frac{\operatorname{sgn}(p)}{a(a-1)(a-2)},&d\ge3,\\ 0,&d<3, \end{cases} \right],61​​a(a+1)(a+2)1​+a(a+1)(a−1)2χ​+⎩⎨⎧​a(a−1)(a−2)sgn(p)​,0,​d≥3,d<3,​​,

where sgn⁡(p)∈{−1,1}\operatorname{sgn}(p)\in\{-1,1\}sgn(p)∈{−1,1} is regarded as real. All divisions use the convention that division by zero is zero; consequently the definition also applies at d=0,1,2d=0,1,2d=0,1,2, and its value is zero at d=0d=0d=0 and d=1d=1d=1.

Human review
  • Endorsed by Shuze Chen · Nov 1, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Nov 1, 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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me