Eigenvalues, singular values, rank

Keeping the vectors, and losing the bound

Thick restarting keeps the Ritz vectors instead of filtering the starting vector — the same eigenvalues for a third of the products with A. Its residual bound reaches 9.4·10⁻⁴¹ while the residual it bounds sits at 5.7·10⁻⁵, and the eigenvalues are correct to 4.3·10⁻¹⁴ the whole time, so nothing reports it.

Worth reading first: An eigenvalue that arrives twice · The plane survives what its vectors do not · The rate the condition number predicts.

Restarting is a filter measured what a restart does: multiply the starting vector by Π(A − θⱼI), suppressing the directions the run has decided it does not want. The Ritz pairs are discarded at the end of every cycle and rebuilt from scratch in the next one, and the whole content of the method is in the polynomial.

There is another way to do it, and it does the opposite. Keep the k Ritz vectors that are wanted, add the last residual vector, and continue the Lanczos recurrence from there. Nothing is filtered and nothing is rebuilt.

The two are known to be equivalent, and the equivalence is the reason thick restarting is usually described as an implementation detail rather than as a method: same answer, simpler code, no shifts to choose. Everything below takes that seriously enough to measure it, and the first two measurements confirm it exactly. The third does not.

The reported bound and the residual it bounds, over 10 cyclesThree quantities against the cycle count on a logarithmic vertical axis. The residual bound the method reports falls without limit, reaching 9.41·10⁻⁴¹. The residual it claims to bound stops at 5.68·10⁻⁵ and does not move. Recomputing the arrowhead's border entries, at one extra product with A a cycle, takes the residual to 3.81·10⁻¹⁴.1234567891010⁻⁵⁵10⁻⁴⁹10⁻⁴³10⁻³⁷10⁻³¹10⁻²⁵10⁻¹⁹10⁻¹³10⁻⁷10⁻¹cyclesizethe residualrepairedthe reported boundwhat the stopping rule readsreported at the last cycle9.4·10⁻⁴¹the residual there5.7·10⁻⁵with the border recomputed3.8·10⁻¹⁴products, cheap and repaired9a bound with nothing under itand one product a cycle to fix it
Fig. 1 Three quantities over ten cycles. The dashed curve is the residual bound the method reports and stops on. The middle curve is the residual it claims to bound. The third is what one extra product with A a cycle buys.

The identity, and the shape it produces

After m steps, each Ritz vector satisfies

A yᵢ = θᵢ yᵢ + sᵢ v, with sᵢ = βₘ times the last entry of yᵢ’s coefficient vector

so each retained vector is an eigenvector of A up to one shared direction — the residual vector v, which is the same vector for all of them. That is what makes the retention work: the space spanned by {y₁ … y_k, v} is almost invariant, and A maps each yᵢ back into it exactly.

It also fixes the shape of the projected matrix. The retained values sit on the diagonal, their couplings to v sit in one row and one column, and the ordinary Lanczos tridiagonal continues from there.

The projected matrix after 3 cycles, keeping 4 vectorsA 8×8 matrix drawn as a grid. The first 4 diagonal entries are the retained Ritz values; the row and column at index 4 are their couplings to the residual vector; the remaining 4×4 block is an ordinary Lanczos tridiagonal. 22 entries are above rounding out of 64.retained Ritz values on the diagonal, their couplings in one row and column10···1.3·10⁻⁵····9.5··4.9·10⁻⁶·····9·0.000325······8.52.8·10⁻⁵···1.3·10⁻⁵4.9·10⁻⁶0.0003252.8·10⁻⁵1.830.554······0.5542.250.447······0.4471.960.427······0.4271.94the shape, countedentries above rounding22of a possible64worst entry off the arrow0a diagonal and one borderand a tridiagonal tail
Fig. 2 The projected matrix after three cycles, with four vectors retained. Twenty-two entries above rounding out of sixty-four, and every one of them on the diagonal, the border or the tridiagonal tail — which is asserted rather than seen, by requiring every other entry to be below 10⁻¹³ of the matrix’s norm.

That is an arrowhead, and this site has an essay about arrowhead matrices in a completely different field: two ends of the same arrow is about what happens when one row’s position decides whether elimination costs n or n³. The same shape arrives here from a restart rather than from an ordering, and for the same underlying reason — one object coupled to everything, and everything else coupled to nothing.

