NLA-lib Explorer

NLAlib.ShiftedQR.shiftedStep_isPerturbedUnitarySimilar

Library · theorem

Standard rounding

The rounded single shifted QR step is backward stable ([BanksGarzaVargasSrivastava2022, Lemma 3.5], for the conjugating implementation): the scalar program shiftedStep, run on a machine with the standard model at the unit roundoff \boldsymbol{u} with (n + 1)\boldsymbol{u} \le 1/2500, returns a perturbed unitary similarity of its input with backward error 50(n + 1)\boldsymbol{u}\|\mathbf{H}\|_2, for every shift. Each round rotates two rows and two columns with rounded coefficients (NLAlib.IsRoundedRowRotation.specNorm_sub_le, 49\boldsymbol{u}\|\mathbf{Z}\|_2 per round); the rounds compose by NLAlib.Ops.BackwardStep.loop_rel. The bound is O(n), not the paper's 32n^{3/2}; it is relative to \|\mathbf{H}\|_2 because this implementation conjugates \mathbf{H} itself. The output is upper Hessenberg up to the rounding of entries that cancel in exact arithmetic; the finite-precision program zeroes them.

NLAlib.ShiftedQR.shiftedStep_isPerturbedUnitarySimilar {O Q : Type} [Ops.Has Ops.ScalarOp O]
  [Ops.Has Ops.CmpTst Q] {M : Ops.Machine ℝ} {I : Ops.Interp O Q ℝ} {u : ℝ} (hS : Ops.IsScalar M I)
  (hM : Ops.StdModel u id M) (hu : 0 ≤ u) (hCmp : Ops.IsCmp id I) {τ : Ops.Tape ℝ} {m : Ops.Mem ℝ}
  {n : ℕ} {a s z : ℕ × ℕ} {H : Matrix (Fin (n + 1)) (Fin (n + 1)) ℂ} {shift : ℂ}
  (hnu : (↑n + 1) * u ≤ 1 / 2500) (hl : m.Live [a, s, z]) (hH : HoldsMatrix a H m.store)
  (hs : m.store.readBlock s.1 s.2 2 = some [shift.re, shift.im])
  (hz : z.2 + 2 * ((n + 1) * (n + 1)) ≤ m.store.len z.1)
  (haz :
    Ops.Fp.Disj (Ops.Store.inBlock a.1 a.2 (2 * ((n + 1) * (n + 1))))
      (Ops.Store.inBlock z.1 z.2 (2 * ((n + 1) * (n + 1)))))
  (hsz :
    Ops.Fp.Disj (Ops.Store.inBlock s.1 s.2 2)
      (Ops.Store.inBlock z.1 z.2 (2 * ((n + 1) * (n + 1))))) :
  Ops.Writes Ops.Mode.total I τ ShiftedQR.shiftedStep (Ops.Env.frame [n + 1] [a, s, z])
    (Ops.Store.inBlock z.1 z.2 (2 * ((n + 1) * (n + 1))))
    (fun m' ↦
      m'.pos = m.pos ∧
        ∃ H',
          IsPerturbedUnitarySimilar H H' (50 * (↑n + 1) * u * specNorm H) ∧
            HoldsMatrix z H' m'.store)
    m

Full source on GitHub

Import NLAlib.Eigensolvers.ShiftedQR.Backward.