Neither sparse nor dense

A far pair is not a smooth pair

The admissibility test reads four numbers per pair of clusters and not one entry of the matrix, which was presented as its great economy. It is also an assumption: that distance from the diagonal is smoothness. On the kernel it was built for it lands within an eighth of the least storage any partition of the same tree has. Move the singularity onto a line off the diagonal and it stores twice the least, admitting blocks of rank 35 that cost more than their entries. Put no singularity anywhere and it stores nearly six times the least, carefully refusing pairs that needed no refusal. A random probe of a few entries finds the best partition, and a larger one can miss the singular line altogether and store the whole matrix as one block of rank 165, unless it checks the rank before believing it.

Worth reading first: Which pairs are allowed to be small · A block nobody can call sparse.

Which pairs are allowed to be small introduced the rule a hierarchical representation is built on. A pair of clusters of indices is admissible when its members are far apart relative to their size, and an admissible block is stored as two thin factors. On a 256-square matrix it yields 112 blocks, 66 of them low-rank, none of rank above five. And it does so by reading “four numbers per pair of index clusters and not one entry of the matrix”, which is why it can be run before the matrix exists.

The test that costs what it saves then weighed it against the rule that compresses every off-diagonal block regardless, and the same matrix, numbered twice showed it failing outright when a permutation hides the geometry. Neither questioned the premise, which is stated in the sentence above: that where the points are says how compressible a block is. That is true for a kernel whose only singularity sits on the diagonal, because such a kernel is smooth away from it. The rule has assumed this about the kernel without looking, and it has no way of looking. Four kernels are enough to find out what that costs.

The least any partition of this tree can store

To measure an overpayment there has to be a floor, and for a fixed cluster tree there is a computable one. Every candidate block in the tree is either stored whole, compressed at its own numerical rank, or split into its four children. Taking the cheapest of those from the bottom up gives the least storage any partition of the tree can reach, at one tolerance. This takes an SVD of every block in the tree, a total of 341 SVDs at 256 unknowns with a leaf size of 16, which no program would do in practice and which is just what a measurement needs. So all partitions below compress their admitted blocks by their own SVDs to the same 10−810^{-8}, and differ only in which blocks they admit.

Four kernels on a uniform grid are used. The first is the one the rule was built for, 1/r1/r with its singularity on the diagonal. The second is the same function with its singularity moved to the line x−y=0.37x - y = 0.37. The third is a wide Gaussian with no singularity at all. The fourth is an oscillatory kernel, cos⁡(40r)/r\cos(40r)/r, which a separate essay on this field has already found refuses to compress beyond a certain point.

The block partitions of a 256-square matrix of 1/r on a line off it, by the geometric admissibility rule and by the least storage any partition of this tree hasOn 1/r on a line off it the geometric rule stores 60.8 per cent of the entries in 112 blocks, of rank at most 35; the best partition stores 29.5 per cent in 43 blocks, of rank at most 10.the geometric rule: 61% of n²the best possible: 30% of n²kept wholerank up to 6up to 20above 20n = 256 · ε = 10⁻⁸ · the same treethe rule cannot see the kernel
Fig. 1 The block partitions of a 256-square matrix by the geometric admissibility rule and by the least storage any partition of the tree has. The dial sets the kernel. The left-hand picture never changes.

The left-hand panel is the point of this figure, and the dial makes it plain. Turn through all four kernels and it does not move at all: 112 blocks in the same pattern, because it depends only on the points. The right-hand panel changes with every stop. On the diagonal kernel it resembles the geometric partition with coarser blocks near the corners. On the offset kernel it runs a line of small blocks along x−y=0.37x - y = 0.37, exactly where the singularity is, and it leaves the real diagonal to large low-rank blocks. On the Gaussian it is one block, of rank 8.

What the rule pays on each kernel

The storage of a 256-square matrix as a share of its entries, at one tolerance, by four routes to a partition, on four kernels1/r on the diagonal: the geometric rule 0.412, probe of eight 0.367, probe of sixteen, checked 0.422, the best possible 0.367; 1/r on a line off it: the geometric rule 0.608, probe of eight 0.472, probe of sixteen, checked 0.360, the best possible 0.295; a wide Gaussian: the geometric rule 0.358, probe of eight 0.063, probe of sixteen, checked 0.063, the best possible 0.063; cos(40r)/r: the geometric rule 0.539, probe of eight 0.496, probe of sixteen, checked 0.484, the best possible 0.438.00.250.50.7511/r on the diagonalthe geometric rule0.412probe of eight0.367probe of sixteen, checked0.422the best possible0.3671/r on a line off itthe geometric rule0.608probe of eight0.472probe of sixteen, checked0.360the best possible0.295a wide Gaussianthe geometric rule0.358probe of eight0.063probe of sixteen, checked0.063the best possible0.063cos(40r)/rthe geometric rule0.539probe of eight0.496probe of sixteen, checked0.484the best possible0.438stored numbers over the matrix's entriesn = 256 · ε = 10⁻⁸a rule made for one kernel
Fig. 2 The storage of a 256-square matrix as a share of its entries, at one tolerance, by four routes to a partition, on four kernels.

