I want to calculate the correlation \langle \chi_m \chi_n \rangle where \chi =

Here, i,j,k are the three vertices of a triangle on a triangular lattice ; m,n are the centers of two triangles, and S is the total spin operator.

How can I code this operator and more importantly, how can I calculate the correlation.
I couldn’t find any cross product function and there seems to be too many variables in calculating the correlation.

So first of all you’ll need to expand out the cross and dot product. I don’t mean by hand, but writing loops in code that go over all the terms involving S^+, S^- and S^z (or you can use S^x, S^y, S^z if you aren’t conserving the total-Sz quantum number).

Then this will give a set of 6-operator correlation functions you need to measure. For each of these, the easy but less efficient route is to use OpSum to make an MPO and compute the expected value of that MPO.

The more efficient and “professional” — but harder to code — route is to contract your wavefunction MPS |\psi\rangle together with its conjugate \langle \psi | and with the selected operators inserted in between on the correct sites.

Something that could help here is if you know in advance that you only want a certain linear combination, like a certain (k_x, k_y) component, of the correlators. For example, the (k_x,k_y)=(0,0) Fourier component which would just be the equal-weight sum of all the correlators. Then you could just input that whole sum into OpSum and make a single MPO for it which could be quite an efficient way to go.