A reflection cannot stop being one
Look again at the flat line.
Every other quantity here degrades as the problem gets harder. Forward errors rise with κ, loss of orthogonality in Gram–Schmidt rises with κ or κ², approximation errors rise, rank decisions get harder. The Householder line is flat, and the flatness is not a matter of the method being better by a large factor. It is a different kind of thing, and the reason is worth understanding because it generalises far beyond this algorithm.
The construction
Each step of Householder QR takes a column x and reflects it onto a multiple of the first coordinate axis. The reflector is
H = I − 2vvᵀ, where v = (x − αe₁) / ‖x − αe₁‖ and α = ±‖x‖.
v is a unit vector by construction — it is divided by its own norm — and H is the matrix that reflects space in the hyperplane perpendicular to it.
The structural argument
Now the point.
Suppose the arithmetic rounds while computing v. What comes out is v̂, a slightly different vector, and — after the normalisation, which is also rounded — a vector of length 1 ± u.
The matrix I − 2v̂v̂ᵀ is exactly a reflection, for whatever v̂ the rounding produced. It reflects in the hyperplane perpendicular to v̂ rather than the one perpendicular to v, which is a slightly different plane, but it is still a reflection: still orthogonal, still norm-preserving, still an involution.
The rounding perturbed which orthogonal transformation was applied. It did not perturb the orthogonality, because orthogonality is not something the arithmetic computes — it is a property of the form I − 2vvᵀ, and that form survives having its v rounded.
Compare Gram–Schmidt. Its Q is assembled by subtraction and division, entry by entry, and nothing about the assembly enforces the property. When the subtractions are inaccurate, the result is a matrix, and there is no structure to fall back on. Its orthogonality is achieved, and it can therefore fail to be achieved.
Achieved against enforced
That distinction is the transferable lesson, and it is worth stating outside the subject.
An invariant maintained by a representation survives perturbation. An invariant maintained by computation does not.
Store a rotation as an angle and it is a rotation no matter what the arithmetic does to the angle. Store it as a 2×2 matrix and repeated multiplication drifts it away from being orthogonal, which is why graphics and robotics code re-orthonormalises rotation matrices periodically, and why quaternions are popular: a normalised quaternion is a rotation by construction.
The same idea explains why the algorithms on this site are made of orthogonal steps rather than inverses. An orthogonal step has κ = 1 and therefore amplifies nothing, and it cannot cease to be orthogonal. Two properties, both structural, and together they are most of what makes an algorithm stable.
The sign, which is the one place it can go wrong
There are two choices of α — plus or minus ‖x‖ — and they differ only in which of the two directions along the axis x is reflected onto. Mathematically it does not matter.
Numerically one of them is a cancellation. If x already points mostly along e₁ with x₁ > 0, choosing α = +‖x‖ makes the first component of v equal to x₁ − ‖x‖, a difference of two nearly equal positive numbers. The direction that defines the reflection is then computed from cancelled digits, and every operation afterwards inherits it — cancellation takes the answer is the mechanism.
Choosing α with the opposite sign to x₁ makes it a sum. Nothing cancels. The figure at the top of this essay reports what the unsafe choice would cost on that particular vector: v would come out at a small fraction of the size of its operands, and the digits would be gone.
The fix is one sign flip and it is in every serious implementation. It is in almost no derivation, because the derivation is correct either way, which is the recurring shape of identical algebra, different arithmetic.
What Householder costs
For an m×n matrix with m ≥ n, Householder QR costs about 2mn² − 2n³/3 operations, which for a square matrix is 4n³/3 — roughly twice Gaussian elimination and about twice Gram–Schmidt.
That factor of two is the price of orthogonality that does not depend on the matrix, and for a dense factorisation it is worth paying without thinking about it. Two situations complicate the choice.
Q is often not needed explicitly. The reflectors are stored as their v vectors, and applying Q or Qᵀ to something costs O(mn) per vector without ever forming the matrix. LAPACK returns the reflectors, not Q, for exactly this reason. If Q is formed explicitly the extra cost is real and frequently unnecessary.
Column-at-a-time access. Krylov methods generate their basis vectors one at a time and cannot factorise a matrix they do not yet have. Householder does not fit that pattern, which is why Gram–Schmidt with re-orthogonalisation survives there.
For everything else — a least-squares fit, a rank decision, an explicit orthonormal basis — Householder is the answer and the choice is not interesting.
Givens rotations, briefly
The other orthogonal building block deserves a mention because it shares the structural property and is used where reflections are clumsy.
A Givens rotation acts on two coordinates at a time, zeroing one entry with a plane rotation built from a cosine and a sine satisfying c² + s² = 1. Like a reflection, it is orthogonal by construction: round c and s, renormalise, and what remains is still exactly a rotation of a slightly different angle.
Rotations cost more than reflections for a dense factorisation — they zero one entry at a time rather than a whole column — and they win where the matrix is sparse or already nearly triangular, because they touch only two rows. Updating a QR factorisation when a row is added, which is the standard move in recursive least squares, is a sequence of Givens rotations.
Both are instances of the same idea, and the idea is the reason this field exists as a separate part of the site: orthogonal transformations are the only ones that can be applied repeatedly without watching the error.
What is asserted here
The figure’s claims are checked as it is drawn, and each is a measurement with a tolerance bracketed rather than a round number chosen.
The reflection preserves length: ‖Hx‖ equals ‖x‖ to 10⁻¹³, checked as two routes to the same number rather than as an inequality. It lands the vector on the axis: the second component of the image is below 10⁻¹³. It is orthogonal: ‖HᵀH − I‖ below 10⁻¹⁵.
And it is an involution: HH must be the identity to 10⁻¹⁴. That is the second route, and it is the one that would catch a sign error in the construction of the reflector — a wrong sign gives a matrix that is still orthogonal and still norm-preserving and is not a reflection, so the first three checks would all pass.
The cancellation claim is a measurement too: the unsafe sign is computed, and the size of the resulting v relative to what it would be with the safe sign is required to show real cancellation. The essay does not warn about it; the build measures it.
Across the loss curve, Householder’s ‖QᵀQ − I‖ is required to stay below a bound proportional to the unit roundoff and the matrix size at every condition number, which is the flat line as an assertion. If it ever rose with κ — which is what a subtle bug in the reflector application would cause — the build would stop, and the essay’s central claim would be the thing that caught it.
The cost accounting, in full
It is worth being precise about the arithmetic, because “Householder costs twice as much” is repeated without the qualifications that make it decision-relevant.
For an m×n matrix with m ≥ n, factorising costs about 2mn² − 2n³/3 flops. Classical or modified Gram–Schmidt costs about 2mn². For a square matrix that is 4n³/3 against 2n³, so Householder is cheaper — the “twice as expensive” folklore comes from the case where Q is formed explicitly, which costs a further 2mn² − 2n³/3 and is usually unnecessary.
The reflectors are stored as their v vectors, in the space the zeroed entries of A vacated, and
applying Q or Qᵀ to a vector costs O(mn) by applying the reflectors in sequence. LAPACK returns them
in that form for exactly this reason, and code that calls orgqr to materialise Q is frequently
spending more than the factorisation cost on something it will only use to multiply.
So the honest summary: Householder is not more expensive than Gram–Schmidt for a dense factorisation, it is more expensive than a Gram–Schmidt that also produces Q explicitly, and it is the wrong shape for algorithms that generate their columns one at a time.
Why the same argument applies to rotations
The structural property is not special to reflections, and the second orthogonal building block shows why the argument is about form rather than about a particular matrix.
A Givens rotation is built from a cosine and a sine with c² + s² = 1. Round c and s, renormalise, and what remains is exactly a rotation through a slightly different angle. Same guarantee, same reason: the property is enforced by the parameterisation rather than achieved by the arithmetic.
Rotations zero one entry at a time rather than a whole column, which makes them more expensive for a dense factorisation and cheaper for a sparse or nearly-triangular one, since they touch only two rows. That is why the QR algorithm for eigenvalues uses rotations on a Hessenberg matrix, and why updating a factorisation after a new row arrives — the standard move in recursive least squares — is a sequence of Givens rotations rather than a refactorisation.
The Jacobi methods used throughout this site are the same object again: each sweep is a sequence of plane rotations, so the accumulated eigenvector matrix cannot drift away from orthogonality. Symmetry is worth more than precision reports ‖VᵀV − I‖ = 10⁻¹⁵ for the Hilbert matrix’s eigenvectors, and that number is flat for the same structural reason the Householder line is flat.
What “structural” buys elsewhere
The general lesson is worth taking out of the subject, because it applies wherever a computation must preserve a property.
Represent a rotation as three angles and it is a rotation no matter what happens to the angles. Represent it as a 3×3 matrix and repeated composition drifts, which is why graphics and robotics code re-orthonormalises periodically and why unit quaternions are popular — a normalised quaternion is a rotation by construction, and normalising is one division.
Represent a probability distribution as unnormalised weights plus a normalisation step and it sums to one exactly, every time. Represent it as numbers that are supposed to sum to one and it drifts.
Represent a symmetric matrix by its upper triangle and it is symmetric. Store all n² entries and
compute with them, and the asymmetry that rounding introduces is enough to make a symmetric
eigensolver refuse — which is exactly the precondition this site’s Jacobi routine enforces, and
exactly why (A + Aᵀ)/2 appears in careful code.
In each case the pattern is the same: choose a representation in which the invariant cannot be violated, and the arithmetic can be as sloppy as it likes.
Where this leaves the field
Three essays on orthogonality, and a single practical conclusion.
Orthogonal is a number established that the property is a measurement, that it can be badly violated by a factorisation that reconstructs its matrix perfectly, and that unit columns are not perpendicular columns. Two Gram–Schmidts established that one word of difference produces eight orders of magnitude, and that the R factors agree while the Q factors do not. This essay establishes why one method escapes the problem entirely.
The conclusion: use Householder for dense factorisations, use modified Gram–Schmidt with re-orthogonalisation where the access pattern requires it, and measure ‖QᵀQ − I‖ either way. The first two are free. The third costs a matrix product and is the only thing that would reveal whether either had gone wrong.
Which is the honest summary of the trade. Elimination is a sequence of choices is faster and relies on an observation; orthogonal is a number measures what the alternative buys; and the projection and the right angle is where the guarantee is actually spent.
What this does not protect against
Being precise about the guarantee, because “orthogonality is structural” can be over-read.
Householder QR is backward stable: the computed Q and R satisfy QR = A + E with ‖E‖ at the level of rounding, and the computed Q is within rounding of an exactly orthogonal matrix. Both of those are theorems.
Neither says the factorisation is accurate in the sense of being close to the exact QR of A. For an ill-conditioned matrix the exact R and the computed R can differ substantially, because R inherits the conditioning of A — and it must, since R and A have the same singular values. What is guaranteed is that the computed pair factorises something very close to A, which is the strongest statement available and is not the same statement.
The distinction is exactly the one the exact answer to a nearby problem sets up, applied to a factorisation rather than a solution. The structural argument in this essay is about one factor’s orthogonality; the conditioning of the problem still governs how much the factors themselves can be trusted, and orthogonal steps guarantee only that the algorithm adds nothing to it.
That is worth saying because the flat line in the first figure invites the opposite conclusion. It says the method does not degrade. It does not say the answer improves.