Two errors, and whose fault they are

The vector moves with its eigenvalue

The Sylvester–Kac matrix's middle eigenvectors came back exact to fourteen digits by inverse iteration while their eigenvalues lost eleven, and the route LAPACK uses — back substitution in the computed Schur form, then the accumulated orthogonal transformation — was predicted to lose them, at about the eigenvalue's error divided by the gap of two: 10⁻⁵ at order 80. It does, at 2.3·10⁻⁵, so the route is the whole of the difference: nine orders of magnitude between two ways of computing the same vectors from the same eigenvalues. The constant is not one over the gap. On all 274 eigenvectors whose eigenvalues are off by more than 10⁻¹¹, at every order from 40 to 80, the Schur route's error is 0.76 to 0.84 times its eigenvalue's error, and 0.79 is a number the exact vectors carry: how fast a unit Krawtchouk vector turns as its eigenvalue moves. The Schur route returns the right eigenvector of a wrong eigenvalue.

Worth reading first: An answer that is known · A backward-stable answer to a problem nobody asked · The eigenvalues that are not there.

The middle eigenvectors come back exact put the Sylvester–Kac matrix’s eigenvectors against the exact ones, which are Krawtchouk polynomials evaluated at the integers and can be computed in rational arithmetic to any order. It found that a feared loss did not happen. The matrix’s middle eigenvalues lose up to eleven digits at order 80 — they are the most ill-conditioned — and their eigenvectors, computed by three steps of inverse iteration with the computed eigenvalue as the shift, from a random start, are exact to fourteen digits at every order. An earlier result that looked like a loss had been a start vector with no component along half the eigenvectors.

Its closing section named the route on which the loss should happen after all: “Back substitution in the computed quasi-triangular factor and multiplication by the accumulated orthogonal transformation is how LAPACK computes eigenvectors, and it inherits the similarity’s backward error. The prediction with a sign is that on that route the middle eigenvectors’ normwise error grows like the middle eigenvalues’ error divided by the gap — about 10−510^{-5} at order 80 — so that the earlier essay’s prediction holds there and fails here, and the difference between the two routes is the whole of the answer.”

It holds, in its shape and its size. Its constant is a different number with a different reason, and the reason is the more interesting half.

Two routes from one Schur form

Both routes start from the same computation. The Francis double-shift iteration reduces the Sylvester–Kac matrix to real Schur form, A=ZTZTA = ZTZ^{\mathsf T} with ZZ orthogonal and TT upper triangular — every eigenvalue of this matrix is real, and up to order 80 the computed form has no two-by-two blocks. The diagonal of TT is the computed spectrum, the numbers an answer that is known measured against the integers −(n−1),−(n−3),…,n−1-(n-1), -(n-3), \ldots, n-1.

The first route is the earlier essay’s: take a computed eigenvalue λ^\hat\lambda, factor A−λ^IA - \hat\lambda I once, and solve with it three times from a random vector. The second is LAPACK’s. An eigenvector of the triangular TT for its jj-th diagonal entry has zeros below position jj, a one at jj, and entries above found by back substitution, each a division by tii−tjjt_{ii} - t_{jj}; the eigenvector of AA is ZZ times that. It costs no factorisation and returns every eigenvector at once, which is why it is the standard route. The form a real matrix can reach is the account of why the Schur form is the object every dense eigensolver aims at, and two shifts that are never formed of how the Francis iteration reaches it without complex arithmetic; neither route here touches the iteration itself, only what is done with its output.

