Every point in the affine search space is uniquely , since the columns of form a basis. Its linear-system residual is , so minimizing the residual is exactly the linear least-squares problem .
Use the standard starting choice and an orthonormal extended basis . If , then and orthonormality givesThe starting-vector choice is needed for this particular representation; an arbitrary orthonormal basis need not have those initial coordinates.
The Arnoldi iteration constructs the basis. At column , orthogonalize against , recording coefficients ; normalize the remaining vector with to get . This makes an upper Hessenberg matrix of size . The resulting GMRES algorithm starts from , grows this Arnoldi basis, solves the small least-squares problem, and sets . Its small residual norm provides the stopping test. Incremental Givens rotations efficiently update the small QR decomposition instead of solving it anew. Zero initial residual means the system is already solved; Arnoldi breakdown gives an invariant subspace and, for nonsingular , permits exact solution within it.
A real square orthogonal matrix satisfies , so it preserves the Euclidean norm. The columns of are orthonormal, hence . The induced matrix norm therefore givesFor the left truncation, , and equality is guaranteed for arbitrary only when . Indeed, if , take , where is an omitted column of . Then but . Merely taking does not guarantee preservation for an arbitrary .
A full QR decomposition of a real matrix is , with orthogonal and upper trapezoidal; for a square matrix, is upper triangular. Fix the following sign convention for a Givens rotation: it is the identity except for its blockThe block transpose times the block is because , proving orthogonality. Writing , the choice gives and . To zero the other coordinate take , giving . If , both entries are already zero and the identity suffices.
For a tridiagonal matrix, successively rotate adjacent row pairs , each time zeroing the current entry . Earlier columns remain triangular because both affected rows are already zero there. The result is upper triangular, so gives its QR decomposition. Only rotations are required; the resulting has at most two superdiagonals.
For a full square matrix, process columns . Within column , for , rotate rows to eliminate the current entry. Previously cleared columns stay clear. With in application order, , one has . This is QR decomposition by Givens rotations.
Past exam of the numerical linear algebra course of the University of Oxford 2025 3 a ii Solution 2026-10-25
For the small QR decomposition, each of the Givens rotations eliminates one subdiagonal entry of the upper Hessenberg matrix. At column , apply the rotation to two rows in columns , costing arithmetic operations. Summing gives , and applying the rotations to the right-hand side costs . Backward substitution in a triangular system costs .
Computing costs and the final dense matrix multiplication costs . Thus the total, with the Arnoldi decomposition already supplied, isHere , since has orthonormal columns in . In the standard dense arithmetic model, forming the general matrix–vector product gives the sharp cost. The pair above records that two-parameter bound; looser bounds such as are also possible because . Treating as an unstructured dense matrix would unnecessarily replace its factorization by an computation.
Past exam of the numerical linear algebra course of the University of Oxford 2025 3 a i Solution 2026-10-25
Write and . The Arnoldi decomposition and giveBecause has orthonormal columns, it preserves the Euclidean norm. The generalized minimal residual method therefore reduces to the small linear least-squares problemUse Givens rotations on the upper Hessenberg matrix to obtain a QR decompositionwhere is an orthogonal matrix and is an upper triangular matrix. Then solve by backward substitution in a triangular system and form . The resulting minimum linear-system residual has Euclidean norm .
The small problem has a unique answer: if , the Arnoldi decomposition gives . The invertible matrix implies , and the orthonormality of then gives . Thus has full column rank and is nonsingular.
A Givens rotation equals the identity except in coordinates , where its block can be taken asThe two block columns are orthonormal because ; other coordinates are unchanged, so the full matrix is orthogonal. If , take , and . The transformed pair is . If both entries are zero, the identity already suffices.
For the specified vector one possible matrix isIts rows are orthonormal. It is not unique: premultiply by any orthogonal transformation fixing the second coordinate axis pointwise. This rotates or reflects the other two output coordinates without changing the required image. Equivalently its second row must be , but any orthonormal completion of that row works.
The columns outside indices are unchanged coordinate vectors. The remaining two columns have nonzero entries only in rows , with the block . They have squared norm and mutual inner product zero; they are also orthogonal to all the unchanged columns. Hence .
Let . If , choose with and . ThenEvery other coordinate is unchanged. If , choose ; the same conclusions hold. Therefore the procedure can be fixed with the nonnegative pivot conventionThis is a Givens rotation.
A Givens rotation acts as the identity except on coordinates , where its block can be writtenThe block has orthonormal columns because and their inner product is zero, so . For , choose , . The new coordinates are , eliminating the th entry. If both entries are zero, the identity already works.
For the specified vector, one suitable matrix isIts rows are orthonormal, so it is orthogonal; in fact its determinant is one. The positive nonzero output component must be five because an orthogonal matrix preserves Euclidean norm.
The matrix is not unique. Left multiplication by any orthogonal matrix fixing the second coordinate vector preserves this output. For example arbitrary rotations of the first and third coordinates provide infinitely many alternatives.
Use determinant-one Givens rotations and choose every nonzero eliminated pair to leave a positive pivot. If the input square matrix is orthogonal, its resulting upper triangular factor is orthogonal too, and hence diagonal with entries of absolute value one. Positivity fixes the first entries to one, while determinant preservation fixes the last to . A negative last entry is unavoidable when the input reverses orientation.
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, takeFirst 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 decompositionThe 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.
More generally, if the chronological rotations are , thenEach 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.
Stable construction of a Givens rotation 2026-10-14
For finite real numbers , a Givens rotation that annihilates is defined mathematically byHere
hypot means an evaluation of the Euclidean norm of designed to avoid unnecessary range failures in floating-point arithmetic. The zero case selects the identity matrix, avoiding division by zero. If , then ; if , then . Thus the retained component is nonnegative, including when . In exact arithmetic, and .Computing the square root of
a*a + b*b directly can fail even when the final norm is representable. In binary64 floating-point arithmetic, makes the squares overflow, whereas is finite. With the squares round to zero, although is representable. A range-safe hypot avoids these intermediate failures.The simple divisions still need care when is a subnormal number: rounding can cause large relative errors. For the smallest positive binary64 subnormal number , taking rounds to ; dividing by that rounded value gives , which is not an orthogonal matrix. For nonzero finite inputs, compute the coefficients before rescaling the norm:At least one scaled component has absolute value one, and . This construction keeps the coefficients meaningful even when rounding is severe. It cannot make an unrepresentably large finite, preserve an arbitrarily tiny against underflow, or repair inputs already rounded to zero. The row updates themselves can also overflow if their exact results exceed the available range.
LAPACK's
DLARTG uses scaling for numerical stability but a different sign convention: for it chooses and ; for it returns . Its block still has the lower-left minus sign. Do not combine its returned coefficients with an assumed nonnegative .[ref]DLARTG (LAPACK 3.12.1) by Edward Anderson. DLARTG, LAPACK 3.12.1, Purpose: block, signed R, scaling and zero-input cases; implementation lines 137–159
