I am trying to implement a fully connected model \(\sum_{i<j} J_{ij}(X_iX_j + Y_iY_j + Z_iZ_j) \).

Currently, i am doing something like this

Code: Select all

```
lat = Chain(L, spin_site, bc=bc, bc_MPS = bc_MPS)
CouplingModel.__init__(self, lat)
for i in range(L-1):
for j in range(i+1,L):
dx = np.array([[1]])
self.add_coupling(J[i,j], i, 'Sp', j, 'Sm', dx=dx)
self.add_coupling(J[i,j], j, 'Sp', i, 'Sm', dx=-dx)
self.add_coupling(J[i,j], i, 'Sm', j, 'Sp', dx=dx)
self.add_coupling(J[i,j], i, 'Sm', j, 'Sp', dx=-dx)
self.add_coupling(J[i,j], i, 'Sz', j, 'Sz', dx=dx)
```

However, I get an index out-of-bounds error (probably because I do not respect the unit cell of the lattice).

I would be very grateful for any hint!

PS: I know that those kinds of models are not great for MPS.