next up previous
Next: Elements of a Continuous-Space Up: Case Study 1: The Previous: A C Code for

Suggested Exercises

  1. Run the code for the following values of temperature: 5.0, 4.0, 3.0, 2.0, 1.0. Run the code several times at each $T$ with a different value for the random number generator seed. Report the average spin and average energy per spin. What is happening near $T = 2.0$?
  2. Modify the code so that when samples are taken in accumulating statistics for $\left<s_1\right>$ and $\left<\epsilon\right>$, the current sample values are output to the terminal. You'll want to find the right place to add the following line: fprintf(stdout,"%i %.5lf %.5lf$\backslash$n",c,s,e);
  3. The current version of the code initializes the Ising lattice with random spins. What temperature does this correspond to? Modify the code so that the initial lattice has two well-defined domains, all spin-up for $i < L/2$ and all spin-down for $i > L/2$. Re-run at the various temperatures. Do you see any differences?
  4. (Advanced) Modify the code ising.c to compute the quantity $\left<s_is_j\right> - \left<s_i\right>\left<s_j\right>$ as a function of various distances between spins $i$ and $j$.



cfa22@drexel.edu