Problem 2a
Problem 2b
After performing 'N' sweeps, we will have a lattice in a new/different configuration. This new configuration can represent how the lattice changed over some period of time. If we defined a 'new' lattice state after only one sweep, then the new lattice would differ from the original by only a single spin. It makes more sense to define a 'new' state after performing 'N' sweeps, because it is likely that multiple spins within the lattice will be changing at a time.
Problem 2c
The plot after tossing the first 100 sweeps looks much better. Perhaps the lattice configurations in the first 100 sweeps are too similar to the original lattice state. This may be a problem if the original randomly generated lattice was actually in a configuration that was energetically unfavorable or otherwise physically unreasonable. It would take some time for the lattice to revert to a more physically reasonable configuration.
/shared-libs/python3.7/py/lib/python3.7/site-packages/numpy/core/fromnumeric.py:3373: RuntimeWarning: Mean of empty slice.
out=out, **kwargs)
/shared-libs/python3.7/py/lib/python3.7/site-packages/numpy/core/_methods.py:170: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
/shared-libs/python3.7/py/lib/python3.7/site-packages/numpy/core/fromnumeric.py:3373: RuntimeWarning: Mean of empty slice.
out=out, **kwargs)
/shared-libs/python3.7/py/lib/python3.7/site-packages/numpy/core/_methods.py:170: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
Problem 2d
By re-initializing for every point on our plot, we can the relationship between <M> and h as independent of the initial lattice configuration.
Problem 2e
Problem 2f
The function is maximized at around T = 2.3. If we look back to the parameters we set at the beginning of this problem, this is the critical temperature! This is what we'd expect to see from a plot of C_v vs T.