WOLFRAM NOTEBOOK

Ising model

In 1D, the energy is the sum of 1’s for identical neighboring spins, and -1 for non-identical
In[]:=
isingEnergy[list_]:=Total[Times@@@Partition[list,2,1,1]]
In[]:=
GroupBy[Tuples[{1,-1},4],isingEnergy]
Out[]=
4{{1,1,1,1},{-1,-1,-1,-1}},0{{1,1,1,-1},{1,1,-1,1},{1,1,-1,-1},{1,-1,1,1},{1,-1,-1,1},{1,-1,-1,-1},{-1,1,1,1},{-1,1,1,-1},{-1,1,-1,-1},{-1,-1,1,1},{-1,-1,1,-1},{-1,-1,-1,1}},-4{{1,-1,1,-1},{-1,1,-1,1}}
In[]:=
GroupBy[Tuples[{1,-1},5],isingEnergy]
Out[]=
5{{1,1,1,1,1},{-1,-1,-1,-1,-1}},1{{1,1,1,1,-1},{1,1,1,-1,1},{1,1,1,-1,-1},{1,1,-1,1,1},{1,1,-1,-1,1},{1,1,-1,-1,-1},{1,-1,1,1,1},{1,-1,-1,1,1},{1,-1,-1,-1,1},{1,-1,-1,-1,-1},{-1,1,1,1,1},{-1,1,1,1,-1},{-1,1,1,-1,-1},{-1,1,-1,-1,-1},{-1,-1,1,1,1},{-1,-1,1,1,-1},{-1,-1,1,-1,-1},{-1,-1,-1,1,1},{-1,-1,-1,1,-1},{-1,-1,-1,-1,1}},-3{{1,1,-1,1,-1},{1,-1,1,1,-1},{1,-1,1,-1,1},{1,-1,1,-1,-1},{1,-1,-1,1,-1},{-1,1,1,-1,1},{-1,1,-1,1,1},{-1,1,-1,1,-1},{-1,1,-1,-1,1},{-1,-1,1,-1,1}}
In[]:=
GroupBy[Tuples[{1,-1},5],isingEnergy,ArrayPlot[#,ColorRules->{-1->White,1->Black},Mesh->True,ImageSize->Tiny]&]
Out[]=
5
,1
,-3
Transform to “domain wall dofs”

Domain walls

In[]:=
domainWalls[list_]:=Times@@@Partition[list,2,1,1]
In[]:=
GroupBy[Tuples[{1,-1},5],isingEnergy,ArrayPlot[domainWalls/@#,ColorRules->{-1->White,1->Black},Mesh->True,ImageSize->Tiny]&]
Out[]=
5
,1
,-3
In[]:=
GroupBy[Tuples[{1,-1},6],isingEnergy,ArrayPlot[domainWalls/@#,ColorRules->{-1->White,1->Black},Mesh->True,ImageSize->Tiny]&]
Out[]=
6
,2
,-2
,-6
In[]:=
GroupBy[Tuples[{1,-1},7],isingEnergy,ArrayPlot[domainWalls/@#,ColorRules->{-1->White,1->Black},Mesh->True,ImageSize->Tiny]&]
Out[]=
7
,3
,-1
,-5

Energy, magnetization of configurations

In[]:=
isingEnergy[list_]:=Total[Times@@@Partition[list,2,1,1]]
In[]:=
cts=Counts[{Total[Times@@@Partition[#,2,1,1]],Total[#]}&/@Tuples[{-1,1},3]]
Out[]=
{3,-3}1,{-1,-1}3,{-1,1}3,{3,3}1
In[]:=
MatrixPlot[Table[Lookup[cts,Key@{x,y},0],{x,-3,3},{y,-3,3}]]
Out[]=
In[]:=
With[{r=7},With[{cts=Counts[{Total[Times@@@Partition[#,2,1,1]],Total[#]}&/@Tuples[{-1,1},r]]},MatrixPlot[Table[Lookup[cts,Key@{x,y},0],{x,-r,r},{y,-r,r}],FrameLabel->{"energy","magnetization"}]]]
Out[]=
In[]:=
With[{r=12},With[{cts=Counts[{Total[Times@@@Partition[#,2,1,1]],Total[#]}&/@Tuples[{-1,1},r]]},MatrixPlot[Table[Lookup[cts,Key@{x,y},0],{x,-r,r},{y,-r,r}],FrameLabel->{"energy","magnetization"}]]]
Out[]=
In[]:=
With[{r=20},With[{cts=Counts[{Total[Times@@@Partition[#,2,1,1]],Total[#]}&/@Tuples[{-1,1},r]]},MatrixPlot[Table[Lookup[cts,Key@{x,y},0],{x,-r,r},{y,-r,r}],FrameLabel->{"energy","magnetization"}]]]
Out[]=

Transfer function: ?? turning a 2D system into 1+1 D

Partition function

Temperatures : { 0, Infinity }
Partition function:

Periodic boundary conditions

Wolfram Cloud

You are using a browser not supported by the Wolfram Cloud

Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.


I understand and wish to continue anyway »

You are using a browser not supported by the Wolfram Cloud. Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.