What it buys

Two things, both measured against restart.js’s filtered restart on the same matrix with the same seed.

The same eigenvalues. At the first two cycles the two methods return Ritz values agreeing to 3.6·10⁻¹⁵ and 1.2·10⁻¹⁴; over six cycles the worst disagreement is 4.8·10⁻¹⁴. That is the equivalence theorem, measured rather than quoted, and the assertion is deliberately placed at the early cycles where the claim is about the algebra rather than about the rounding.

For a third of the products with A. The filtered restart rebuilds the whole m-step recurrence each cycle and then applies p shifts, so it spends m + p products; thick restarting keeps k of the vectors and spends p. Over eight cycles with k = p = 4 that is 36 products against 96.

12 restarts keeping 4 of 8, on a 40×40 matrixThe residual bound of the worst wanted eigenvalue and its true error, against the number of products with A. The bound falls from 1.21 to 1.08·10⁻¹³ across 12 cycles and 140 products, and the true error reaches 7.11·10⁻¹⁵. The basis is 8 vectors at every cycle and never grows.0183654729010812610⁻¹⁶10⁻¹³10⁻¹⁰10⁻⁷10⁻⁴10⁻¹products with Asizeresidual boundtrue errorbounded memorybasis vectors kept8products with A140worst error in the k wanted7.1·10⁻¹⁵the bound is free and the error is notand the basis never grows
Fig. 3 The filtered restart converging on a basis that never grows, from the previous essay. The comparison in this one is products for products against exactly this run — the same wanted eigenvalues, the same memory, and a third of the arithmetic.

The identity holds for one restart and not for two

Now the part that is not in the description.

The residual of a retained vector is supposed to lie entirely along v. Measure the part of it that does not:

cycle component of the residual off v
1 1.8·10⁻¹⁴
2 2.8·10⁻¹⁴
3 5.7·10⁻⁵
4 3.2·10⁻⁵
5 5.7·10⁻⁵

The third cycle is the first one whose retained vectors were themselves built out of retained vectors. Before it the identity is exact to rounding; from it the identity is wrong by nine orders of magnitude more than rounding, and stays wrong.

The consequence is that the arrowhead is not the Rayleigh quotient of the basis it names. ‖T − QᵀAQ‖/‖QᵀAQ‖ is 1.6·10⁻¹⁶ and 1.1·10⁻¹⁵ at the first two cycles and 4.2·10⁻⁶ at the third.

The projected matrix, against the basis it is supposed to project ontoThree quantities against the cycle count on a logarithmic vertical axis. The disagreement between the arrowhead and the Rayleigh quotient of its own basis is at the level of rounding for two cycles and reaches 4.23·10⁻⁶ after. The basis's own orthogonality error stays at 9·10⁻¹⁶ throughout, and the run whose border entries are recomputed stays at 2.5·10⁻¹⁵.1234567810⁻¹⁸10⁻¹⁵10⁻¹²10⁻⁹10⁻⁶10⁻³cyclerelative sizea vector kept twice‖T − QᵀAQ‖‖QᵀQ − I‖border recomputedwhich model is wrong‖T − QᵀAQ‖ at cycle 21.1·10⁻¹⁵at cycle 34.2·10⁻⁶‖QᵀQ − I‖, worst9·10⁻¹⁶the basis is orthonormal throughoutand the matrix on it is not its own
Fig. 4 The projected matrix against the Rayleigh quotient of its own basis, with the basis’s orthogonality error on the same axes. The one thing this is not is a lost basis: ‖QᵀQ − I‖ stays at 7·10⁻¹⁶ at every cycle, which is the explanation this site would reach for first and the one the measurement rules out.

That last point is worth dwelling on. Every other failure of a Lanczos-type method on this site has been a lost basis — ghosts, duplicated eigenvalues, orthogonality collapsing geometrically over ten steps. This is not that. The basis here is reorthogonalised twice against everything at every step and is orthonormal to 7·10⁻¹⁶ throughout. What is wrong is the matrix written down about it.

So the stopping rule stops measuring

