Local moves, one global cluster?
An integer number of particles is placed on a periodic grid. A particle can move to one of its four neighbours, and its move is accepted if it increases the total interaction energy. On screen, the height above a site is its integer occupation count. The question is the one addressed in the manuscript: must a sequence of moves that all improve the energy eventually produce a single cluster?
The answer depends on the kernel, the graph and the interaction parameter. On the discrete torus, for a sufficiently small parameter, the concentration theorem gives an affirmative answer for every initial configuration. Outside this sufficient range, the experiment may show concentration or several separated clusters that have become stationary. Both behaviours can be examined within the same model.
The model
The sites are the elements of \(X=(\mathbb Z/N\mathbb Z)^2\). The right edge of the grid joins the left edge, and the top edge joins the bottom edge. If \(c(x)\) is the occupation of site \(x\), the total number of particles is \(n=\sum_xc(x)\). The solver stores the normalised mass \(\rho(x)=c(x)/n\); the figure converts it to the count \(c(x)\), so the vertical axis can be read directly in particles.
The visible lattice locates the graph vertices. Every occupied vertex has a bright pink marker of the same screen size, independently of its occupation count. Height and the blue-to-gold colour scale carry the count information. The vertical axis follows the maximum of the current configuration; its tick values therefore change during the experiment. The triangular surface and its level curves interpolate the displayed heights between vertices and do not introduce continuous mass or additional particles.
The kernel is exactly the exponential torus kernel studied in the notes, normalised to have unit diagonal:
\[ K_\beta(x,y)=\exp\!\left[\beta\left(\cos\frac{2\pi(x_1-y_1)}N+\cos\frac{2\pi(x_2-y_2)}N-2\right)\right],\qquad \beta>0. \]Subtracting \(2\) in the exponent multiplies the original kernel by a positive constant. It changes neither the accepted moves nor their ranking. Interactions involve every pair of sites; only the allowed moves are restricted to neighbours. The three-dimensional plot visualises occupations. The spherical embedding associated with the kernel lies in \(\mathbb R^4\).
Each move is decided by its exact gain
The potential and energy are \(V_c=K_\beta c\) and \(E(c)=c^\top K_\beta c\). To move one particle from an occupied site \(p\) to its neighbour \(q\), we compute
\[ \Delta_{p,q}E=2\bigl[V_c(q)-V_c(p)+1-K_\beta(p,q)\bigr]. \]The term \(1-K_\beta(p,q)\) is the correction arising from moving an entire particle. Omitting it would change the algorithm. At each iteration, the program compares all admissible moves and chooses the one with the largest gain: this is global steepest ascent. A move is accepted only if its gain is strictly positive, up to the numerical tolerance. Particles move one at a time, and the potential is updated after each move.
The evolution slider therefore counts accepted moves. It represents neither the time of a differential equation nor an Euler step. Playback runs through saved configurations; moving the slider allows an earlier step to be revisited. Every saved state has integer occupations. Any visual transition between two states would not constitute an additional state of the algorithm.
What do the settings change?
\(N\) sets the number of sites in each direction: the grid has \(N^2\) sites. \(n\) is the number of particles. These parameters have different roles; increasing \(N\) does not create additional particles. \(\beta\) controls the decay of similarity between sites. The iteration budget bounds the number of computed moves. The calculation can stop earlier if no admissible move improves the energy.
A new experiment draws a random positive profile, then distributes the \(n\) particles according to a multinomial sample from that profile. The generator seed is stored in the results: the Python code reproduces the same trajectory with the same parameters and seed. Changing the seed renews the initial configuration without changing the kernel or the acceptance rule.
With this normalisation, \(E(c)/n^2\le1\), and equality characterises single-cluster configurations. The displayed energy should increase, and the mass should remain one. The number of occupied sites indicates whether particles are concentrating. It may behave less regularly than the energy: the rule does not require it to decrease at every move.
Connecting the experiment to the theorem
In dimension two, set \(\delta_N=1-\cos(2\pi/N)\) and \(A=\max_{x,y}\bigl(2-\cos(2\pi(x_1-y_1)/N)-\cos(2\pi(x_2-y_2)/N)\bigr)\). For \(n\ge2\), the sufficient regime in the theorem is
\[ 0<\beta\le\frac{\delta_N}{(n-1)A^2}. \]The program computes this bound for the chosen grid. It can be very small and decreases as the number of particles or the grid resolution increases. It is sufficient: observing a single cluster at a larger \(\beta\) does not contradict it. Conversely, separated clusters for a large parameter illustrate the distinction between a global energy maximum and a stationary configuration under the allowed moves.
The code uses numpy and caches the potential. To avoid loss of precision for small \(\beta\), it works with \(B=(K_\beta-\mathbf1\mathbf1^\top)/\beta\), computed using expm1. This transformation preserves the sign and ranking of the gains; the displayed energy is then restored to its original normalisation. The cache is recomputed periodically to limit accumulated roundoff. The tolerance appears in the metadata, and reaching the move budget is distinguished from reaching a stationary state.
The file below is the one executed by the experiment. It can also be run in a Python environment with NumPy. These calculations check particular trajectories in floating-point arithmetic; the universal scope of the result comes from the proofs in the Mathematics section.
