For the purposes of a lecture on simulating the Ising model of ferromagnetism using the Metropolis-Hastings algorithm, I explored the behaviour of magnetic susceptibility on a four-dimensional hypercube lattice. In particular, I wanted to test a well-known prediction of theoretical physics that a zero-field singularity should appear at a certain critical temperature. The idea is that there is an essential singularity in the mathematics at zero external magnetic field which disappears with a non-zero magnetic field. See the discussion on physics Stack Exchange about this. I was interested to see if a computer simulation of magnetic susceptibility in an Ising model on a four-dimensional hypercube lattice would produce similar results as the second diagram in this Stack Exchange query, which I reproduce here:

The results do suggest that, in the nearest-neighbour ferromagnetic Ising model on a 4-D hypercube lattice, there is a cusp-like singularity in magnetic susceptibility at a critical temperature around T = 7. This singularity becomes more and more apparent in the plots as the external magnetic field strength is reduced to zero but tends to disappear as the field strength increases. I want to record this experiment and the results in the present post.
I considered a 4-D ferromagnetic Ising model on a hypercubic lattice, with
. I assumed periodic boundary conditions and the presence of an external magnetic field with parameter
. The nearest-neighbour Hamiltonian for a particular configuration
of the
spins on the four-dimensional hypercube is
where is the spin at site
on the lattice,
is the nearest-neighbour interaction energy and
is the external magnetic field parameter. The partition function assuming thermal equilibrium at a temperature
is
where is Boltzmann’s constant and
is the Hamiltonian for the
-th spin configuration
. For the computer simulations I used units in which
and
.
I used Monte Carlo simulations in the form of the well-known single-flip Metropolis-Hastings algorithm to produce plots of the magnetic susceptibility, , as a function of the temperature in the range
to
, for a lattice of size
with
,
and
. With units in which
and
, the magnetic susceptibility is calculated as
where
is the total magnetisation given a particular spin configuration on the 4-D lattice.
I initially chose a range of -values rising from
to
in multiples of two. I obtained the following results for
,
and
, starting with a completely ordered configuration in which all the spins in the lattice were in the
state:

The results show a clear peak in magnetic susceptibility becoming more pronounced as is reduced towards zero, with the critical temperature being around
. Notice also a rapid increase in the CPU time with
, the CPU time being around one minute for
, twelve minutes for
, and over two hours for
. The plot did not change much between
and
so I used
for the remaining simulations.
To confirm the zero-field singularity at the critical temperature , I reduced
even further. I obtained the following plots for
-values going down to
.

It is clear that the peak becomes arbitrarily large as at a critical temperature of around
, indicating that there is indeed a singularity there.