The residual bound is βₘ|s_{m,i}|, it comes out of the eigenvectors of the projected matrix, and it costs nothing. It is what a real code stops on, and it is computed inside a model that has stopped describing the operator.

cycle reported bound actual residual
2 3.3·10⁻⁴ 3.3·10⁻⁴
3 6.7·10⁻⁹ 5.7·10⁻⁵
4 1.8·10⁻¹³ 5.7·10⁻⁵
6 1.4·10⁻²² 5.7·10⁻⁵
8 1.1·10⁻³¹ 5.7·10⁻⁵
10 9.4·10⁻⁴¹ 5.7·10⁻⁵

Forty-four orders of magnitude, in the direction that makes the run look finished.

And nothing else reports it. The eigenvalues are correct to 4.3·10⁻¹⁴ at every one of those cycles, which is the accuracy the method is usually asked about; the basis is orthonormal; the residual bound is falling monotonically, which is what a converging run looks like. The only quantity that says anything is the one nobody computes, because computing it costs a product with A per vector and the bound exists to avoid exactly that.

The vectors really are worse

A residual is a proxy, and a proxy that has just been shown to be untrustworthy is a poor thing to rest a finding on. These matrices are built from a spectrum and an orthogonal basis, so the true eigenvectors are available — the exact ground truth move the site makes wherever it can — and the angle to them can be measured directly.

worst angle to the true eigenvector worst eigenvalue error
border from the previous cycle 8.6·10⁻⁶ 4.26·10⁻¹⁴
border recomputed 2.1·10⁻⁸ 4.09·10⁻¹⁴

A factor of 410 in the quantity the method exists to produce, and nothing at all in the quantity anybody checks.

That last column is not a coincidence, and the depth phase already measured why. An eigenvalue is quadratically insensitive to an error in its eigenvector — the Rayleigh quotient of a vector 8.6·10⁻⁶ from an eigenvector is wrong by something like the square of that, divided by a gap — so an eigenvalue error of 10⁻¹⁴ is exactly what a vector error of 10⁻⁶ produces.

What a perturbation of 10⁻⁶ moves, against the gap it is applied acrossThree curves against the gap between two eigenvalues, both axes logarithmic. Two are flat; the third rises steeply as the gap closes and then levels off.10⁻⁹10⁻⁷10⁻⁵10⁻³10⁻⁸10⁻⁵10⁻²gap between the two eigenvalueshow far it movedthe eigenvectorsthe eigenvaluestheir plane‖E‖ / gapone perturbation, three answerseigenvalue shift, spread over the sweep1plane angle, spread over the sweep1eigenvector angle, spread1.6·10⁵the dashed line is Davis–Kahan's ‖E‖/gaptwo of the three never noticed
Fig. 5 The same insensitivity from the other side, in the subspace field: at a perturbation of 10⁻⁶ the eigenvalue moves by 3.9·10⁻⁷ at every gap while the eigenvector’s angle runs from 3.1·10⁻⁶ to half a radian. The two quantities are not interchangeable, and here that is what hides the defect.

What is stored, which does not change

It is worth being explicit that this is not a memory trade.

The filtered restart keeps m = k + p basis vectors and rebuilds them each cycle. Thick restarting keeps m too: the k retained Ritz vectors, the residual vector, and the p − 1 it generates. Neither method’s storage grows with the number of cycles, which is the property both exist for and which the previous essay asserts of the filtered one.

What differs is entirely in the arithmetic: one method spends m + p products with A a cycle to rebuild what it discarded, and the other spends p because it did not discard it. The retained vectors are not free to keep — they have to stay orthonormal, and they are reorthogonalised against at every step — but that cost is in inner products rather than in products with A, which on a large sparse matrix is the cheap side of the ledger.

One product with A a cycle

The border entries are the couplings yᵢᵀAv. The cheap method takes them from the previous cycle’s bounds, which is what the identity says they are. Recomputing them takes one product Av, shared by all k retained vectors, and then k inner products.

products over 8 cycles ‖T − QᵀAQ‖ reported bound actual residual
border from the previous cycle 36 up to 4.2·10⁻⁶ 1.1·10⁻³¹ 5.7·10⁻⁵
border recomputed 43 2.4·10⁻¹⁵ 1.4·10⁻²⁰ 3.8·10⁻¹⁴