On the diagonal kernel the rule is in good shape: 41.2 per cent of the entries against a least of 36.7, an overpayment of 12 per cent. A rule built on a theorem about this kernel is doing what the theorem says. And that near-agreement is the evidence the earlier essays had before them.

On the wide Gaussian it stores 35.8 per cent against a least of 6.3, more than five times too much. That matrix is one low-rank block of rank 8, at 4,096 numbers. The rule never finds out, because it keeps subdividing near the diagonal: two touching clusters always fail the test, whatever the kernel does there, so it ends at the same 16-by-16 dense leaves along the whole diagonal. Those leaves are what the storage is. They were the price of a singularity that this kernel does not have.

On the oscillatory kernel it stores 53.9 against 43.8, an overpayment of a fifth. And on the offset kernel it stores 60.8 against 29.5, about double. That one fails in the other direction as well.

Far from the diagonal, and across the singular line

The largest rank among the admitted blocks of each partition, and how many of the geometric rule's admitted blocks cost more than storing them whole, on four kernels1/r on the diagonal: geometric 5 with 0 wasted, best 12; 1/r on a line off it: geometric 35 with 5 wasted, best 10; a wide Gaussian: geometric 4 with 0 wasted, best 8; cos(40r)/r: geometric 9 with 0 wasted, best 17.0102030401/r on the diagonalgeometric, 0 blocks worse than whole5the best partition121/r on a line off itgeometric, 5 blocks worse than whole35the best partition10a wide Gaussiangeometric, 0 blocks worse than whole4the best partition8cos(40r)/rgeometric, 0 blocks worse than whole9the best partition17the largest rank admittedn = 256 · ε = 10⁻⁸a far pair is not a smooth pair
Fig. 3 The largest rank among the admitted blocks of each partition, and how many of the geometric rule’s admitted blocks cost more than storing them whole.

The rule’s largest admitted rank on the diagonal kernel is five, as the first essay reported. On the offset kernel it is 35, and five of its admitted blocks are stored at more cost than if they had been left whole. These are the blocks that the singular line crosses. They are far from the diagonal, they pass the test, and what they contain is the worst part of the matrix. The rule is not merely overpaying on them. It is storing them worse than a program that had made no attempt to compress at all.

It is worth contrasting this with what the best partition does with the same kernel. Its largest rank is ten. Its blocks along the singular line are small and whole, while its blocks elsewhere, including over the diagonal, are large and low-rank. So the best partition’s largest rank on the diagonal kernel is higher than the rule’s, 12 against 5, and that is not a failure: it has chosen to take larger blocks at higher rank wherever that stores less. The rule’s low ranks, which read like an achievement, are partly the mark of a partition subdivided further than it needed to be. The smaller cluster sets the rank shows the local version of this, in which a rank is a matter of what the block’s shorter side can support.

A real kernel has this offset singularity more often than one might expect. A delay in a time-dependent integral operator gives one, a reflection across a boundary gives one in a coordinate that does not make it look like a boundary, and so does a Green’s function in which a source is mirrored. Those are familiar problems with familiar reasons to use a hierarchical format, and the standard rule reads nothing from them.

The overpayment grows with the matrix

At 128 unknowns the same four kernels show the rule’s overpayment at 1.13, 1.72, 4.6 and 1.18, in the order diagonal, offset, Gaussian, oscillatory. At 256 they are 1.12, 2.06, 5.7 and 1.23. So on the kernel the rule was made for, the ratio holds still, since a theorem about that kernel underlies both partitions. On the other three it rises with the size, by about a fifth per doubling on the two that do not suit it at all.

The reason is the same on both, though the failure looks different. On the Gaussian, the best partition stores eight columns times twice the size, so its storage grows in proportion to the size, while the rule’s dense diagonal grows the same way with a much larger constant, and the rule’s near-diagonal low-rank blocks add a logarithm’s worth more. On the offset kernel, the blocks crossing the singular line are admitted at a rank that itself grows with the size, 20 at 128 unknowns and 35 at 256. Only the second of these would ever become an impossibility: a rank that grows with the block is the condition under which a hierarchical format stops being one, and the rule, in admitting such blocks, has taken a kernel that a better partition holds at rank 10 and given it that condition.

A test that reads a few entries

