NLA-lib Explorer

NLAlib.ShiftedQR.searchGridWithScratch_writes

Library · theorem

Exact arithmetic

The actual two-loop grid search extends any earlier search prefix by exactly the standard grid order. Its persistent storage is independent of the number of grid candidates. A fragment of the exact decoupler NLAlib.ShiftedQR.scalarDecouple, which exact shifted QR (NLAlib.ShiftedQR.deflationRoutine) takes as its decoupler.

NLAlib.ShiftedQR.searchGridWithScratch_writes {Op Tst : Type} [Ops.Has Ops.ScalarOp Op]
  [Ops.Has Ops.IndexOp Op] [Ops.Has Ops.CmpTst Tst] {M : Ops.Machine ℝ} {I : Ops.Interp Op Tst ℝ}
  (hS : Ops.IsScalar M I) (hE : Ops.ExactModel id M) (hL : Ops.IsIndexLit M I) (hC : Ops.IsCmp id I)
  {τp : Ops.Tape ℝ} {m : Ops.Mem ℝ} {n k D : ℕ} {a c r t target s z f : ℕ × ℕ}
  {H : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {τ γ radius : ℝ} {center : ℂ} {before : List ℂ}
  (hk : k ≤ n) (hτ : 0 ≤ τ) (hD : 1 ≤ D) (hH : HoldsMatrix a H m.store)
  (hc : m.store.readBlock c.1 c.2 2 = some [center.re, center.im])
  (hr : m.store.get r.1 r.2 = some radius) (ht : m.store.get t.1 t.2 = some (τ ^ 2))
  (hTarget : m.store.get target.1 target.2 = some ((1 - γ) ^ (2 * k) * subdiagNormSqProd k H))
  (hstate : ShiftedQR.CandidateHolds τ γ k H before z f m.store)
  (hl : m.Live [a, c, r, t, target, s, z, f]) (hs : s.2 + 2 ≤ m.store.len s.1)
  (hz : z.2 + 2 * ((n + 1) * (n + 1)) ≤ m.store.len z.1) (hf : f.2 < m.store.len f.1)
  (hapart : Ops.Fp.Apart [s, z, f] [2, 2 * ((n + 1) * (n + 1)), 1])
  (hsep :
    (Ops.Fp.blocks [s, z, f] [2, 2 * ((n + 1) * (n + 1)), 1]).Disj
      (Ops.Fp.blocks [a, c, r, t, target] [2 * ((n + 1) * (n + 1)), 2, 1, 1, 1])) :
  Ops.Writes Ops.Mode.total I τp ShiftedQR.searchGridWithScratch
    (Ops.Env.frame [n + 1, k, D] [a, c, r, t, target, f, s, z, f])
    (Ops.Fp.blocks [s, z, f] [2, 2 * ((n + 1) * (n + 1)), 1])
    (fun m' ↦
      m'.pos = m.pos ∧
        ShiftedQR.CandidateHolds τ γ k H (before ++ ShiftedQR.gridPoints center radius D) z f
          m'.store)
    m

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.GridSearch.