OpenWorldLab
Grains: 0
Sandpile Integer-valued rule on a square grid, 4 neighbours, open edges

Abelian Sandpile

Stack grains until they spill, then watch the spill spread

Stack grains on a grid. Any pile holding four or more spills one grain to each side, which can set off a chain of further spills.

How it works

In plain English, before the notation

Each square holds a number of grains. A square holding four or more is unstable: it gives away four grains, one to each of its four orthogonal neighbours. That can push a neighbour over four, which spills in turn, and so on. Drop a large pile on one square and the collapse takes thousands of steps and leaves behind a fixed pattern with clear repeating structure at several scales.

Every square holds a whole number of grains — there is no upper limit while it is unstable.
A square with four or more grains topples: it loses four and passes one to each of its north, south, east and west neighbours.
Toppling continues until every square holds three grains or fewer.
Grains that topple off the edge of the grid are gone. Without that, the pile could never finish settling.

Collapse one large pile

  1. Open Presets and load "Single Pile, 80,000 Grains" — all of them stacked on one square.
  2. Press Play. The collapse takes several thousand steps; the final shape is worth waiting for.
  3. Once it has settled, use Drop Sand with the +80k setting to add another pile off-centre and watch the two interact.

Starting configurations

Loads straight into the simulator

Try any rule

The catalogue covers a few dozen rules. Here you can run any of the 262,144 two-state grid rules, or any of the 256 one-dimensional rules, including ones nobody has written up.

B3
B
Toggle:
S23
S
Toggle:
B3/S23 Likely: a mix, as in Conway’s rule
Birth: A dead cell becomes alive with 3 live neighbours.
Survival: A live cell survives with 2 or 3 live neighbours, and dies otherwise.

Well-known rules

Where it came from

Per Bak, Chao Tang and Kurt Wiesenfeld introduced the model in 1987 at Brookhaven National Laboratory as the founding example of self-organised criticality: the idea that some systems drive themselves to a critical point without anyone tuning a parameter to get them there.

Deepak Dhar showed in 1990 that the model has an exact algebraic structure — the stable configurations that can be reached repeatedly form a finite abelian group. That result is why the model is studied by mathematicians as well as physicists, and it is where the "abelian" in the name comes from.

The rule, precisely

What each cell looks at

The 4 cells sharing an edge — north, south, east and west (the von Neumann neighbourhood)

What a cell can be

A non-negative integer per cell; stable configurations use only 0, 1, 2 and 3

The update

if h(x,y) >= 4 then h(x,y) -= 4 and each of the 4 orthogonal neighbours gains 1

The model is called abelian because the order of toppling does not matter: if several squares are unstable, toppling them in any order gives exactly the same final configuration.

Structure at every scale

The settled pattern is far more organised than the rule suggests it should be:

  • A single large pile settles into a shape with distinct triangular regions and repeating structure at several scales.
  • The scaling limit of that shape has been characterised mathematically, and is related to Apollonian circle packings — a result of Levine, Pegden and Smart.
  • Adding one grain to a settled pile can cause no toppling at all, or a cascade across a large part of the grid.
  • The reachable stable configurations form a finite abelian group. Its identity element is itself a striking pattern, computed rather than designed.

Algebraically rich, and harder than it looks

The abelian group structure gives the model exact algebraic identities, and sandpile dynamics have been shown capable of carrying logic.

Not flagged as universal here because the strongest published undecidability results apply to variants and higher dimensions rather than to this exact two-dimensional model. What is solidly established is the group structure and the characterisation of the scaling limit.

Where the idea of self-organised criticality came from

Earthquake magnitudes (Gutenberg–Richter)Solar flaresNeuronal avalanches

The model was proposed to explain why so many natural systems produce events with no characteristic size — many small ones, occasionally a very large one, with no separate mechanism for the large events. That framing has been influential and also contested: the two-dimensional sandpile’s own avalanche statistics turn out to be more complicated than a single clean power law. Its lasting contribution is the mechanism, not the fit.

Things to try

  • Use the +4 Drop Sand setting on a settled pile. Most single additions do nothing visible; occasionally one sets off a large cascade. That contrast is the whole point of the model.
  • Drop two large piles apart from each other and let them collide. The result is not the sum of the two settled shapes.
  • Because the edges are open, a pile near the boundary settles much faster than one in the middle.

Frequently Asked Questions

Because toppling operations commute. If two squares are both unstable, toppling A then B gives the same final result as toppling B then A — and the same holds for any number of unstable squares in any order.

References

Other rules in this family

Browse by family

Lab overview →