When the index is a tuple

A jump is two numbers

On smooth coefficients, the iterations a separable preconditioner leaves follow the pointwise spread between the coefficient and its fit. A coefficient that jumps by 10⁴ breaks that rule twice. Along an axis the jump is exactly separable, the fit has a spread of one, and the preconditioner still takes 21 and 23 iterations on two grids of four, because it averages its face values across the interface; read at the faces, it takes one. Across the diagonal the logarithm's fit takes 446 to 827 iterations, as predicted more than twice what a constant takes, but the constant takes three, at every jump from ten to a million, with a spread equal to the jump. A two-valued coefficient preconditioned by a constant leaves all but one row of eigenvalues at two values, and on the diagonal the rest at a third. A fit turns those values into a range.

Worth reading first: An index that is a pair · Changing the condition number on purpose.

The nearest product is not the nearest operator used separability as a preconditioner. The operator −∇⋅(a∇u)-\nabla\cdot(a\nabla u) on a grid is a Kronecker sum, and so solvable by one eigendecomposition per axis, only when a(x,y)=p(x)q(y)a(x, y) = p(x)q(y). For any other coefficient, the nearest separable one can be found, either from the first singular triple of the coefficient’s samples or by fitting its logarithm as f(x)+g(y)f(x) + g(y), and the separable operator built from it preconditions the real one. That essay found that the first singular value’s share predicts nothing about the iterations, and that the pointwise spread does: the largest over the smallest ratio of the coefficient to its fit, whose square root rose with the iterations at a correlation above 0.95 on two smooth families. On a ridge along the diagonal, which has no separable part, a constant beat every fit.

It closed with a prediction in a sharper form. A coefficient that jumps by 10410^4 across an interface parallel to an axis is exactly separable; across the diagonal it is not. On the axis, the logarithm’s fit should take under 20 iterations at every grid. On the diagonal it should take more than a constant does by a factor of at least two, “since its spread is then larger than the jump itself”.

Each half comes out as signed at most grids, and each for a reason other than the one given. A jump turns out to be a different kind of object from a smooth coefficient, and the pointwise spread that predicted everything on the smooth families predicts nothing on it.

The jumps, and what each route is given

The coefficient is one on one side of an interface and JJ on the other, with JJ from 10 to 10610^6, on square grids of 16 to 48 interior points a side. Three interfaces: the line x=0.4x = 0.4, parallel to an axis; the diagonal y=xy = x; and a tilted line y=0.4+0.2xy = 0.4 + 0.2x. The operator is the earlier essay’s five-point stencil with the coefficient sampled at the cell faces. Conjugate gradients runs to a relative residual of 10−810^{-8} from one random right-hand side, preconditioned three ways: by a constant coefficient, the coefficient’s mean, solved by sine transforms; by the nearest separable coefficient in the norm; and by the nearest in the logarithm. The separable preconditioners are solved by the earlier essay’s fast diagonalisation, which works from the fit’s values at the grid points and averages neighbouring points to get the values at the faces between them.

On a 24 × 24 grid with the coefficient jumping by J across the diagonal y = x, conjugate gradient iterations to 10⁻⁸ preconditioned by a constant and by the nearest separable coefficient fitted in the norm and in the logarithm, against JJ = 10¹: constant 3, logarithm 27, norm 46; J = 10²: constant 3, logarithm 80, norm 186; J = 10³: constant 3, logarithm 229, norm 515; J = 10⁴: constant 3, logarithm 628, norm 1003; J = 10⁵: constant 3, logarithm 1637, norm 1452; J = 10⁶: constant 3, logarithm not within 3,000, norm 1878.123456110¹10²10³log₁₀ J, the jump across the interfaceiterationsfit in the normfit in the logarithma constant24 × 24 · one right-hand sidea constant does not see the jump
Fig. 1 Iterations against the jump, preconditioned by a constant and by the nearest separable coefficient fitted in the norm and in the logarithm, on a 24-by-24 grid. The dial sets the interface.

