cfahlgren1's picture
download
raw
2.52 kB
import OAI.Analysis.MutuallyUnbiased.Moments.GramNormalization
import OAI.Analysis.MutuallyUnbiased.Certificate.CompareMerge
namespace OAI
/-! Finite auxiliary Gram products interpreted as sparse normalized keys. -/
namespace MUB6.Certificate.GramPolynomial
open GramFunctions GramNormalization
open scoped BigOperators
def compareRows : List (ℤ × ℤ) → List (ℤ × ℤ) → Ordering
| [], [] => .eq
| [], _ :: _ => .lt
| _ :: _, [] => .gt
| a :: as, b :: bs =>
(compare a.1 b.1).then ((compare a.2 b.2).then (compareRows as bs))
def keyLess (a b : Key) : Bool :=
(compare a.leftTag.val b.leftTag.val |>.then
(compare a.rightTag.val b.rightTag.val) |>.then (compareRows a.rows b.rows)) == .lt
def normalizedRow (s : Fin 2) (a : Charge) (Q : LinearForm) : Integer.Sparse Key :=
List.ofFn fun j =>
(normalize s (Q.terms j).tag a (Q.terms j).charge, (Q.terms j).coefficient)
theorem normalizedRow_eval (s : Fin 2) (a : Charge) (Q : LinearForm)
(B : Fin 7 → Basis) (hB : IsMUBFamily B) :
Integer.Sparse.eval (normalizedRow s a Q) (GramNormalization.eval B) =
∑ j, ((Q.terms j).coefficient : ℝ) *
auxiliaryMixedEntry B s (Q.terms j).tag a (Q.terms j).charge := by
simp [normalizedRow, Integer.Sparse.eval, List.map_ofFn, List.sum_ofFn,
GramNormalization.eval_normalize B hB]
theorem mixedGram_eq_rows (P Q : LinearForm) (B : Fin 7 → Basis)
(hB : IsMUBFamily B) :
P.mixedGram Q B = ∑ i, ((P.terms i).coefficient : ℝ) *
Integer.Sparse.eval (normalizedRow (P.terms i).tag (P.terms i).charge Q)
(GramNormalization.eval B) := by
simp_rw [normalizedRow_eval _ _ _ B hB, Finset.mul_sum]
unfold LinearForm.mixedGram
apply Finset.sum_congr rfl
intro i _
apply Finset.sum_congr rfl
intro j _
ring
theorem mixedGram_symm (P Q : LinearForm) (B : Fin 7 → Basis)
(hB : IsMUBFamily B) : P.mixedGram Q B = Q.mixedGram P B := by
rw [← LinearForm.auxiliaryEval_gram P Q B hB,
← LinearForm.auxiliaryEval_gram Q P B hB, realGram_symm]
theorem collectWeightedRows_eval {n : ℕ} (rows : Fin n → Integer.Sparse Key)
(weights : Fin n → ℤ) (x : Key → ℝ) :
Integer.Sparse.eval
(Integer.Sparse.collectLevels keyLess n
(List.ofFn fun i => Integer.Sparse.scale (weights i) (rows i))) x =
∑ i, (weights i : ℝ) * Integer.Sparse.eval (rows i) x := by
rw [Integer.Sparse.eval_collectLevels]
simp [List.map_ofFn, List.sum_ofFn]
end MUB6.Certificate.GramPolynomial
end OAI

Xet Storage Details

Size:
2.52 kB
·
Xet hash:
3decbc78036220d89f0a0f339dd4a25d19c1b5391588798fb3cc840bfdf9837f

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.