Structure, and the solver that cannot see it

What the commuting family was hiding

A Sylvester solve's structured backward error climbed 26,000 times above its residual while its forward error did not move, on a family built so that X commutes with A and B. Replace X by a random matrix with the same singular values, and the backward error is within a factor of eleven of the residual at every setting, on both routes. The structured product and the residual's estimate agree too, within 45 and 9 times the forward error. So that gap, the prediction said, was the family's geometry, and it was. But the perturbation's share on C does not fall below a half as predicted: it rises to 88 and 99 per cent. And a residual in the Schur bases that costs nothing is not the residual: it is a twentieth of it, because what is left is the Schur factorisations' own rounding.

Worth reading first: An equation whose unknown is a matrix · The exact answer to a nearby problem · An index that is a pair.

The residual knew the error ended a two-part argument about the Sylvester equation AX+XB=CAX + XB = C. A backward error the answer does not feel had built a family on which a structured backward error climbs far above its residual, while the error of the answer does not move. The next essay looked for a structured condition number to go with it and found one that moves the wrong way, with the plain relative residual times ∥P−1∥\|P^{-1}\| predicting the forward error within a factor of 10 on all 120 solves.

All of that was on one construction. There AA is symmetric, B=−A+δIB = -A + \delta I, and XX shares AA’s eigenvectors, so that AX+XB=δXAX + XB = \delta X exactly. The essay asked the obvious question of its own result and signed the answer: with XX replaced by a random matrix of the same singular values, the backward error over the residual at κ(X)=108\kappa(X) = 10^8 and a scale of 10−610^{-6} should fall below a thousand on both routes, the share of the perturbation on CC should fall below a half, the structured product should overstate the forward error by less than a hundred, and the residual’s estimate should stay within ten, “so that the gap measured here is a property of the commuting family’s geometry, not of structured estimates in general.” It added a second prediction about a residual available at no cost in the Schur bases.

Most of the first prediction holds and part of it fails informatively. The second fails by a wide margin, and that failure is a small finding about what the residual is.

A family with the same numbers and no alignment

Everything is kept but XX. The matrix AA has eigenvalues 1 to 8 and BB is −A+δI-A + \delta I, for δ\delta of 12\tfrac12, 10−210^{-2}, 10−410^{-4} and 10−610^{-6}. Now X=P diag(s) RTX = P\,\mathrm{diag}(s)\,R^{\mathsf T} with PP and RR random orthogonal, with ss graded as before over κ(X)\kappa(X) from one to 10810^8, and CC is formed from AX+XBAX + XB. Three seeds per setting. The two routes are Bartels and Stewart’s, through the real Schur forms, and elimination on the Kronecker system.

This makes CC large in a way it was not before. In the commuting family AX+XBAX + XB cancels to δX\delta X, so CC is small and shaped exactly like XX. Here the two terms AXAX and XBXB do not cancel, because XX does not commute with AA, and CC is of about the size of AXAX whatever δ\delta is. So the sharp contrast in sizes that drove the earlier finding has gone. What remains the same is everything that a norm or a singular value can report about AA, BB and XX.

The structured backward error of a Sylvester solution over its relative residual against the condition number of X, for the commuting family and for one with X replaced by a random matrix of the same singular values, at a scale of 0.000001, median of three seedscommuting, Bartels–Stewart: 4.0e+0, 7.4e+0, 2.2e+2, 1.8e+4, 2.1e+5; not commuting, Kronecker: 4.1e+0, 7.5e+0, 8.0e+0, 9.0e+0, 9.6e+0; not commuting, Bartels–Stewart: 4.1e+0, 4.3e+0, 4.1e+0, 4.0e+0, 4.0e+0 at condition numbers one to ten to the eighth.110²10⁴10⁶10⁸110¹10²10³10⁴10⁵10⁶κ(X)backward error over residualcommuting, Bartels–Stewartnot commuting, Kroneckernot commuting, Bartels–Stewartorder 8 · C at the scale of 10⁻⁶ · three seedsthe gap belonged to the commuting family
Fig. 1 The structured backward error of a Sylvester solution over its relative residual against the condition number of XX, for the commuting family and for a random XX of the same singular values, median of three seeds. The dial sets the scale δ\delta.

