Randomised, and the guarantee that changes kind

Counting what is inside a circle

A trace of a matrix nobody wants to form, integrated around a contour, gives an integer — how many eigenvalues are inside. It converges exponentially, it is estimated with random probes, and the probe block is a ceiling that the answer does not mention.

Worth reading first: Counting what cannot be looked at · A problem with infinitely many eigenvalues.

Counting what cannot be looked at is about a trace that has to be estimated because the matrix it belongs to is never formed. The estimator is Hutchinson’s: probe with random vectors, average zᵀAz, and the variance of the estimate is what the choice of probe distribution decides.

This essay is the same device with a stranger integrand and a much stranger answer. The trace being estimated is of T(z)⁻¹T′(z) for a matrix-valued function T; it is integrated around a closed contour; and what comes out is not a real number to be reported with an error bar but an integer — the number of eigenvalues inside.

Counting the eigenvalues inside a circle: an integral that is an integer once it has convergedThe number of eigenvalues of the delay problem inside |z| = 2, computed as (1/2πi)∮tr(T(z)⁻¹T′(z))dz by the trapezoidal rule. The true count is 2, from the closed form. The error runs 0.00282, 0.0572, 0.0151, 5.25·10⁻⁴, 3.6·10⁻⁷, 1.35·10⁻¹³ at 4 to 128 points — a straight line on this axis is a constant factor a doubling, and this falls faster than that, which is what exponential convergence looks like when the integrand is analytic on the contour. The answer is then ROUNDED, and 0 of the 6 quadratures round to the wrong integer while looking exactly as confident as the ones that do not. The only evidence available is the distance from the nearest integer, which is the quantity plotted.11.31.61.92.210⁻¹⁶10⁻¹³10⁻¹⁰10⁻⁷10⁻⁴10⁻¹10²log₁₀ quadrature pointsdistance from the true counthalf an eigenvaluean integer, eventuallytrue count2at 4 points2at 128 points2finest error1.4·10⁻¹³the integral is an integerand a rounding hides how far it was
Fig. 1 The distance from the true count against the number of quadrature points. The marks are coloured by whether the rounded answer is right, which is not the same question as whether the integral has converged.

Why the trace of that thing is a count

The argument principle says that for a function f analytic inside a contour except at its zeros, (1/2πi)∮ f′/f dz counts the zeros inside, with multiplicity. Take f = det T. Its logarithmic derivative is

(det T)′/det T = tr(T(z)⁻¹T′(z)),

by Jacobi’s formula, so the count is an integral of a trace and no determinant is ever formed — which matters, because a determinant of a matrix of any size is the number that decides nothing: it overflows before it is uninformative and is wrong long before it is absent.

The integrand costs n linear solves per quadrature point, in complex arithmetic, and it is the whole computation.

The convergence is exponential, which is why anyone bothers

On a circle, the integrand is analytic and periodic, and the trapezoidal rule on a periodic analytic function converges geometrically in the number of points rather than at the algebraic rate a Newton–Cotes rule gets on an interval. Measured, on a circle of radius two containing two eigenvalues of a delay problem:

4 points      5.7·10⁻²
8             1.5·10⁻²
16            5.3·10⁻⁴
32            3.6·10⁻⁷
64            3.6·10⁻⁷ → 128 points: 1.4·10⁻¹³

Each doubling buys more than the last. That is the entire economic case for contour methods: a hundred and twenty-eight solves of an n × n complex system buy thirteen digits of a quantity that would otherwise require finding the eigenvalues.

The rate depends on the distance from the contour to the nearest singularity, not on how many singularities are inside. A circle that passes close to an eigenvalue has a nearly singular integrand and needs several times as many points — at radius 1.5, which runs close to an eigenvalue at 1.587, a hundred and twenty-eight points reach only 7.6·10⁻⁴. Nothing about the count is harder there; the quadrature is.

And then it is rounded, which is where the trouble is

The count is an integer, so the natural last step is to round. The natural last step throws away the only diagnostic available.

At eight points on the radius-two circle the rounded answer is already right while the integral is 0.06 away from it — correct by luck, with two digits of margin. On a circle of radius four, which passes closer to the spectrum, eight points return a count of minus two where the answer is four.

A negative number of eigenvalues, from a routine that did not fail, warn or diverge. Nothing in the returned integer says which of those two situations it came from. The distance from the nearest integer does, it costs nothing, and it is the quantity this essay plots — for the same reason the residual the method reports is worth printing beside an iterate: the number a method returns and the number that says whether to believe it are different numbers.

The probes, and three ceilings

Counting is not usually the goal. Beyn’s method uses the same contour and the same solves to produce the eigenvalues themselves: form the moment

A₀ = (1/2πi) ∮ T(z)⁻¹V dz

for a random n × ℓ block V, and the eigenvalues fall out of its rank and its singular vectors. The random block is doing exactly what a sketch does in the dimension does not appear — capturing a subspace by hitting it with something generic — and it inherits the same failure mode.

