The abelian sandpile explained
Pour sand on one spot and you expect a cone. Pour grains on one cell of a grid, with the rule that a cell holding four grains passes one to each neighbour, and you get something far stranger: a pattern of perfect order and endless detail. The sandpile model began as physics, a toy for avalanches and earthquakes, and grew into a meeting point of probability, combinatorics and geometry.
The rule
Take a grid of cells, each holding some grains of sand. A cell is stable while it has fewer grains than neighbours: on a square grid with four neighbours it may hold 0, 1, 2 or 3. A cell with 4 or more topples: it loses 4 grains and each of its four neighbours gains one. A toppling can push a neighbour over the threshold, which topples in turn, so a single grain can start an avalanche of any size. On a finite grid, grains that topple over the edge are lost, so every avalanche ends. Per Bak, Chao Tang and Kurt Wiesenfeld introduced the model in 1987, in a paper called Self-organized criticality: an explanation of 1/f noise.
Why the order does not matter
If two cells are unstable at once, toppling one first does not stop the other from toppling later, because toppling only ever adds grains to other cells. From that simple fact Deepak Dhar showed in 1990 that the final stable configuration does not depend on the order of the topplings, and neither does the number of times each cell topples. He called the model abelian, after the property of addition that a + b = b + a. Mathematicians know the same game as chip-firing, studied on any graph by Anders Björner, László Lovász and Peter Shor in 1991. The abelian property is also what makes large piles computable: a cell may give away all its surplus at once.
Self-organized criticality
A magnet loses its magnetism at one exact temperature, the Curie point, and only near such critical points do fluctuations of all sizes appear together. Bak, Tang and Wiesenfeld asked why so many things in nature, from earthquakes to the flicker noise in electronic circuits, show that critical behaviour without anyone tuning them. Their sandpile was the answer they proposed: drop grains at random and the grid drives itself to a critical state. In that state most grains do nothing, a few cause avalanches that cross the whole grid, and the sizes in between follow a power law. On an infinite square grid the average height in that state is exactly 17/8 = 2.125.
The sandpile group
On a finite grid, the stable configurations that keep coming back when grains are added at random are called recurrent. Adding two of them cell by cell and letting the sum topple gives another recurrent configuration, and with this addition they form a finite group, the sandpile group. Its number of elements equals the number of spanning trees of the grid, a link to Kirchhoff's matrix-tree theorem of 1847. Its identity element, the configuration that changes nothing when added, can be found by stabilizing 6 grains on every cell, subtracting the result from 6 and stabilizing again. For a square grid it is a striking picture: a square in the middle, surrounded by fractal patterns.
The fractal of a single pile
Put N grains on one cell of an infinite square grid and let it topple. The pile grows to a roughly round region whose width grows like the square root of N: 65,536 grains spread over 189 cells, 262,144 over 375 and 1,048,576 over 747. Inside, the cells settle into patches of regular patterns, such as all 3s, stripes or checkerboards, bounded by thin lines, with smaller patches between larger ones. Wesley Pegden and Charles Smart proved in 2013 that the picture converges to a limit as N grows, and with Lionel Levine they found that the patterns are governed by Apollonian circle packings, circles nested inside the gaps between other circles.
Lattices and floors
The sandpile remembers the grid it grows on. With diagonals, so that a cell has 8 neighbours and topples at 8 grains, the pile is more compact and its pattern has a different structure; on a triangular lattice with 6 neighbours the pile takes on the six-fold symmetry of the hexagon. Starting on a floor that already holds grains changes the picture too. Anne Fey, Lionel Levine and Yuval Peres showed in 2010 that on a square grid a pile always stabilizes on a floor of 2 grains per cell, but on a floor of 3 a single extra grain makes the avalanche run forever.
Explore it
Open the sandpile fractal to drop up to 1,048,576 grains on one cell and watch them topple live on a square lattice, a square lattice with diagonals or a triangular lattice, on an empty floor or one of 1 or 2 grains per cell. The tiles count the topplings, the width and the mean height, and the legend shows how many cells hold each number of grains. Identity draws the identity of the sandpile group of an n × n grid, and Avalanches drops grains one by one and plots the sizes of the avalanches on a log-log chart. Zoom in until every cell shows its number.
Frequently asked questions
Is the sandpile model about real sand?
Only loosely. Real sand piles depend on friction, grain shape and inertia, and experiments with rice piles matched the model better than sand did. The model is a mathematical idealization of a system that builds up stress slowly and releases it in avalanches.
Why does the pile end up round when the grid is square?
Toppling spreads grains much like heat spreads, and spreading tends to round shapes off. The pile is not exactly a circle, though, and its inner pattern keeps the four-fold symmetry of the square grid.
Is the pattern random?
No. The rule has no randomness, so the same number of grains always gives exactly the same pile, cell for cell. Randomness only enters in the avalanche version, where grains are dropped at random places.
What do the colours mean?
Each colour is a number of grains on a cell, from 0 up to one less than the number of neighbours. While the pile is still toppling, cells that are about to topple get a colour of their own.
Ready to try it?
Open PictorX in your browser — no install, no credit card required to start.
Open the sandpile fractal