494 Computational methods for lattice field theories
Pd(S)=exp(− 2 βJ)respectively and we have
T(S→S′)
T(S′→S)
=
Tf(S→S′)[ 1 −exp(− 2 βJ)]+T 0 (S→S′)exp(− 2 βJ)
Tf(S′→S)[ 1 −exp(− 2 βJ)]+T 0 (S′→S)exp(− 2 βJ)
.
(15.82)
Since the pairsisjis equal in bothSandS′, the transition probabilityTf=T 0 and
we see that(15.79)does hold for the transition probability after the SW step.
If before and after the step the spinssiandsjare unequal,Tfvanishes in both
numerator and denominator, and it is clear that (15.79) holds in this case too.
Supposesi=sjinSand that the corresponding pairs′i,s′jinS′is unequal. In that
case we have
T(S→S′)
T(S′→S)
=
Tf(S→S′)[ 1 −exp(− 2 βJ)]+T 0 (S→S′)exp(− 2 βJ)
T 0 (S′→S)
.
(15.83)
The denominator in the right hand side contains only the term with a deleted bond
because starting from the configurationS′in whichs′iands′jare unequal, we can only
delete the bond. The transition probabilityTf(S→S′)occurring in the numerator
obviously vanishes, and we see that for this case detailed balance, Eq. (15.79), is
again satisfied.
It is instructive to code the SW method. First a sweep through the lattice is per-
formed in which all the bonds are either frozen or deleted. This poses no difficulties.
Then the clusters must be identified. This can be done using ‘back-tracking’ and is
most conveniently coded recursively. It works as follows. A routine BackTrack(x,y)
is written, which scans the cluster containing the site given by the Cartesian (integer)
components(x,y). Start at site(x,y)and check whether this site has already been
visited. If this is not the case, leave a flag there as a mark that the cluster site has
now been visted, and scan the neighbouring sites in a similar way by recursive calls.
The resulting routine looks more or less as follows (ford=2):
ROUTINE BackTrack(x,y)
IF NOT Visited (x,y) THEN
Mark(x,y)as being visited;
IF (Frozen(x,y,x+1,y)) THEN
BackTrack(x+1,y);
IF (Frozen(x,y,x,y+1)) THEN
BackTrack(x,y+1);
IF (Frozen(x,y,x−1,y)) THEN
BackTrack(x−1,y);