The Sylvester–Kac matrix's middle eigenvectors, eigenvalues within five of zero, against the order: the worst eigenvalue error, and the worst eigenvector's normwise error computed from the Schur form and by inverse iteration from a random starteigenvalue error: 1.5e-14 at 16, 1.7e-13 at 24, 3.4e-12 at 32, 1.6e-10 at 40, 3.0e-9 at 48, 4.1e-8 at 56, 1.0e-6 at 64, 1.5e-6 at 72, 3.0e-5 at 80; eigenvector, Schur route: 1.3e-14 at 16, 1.4e-13 at 24, 2.7e-12 at 32, 1.2e-10 at 40, 2.4e-9 at 48, 3.2e-8 at 56, 8.2e-7 at 64, 1.2e-6 at 72, 2.3e-5 at 80; eigenvector, inverse iteration: 1.7e-16 at 16, 3.2e-16 at 24, 1.8e-16 at 32, 1.9e-16 at 40, 2.9e-16 at 48, 3.6e-16 at 56, 5.6e-16 at 64, 4.0e-16 at 72, 4.7e-14 at 80.16243240485664728010⁻¹⁷10⁻¹⁵10⁻¹³10⁻¹¹10⁻⁹10⁻⁷10⁻⁵10⁻³orderworst over the middleeigenvalue erroreigenvector, Schur routeeigenvector, inverse iterationmiddle eigenvalues, |λ| ≤ 5the route is the answer
Fig. 1 The worst middle eigenvector — eigenvalue within five of zero — at each order: its normwise error from the Schur form (red), by inverse iteration (blue), and the worst middle eigenvalue’s error (open), on a logarithmic axis.

The figure is the prediction’s verdict. By inverse iteration the worst middle eigenvector is off by 2⋅10−162 \cdot 10^{-16} to 5⋅10−145 \cdot 10^{-14} at every order. From the Schur form it is off by 10−1410^{-14} at order 16, 2⋅10−92 \cdot 10^{-9} at 48, 8⋅10−78 \cdot 10^{-7} at 64 and 2.3⋅10−52.3 \cdot 10^{-5} at 80 — the prediction’s 10−510^{-5}, within a factor of three — and it climbs in step with the middle eigenvalues’ error, never more than a little under it. The two routes start from the same computed eigenvalues and end nine orders of magnitude apart.

Every eigenvector, just under its eigenvalue

The middle is where the loss is largest, but not where it happens.

Every eigenvector of the Sylvester–Kac matrix of order 80: its eigenvalue's error, and its normwise error computed from the Schur form and by inverse iteration from a random start, against the eigenvalueMiddle eigenvalues: error up to 3.0e-5; their eigenvectors from the Schur form up to 2.3e-5, by inverse iteration up to 4.7e-14. At the ends of the spectrum the eigenvalue error is 1.7e-12 and both routes' eigenvectors are within 1.4e-13.order 80, normwisemiddle eigenvalue error3·10⁻⁵Schur route, middle vector2.3·10⁻⁵inverse iteration4.7·10⁻¹⁴-80-60-40-2002040608010⁻¹⁷10⁻¹⁵10⁻¹³10⁻¹¹10⁻⁹10⁻⁷10⁻⁵10⁻³eigenvalueerroreigenvalue erroreigenvector, Schur routeeigenvector, inverse iterationopen: eigenvalue · red: Schur · blue: inversejust under the eigenvalue's error
Fig. 2 Every eigenvector of one order, against its eigenvalue: the eigenvalue’s error (open), the eigenvector’s normwise error from the Schur form (red) and by inverse iteration (blue). The dial sets the order.

At order 80 the eigenvalue errors make an arch over the spectrum, from 10−1210^{-12} at the ends to 3⋅10−53 \cdot 10^{-5} in the middle, and the Schur route’s eigenvector errors make the same arch a fixed step below it, at every eigenvalue where the arch is above 10−1110^{-11}. Inverse iteration’s errors are flat at 10−1510^{-15} across the whole spectrum, rising to 10−1310^{-13} only in the middle. Turn the dial down and the arch flattens, at order 48 to a peak of 3⋅10−93 \cdot 10^{-9}, and the red points follow it down; the blue ones do not move.

The two dips in the arch near ±24\pm 24 are eigenvalues the Francis iteration happened to converge to more accurately; their eigenvectors from the Schur form dip with them. Nothing about the eigenvector’s own sensitivity changes there. Whatever the Schur route does to an eigenvector, it does in proportion to what happened to that eigenvalue.

A ratio that is not one over the gap

The prediction’s constant was one over the gap: an eigenvector’s sensitivity to a perturbation is the perturbation over the distance to the neighbouring eigenvalues, and here every distance is two, so the error should be half the eigenvalue’s. That is the reasoning the gap decides the eigenvector made precise for symmetric matrices.