The obvious alternative is a test that actually looks. Pick a random set of kk rows and kk columns of the block, read the k2k^2 entries where they cross, and compute that small matrix’s numerical rank. If it is well below kk, and storing a block of that rank would be cheaper than storing it whole, admit the block; otherwise split. At eight samples this reads 1,856 entries of 65,536 on the diagonal kernel and only 64 on the Gaussian, which it takes as one block immediately.

At eight samples the result is striking. On the diagonal kernel it lands on 36.7 per cent, exactly the least. On the Gaussian it lands on 6.3, exactly the least. On the oscillatory kernel it stores 49.6 against 43.8, and on the offset kernel, at this seed, 47.2 against 29.5, each better than the rule. A test that reads under 3 per cent of the entries found the best partition on two kernels of four, where a rule that reads none is the worst of those compared.

And yet a probe has a failure that the rule cannot have.

The storage a probe reaches over six seeds, at three sizes of the random cross, on four kernels, as a share of the entries1/r on the diagonal: 4 samples from 0.613 to 0.675, 8 samples from 0.367 to 0.367, 16 samples from 0.367 to 2.000; 1/r on a line off it: 4 samples from 0.528 to 0.596, 8 samples from 0.472 to 1.289, 16 samples from 1.289 to 1.289; a wide Gaussian: 4 samples from 0.164 to 0.207, 8 samples from 0.063 to 0.063, 16 samples from 0.063 to 0.063; cos(40r)/r: 4 samples from 1.000 to 1.000, 8 samples from 0.488 to 0.517, 16 samples from 0.438 to 2.000.00.511.521/r on the diagonal, best 0.3674 samples8 samples16 samples1/r on a line off it, best 0.2954 samples8 samples16 samplesa wide Gaussian, best 0.0634 samples8 samples16 samplescos(40r)/r, best 0.4384 samples8 samples16 samplesstored over entries; above one is worse than densedot: the median of six seeds · bar: the rangemore samples can be worse
Fig. 4 The storage a probe reaches over six seeds, at three sizes of the random cross, on four kernels, as a share of the entries. The dot is the median and the bar is the range. Above one is worse than storing the matrix whole.

At sixteen samples, on the offset kernel, the median probe stores 129 per cent of the entries, in one block, of rank 165. It looked at 256 entries of the whole matrix, found a cross of low rank, and admitted everything. Its cross happens to contain no points within the narrow peak of the line, so what it sampled was smooth. All six seeds do this. On the diagonal kernel the same happens on most seeds and not on all: at sixteen samples four seeds of six store 200 per cent, a block of full rank held as two factors, while at eight samples every seed lands on 36.7. On the oscillatory kernel at sixteen one seed reaches 200 per cent as well, and on the offset kernel at eight the seeds run from 47 to 129. Reading more can make the outcome worse, since a larger cross has more room for its rank to fall short of kk, and the bar for admission is that it should. This is the same trouble as a sketch that finds the columns it can see: a random sample of a matrix cannot see a feature concentrated in a small part of it. A singularity is such a feature, and a singularity is what the whole theory is about.

Believing the rank after reading it

The repair costs very little, because the compression has to happen anyway. Once a block is admitted, it is passed to an SVD or a cross approximation to get its factors, and that reveals its true rank. If that rank is not paying, put the block back and split it.

The storage a checked probe reaches over six seeds, at three sizes of the random cross, on four kernels, as a share of the entries1/r on the diagonal: 4 samples from 0.613 to 0.675, 8 samples from 0.422 to 0.422, 16 samples from 0.422 to 0.422; 1/r on a line off it: 4 samples from 0.528 to 0.596, 8 samples from 0.360 to 0.360, 16 samples from 0.360 to 0.360; a wide Gaussian: 4 samples from 0.164 to 0.207, 8 samples from 0.063 to 0.063, 16 samples from 0.063 to 0.063; cos(40r)/r: 4 samples from 1.000 to 1.000, 8 samples from 0.539 to 0.681, 16 samples from 0.484 to 0.484.00.511.521/r on the diagonal, best 0.3674 samples8 samples16 samples1/r on a line off it, best 0.2954 samples8 samples16 samplesa wide Gaussian, best 0.0634 samples8 samples16 samplescos(40r)/r, best 0.4384 samples8 samples16 samplesstored over entries; above one is worse than densedot: the median of six seeds · bar: the rangethe rank is read before it is believed
Fig. 5 The storage a checked probe reaches over six seeds, at three sizes of the random cross, on four kernels. The same axis as the unchecked probe’s.

With that check, the probe no longer has a catastrophic outcome anywhere. Admitting only if the true rank stores in under half the block’s entries, the sixteen-sample probe lands on 42.2, 36.0, 6.3 and 48.4 per cent, within a quarter of the least on all four kernels, and with no spread at all between the six seeds on any of them. That beats the geometric rule on all kernels except the diagonal, where it pays one percentage point more, on the kernel the rule was designed for. Its reads rise only slightly, 7,424 on the diagonal kernel, or about 11 per cent of the entries, and the SVDs that make up its check are ones the compression would have done anyway on the blocks it keeps. A rejected block’s SVD is the only wasted effort, and it is not much.

