Swendsen-Wang algorithm (source code)

= Swendsen-Wang algorithm
{c}
{title2=$p=1-e^{-2\beta J}$}

The <Swendsen-Wang algorithm> is a cluster <Markov chain Monte Carlo> method that updates connected groups of variables together. For the ferromagnetic <Ising model> with no external field, let $s_i\in\{-1,+1\}$ and $H(s)=-J\sum_{\{i,j\}\in E}s_is_j$, where $J>0$ and $\beta$ is inverse temperature. One step places a bond on each equal-spin edge independently with probability $p=1-e^{-2\beta J}$, leaves unequal-spin edges unbonded, then assigns each connected bond cluster an independent uniformly chosen sign.<Nonuniversal critical dynamics in Monte Carlo simulations by Robert H. Swendsen and Jian-Sheng Wang>[1987, cluster construction]{ref}

The bond and spin updates are conditional draws from a joint spin-bond distribution. Summing out the bonds recovers the <Boltzmann distribution>, so alternating the two conditional draws preserves the intended equilibrium law.<Generalization of the Fortuin-Kasteleyn-Swendsen-Wang representation and Monte Carlo algorithm by R. G. Edwards and A. D. Sokal>[Joint representation and alternating conditional updates]{ref}

For two connected vertices initially carrying equal spins, the next spins agree with probability $p+(1-p)/2=(1+p)/2$: a retained bond forces agreement, while an absent bond permits independent signs. Unlike a single-spin update, one step can reverse a large correlated region. This often reduces <critical slowing down>, although efficiency depends on the model and the observable. The Ising formula above should not be applied unchanged to a frustrated interaction or an external field.