Generator

chan-vs-strang

One function in the chan library, called 7 times across 6 essays. Below: what it draws at its defaults, what it draws at every value an essay asks for, the 17 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 conjugate gradient steps on the ρ = 0.95 toeplitz family. Iteration count against the matrix size, drawn on a logarithmic size axis. Unpreconditioned: 20, 37, 59, 99, 149. With the wrapped circulant: 21, 55, 117, 122, 9. With the averaged one: 7, 8, 9, 10, 10, which is the O(1) the theory promises and the wrapped one does not deliver until its smallest eigenvalue has become positive.

chan-vs-strang is one function in lib/figures/chan.js — two circulants — the one that chooses a diagonal, and the one that averages. 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.

Conjugate gradient steps on the ρ = 0.95 Toeplitz familyIteration count against the matrix size, drawn on a logarithmic size axis. Unpreconditioned: 20, 37, 59, 99, 149. With the wrapped circulant: 21, 55, 117, 122, 9. With the averaged one: 7, 8, 9, 10, 10, which is the O(1) the theory promises and the wrapped one does not deliver until its smallest eigenvalue has become positive.10²020406080100120140160size niterationsno preconditionerwrapped (Strang)averaged (T. Chan)both are circulant approximations‖C − T‖/‖T‖, averaged0.13‖C − T‖/‖T‖, wrapped0.25smallest eigenvalue, wrapped, n = 16-0.65one of them is positive definiteand it is the one that is nearer

Iteration count against the matrix size, drawn on a logarithmic size axis. Unpreconditioned: 20, 37, 59, 99, 149. With the wrapped circulant: 21, 55, 117, 122, 9. With the averaged one: 7, 8, 9, 10, 10, which is the O(1) the theory promises and the wrapped one does not deliver until its smallest eigenvalue has become positive.

rho: 0.95

The arguments are the ones A preconditioner that changes sign passes. A value drawn at the generator's defaults instead would be a picture no essay asked for and no assertion has been run against.

Conjugate gradient steps on the ρ = 0.95 Toeplitz familyIteration count against the matrix size, drawn on a logarithmic size axis. Unpreconditioned: 20, 37, 59, 99, 149. With the wrapped circulant: 21, 55, 117, 122, 9. With the averaged one: 7, 8, 9, 10, 10, which is the O(1) the theory promises and the wrapped one does not deliver until its smallest eigenvalue has become positive.10²020406080100120140160size niterationsno preconditionerwrapped (Strang)averaged (T. Chan)both are circulant approximations‖C − T‖/‖T‖, averaged0.13‖C − T‖/‖T‖, wrapped0.25smallest eigenvalue, wrapped, n = 16-0.65one of them is positive definiteand it is the one that is nearer

Iteration count against the matrix size, drawn on a logarithmic size axis. Unpreconditioned: 20, 37, 59, 99, 149. With the wrapped circulant: 21, 55, 117, 122, 9. With the averaged one: 7, 8, 9, 10, 10, which is the O(1) the theory promises and the wrapped one does not deliver until its smallest eigenvalue has become positive.

rho: 0.9

The arguments are the ones Changing the condition number on purpose passes. A value drawn at the generator's defaults instead would be a picture no essay asked for and no assertion has been run against.

Conjugate gradient steps on the ρ = 0.9 Toeplitz familyIteration count against the matrix size, drawn on a logarithmic size axis. Unpreconditioned: 20, 35, 54, 82, 117. With the wrapped circulant: 20, 45, 26, 7, 4. With the averaged one: 7, 9, 10, 10, 9, which is the O(1) the theory promises and the wrapped one does not deliver until its smallest eigenvalue has become positive.10²020406080100120size niterationsno preconditionerwrapped (Strang)averaged (T. Chan)both are circulant approximations‖C − T‖/‖T‖, averaged0.21‖C − T‖/‖T‖, wrapped0.29smallest eigenvalue, wrapped, n = 16-0.4one of them is positive definiteand it is the one that is nearer

Iteration count against the matrix size, drawn on a logarithmic size axis. Unpreconditioned: 20, 35, 54, 82, 117. With the wrapped circulant: 20, 45, 26, 7, 4. With the averaged one: 7, 9, 10, 10, 9, which is the O(1) the theory promises and the wrapped one does not deliver until its smallest eigenvalue has become positive.

What it checked while drawing

Every figure above asserted its own claims on the way to being drawn, and a claim that failed would have failed the build rather than drawn a wrong picture. Those assertions 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.

17 distinct claims across 3 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.

and beats no preconditioner at n = 16 — asserted 5 times

the averaged circulant is definite at n = 16 — asserted 5 times

a correlation the family is conditioned at

enough sizes to show a trend

the averaged circulant's step count barely moves

the circulant is not singular

the fast transform is given a power-of-two length

the Toeplitz corner is one number

while the unpreconditioned count grows with the size

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 66 of 131 generators — 51 print a residual and 15 are exempt with a published reason; 65 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.

Structure, and the solver that cannot see it

A preconditioner that changes sign

Strang's circulant preconditioner takes Toeplitz conjugate gradients from 179 steps to 10 at n = 256. At n = 64 on the same family it takes 66 steps to 109 — worse than doing nothing. Between those rows the preconditioner's smallest eigenvalue crosses zero, and nothing in the published account of the method mentions that it can be negative.

Iterating, instead of factorising

Changing the condition number on purpose

Preconditioning is usually introduced as a trick that makes an iteration converge faster. It is not a trick. It is solving a different system with the same solution and a condition number chosen rather than inherited, and the new condition number is computable.

Sparsity, and what elimination costs

Structure and stability stop being separable

The sparsest variable to eliminate on this matrix has a diagonal entry of 10⁻¹². Eliminating it produces the smaller factor, reproduces the matrix to 3.8·10⁻¹⁷ — better than pivoting does — and returns an answer wrong in the fifth digit.

Structure, and the solver that cannot see it

The circulant that cannot be indefinite

The previous essay found a preconditioner taking 117 steps against an unpreconditioned 59, because its smallest eigenvalue was −0.173. Average the two diagonals instead of choosing between them and the count is 7, 8, 9, 10, 10 across a factor of sixteen in size.

Iterating, instead of factorising

The spectrum that predicts nothing

For a symmetric matrix the eigenvalues govern how fast an iteration converges. Drop symmetry and they stop governing anything — there is a matrix whose eigenvalues are as evenly spread as eigenvalues can be, on which GMRES makes no progress at all until the last possible step.

Structure, and the solver that cannot see it

Two dimensions, and the cluster that thins

The same kernel, the same averaging, the same transform — applied along two axes instead of one. In one dimension the preconditioned step count is 7, 10, 10, 10; on square grids with the same unknown counts it is 10, 18, 20, 21, and the share of the spectrum near one falls from 56% to 17%.

The whole library · All essays · What must fail