Quantum Ising chain

Operators

Pauli Matrices

id=(({{1, 0}, {0, 1}}))//N//SparseArray;σx=(({{0, 1}, {1, 0}}))//N//SparseArray;σz=(({{1, 0}, {0, -1}}))//N//SparseArray;
sigx[i_,leng_]:=Apply[KroneckerProduct,Join[Table[id,{l,1,i-1}],{σx},Table[id,{l,i+1,leng}]]]//SparseArray;
sigz[i_,leng_]:=Apply[KroneckerProduct,Join[Table[id,{l,1,i-1}],{σz},Table[id,{l,i+1,leng}]]]//SparseArray;

Hamiltonian

Ham[leng_,J_,G_]:=-J Sum[sigz[j,leng].sigz[Mod[j+1,leng,1],leng],{j,1,leng}]-G Sum[sigx[j,leng],{j,1,leng}]

Magnetizaton

Mag[leng_]:=(1/leng) Sum[sigz[j,leng],{j,1,leng}]

Order parameter

Ord[leng_,J_,G_]:=Module[{spec,vec},
spec=Eigensystem[Ham[leng,J,G],4]//Thread//Sort//Chop;
vec=spec[[1]][[2]];
vec.Mag[leng].Mag[leng].vec//Sqrt
]

J=1.0;
ListPlot[
{Table[{G,Ord[6,J,G]},{G,0.0,2.0,0.05}],
Table[{G,Ord[8,J,G]},{G,0.0,2.0,0.05}],
Table[{G,Ord[10,J,G]},{G,0.0,2.0,0.05}],
Table[{G,Ord[12,J,G]},{G,0.0,2.0,0.05}],
Table[{G,Ord[14,J,G]},{G,0.0,2.0,0.05}],
Table[{G,Ord[16,J,G]},{G,0.0,2.0,0.05}]}
]

J=1.0;
ListPlot[
{Table[{G,Ord[6,J,G]},{G,0.0,2.0,0.05}],
Table[{G,Ord[8,J,G]},{G,0.0,2.0,0.05}],
Table[{G,Ord[10,J,G]},{G,0.0,2.0,0.05}],
Table[{G,Ord[12,J,G]},{G,0.0,2.0,0.05}],
Table[{G,Ord[14,J,G]},{G,0.0,2.0,0.05}],
Table[{G,Ord[16,J,G]},{G,0.0,2.0,0.05}],
Table[{G,Ord[18,J,G]},{G,0.0,2.0,0.05}]}
]