NLA-lib Explorer

NLAlib.ShiftedQR.initializeState_writes

Library · theorem

Exact arithmetic

Initialization copies the actual raw matrix into both state matrices and subtracts the supplied shift only from the working matrix. The raw matrix and shift occupy disjoint views from the outputs, and the two output matrices are separate. No initialized output is needed. Shared by the trees of NLAlib.ShiftedQR.shiftedStepRoutine, NLAlib.ShiftedQR.shqrSmallEigRoutine and NLAlib.SmallEig.smallEigRoutine, on their scratch.

NLAlib.ShiftedQR.initializeState_writes {Op Tst : Type} [Ops.Has Ops.ScalarOp Op]
  {M : Ops.Machine ℝ} {I : Ops.Interp Op Tst ℝ} (hS : Ops.IsScalar M I) (hE : Ops.ExactModel id M)
  {τ : Ops.Tape ℝ} {m : Ops.Mem ℝ} {n : ℕ} {a s w z : ℕ × ℕ} {H : Matrix (Fin n) (Fin n) ℂ}
  {shift : ℂ} (hl : m.Live [a, s, w, z]) (hH : HoldsMatrix a H m.store)
  (hs : m.store.readBlock s.1 s.2 2 = some [shift.re, shift.im])
  (hw : w.2 + 2 * (n * n) ≤ m.store.len w.1) (hz : z.2 + 2 * (n * n) ≤ m.store.len z.1)
  (haw :
    Ops.Fp.Disj (Ops.Store.inBlock a.1 a.2 (2 * (n * n))) (Ops.Store.inBlock w.1 w.2 (2 * (n * n))))
  (haz :
    Ops.Fp.Disj (Ops.Store.inBlock a.1 a.2 (2 * (n * n))) (Ops.Store.inBlock z.1 z.2 (2 * (n * n))))
  (hsw : Ops.Fp.Disj (Ops.Store.inBlock s.1 s.2 2) (Ops.Store.inBlock w.1 w.2 (2 * (n * n))))
  (hsz : Ops.Fp.Disj (Ops.Store.inBlock s.1 s.2 2) (Ops.Store.inBlock z.1 z.2 (2 * (n * n))))
  (hwz :
    Ops.Fp.Disj (Ops.Store.inBlock w.1 w.2 (2 * (n * n)))
      (Ops.Store.inBlock z.1 z.2 (2 * (n * n)))) :
  Ops.Writes Ops.Mode.total I τ ShiftedQR.initializeState (Ops.Env.frame [n] [a, s, w, z])
    (Ops.Store.inBlock w.1 w.2 (2 * (n * n)) ⊔ Ops.Store.inBlock z.1 z.2 (2 * (n * n)))
    (fun m' ↦ m'.pos = m.pos ∧ HoldsMatrix w (H - shift • 1) m'.store ∧ HoldsMatrix z H m'.store) m

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.Shift.