The red line is the earlier family at δ=10−6\delta = 10^{-6}, climbing from 4 to 2⋅1052 \cdot 10^5. The other two are the same equation with XX unaligned. On Bartels and Stewart’s route the ratio is 4 at every condition number, and through the Kronecker system it runs from 4 to about 10. Over all the settings, four scales, five conditionings and three seeds, on both routes, its largest value is 10.8. The prediction was below a thousand, and that is correct by two orders of magnitude. Turn the dial and only the red line moves: it depends on δ\delta, since its CC is δX\delta X, and the other two take no notice at all.

So the earlier essays’ central gap did belong to the commuting family. It is what happens when CC is exactly aligned with XX and much smaller than AXAX and XBXB individually. A backward error measures how far AA, BB and CC must each move, relative to their own norms. If CC is tiny then its relative budget is tiny, and moving it is expensive. On a generic XX it is not tiny, and nothing about that arithmetic singles it out.

That result corrects a possible reading of the essay that started this. A person reading it could reasonably have concluded that a Sylvester residual is a poor guide to backward error in general, and that a structured measure has to be computed. On a generic right-hand side the two are within a factor of four to eleven, a constant anybody can absorb. The structured measure is a different number on a narrow class of structured right-hand sides, and it is worth computing there, but it is not generally.

Two estimates that now agree

The largest factor by which each error estimate overstates the forward error, on the commuting family and on the non-commuting one, at the smallest scale, by Bartels and Stewart's routethe commuting family, δ = 10⁻⁶: structured product, largest over 3.2e+6, residual's estimate, largest over 6.1e+0; not commuting, δ = 10⁻⁶: structured product, largest over 5.8e+0, residual's estimate, largest over 4.6e+0.110²10⁴10⁶the commuting family, δ = 10⁻⁶structured product, largest overresidual's estimate, largest overnot commuting, δ = 10⁻⁶structured product, largest overresidual's estimate, largest overestimate over the forward errororder 8 · three seeds, five conditioningsthe two estimates meet
Fig. 2 The largest factor by which each error estimate overstates the forward error, on the commuting family and on the non-commuting one, at the smallest scale.

The second clause of the prediction holds too. On the commuting family the structured condition number times the backward error overstated the forward error by up to 3⋅1063 \cdot 10^6 on Bartels and Stewart’s route, and the residual’s estimate was within ten. On the non-commuting family at the same scale, the structured product’s overstatement falls to about 6. Across all settings and both routes its largest is 45, against the prediction’s hundred. The residual’s estimate runs from 1.6 to 8.8, within the prediction’s ten.

So the two estimates have come together, as the prediction said. The product of a structured condition number and a structured backward error is a sound estimate of the forward error on a generic problem, which is what such a thing is meant to be, and the earlier essay’s “overstates by 9⋅1069 \cdot 10^6” was a property of the geometry on which it was measured. The residual’s estimate is still the simpler and slightly tighter one, and it is much cheaper: a structured condition number at this order takes 3n23n^2 solves against an n2n^2 system, whereas the residual needs two products and ∥P−1∥\|P^{-1}\| needs one estimate.

The forward error of a Sylvester solution by Bartels and Stewart's route against the scale that sets how nearly A and B cancel, on both families, at a condition number of X of ten thousandcommuting: 1.8e-9, 5.0e-11, 2.0e-13, 7.5e-15; not commuting: 3.7e-9, 4.3e-11, 4.7e-13, 1.2e-14 at scales 0.000001, 0.0001, 0.01, 0.5.10⁻⁶10⁻⁵10⁻⁴10⁻³10⁻²10⁻¹110⁻¹⁶10⁻¹⁴10⁻¹²10⁻¹⁰10⁻⁸10⁻⁶δ, the margin between A and −Bforward errorcommutingnot commutingorder 8 · κ(X) = 10⁴the error follows the separation
Fig. 3 The forward error by Bartels and Stewart’s route against the margin δ\delta between AA and −B-B, on both families, at a condition number of XX of 10410^4.

The forward error itself is nearly the same on both families, and that is worth seeing, since the two have such different backward errors. It is set by δ\delta: about 10−1410^{-14} at δ\delta of 12\tfrac12, 3⋅10−133 \cdot 10^{-13} at 10−210^{-2}, 5⋅10−115 \cdot 10^{-11} at 10−410^{-4} and 3⋅10−93 \cdot 10^{-9} at 10−610^{-6}. That is what the essay on sep against the gap would say: a separation of δ\delta between the two spectra means the Kronecker matrix’s smallest singular value is about δ\delta, and the error is the rounding over that. So the answer’s accuracy has been a matter of the separation all along. It does not know whether XX commutes.

