NLA-lib Explorer

Matrix.IsHermitian.cgIterate_eq_lanczosMatrix

Library · theorem

Headline of cg-lanczos (provisional)

The Lanczos recurrence yields CG: for Hermitian \mathbf{A} and every q, \mathsf{cgIterate}(\mathbf{A}, \mathbf{b}, \mathbf{x}_0, q + 1) = \mathbf{x}_0 + \|\mathbf{r}_0\|\,\mathbf{Q}\mathbf{T}^{+}\mathbf{e}_0 with \mathbf{Q} and \mathbf{T} computed by q + 1 steps of the recurrence from \mathbf{r}_0; past the grade the recurrence has frozen at zero and the iterate is unchanged. [Saad2003, §6.7.1]. Result: cg-lanczos

Matrix.IsHermitian.cgIterate_eq_lanczosMatrix.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2}
  [Fintype n] [DecidableEq n] {A : Matrix n n 𝕜} (hA : A.IsHermitian) (b x₀ : n → 𝕜) (q : ℕ) :
  cgIterate A b x₀ (q + 1) =
    x₀ +
      ↑‖WithLp.toLp 2 (b - A *ᵥ x₀)‖ •
        lanczosMatrix A (b - A *ᵥ x₀) (q + 1) *ᵥ
          pinv (lanczosTridiagonal A (b - A *ᵥ x₀) (q + 1)) *ᵥ Pi.single 0 1

Full source on GitHub

Import NLAlib.Krylov.LinearSystems.CGLanczos.