The Ising Model

Create a random grid

Create a random n ×n grid of +1 and -1 values. Set all of the edge values to +1.

For a grid g, define f(g) to be the number of pairs of neighboring entries with the same value.

Define the weight of the grid to be weight(g)=(e^(β f(g))) for some constant β>=0.

Define the magnetization of the grid to be the sum of all its entries divided by its area.

Markov chains of grids

A transition from one grid to another flips a random entry.

How do  transitions affect the weight of a grid?

Now generate a Markov chain of grids

(* set parameters *)


(* randomly generate an initial grid *)


(* generate the Markov chain *)
Do[
(* first select a proposed transition *)



(* compute the change in weight if the proposal is accepted *)



(* now decide whether or not to accept the proposed transition *)



(* optionally, store the grid in a list *)


,{}]

Questions

What do you observe when you simulate a long Markov chain of grids? What does a typical high-weight grid look like?

What happens when you adjust the parameter β? How does β affect the long-term behavior of the Markov chain?

What happens when you adjust the size n? How does the size affect the long-term behavior of the Markov chain?

What happens when you adjust the boundary values in the grid? How does this affect the long-term behavior of the Markov chain?

What questions do you have?