Seven orders of magnitude of eigenvector, for seven products with A. The arrowhead becomes the Rayleigh quotient again at every cycle, the bound tracks the residual to a part in a thousand while both are falling, and the residual reaches the level everything else on this site reaches.

The eigenvalues are 4.26·10⁻¹⁴ and 4.09·10⁻¹⁴ — the same to rounding either way, which is the last piece of why the defect is invisible.

How big it is depends on a tuning parameter

The slider is the number of retained vectors, and the gap between the reported bound and the residual at the tenth cycle runs across it like this:

vectors retained reported ÷ actual, at cycle 10 residual, cheap residual, repaired
2 5.8·10¹⁰ 1.6·10⁻² 2.7·10⁻¹³
3 1.4·10¹⁶ 2.4·10⁻¹⁴ 2.5·10⁻¹⁴
4 6.0·10³⁵ 5.7·10⁻⁵ 3.8·10⁻¹⁴
5 3.2·10³ 2.8·10⁻¹ 3.1·10⁻⁵
6 2.2·10² 1.5·10⁻¹ 4.4·10⁻⁴

At every setting the bound leaves the residual behind. What the setting decides is how much damage that does: at three retained vectors the cheap run happens to land exactly where the repaired one lands, and at four it is a billion times worse.

A defect whose size varies this way across a tuning parameter is one nobody finds by testing at one setting, which is the practical reason this essay exists. The assertion is therefore written against the part that is invariant — the bound is the residual at the first cycle, and is at least a hundred times below it by the tenth, at every k — rather than against the number the default happens to produce.

How it was found, which is the argument for measuring twice

The path is worth writing down because no single measurement would have got there.

The first thing drawn was the bound against the cycle count, because that is the stopping rule and the obvious thing to plot. It falls smoothly through forty decades, which looks like a method converging beautifully and is the reason nobody looks further.

The second was the residual recomputed from the returned pair — one product with A per vector, which is exactly the cost the bound exists to avoid, and therefore a thing only a figure would ever pay for. That produced the flat line at 5.7·10⁻⁵ and the question.

The third measurement was the diagnosis, and it had two candidates. This site’s standing explanation for a Krylov method behaving badly is a lost basis, so ‖QᵀQ − I‖ was measured first and came back at 7·10⁻¹⁶ — ruling out the answer that would have been reached for by habit. What was left was the projected matrix itself, and comparing it against the Rayleigh quotient of its own basis is a three-line computation that no working code would ever do, because forming QᵀAQ costs m products with A and defeats the entire purpose of a projection method.

Every step in that chain costs something the method is designed not to spend. That is the general shape of this site’s findings and it is worth naming: a defect that only an expensive measurement can see will survive in a method whose whole point is to avoid that expense.

When to use it anyway

None of the above says not to use thick restarting. It says what to measure.

The method’s advantages are real and are not affected by any of this: the same eigenvalues as the filtered restart, a third of the products with A, no shift selection, no bulge chase, and a projected matrix whose shape a reader can check by eye. For a run of two or three cycles — which is what a well-separated spectrum needs — the arrowhead identity has not yet broken and the free bound is a bound.

What the measurements say is: recompute the border, at one product with A a cycle, and the free bound becomes trustworthy again along with everything else. That is between two and three per cent of the products a cycle costs at any realistic p, and it removes the only quantity in the method that lies.

If that is too expensive, the fallback is the one this essay’s third measurement used: recompute the residual of the returned pairs when the run stops, once, and compare it against the bound that stopped it. One product with A per wanted eigenvector, paid once, and the whole failure mode is visible.

What this is an instance of

The site has a name for this shape by now.

mixedcg.js measured a preconditioned conjugate gradient run whose reported residual read 1.1·10⁻¹³ while the true error was 1.6·10⁻⁷, and drew the rule out of it: a quantity that steers may be rounded, and a quantity that measures may not. The projected residual bound here is the same kind of object — a quantity computed inside the method’s own model of itself, used as though it were a measurement of the world.

