Orthogonality, measured

The basis nobody chose on purpose

A method that eliminates a constraint has to pick a basis for its null space, and every basis is correct. Their condition numbers are eight orders apart, the reduced problem inherits the square, and the choice is usually made by a one-line rule nobody thought of as a numerical decision.

Worth reading first: Orthogonal is a number · The zero that is not a missing entry.

The null-space method turns a constrained problem of size n + m into an unconstrained one of size n − m: write x = x_p + Zv with Ax_p = g and AZ = 0, and solve the reduced system ZᵀHZ. The essay that set it up measured its condition number as 21.13 and observed that it did not move while κ(A) crossed four decades.

Nothing in that derivation says which Z, and the set of legal answers is enormous. Any Z whose columns are independent and annihilated by A will do, every one gives the same x in exact arithmetic, and their condition numbers are decades apart.

Three bases for the same null space, at 10 unknowns and 4 constraintsThe same constrained problem solved three times, differing only in which basis Z is used for the null space of A. The orthonormal basis, from a QR of Aᵀ, has κ(Z) = 1 exactly and is dense — 100 per cent of its entries are nonzero. The fundamental basis built on the first 4 columns has κ(Z) = 1.994·10⁸, and its reduced Hessian comes out at 3.801·10¹⁶, which is κ(Z)² to within a factor of 0.956 — the square attained rather than bounded. Its answer is wrong by 0.05179, against 1.07·10⁻¹⁵ for the orthonormal one. Choosing the same kind of basis by pivoting instead gives κ(Z) = 2.06, an error of 6.71·10⁻¹⁶, and the same 50 per cent density: all of the sparsity and none of the loss.κ(A) = 10⁶ throughout · κ(H) = 100 · the answer is the same answer for every basisorthonormal — κ(Z)1κ(ZᵀHZ)25.6relative error1.07·10⁻¹⁵first m basic — κ(Z)1.99·10⁸κ(ZᵀHZ)3.8·10¹⁶relative error0.0518pivoted basic — κ(Z)2.06κ(ZᵀHZ)31.9relative error6.71·10⁻¹⁶what the choice costsdensity, orthonormal1density, fundamental0.5κ(ZᵀHZ) ÷ κ(Z)², naive0.96error, pivoted choice6.7·10⁻¹⁶every one of them is a basisand one of them loses fourteen digits
Fig. 1 Three bases for one null space of one matrix. The answer is the same answer for all three.

The square that was quietly set to one

The identity is

κ(ZᵀHZ) ≤ κ(H) · κ(Z)²

with the square arriving for the reason it arrives in the normal equations: ZᵀHZ is a Gram matrix in the H-inner product, and a Gram matrix’s condition number is the square of its factor’s.

The previous essay’s flat line was that identity with κ(Z) = 1, because the basis it used came from a QR of Aᵀ and had orthonormal columns by construction. So the flat line was true and it was also a choice, and the choice was made inside a routine rather than by anybody looking at the problem.

Set κ(Z) to 10⁸ and the bound says 10¹⁶. The measurement says 3.80·10¹⁶ against a κ(Z)² of 3.96·10¹⁶ — the square attained to two digits, on a matrix H whose own condition number is 100. The bound is not a bound here; it is the answer.

The reduced Hessian and the answer, against how badly the basic columns were chosenγ is the condition number of the first 4 columns of A, and the naive rule calls exactly those columns basic. Its reduced Hessian's condition number climbs from 83.77 to 4.871·10¹⁸ across ten decades of γ — the square, because κ(ZᵀHZ) ≤ κ(H)κ(Z)² and the bound is attained. Choosing the basic columns by a column-pivoted QR instead holds it between 31.72 and 43.09 at every stop. The two forward errors, measured against a BigInt answer, follow their own condition numbers: 0.3173 against 8.07·10⁻¹⁶ at γ = 10¹⁰. κ(A) is 10⁶ throughout and never moves — nothing about the problem's difficulty changes across this axis, only which columns a one-line rule happens to pick.024681010⁻¹⁷10⁻¹³10⁻⁹10⁻⁵10⁻¹10³10⁷10¹¹10¹⁵10¹⁹log₁₀ γ — conditioning of the first m columnscondition number, and relative errorκ(ZᵀHZ), naiveκ(ZᵀHZ), pivotederror, naiveerror, orthonormalone problem, two rulesκ(ZᵀHZ) naive, γ = 10¹⁰4.9·10¹⁸κ(ZᵀHZ) pivoted, worst43error, naive0.32error, pivoted8.1·10⁻¹⁶κ(A) does not move across this axisand the answer moves by fourteen digits
Fig. 2 The same square as a slope: κ(ZᵀHZ) rising as γ², and the pivoted rule’s line flat beneath it.

The two bases, and what each is for

Orthonormal. Take a full QR of Aᵀ. The first m columns of Q span the row space of A and the last n − m span its null space, with κ(Z) = 1 exactly. That is the basis with no numerical question attached, and its price is density: Z is n × (n − m) with essentially every entry nonzero — measured at 100 per cent — even when A was sparse. On a problem where A is a few constraint rows across a large sparse stiffness matrix, Z is the largest object in the computation.

Fundamental. Split the columns of A into m basic and n − m nonbasic, so that A = [A_B A_N] after a permutation, and write

Z = [ −A_B⁻¹ A_N ] [ I ]

with the rows put back in order. The identity block is free, the other block is as sparse as A_B⁻¹A_N, and there is no orthogonalisation anywhere. Measured density: 50 per cent, half the orthonormal one’s.

The second is what a large-scale optimisation code uses, and it is what a simplex-based method produces for nothing, because the basic/nonbasic split is the simplex basis. Its condition number is a property of A_B, and A_B is chosen by whatever rule the code was using for other reasons.

