Generator

Multiplications in one product with the 3-dimensional Laplacian, assembled against reshaped

One function in the tensor library, called 19 times across 4 essays. Below: what it draws at its defaults, what it draws at every value an essay asks for, the 10 claims it put to the test while drawing them, and where it stands against the rule this site is named for.

At its defaults it draws multiplications in one product with the 3-dimensional laplacian, assembled against reshaped. Both curves are exact counts rather than estimates. The assembled matrix has n^3 rows, so multiplying by it is n^6 multiplications; applying the 3 one-dimensional factors along their own indices is 3·n^4. The fitted slopes are 6.00 and 4.00 against 6 and 4 exactly. At n = 256 that is 2.81·10¹⁴ against 1.29·10¹⁰, a factor of 2.18·10⁴ — and the ratio is n^2, so it grows with every size rather than settling.

kron-cost is one function in lib/figures/tensor.js — an index that is a tuple — a matrix that is d small ones, and the inverse that is nearly one. Everything below came out of it during this build, at arguments taken from the essays rather than invented for this page. A figure here is the figure a reader meets in an essay, and if the generator changes, this page changes with it.

At its defaults

Drawn even though every essay passes arguments — which on this site is every essay, at 100% of placements since the standard pass. A default nothing exercises is a trap for the next essay to call this with none, and this is the page where a default that has drifted from the figures around it becomes visible.

Multiplications in one product with the 3-dimensional Laplacian, assembled against reshapedBoth curves are exact counts rather than estimates. The assembled matrix has n^3 rows, so multiplying by it is n^6 multiplications; applying the 3 one-dimensional factors along their own indices is 3·n^4. The fitted slopes are 6.00 and 4.00 against 6 and 4 exactly. At n = 256 that is 2.81·10¹⁴ against 1.29·10¹⁰, a factor of 2.18·10⁴ — and the ratio is n^2, so it grows with every size rather than settling.10¹10²10²10⁵10⁸10¹¹10¹⁴n, points along one axismultiplicationsassembled: n^6reshaped: 3n^4two exponentsfitted dense slope62d6fitted factored slope4d + 14ratio at n = 2562.2·10⁴nothing is approximatedthe matrix was never anything else

Both curves are exact counts rather than estimates. The assembled matrix has n^3 rows, so multiplying by it is n^6 multiplications; applying the 3 one-dimensional factors along their own indices is 3·n^4. The fitted slopes are 6.00 and 4.00 against 6 and 4 exactly. At n = 256 that is 2.81·10¹⁴ against 1.29·10¹⁰, a factor of 2.18·10⁴ — and the ratio is n^2, so it grows with every size rather than settling.

show: "jk-spectrum"

The arguments are the ones A jump is two numbers passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

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

jump 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.

show: "jk-jump", kind: "diagonal"

The arguments are the ones A jump is two numbers passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

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

J = 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.

show: "jk-axis"

The arguments are the ones A jump is two numbers passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

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

16 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.

show: "jk-diag"

The arguments are the ones A jump is two numbers passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

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

16 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.

show: "jk-spread"

The arguments are the ones A jump is two numbers passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

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

Smooth 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.

What it checked while drawing

Every figure above checked its own claims on the way to being drawn, and a claim that failed would have stopped the picture rather than shipped a wrong one. Those checks used to leave no trace at all: a passing one returned true and the only evidence the figure had checked anything was that nothing crashed. The list below is what they actually said, collected by running this generator with an observer installed — not a description of what it is believed to check.

10 distinct claims across 6 sets of arguments, grouped below by shape — because most of them are one sentence with a different number in it, and how many separate times that sentence was put to the test is the informative part.

a coefficient family this file draws

a coefficient the dial offers

a number of indices the counts are meaningful at

an interface the dial offers

an interface this file draws

and the reshaped one costs nᵈ⁺¹

at least one row

curves with points on them

Jacobi needs a symmetric matrix

the assembled product costs n²ᵈ

Against the rule

The rule does not apply to it. It factorises nothing, so there is no residual it could be withholding. That is worth stating rather than leaving blank: a site that reported the rule as satisfied by every generator would be counting mostly generators the rule never reached.

Across the library: the rule bites on 217 of 397 generators — 199 print a residual and 18 are exempt with a published reason; 180 factorise nothing. Read from lib/residual-rule.js, which is the same body the gate enforces from, and the gate's last check fails the build if this page and it disagree about any generator.

Where it is called

Changing this generator changes every figure on this list. That is what makes the list worth publishing rather than keeping in a check script.

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.

When the index is a tuple

An index that is a pair

A discretisation on a two-dimensional grid of n points a side has n² unknowns and a matrix with n⁴ entries — 10⁸ at n = 100. What that matrix is instead is two Kronecker products of an n × n matrix, which is 2n² numbers, and nothing has been approximated: assembling it was the mistake.

When the index is a tuple

Five indices are cheaper than two

The same 4,096 unknowns cost 1.049·10⁶ multiplications indexed as a 64 × 64 grid and 1.966·10⁵ indexed as six axes of four. The dense factorisation that ignores the indexing costs 4.581·10¹⁰ at every one of them, and the residual improves in the same direction as the cost.

When the index is a tuple

The nearest product is not the nearest operator

A Kronecker sum is solved by one eigendecomposition per axis, and a variable-coefficient operator almost never is one. So the natural move is to solve the nearest separable problem instead and use it as a preconditioner, with the coefficient's first singular value saying how near. That number predicts nothing. A bump at contrast six has 99.9 per cent of its norm in its first singular value and takes 123 iterations, seven times what it takes at a share of 95 per cent, because a fit in the norm chases the peak and leaves the rest of the domain wrong by a factor of 167. Fit the logarithm instead and the misfit is a ratio, the iterations fall by more than half, and one number accounts for them on every case tried: the root of the spread of the pointwise ratio.

The whole library · All essays · What must fail