Expand description
Wolff (1989) single-cluster Monte-Carlo update for the ferromagnetic Ising model.
Where Swendsen-Wang (see super::swendsen_wang) partitions the entire
lattice into clusters every sweep, Wolff grows and flips a single cluster
seeded at a random site. This is often more efficient per unit work near
criticality because the algorithm preferentially builds large clusters (the
probability of seeding inside a big cluster is proportional to its size),
and a single flood-fill touches only the spins it actually flips.
One update proceeds as:
- Seed. Pick a site
kuniformly at random; remember its spin values_seed. - Grow. Flood-fill (stack / BFS) from
k. For each aligned neighbourj(s_j == s_seed) not yet in the cluster, add it with probabilityp = 1 − exp(−2 β J). - Flip. Flip the whole grown cluster unconditionally.
Because the seed cluster is always flipped (not with probability ½), the
single-cluster move still satisfies detailed balance — the asymmetry in the
proposal is exactly cancelled by the Fortuin-Kasteleyn bond weights. The
chain is ergodic: over enough updates it visits both +M and −M ordered
states, decorrelating the global magnetisation far faster than single-spin
Metropolis near T_c.
Spins are i8 values in {−1, +1}. Square lattices (open or periodic) and
general graphs are both supported; the geometry and validation helpers are
shared with super::swendsen_wang.
Structs§
- Wolff
- Wolff single-cluster sampler.
- Wolff
Config - Configuration for a Wolff sampler.