How many eigenvalues a contour method can return: the probe block is a ceiling and does not say soBeyn's method probes the contour with a random 4 × ℓ block V and reads the eigenvalues out of the rank of ∮T(z)⁻¹V dz. That rank is at most ℓ whatever is inside, so a probe block narrower than the number of eigenvalues present returns ℓ of them — with small residuals, and with nothing in the returned object to say that there were more. Measured with 4 eigenvalues inside |z| = 4: the rank is 1, 2, 3, 4, 4 at ℓ = 1, 2, 3, 4, 5, rising with the probe count and then stopping at 4. A caller who asked for two gets two. The counting integral is the check that says so, and it costs one more pass round the same contour.1 probe12 probes23 probes34 probes45 probes44 insidea ceiling nothing announceseigenvalues inside4rank at 1 probe1rank at 5 probes4the binding ceiling4the residuals are smalland half the answer is missing
Fig. 2 The rank of the probed moment against the number of probes, with four eigenvalues inside. It rises, and then it stops, and the returned object does not say which ceiling stopped it.

Measured with four eigenvalues inside: the rank is 1, 2, 3, 4, 4 at ℓ = 1 to 5.

Ceiling one: the probe count. A caller who asks for two eigenvalues gets two — both genuine, both with small residuals — and nothing reports that there were four. This is the same shape as the sketch that is spent: a random probe carries a fixed budget of information, and asking it for more than it holds returns something plausible.

Ceiling two: the number actually inside. Past ℓ = 4 the rank stops rising, which is the good case — the method has everything and extra probes cost solves for nothing.

Ceiling three, and it is the one nobody predicts: the size of the matrix. The moment is n × ℓ, so its rank cannot exceed n. On a circle of radius five containing twelve eigenvalues of a four-by-four problem, the rank stops at four however many probes are used. The first moment cannot represent more than n eigenvalues; recovering the rest needs higher moments — ∮z^k T⁻¹V dz — rather than a wider block, and a caller who responds to a saturated rank by adding probes is buying nothing at all.

Three ceilings, one number, and no way to tell them apart from the result. The counting integral distinguishes them, it uses the same integrand, and it costs one more pass round the same contour.

What the integrand costs, and what it is compared against

Every quantity above rests on the trace being right, and the trace is the one thing here that could be silently wrong: a complex solve at a point where T is nearly singular, n of them per quadrature point, summed around a contour, with cancellation between contributions of opposite sign.

So it is computed twice. The first route embeds the complex system in a real one of twice the size — [[Re, −Im], [Im, Re]] against [xᵣ; xᵢ] — and calls the same pivoted elimination everything else on this site calls. The second uses the fact that, for the family drawn here, T is a symmetric matrix plus a scalar multiple of the identity, so T⁻¹T′ has eigenvalues in closed form and the trace is a sum of n divisions.

They agree to 5.6·10⁻¹⁵ at sixteen points around a contour. One is sixteen solves of an 8 × 8 real system; the other is sixteen sums of four quotients. Nothing is shared, which is what makes the agreement mean something — and the second route exists only for the restricted family, which is exactly why the family was restricted.

The cost, counted honestly

A contour method looks expensive and the arithmetic says otherwise, provided the right thing is being counted.

Per quadrature point: one factorisation of T(z), which is complex and n × n — so, through the real embedding, one factorisation of a 2n × 2n real matrix, at eight times the cost of an n × n one. Then ℓ solves for the probe block, or n for the trace. At 32 points that is 32 factorisations, which for n in the thousands is the whole budget.

Against what? For a problem with infinitely many eigenvalues there is no alternative to compare with, which is the honest answer and also the uncomfortable one: this is not a faster route to something a direct method could have done, it is the only route to a question a direct method cannot pose. The comparison worth making is with the other narrow question — Newton from a starting guess, at one factorisation per step, converging quadratically to one eigenvalue that may not be the one it was pointed at. Thirty factorisations for every eigenvalue in a region, against five for one eigenvalue near a point, and the choice is decided by how many are wanted rather than by any rate.

Two integers from one contour

A detail worth having, since it costs nothing and is the practical use of the count.

The moment A₀ gives the eigenvalues; the count N gives how many there should be. Running both means the rank of A₀ can be compared with an independently computed integer, and the three ceilings above become distinguishable:

  • rank < ℓ and rank = N — the method has everything and the probes were sufficient.
  • rank = ℓ < N — the probe block is the binding ceiling; widen it.
  • rank = n < N — the size is the binding ceiling; higher moments are needed and a wider block will not help.

That is a decision procedure made out of two integers, both exact, from one pass of the same factorisations. It is the same pattern an eigenvalue count that cannot be slightly wrong sets out for a symmetric matrix: an integer that is either right or wrong by a whole unit is a far better diagnostic than a real number that is approximately right, because it can be checked against another integer rather than compared against a tolerance.

What the randomisation is and is not doing

Worth separating, because this method is randomised in a narrower way than most of the field.

The random block is not reducing a dimension. It is not a Johnson–Lindenstrauss embedding and there is no distortion bound: nothing here is claiming that a subspace is approximately preserved. What V does is guarantee, with probability one, that the columns of the moment span the whole eigenspace the contour encloses — a genericity argument rather than a concentration one.

