This interactive application demonstrates random domino tilings of an Aztec diamond - a diamond-shaped union of unit squares. The simulation allows exploration of two distinct sampling methods:
Shuffling algorithm: The "Sample" button generates an initial configuration using the exact-sampling shuffling algorithm, producing a perfect sample from the weighted domino tiling measure, with random Bernoulli weights on 3/4 of edges. The Bernoulli weights are equal to $u$ or $v$ with probability 1/2, where $u$ and $v$ are user-defined parameters. The remaining 1/4 of edges are assigned a deterministic weight of 1.0.
Frozen configuration: The "Make Frozen" button creates an all-vertical domino configuration, where every domino is oriented vertically. This provides a deterministic starting point that can be useful for observing how the system evolves under Glauber dynamics from a highly ordered initial state.
After generating an initial configuration, you can observe the evolution of the system through Glauber dynamics - a Markov chain Monte Carlo method that preserves the stationary distribution. Each step attempts to flip a randomly chosen 2×2 block of cells according to the heat-bath probability determined by the edge weights.
Unlike the shuffling algorithm which generates an exact sample immediately, Glauber dynamics shows the system evolving over time.
Note: During Glauber dynamics, the domino tiling visualization is updated in real-time only for n≤30. For larger sizes (n>30), the picture is not updated to improve performance, but you can manually refresh it or observe the evolution through the height function graph below.
You can change the weights before the Glauber dynamics, effectively running a dynamics out of equilibrium.
The "Show Weight Graph" button displays a graphical representation of the edge weights used in the simulation:
The graph visualization shows a 4×4 corner of the weight matrix to help understand the spatial arrangement of weights in the Aztec diamond graph.
The sampling runs entirely in your browser. For sizes up to about n≤120 the sampler is fast; larger n may take noticeable time (hard cap n=400 due to WebAssembly memory limits).
Link to code
(This simulation is interactive, written in JavaScript; see the source code of this page at the link)
Link to code
(C++ code for the simulation)