Four-spin Ising ring (source code)

= Four-spin Ising ring
{title2=$N=4,\quad H=-J\sum_{i=1}^{4}\sigma_i\sigma_{i+1}$}

Take a <cycle graph> with four labeled <graph vertices> and four distinct <edges> $\{1,2\},\{2,3\},\{3,4\},\{4,1\}$. Set $h=0$, $J>0$, and impose <periodic boundary conditions> by writing $\sigma_5=\sigma_1$. The square drawing represents a one-dimensional ring: it has no diagonal interactions and is not a two-dimensional <lattice>.

Call an <edge> between opposite <Ising spins> a <domain wall>. If $d$ is their number, the four bond products sum to $4-2d$, so the <energy> is
$$
H=-4J+2Jd.
$$
Each <domain wall> costs $2J$ relative to an aligned bond. Returning around the ring must return to the starting <Ising spin>, so $d$ is even: equivalently, $\prod_{i=1}^{4}(\sigma_i\sigma_{i+1})=1$. Choosing an even set of $d$ wall <edges> and then choosing $\sigma_1$ determines the entire pattern. The <state degeneracy> is therefore $g_d=2\binom{4}{d}$, using a <binomial coefficient>.

|| <Domain walls> $d$
|| <State degeneracy> $g_d$
|| <Energy> $H$
|| Total <Boltzmann factor> weight

| $0$
| $2$
| $-4J$
| $2e^{4\beta J}$

| $2$
| $12$
| $0$
| $12$

| $4$
| $2$
| $4J$
| $2e^{-4\beta J}$

The twelve middle <microstates> consist of eight patterns with one exceptional <Ising spin> and four patterns with two adjacent $+1$ <Ising spins> and two adjacent $-1$ <Ising spins>. The two alternating patterns have four <domain walls>. All $2+12+2=16$ <microstates> are shown below.

\Image[/ising-four-spin-ring-configurations.png]
{title=All sixteen configurations of the four-spin Ising ring, grouped by domain walls and energy}
{description=Original enumeration of the four distinct ring <edges>. Blue vertices denote $+1$ <Ising spins>, orange vertices denote $-1$ <Ising spins>, and dashed red <edges> mark <domain walls>. These are exact model configurations.}

Writing $K=\beta J$, the <partition function> and the <probability> of each <energy> class are
$$
Z=2e^{4K}+12+2e^{-4K}=4\cosh(4K)+12,\qquad
P(d)=\frac{g_de^{K(4-2d)}}{Z}.
$$
For an original exact example, choose $K=(\ln2)/4$. Then $e^{4K}=2$, $Z=17$, and $P(d=0)=4/17$, $P(d=2)=12/17$, $P(d=4)=1/17$. Each aligned <microstate> has <probability> $2/17$, each middle <microstate> $1/17$, and each alternating <microstate> $1/34$: multiply by <state degeneracy> before comparing whole classes. As $K\to0$, all sixteen <microstates> become equally likely, but the class <probabilities> approach $1/8,3/4,1/8$. As $K\to\infty$, the two all-aligned <microstates> each have limiting <probability> $1/2$.