At the dial’s diagonal stop, the logarithm’s fit takes 27 iterations at a jump of ten, 80 at a hundred, 229 at a thousand, 628 at 10410^4 and 1,637 at 10510^5, and at 10610^6 it does not finish within 3,000. The fit in the norm is worse at every jump below 10510^5. The constant takes three iterations at every jump. Unpreconditioned, the same systems take over a thousand. So on the diagonal the prediction’s factor of two is a factor of two hundred, and the interesting number in the figure is not the fits’ climb but the constant’s three.

Along an axis: an exact fit, and a preconditioner that is not exact

Turn the dial to the axis interface. The coefficient there is p(x)p(x), a function of xx alone, so both fits recover it exactly: the pointwise spread between the coefficient and either fit is 1.0000001.000000 on every grid and at every jump. On the earlier essay’s rule, an exact fit with a spread of one should be an exact preconditioner, and conjugate gradients should take one iteration.

With the coefficient jumping by 10⁴ along x = 0.4, conjugate gradient iterations against the grid, preconditioned by the exact separable fit with its face values averaged from the grid points and read at the faces, and by a constant16 points a side: averaged faces 21, exact faces 1, constant 13; spread of the fit 1.000000; 24 points a side: averaged faces 3, exact faces 1, constant 19; spread of the fit 1.000000; 32 points a side: averaged faces 3, exact faces 1, constant 21; spread of the fit 1.000000; 48 points a side: averaged faces 23, exact faces 1, constant 14; spread of the fit 1.000000.1624324048051015202530grid points a sideiterationsexact fit, faces averageda constantexact fit, faces readthe fit's pointwise spread is 1 on every gridthe faces, not the fit
Fig. 2 With the coefficient jumping by 10⁴ along x = 0.4, iterations against the grid, preconditioned by the exact separable fit with its face values averaged from the grid points and read at the faces, and by a constant.

It takes 21 iterations on the 16-point grid, 3 on the 24- and 32-point grids, and 23 on the 48-point grid. So the prediction, under 20 at every grid, fails at two grids of four. The fit is not the cause; the fit is exact. The cause is the step from fitted values to an operator. The fast solver takes the fit at the grid points and makes each face value the average of the two points beside it, which is exact for a smooth coefficient to second order and wrong for a jump by half the jump: the column of faces that straddles x=0.4x = 0.4 gets (1+J)/2(1 + J)/2 where the operator has JJ or one. Whether that matters depends on where the interface falls between grid points, which is why the count jumps between grids. Built from the coefficient read at the faces, the same fit is the operator exactly, and conjugate gradients takes one iteration on every grid.

This is a small point about discretisation and a large point about the earlier rule. A pointwise spread compares the coefficient with its fit at the grid points. The preconditioner is built from faces. For a smooth coefficient the two agree closely enough that the spread predicts the preconditioner; for a coefficient that is discontinuous between two grid points, the spread can be exactly one and the preconditioner still wrong along a whole line of the grid.

Across the diagonal: three iterations

With the coefficient jumping by 10⁴ across the diagonal, conjugate gradient iterations against the grid, preconditioned by a constant and by the nearest separable coefficient in the norm and in the logarithm16 points a side: constant 3, logarithm 446 at a spread of 5623, norm 567 at a spread of 4.7e+7; 24 points a side: constant 3, logarithm 628 at a spread of 6813, norm 1003 at a spread of 4.8e+7; 32 points a side: constant 3, logarithm 708 at a spread of 7499, norm 1414 at a spread of 4.9e+7; 48 points a side: constant 3, logarithm 827 at a spread of 8254, norm 2124 at a spread of 4.9e+7.1624324048110¹10²10³grid points a sideiterationsfit in the normfit in the logarithma constantJ = 10⁴ across y = xa fit turns two values into a range
Fig. 3 With the coefficient jumping by 10⁴ across the diagonal, iterations against the grid, preconditioned by a constant and by the nearest separable coefficient in the norm and in the logarithm.

