Skip to content

QR Decomposition

An exact matrix factorization into an orthogonal or unitary coordinate factor and an upper-triangular or trapezoidal coefficient factor.

Version
v1 · 2026-10-03 · History
Domain-specific #
13537
Domain group
Formal Sciences
Origin domain
Mathematics
Subdomain
Numerical Linear Algebra → Mathematics
Aliases
Qr Factorization

Core Idea

QR decomposition writes a matrix as \(A=QR\), separating an orthogonal or unitary coordinate frame \(Q\) from an upper-triangular coefficient factor \(R\). For a real tall matrix, a full form uses square orthogonal \(Q\) and a zero-padded triangular factor; an economy form keeps only the needed orthonormal columns. Multiplication reconstructs \(A\) exactly in algebra.[1]

The identity is not one algorithm. Gram–Schmidt and Householder methods can construct QR with different numerical properties. A rank-deficient matrix can still have QR, but the familiar nonsingular backsolve and positive-diagonal uniqueness claims require explicit full-rank assumptions.[2][3]

How would you explain it like I'm…

Neat Directions and How-Far Lists

Imagine describing where toys are in a room. First you pick a neat set of straight, square-cornered directions, like 'along the wall' and 'up.' Then you write how far each toy goes along each direction. QR Decomposition does this for a grid of numbers: one part is the neat directions, the other part is the 'how far' list.

Right-Angle Split

A matrix is a grid of numbers, and its columns can be thought of as arrows. QR Decomposition writes the matrix as Q times R. Q is a set of arrows that are all length one and all at right angles to each other, like the edges of a perfect box corner. R is a triangle-shaped grid of numbers that tells how to build each original arrow out of Q's arrows, using only the first few each time. There are several ways to compute it, and some are more careful about rounding errors than others.

Orthogonal-Triangular Factorization

QR Decomposition writes a matrix A as the product QR. The columns of Q are orthonormal: each has length 1 and all are perpendicular, so Q preserves lengths and angles. R is upper triangular (all zeros below the diagonal), recording how each original column is built from the first few Q directions. For a tall matrix there is a full form, with a square Q and R padded by zeros, and an economy form that keeps only as many Q columns as A has columns. The decomposition is a way of representing the matrix, not one particular recipe — methods like Gram–Schmidt or Householder reflections compute it with different numerical reliability. It even exists when the columns of A are dependent, but nice properties like a unique answer need extra conditions.

 

QR Decomposition represents a matrix A as A = QR, where Q has orthonormal columns (or is a square orthogonal/unitary matrix in the full form) and R is upper triangular or upper trapezoidal depending on shape. For a real m×n matrix with m ≥ n, the full form is A = Q[R; 0] with Q m×m orthogonal and R n×n upper triangular, while the economy form keeps only the first n columns of Q. The two factors do different jobs: Q gives a length-preserving coordinate frame, and R records the coordinates of the original columns in that frame. It is a formal representation rather than a single algorithm: Gram–Schmidt, Householder transformations and other methods produce QR forms with different numerical behavior. A QR factorization exists even for rank-deficient A, but a nonsingular triangular solve and uniqueness under a positive-diagonal convention require stronger assumptions — the standard uniqueness theorem covers square invertible matrices with positive diagonal in R.

Scope of Application

In full-column-rank least squares, \(Q\) preserves residual norm and \(R\) yields a triangular solve. In eigenvalue computation, QR-based iterations on Hessenberg matrices are steps toward Schur form. These are distinct uses of the factorization, not competing definitions of it. Complex matrices use unitary rather than real orthogonal geometry.[1][4]

Clarity

QR makes the difference between a column-space frame and coordinates within that frame explicit. It also separates “the matrix has a QR representation” from “a particular least-squares solution is unique.” The latter needs rank, and a whole QR eigenvalue algorithm needs iteration beyond one product identity.[1][4]

Manages Complexity

The dense matrix becomes two structured factors: norm-preserving \(Q\) and ordered triangular \(R\). This turns a qualifying least-squares problem into coordinate separation plus back-substitution. Yet numerical construction still matters: Householder QR is more reliable than classical Gram–Schmidt in the cited Cornell comparison, and the normal-equation alternative squares the condition number of \(A\).[1][2]

Abstract Reasoning

Because orthogonal \(Q\) preserves the 2-norm, minimizing \(\lVert Ax-b\rVert_2\) can be recast in \(Q\) coordinates. When \(A\) has full column rank, the fitted component gives an invertible triangular equation in \(R\); the complementary coordinates describe the residual. If rank fails, do not infer that same unique backsolve merely from the presence of QR.[1]

Knowledge Transfer

The same orthogonal–triangular roles transfer literally from least-squares matrices to matrices encountered in eigenvalue iteration, while the downstream objective changes. More broadly, QR instantiates live prime Decomposition's recoverable-whole pattern. Live Factorization is a neighbor, but its same-type and irreducible-factor commitments do not strictly describe every rectangular QR.

Relationships to Other Abstractions

Local relationship map for QR DecompositionParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.QR DecompositionDOMAINPrime abstraction: Decomposition — is a kind ofDecompositionPRIME

Current abstraction QR Decomposition Domain-specific

Parents (1) — outgoing typed relations

  • QR Decomposition is a kind of Decomposition Prime

    QR decomposes a matrix into exactly recombinable orthogonal/unitary and triangular factors.

Hierarchy path (1) — routes to 1 parentless root

Neighborhood in Abstraction Space

QR Decomposition sits in a moderately populated region (57th percentile for distinctiveness): it has near-neighbors but no dense thicket of look-alikes.

Family — Codes, Matrices & Combinatorial Problems (33 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-11-14

References

[1] E. Anderson et al., LAPACK Users' Guide, 3rd ed. (1999), QR Factorization. ↩a ↩b ↩c ↩d ↩e

[2] Cornell University CS 4220/5223 numerical methods review, §5.3, PDF p. 26. registry ↩a ↩b

[3] MIT 18.700 Lesson Plan 19, Theorem 10. ↩

[4] E. Anderson et al., LAPACK Users' Guide, Eigenvalue Problems. registry ↩a ↩b

[5] Encyclopedia of Abstractions, live prime_abstractions/v2/decomposition.md, inspected 2026-10-01. registry

[6] Encyclopedia of Abstractions, live prime_abstractions/v2/factorization.md, inspected 2026-10-01. registry