Definitions for Classical Shadow Tomography with Locally Scrambled Quantum Dynamics
DefinitionQAlgorithms_Papers_Independent_Intakethird100_P71The 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.
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
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 , any measure on complex matrices indexed by , and any real-valued function on subsets of , this property requires, for every ,
where , and combines configurations on and its complement. There are no probability, support, or integrability assumptions on ; nonintegrable integrals are zero. Division by zero is zero and zeroth powers are one. In particular, when and is zero or one, every fusion factor vanishes, so no can satisfy the required equation for . When , the system is the single equation .
QAlgorithms.Papers.Independent.Intakethird100.P71.Complete
For arbitrary natural numbers and any measure on complex matrices indexed by , this property means that the complex-linear map
is injective: for every pair of complex matrices , equality implies . This concerns all matrices, without positivity or trace restrictions. No probability or integrability assumption is imposed on , and nonintegrable coefficient integrals are zero. When , the matrix space has only one element, so injectivity holds vacuously; when , the configuration set instead has one element.
QAlgorithms.Papers.Independent.Intakethird100.P71.DualTableau
For any natural number , let each be an -tuple of Pauli strings on qubits. A string with phase and factors represents the matrix , where , and the single-qubit matrices are , , , and . This predicate requires each of separately to satisfy all of the following: every phase is or ; all represented matrices commute; for every index , every subset of indices excluding , and every , its -th matrix differs from times the product of its matrices indexed by ; 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 , if , and otherwise. The definition includes , with empty tuples and empty products.
QAlgorithms.Papers.Independent.Intakethird100.P71.IsLocalDesign
For any natural numbers and any two measures on tuples of unitary matrices, this predicate means that, for every complex matrix indexed by -tuples of configurations in ,
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 , as well as or , is included.
QAlgorithms.Papers.Independent.Intakethird100.P71.LocallyScrambled
For arbitrary natural numbers and any measure on complex matrices indexed by , this property requires invariance under every family of unitary matrices. Explicitly, let
Then the pushforward of under must equal , for every such family . No probability, positivity, normalization, or injectivity condition is included. The definition allows , with the empty product equal to one, and ; in either case these conjugations are identity maps, so every measure satisfies the property.
QAlgorithms.Papers.Independent.Intakethird100.P71.Permutations
For any natural numbers , this abbreviation denotes the set of assignments of a permutation of to each site in . Thus an element is a family , with each a bijection of the copy indices. Both parameters may be zero: when there is one empty family, and when each site is assigned the unique permutation of the empty set.
QAlgorithms.Papers.Independent.Intakethird100.P71.ProjectiveEnsemble
For each pair of natural numbers , a projective ensemble consists of a measure on the type , together with a proof that is a probability measure, meaning that its total mass is . There are no positivity restrictions on or . The definition of is not included in the supplied excerpt.
QAlgorithms.Papers.Independent.Intakethird100.P71.SnapshotPolynomialIntegrable
For any natural numbers , including zero, let and let be any measure on the complex matrices indexed by . This predicate requires all three of the following: for every natural number , the matrix-valued function is integrable with respect to , where its entry at configurations is ; for every complex matrix indexed by , the matrix-valued function is integrable; and for every pair of such matrices , the real-valued function is integrable. The first requirement includes , for which the empty product gives the constant one-dimensional matrix . No positivity, trace normalization, or probability-measure assumption is imposed.
QAlgorithms.Papers.Independent.Intakethird100.P71.ToyFeature
For any natural number , any measure on complex matrices indexed by pairs in , and any real number , this predicate requires
for every subset . Here the matrix , indexed by assignments , has entry , summing over all assignments 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 , all the integrands are zero, so the required value for cannot hold.
QAlgorithms.Papers.Independent.Intakethird100.P71.averagedSecondMoment
For any natural numbers , put . Let be any measure on tuples of unitary matrices, let be any measure on complex matrices indexed by , and assume that the map
is injective. For arbitrary matrices , define by and set . Let be weighted by . The averaged second moment is
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 , any measure on complex matrices indexed by configurations , and four configurations , this defines the complex number
The two matrix entries are multiplied without complex conjugation, and the second entry has indices , in that order. No normalization, positivity, support, or integrability condition is required of ; a nonintegrable integrand has integral zero. The parameters include , when has one element and , and , when no configurations exist.
QAlgorithms.Papers.Independent.Intakethird100.P71.copyPermutation
For any natural numbers and any family of permutations of , this definition gives a complex matrix whose rows and columns are indexed by -tuples of configurations in . Its entry at row and column is
All three parameters may be zero. For the index set is a singleton and the matrix is ; for it is also . If while , the matrix has an empty index set.
QAlgorithms.Papers.Independent.Intakethird100.P71.efReconstruct
For arbitrary natural numbers , any real-valued function on subsets of , and any complex matrix indexed by , this defines the matrix
Here combines configurations on and its complement, and real scalars are regarded as complex scalars. No equation or other condition on , and no positivity or normalization condition on , 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 , the formula reduces to .
QAlgorithms.Papers.Independent.Intakethird100.P71.feature
For arbitrary natural numbers , any measure on the space of complex matrices indexed by , and any subset , this defines
where are configurations on , and combines the indicated configurations on and . 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 or are allowed.
QAlgorithms.Papers.Independent.Intakethird100.P71.featureThree
For any natural numbers , let . Given any measure on the complex matrices indexed by , and a family of permutations of , this defines
where both matrices are indexed by triples , with entries
No probability, positivity, normalization, or integrability hypothesis is imposed on or its matrices; the complex integral is defined to be zero when its integrand is not integrable. If , is a singleton and the conditions defining are vacuous; if , the matrix index set is empty and the result is zero.
QAlgorithms.Papers.Independent.Intakethird100.P71.frameGap
For any natural numbers , any measure on tuples of unitary matrices, and any measure on complex operators indexed by , let be the pushforward of by , with . This defines
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 and .
QAlgorithms.Papers.Independent.Intakethird100.P71.framePotential
For any natural numbers and any measure on complex matrices indexed by , this defines the real number
There is no assumption that is normalized or that 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 or are included.
QAlgorithms.Papers.Independent.Intakethird100.P71.fusion
For arbitrary natural numbers and subsets , this defines
The sum ranges over every subset satisfying the displayed equality; if none exists, it is zero. No positive lower bound on is assumed, so all zero denominators use the value zero, and zeroth powers have value one. For , all three subsets are empty and the value is one for every . For and or , the value is zero.
QAlgorithms.Papers.Independent.Intakethird100.P71.fusionSite
For every natural number and every three Boolean values , this defines the following real number, with interpreted as a real number in the formulas:
There is no lower bound on . Division by zero is defined to be zero, so at every branch with has value zero; at , every branch has value zero.
QAlgorithms.Papers.Independent.Intakethird100.P71.gueCoordinates
For every natural number , including zero, let . This defines the product measure on real arrays
whose coordinate measures are all Gaussian with mean and variance . Thus the coordinates are independent standard real Gaussian variables. When , 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 , let . Given any real array , form
This defines the complex matrix
where is the conjugate transpose. Equivalently, its entries are
The input array is unrestricted. Division by zero is defined to be zero; for , is empty and the output is the unique empty matrix.
QAlgorithms.Papers.Independent.Intakethird100.P71.hsSquare
For arbitrary natural numbers , including zero, and any complex matrix indexed by , this defines
No Hermiticity or positivity hypothesis is required. If , the value is zero; if , 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 , every , and every , define
where denotes conjugate transpose and each is viewed as a complex matrix. No positivity, trace, or normalization hypothesis is imposed on . The types and , and the product’s site index type, are not defined in the supplied excerpt; an empty product equals .
QAlgorithms.Papers.Independent.Intakethird100.P71.localMatrix
For all natural numbers and every of type , define an operator by the entry formula
where each is viewed as a complex matrix indexed by . An empty product equals . The supplied excerpt does not define , , or their configuration and site index types.
QAlgorithms.Papers.Independent.Intakethird100.P71.localMomentAction
For any natural numbers , any measure on tuples of unitary matrices, and any complex matrix indexed by -tuples of configurations from , this defines the matrix-valued Bochner integral
No normalization of , integrability hypothesis, or restriction on is required; the integral is zero if the matrix-valued integrand is not integrable. All three natural numbers may be zero. In particular, for the matrix is the identity.
QAlgorithms.Papers.Independent.Intakethird100.P71.localObservable
For any natural number , including zero, and any complex matrix , this defines the matrix indexed by pairs from with entries
Equivalently, it is , with the first coordinate carrying . No assumptions are imposed on . For , the matrix is empty.
QAlgorithms.Papers.Independent.Intakethird100.P71.localityNumerator
For any natural number , including zero, and any complex matrix indexed by pairs from , define matrices
This defines the real number
The squares are ordinary matrix products, and no assumptions are imposed on . For , both traces are empty sums and the value is zero.
QAlgorithms.Papers.Independent.Intakethird100.P71.observableFeature
For any natural numbers , let , let be any measure on tuples of unitary matrices, let be any complex matrix indexed by , and let . Define and . For assignments on , define the matrix by
where denotes the configuration taking its coordinates from on and from elsewhere. The observable feature is defined as . The square is ordinary matrix multiplication. No Hermiticity, positivity, normalization, or integrability assumption is imposed; zero dimensions, empty , and full are included, and a nonintegrable integrand has integral zero.
QAlgorithms.Papers.Independent.Intakethird100.P71.observableThree
For any natural numbers , put . Let be any measure on complex matrices, subject to the hypothesis that the complex linear map
is injective. For arbitrary complex matrices , and a family of permutations of , this defines
where is the unique matrix satisfying , and
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 , and nonintegrable coefficient integrands have integral zero. Zero values of are included, with ; when , all these matrices are empty and the result is zero.
QAlgorithms.Papers.Independent.Intakethird100.P71.oneSiteInverse
For every natural number , including zero, and every complex matrix , this defines the matrix
Equivalently, its entry is . No positivity, Hermiticity, trace, or invertibility hypothesis is required. For , it is the unique empty matrix.
QAlgorithms.Papers.Independent.Intakethird100.P71.operatorBorel
For every pair of natural numbers , including zero, the measurable structure on coincides with the Borel measurable structure generated by its topology. The definition of is not included in the supplied excerpt.
QAlgorithms.Papers.Independent.Intakethird100.P71.operatorMeasurable
For every pair of natural numbers , including zero, the type is equipped with the Borel measurable structure generated by its topology. The definition of the operator type is not included in the supplied excerpt.
QAlgorithms.Papers.Independent.Intakethird100.P71.partialPurity
For arbitrary natural numbers , a subset , and any complex matrix indexed by configurations , define a matrix indexed by configurations on by
where agrees with on and with on its complement. The defined quantity is
There is no assumption that is Hermitian, positive, or normalized; the square is matrix multiplication, with no conjugate transpose. Empty , , and are included, with empty sums equal to zero.
QAlgorithms.Papers.Independent.Intakethird100.P71.partialTrace
For every natural number , every finite type equipped with decidable equality, every subset , and every complex matrix indexed by functions , define a matrix indexed by functions through
where is the function equal to on and to on its complement. No condition is imposed on . Empty index sets and an empty are allowed: an empty sum is zero, and there is exactly one function from an empty domain to ; in particular, gives the trace as the sole matrix entry, while gives under restriction of indices.
QAlgorithms.Papers.Independent.Intakethird100.P71.pauliFactor
For any natural number , any Pauli string consisting of a phase in and one factor from at each of the qubits, any index , and any Boolean , this defines the complex number if the factor of at is or is true, and otherwise. The phase of does not affect the value. When , no index exists.
QAlgorithms.Papers.Independent.Intakethird100.P71.posteriorOf
For all natural numbers , every measure on , and every operator , define a measure by weighting with the nonnegative extended-real density
Here replaces negative real values by zero. Neither nor is required to be normalized, and is not required to be positive or Hermitian. Both and may be zero; when , the density is identically zero. The operator type is not defined in the supplied excerpt.
QAlgorithms.Papers.Independent.Intakethird100.P71.prior
For all natural numbers and every projective ensemble , whose law is a probability measure on , define a measure on by
where has its sole nonzero entry at , the subscript denotes pushforward of a measure, and viewed as a nonnegative extended real. The inverse is taken in , where ; consequently the scaling factor is zero when , whereas , including when . The types , , and are not defined in the supplied excerpt.
QAlgorithms.Papers.Independent.Intakethird100.P71.productWgThree
For any natural numbers , including zero, and families and of permutations of , this defines the real number
where permutation multiplication is composition and, writing as a real number and ,
Every division is total, with division by zero equal to zero. For , the product is .
QAlgorithms.Papers.Independent.Intakethird100.P71.raw
For all natural numbers , every , and every , define
where is viewed as an operator in , and has entry at and entry everywhere else. Equivalently, its -entry is . The definitions of the three named types are not supplied, and no positive lower bound on or is assumed.
QAlgorithms.Papers.Independent.Intakethird100.P71.reducedSnapshot
For every natural number , every finite type equipped with decidable equality, every subset , and every complex matrix indexed by functions , define a matrix on the same index set by
The unions here combine functions on complementary domains. No positivity, Hermiticity, or normalization is assumed for . The exponent uses natural-number subtraction, and ; empty sums equal zero, , and complex division by zero is defined to be zero. The definition includes , empty , and empty .
QAlgorithms.Papers.Independent.Intakethird100.P71.regionalWg
For arbitrary natural numbers and subsets , this defines the real number
where is their symmetric difference and the first factor means . There is no restriction : reciprocals of zero and division by zero have value zero, and a zeroth power, including , has value one. Consequently the value is one when , and it is zero when and .
QAlgorithms.Papers.Independent.Intakethird100.P71.sandwichPrior
For any natural numbers , any unitary on configurations , and any measures on tuples of unitary matrices, this defines the measure
where , similarly for , and converts a nonnegative real scalar to an extended nonnegative real scalar. Neither input measure is required to be a probability measure. If , the configuration set is empty and the resulting measure is zero; if , there is one configuration and the scalar is , including when .
QAlgorithms.Papers.Independent.Intakethird100.P71.sandwichRaw
For any natural numbers , any unitary matrix indexed by , any two tuples and of unitary matrices, and any configuration , this defines
Here has its only nonzero entry, equal to , at . For , configurations form a singleton and both local products are ; for , there is no configuration to supply.
QAlgorithms.Papers.Independent.Intakethird100.P71.scalarCode
For every complex number , this defines a natural number equal to when , equal to when , and equal to for every other complex number.
QAlgorithms.Papers.Independent.Intakethird100.P71.secondMoment
For any natural numbers , let , let be any measure on complex matrices indexed by , and assume that the map
is injective, so that its inverse exists. For arbitrary matrices , define the measure by weighting with the nonnegative extended-real density . The second moment is defined by
Neither nor is required to be a density matrix or Hermitian, 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 , let , let be any measure on complex matrices indexed by , and suppose the complex-linear map defined by
is injective. Since its domain and codomain are the same finite-dimensional space, it has an inverse. For arbitrary matrices indexed by , the shadow estimate is defined as . 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 , let , let be any measure on complex matrices indexed by , and assume the complex-linear map
is injective. For any matrix and any prescribed tuple of matrices , the shadow sample mean is defined as
The tuple is arbitrary and is not assumed to have been sampled from a measure. When , the empty sum and the convention 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 , put . Let be any measure on complex matrices indexed by , and suppose the map
is injective. For arbitrary matrices , let be weighted by and write . The shot variance is defined as
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 , any measure on complex matrices indexed by , and the hypothesis that
is injective on all complex matrices, this defines the inverse complex-linear equivalence . Surjectivity is obtained from injectivity because the domain and codomain are the same finite-dimensional space, so the defined inverse satisfies both and for every matrix . No additional probability or integrability hypothesis is required; nonintegrable coefficient integrals are zero. The construction includes the zero-dimensional matrix space arising when , as well as the one-dimensional matrix space arising when .
QAlgorithms.Papers.Independent.Intakethird100.P71.snapshotMeasurementMap
For arbitrary natural numbers and any measure on complex matrices indexed by , this defines a complex-linear map on that entire matrix space by
Thus its coefficients are separately defined integrals, with no conjugation of the entries of . No assumption says that 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: gives a one-dimensional matrix space, while gives the zero-dimensional matrix space.
QAlgorithms.Papers.Independent.Intakethird100.P71.snapshotMoment
For arbitrary natural numbers , any measure on complex matrices indexed by , and any natural number , this defines the matrix-valued integral
whose row and column indices are functions . 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 is included: its index set has one element and its integrand is the 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 , let , let be any measure on complex matrices indexed by , and let be any such matrix. Weight by the nonnegative extended-real density to obtain a measure . The snapshot sample law is defined as the finite product measure on -tuples of matrices. No density-matrix or probability-measure assumption is imposed. In particular, is included and gives the empty product measure on the singleton set of empty tuples; and may also be zero.
QAlgorithms.Papers.Independent.Intakethird100.P71.tableauInput
For any natural number , any two -tuples of Pauli strings on qubits, and any Pauli string on qubits, this defines a list of natural numbers beginning with the single entry , followed by the encodings of , then , then , with every Boolean encoding bit converted to for false or for true. A string of phase , represented by , is encoded by the two bits , followed by its Pauli factors in increasing qubit order, using , , , and . A tableau encoding concatenates its string encodings in increasing row order. No validity or commutation conditions are required. For , both tableau encodings are empty, so the output is followed by the two phase bits of .
QAlgorithms.Papers.Independent.Intakethird100.P71.tableauRecord
For every natural number , every list of -qubit Pauli strings, and every -qubit Pauli string , this defines a list of natural numbers. A Pauli string consists of a phase and factors , and represents the matrix , using the representative . Put , with factors in increasing index order, and . The first list entry is if , if , and for every other complex value of . It is followed, in increasing order of , by the pair when , and otherwise. There are no validity, commutativity, or phase restrictions on or . The case is included: the empty product 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 , real number , and subset , writing as a real number, this defines
There are no restrictions on and no nonzero denominator hypotheses. Each fraction whose denominator is zero has value zero.
QAlgorithms.Papers.Independent.Intakethird100.P71.twirled
For any natural numbers , let , and let operators be complex matrices indexed by . Given any measure on tuples of unitary matrices and any measure on operators, this defines the pushforward of under , where . Neither measure is required to be a probability measure, and is not required to be a density matrix. The definition includes , when is a singleton and the empty product defining is , and .
QAlgorithms.Papers.Independent.Intakethird100.P71.twoSiteProduct
For any natural number , including zero, and arbitrary complex matrices , this defines a matrix indexed by functions , whose entries are
Thus, identifying each function with its ordered pair of values, . For , the index set is empty.
QAlgorithms.Papers.Independent.Intakethird100.P71.unitaryBorel
For every finite type equipped with decidable equality, the measurable structure on the group of complex unitary matrices indexed by coincides with the Borel measurable structure generated by its topology. This includes the case where is empty.
QAlgorithms.Papers.Independent.Intakethird100.P71.unitaryMeasurable
For every finite type equipped with decidable equality, the group of complex unitary matrices indexed by is equipped with the Borel measurable structure generated by its topology. The index type is allowed to be empty.
QAlgorithms.Papers.Independent.Intakethird100.P71.varianceCoefficient
For any natural numbers , any real-valued function on the subsets of , and any four such subsets , the variance coefficient is defined as
with all arithmetic performed in the real numbers and denoting symmetric difference. There are no restrictions on or the subsets, and , , and are included. Division by zero has value zero, and every zeroth power, including , has value one.
QAlgorithms.Papers.Independent.Intakethird100.P71.wgThree
For every natural number , including zero, and every permutation of , let as a real number and let . This definition assigns the real number
where is regarded as real. All divisions use the convention that division by zero is zero; consequently the definition also applies at , and its value is zero at and .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.