The Schur route's normwise eigenvector error over its eigenvalue's error, on every Sylvester–Kac eigenvector whose eigenvalue is off by more than ten to the minus eleven, orders 40 to 80, with the exact eigenvector's speed and one over the gap274 eigenvectors; the ratio runs from 0.767 to 0.830. The exact unit eigenvector turns at 0.787 per unit change of its eigenvalue at order 80; one over the gap of two is 0.5.10⁻¹¹10⁻¹⁰10⁻⁹10⁻⁸10⁻⁷10⁻⁶10⁻⁵10⁻⁴0.40.50.60.70.80.91eigenvalue errorvector error over eigenvalue errorthe vector's speedone over the gaporders 40 to 80, every lossy eigenvectorthe error is the vector's speed
Fig. 3 The Schur route’s normwise eigenvector error over its eigenvalue’s error, on every eigenvector at orders 40 to 80 whose eigenvalue is off by more than 10−1110^{-11}, with the exact eigenvector’s speed (dashed) and one over the gap of two (dotted).

On 274 such eigenvectors the ratio is between 0.76 and 0.84, and nearly all of them are within a hundredth of 0.79. It does not depend on the order, on where the eigenvalue sits in the spectrum, or on how large its error is across six decades from 10−1110^{-11} to 10−510^{-5}. It is not a half.

The 0.79 can be found without any eigensolver. The matrix’s own recurrence — the first equation of (A−λI)x=0(A - \lambda I)x = 0 gives x1x_1 from x0x_0, the second x2x_2 from x1x_1 and x0x_0, and so on — can be run at any λ\lambda, not only an integer, exactly, in rational arithmetic on the double’s binary value. At an eigenvalue it gives the eigenvector; at a nearby λ\lambda it gives a vector that satisfies every equation but the last. Differencing the unit vectors at λ±2−20\lambda \pm 2^{-20} measures how fast the eigenvector turns as its eigenvalue moves.

How fast the Sylvester–Kac matrix's unit eigenvector turns as its eigenvalue moves, in hundredths per unit, against the eigenvalue over the spectrum's half-width, at four ordersorder 24: 0.863 at -1.00, 0.797 at -0.65, 0.793 at -0.30, 0.792 at 0.04, 0.794 at 0.39, 0.800 at 0.74; order 48: 0.893 at -1.00, 0.791 at -0.66, 0.789 at -0.32, 0.789 at 0.02, 0.789 at 0.36, 0.792 at 0.70, 0.893 at 1.00; order 64: 0.903 at -1.00, 0.789 at -0.62, 0.788 at -0.24, 0.788 at 0.14, 0.789 at 0.52, 0.799 at 0.90; order 80: 0.909 at -1.00, 0.789 at -0.70, 0.788 at -0.39, 0.787 at -0.09, 0.788 at 0.22, 0.788 at 0.52, 0.792 at 0.82.-1-0.500.51707580859095100eigenvalue over n − 1speed, hundredthsorder 24order 48order 64order 80exact central differences of the recurrence0.79 inside, 0.91 at the ends
Fig. 4 How fast the exact unit eigenvector turns as its eigenvalue moves, in hundredths per unit change, against the eigenvalue over half the spectrum’s width, at orders 24, 48, 64 and 80.

It turns at 0.787 per unit in the interior of the spectrum at every order from 48 up, rising to 0.91 at the two ends. On every eigenvector of orders 48 and 80 whose error is measurable the speed matches the Schur route’s ratio to within three per cent. And measured directly, on nine eigenvectors checked at orders 48, 64 and 80, the Schur route’s vector sits exactly as far from the exact one as the recurrence’s vector at the computed eigenvalue does, to three digits — on the opposite side of it, to within a fifth of that distance.

So the Schur route’s error has a plain description. It computes the eigenvector of the eigenvalue it was given, and the eigenvalue it was given is wrong. Back substitution in TT for the diagonal entry tjjt_{jj} is an exact computation, to rounding, of a vector that the triangular matrix maps to tjjt_{jj} times itself; multiplying by ZZ carries it to the matrix that ZZ and TT represent, which is AA to within rounding. What is wrong is tjjt_{jj}, and the vector moves with it at the speed the matrix’s eigenvectors move — 0.79, for this matrix, not the 0.5 a gap would suggest, because the gap governs how a perturbation of the matrix mixes in the neighbouring eigenvectors, and this error is not a mixing. It is a slide along the curve the eigenvector traces as its eigenvalue changes.

Why inverse iteration does not slide