Three bases for the same null space, at 10 unknowns and 4 constraintsThe same constrained problem solved three times, differing only in which basis Z is used for the null space of A. The orthonormal basis, from a QR of Aᵀ, has κ(Z) = 1 exactly and is dense — 100 per cent of its entries are nonzero. The fundamental basis built on the first 4 columns has κ(Z) = 4.436, and its reduced Hessian comes out at 83.77, which is κ(Z)² to within a factor of 4.26 — the square attained rather than bounded. Its answer is wrong by 1.26·10⁻¹⁵, against 1.29·10⁻¹⁵ for the orthonormal one. Choosing the same kind of basis by pivoting instead gives κ(Z) = 2.258, an error of 1.41·10⁻¹⁵, and the same 50 per cent density: all of the sparsity and none of the loss.κ(A) = 10⁶ throughout · κ(H) = 100 · the answer is the same answer for every basisorthonormal — κ(Z)1κ(ZᵀHZ)32relative error1.29·10⁻¹⁵first m basic — κ(Z)4.44κ(ZᵀHZ)83.8relative error1.26·10⁻¹⁵pivoted basic — κ(Z)2.26κ(ZᵀHZ)43.1relative error1.41·10⁻¹⁵what the choice costsdensity, orthonormal1density, fundamental0.5κ(ZᵀHZ) ÷ κ(Z)², naive4.3error, pivoted choice1.4·10⁻¹⁵every one of them is a basisand one of them loses fourteen digits
Fig. 3 On a constraint whose first m columns happen to be a good basis, where all three agree to the rounding level. This is the control.

Where the experiment had to be built rather than found

The measurement needs a matrix on which the naive choice is bad and the matrix is fine, because otherwise the two explanations — a hard problem, and a badly made basis — cannot be separated.

A constraint matrix built as UΣVᵀ from random orthogonal factors cannot supply one. Its columns come from a random orthogonal V, so every subset of m of them is about as well conditioned as every other, and the naive rule is accidentally safe: measured κ(A_B) of 7.97·10⁵ for the first m columns against 1.02·10⁶ for the pivoted choice, which is no separation at all.

So the family is constructed: A = [B | N] with κ(B) = γ chosen and N well conditioned. The variable ordering is the problem’s rather than the solver’s, and a problem that lists its near-duplicate variables first is not exotic — it is what a model built up in blocks looks like, and it is what a mesh numbered by subdomain looks like.

That construction is the honest part of the page. The finding is not that the naive rule is always bad; it is that nothing stops it being arbitrarily bad, and that when it is, nothing in the problem’s own condition numbers says so.

The reduced Hessian and the answer, against how badly the basic columns were chosenγ is the condition number of the first 2 columns of A, and the naive rule calls exactly those columns basic. Its reduced Hessian's condition number climbs from 148.6 to 2.711·10¹⁹ across ten decades of γ — the square, because κ(ZᵀHZ) ≤ κ(H)κ(Z)² and the bound is attained. Choosing the basic columns by a column-pivoted QR instead holds it between 64.71 and 75.33 at every stop. The two forward errors, measured against a BigInt answer, follow their own condition numbers: 0.8965 against 2.01·10⁻¹⁵ at γ = 10¹⁰. κ(A) is 10⁶ throughout and never moves — nothing about the problem's difficulty changes across this axis, only which columns a one-line rule happens to pick.024681010⁻¹⁷10⁻¹³10⁻⁹10⁻⁵10⁻¹10³10⁷10¹¹10¹⁵10¹⁹log₁₀ γ — conditioning of the first m columnscondition number, and relative errorκ(ZᵀHZ), naiveκ(ZᵀHZ), pivotederror, naiveerror, orthonormalone problem, two rulesκ(ZᵀHZ) naive, γ = 10¹⁰2.7·10¹⁹κ(ZᵀHZ) pivoted, worst75error, naive0.9error, pivoted2·10⁻¹⁵κ(A) does not move across this axisand the answer moves by fourteen digits
Fig. 4 With two constraints, where the naive basis is a 2 × 2 inverse and the same slope of two appears.

The repair is pivoting, not orthogonalisation

The obvious fix is to orthogonalise the fundamental basis, which costs a QR of an n × (n − m) matrix and gives back the density that was the reason for using it.

The cheaper fix is to choose the basic columns differently. Run a column-pivoted QR of A and take the m columns it selects: that is the greedy rule that maximises the residual norm at each step, it costs O(m²n), and it is what the rank-revealing factorisation already does for a different purpose.

Measured on the same problem at γ = 10⁸:

rule κ(Z) κ(ZᵀHZ) density error orthonormal 1.00 25.6 1.00 1.1·10⁻¹⁵ first m basic 1.99·10⁸ 3.80·10¹⁶ 0.50 5.2·10⁻² pivoted basic 2.06 31.9 0.50 6.7·10⁻¹⁶

The pivoted fundamental basis has the orthonormal one’s conditioning to within a factor of 1.25 and the naive one’s sparsity exactly. All of the sparsity and none of the loss, for one greedy pass over A.

Singular values of a rank-4 matrix with noise of relative size 10⁻⁸Ten singular values on a logarithmic axis. The first four sit near one; the rest sit at the noise level, and the vertical distance between the two groups is the evidence for the rank.1234567891010⁻¹⁸10⁻¹⁵10⁻¹²10⁻⁹10⁻⁶10⁻³1indexsingular valuecutoff, σ₁ · 10⁻¹⁰numerical rank 10gap 8.2·10⁶an opiniontrue rank 410×10, built with 4 nonzero valuesrank is a decision
Fig. 5 The column-pivoted QR in the job it is usually given, from the spectra field.

What the basic set is, when nobody chose it

The measurement above treats “which columns are basic” as a decision, and in most codes it is not made as one. It is inherited.