The share on C does not fall

The share of the smallest perturbation that falls on C, against the condition number of X, on the non-commuting family, by each routeBartels and Stewart: 0.40, 0.67, 0.76, 0.84, 0.88. Kronecker: 0.40, 0.86, 0.94, 0.97, 0.99, at condition numbers one to ten to the eighth.110²10⁴10⁶10⁸00.250.50.751κ(X)share of the perturbation on CKroneckerBartels–Stewartδ = 10⁻⁶ · not commutingthe prediction wanted under a half
Fig. 4 The share of the smallest perturbation that falls on CC, against the condition number of XX, on the non-commuting family, by each route.

One clause of the prediction fails. It said the share of the minimum perturbation that lands on CC should fall below a half at κ(X)=108\kappa(X) = 10^8, once the commuting alignment was gone. It does not fall: it is 0.40 at κ(X)=1\kappa(X) = 1 on both routes, and it rises as XX grows ill conditioned, to 0.88 on Bartels and Stewart’s route and 0.99 through the Kronecker system.

The reason was already in the earlier essay’s own analysis. A perturbation of AA reaches the residual only by way of ΔA⋅X^\Delta A \cdot \hat X, and one of BB only by way of X^ΔB\hat X\Delta B, so both pass through X^\hat X. Where X^\hat X has small singular values, on the small-by-small block of its singular directions, neither can contribute. Only CC reaches that block. That argument is entirely about XX’s singular values, and they have not changed. It needs no commuting. So what the commuting family added was not the concentration on CC. It added the large size of the perturbation that concentration requires, by making CC small. On the generic family CC is large and a perturbation on it is cheap, so the share is high and the size stays modest. The prediction’s error was to treat those two as one effect.

A residual that costs nothing is not the residual

Bartels and Stewart’s route solves a triangular equation in the Schur bases, SY+YT=FSY + YT = F, and the residual of that equation is sitting there at no additional cost. Rotated back to the original bases its norm is unchanged, because the bases are orthogonal. The prediction was that this free number would be within a factor of two of the true residual, so that the residual’s estimate of the error comes for the price of the solve.

The residual of the triangular equation in the Schur bases over the true residual in the original bases, by scale, for both families: the median, least and greatest over five conditionings and three seedsnot commuting: δ = ½ from 3e-2 to 7e-2, δ = 10⁻² from 3e-2 to 6e-2, δ = 10⁻⁴ from 2e-2 to 1e-1, δ = 10⁻⁶ from 3e-2 to 7e-2; commuting: δ = ½ from 2e-3 to 5e-2, δ = 10⁻² from 4e-4 to 4e-2, δ = 10⁻⁴ from 1e-3 to 5e-2, δ = 10⁻⁶ from 4e-3 to 4e-2.10⁻⁴10⁻³10⁻²10⁻¹1not commutingδ = ½δ = 10⁻²δ = 10⁻⁴δ = 10⁻⁶commutingδ = ½δ = 10⁻²δ = 10⁻⁴δ = 10⁻⁶free residual over true residualfifteen solves in each rowit sees the triangular solve and nothing else
Fig. 5 The residual of the triangular equation in the Schur bases over the true residual in the original bases, by scale, for both families: the median, least and greatest over fifteen solves.

It is not close. On the non-commuting family the free residual is between 0.024 and 0.099 of the true one, with a median near a twentieth. On the commuting family it is lower, between 4⋅10−44 \cdot 10^{-4} and 0.05. That is a large miss in a direction that matters: a code reading the free number would conclude the solve is ten to a thousand times better than it is, and the estimate of the error it then forms would be too small by the same factor.

The reason is plain once the free residual’s blind spot is written out. Back substitution is an extremely accurate operation, and its residual measures only what that substitution left. The true residual also contains the rounding in the two Schur factorisations, in the two rotations of CC into the Schur bases, and in the two rotations of YY out of them. Those happen outside the triangular equation, and that equation has no way to see them. They are also larger, because each is an orthogonal step on a matrix of norm ∥A∥∥X∥\|A\|\|X\|, with a rounding error of the corresponding size.

