Skip to content
Tutorials Center
My learning

Topics

Lesson 37 of 39 · Projects and Practice

Practice Set 2: Ising Model and Monte Carlo

Eight problems on the Ising model, mean-field theory, Onsager's results, Metropolis acceptance and detailed balance, diffusion and trapped particles, each with a runnable solution.

This set covers chapters 7 and 8: Ising models, mean-field theory, exact 2D results, Metropolis sampling, diffusion and Langevin dynamics. As before, try each problem by hand first, estimate the answer, and then use the code to check or explore. All temperatures in the Ising problems are in units of J/k, with k = 1.

Problems 1 to 4: Ising model and mean-field theory

Problem 1. For a periodic 1D Ising ring of N = 6 spins with J = 1, h = 0, compute Z at T = 1 using the transfer-matrix formula, and verify by enumeration. Then find the correlation length at T = 0.5.

Problem 2. A body-centered cubic lattice has z = 8. What does mean-field theory give for T_c? Solve the self-consistent equation for m at T = 0.5 T_c.

Problem 3. Using Onsager's result, compute the spontaneous magnetization of the 2D square lattice at T = 2.0 and at T = 2.2.

Problem 4. In a Metropolis simulation of the 2D Ising model, what is the probability of accepting a spin flip with ΔE = +4 at T = 1 and at T = T_c?

Python Solutions to problems 1 to 4

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Answers in words: the ring's Z from the transfer matrix equals the brute-force sum, and ξ ≈ 27 lattice spacings at T = 0.5. Mean-field theory gives T_c = 8 J/k for BCC; the accurate value is about 6.35, so mean-field overestimates by about 26 percent, a smaller error than in 2D because z is larger. The magnetization at T = 2.0 is about 0.91 and at T = 2.2 about 0.78: the cliff-like onset of the 1/8 exponent. At T = 1 a ΔE = +4 flip is accepted with probability about 1.8 percent, and at T_c about 17 percent.

Problem 5: a Metropolis chain for three energy levels

Problem 5. A system has three states with energies 0, 1 and 2 (in units of kT, so kT = 1). Construct the Metropolis transition matrix, where from each state you propose either of the other two states with equal probability, and accept with min(1, e^(-ΔE)). Verify that the Boltzmann distribution is the stationary distribution, and that a simulated chain reproduces it.

Python Detailed balance for a three-state system

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

All four distributions agree: the Boltzmann weights are 1 : e^-1 : e^-2, normalized, which gives about 0.665, 0.245, 0.090.

Problems 6 to 8: diffusion and trapped particles

Problem 6. A polystyrene bead of diameter 1 µm in water at 293 K has D ≈ 4.3 × 10⁻¹³ m²/s. How long does it take, on average, to diffuse an rms distance of 10 µm along one axis? Compare with the time to sediment through 10 µm if the drift speed were 0.1 µm/s.

Problem 7. A bead in an optical trap has an rms position fluctuation of 25 nm at 293 K. Find the trap stiffness.

Problem 8. A resistor of 50 kΩ at 300 K is observed with a 1 kHz bandwidth. What is the rms Johnson noise voltage?

Python Solutions to problems 6 to 8

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Diffusion takes about two minutes, comparable to the 100 s of steady drift: for particles of this size and distance, diffusion and weak drift compete. The trap stiffness is about 6.5 × 10⁻⁶ N/m, or 6.5 pN/µm. The resistor produces about 0.9 µV.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. Metropolis detailed balance requires that the ratio W(i→j)/W(j→i) equal

    P(i)W(i→j) = P(j)W(j→i) implies W(i→j)/W(j→i) = P(j)/P(i).
  2. 2. Mean-field theory for a lattice with z neighbors predicts kT_c equal to

    m = tanh(βzJm) first has a nonzero solution when βzJ = 1.
  3. 3. For the same bead, doubling the trap stiffness κ makes the rms position fluctuation

    ⟨x²⟩ = kT/κ, so the rms goes as κ^(-1/2).
  4. 4. What is the probability of accepting a spin flip with ΔE = 0 in Metropolis?

    min(1, e^0) = 1.

Summary

  • Always check formulas against brute-force enumeration or an independent simulation when you can.
  • Mean-field kT_c = zJ; Onsager's m = [1 - sinh⁻⁴(2J/kT)]^(1/8) below T_c.
  • Metropolis chains satisfy detailed balance; the Boltzmann distribution is their stationary distribution.
  • ⟨x²⟩ = kT/κ, t = x²/2D and ⟨V²⟩ = 4kTRΔf are the workhorse estimates of Chapter 8.

Next: Project: Finite-Size Scaling and the Ising Critical Point