I want to do the sum (in Ising lattice gauge theory)
n = 3;
energy[sx_,sy_] := Sum[sx[[i, j]] sy[[i, j]] sx[[i + 1, j]] sy[[i, j + 1]], {i, 1, n}, {j, 1, n}]
sx = Tuples[{-1,1}, {n+1,n}];
sy = Tuples[{-1,1}, {n,n+1}];
I want the values of this function over all possible permutations of sx
and sy
but I am unable to find a way to do so. Basically this is a variant of the usual Ising model but this time the spins placed on the bonds instead of the nodes. Spins still take values $\pm 1$ but the Hamiltonian is now the product of spins on a 'square'. I am trying to calculate the partition function of this model and hence this sum arose. I divided the spins into ones along the $x$ axis and others along the $y$ axis and hence am using two lists. Any help would be greatly appreciated. Thanks.
Edit: as pointed out in the comment the definitions of sx
and sy
are wrong. sx
is the name of the matrix of horizontal bonds and sy
is the matrix of vertical bonds.