Metropolis sampling of Ising configurations
Construct a balanced local spin update from an explicitly counted lattice measure and distinguish equilibrium correctness from a finite run.
On this page
The question for today
What you’ll understand
- Declare a dimensionless Ising action and its counting measure.
- Derive a single-spin acceptance ratio with the correct sign.
- Check irreducibility and periodicity separately from detailed balance.
A Monte Carlo configuration is a whole field assignment, not one spin drawn in isolation. For a finite Ising lattice, each site carries a sign and the target probability weights every complete assignment. A valid update preserves that probability in equilibrium, but a short trajectory need not represent it well. This module uses dimensionless actions and distinguishes algorithmic update time from physical dynamics. Tiny exact ensembles will provide checks whose complete state spaces can be enumerated; they are not evidence that a large critical field has equilibrated.
Specify the measure before designing the move
Take N spins on a stated graph, with each undirected nearest-neighbor bond counted once. The zero-field ferromagnetic coupling is positive. Writing K as inverse temperature times an energy coupling J, and H as inverse temperature times an energy-valued external field h, makes the action dimensionless. The partition function sums over all two-to-the-N assignments with the uniform counting measure. Boundary conditions and bond multiplicities belong to the model: a two-site periodic convention can differ from a graph containing just one bond.
The normalization is usually unknown, but ratios between two configuration weights do not need it. A uniform choice of a site followed by a proposed spin reversal has a symmetric proposal probability. Flipping that spin changes only its incident bonds and its field term, so the action difference is local even though the sampled state is global. A wrong neighbor count or a duplicated bond changes the target model; a high acceptance rate cannot diagnose that error by itself.
Rejected proposals are part of the transition law
The Metropolis acceptance probability is one for an action-lowering move and the exponential of minus the action increase otherwise. Comparing forward and reverse accepted proposals proves pairwise detailed balance for a symmetric proposal. A rejection leaves the current configuration in place and still counts as an update opportunity. Repeatedly proposing until something is accepted and storing only those changes instead samples an embedded jump chain with different residence weighting unless that change is explicitly corrected.
Detailed balance is a sufficient way to establish stationarity, not a guarantee that every state communicates or that the chain converges from every start. At finite temperature, random single-site proposals can connect all finite spin assignments. Aperiodicity needs care: at zero coupling and zero field, accepting every single flip alternates the parity of the number of up spins. Adding a fixed probability of doing nothing produces a lazy chain and removes this period without changing the invariant distribution.
A correct equilibrium measure still needs a sampling audit
A sweep is a declared unit of computational work, often N attempted local updates, rather than an independent sample. Warmup must be discarded according to actual relaxation evidence, and measurements generally remain correlated afterward. Comparing ordered and disordered starts, recording histories, and checking several observables can reveal poor equilibration, but no single pleasant-looking trace proves that an unvisited sector is irrelevant. At low temperature a finite-volume magnetization can remain trapped in one sign for a very long run.
Small exact systems provide unusually strong implementation checks. Their partition sums determine energies, correlations, and spin moments independently of the update trajectory. Such agreement tests the stated finite graph and measurement normalization. It does not remove finite-volume effects or establish a continuum limit. The two-state Markov instrument below exposes the difference between a stationary probability and the distribution after one update; it does not carry an Ising configuration, an energy function, or a random-number-driven field sampler.
Work it through
A local flip with a transparent Boltzmann penalty
A positive central spin has three positive and one negative nearest neighbors. Set and . Find the action change and acceptance for flipping the central spin, then compare the reverse move.
The neighbor sum is two, so reversing the positive central spin gives . The higher action means the proposed configuration has lower target weight.
The forward acceptance is . A rejected proposal retains the original spin assignment and must remain represented in the trajectory.
The reverse action change is minus logarithm of two, so its acceptance is one. The proposed target weight ratio is one half; multiplying the equal proposal rates by these acceptances makes the forward and reverse probability fluxes equal.
The forward flip costs ln2 and is accepted with probability one half; the reverse is accepted with probability one, consistently with detailed balance.
The living notebook
Explore the model
Interactive lab · markov
Stationary weights differ from one-step probabilities
Reset and set , ; Step once, giving one transition from initial distribution (1,0), and predict state-one probability 0.2. Repeat from Reset with both controls , and one Step; predict 0.4. Their stationary state-one probabilities are respectively 1/3 and 2/3, not the one-step values. This exact two-state chain is not an Ising Monte Carlo simulation.
- P(state 1) at step 0
- 0%
- Stationary P(state 1)
- 60%
- Chain behavior
- Monotone convergence
Exact finite-step probabilities for a two-state chain starting in state 0, not sampled trajectories. Playback advances two transitions per second. When p = q = 0 every distribution is stationary; when p = q = 1 the chain alternates forever. A single zero transition creates an absorbing state. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forA transition rule can target a stationary distribution without reaching it after one update.
Pause & reason
Check your understanding
Your turn
Try it yourself
Consider exactly two spins joined by one bond, not a periodic chain with a doubled bond. At and , enumerate their partition sum and find the probability of alignment and .
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
There are two aligned states with weight e^K and two antialigned states with weight e^(−K).
Compare with the solution
The partition sum is . The total aligned probability is , leaving antialigned probability 1/3. Therefore . This exact finite-graph result tests both bond counting and the sign of the Boltzmann factor; it contains no thermodynamic critical point.
Keep the idea
Take it with you
- The lattice, bond convention, counting measure, and dimensionless action jointly define the target.
- Detailed balance, communication between states, and aperiodicity are separate checks.
- Rejected moves and correlated measurements remain part of the correctly weighted trajectory.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.