The true residual of a non-commuting Sylvester solution over the unit roundoff times the size of its terms, at four scales and three conditionings of Xδ = ½, κ(X) = 10⁰: from 3.62 to 6.13; δ = ½, κ(X) = 10⁴: from 2.18 to 4.23; δ = ½, κ(X) = 10⁸: from 1.83 to 4.40; δ = 10⁻², κ(X) = 10⁰: from 3.78 to 7.11; δ = 10⁻², κ(X) = 10⁴: from 2.55 to 4.26; δ = 10⁻², κ(X) = 10⁸: from 2.49 to 4.10; δ = 10⁻⁴, κ(X) = 10⁰: from 3.61 to 6.75; δ = 10⁻⁴, κ(X) = 10⁴: from 2.10 to 6.07; δ = 10⁻⁴, κ(X) = 10⁸: from 1.78 to 5.85; δ = 10⁻⁶, κ(X) = 10⁰: from 4.37 to 5.33; δ = 10⁻⁶, κ(X) = 10⁴: from 2.64 to 3.83; δ = 10⁻⁶, κ(X) = 10⁸: from 2.50 to 3.89.0.1110δ = ½, κ(X) = 10⁰δ = ½, κ(X) = 10⁴δ = ½, κ(X) = 10⁸δ = 10⁻², κ(X) = 10⁰δ = 10⁻², κ(X) = 10⁴δ = 10⁻², κ(X) = 10⁸δ = 10⁻⁴, κ(X) = 10⁰δ = 10⁻⁴, κ(X) = 10⁴δ = 10⁻⁴, κ(X) = 10⁸δ = 10⁻⁶, κ(X) = 10⁰δ = 10⁻⁶, κ(X) = 10⁴δ = 10⁻⁶, κ(X) = 10⁸the true residual over u(‖A‖ + ‖B‖)‖X‖three seeds in each rowthe residual is mostly the Schur steps
Fig. 6 The true residual of a non-commuting Sylvester solution over the unit roundoff times the size of its terms, at four scales and three conditionings of XX.

That account predicts something better than the free residual, and the prediction turns out to hold. If the residual is dominated by orthogonal steps’ rounding, then its size should be about u(∥A∥+∥B∥)∥X∥u(\|A\| + \|B\|)\|X\|, with no reference to the particular solve. On all sixty non-commuting equations, the true residual is between 1.8 and 7.1 times this number, regardless of δ\delta and κ(X)\kappa(X). So a code does not need the free residual, and it does not need to form AX^A\hat X either, to know what the residual will be. It needs the norms. The estimate of the error then reads: uu times the size of the terms, divided by ∥P−1∥−1\|P^{-1}\|^{-1}. That is the classical forward bound, and in this measurement it has held to within a factor of about four.

So on this family a solve’s residual can be predicted to within a factor of about four before the solve is run, and what remains of the forward error’s estimate is a single further number, the separation. That is cheap: an estimate of ∥P−1∥\|P^{-1}\| can be had from the Schur factors, which the condition estimators would do at a few triangular solves each, at a small part of what a structured condition number costs. Nothing here depends on the singular values of XX being spread or on any particular δ\delta, within the settings measured, which is to say that the forward bound in its simplest form has held across eight decades of conditioning and six of separation.

This sits in contrast with what the backward-error literature emphasises. A residual is a measured quantity with a real role when a solver might be unstable. Bartels and Stewart’s route is stable, and a stable route’s residual has no information beyond its own stability, at least on this family. It is at its proper level, a small multiple of uu times the data, on every equation here, and computing it confirms that nothing went wrong but cannot tell one equation from another. Three errors and one number separates those uses in general, and here the case is unusually clean. The elimination the matrix does not need has shown that the Kronecker route costs little more on this structure, and its residual, computed by elimination, is about the same size.

The commuting family’s place

None of this means the commuting family was a bad example, and the most common Sylvester equation in practice gives a direct way to check that. A controllability Gramian solves AX+XAT=−bbTAX + XA^{\mathsf T} = -bb^{\mathsf T}, with a stable AA and data of rank one. It is the equation inside every balanced truncation, and its solution’s singular values fall quickly for the reason why a Gramian can be truncated at all gives. Here AA is symmetric with eigenvalues spread over between none and six decades, and bb is random, so that the exact solution is known in AA’s eigenbasis.