So the quantity that behaves probabilistically is rank, not accuracy. A badly chosen V does not give a slightly worse answer; it gives an answer of the wrong dimension, which is a discrete failure and is exactly what randomisation does not create structure warns about from the other direction. The eigenvalues that do come back are as accurate as the quadrature — measured against a Lambert closed form, to the rounding level once the contour is resolved.

And the seed matters in the way an answer that changes with the seed describes: two runs with different V return the same eigenvalues to the rounding level when ℓ is large enough, and different subsets when it is not. A method whose answer changes with the seed in its cardinality is a different animal from one whose answer changes in its fifteenth digit.

Where the estimate is exact and where it is not

One more separation, because this essay sits in a field about bounds that hold with probability.

The count is not an estimate. Once the quadrature has converged it is exact — an integer, obtained by rounding a number that is within 10⁻¹³ of it, with the distance printed. Nothing about it holds “with probability”, and no probe is involved: the count needs the trace, and the trace is computed by n solves rather than sampled.

The eigenvalues are where the randomness enters, and there the guarantee is the discrete one above. So a run of Beyn’s method contains a deterministic exact integer and a randomised set whose size is bounded by it, and the useful discipline is to compute the first and check the second against it. That is the shape a bound that holds with probability recommends in general — know which of the numbers in hand is the guaranteed one — arriving here with an unusually clean division between them.

What this does to the field’s own habit

The randomised field on this site has a discipline: state what is guaranteed, state with what probability, and measure whether the bound is attained. Every essay in it — a bound that holds with probability onwards — reports a failure probability and a distortion, because those are the currency.

This method does not fit that currency, and the mismatch is worth recording rather than smoothing over. There is no ε, no δ, and no failure probability that shrinks with oversampling. There is a genericity argument that holds with probability one, a discrete rank that is either sufficient or not, and a deterministic integer beside it. Oversampling — the standard lever, priced in built from products alone — buys nothing here once ℓ exceeds the count, and buys everything until it does. The curve is a step rather than a slope.

That is a genuinely different shape of randomised method, and the reason it is worth its own essay in this field rather than a paragraph in the polynomial one.

Where the contour goes, which is the only real decision

Everything else here is machinery; the placement of the contour is judgement, and it decides both of the quantities the method returns.

It sets ρ, the distance to the nearest eigenvalue, and therefore the convergence rate — measured at nine orders of difference between a circle in a gap and one across it. It sets how many eigenvalues are inside, and therefore the probe count needed. And it sets what the answer means: a contour drawn around a region of physical interest returns a physically meaningful count, and one drawn for numerical convenience returns a number about a disc.

The uncomfortable part is that all three want different things. A contour placed to avoid the spectrum converges fast and may enclose the wrong set; one placed around the interesting region may pass arbitrarily close to an eigenvalue. There is no rule, and the honest practice is the one the measurement supports: place the contour for the question, then read the distance from the nearest integer, then move it if that distance is not small.

At other settings