The difference, and it is the reason this one is worse, is that the mixed-precision case has a knob with the trade written on it. Nobody chooses the stale border; it is what the derivation says the number is, and the derivation is right in exact arithmetic. There is no setting at which a reader is warned.

What the solver reported, and what it achievedFinal relative residual and final relative error against the working precision, on a logarithmic vertical axis. The residual sits at the stopping tolerance at every precision — the method converged, by every test available to it. The error runs from 9.06·10⁻¹³ at 53 bits to 0.0114 at 8, tracking the unit roundoff, which is drawn beside it.614223038465410⁻¹³10⁻¹⁰10⁻⁷10⁻⁴working significand bitsrelative sizeerrorresidualuthe gap the solver cannot seeerror ÷ residual at 24 bits5.9·10⁵error ÷ residual at 16 bits1.2·10⁸error ÷ residual at 8 bits2.7·10¹⁰every convergence test passesand the answer is wrong in proportion to u
Fig. 6 The same shape one field along: a residual that reads at the level of rounding while the error it is supposed to indicate is seven orders of magnitude larger. There the quantity was rounded on purpose; here it is computed exactly, inside a model that has stopped applying.
What 3 shifts do to each direction of the starting vectorAmplification of each eigen-component against its eigenvalue, on a logarithmic vertical axis. The points are measured — the component of the vector along each eigenvector, before and after — and the curve is |Π(λ − θ)| with the roots at the 3 discarded Ritz values. They agree to 3.9·10⁻¹¹. The 3 wanted directions are amplified by at least 1 and everything else by at most 0.802.1357910⁻⁵10⁻⁴10⁻³10⁻²10⁻¹1eigenvalue λamplificationkeptdiscardeda filter on the starting vectormeasured against the polynomial3.9·10⁻¹¹worst kept direction1best discarded direction0.8the roots are the discarded Ritz valuesand the vertical lines are where they sit
Fig. 7 The other restart, in one figure: a polynomial applied to the starting vector, measured component by component. This essay keeps the vectors instead and pays for the bound.
Copies of each eigenvalue after 80 steps on a 40×40 matrix with a simple spectrumA bar per eigenvalue that came back more than once, showing how many times. The matrix has 40 distinct eigenvalues by construction; the run returned 25 extra copies of 13 of them, the most-copied arriving 5 times. Every copy is accurate to 1.9·10⁻⁸ relative, which is why nothing but the true spectrum could detect them.λ = 105 timesλ = 9.55 timesλ = 95 timesλ = 8.55 timesλ = 2.952 timesλ = 2.92 timeseigenvalues that arrived more than once — the matrix has 40 distinct onesa spectrum with the wrong multiplicitiesextra copies, no reorthogonalisation25extra copies, full reorthogonalisation0worst relative error among the copies1.9·10⁻⁸steps taken of 80 asked for, full40no arithmetic error was madeevery one of these is right to eight digits
Fig. 8 What a Lanczos method’s failures usually look like: extra copies of converged eigenvalues, produced by a basis that has lost orthogonality. The defect in this essay is not that one.
The plane, and the two vectors inside it, at a gap of 10⁻⁴A circle representing the invariant plane, with two perpendicular radii for the eigenvectors and two more for the perturbed ones, rotated within the same circle.the invariant planesolid: beforedashed: aftersame perturbation, two questionsthe vectors turned, radians3.1·10⁻⁴the plane turned, radians7.6·10⁻⁸what left the plane7.9·10⁻⁸drawn in the unperturbed plane's own basisa radius is not determined; the circle is
Fig. 9 Why an eigenvalue can be right while its vector is wrong. The subspace field’s measurement is what makes a residual bound worth checking against an angle.

What the drag does

The slider is the number of retained vectors, and every position of it shows the same qualitative picture with a different magnitude — which is the point made above. Two things do not change at any position: the reported bound falls without limit, and the residual it names does not.

What is worth watching is the third curve. The repaired run’s residual is never the larger of the two, at any setting, and the assertion says exactly that rather than claiming an improvement — because at three retained vectors there is no improvement to claim, and a figure that asserted one would be asserting something false at one of its own stops.

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.

Arrowhead matrixInvariant subspaceLanczosRayleigh quotientReorthogonalisationResidual boundRestartingRitz valuesStopping criterionThick restarting