A Lyapunov equation with rank-one data, against the spread of the operator's eigenvalues: the backward error over the residual, and how much each estimate overstates the forward error, median of three seedsstructured product over error: 1e+0, 2e+0, 2e+1, 1e+2, 5e+2, 3e+3, 9e+3; backward error over residual: 2e+0, 2e+0, 1e+1, 5e+1, 1e+2, 1e+3, 5e+3; residual's estimate over error: 8e-1, 3e+0, 4e+0, 8e+0, 2e+1, 1e+1, 7e+0 at spreads from one to a million. The condition number of X is 5e+17, 1e+9, 4e+5, 1e+5, 3e+5, 1e+6, 5e+6.110¹10²10³10⁴10⁵10⁶110¹10²10³10⁴10⁵the spread of A's eigenvaluesthe three ratiosstructured product over errorbackward error over residualresidual's estimate over errororder 8 · stable A · C of rank onethe gap comes back with the operator
Fig. 7 A Lyapunov equation with rank-one data, against the spread of the operator’s eigenvalues: the backward error over the residual, and how much each estimate overstates the forward error, median of three seeds.

The gap comes back, and it does not respond to the variable the earlier family pointed at. With no spread at all, XX has rank one to rounding, its condition number is above 101710^{17}, and the backward error over the residual is 2.3. So a huge κ(X)\kappa(X) on its own has no effect. At a spread of 10410^4 the ratio is about a hundred, while κ(X)\kappa(X) has fallen to 3⋅1053 \cdot 10^5. At 10610^6 the ratio is about 5,000, and up to 28,700 on one seed, while κ(X)\kappa(X) is about 5⋅1065 \cdot 10^6. The structured product overstates the forward error by about 9,000 at the median and by 1.4⋅1051.4 \cdot 10^5 on the worst. The residual’s estimate stays between 0.7 and 34 across the whole of that range.

So the earlier finding belongs to a large and useful class after all, one defined by the operator’s spread and not by κ(X)\kappa(X) or by any literal commuting. A small low-rank right-hand side, solved against an operator far larger than the result it produces on the small directions, is what makes the budget on CC tight. The Gramian equation has that. Where the earlier essays’ conclusion said to trust the residual’s estimate and not the structured product, that is sound advice on the equation people actually solve, and the commuting family was a clean model of it. And this is not what the prediction said to expect, which was a threshold in the spread of XX.

It matters that this was found by looking for the structural difference rather than a numerical one. Reading κ(X)\kappa(X) or δ\delta from the earlier family would have suggested that a large gap needs a large κ(X)\kappa(X), and a Gramian at no spread has a condition number of 5⋅10175 \cdot 10^{17} and no gap at all. So the earlier family’s two parameters were standing in for the variable that counts, which is the size of AA against the small singular directions of the result. That is a property of the pair (A,X)(A, X) taken together, and it cannot be read from either alone.

What is not covered

Order 8 and three seeds per setting are small, because a structured condition number takes 3n23n^2 solves, and that cost grows steeply. The family’s AA and BB are symmetric and BB is almost exactly −A-A, so that a separation of δ\delta is the only thing setting the Kronecker matrix’s smallest singular value. A nonsymmetric pair, in which sep falls far below the eigenvalue gap, could break the correspondence between forward error and δ\delta that the figure shows. All solutions here are built, and their CC computed, in the same double precision, so the forward errors at the small end include rounding made in forming the problem.

Still open: an equation with a Gramian in it, and a nonsymmetric pair

A low-rank right-hand side on a non-commuting family. The Gramian’s right-hand side has two features, low rank and a small norm against the operator. The prediction with a sign is that a rank-one CC scaled to the size of AXAX and solved on the non-commuting family has a ratio under 20 at any spread, and that scaling it down by 10−610^{-6} raises the ratio above a thousand, so that it is the size and not the rank that opens the gap.

A nonsymmetric pair with a small sep. The law for the residual’s size has used only the norms. The prediction is that on a pair whose sep is far below its eigenvalue gap, the true residual is still within ten of u(∥A∥+∥B∥)∥X∥u(\|A\| + \|B\|)\|X\|, and that the forward error is then the residual over sep and not over the gap, to within ten, with the free residual lower still, by a factor that grows with the pair’s non-normality, since the Schur forms’ rotations are unchanged and back substitution meets a harder triangular system.

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.

Named objects

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

Backward errorCondition numberForward errorMatrix equationResidualSchur formStructured perturbation