Four samples, on the other hand, is too few. There the rank of a small cross falls short of four only for very smooth blocks, so it rarely admits, and it lands at 61 per cent on the diagonal kernel and at 100 on the oscillatory one. The lower limit on a probe’s size is about what the block’s real rank needs, and the upper limit is whatever a check can catch. That points to a better design still: compress with a rank-revealing method to a modest stopping rank, in which the probe and the check are one and the same operation. Built from products alone reaches a representation from the other direction, reading no entries at all, and it has to fix its partition beforehand by geometry for this very reason.

The entries of a 256-square matrix each probe reads to choose its partition, on four kernels, against 65536 in the matrix1/r on the diagonal: 1856, 4352, 7424; 1/r on a line off it: 1088, 256, 9472; a wide Gaussian: 64, 256, 256; cos(40r)/r: 3392, 7424, 7424 at eight, sixteen and sixteen checked samples, of 65536.101001000100001/r on the diagonal8 samples185616 samples435216 samples, checked74241/r on a line off it8 samples108816 samples25616 samples, checked9472a wide Gaussian8 samples6416 samples25616 samples, checked256cos(40r)/r8 samples339216 samples742416 samples, checked7424entries readthe geometric rule reads nonea small part of what compression will read
Fig. 6 The entries of a 256-square matrix each probe reads to choose its partition, on four kernels, against 65,536 in the matrix.

What remains of the rule’s economy

The geometric rule’s advantage is real, and it is not only about the entries it saves. It runs before the matrix exists, and that makes it the only option when the partition has to be chosen to decide what to compute at all, as with a kernel whose entries are expensive, or a matrix being assembled in pieces by different processors. It reads nothing and so it cannot be fooled by a bad sample, and the same run on the same points produces the same partition, so a storage estimate can be made in advance. It is also self-consistent in that its bound on the rank is a theorem for the kernels it applies to. The size the rank does not notice rests on precisely that.

What it does not have is any knowledge of the kernel, and all the facts that make its economy work are facts about the kernel that some person knows. So the rule’s sentence should read: if the kernel is smooth away from the diagonal, this partition’s ranks are small. A caller holding a kernel of a different kind has to supply a different geometry, for instance a coordinate in which x−y−0.37x - y - 0.37 is the separation, and a reader of the results has to know that happened. For the offset kernel such a coordinate would repair everything, since it reproduces the diagonal case. Finding one from entries is the probe’s job, and for a kernel that is someone else’s code it may be the only way available.

The earlier reading of a rank as a number of digits stands on the blocks where it was measured. Here the point has moved one level up. Which block the digits are counted over is also a choice, and at 256 unknowns on a kernel this benign the choice moves the storage by a factor of six.

Where this measurement ends

The kernels are four, in one dimension, on one grid, and at one tolerance. In one dimension a tree is a very simple thing: clusters are intervals, and a kernel’s singular set is a line in the block plane. Two and three dimensions raise the rank at which any of this occurs, and make the geometric rule’s premise harder to violate by accident in some ways and easier in others. Probes in higher dimensions have many more blocks to read, and the 11 per cent read here would be a smaller share.

The probe here samples uniformly. A probe that samples the block’s corners, or its boundary, would see a singular line that crosses a block more reliably, and such designs exist. And the least storage is the least over one tree: a tree built from the kernel’s own structure could beat it, as a clustering by the singular line would. Six seeds can show the range of a probe’s behaviour only coarsely, so a probe with a one-in-twenty failure would easily go unseen here, and the checked route’s agreement across seeds is evidence rather than proof.

Still open: a sharper probe, and a rule told where the singularity is

A probe that includes the corners. A singular line that crosses a block must enter and leave through its boundary. The prediction with a sign is that a cross drawn half from the boundary rows and columns and half at random never admits the whole matrix on the offset kernel at any seed, stores within 1.2 of the least at sixteen samples, without any check, and reads no more entries than the probe above. If it fails, then the check is doing work that a sampling design cannot replace.

The rule, told. If a caller supplies the line, the geometric rule can use the distance to it in place of the distance to the diagonal. The prediction is that with that change the rule on the offset kernel stores within 1.15 of the least, the same margin it has on the diagonal kernel, so that its whole failure on this kernel is ignorance of where the line is. On the Gaussian no such distance exists, and the prediction is that no setting of the constant η\eta below two brings it within a factor of three of the least, since its dense diagonal is built into a test that refuses touching pairs.

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.

AdmissibilityCluster treeHierarchical matrixKernel matrixNumerical rankOff-diagonal rank