Skip to content
QFT.org

Search QFT.org

Enter a word or phrase.

    You can also browse the main navigation and chapter contents.

    Cluster Updates and Critical Slowing Down

    Near the critical temperature of the square-lattice Ising model, how much work buys an independent measurement of the energy? Reversing all spins changes the magnetization sign instantly while leaving the energy exactly fixed. A useful collective update must also change the interfaces that carry the energy. We will build such an update, verify its stationary measure on four spins, and measure the precision of two spin-reversal-even observables at comparable computational cost.

    Use a periodic L×LL\times L square, V=L2V=L^2 sites, spins si=±1s_i=\pm1, and no magnetic field. With J>0J>0 and kB=1k_{\rm B}=1, write E=H/J=−∑⟨ij⟩sisjE=H/J=-\sum_{\langle ij\rangle}s_i s_j and K=J/TK=J/T. Each horizontal and vertical bond enters the sum once. The normalized Gibbs measure is π(s)=e−KE(s)/Z\pi(s)=e^{-K E(s)}/Z. The random-cluster expansion gives the geometry. Autocorrelation and effective sample size supplies the error convention.

    Grow one cluster from a uniformly chosen site

    For one bond with δij=1\delta_{ij}=1 if its spins agree, expand its Boltzmann factor as

    eKsisj=eK[(1−p)+p δij],p=1−e−2K.\begin{aligned} e^{K s_i s_j} &= e^{K}\big[(1-p)+p\,\delta_{ij}\big],\\ p &= 1-e^{-2K}. \end{aligned}

    For opposite spins the right side is e−Ke^{-K}, and for equal spins it is eKe^K. Interpret the two terms as an empty bond and an occupied bond. Conditional on the spins, independently occupy each equal-spin bond with probability pp, leaving unlike pairs disconnected. This is the q=2q=2 Potts construction with Potts reduced coupling 2K2K.

    Choose one site uniformly as a seed. Grow its connected component by testing bonds to like-spin neighbors with probability pp. When a site joins the cluster, mark it and add it to the exploration queue. A failed bond leaves the site eligible to join through a different bond. Once the queue empties, reverse every spin in the component. This is one Wolff update. A seed samples a component with probability proportional to its number of sites. The implementation flips spins as they join, which also marks membership.

    To see why the flip needs no final acceptance test, fix a proposed cluster CC. Let aa boundary bonds join equal spins before the flip and bb join unequal spins. To obtain CC, every one of the aa aligned boundary bonds must fail to activate. In the reverse move bb such bonds must fail. The seed probabilities and all interior bond weights are identical in both directions. Therefore

    E(s′)−E(s)=2(a−b),P(s,s′)P(s′,s)=(1−p)a−b=π(s′)π(s).\begin{aligned} E(s')-E(s)&=2(a-b),\\ \frac{P(s,s')}{P(s',s)} &=(1-p)^{a-b} =\frac{\pi(s')}{\pi(s)}. \end{aligned}

    This proves detailed balance. Any single-site cluster has positive probability at finite KK, so successive allowed flips connect all spin configurations. At positive finite KK a site and an aligned nearest-neighbor pair can also make a two-site cluster, which removes the parity restriction of always flipping exactly one spin. A field would change the energy of the cluster interior under reversal and requires a different update.

    Enumerate the stationary measure on four spins

    On a 2×22\times2 torus the east and west neighbors of a site coincide, as do its north and south neighbors. The Hamiltonian still contains eight bonds, counting the parallel edges separately. Enumerate all 16 spin configurations. For each, list every subset of its aligned bonds, weight it by its Bernoulli probability, and choose each of the four seeds in turn. Placing each resulting spin flip in its destination column gives the complete 16×1616\times16 matrix PP. Form a second matrix by choosing one site uniformly and accepting its spin flip with probability min⁡(1,e−KΔE)\min(1,e^{-K\Delta E}), adding rejections to the diagonal.

    At K=12log⁡(1+2)K=\tfrac12\log(1+\sqrt{2}), the infinite square-lattice critical coupling, both matrices have unit row sums and obey πP=π\pi P=\pi. The largest discrepancies in these two checks are below 9×10−159\times10^{-15}. Detailed-balance discrepancies are below 10−1810^{-18}. The enumeration gives ⟨E⟩/V=−1.69705627\langle E\rangle/V=-1.69705627. For the uniform seed its mean cluster contains 3.497056273.49705627 sites. This second number also follows from ⟨M2⟩/V\langle M^2\rangle/V, with M=∑isiM=\sum_i s_i (Exercise 1).

    As a control, choose between doing nothing and flipping all spins with equal probabilities. This kernel also preserves π\pi. Starting in equilibrium, the next signed MM has zero correlation with the current value. Both EE and M2M^2 have lag-one correlation exactly one and retain their initial values forever. The enumeration checks all three correlations. The stalled even observables expose the disconnected sectors directly.

    Compare the cost of measuring even observables

    For the local chain, one update consists of VV uniformly sampled single-site proposals with replacement. For the cluster chain, one update grows and flips a single component. Both inspect four neighbors for each site they process. Let cc be the mean number of processed sites per update divided by VV. Thus c=1c=1 for a local sweep and c=⟨∣C∣⟩/Vc=\langle |C|\rangle/V for a Wolff step. For a measured observable XX, write

    τX(W)=12+∑t=1WρX(t),τX,work(W)=c τX(W).\begin{aligned} \tau_X(W)&=\tfrac12+\sum_{t=1}^{W}\rho_X(t),\\ \tau_{X,\rm work}(W)&=c\,\tau_X(W). \end{aligned}

    Here tt counts complete updates and ρX\rho_X is the connected correlation divided by its zero-lag value. If the tail beyond WW is negligible, 2τX,work2\tau_{X,\rm work} estimates the sweep-equivalent work per independent observation at the same single-observation variance. Counting the measurement itself adds 2V2V neighbor reads per record to evaluate EE. In units of 4V4V reads, the corresponding time becomes (c+1/2)τX(c+1/2)\tau_X. These counts omit random-number, queue and memory overhead and carry no wall-clock claim.

    Use 12 independent streams per size and algorithm, six initially ordered and six initially disordered. Each local stream discards 2,048 sweeps and records the next 8,192. An independent pilot estimates the average cluster size; it sets fixed cluster counts for equilibration and measurement with the same intended spin-visit budgets. Log after every completed cluster. Stopping each measurement interval at a prescribed number of visited sites could preferentially select configurations with particular cluster sizes. Actual production spin visits of the two algorithms agree within 4% at all three sizes. Each lag uses pairs from the same stream.

    The table shows the windowed times in spin-visit sweep equivalents, at a lag cutoff of approximately 64 sweep equivalents. The last column gives the standard error of the mean of m2=(M/V)2m^2=(M/V)^2, calculated from the dispersion of the 12 independent stream means. No assumed autocorrelation window enters that error.

    LLUpdateτE,work\tau_{E,\rm work}τm2,work\tau_{m^2,\rm work}Mean m2m^2 and standard error
    8Local6.999.120.6411±0.00380.6411\pm0.0038
    8Cluster1.040.940.6460±0.00150.6460\pm0.0015
    16Local16.9227.500.5462±0.00490.5462\pm0.0049
    16Cluster1.381.150.5441±0.00110.5441\pm0.0011
    24Local24.7741.820.4791±0.00830.4791\pm0.0083
    24Cluster1.721.350.4920±0.00130.4920\pm0.0013

    An independent row-transfer calculation on the 8×88\times8 torus gives ⟨m2⟩=0.646912\langle m^2\rangle=0.646912 and ⟨E⟩/V=−1.491589\langle E\rangle/V=-1.491589. The local estimate of the latter is −1.4849±0.0040-1.4849\pm0.0040, and the cluster estimate is −1.4903±0.0018-1.4903\pm0.0018. Both observables agree with the finite-box reference within 1.7 replica standard errors. At L=24L=24 the cluster uses 58.5458.54 million production spin visits, compared with 56.6256.62 million for the local update. Charging both samplers for every observable evaluation raises their m2m^2 autocorrelation times at the displayed window to 2.73 and 62.72, respectively.

    Resolve the slow tail

    Repeat the estimate at lag cutoffs of 16, 64 and 128 sweep equivalents. At L=24L=24 the local m2m^2 times grow from 14.19 through 41.82 to 61.73, while the cluster values are 1.32, 1.35 and 1.32. The local tail still matters at the largest cutoff. Inverting the observed variance across the 12 replica means gives a rough local time of 77.8 sweep equivalents, itself noisy with so few replicas. The table's local value of 41.82 is a truncated correlation sum. Quoting it as a converged time would understate the estimated cost. The smaller replica error for the cluster algorithm persists when one counts the additional measurement work (Exercise 2).

    At three increasing lag cutoffs, the local-update autocorrelation times rise from about 10 to 35 for energy and from 14 to 62 for squared magnetization. The cluster times stay between one and two.

    The 24 × 24 zero-field Ising box at the square-lattice critical coupling. Each point is a truncated covariance sum on the same 12 independent production streams per algorithm. Time and lag cutoff both count spin visits in units of one lattice volume. The intervals joining points guide the eye. The vertical scale is logarithmic.

    The cluster update improves the precision of energy and squared magnetization for these finite critical boxes. The three sizes do not determine a critical dynamic exponent. A model with frustration, a magnetic field, or a different observable requires its own invariant kernel and cost study.

    Reproduce the calculation

    The scientific companion under examples/computational-qft/cluster-monte-carlo/ contains the C++17 sampler, the Python and NumPy checks, and the retained results.json. To reproduce all 72 production streams and the independent pilots, run the following command from that directory with a C++ compiler on your path.

    python3 check.py --output results.json
    

    The output includes the seed rule's deterministic results, actual neighbor counts, means and errors for both observables, all three lag windows, and the ordered-minus-disordered differences. The independent finite-volume Ising calculation uses a row transfer matrix.

    Exercises

    1. Why does a seed measure susceptibility? Show that a uniformly chosen seed has mean cluster size ⟨M2⟩/V\langle M^2\rangle/V in the finite zero-field ensemble, and relate it to the magnetic susceptibility per site for a field coupling −hM-hM.

    Solution

    Conditional on the bonds, distinct clusters have independent unbiased Ising signs. Thus ⟨sisj⟩\langle s_i s_j\rangle equals the probability that ii and jj are connected. Summing over jj gives the expected size of the cluster containing ii. Averaging over uniform ii gives V−1∑ij⟨sisj⟩=⟨M2⟩/VV^{-1}\sum_{ij}\langle s_i s_j\rangle=\langle M^2\rangle/V. Differentiating ⟨M⟩/V\langle M\rangle/V with respect to hh gives χ=(⟨M2⟩−⟨M⟩2)/(VT)\chi=(\langle M^2\rangle-\langle M\rangle^2)/(VT). Spin reversal makes the finite-volume mean zero, so ⟨∣C∣⟩=Tχ\langle |C|\rangle=T\chi. No extra factor of TT enters the reduced-field derivative with respect to h/Th/T.

    2. Charge the measurements to the simulation. At L=24L=24 the measured total neighbor-read counts, including measurement, are 339.74 million for the local run and 472.05 million for the cluster run. Use the replica errors 0.008310.00831 and 0.001290.00129 for m2m^2 to compare the work needed for the same standard error.

    Solution

    With independent repetitions of the same finite-run protocol, mean variance falls inversely with total work. Estimate the ratio of work needed by the local and cluster protocols from

    339.74472.05(0.008310.00129)2≃30.\frac{339.74}{472.05} \left(\frac{0.00831}{0.00129}\right)^2 \simeq30.

    The cluster run spent more on measurements because it recorded more events. The observed difference in precision more than covers that extra cost. This is a ratio estimated from a finite number of replica means. Its magnitude can change with measurement frequency, implementation and observable.

    References

    • R. G. Edwards and A. D. Sokal, “Generalization of the Fortuin-Kasteleyn-Swendsen-Wang representation and Monte Carlo algorithm,” Physical Review D 38, 2009–2012 (1988), pp. 2009–2010 for the joint spin-and-bond distribution. Article
    • U. Wolff, “Collective Monte Carlo Updating for Spin Systems,” Physical Review Letters 62, 361–364 (1989), pp. 361–362 for construction of a single-cluster update. Article
    • U. Wolff, “Monte Carlo errors with less errors,” Computer Physics Communications 156, 143–153 (2004), corrected version 4, §§2.1, 3.1–3.3 for the covariance sum, independent replicas and window choice. Full text

    Scrollable formula. Use Left and Right arrow keys to reveal hidden content.

    Scrollable table. Use Left and Right arrow keys to reveal hidden columns.

    Scrollable figure. Use Left and Right arrow keys to reveal hidden content.