NLA-lib Explorer

NLAlib.ShiftedQR.findRitzSearch_writes

Library · theorem

Exact arithmetic

The complete scoped implementation returns exactly the mathematical Ritz binary search on the actual supplied shift list. All numerical steps are explicit scalar programs; the standard index and comparison models govern the actual bounded index reads. [BanksGarzaVargasSrivastava2021, §4.3]. A fragment: its tree runs only inside the tree of NLAlib.ShiftedQR.iteration. A fragment of the tree NLAlib.ShiftedQR.iteration.

NLAlib.ShiftedQR.findRitzSearch_writes {Op Tst : Type} [Ops.Has Ops.ScalarOp Op]
  [Ops.Has Ops.IndexOp Op] [Ops.Has Ops.CmpTst Tst] [Ops.Has Ops.IdxTst Tst] {M : Ops.Machine ℝ}
  {I : Ops.Interp Op Tst ℝ} (hS : Ops.IsScalar M I) (hE : Ops.ExactModel id M)
  (hCmp : Ops.IsCmp id I) (hL : Ops.IsIndexLit M I) (hToNat : Ops.IsToNat id I) {τ : Ops.Tape ℝ}
  {m : Ops.Mem ℝ} {n levels k : ℕ} {b ss z : ℕ × ℕ} {H : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ}
  {shifts : List ℂ} (hH : IsUpperHessenberg H) (hB : HoldsMatrix b H m.store)
  (hSS : ShiftedQR.HoldsShifts ss shifts m.store) (hlen : shifts.length = k) (hk : k = 2 ^ levels)
  (hdet : ∀ shift ∈ shifts, (H - shift • 1).det ≠ 0)
  (hsep : Ops.Fp.Disj (Ops.Store.inBlock ss.1 ss.2 (2 * k)) (Ops.Store.inBlock z.1 z.2 2))
  (hz : z.2 + 2 ≤ m.store.len z.1) :
  Ops.Writes Ops.Mode.total I τ ShiftedQR.findRitzSearch
    (Ops.Env.frame [n + 1, levels, k] [b, ss, z]) (Ops.Store.inBlock z.1 z.2 2)
    (fun m' ↦
      m'.pos = m.pos ∧
        m'.store.readBlock z.1 z.2 2 =
          some [(findRitz H levels 1 shifts).re, (findRitz H levels 1 shifts).im])
    m

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.FindRitz.