Inverse iteration uses the same wrong eigenvalue and returns the right vector, and the difference is what the computation does with the eigenvalue. In back substitution λ^\hat\lambda is part of the answer: the vector is defined as the one that λ^\hat\lambda makes singular. In inverse iteration it is only a shift. A solve with A−λ^IA - \hat\lambda I multiplies the component along each eigenvector by one over its distance from the shift, so the wanted component is amplified by 1/∣λ−λ^∣1/|\lambda - \hat\lambda| and the others by about a half; after three solves the wanted direction dominates by a factor that is enormous whether λ^\hat\lambda is right to fifteen digits or to five. The vector it converges to is AA’s eigenvector, not λ^\hat\lambda’s, because the iteration never asks which eigenvalue it belongs to. At order 80 the worst middle eigenvalue is off by 3⋅10−53 \cdot 10^{-5}, so each solve amplifies the wanted direction by about thirty thousand against a half for its nearest neighbours: a ratio of sixty thousand per solve, 2⋅10142 \cdot 10^{14} after three, which is why three solves from a random start reach rounding at every order measured.

That is the earlier essay’s result seen from the other side. Its explanation was that a shifted solve is insensitive to the shift’s error; this one adds that the route which uses the shift as a definition is exactly as sensitive as the eigenvector’s speed allows. The practical repair follows directly. Take the Schur route’s vector as the start of inverse iteration, shifted by the same computed eigenvalue, and solve once. At orders 48 and 64 every eigenvector is then within 8⋅10−148 \cdot 10^{-14} normwise; at 80, within 1.9⋅10−101.9 \cdot 10^{-10}, from a slide of up to 4⋅10−54 \cdot 10^{-5}, and a second solve would finish the job. One solve multiplies the slide by about the eigenvalue’s error over the gap, which is the shifted solve’s insensitivity working on a start that is already close. LAPACK offers the inverse-iteration route as an alternative to back substitution, working on the Hessenberg form; on this matrix the choice between them is the difference between five digits and fourteen.

A condition number for one eigenvalue is the account of why the middle eigenvalues are wrong by so much — the non-normality the left and right eigenvectors carry — and the Schur route passes that error on to the vectors at a fixed rate while inverse iteration does not pass it on at all.

The ends, lost twice

Normwise, the Schur route’s vectors at the ends of the spectrum are as good as inverse iteration’s. Componentwise they are not.

The componentwise relative error of every Sylvester–Kac eigenvector of order 64, computed from the Schur form and by inverse iteration, over the rounding unit times ten to the exact vector's dynamic rangeSchur route: 6.5e-1 to 2.0e+3; inverse iteration: 1.0e-3 to 3.2e-1.-64-48-32-1601632486410⁻³10⁻²10⁻¹110¹10²10³10⁴eigenvaluecomponentwise error over u·rangeSchur routeinverse iterationorder 64 · dashed: one unit times the rangethe ends, lost twice
Fig. 5 The componentwise relative error of every eigenvector at order 64, from the Schur form (red) and by inverse iteration (blue), over the rounding unit times ten to the exact vector’s dynamic range; the dashed line is one.

An eigenvector near the ends of the spectrum has entries spanning many decades, and the earlier essay found that inverse iteration’s componentwise error is the rounding unit times that span, within a few units, at every order. The Schur route’s is a hundred to two thousand times past it at orders 48, 64 and 80. The vector is formed as ZZ times the triangular eigenvector, and each entry of a matrix-vector product carries an error relative to the largest terms in its sum, not to its own size; the small entries at the far end of an end eigenvector are sums of large terms that cancel. Inverse iteration computes each entry as part of a solve whose residual is small entry by entry. Both are backward stable, normwise; only one of them preserves the vector’s small entries.

What the prediction was right about

The prediction’s claim was that the route is the whole of the difference, and it is: the same eigenvalues, the same matrix, nine orders of magnitude between the routes in the middle at order 80. Its size was right within a factor of three. What it had wrong was the mechanism behind the constant, and the difference matters for any matrix other than this one. One over the gap is the right constant for an eigenvector perturbed by a perturbation of the matrix. The Schur route’s error on this matrix is dominated by something more specific — the triangular form’s diagonal is wrong by the eigenvalue’s error, and the eigenvector is computed from the diagonal — and for that, the constant is the speed at which the eigenvector moves along its own family as the eigenvalue changes, which a gap does not determine.