Counting the eigenvalues inside a circle: an integral that is an integer once it has convergedThe number of eigenvalues of the delay problem inside |z| = 1.5, computed as (1/2πi)∮tr(T(z)⁻¹T′(z))dz by the trapezoidal rule. The true count is 1, from the closed form. The error runs 0.473, 0.39, 0.289, 0.142, 0.0268, 7.58·10⁻⁴ at 4 to 128 points — a straight line on this axis is a constant factor a doubling, and this falls faster than that, which is what exponential convergence looks like when the integrand is analytic on the contour. The answer is then ROUNDED, and 0 of the 6 quadratures round to the wrong integer while looking exactly as confident as the ones that do not. The only evidence available is the distance from the nearest integer, which is the quantity plotted.11.31.61.92.210⁻¹⁶10⁻¹³10⁻¹⁰10⁻⁷10⁻⁴10⁻¹10²log₁₀ quadrature pointsdistance from the true counthalf an eigenvaluean integer, eventuallytrue count1at 4 points1at 128 points1finest error7.6·10⁻⁴the integral is an integerand a rounding hides how far it was
Fig. 3 A contour running close to an eigenvalue: the same exponential rate, several times slower.
Counting the eigenvalues inside a circle: an integral that is an integer once it has convergedThe number of eigenvalues of the delay problem inside |z| = 3, computed as (1/2πi)∮tr(T(z)⁻¹T′(z))dz by the trapezoidal rule. The true count is 3, from the closed form. The error runs 0.151, 0.532, 0.0874, 0.0263, 8.44·10⁻⁴, 7.21·10⁻⁷ at 4 to 128 points — a straight line on this axis is a constant factor a doubling, and this falls faster than that, which is what exponential convergence looks like when the integrand is analytic on the contour. The answer is then ROUNDED, and 1 of the 6 quadratures round to the wrong integer while looking exactly as confident as the ones that do not. The only evidence available is the distance from the nearest integer, which is the quantity plotted.11.31.61.92.210⁻¹⁶10⁻¹³10⁻¹⁰10⁻⁷10⁻⁴10⁻¹10²log₁₀ quadrature pointsdistance from the true counthalf an eigenvaluean integer, eventuallytrue count3at 4 points3at 128 points3finest error7.2·10⁻⁷the integral is an integerand a rounding hides how far it was
Fig. 4 Three eigenvalues inside, and a sixteen-point rule that rounds to two.
Counting the eigenvalues inside a circle: an integral that is an integer once it has convergedThe number of eigenvalues of the delay problem inside |z| = 4, computed as (1/2πi)∮tr(T(z)⁻¹T′(z))dz by the trapezoidal rule. The true count is 4, from the closed form. The error runs 2.23, 5.64, 1.38, 0.167, 0.00222, 0.00483 at 4 to 128 points — a straight line on this axis is a constant factor a doubling, and this falls faster than that, which is what exponential convergence looks like when the integrand is analytic on the contour. The answer is then ROUNDED, and 3 of the 6 quadratures round to the wrong integer while looking exactly as confident as the ones that do not. The only evidence available is the distance from the nearest integer, which is the quantity plotted.11.31.61.92.210⁻¹⁶10⁻¹³10⁻¹⁰10⁻⁷10⁻⁴10⁻¹10²log₁₀ quadrature pointsdistance from the true counthalf an eigenvaluean integer, eventuallytrue count4at 4 points6at 128 points4finest error0.0048the integral is an integerand a rounding hides how far it was
Fig. 5 And the circle where eight points return minus two.
How many eigenvalues a contour method can return: the probe block is a ceiling and does not say soBeyn's method probes the contour with a random 4 × ℓ block V and reads the eigenvalues out of the rank of ∮T(z)⁻¹V dz. That rank is at most ℓ whatever is inside, so a probe block narrower than the number of eigenvalues present returns ℓ of them — with small residuals, and with nothing in the returned object to say that there were more. Measured with 2 eigenvalues inside |z| = 2: the rank is 1, 2, 2, 2, 2 at ℓ = 1, 2, 3, 4, 5, rising with the probe count and then stopping at 2. A caller who asked for two gets two. The counting integral is the check that says so, and it costs one more pass round the same contour.1 probe12 probes23 probes24 probes25 probes22 insidea ceiling nothing announceseigenvalues inside2rank at 1 probe1rank at 5 probes2the binding ceiling2the residuals are smalland half the answer is missing
Fig. 6 Two eigenvalues inside: two probes are enough and the third buys nothing.
How many eigenvalues a contour method can return: the probe block is a ceiling and does not say soBeyn's method probes the contour with a random 4 × ℓ block V and reads the eigenvalues out of the rank of ∮T(z)⁻¹V dz. That rank is at most ℓ whatever is inside, so a probe block narrower than the number of eigenvalues present returns ℓ of them — with small residuals, and with nothing in the returned object to say that there were more. Measured with 12 eigenvalues inside |z| = 5: the rank is 1, 2, 3, 4, 4 at ℓ = 1, 2, 3, 4, 5, rising with the probe count and then stopping at 4, which is the SIZE of the problem rather than the number of eigenvalues — a second ceiling, because an 4 × ℓ block cannot have rank above 4 whatever is inside the contour. A caller who asked for two gets two. The counting integral is the check that says so, and it costs one more pass round the same contour.1 probe12 probes23 probes34 probes45 probes44 rowsa ceiling nothing announceseigenvalues inside12rank at 1 probe1rank at 5 probes4the binding ceiling4the residuals are smalland half the answer is missing
Fig. 7 Twelve inside a four-by-four problem, where the size of the matrix is the binding ceiling.
A spectrum with no last eigenvalue: 12 of the infinitely many solutions of a delay problemT(λ) = A − λI + 1e^−λI for the model matrix at n = 4. The problem decouples in A's eigenvector basis, so each of its 4 eigenvalues μ contributes the scalar equation μ − λ + γe^−λ = 0, whose solutions are λ = μ + W_k(γe^−μ) — one for every branch of the Lambert W function, and therefore countably infinitely many, running off to the left along two curves. The marks are the closed form, each checked by substitution to 1.6·10⁻¹⁵. There is no computation that returns this set: the only well-posed question is which eigenvalues lie inside a region, and the circle of radius 4 contains 4 of them.-2-101234-5-3-1135real partimaginary part4 insidea countable spectruminside the contour4drawn12existingworst branch residual1.6·10⁻¹⁵there is no last eigenvalueso the question has to change
Fig. 8 The spectrum being counted, which is countably infinite.
A spectrum with no last eigenvalue: 12 of the infinitely many solutions of a delay problemT(λ) = A − λI + 5e^−λI for the model matrix at n = 4. The problem decouples in A's eigenvector basis, so each of its 4 eigenvalues μ contributes the scalar equation μ − λ + γe^−λ = 0, whose solutions are λ = μ + W_k(γe^−μ) — one for every branch of the Lambert W function, and therefore countably infinitely many, running off to the left along two curves. The marks are the closed form, each checked by substitution to 1.7·10⁻¹⁵. There is no computation that returns this set: the only well-posed question is which eigenvalues lie inside a region, and the circle of radius 4 contains 6 of them.01234-5-3-1135real partimaginary part6 insidea countable spectruminside the contour6drawn12existingworst branch residual1.7·10⁻¹⁵there is no last eigenvalueso the question has to change
Fig. 9 And the same problem with a stronger delay term.
Two trace estimators against their budget, on a 80×80 matrix whose spectrum decays at 0.85Two curves of relative error against the number of products with A, both axes logarithmic, as medians over 32 seeds. Hutchinson's fitted exponent is -0.54 and Hutch++'s is -2.55. The deflation changes the exponent rather than the constant, which is what makes it worth two thirds of the budget.10¹10²10⁻⁴10⁻³10⁻²10⁻¹1products with Arelative errorHutchinsonHutch++measured at equal costfitted rate, Hutchinson-0.54fitted rate, Hutch++-2.5error at 96, Hutchinson0.024error at 96, Hutch++4.4·10⁻⁴both axes count products with Aso the sketch is paid for in the picture
Fig. 10 The trace estimator this one descends from, with its variance against the number of probes.
160 single-probe estimates of one 40×40 trace, from the two standard probe distributionsTwo clouds of points, each one estimate of the trace from one random vector. Both are centred on the true value of 171.14 — the estimator has no bias at all — and the dashed bands are the standard deviation each distribution is known in closed form to have: 59.14 for the ±1 probe and 72.01 for the normal one. Measured over these draws they come out 56.68 and 68.57.027548110813544119.306194.613269.919345.226420.532drawzᵀAz from one probenormal±1two routes to one spreadthe trace171±1 spread, predicted59±1 spread, measured57normal ÷ ±11.2no bias in either cloudand one of them is narrower for a reason
Fig. 11 What the choice of probe distribution is worth there.
Random numbers a sketch needs, against the number of indices, at n = 8A dense Gaussian sketch of a mode-k unfolding multiplies an n × n^{d−1} matrix by a random one with n^{d−1} rows, so the random object is the size of the tensor divided by n — the line that crosses the tensor's own entry count at d = 2 and is 1.51·10⁸ by d = 8. A Khatri–Rao sketch replaces it with d − 1 small Gaussians per column, costing 4,032 numbers at the same point — a factor of 3.74·10⁴ — and is applied as mode products, so nothing the size of the tensor is ever formed. What it is not is Gaussian, which is what the previous figure has to measure rather than bound.12345678910¹10³10⁵10⁷number of indicesrandom numbers drawna dense Gaussian sketchdashes: the tensor's own entriesa Khatri–Rao sketcha random matrix nobody can afforddense at d = 81.5·10⁸structured4032the tensor's entries1.7·10⁷dense ⁄ structured3.7·10⁴crossing at d2the sketch outgrows its tensorand the structured one does not
Fig. 12 A sketch drawn, in the field’s opening essay.
The error of a rank-4 Tucker representation built from a sketch, against the columns of oversamplingThe flat line is the deterministic decomposition — d matrix SVDs — at 8.81·10⁻⁴, and nothing random can go below it, since every curve here is a projection onto a subspace of the same size. The upper two are medians over five seeds: a dense Gaussian sketch, which the randomised field's bounds cover, and a Khatri–Rao sketch, whose columns are outer products of small random vectors and which no bound in that field applies to. With no oversampling the dense sketch is 3.65 times the deterministic answer; at twelve extra columns it is 1.15. The structured one costs 6.8 per cent more at four extra columns and 9.5 per cent at twelve — measured, because there is nothing else to say about it.-113579111310⁻³10⁻²extra columns in the sketchrelative errora Khatri–Rao sketch: no bound covers ita dense Gaussian sketchthe decomposition, which nothing beatsrank 4, five seedsdeterministic8.8·10⁻⁴dense, p = 00.0032dense, p = 120.001structured, p = 120.0011structured ⁄ dense1.1a bound and a measurementand only one of them is available
Fig. 13 And what oversampling buys a randomised method.
ν(σ), the number of eigenvalues below σ, counted from the signs of an unpivoted LDLᵀThe staircase is the number of negative pivots in an LDLᵀ factorisation of A − σI, taken with no pivoting at all. Congruence preserves the signs, so that count is the number of eigenvalues below σ — Sylvester's law of inertia, used as an algorithm. The vertical marks are the 10 eigenvalues a Jacobi decomposition returns, which is a completely different computation; every step of the staircase is at one of them and every one of them has a step. Over 2000 shifts placed at random across the interval the two answers disagree 0 times. That is not a statement about a tolerance: the output is a count, so it is exactly right or wrong by a whole eigenvalue, and there is nothing in between for a rounding error to land in.-3-1.84971-0.6994290.4508571.601142.751433.901710246810shift σν(σ)an answer that is an integershifts2000disagreements0eigenvalues10steps10the marks are a Jacobi decompositionand the staircase never saw one
Fig. 14 An eigenvalue count from an inertia rather than an integral.
The share of shifts inside a pair of eigenvalues that count it wrongly, against the pair's separationTwo eigenvalues at 1 and 1 + gap, with six others spread around them, and 100 shifts placed strictly between the pair — where the count must read 3. Down to a separation of 10⁻¹² every shift reads it correctly. At 10⁻¹³ one of 100 does not, at 10⁻¹⁴ 30 do not, and at 10⁻¹⁵ none of them reads it correctly. The boundary sits where n‖A‖u puts it — 4.859·10⁵ for this matrix — because the floating-point count is the exact count of a matrix within that distance of A. This is the only place in the method where the answer can be wrong**, and it is wrong by a whole eigenvalue when it is: the failure is a miscount, not a small error.-15-13-11-9-7-5-300.250.50.751log₁₀ separation of the pairshare of shifts counted wronglyn‖A‖uthe only place it failswrong at 10⁻¹²0wrong at 10⁻¹⁴30wrong at 10⁻¹⁵100n‖A‖u4.9·10⁵wrong by a whole eigenvalueor not wrong at all
Fig. 15 And the band where that one stops being exact.
log₁₀|det H_n| by three routes, to n = 30The exact rational determinant of the Hilbert matrix falls to 10^-518 at n = 30. The accumulated logarithm of the pivots follows it to n = 13 and then departs, reaching 10^-352 — wrong by 166 orders of magnitude and still an ordinary-looking number. The product of the pivots is a separate curve that ends at n = 29, where it underflows to exactly zero.26101418222630-550-450-350-250-150-50nlog₁₀|det H_n|exact rationalΣ log|u_ii|Π u_iithree routes, one theoremexact at the largest n-518accumulated logarithm-352decades of disagreement166smallest pivot at that n1.2·10⁻¹⁷every pivot is a normal numberat every size on this axis
Fig. 16 The determinant this method carefully never forms.
Where the missing eigenvalues went: an 6 × 6 quadratic with 1 of its masses removedA chain of 6 masses with the first 1 of them set to zero, so M is singular of rank 5. det Q(λ) is a polynomial of degree at most 12; interpolated exactly in BigInt rationals at 13 nodes it has degree 11, so 1 of the 12 eigenvalues are at infinity — the same object a descriptor pencil has, arriving here because a degree of freedom with no inertia is an algebraic constraint. The float route counts the singular values of M judged to be zero and reaches 1, backed by a gap of ∞ between consecutive singular values. One integer, two routes, and only the second of them is a decision.finite eigenvalues (degree of det Q)11at infinity (2n − degree)1at infinity, by the rank of M12n, if M were nonsingular12a degree, not a decisiondegree of det Q11at infinity1by the rank of M1singular-value gapthe count is a degreeand the other route is a judgement
Fig. 17 A count that is a degree, from the polynomial field.
The 16 eigenvalues of an 8 × 8 quadratic eigenvalue problem, computed and in closed formλ²M + λC + K for a chain of 8 masses with C = 0.3M + 0.1K. The crosses are the closed form — one scalar quadratic per eigenvalue of K, whose roots are known exactly — and the discs are the eigenvalues a real Schur factorisation returns from the 16 × 16 first companion linearisation. There are 16 of them for a matrix with 8 rows, of which 16 are complex and arrive in conjugate pairs, so the eigenvectors cannot be independent: 9 vectors in 8 dimensions never are. The worst disagreement between the two routes is 2.12·10⁻¹⁵, and the routes share nothing but the three coefficient matrices.00.0939569-2-1.24498-0.4899610.2650581.020081.7751real partimaginary parttwo routes, one spectrumeigenvalues16rows8complex16against the closed form2.1·10⁻¹⁵n rows and 2n eigenvaluesso the eigenvectors are not a basis
Fig. 18 And a spectrum that is finite, for comparison.
Counting the eigenvalues inside a circle: an integral that is an integer once it has convergedThe number of eigenvalues of the delay problem inside |z| = 2, computed as (1/2πi)∮tr(T(z)⁻¹T′(z))dz by the trapezoidal rule. The true count is 2, from the closed form. The error runs 0.00282, 0.0572, 0.0151, 5.25·10⁻⁴, 3.6·10⁻⁷, 1.35·10⁻¹³ at 4 to 128 points — a straight line on this axis is a constant factor a doubling, and this falls faster than that, which is what exponential convergence looks like when the integrand is analytic on the contour. The answer is then ROUNDED, and 0 of the 6 quadratures round to the wrong integer while looking exactly as confident as the ones that do not. The only evidence available is the distance from the nearest integer, which is the quantity plotted.11.31.61.92.210⁻¹⁶10⁻¹³10⁻¹⁰10⁻⁷10⁻⁴10⁻¹10²log₁₀ quadrature pointsdistance from the true counthalf an eigenvaluean integer, eventuallytrue count2at 4 points2at 128 points2finest error1.4·10⁻¹³the integral is an integerand a rounding hides how far it was
Fig. 19 The exponential convergence on a well-placed contour, at the resolution the essay quotes.
How many eigenvalues a contour method can return: the probe block is a ceiling and does not say soBeyn's method probes the contour with a random 4 × ℓ block V and reads the eigenvalues out of the rank of ∮T(z)⁻¹V dz. That rank is at most ℓ whatever is inside, so a probe block narrower than the number of eigenvalues present returns ℓ of them — with small residuals, and with nothing in the returned object to say that there were more. Measured with 3 eigenvalues inside |z| = 3: the rank is 1, 2, 3, 3, 3 at ℓ = 1, 2, 3, 4, 5, rising with the probe count and then stopping at 3. A caller who asked for two gets two. The counting integral is the check that says so, and it costs one more pass round the same contour.1 probe12 probes23 probes34 probes35 probes33 insidea ceiling nothing announceseigenvalues inside3rank at 1 probe1rank at 5 probes3the binding ceiling3the residuals are smalland half the answer is missing
Fig. 20 Three eigenvalues inside, where the ceiling binds at three.
A spectrum with no last eigenvalue: 12 of the infinitely many solutions of a delay problemT(λ) = A − λI + 2e^−λI for the model matrix at n = 4. The problem decouples in A's eigenvector basis, so each of its 4 eigenvalues μ contributes the scalar equation μ − λ + γe^−λ = 0, whose solutions are λ = μ + W_k(γe^−μ) — one for every branch of the Lambert W function, and therefore countably infinitely many, running off to the left along two curves. The marks are the closed form, each checked by substitution to 1.8·10⁻¹⁵. There is no computation that returns this set: the only well-posed question is which eigenvalues lie inside a region, and the circle of radius 4 contains 6 of them.-101234-5-3-1135real partimaginary part6 insidea countable spectruminside the contour6drawn12existingworst branch residual1.8·10⁻¹⁵there is no last eigenvalueso the question has to change
Fig. 21 The spectrum whose members are being counted.
A spectrum with no last eigenvalue: 12 of the infinitely many solutions of a delay problemT(λ) = A − λI + 0.5e^−λI for the model matrix at n = 4. The problem decouples in A's eigenvector basis, so each of its 4 eigenvalues μ contributes the scalar equation μ − λ + γe^−λ = 0, whose solutions are λ = μ + W_k(γe^−μ) — one for every branch of the Lambert W function, and therefore countably infinitely many, running off to the left along two curves. The marks are the closed form, each checked by substitution to 1.2·10⁻¹⁵. There is no computation that returns this set: the only well-posed question is which eigenvalues lie inside a region, and the circle of radius 4 contains 4 of them.-3-2-101234-5-3-1135real partimaginary part4 insidea countable spectruminside the contour4drawn12existingworst branch residual1.2·10⁻¹⁵there is no last eigenvalueso the question has to change
Fig. 22 And the same problem with a weaker delay term, where a fixed contour holds fewer.
Two trace estimators against their budget, on a 80×80 matrix whose spectrum decays at 0.95Two curves of relative error against the number of products with A, both axes logarithmic, as medians over 32 seeds. Hutchinson's fitted exponent is -0.50 and Hutch++'s is -1.03. The deflation changes the exponent rather than the constant, which is what makes it worth two thirds of the budget.10¹10²10⁻³10⁻²10⁻¹1products with Arelative errorHutchinsonHutch++measured at equal costfitted rate, Hutchinson-0.5fitted rate, Hutch++-1error at 96, Hutchinson0.0086error at 96, Hutch++0.0055both axes count products with Aso the sketch is paid for in the picture
Fig. 23 A trace estimator’s variance against the number of probes, in the essay this one descends from.
160 single-probe estimates of one 120×120 trace, from the two standard probe distributionsTwo clouds of points, each one estimate of the trace from one random vector. Both are centred on the true value of 644.26 — the estimator has no bias at all — and the dashed bands are the standard deviation each distribution is known in closed form to have: 198.6 for the ±1 probe and 217.1 for the normal one. Measured over these draws they come out 227.1 and 205.3.0275481108135243534.65826.31117.951409.61701.25drawzᵀAz from one probenormal±1two routes to one spreadthe trace644±1 spread, predicted199±1 spread, measured227normal ÷ ±11.1no bias in either cloudand one of them is narrower for a reason
Fig. 24 What the choice of probe distribution is worth there.
What each round of sketch-and-deflate actually sees, for a sketch kept, half redrawn, and redrawnA randomised range finder forms Y = AΩ, takes Q spanning it, and deflates: A ← A − QQᵀA. With the same Ω the next sketch is A₂Ω = AΩ − QQᵀ(AΩ) = Y − QQᵀY, which is zero exactly, because Q spans Y. Measured, the kept sketch sees 2.62 at the first round and 9.03·10⁻¹⁵ at the second — the unit roundoff, which is to say nothing at all, and the subspace it produces after that is whatever the rounding error happened to point at. A fresh sketch stays at about 3.3, and redrawing half the columns sees about half as much. After 5 rounds of identical arithmetic the kept run is at 0.2845 and the redrawn one at 0.1126.012345610⁻¹⁶10⁻¹³10⁻¹⁰10⁻⁷10⁻⁴10⁻¹round‖AΩ‖ ⁄ ‖A‖ at that roundredrawn each roundhalf redrawnkept: the sketch is now the zero matrixthe randomness is spentkept, round 12.6kept, round 29·10⁻¹⁵redrawn, round 23.1kept, final error0.28redrawn, final error0.11a random matrix used twiceis not random the second time
Fig. 25 A sketch that captures a subspace, which is what the probe block is doing here.
What extra columns buy a construction that never sees the matrix, over five seedsThe band is the range across five seeds and the line is their mean; the flat lower line is the best representation of rank 8 there is, which a decomposition of every block would find. With no oversampling the construction is 11.6 times behind it and the spread across seeds is 44 per cent of the mean. Eight extra columns bring it to 3.0× and the spread to 12 per cent. Both halves matter and only one of them is visible in a single run: what oversampling buys is a better answer and a more predictable one, and a figure drawn from one seed would have shown the first and hidden the second. No draw is ever better than the flat line, which is the check that the comparison is honest — a sample cannot beat the decomposition it is approximating.048121610⁻⁸10⁻⁷10⁻⁶10⁻⁵extra columns in the sample, p‖A − A_H‖ ⁄ ‖A‖the best rank-8 representationfive draws, mean and rangea band, not a lineexcess at p = 012excess at p = 83spread at p = 00.44spread at p = 80.12the optimum of this rank7.8·10⁻⁸one seed shows the meanand five show the risk
Fig. 26 And what oversampling buys when the guarantee is a distortion rather than a rank.
The randomised SVD against the optimum it cannot beatA semi-logarithmic plot of approximation error against target rank. A shaded band shows the spread across seeds, a solid line the optimal error from the exact singular values, and a dashed line the published probabilistic bound well above both.04812162010⁻¹10⁻⁰.⁵1target rank k‖A − A_k‖₂published boundrandomisedσₖ₊₁, optimalhow far apart the three areworst seed spread1.6bound / median at k = 125.9median / optimum at k = 121.960×60, 6 seeds, oversampling p = 5band is best to worst
Fig. 27 A randomised approximation’s error against its target.
log₁₀|det H_n| by three routes, to n = 26The exact rational determinant of the Hilbert matrix falls to 10^-387 at n = 26. The accumulated logarithm of the pivots follows it to n = 13 and then departs, reaching 10^-289 — wrong by 98 orders of magnitude and still an ordinary-looking number. The product of the pivots is a separate curve that ends at n = 26, where it underflows to exactly zero.261014182226-400-300-200-1000nlog₁₀|det H_n|exact rationalΣ log|u_ii|Π u_iithree routes, one theoremexact at the largest n-387accumulated logarithm-289decades of disagreement98smallest pivot at that n3.1·10⁻¹⁸every pivot is a normal numberat every size on this axis
Fig. 28 The determinant this method never forms.
The 16 eigenvalues of an 8 × 8 quadratic eigenvalue problem, computed and in closed formλ²M + λC + K for a chain of 8 masses with C = 0.3M + 0.1K. The crosses are the closed form — one scalar quadratic per eigenvalue of K, whose roots are known exactly — and the discs are the eigenvalues a real Schur factorisation returns from the 16 × 16 first companion linearisation. There are 16 of them for a matrix with 8 rows, of which 16 are complex and arrive in conjugate pairs, so the eigenvectors cannot be independent: 9 vectors in 8 dimensions never are. The worst disagreement between the two routes is 2.12·10⁻¹⁵, and the routes share nothing but the three coefficient matrices.00.0939569-2-1.24498-0.4899610.2650581.020081.7751real partimaginary parttwo routes, one spectrumeigenvalues16rows8complex16against the closed form2.1·10⁻¹⁵n rows and 2n eigenvaluesso the eigenvectors are not a basis
Fig. 29 And a spectrum that is finite, where counting is not the interesting question.
Counting the eigenvalues inside a circle: an integral that is an integer once it has convergedThe number of eigenvalues of the delay problem inside |z| = 5, computed as (1/2πi)∮tr(T(z)⁻¹T′(z))dz by the trapezoidal rule. The true count is 12, from the closed form. The error runs 1.81, 3.37, 0.706, 0.0412, 0.0052, 1.43·10⁻⁵ at 4 to 128 points — a straight line on this axis is a constant factor a doubling, and this falls faster than that, which is what exponential convergence looks like when the integrand is analytic on the contour. The answer is then ROUNDED, and 3 of the 6 quadratures round to the wrong integer while looking exactly as confident as the ones that do not. The only evidence available is the distance from the nearest integer, which is the quantity plotted.11.31.61.92.210⁻¹⁶10⁻¹³10⁻¹⁰10⁻⁷10⁻⁴10⁻¹10²log₁₀ quadrature pointsdistance from the true counthalf an eigenvaluean integer, eventuallytrue count12at 4 points10at 128 points12finest error1.4·10⁻⁵the integral is an integerand a rounding hides how far it was
Fig. 30 Twelve eigenvalues inside, where the count is largest.
How many eigenvalues a contour method can return: the probe block is a ceiling and does not say soBeyn's method probes the contour with a random 4 × ℓ block V and reads the eigenvalues out of the rank of ∮T(z)⁻¹V dz. That rank is at most ℓ whatever is inside, so a probe block narrower than the number of eigenvalues present returns ℓ of them — with small residuals, and with nothing in the returned object to say that there were more. Measured with 2 eigenvalues inside |z| = 2: the rank is 1, 2, 2, 2, 2 at ℓ = 1, 2, 3, 4, 5, rising with the probe count and then stopping at 2. A caller who asked for two gets two. The counting integral is the check that says so, and it costs one more pass round the same contour.1 probe12 probes23 probes24 probes25 probes22 insidea ceiling nothing announceseigenvalues inside2rank at 1 probe1rank at 5 probes2the binding ceiling2the residuals are smalland half the answer is missing
Fig. 31 And the smallest contour, where two probes are enough.

What links here

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

Named objects

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

Argument principleComplex arithmeticContour integralNonlinear eigenvalue problemQuadratureRandom probeRankTrace estimation