In a simplex-based method the basic set is the simplex basis, chosen by a pricing rule for reasons that are about the optimisation and not about conditioning at all. In a reduced-gradient method it is whichever variables are away from their bounds. In a finite-element code with multipoint constraints it is often the first variable each constraint mentions, because that is what the assembly loop reached first. None of those rules has any reason to produce a well conditioned A_B, and none of them reports κ(A_B).

The consequence is that the number this page is about — κ(Z), the quantity that decides how many digits the answer keeps — is set by a subroutine chosen for a different purpose. That is a recognisable shape on this site: the ordering that decides a factorisation’s memory is chosen by a graph heuristic that knows nothing about the values, and the tolerance that decides a rank is often a default nobody set.

What is different here is that a fix is cheap and local. Computing κ(A_B) costs an estimate; if it is large, one column-pivoted pass supplies a better basic set. The measurement’s value is that it says how large “large” has to be before it matters, and the answer is around 10⁸ for a five-per-cent error in double precision — which is √(1/u), for the same reason it always is.

How close Hager's estimate is to the true κ₁, over 200 seeded 8×8 matricesFive bars. The estimate is exactly the true condition number on 81% of the sample and inside ten per cent on 87%; the worst underestimate in the whole sample returns 38% of the truth. The last bar is the matrix built to defeat it, at 7.7%, well below anything the random sample reached.each bar is a percentage — of the sample, or of the true condition numberexactly right80.5%inside 10%87.0%inside a factor of 287.0%worst in the sample, ×10037.7%the constructed matrix, ×1007.7%usually exactexact share0.81worst of the sample0.38the constructed matrix0.077a routine that is right most of the timeand never wrong in the safe direction
Fig. 6 The estimate that would say so, from the error field, and the matrix on which it under-reports.

What five per cent means here

The naive basis’s forward error is 5.2·10⁻², measured against a solution computed in BigInt rationals from the same stored matrices. That is not a loss of precision in the usual sense — it is an answer wrong in its first significant figure.

And nothing about the computation announces it. The constraint is satisfied: Ax = g holds to the rounding level for every basis, because x_p was built to satisfy it and Z annihilates A exactly. The reduced system was solved by a Cholesky that completed without complaint, because ZᵀHZ really is positive definite. The residual of the reduced system is small. Every check a code would run passes.

The only quantity that says anything is κ(ZᵀHZ), and it is a number a code computes only if somebody asks it to. This is the same shape as the classical Gram–Schmidt failure, where the reconstruction ‖A − QR‖ stays at 10⁻¹⁶ while ‖QᵀQ − I‖ reaches one: the quantity that is wrong is not the quantity anybody looks at.

QᵀQ from classical Gram–Schmidt and from Householder on the 8×8 Hilbert matrixTwo eight-by-eight tables of QᵀQ. The upper one has ones on the diagonal and entries as large as one off it; the lower one is the identity to three decimal places everywhere.A = H8 · κ = 1.5·10¹⁰ · both factorisations reconstruct A to 6·10⁻¹⁷the diagonal is 1 in both — every column is a unit vector either way1.000000000001.000000000001.000000000001.000000000001.00000.002-0.002000001.0000.125-0.13300000.0020.1251.000-1.0000000-0.002-0.133-1.0001.000classical Gram–Schmidt1.000000000001.000000000001.000000000001.000000000001.000000000001.000000000001.000000000001.000Householderclassical ‖QᵀQ − I‖1.4Householder ‖QᵀQ − I‖1.4·10⁻¹⁵largest off-diagonal 1 against 3.1·10⁻¹⁶length is not angle
Fig. 7 The measurement that does say something, in the field that made it a number.

Why it is invisible to the constraint’s own conditioning

κ(A) is 10⁶ at every point of the sweep. It does not move. The badness being measured is not in A; it is in a choice made about A, and no norm of A can see it.

That is worth separating from the second essay in the constraint field, where the range-space method’s error grew because κ(A) grew. There the problem got harder. Here the problem is fixed and the method’s internal decision is what moves.

The distinction is the site’s spine with a third author in it. Backward error is what the algorithm did; the condition number is what the problem did with it; and this is neither — it is what a reformulation did, and the reformulation was exact. Two essays here have now found the same author, and the other one is the elimination that squares.

What each way of eliminating a constraint inherits, over five decades of κ(A)The same system solved twice, at 8 unknowns and 3 constraints with κ(H) = 100. The range-space method forms S = AH⁻¹Aᵀ and inherits κ(S), which rises from 12.99 to 3.981·10¹⁰ — the square of κ(A), for the reason the normal equations square it. The null-space method solves with the reduced Hessian ZᵀHZ, whose condition number is 21.13 at the start of the sweep and 21.13 at the end: it does not contain κ(A) at all. The two forward errors, measured against a solution computed in BigInt rationals, follow their own condition numbers: 5.314·10⁻⁶ against 5.788·10⁻¹² at the far end. Both methods are correct and one of them is usable.01234510⁻¹⁷10⁻¹³10⁻⁹10⁻⁵10⁻¹10³10⁷10¹¹log₁₀ κ(A)condition number, and relative errorκ(S)κ(ZᵀHZ)range-space errornull-space erroragainst a BigInt answerκ(S) at κ(A) = 10⁵4·10¹⁰κ(ZᵀHZ), all stops21range-space forward error5.3·10⁻⁶null-space forward error5.8·10⁻¹²both are the same algebraand only one squares
Fig. 8 The other reformulation with the same signature, from the constraint field.

What the theorem of the constraint preconditioner says about all this

There is an apparent contradiction with the fourth essay in the constraint field, which states that the preconditioned spectrum is the generalised eigenvalues of the pencil (ZᵀHZ, ZᵀGZ) for any Z. If the basis matters as much as this page says, how can that be basis-free?

Because a generalised eigenvalue is invariant under congruence. Replacing Z by ZM sends both matrices of the pencil to Mᵀ(·)M, and det(MᵀXM − λMᵀYM) = det(M)²det(X − λY): the characteristic polynomial is scaled and its roots are not moved. Any two bases for one null space differ by such an M.

