Definition (QR factorization). For \mathbf{A}\in\mathbb{C}^{m\times n} with m\ge n, a thin QR factorization is \mathbf{A}=\mathbf{Q}\mathbf{R}, where \mathbf{Q}^{\mathsf{H}}\mathbf{Q}=\mathbf{I} and \mathbf{R} is upper triangular. Full QR extends \mathbf{Q} to a unitary basis. Rank deficiency permits zero diagonal entries of \mathbf{R}. Householder transformations, Givens rotations, and GramβSchmidt are different ways to compute factors; QR eigenvalue iteration is a separate algorithm.
QR factorization
Factor a matrix into an orthogonal basis and a triangular factor.
Definition
Results
Theorem (Givens QR gives the thin QR factorization).
of a tall upper Hessenberg matrix. [GolubVanLoan2013, Algorithm 5.2.4].
Lean statement and details
NLAlib.isQR_givensHessenberg.{u_1} {π : Type u_1} [RCLike π] {m p : β}
{H : Matrix (Fin m) (Fin p) π} (hH : IsUpperHessenberg H) (h : p β€ m) :
IsQR H ((givensHessenbergQ H).submatrix id (Fin.castLE h))
((givensHessenbergR H).submatrix (Fin.castLE h) id)Theorem (Least squares through QR).
When the diagonal of \mathbf{R} has no zero (full column rank), \mathbf{x} minimises \|\mathbf{A}\mathbf{x} - \mathbf{b}\| exactly when \mathbf{R}\mathbf{x} = \mathbf{Q}^{\mathsf{H}}\mathbf{b}. [GolubVanLoan2013, Β§5.3.3]; [TrefethenBau1997, Lecture 11].
Lean statement and details
NLAlib.IsQR.isLeastSquaresSolution_iff.{u_1, u_3, u_4} {π : Type u_1} [RCLike π] {m : Type u_3}
{n : Type u_4} [Fintype m] [Fintype n] [LinearOrder n] [DecidableEq n] {A Q : Matrix m n π}
{R : Matrix n n π} (h : IsQR A Q R) (hR : β (i : n), R i i β 0) {b : m β π} {x : n β π} :
IsLeastSquaresSolution A b x β R *α΅₯ x = Qα΄΄ *α΅₯ bUsed by other algorithms
Hutch++
Combine a low-rank approximation with residual trace estimation.
Hermitian spectral bisection (Shah)
Use a spectral split to separate invariant subspaces.
Randomized subspace extraction (deflation)
Project a random sample through a matrix and extract a basis using QR.
Hessenberg shifted QR (BGS)
The shifted QR algorithm of Banks, Garza-Vargas and Srivastava on Hessenberg matrices, with exact-arithmetic and finite-precision programs and BGS + Dense Schur (end-to-end).