On the diagonal the separable fits grow worse with the grid: the logarithm’s from 446 to 827 iterations between 16 and 48 points a side, the norm’s from 567 to 2,124. The constant takes three on every grid. The prediction’s reason was that the fit’s spread would be larger than the jump, and it is not: the logarithm’s fit has a spread of 5,600 to 8,300 at a jump of 10410^4, smaller than the jump, while the constant’s spread is the jump itself, exactly 10410^4. On the earlier rule the fit should have been the better preconditioner by a factor of about the square root of the ratio, and it is two hundred times worse.

The tilted interface sits between the two. Its constant takes 15 to 24 iterations across the jumps, its logarithmic fit 39 at a jump of ten and 2,822 at 10510^5, its fit in the norm 38 to 477. A constant wins there at every jump, by a factor of two and a half at a jump of ten and about twenty at the largest.

Why a constant sees no jump

On a 12 × 12 grid, the 144 eigenvalues of the operator preconditioned by a constant coefficient, in increasing order, scaled by that constant, for a jump of 10⁴ across the diagonal, a jump along x = 0.4, and a smooth bumpjump across the diagonal: 132 at the two cluster values 1 and 10000, 12 between them taking 1 distinct value; jump along x = 0.4: 132 at the two cluster values 1 and 10000, 12 between them taking 12 distinct values; smooth bump, contrast about 400: spread continuously over a ratio of 272.024487296120144110¹10²10³10⁴eigenvalue, in increasing ordereigenvalue × the constantjump across the diagonaljump along x = 0.4smooth bump, contrast about 40012 × 12 · the constant is the geometric meantwo clusters and an interface
Fig. 4 On a 12-by-12 grid, the eigenvalues of the operator preconditioned by a constant, in increasing order and scaled by the constant, for a jump of 10⁴ across the diagonal, a jump along x = 0.4, and a smooth bump.

Conjugate gradients converges in as many steps as its preconditioned operator has distinct eigenvalues, in exact arithmetic, and the figure counts them. On a 12-by-12 grid with a jump of 10410^4, preconditioned by a constant cc, 132 of the 144 eigenvalues sit at 1/c1/c or J/cJ/c to within one per cent. They belong to functions that live entirely on one side of the interface, where the operator is the Laplacian times one or times JJ and the preconditioner is the Laplacian times cc. The other twelve, as many as there are grid points along the interface, belong to functions that straddle it. On the axis interface those twelve take twelve distinct values between 1,478 and 4,121 times 1/c1/c. On the diagonal every one of them is the same number, (J+1)/2(J + 1)/2 times 1/c1/c, because the diagonal staircase meets every row and column of the grid in the same way, and each straddling function sees exactly one cell of each kind. So on the diagonal the preconditioned operator has three distinct eigenvalues, and conjugate gradients finishes in three steps, at any jump and any grid. On the axis it has n+2n + 2, fourteen on this grid, and the counts of 13 to 22 measured on grids of 16 to 48 points sit below n+2n + 2 there because the tolerance is met before every straddling eigenvalue has been resolved. This is the same polynomial argument that a kept vector buys one iteration rests on, where a preconditioned matrix equal to the identity plus a term of rank rr took exactly r+1r + 1 steps: here the identity is replaced by two clusters and the rank by the length of the interface.

The smooth bump of the earlier essay, at a contrast of e6e^6, preconditioned by the same kind of constant, has no clusters at all: its eigenvalues spread continuously over a factor of 272, and conjugate gradients pays for the spread. That is the regime in which the earlier rule holds. A jump is not a large spread; it is two numbers and an interface, and a preconditioner that leaves the two numbers intact leaves an operator conjugate gradients can solve in a handful of steps however far apart the numbers are.

