 # The 3-D Ising Model

The Ising model is a simple model of a lattice of spins. The spin at each lattice site can be up or down. In the ferromagnetic case the alignment of nearest neighbors results in a lower energy. In the work below we used a variation on the Metropolis Algorithm which goes as follows:

```1. Choose a lattice site randomly.

2. Calculate the energy at that site due to its nearest neighbors (E1).

3. Calculate the energy again if this spin were reversed (E2).

4. If E2 < E1 then reverse that spin.

5. If E2 = E1 then flip a coin (50% chance) to decide whether or not to
reverse that spin.

6. If E2 > E1 then flip the spin with a probablity e-β(E2-E1)
where β is the inverse temperature (large β means low temperature).

7. Repeat these steps for a while and see what happens.
```
Our lattice uses periodic boundary conditions, where the edges are copied to extra lattice sites next to the opposite edges so that there are no surfaces in the lattice. This is a trick one usually uses when one wants to see bulk properties and ignore surface properties.

The images below are screenshots of the model for a cubic lattice and a hexagonal-close-packed (hcp) lattice. There are two types of graphs. One shows all spins of a particular alignment (either all up or all down). The other graph only shows lattice sites that differ from at least one of their neighbors. This will show the borders of the domains more clearly, but won't help you identify the direction of the spin in a particular region.

The visualization program is very sluggish on a typical computer because for a 50x50x50 lattice we have to render up to about a hundred thousand objects.

For details of the calculation and related information, see this Wikipedia Page. After 500000 iterations structures begin to take form: After 3 million iterations separation between domains is more obvious: After 20 million iterations domains are smoother as sharp edges are removed: Same time (20 million iterations) showing borders more clearly: Below is a randomized initial configuration on a hcp lattice: After 500000 iterations: After 3 million iterations: After 20 million iterations: After 20 million iterations (showing borders): 