So the exact spectrum is basis-free and the computed one is not, and everything this page measures lives in the gap between those two sentences. That gap is the site’s whole subject, and it is unusually explicit here: an invariant that is invariant in the algebra and moves by eight orders in the arithmetic.

The constraint preconditioner's spectrum, over six decades of the constraint's condition numberP = [[G, Aᵀ], [A, 0]] with G an approximation to H — here a well-conditioned matrix that is not H at all. The theorem says P⁻¹K has eigenvalue 1 with multiplicity 2m = 8 and n − m = 6 others, which are the generalised eigenvalues of the pencil (ZᵀHZ, ZᵀGZ) for any basis Z of the null space of A. A does not appear in that list, and the measurement is the flat lines: κ(A) crosses six decades along the horizontal axis and the 6 eigenvalues move by 7.14·10⁻⁶ relative, which is the arithmetic. A preconditioner for a constrained problem can decline to know anything about the constraint, because the constraint has already been inverted exactly inside it. The one quantity that does move is the drift of the eigenvalues the theorem puts at exactly one: 6.65·10⁻⁹ at κ(A) = 1 and 6.04·10⁻⁵ at 10⁶, which is κ(A) times the unit roundoff.012345610⁻³10⁻²10⁻¹110¹log₁₀ κ(A)eigenvalue of P⁻¹Kthe constraint is not in itnontrivial6at one8movement, six decades7.1·10⁻⁶drift at one6·10⁻⁵2m at onethe marks are a pencil that never saw Aand the lines are the preconditioned matrix
Fig. 9 The invariant, computed with the good basis — where it agrees with the other route to six digits.

The sparsity that is being defended

It is worth putting a number on what the fundamental basis is for, since the page has spent most of its length on its failure mode.

The orthonormal Z from a QR of Aᵀ has n(n − m) entries and essentially all of them are nonzero. The fundamental basis has an (n − m) × (n − m) identity plus an m × (n − m) block, so its nonzero count is (n − m)(m + 1) at worst and much less when A_B⁻¹A_N is itself sparse — which it is whenever the constraints are local, as they are for a mesh, a network or a set of multipoint ties.

On the figure’s small problem that is 0.50 against 1.00 in density, which is a factor of two. On a problem with n = 10⁵ and m = 10³ it is the difference between an object of 10⁸ entries and one of 10⁶, and the second is the only one anybody can hold. The reduced Hessian inherits the same distinction: ZᵀHZ formed from a dense Z is dense, and formed from a local Z keeps a banded structure that a sparse Cholesky can exploit.

So the naive rule is not a mistake to be replaced by the orthonormal basis. It is the right family of basis, chosen badly, and the repair is inside the family.

The 12×12 grid Laplacian and its Cholesky factor, ordered by naturalTwo square sparsity plots side by side. The left shows the nonzeros of the matrix; the right shows the nonzeros of its Cholesky factor, with the entries created by elimination marked in a second colour.the matrix, lower triangle408 entriesits Cholesky factor1739 entries · 1331 created‖A − LLᵀ‖/‖A‖1.4·10⁻¹⁶fill, symbolic1331fill, numeric1331n = 144 · density 3.2% · bandwidth 12same matrix, renumberedthe answer is identical to rounding
Fig. 10 What a dense factor costs in the field that counts it.

Two refusals, and what each guards

The claim this page has to close is the one that reads as a definition rather than an assumption: any set of n − m independent directions annihilated by A is as good a basis as any other, since they all describe the same subspace and give the same answer. Every clause of that is true except the conclusion. The assertion is fed the naive basis’s reduced Hessian and required to reject the claim that it is within a factor of a million of the orthonormal one’s — and 3.8·10¹⁶ against 25.6 is a factor of 1.5·10¹⁵.

The second refusal guards the other direction. The fundamental basis has an identity block in it, and an identity block is orthonormal, so it is easy to conclude that the basis is. It is not: the other block is A_B⁻¹A_N and has no reason to be anything in particular. The assertion is fed κ(Z) = 1.99·10⁸ and required to refuse.

And the third covers the sparsity claim from the other side: a QR of Aᵀ is asserted to be dense, because the entire case for the fundamental basis rests on the orthonormal one not being sparse, and a reader is entitled to have that measured rather than assumed.

Three bases for the same null space, at 10 unknowns and 4 constraintsThe same constrained problem solved three times, differing only in which basis Z is used for the null space of A. The orthonormal basis, from a QR of Aᵀ, has κ(Z) = 1 exactly and is dense — 100 per cent of its entries are nonzero. The fundamental basis built on the first 4 columns has κ(Z) = 1.997·10⁴, and its reduced Hessian comes out at 5.845·10⁸, which is κ(Z)² to within a factor of 1.47 — the square attained rather than bounded. Its answer is wrong by 8.504·10⁻¹⁰, against 2.25·10⁻¹⁵ for the orthonormal one. Choosing the same kind of basis by pivoting instead gives κ(Z) = 2.06, an error of 1.33·10⁻¹⁵, and the same 50 per cent density: all of the sparsity and none of the loss.κ(A) = 10⁶ throughout · κ(H) = 100 · the answer is the same answer for every basisorthonormal — κ(Z)1κ(ZᵀHZ)25.6relative error2.25·10⁻¹⁵first m basic — κ(Z)2·10⁴κ(ZᵀHZ)5.85·10⁸relative error8.5·10⁻¹⁰pivoted basic — κ(Z)2.06κ(ZᵀHZ)31.8relative error1.33·10⁻¹⁵what the choice costsdensity, orthonormal1density, fundamental0.5κ(ZᵀHZ) ÷ κ(Z)², naive1.5error, pivoted choice1.3·10⁻¹⁵every one of them is a basisand one of them loses fourteen digits
Fig. 11 An intermediate stop, where the naive basis has lost eight digits and not yet all of them.

