Existence of QR Decomposition
The decomposition factors a matrix into an orthogonal factor and an upper-triangular factor. Orthogonal multiplication preserves lengths and angles, so it is well suited to stable numerical calculations.
Let satisfy and . Then there is an orthogonal matrix with and an upper-triangular matrix whose first diagonal entries are positive, such that
This factorization is the decomposition of .
Proof with Gram Schmidt Orthogonalization
Let denote column of . Gram-Schmidt removes the components in the directions already found, then normalizes what remains:
Full column rank guarantees at every step. The normalized vectors form the columns of and satisfy . Each original column can be reconstructed as
, where is upper triangular and .
Complete with orthonormal columns to form .
Appending zero rows to gives:
The completed matrices still satisfy .
Full and Reduced QR Decomposition
For with , the full and reduced forms describe the same factorization with different matrix sizes. Both forms multiply back to , so the choice depends on whether you need the complete orthonormal basis or only the columns that carry the data.
Full QR Decomposition
The full form keeps all columns of :
Here is orthogonal and contains an upper-triangular block above zero rows.
Reduced QR Decomposition
The reduced form removes those zero rows and the matching unused columns of :
Here contains the first columns of , and is upper triangular. Storing only the first columns of saves memory and avoids operations on blocks that are known to be zero.
The unused columns form an orthonormal basis for the null space of :
The null space of is the set of vectors that satisfy .
Uniqueness Property
For a full-column-rank matrix, the reduced factorization is unique when every diagonal entry of is positive. That sign condition removes the remaining freedom, because multiplying a column of and the matching row of by leaves the product unchanged.
Worked Thin QR Example
Let
Gram-Schmidt first gives
The calculation gives:
Householder Method for QR Decomposition
Classical Gram-Schmidt gives a direct derivation, but nearly dependent columns can lose orthogonality in floating-point arithmetic. Modified Gram-Schmidt reduces that error. Dense numerical software commonly uses Householder reflectors, while Givens rotations are useful when only selected entries need to be eliminated.
Householder Transformation
For a unit vector , define the Householder matrix
The outer product multiplies an column by a row, so it produces an rank-one matrix. The reversed product is the scalar .
Properties of Householder Transformation
For and , the following properties hold. Symmetry and orthogonality come from the unit vector in the definition, the reflection explains what the transformation does to a vector, and condition number one means that an exact reflection preserves the Euclidean norm of a perturbation vector.
-
is symmetric:
-
is an orthogonal matrix:
-
reflects across the hyperplane perpendicular to
Householder Procedure
Let satisfy and . Each Householder step zeros the entries below one diagonal position while leaving the zeros created by earlier steps unchanged.
Start with . Reflect its first column onto a multiple of the first coordinate vector:
Iterative Transformation Process
With , the first column below the diagonal becomes zero:
In the matrix , and .
Apply the next reflector only to the remaining lower-right submatrix:
Embed the second reflector in the lower-right block of the identity matrix:
The second column below the diagonal then becomes zero:
Here and . Repeating the same operation leaves the final active column
After the last reflection, the transformed matrix is upper triangular:
Because each reflector is orthogonal and symmetric, their product gives
The matrix is orthogonal because it is a product of orthogonal reflectors.
Householder Algorithm
Initialize the active matrix and accumulated orthogonal factor:
At step , take the active part of column :
Compute its norm, choose a sign that avoids cancellation, and form the Householder vector:
The corresponding scale factor is
The normalized vector and the full reflector are
Update the active matrix and the accumulated factor without forming an extra dense product:
After steps,
Numerical Aspects and Householder Complexity
Implementing the decomposition in floating-point arithmetic raises two practical questions, how many operations it costs and how the rounding error behaves. Both answers decide whether the method fits the problem: the operation count sets the run time for a large matrix, and the rounding behavior decides how much of the computed result you can trust.
Computational Complexity
The count below stores implicitly as reflectors and computes . Explicitly constructing a full matrix costs additional work.
For , a decomposition with Householder reflectors requires approximately:
The approximate number of floating-point operations when is:
Numerical Properties
Orthogonal multiplication preserves singular values, so for a full-column-rank matrix.
At step , the new diagonal entry is . Choose the sign below while computing the reflector to avoid subtracting nearly equal numbers:
After the factorization, matching signs in one column of and one row of can be flipped to make the diagonal of positive. If , the matrix lacks full column rank and this uniqueness condition no longer applies. A column-pivoted, rank-revealing decomposition is more informative when numerical rank matters.
A compact implementation rescales the Householder vector so its first active entry is 1. Its remaining entries fit below the diagonal of the working matrix, while a separate scalar stores the reflector strength. The diagonal and upper triangle retain . Apply the stored reflectors without constructing explicitly.
The reduced factorization keeps the first columns of and the first rows of .