A separable fit across the diagonal does the opposite. Fitting the logarithm of a step function along both axes produces a smooth ramp, and the coefficient over the ramp is no longer two values but every value between them. The clusters dissolve, the spectrum becomes a continuum of width about the spread, and conjugate gradients is back in the regime where the spread governs it, at a spread of several thousand.

The rule, and where it stops

Conjugate gradient iterations on a 24 × 24 grid against the preconditioned coefficient's pointwise spread, the largest over the smallest ratio of the coefficient to its preconditioner, for smooth coefficients with separable fits, for jumps under a constant, and for jumps under a separable fitSmooth coefficients: 7 at 10^0.1, 8 at 10^0.1, 9 at 10^0.2, 10 at 10^0.3, 10 at 10^0.3, 10 at 10^0.3, 15 at 10^0.5, 16 at 10^0.5, 16 at 10^0.6, 17 at 10^0.6, 22 at 10^0.8, 29 at 10^1.0, 28 at 10^1.1, 30 at 10^1.1, 30 at 10^1.2, 50 at 10^1.5, 48 at 10^1.6, 50 at 10^1.6, 55 at 10^1.8, 80 at 10^2.1, 123 at 10^2.4, 100 at 10^2.5, 205 at 10^3.2, 308 at 10^3.8. Jumps under a constant, along x = 0.4: 13 at 10^1, 17 at 10^2, 19 at 10^3, 19 at 10^4, 21 at 10^5, 22 at 10^6; across the diagonal: 3 at 10^1, 3 at 10^2, 3 at 10^3, 3 at 10^4, 3 at 10^5, 3 at 10^6. Jumps under a logarithmic fit: 27 at 10^1.0, 39 at 10^1.5, 80 at 10^1.9, 229 at 10^2.9, 140 at 10^2.9, 628 at 10^3.8, 468 at 10^4.4, 1637 at 10^4.8, 1144 at 10^5.8, 2822 at 10^7.3.0123456110¹10²10³log₁₀ of the pointwise spreaditerationssmooth, separable fitsjumps, separable fita constant, jump along an axisa constant, jump across the diagonalpoints joined in order of spreada jump has two values, not a range
Fig. 5 Iterations against the pointwise spread of the preconditioned coefficient, for smooth coefficients with separable fits, for jumps under a separable fit, and for jumps under a constant.

On one axis, the measurements of this essay and the earlier one show two regimes. The smooth coefficients with separable fits lie on one rising line, the earlier essay’s rule: iterations grow with the spread, about as its square root. The jumps under a separable fit lie on the same line, from 27 iterations at a spread of about nine to 2,822 at a spread of 2⋅1072 \cdot 10^7, because the fit has made them smooth. The jumps under a constant lie on two flat lines, at three iterations on the diagonal and 13 to 22 along the axis, across five decades of spread. The rule is a rule about spectra that are continuous, and a two-valued coefficient preconditioned by something that keeps it two-valued does not have one.

For a program, the consequence is that a piecewise-constant coefficient, the common case in layered media, composite materials and anything assembled from parts, should be preconditioned by something that respects its pieces before anything that smooths it. A constant does that by accident, and a preconditioner built from the pieces themselves, a different constant in each region, would do it by design. A separable fit, which a solve that is d decompositions makes so cheap and five indices are cheaper than two makes cheaper still in more dimensions, is the right tool for a coefficient that varies smoothly and the wrong one for a coefficient that jumps, unless the jump happens to run along an axis and the faces are read exactly.

What a method that reads the matrix would see

The separable preconditioners read the coefficient’s samples; a constant reads one number. A method that reads the matrix itself sees something neither does. Each off-diagonal entry of the five-point operator is a face value, so the entries across the interface are −J-J on one side, −1-1 on the other, and a mixture of the two along the faces the interface crosses. Aggregating what the matrix calls strong built a hierarchy from exactly that kind of reading, grouping unknowns joined by large entries, and on a two-valued coefficient such a reading separates the two regions along the interface without being told where it is. The coarse grid the matrix chooses showed the same mechanism finding an anisotropy’s direction from the entries alone.