A third basis this page does not build

There is a middle option that appears in the literature and is worth naming so that the comparison does not read as exhaustive: an orthogonal fundamental basis, obtained by orthogonalising only the m × (n − m) block rather than the whole of Z.

It does not exist in general. The columns of the fundamental basis are not orthogonal to each other, and making them so mixes the identity block into itself — after which the identity block is gone and so is the sparsity. What can be done instead is to keep the fundamental form and precondition the reduced problem, which is exactly what the constraint preconditioner of the constraint field does and which leaves the conditioning of Z where it was while removing its effect on the iteration count.

That is a genuine third answer and it changes the question rather than answering it: the reduced Hessian is still κ(Z)² and is never formed, and what governs the work is the preconditioned spectrum instead. It is available only to an iterative method, and the two bases compared above are what a direct one has.

The condition number a sketched preconditioner leaves, against the condition number it was givenTwo curves against κ(A), both axes logarithmic. The matrix's own condition number climbs the diagonal from 100 to 10¹⁰; κ(AR⁻¹), where R comes from a QR of a 4n-row sketch, is 2.2284 at every one of them — the same number to ten digits, not a similar one. The reason is two lines of algebra: with G = SU the preconditioned singular values are those of (GᵀG)⁻¹, which has no spectrum of A in it at all.10²10⁴10⁶10⁸10¹⁰110²10⁴10⁶10⁸10¹⁰condition number of the matrixcondition number seen by the iterationκ(A), unchangedκ(AR⁻¹)a bound with no κ(A) in itκ(AR⁻¹), every κ(A)2.2κ(SU), the other route2.2κ(A), across the sweep10⁸κ(AR⁻¹), across the sweep1the sketch never sees the spectrumand the spectrum cancels out of the answer
Fig. 12 The alternative to fixing a condition number, in the field that introduced it: leaving it and moving the spectrum instead.

At other settings

