コンテンツにスキップ

Local Updates

In a Monte Carlo simulation, system states are usually sampled through local updates, where individual site configuration is updated one at a time based on its local environment. We will use Ising model to illustrate how the sampling of states is achieved.

The Hamiltonian of the Ising model is given by the Hamiltonian:

H=Ji,jsizsjzhisiz, \mathcal{H} = -J \sum_{\langle i,j \rangle} s_i^z s_j^z - h \sum_i s_i^z,

where:

  • JJ is the interaction strength between neighboring spins,
  • i,j\langle i,j \rangle denotes a sum over nearest-neighbor pairs,
  • siz=±1s_i^z=\pm 1 is the spin at site ii,
  • hh is an external magnetic field.

Steps of a Monte Carlo Simulation

1. Initialize the System

  • Start with a lattice of spins (e.g., a 2D square lattice of size L×LL \times L).
  • Initialize the spins randomly (e.g., siz=±1s_i^z = \pm 1 with equal probability) or in a specific configuration (e.g., all spins up).

2. Perform Local Updates

Local updates are performed using either the Metropolis-Hastings algorithm or the heat-bath algorithm.

Metropolis-Hastings Local Update

For each spin sizs_i^z:

  1. Propose a flip: Flip the spin sizs_i^z to its opposite value, sizsizs_i^z \to -s_i^z.
  2. Calculate the energy change: Compute the change in energy ΔE\Delta E due to the proposed flip. For the Ising model, the energy change depends only on the spin sizs_i^z and its nearest neighbors: ΔE=2Jsizjneighbors(i)sjz+2hsiz. \Delta E = 2 J s_i^z \sum_{j \in \text{neighbors}(i)} s_j^z + 2 h s_i^z. Here, the sum is over the nearest neighbors of spin sizs_i^z.
  3. Accept or reject the flip: Paccept=min(1,eβΔE), P_{\text{accept}} = \text{min}(1, e^{-\beta \Delta E}), where β=1/(kBT)\beta = 1/(k_B T) is the inverse temperature. This means
    • If ΔE0\Delta E \leq 0, always accept the flip.
    • If ΔE>0\Delta E > 0, accept the flip with probability: eβΔEe^{-\beta \Delta E}.
    • If the flip is rejected, leave the spin unchanged.

Heat-Bath Local Update

Alternatively, the heat-bath algorithm can be used for local updates. For each spin sizs_i^z:

  1. Compute the local field: The local field acting on spin sizs_i^z is given by: hi=Jjneighbors(i)sjzh. h_i = -J \sum_{j \in \text{neighbors}(i)} s_j^z - h.
  2. Sample the new spin state: The spin sizs_i^z is updated to +1+1 or 1-1 with probabilities: P1+1=eβhieβhi+eβhi, P_{ -1 \to +1} = \frac{e^{-\beta h_i}}{e^{-\beta h_i} + e^{\beta h_i}}, P+11=eβhieβhi+eβhi. P_{ +1 \to -1} = \frac{e^{\beta h_i}}{e^{-\beta h_i} + e^{\beta h_i}}. These probabilities ensure that the spin is sampled from its equilibrium distribution given its local environment.

3. Repeat for Many Sweeps

  • A sweep consists of attempting to update every spin in the lattice once.
  • Repeat the local update process for many sweeps to allow the system to reach equilibrium and to collect statistics.