Balancing moves the eigenvalue, and the vector follows

The reading makes a prediction that can be checked at once. Balanced is not symmetric found that balancing the Kac matrix — a diagonal similarity B=D−1ADB = D^{-1}AD chosen to even out its rows and columns — improves its computed eigenvalues by a constant factor without changing how fast they are lost with the order. If the Schur route’s eigenvector error is the eigenvalue’s error times the vector’s speed, it should improve by exactly the same factor, since the eigenvector family of AA is fixed whatever similarity is used to compute it.

It does. Run through the Schur form of the balanced matrix, with each eigenvector of BB multiplied back by DD, the middle eigenvalues at order 48 are off by 2.7⋅10−112.7 \cdot 10^{-11} instead of 3.0⋅10−93.0 \cdot 10^{-9}, and their eigenvectors by 2.2⋅10−112.2 \cdot 10^{-11} instead of 2.4⋅10−92.4 \cdot 10^{-9}; at 64, 1.2⋅10−81.2 \cdot 10^{-8} and 9.8⋅10−99.8 \cdot 10^{-9}; at 80, 2.2⋅10−62.2 \cdot 10^{-6} and 1.7⋅10−61.7 \cdot 10^{-6}. Over every lossy eigenvector of the three orders, 136 of them, the ratio is 0.76 to 0.83 — the same speed, at errors a hundred times smaller. Balancing bought the eigenvalues a factor of 14 to 110 and the vectors exactly the same factor, and nothing else.

It also rescues the ends. The balanced route’s componentwise error is within 6 to 29 units of the dynamic range’s bound at orders 48 to 80, where the unbalanced route’s was a hundred to two thousand times past it: DD carries the vector’s range, so the product with ZZ is formed among entries of comparable size and the small ones are no longer differences of large ones. Symmetry is worth more than precision found that the symmetrised Kac matrix, a similarity by a different diagonal, computes its eigenvalues exactly; on that route the eigenvalue error vanishes and with it, by this reading, the Schur route’s slide.

What one matrix does not show

The Sylvester–Kac matrix has every gap equal, so it cannot distinguish a constant that comes from the gap from one that does not except through its value, and it has an eigenvector family with a closed form, which is what makes the speed computable. On a matrix with unequal gaps both effects would be present at once, and only a matrix with known eigenvectors could separate them. The Schur form here has no two-by-two blocks; for complex eigenvalues LAPACK’s back substitution solves small two-by-two systems, and how they carry an eigenvalue’s error is not measured. And the orders stop at 80, where the middle eigenvalues still have five digits; the Schur forms stay real to order 104, but the eigenvalues there have three digits, and an eigenvector that slides by a thousandth is no longer a small perturbation of the right one.

The refinement’s cost is not measured either. A solve with a tridiagonal matrix is cheap, and the Sylvester–Kac matrix is tridiagonal, so here one solve per eigenvector is negligible beside the Schur form; on a dense matrix it is a factorisation per eigenvector, n3/3n^3/3 operations each, and refining all nn of them costs more than the Schur form itself. That is why back substitution is the default and why a code that wants accurate vectors for a few eigenvalues and not all of them would do well to refine those few.

Still open: the left eigenvectors, and a matrix with unequal gaps

The left eigenvectors. The left eigenvectors of the Kac matrix satisfy the transpose’s recurrence and are exact rationals too. From the Schur form they come from the transposed triangular system. The prediction with a sign is that they slide with their eigenvalue at a speed of their own — not 0.79 — and that the product of the two speeds, left and right, times the eigenvalue’s error, accounts for the error in the eigenvalue condition number computed from the two vectors to within a factor of two.

Unequal gaps. A tridiagonal matrix with the Kac matrix’s off-diagonal pattern but a varying diagonal has unequal gaps and still has eigenvectors given by a three-term recurrence, so their speed is computable. The prediction is that the Schur route’s error is the speed times the eigenvalue error on every eigenvector to within ten per cent whatever the gaps, and that one over the gap predicts it only where the speed happens to be near one over the gap — so that the slide, not the mixing, is the Schur route’s error wherever the eigenvalue is computed less accurately than the vector’s neighbours are separated.

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.

Eigenvalue condition numberExact ground truthForward errorInverse iterationNon-normalityRational arithmeticTridiagonal