QR decomposition by Givens rotations Created 2026-09-24 Updated 2026-10-14
Successive Givens rotations eliminate entries below the diagonal of a matrix. For an matrix with , process columns ; within column , rotate rows for each whose entry needs elimination. Apply each Givens row-pair update to columns . Both rows are zero in earlier columns, so these operations preserve earlier eliminations. No assumption of full column rank is needed to perform the eliminations.
For a concrete example, take
First use , then :
The entry in position was already zero, so its elimination was skipped. The second Givens rotation combines the remaining pair in column two. This yields the full QR decomposition
The first two columns of and first two rows of give the reduced QR decomposition. Direct multiplication verifies both and . For these displayed factors evaluated in binary64 floating-point arithmetic, the Frobenius norms and are both below ; these measure reconstruction and loss of orthogonality separately.
Figure 1.
Two local Givens row-pair updates turn a matrix into the rectangular of a QR decomposition
. Details.
More generally, if the chronological rotations are , then
Each factor is an orthogonal matrix, so is too. For a rectangular matrix, has zeros below its diagonal; its leading block is an upper triangular matrix. With full column rank, retaining the first columns of gives orthonormal columns. To impose a positive diagonal when necessary, flip matching columns of and rows of , preserving their product.
For a linear least-squares problem, apply the same chronological Givens rotations to the right-hand side , obtaining , without explicitly constructing . Since the Euclidean norm is preserved, solve the leading upper triangular matrix system by back substitution when has full column rank; the remaining entries of give the minimum residual norm. In the example, gives , , and minimum residual Euclidean norm .
The locality is useful for a sparse matrix or an existing QR decomposition needing an extra row: only two rows change at each step, and the new row can be eliminated against the stored upper triangular matrix. For an factor, this extra-row procedure takes rotations and arithmetic operations. Locality does not guarantee preservation of sparsity: mixing rows can create nonzeros wherever either row had one. For a fully populated input, the straightforward elimination uses rotations, each touching columns, giving work. Storage layout, zero patterns and implementation affect speed; this count alone establishes no universal advantage over other QR decomposition algorithms.
The Euclidean norm preservation explains the appeal for numerical stability: exact rotations do not amplify a perturbation's length. Rounded coefficients and Givens row-pair updates still introduce roundoff error. Small reconstruction and orthogonality residuals check the computed factors, while the condition number of the original problem still controls how accurately a linear least-squares problem determines its solution.