Yes, in the FM case, the correlations should be positive. In the AFM case, the sign should alternate. The fact that your answer does not depend on the sign of ##J## suggests a problem. The GS could be wrong, or even the functions you coded. But if you say you built the Hamiltonian with these same functions, and you obtained the correct GS; I believe they must be efficient. You can still test for ##N=3## for instance, and compare the acting of your functions with the formal expressions of the matrices (with ##\hbar=2##):
$$
\mathrm{S}_1^x\mathrm{S}_2^x =
\begin{pmatrix}
0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\
1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 & 0 & 0 & 0 & 0
\end{pmatrix}
\begin{pmatrix}
0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\
0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 1 & 0 & 0
\end{pmatrix}.
$$
I have real trouble understanding this sentence:
woodydewar said:
Therefore I am selecting the "position"/integer representation (equivalent) of the state which corresponds to the state which results from application of the sxsx operators to the state I am currently interested in.
And how does that explain the selection of the non-zero elements for ##\mathrm{S}_{x/y}## (the ##\mathtt{sxsq}## function) ?
I usually solved the spin chain by the use of sparse matrices in Python, and your explanations are at the moment outside the scope of my understanding.
Someone more competent than me is welcome to help our friend here.