Three bases for the same null space, at 10 unknowns and 4 constraintsThe same constrained problem solved three times, differing only in which basis Z is used for the null space of A. The orthonormal basis, from a QR of Aᵀ, has κ(Z) = 1 exactly and is dense — 100 per cent of its entries are nonzero. The fundamental basis built on the first 4 columns has κ(Z) = 205.7, and its reduced Hessian comes out at 8.39·10⁴, which is κ(Z)² to within a factor of 1.98 — the square attained rather than bounded. Its answer is wrong by 3.074·10⁻¹³, against 1.15·10⁻¹⁵ for the orthonormal one. Choosing the same kind of basis by pivoting instead gives κ(Z) = 2.061, an error of 2.88·10⁻¹⁶, and the same 50 per cent density: all of the sparsity and none of the loss.κ(A) = 10⁶ throughout · κ(H) = 100 · the answer is the same answer for every basisorthonormal — κ(Z)1κ(ZᵀHZ)25.6relative error1.15·10⁻¹⁵first m basic — κ(Z)206κ(ZᵀHZ)8.39·10⁴relative error3.07·10⁻¹³pivoted basic — κ(Z)2.06κ(ZᵀHZ)31.7relative error2.88·10⁻¹⁶what the choice costsdensity, orthonormal1density, fundamental0.5κ(ZᵀHZ) ÷ κ(Z)², naive2error, pivoted choice2.9·10⁻¹⁶every one of them is a basisand one of them loses fourteen digits
Fig. 13 At γ = 100, where the naive rule is still safe.
Three bases for the same null space, at 10 unknowns and 4 constraintsThe same constrained problem solved three times, differing only in which basis Z is used for the null space of A. The orthonormal basis, from a QR of Aᵀ, has κ(Z) = 1 exactly and is dense — 100 per cent of its entries are nonzero. The fundamental basis built on the first 4 columns has κ(Z) = 1.994·10¹⁰, and its reduced Hessian comes out at 4.871·10¹⁸, which is κ(Z)² to within a factor of 0.0123 — the square attained rather than bounded. Its answer is wrong by 0.3173, against 8.67·10⁻¹⁶ for the orthonormal one. Choosing the same kind of basis by pivoting instead gives κ(Z) = 2.06, an error of 8.07·10⁻¹⁶, and the same 50 per cent density: all of the sparsity and none of the loss.κ(A) = 10⁶ throughout · κ(H) = 100 · the answer is the same answer for every basisorthonormal — κ(Z)1κ(ZᵀHZ)25.6relative error8.67·10⁻¹⁶first m basic — κ(Z)1.99·10¹⁰κ(ZᵀHZ)4.87·10¹⁸relative error0.317pivoted basic — κ(Z)2.06κ(ZᵀHZ)31.9relative error8.07·10⁻¹⁶what the choice costsdensity, orthonormal1density, fundamental0.5κ(ZᵀHZ) ÷ κ(Z)², naive0.012error, pivoted choice8.1·10⁻¹⁶every one of them is a basisand one of them loses fourteen digits
Fig. 14 And at 10¹⁰, where its reduced Hessian is numerically singular.
The reduced Hessian and the answer, against how badly the basic columns were chosenγ is the condition number of the first 6 columns of A, and the naive rule calls exactly those columns basic. Its reduced Hessian's condition number climbs from 27.85 to 7.309·10¹³ across ten decades of γ — the square, because κ(ZᵀHZ) ≤ κ(H)κ(Z)² and the bound is attained. Choosing the basic columns by a column-pivoted QR instead holds it between 6.175 and 20.89 at every stop. The two forward errors, measured against a BigInt answer, follow their own condition numbers: 0.05908 against 5.51·10⁻¹⁶ at γ = 10¹⁰. κ(A) is 10⁶ throughout and never moves — nothing about the problem's difficulty changes across this axis, only which columns a one-line rule happens to pick.024681010⁻¹⁷10⁻¹³10⁻⁹10⁻⁵10⁻¹10³10⁷10¹¹10¹⁵10¹⁹log₁₀ γ — conditioning of the first m columnscondition number, and relative errorκ(ZᵀHZ), naiveκ(ZᵀHZ), pivotederror, naiveerror, orthonormalone problem, two rulesκ(ZᵀHZ) naive, γ = 10¹⁰7.3·10¹³κ(ZᵀHZ) pivoted, worst21error, naive0.059error, pivoted5.5·10⁻¹⁶κ(A) does not move across this axisand the answer moves by fourteen digits
Fig. 15 Six constraints, so a null space of four, and the same two slopes.
The reduced Hessian and the answer, against how badly the basic columns were chosenγ is the condition number of the first 3 columns of A, and the naive rule calls exactly those columns basic. Its reduced Hessian's condition number climbs from 277.2 to 8.131·10¹⁷ across ten decades of γ — the square, because κ(ZᵀHZ) ≤ κ(H)κ(Z)² and the bound is attained. Choosing the basic columns by a column-pivoted QR instead holds it between 43.16 and 55.06 at every stop. The two forward errors, measured against a BigInt answer, follow their own condition numbers: 0.5617 against 3.07·10⁻¹⁶ at γ = 10¹⁰. κ(A) is 10⁶ throughout and never moves — nothing about the problem's difficulty changes across this axis, only which columns a one-line rule happens to pick.024681010⁻¹⁷10⁻¹³10⁻⁹10⁻⁵10⁻¹10³10⁷10¹¹10¹⁵10¹⁹log₁₀ γ — conditioning of the first m columnscondition number, and relative errorκ(ZᵀHZ), naiveκ(ZᵀHZ), pivotederror, naiveerror, orthonormalone problem, two rulesκ(ZᵀHZ) naive, γ = 10¹⁰8.1·10¹⁷κ(ZᵀHZ) pivoted, worst55error, naive0.56error, pivoted3.1·10⁻¹⁶κ(A) does not move across this axisand the answer moves by fourteen digits
Fig. 16 And three, for reading against the hero’s four.
‖QᵀQ − I‖ of the implied Q, against the condition numberLoss of orthogonality against κ, both axes logarithmic, for three factorisations of the same 256×8 matrix. The column sweep and the reduction tree run from 2.7·10⁻¹⁴ to 1.5·10⁻¹⁰. Cholesky QR — the one with a single reduction — runs from 2.3·10⁻¹³ to 1.8·10⁻⁵, a fitted slope of 1.97 against the others' near-flat one.10²10³10⁴10⁵10⁶10⁻¹⁴10⁻¹²10⁻¹⁰10⁻⁸10⁻⁶condition number κ‖QᵀQ − I‖Cholesky QRsweeptreethe price of one roundfitted slope, Cholesky QR2‖QᵀQ − I‖ at κ = 10·10⁵1.8·10⁻⁵the sweep's, at the same κ1.5·10⁻¹⁰one reduction instead of nand the condition number squared
Fig. 17 Loss of orthogonality against conditioning, in this field’s own terms.
Classical and modified Gram–Schmidt: the same subtraction, in a different orderTwo panels of pseudocode differing in one argument, with the resulting pairwise dot products of the computed columns listed beneath each.for each previous column i, subtract the projection of column j onto qᵢclassicalr[i][j] = qᵢ · a[j] ↑ the ORIGINAL columnv = v − r[i][j] · qᵢthe three worst |qᵢ · qⱼ|:columns 7 and 8: 1columns 6 and 8: 0.13columns 6 and 7: 0.13modifiedr[i][j] = qᵢ · v ↑ what is LEFT of itv = v − r[i][j] · qᵢthe three worst |qᵢ · qⱼ|:columns 1 and 8: 4.4·10⁻⁷columns 2 and 8: 2.7·10⁻⁷columns 3 and 8: 2.4·10⁻⁸The two R factors agree to 1.2·10⁻⁶ relative. The two Q factors do not.the 8×8 Hilbert matrixone word, eight orders
Fig. 18 The other place on this site where the same algebra in a different order costs everything.
One Householder reflection, and the sign that keeps it stableA vector, the mirror line through the origin, and its reflection landing on the negative first axis at the same distance from the origin.the mirrorx, length 4.000Hx = (-4.000, 0)v = x − αe₁safe sign: α = −‖x‖, so v is formed from a sum and nothing cancelsunsafe sign: α = +‖x‖ gives ‖v‖ only 35.1% of ‖x‖ + ‖x‖ — the digits go‖HᵀH − I‖5·10⁻¹⁶‖Hx‖ − ‖x‖8.9·10⁻¹⁶second component2.2·10⁻¹⁶built from a unit vectororthogonality is structural
Fig. 19 The construction the orthonormal basis comes from.
Loss of orthogonality against condition number, in binary64A log–log plot of the norm of Q-transpose-Q minus the identity against condition number. Classical Gram–Schmidt rises steeply, modified Gram–Schmidt rises gently, and Householder is flat.110²10⁴10⁶10⁸10¹⁰10¹²10⁻¹⁷10⁻¹⁴10⁻¹¹10⁻⁸10⁻⁵10⁻²10¹condition number κ(A)‖QᵀQ − I‖classicalmodifiedHouseholderκ²uκu8×8, eight seeds per κ, binary64all three reconstruct A
Fig. 20 And how the loss accumulates along the columns.
The 14 eigenvalues of a saddle-point matrix with 10 unknowns and 4 constraints, inside their closed-form bracketsK = [[H, Aᵀ], [A, 0]] with κ(H) = 100 and κ(A) = 100. The shaded bands are the Rusten–Winther brackets, computed from four numbers — the extreme eigenvalues of H and the extreme singular values of A — before the matrix was assembled: negative eigenvalues in [-0.995, -10·10⁻⁵] and positive ones in [0.01, 1.62]. The marks are the computed spectrum. There are exactly 10 above zero and 4 below, which is Sylvester's law of inertia and not a property of this matrix: K is congruent to blkdiag(H, −AH⁻¹Aᵀ), both blocks are definite, and congruence preserves signs. The two groups are separated by a gap containing zero, at a ratio of 39.3 between the innermost positive eigenvalue and the innermost negative one.-1-0.582271-0.1645420.2531860.6709151.088641.506370eigenvalue4 negative10 positivecounted before it was formedpositive10negative4at zero0innermost ratio39the zero block is a theoremand so is the count either side of it
Fig. 21 The system the basis is eliminating a block of.
Two penalties on the same problem, against the offset in the signalBest relative error for each penalty at four offsets. With no offset the two are within 7% of each other. At an offset of 10 the derivative penalty is 1.85 times better, because a constant lies in its null space and costs it nothing, while the norm penalty pays for the whole offset at every λ.best relative error at each offset‖x‖, offset 00.2035‖L₁x‖, offset 00.1901‖x‖, offset 20.0572‖L₁x‖, offset 20.0524‖x‖, offset 50.0333‖L₁x‖, offset 50.0245‖x‖, offset 100.0240‖L₁x‖, offset 100.0129what the null space buysadvantage at offset 01.1advantage at offset 21.1advantage at offset 51.4advantage at offset 101.9the norm penalty pays for a constantthe derivative penalty does not
Fig. 22 A null space in its other role on this site, as the thing that makes an answer non-unique.
A randomised rank-k solve, 4 seeds a rankRelative error against the rank kept, on a logarithmic vertical axis, with a vertical bar at each rank spanning the seeds. The band is 1.68 wide at rank 8, where the method is at its worst, and 1.004 wide at rank 20, where it is at its best. The same computation on the same data returns a different answer each time.0481216202428321rank keptrelative errormedianthe answer movesspread at rank 81.7spread at rank 201best median error0.15widest where the method is worstand the bound does not say so
Fig. 23 And the decision that has to be made before a null space has a dimension at all.
‖A − Q‖_F for four orthogonal matrices, on an 8×8 matrix with κ = 10The polar factor is 1.8554 from A. QR with its column signs fixed is 2.1265 — 15 per cent further. QR as Householder returns it, with 7 of 8 columns negated, is 3.8226, which is further than the best of two hundred orthogonal matrices drawn at random. The strip beneath the bars is those two hundred draws, whose best is 2.6928; the polar factor is to the left of all of them, which is the minimisation being checked rather than assumed.how far is it from A to an orthogonal matrix?smaller is nearer · the polar factor minimises this in every unitarily invariant normpolar factor U1.8554QR, signs fixed2.1265QR as returned3.8226200 drawn at randomκ = 10polar factor1.9QR, signs fixed2.1QR as returned3.8best of 200 random2.7‖A − QR‖ is the same either wayand ‖A − Q‖ is not
Fig. 24 The nearest orthogonal matrix to a given one, which is not the Q a QR returns.
Three bases for the same null space, at 10 unknowns and 3 constraintsThe same constrained problem solved three times, differing only in which basis Z is used for the null space of A. The orthonormal basis, from a QR of Aᵀ, has κ(Z) = 1 exactly and is dense — 100 per cent of its entries are nonzero. The fundamental basis built on the first 3 columns has κ(Z) = 3.71·10⁸, and its reduced Hessian comes out at 9.204·10¹⁶, which is κ(Z)² to within a factor of 0.669 — the square attained rather than bounded. Its answer is wrong by 0.2077, against 3.81·10⁻¹⁵ for the orthonormal one. Choosing the same kind of basis by pivoting instead gives κ(Z) = 1.876, an error of 8.88·10⁻¹⁶, and the same 40 per cent density: all of the sparsity and none of the loss.κ(A) = 10⁶ throughout · κ(H) = 100 · the answer is the same answer for every basisorthonormal — κ(Z)1κ(ZᵀHZ)44.7relative error3.81·10⁻¹⁵first m basic — κ(Z)3.71·10⁸κ(ZᵀHZ)9.2·10¹⁶relative error0.208pivoted basic — κ(Z)1.88κ(ZᵀHZ)43.2relative error8.88·10⁻¹⁶what the choice costsdensity, orthonormal1density, fundamental0.4κ(ZᵀHZ) ÷ κ(Z)², naive0.67error, pivoted choice8.9·10⁻¹⁶every one of them is a basisand one of them loses fourteen digits
Fig. 25 Three constraints, so three basic columns for the naive rule to choose badly.
The reduced Hessian and the answer, against how badly the basic columns were chosenγ is the condition number of the first 5 columns of A, and the naive rule calls exactly those columns basic. Its reduced Hessian's condition number climbs from 36.88 to 6.626·10¹⁶ across ten decades of γ — the square, because κ(ZᵀHZ) ≤ κ(H)κ(Z)² and the bound is attained. Choosing the basic columns by a column-pivoted QR instead holds it between 24.27 and 27.3 at every stop. The two forward errors, measured against a BigInt answer, follow their own condition numbers: 0.3844 against 2.1·10⁻¹⁶ at γ = 10¹⁰. κ(A) is 10⁶ throughout and never moves — nothing about the problem's difficulty changes across this axis, only which columns a one-line rule happens to pick.024681010⁻¹⁷10⁻¹³10⁻⁹10⁻⁵10⁻¹10³10⁷10¹¹10¹⁵10¹⁹log₁₀ γ — conditioning of the first m columnscondition number, and relative errorκ(ZᵀHZ), naiveκ(ZᵀHZ), pivotederror, naiveerror, orthonormalone problem, two rulesκ(ZᵀHZ) naive, γ = 10¹⁰6.6·10¹⁶κ(ZᵀHZ) pivoted, worst27error, naive0.38error, pivoted2.1·10⁻¹⁶κ(A) does not move across this axisand the answer moves by fourteen digits
Fig. 26 Five, where the null space is smallest and the slope is unchanged.
What each way of eliminating a constraint inherits, over five decades of κ(A)The same system solved twice, at 8 unknowns and 3 constraints with κ(H) = 10. The range-space method forms S = AH⁻¹Aᵀ and inherits κ(S), which rises from 3.169 to 1.585·10¹⁰ — the square of κ(A), for the reason the normal equations square it. The null-space method solves with the reduced Hessian ZᵀHZ, whose condition number is 4.149 at the start of the sweep and 4.149 at the end: it does not contain κ(A) at all. The two forward errors, measured against a solution computed in BigInt rationals, follow their own condition numbers: 2.278·10⁻⁷ against 3.002·10⁻¹² at the far end. Both methods are correct and one of them is usable.01234510⁻¹⁷10⁻¹³10⁻⁹10⁻⁵10⁻¹10³10⁷10¹¹log₁₀ κ(A)condition number, and relative errorκ(S)κ(ZᵀHZ)range-space errornull-space erroragainst a BigInt answerκ(S) at κ(A) = 10⁵1.6·10¹⁰κ(ZᵀHZ), all stops4.1range-space forward error2.3·10⁻⁷null-space forward error3·10⁻¹²both are the same algebraand only one squares
Fig. 27 The elimination this basis is used inside.
The constraint preconditioner's spectrum, over six decades of the constraint's condition numberP = [[G, Aᵀ], [A, 0]] with G an approximation to H — here a well-conditioned matrix that is not H at all. The theorem says P⁻¹K has eigenvalue 1 with multiplicity 2m = 8 and n − m = 6 others, which are the generalised eigenvalues of the pencil (ZᵀHZ, ZᵀGZ) for any basis Z of the null space of A. A does not appear in that list, and the measurement is the flat lines: κ(A) crosses six decades along the horizontal axis and the 6 eigenvalues move by 3.02·10⁻⁶ relative, which is the arithmetic. A preconditioner for a constrained problem can decline to know anything about the constraint, because the constraint has already been inverted exactly inside it. The one quantity that does move is the drift of the eigenvalues the theorem puts at exactly one: 1.93·10⁻⁸ at κ(A) = 1 and 3.11·10⁻⁵ at 10⁶, which is κ(A) times the unit roundoff.012345610⁻²10⁻¹110¹log₁₀ κ(A)eigenvalue of P⁻¹Kthe constraint is not in itnontrivial6at one8movement, six decades3·10⁻⁶drift at one3.1·10⁻⁵2m at onethe marks are a pencil that never saw Aand the lines are the preconditioned matrix
Fig. 28 And the quantity the basis choice cannot move.
Fill under three orderings of a sparse saddle-point matrix, predicted symbolically and then countedA stiffness block of 24 unknowns with 4 constraints each touching 3 of them. Each panel is the pattern of PKPᵀ under one ordering, with the entries the factorisation adds shown against the entries the matrix arrived with. The counts are natural 113, minimum-degree 63, reverse-cuthill-mckee 63: computed from the graph before any number was touched, and matched exactly by the factorisation of the regularised matrix, because quasi-definiteness means nothing during the numeric phase is allowed to move a pivot. That is the guarantee sparse LU cannot make — there the pivot order depends on the values, so the symbolic phase can only bound the fill and the allocation has to be able to grow.natural113 predicted · 113 countedminimum-degree63 predicted · 63 countedreverse Cuthill–McKee63 predicted · 63 countedthe shaded entries are fill: zeros of K that the factorisation makes nonzeroallocated before the numbersnatural113minimum-degree63reverse-cuthill-mckee63predicted minus counted0the symbolic phase decides the memoryand nothing later is allowed to argue
Fig. 29 The sparsity the fundamental basis is defending, counted in the sparsity field’s terms.
Both forms of an interior-point step: two condition numbers that climb together and two errors that do notOne Newton step of an interior-point method for a quadratic programme with 8 unknowns and 6 constraints, 3 of them active, written twice. The augmented form is [[H, Cᵀ], [C, −D⁻¹]] and the condensed form is H + CᵀDC, and they have the same solution. As the barrier parameter μ falls, the diagonal D separates — z/s runs to 1/μ on the active constraints and to μ on the inactive ones — so both condition numbers climb: 29.04 to 3.044·10¹⁵ for the augmented form and 155.8 to 2.403·10¹⁶ for the condensed one, within a factor of 7.9 of each other. The two forward errors, both measured against the exact rational solution of the system the machine is holding, do not follow: the condensed form's rises to 0.3098 and the augmented form's stays at 1.035·10⁻¹⁵ — fifteen correct digits at a condition number of 3.04·10¹⁵.-14-12-10-8-6-4-2010⁻¹⁷10⁻¹³10⁻⁹10⁻⁵10⁻¹10³10⁷10¹¹10¹⁵log₁₀ μ — the barrier parametercondition number, and relative errorκ₂, condensedκ₂, augmentederror, condensederror, augmentedagainst a BigInt answerκ₂ augmented, μ = 10⁻¹⁴3·10¹⁵its relative error10⁻¹⁵κ₂ condensed2.4·10¹⁶its relative error0.31the same step, written two waysand only one of them is solvable
Fig. 30 And a constrained system where the basis question does not arise, because nothing is eliminated.

What links here

Computed from the collection, not written here: the essays that point at this one.

Reads more easily once this is understood

Essays that name this one as worth reading first.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A flat tag is an object no other essay names yet.

Column pivotingCondition numberConstrained minimisationNull spaceNull space basisOrthonormal basisQR factorisationReduced hessianSaddle-point systemsSparsity