The matrix is invertible almost surely. Indeed, successively sampled Gaussian columns have probability zero of lying in the proper linear subspace spanned by the previous columns. Thus the diagonal signs used above exist with probability one. Equivalently, apply the Gram-Schmidt process to the columns, always dividing each residual by its positive Euclidean norm; this produces directly.
To prove uniformity, fix . Each column of has density proportional to , so orthogonal transformations preserve its probability distribution. Column independence therefore gives .
The QR decomposition with positive diagonal is unique: if , then is both an orthogonal matrix and an upper triangular matrix, hence diagonal with entries . Its diagonal entries are positive, so it is the identity. It follows that the orthogonal factor of is . Therefore
By uniqueness of normalized Haar measure on the compact group , the returned matrix has exactly the required probability distribution. Reflection invariance gives each determinant sign probability , so the algorithm samples both components of the orthogonal group. The positive-diagonal correction is essential when a numerical QR decomposition chooses its own signs.
Collect the orthonormal vectors as columns and compute . This gives the thin QR decomposition
The inner products in part (e) prove ; the column identities , , prove .
Substitute the QR decomposition into the normal equations:
The diagonal of is nonzero, so is invertible. Cancel it algebraically to obtain
Compute the three inner products in , then use back substitution in this upper triangular matrix. There is no need to form an inverse or explicitly construct . The orthogonal projection of onto the column space is ; its orthogonal residual proves that this solution minimizes .
For independent columns in a real inner product space, the Gram-Schmidt process recursively forms
Each subtracts the orthogonal projections onto earlier normalized vectors. Their independence ensures . The resulting are orthonormal and preserve the span of every initial column set. Putting and for , with zeros below the diagonal, gives a QR decomposition with . Dependent input columns require omitting a zero residual or treating rank deficiency separately.
Positive-diagonal QR decomposition preserves a complex structure Created 2026-10-14 Updated 2026-10-25
Let be block diagonal with blocks . If a real invertible matrix commutes with , its QR decomposition , with orthogonal and upper triangular with positive diagonal, has both and . Indeed , so is orthogonal and upper triangular in blocks. Orthogonality forces its off-diagonal blocks to vanish. Its diagonal blocks are . For with , this block is . Orthogonality of its columns forces , and hence each block is the identity. Thus , proving the claim.
QR algorithm 2026-10-14
The QR algorithm computes eigenvalues through repeated QR decompositions and similarity updates. Shifted and unshifted forms have different convergence rates; the unshifted QR algorithm uses a zero shift at every step.
QR decomposition Created 2026-09-24 Updated 2026-10-14
A reduced QR decomposition of an matrix over the real numbers with full column rank, , writes , where is with orthonormal columns and is a upper triangular matrix with positive diagonal. Applying the Gram-Schmidt process to the columns of constructs and records the coefficients
This last column identity is exactly the matrix multiplication . The upper triangular matrix records that the th input uses only the first new directions, while its positive diagonal records the norms of the nonzero orthogonal projection residuals. Since , one also has ; denotes the transpose and the identity matrix. Over the complex numbers, use the conjugate transpose in these identities.
For the three-dimensional Gram-Schmidt process example, the exact matrices are
For example, the last column reconstructs as
The diagonal entries are approximately . Each is a norm of the new direction before it was scaled to length one.
For a linear least-squares problem, the orthogonal projection of onto the column space of is . Hence the minimizing coefficients solve the linear system by back substitution. Let consist of the first two columns of the example; its reduced factors are and the leading block of . For , the linear system is
Thus , agreeing with the orthogonal projection computed above, and the minimum Euclidean norm of is . The QR decomposition separates building an orthonormal basis from recovering coefficients in the original basis.[ref]
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.
Randomized range finder 2026-10-25
Choose a random sampling matrix , form , and find an orthonormal basis for the sampled column space by a thin QR decomposition. The low-rank approximation keeps the component of in that space. Since , it reproduces the sampled action exactly. If has deficient matrix rank, one can use only a basis of its column space; alternatively an orthonormal completion must be specified.