The first count names the rank
Worth reading first: The problem that arrives again · Changing the condition number on purpose · A parameter that counts steps.
A kept vector buys one iteration found a law with no slack in it. A sequence of symmetric positive definite matrices drifts from one that has been factorised; the old Cholesky factor preconditions conjugate gradients on each new member; and when the drift has rank , the preconditioned matrix is the identity plus a rank- term, so every member takes exactly iterations. Conjugate gradients has found the directions that matter by the end of each run, and throws them away. Keep of them, refreshed by Rayleigh–Ritz from one member to the next, and the count is , exactly, until it reaches one. Each kept vector costs half an iteration a member in extra products and projections, so the least work is at .
The rank is a property of the drift, and nothing a caller usually knows. That essay therefore predicted, with a sign, what a program could do without it: add one vector each member while the count is falling, stop at the first member where it does not fall, and so reach within one of the rank, within about members, at a total cost within fifteen per cent of keeping the right number from the start.
The first two parts hold exactly. The cost is over the prediction at two ranks of four. And the rule has a weakness the prediction did not consider, which a second rule, one line shorter, does not have.
Growing the kept set one vector at a time
The sequences are the earlier essay’s: a matrix of order 80 with condition number , factorised once; 24 members, each a drift of rank on its smallest eigenvalues, growing by a fixed step each member; a fresh random right-hand side each member, solved to a relative residual of . The growing rule starts with nothing kept, keeps one after the first member, and after every later member keeps one more if that member’s count fell below the previous one’s. At the first member where the count does not fall, it stops growing and holds.
At rank 8 the growing rule’s counts read 9, 8, 7, 6, 5, 4, 3, 2, 1, each kept vector removing exactly one iteration as the law said. At member 10 it keeps nine, the count stays at one, and it stops. At every rank on the dial it ends one vector above the rank, at , and has stopped by member . That is “within one of the true rank, within members of the start” to the letter, give or take the one member it takes to notice that the count has stopped falling.
What climbing costs
The cost of finding the rank this way is the triangle the iteration counts climb down. At rank 16, the first seventeen members take 17, 16, 15 and so on down to one, about 150 iterations where keeping sixteen from the start would take 33, and they carry a growing set of vectors on the way. The rule’s total is 303 iteration-equivalents against 243 for keeping sixteen from the start, a ratio of 1.25. At ranks 2, 4 and 8 it is 1.20, 1.13 and 1.14. So the prediction’s fifteen per cent holds at the middle two ranks and fails at the ends: at rank 16 because the triangle grows like while the saving grows like times the remaining members, and at rank 2 because the one extra vector the rule keeps past the rank is a large fraction of a small kept set. Keeping nothing, for comparison, costs 72, 120, 216 and 408: the growing rule recovers between half and four-fifths of what knowing the rank would have saved.
That is a respectable result for a rule that knows nothing in advance. But the triangle is waste the sequence never needed to pay, because the first member already said what the rank was.
The first count is the rank plus one
Under the law, the first member, solved with nothing kept, takes iterations. So a rule can read the rank off it: keep one fewer vector than the first member took iterations, and hold. At rank 8 the first member takes nine, the rule keeps eight from the second member on, and every later member takes one. That is the second line on the dial’s figure, and it drops straight from the first count to one.
Its cost at the four ranks is 50, 76, 127 and 230, which is below keeping the rank from the start, 51, 78, 132 and 243. The difference is the first member, which the reading rule solves with nothing kept and so without paying for any vectors, while a program that keeps the rank from the start has no vectors to keep at the first member either but is charged as if it did in the accounting the earlier essay used. The saving is small and it is not the point. The point is that the rule needs no growth, no triangle and no knowledge, and lands on the rank in one member.
Why a count can be read as a rank
The law the reading rule leans on is a fact about polynomials, and it is worth seeing why it is exact, because that says when it will not be. Conjugate gradients on a symmetric positive definite matrix produces, at step , the error that the best polynomial of degree with constant term one can leave, measured in the matrix’s own norm. When the preconditioned matrix is the identity plus a term of rank , it has at most distinct eigenvalues: one, and the others the drift moved. A polynomial of degree can vanish on all of them, so the error is zero after steps in exact arithmetic, and to the tolerance in practice. It cannot be zero sooner unless some of the coincide or the right-hand side has no component along some of them, which a random right-hand side always has.
So the first member’s count is not an estimate of the rank. It is the rank plus one, as long as three things hold: the drift’s directions are exactly in number, each moves its eigenvalue far enough from one that the tolerance cannot be met without resolving it, and the right-hand side touches all of them. The first of these is the assumption the growing rule and the reading rule share. The second is a matter of tolerance: an outlier moved by would be inside a tolerance from the start and would never be counted, and would cost nothing to ignore either. The third is why the right-hand sides here are random.
Each of the three can fail, and when one does the count is still a measurement, just of something else: the number of eigenvalues the tolerance cannot tolerate, which is the number of vectors worth keeping. That is a better quantity for the purpose than the rank, and the reading rule gets it for free. A Krylov space for a problem that is not linear leans on the same polynomial view from the other direction, where the count of steps a method takes is what its nonlinearity costs.
When one vector does not buy one iteration
The growing rule rests on a signal: that adding one vector makes the count fall. The earlier essay measured where that signal fails. When the drift’s directions turn by an angle from one member to the next, the kept vectors are slightly out of date, and “by an angle of a member a kept set no longer brings the count to one”. A rule that needs the count to fall by one each time it adds a vector is a rule that needs the law to hold exactly.
At a turn of a thousandth of a radian a member, one kept vector does not take off an iteration: the count stays at nine. The growing rule reads that as the end of the fall and stops, keeping one vector to the end of the sequence, which helps nothing and costs half an iteration a member: 231 iteration-equivalents against 216 for keeping none. The reading rule keeps eight, and the count drops to two and stays there, for 153 against the best fixed choice’s 158. At a turn of a hundredth the reading rule’s counts settle at three, at 178 against the best fixed 183, and the growing rule again keeps one. Every turning drift measured, at a thousandth, a hundredth and a tenth of a radian and at ranks 4 and 8, stops the growing rule at one vector.
The reason the reading rule survives is that it does not need the law to hold at every vector. It needs only the first count, which is a property of the drift alone, before anything is kept. Whether the kept vectors then deliver the full saving or part of it, the rule has chosen the number the best fixed choice would have chosen.
A drift with no rank to find
The earlier essay’s other drift spreads over the smaller half of the spectrum and grows with the sequence, so its count rises member by member: 27 at the first, 46 by the sixth, 55 by the last, with nothing kept. On that drift the growing rule never sees a fall to grow on. Its second member, with one vector kept, takes 33 iterations where the first took 27, the rule stops, and it ends with one vector and a total of 1,133 iteration-equivalents against 1,156 for keeping none. The reading rule reads 27, wants 26 vectors, is capped at 24, and brings the counts down to 13 to 17 a member, for a total of 822. The best fixed count measured is also 24, at 845.
This is the case the growing rule’s premise is furthest from, and it is also a common one: a sequence whose systems get harder as it proceeds, as a barrier method’s do near its end, has a count that rises whatever is kept. A rule that reads improvement as a fall in the count reads a rising count as no improvement, when in fact the kept vectors were taking off as much as they could from a count that would otherwise have risen faster. The comparison that would have told the truth is with the count the member would have taken without the vectors, and that count is never observed.
Both rules against the best a caller could do
Measured against the best fixed choice in every case, the least work any number of kept vectors from none to 24 reaches, the reading rule is at 0.95 to 0.98 on the fixed drifts, 0.97 on the wide drift and on the drifts turning a thousandth and a hundredth of a radian, and 1.07 at a tenth. The growing rule is at 1.13 to 1.25 on the fixed drifts, 1.34 on the wide one, 1.46 and 1.26 on the slow turns, and 1.07 at a tenth, where both rules are beaten by keeping nothing.
The one case the reading rule loses is the fast turn, where the kept vectors age between members faster than they help. At a turn of a tenth of a radian a member, a rank-4 drift keeps four vectors under the reading rule for 144 iteration-equivalents, where keeping none costs 120: a fifth too much. Nothing in the first count can see that, since the first count is taken before any vector has been kept or has aged. A program that wanted to guard against it would compare the second member’s count with the first, and drop the vectors if the saving was below their cost, which is a check on one member rather than a rule that climbs.
What this changes in a program
The earlier essays in this sequence priced the alternatives against each other. Where the drift lands found that the cost of a kept factor depends on which end of the spectrum the drift falls on. What a rebuild is worth priced factorising afresh against carrying the old factor, and a factorisation kept past its date found where the crossover lies. The kept vectors were the third option, and their size was the parameter left to the caller. This measurement takes it away from the caller. The first solve along a sequence reports its own iteration count, and on a low-rank drift that count is the rank plus one.
The same idea shows up elsewhere in the subject as a principle: a Krylov method’s iteration count is a reading of the spectrum, and a program that discards it has discarded a measurement. The problem that arrives again made the general case that a solve is one step of an outer loop and its by-products are inputs to the next step, and a warm start is degree zero found that even the previous answer, the simplest by-product, is worth an order of magnitude when it is used well. The penalty for keeping it is a ratio used a count in this way to price an incomplete factorisation’s ageing. Here it sets a size, and it sets it better than an adaptive rule that watches the counts over many members, because the many members are exactly the ones on which the law can be disturbed.
Put together, the recipe a program needs is two lines long. After the first member, keep one fewer vector than it took iterations, up to whatever the program can afford to store. After the second, compare its count with the first: if the vectors took off less than their own cost, which on these sequences is half an iteration each a member, drop them and solve the rest of the sequence with the factor alone. On every sequence measured here, that recipe lands within five per cent of the best fixed choice except on the fast turn, and the check on the second member is aimed at exactly that case. It is not measured here, which is why it appears below as a prediction and not as a result.
What one matrix and four ranks cannot tell
One matrix of order 80, one condition number, drifts of a chosen form whose rank is exact. On a drift whose rank is approximate, with a few large directions and a tail of small ones, the first count is plus whatever the tail costs, and the reading rule would keep vectors for the tail too; whether that over-keeps, and by how much, is not measured. The cap of 24 binds on the wide drift and nowhere else. The accounting charges each kept vector half an iteration a member, which is a model of a code whose products dominate; a code whose projections are expensive would move every ratio. And the sequences have 24 members: on a longer sequence the growing rule’s triangle is a smaller share of the whole, and its excess would fall toward the extra vector it keeps past the rank.
Still open: an approximate rank, and the barrier
A drift with a tail. Add to a rank-8 drift a second component on the next eight eigenvalues at a hundredth of its size. The prediction with a sign is that the first count is then between 12 and 17, that the reading rule keeps that many less one, and that its work is still within ten per cent of the best fixed count, because the tail’s directions each take off an iteration only once they are kept and cost no more to keep than the drift’s own.
The barrier sequence. On the sequence of what survives one step of the barrier, whose changing entries are a few diagonal values with directions that turn by large angles, the prediction is that the reading rule’s vectors save under one iteration in four, as the earlier essay predicted for any kept set, and that the reading rule’s own check on the second member, keep the vectors only if the saving exceeds their cost, drops them there and costs under five per cent more than keeping none.
What links here
Computed from the collection, not written here: the essays that point at this one.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- The rate the condition number predicts — both name conjugate gradients, krylov subspace, preconditioning
- A count that marks the edge and not the pace — both name conjugate gradients, preconditioning
- A guess worth two per cent — both name conjugate gradients, krylov subspace
- A preconditioner that arrives past the answer — both name conjugate gradients, preconditioning
- A preconditioner that changes sign — both name conjugate gradients, preconditioning
- A proof that does not ask how large the matrix is — both name conjugate gradients, krylov subspace
Named objects
A flat tag is an object no other essay names yet.
Cholesky factorisationConjugate gradientsEigenvalueKrylov subspacePreconditioningSequence of solves