That is the third way of respecting the pieces, and it costs what algebraic coarsening costs. Measured here only by what the constant achieves by accident, the value of respecting the pieces is the difference between three iterations and several hundred, and it is the same at every jump. A program that knows its coefficient is piecewise constant can choose its preconditioner on that fact alone, before looking at a single number, and the earlier essay’s question of which fit is nearest does not arise.

There is a qualification that keeps this from being a recipe. The constant’s three iterations on the diagonal came from a coincidence, every straddling function alike, and its 13 to 22 along the axis from an interface that is short and straight. An interface that winds through the grid has as many distinct straddling eigenvalues as it has cells, and a constant preconditioner’s count would grow with its length. The interface sets the cost; the jump does not.

How this fits the separable story so far

An index that is a pair began this line with the Kronecker product as a way of writing two-dimensional operators in one-dimensional pieces, and the earlier essays built from it a fast solver and a preconditioner. Every step assumed the coefficient varied smoothly enough that its samples at the points stood for it everywhere. The two failures here are both failures of that assumption, at the discretisation level and at the spectral level. The first is cured by reading the coefficient where the operator reads it. The second is not a failure of the separable preconditioner at all: it is the discovery that for a jump, the best preconditioner is not the nearest operator in any norm, but the one whose preconditioned spectrum has the fewest distinct values. The nearest product is not the nearest operator found the first singular value’s share misleading on smooth coefficients; on jumps, nearness in any sense is misleading. The count of distinct eigenvalues is what conjugate gradients pays for, and the first count names the rank found a program reading that count off its first solve along a sequence; a solve on a jump coefficient reports its interface the same way.

What straight interfaces and one equation cannot settle

The interfaces are straight lines and the coefficient takes two values. A curved interface meets the grid irregularly, so its straddling functions would take many distinct values, as the tilted line’s do, and a constant would cost more there; a coefficient with three or more values has as many clusters. The diagonal’s three iterations are a coincidence of geometry, a staircase that meets every row alike, and should not be taken as typical; the axis interface’s fourteen are. The operator is the five-point stencil with arithmetic face values; a harmonic average at the faces, which many codes use for jumps, changes the straddling functions’ eigenvalues and is not measured. And the iterations are from one right-hand side; a right-hand side with no component along some straddling functions would converge in fewer steps. The spectra were computed on a 12-by-12 grid, where a dense symmetric eigensolve is cheap, and the iteration counts on grids of 16 to 48; that the cluster structure carries from the small grid to the large ones is an inference from the counts, which behave as it predicts, and not a separate measurement.

Still open: one constant a region, and a curved interface

A constant for each piece. If the preconditioner is the Laplacian with the coefficient replaced by its value on each side, solved by a fast method on the whole grid only where it is separable, the clusters are kept and the interface modes are moved. The prediction with a sign is that on the tilted interface a preconditioner that is exact on each side and averaged across the interface takes at most as many iterations as a constant at every jump, and fewer than ten at every jump from 10210^2 to 10610^6 on a 24-by-24 grid, so that the cost of a jump is set by its interface and not by its size.

A circle. A circular interface of radius a quarter, centred, meets the grid irregularly. The prediction is that a constant then takes between 30 and 60 iterations on a 24-by-24 grid at every jump from 10210^2 to 10610^6, flat in the jump as here but several times the straight interfaces’ counts, because the straddling functions take as many distinct values as the interface has cells, and that the logarithmic separable fit is worse than the constant by at least a factor of five at a jump of 10410^4.

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.

Conjugate gradientsDiscrete laplacianEigenvalueKronecker sumPreconditioningSeparability