Thank you for quick reply and explanation - this makes sense and is surely correct. I was trying to implement a more complicated Hamiltonian, which then made me generally confused...
I am looking at a Hamiltonian of the form:
\(
H = J \sum_{<i,j>}\sum_{a,b=1}^3 T^{ab}_i T^{ab}_j
\)
where \(\sigma^a\) and \(\tau^a\) are Pauli operators in spin and valley spaces, and \(T^{ab}=\sigma^a \otimes \tau^b \).
In other words, this is two spin sites grouped together, such that:
Python: Select all
ss = SpinSite(conserve='Sz')
gs = GroupedSite([ss, ss], labels=['spin', 'valley'], charges='same')
Expanding out this Hamiltonian yields:
\(
\begin{align}
\frac{H}{J}=\sum_{<i,j>}( &(\sigma^x_i \otimes \tau^x_i)(\sigma^x_j \otimes \tau^x_j)+(\sigma^x_i \otimes \tau^y_i)(\sigma^x_j \otimes \tau^y_j)+(\sigma^x_i \otimes \tau^z_i)(\sigma^x_j \otimes \tau^z_j) \\
+& (\sigma^y_i \otimes \tau^x_i)(\sigma^y_j \otimes \tau^x_j)+(\sigma^y_i \otimes \tau^y_i)(\sigma^y_j \otimes \tau^y_j)+(\sigma^y_i \otimes \tau^z_i)(\sigma^y_j \otimes \tau^z_j) \\
+& (\sigma^z_i \otimes \tau^x_i)(\sigma^z_j \otimes \tau^x_j)+(\sigma^z_i \otimes \tau^y_i)(\sigma^z_j \otimes \tau^y_j)+(\sigma^z_i \otimes \tau^z_i)(\sigma^z_j \otimes \tau^z_j))
\end{align}
\)
Focusing on the first summand, I can write:
\(\sigma^x_i \otimes \tau^x_i = \left( \frac{\sigma^+_i + \sigma^-_i}{2} \right)\left( \frac{\tau^+_i + \tau^-_i}{2} \right) = \frac{1}{4} (\sigma^+_i \tau ^+_i + \sigma^+_i \tau^-_i + \sigma^-_i \tau^+_i + \tau^-_i \sigma^-_i)\).
These operators do not commute here because they are acting on the same site. Expanding the Hamiltonian in this way yields:
\(
\frac{H}{J}=\sum_{<i,j>}\left( \frac{\sigma^+_i \tau^-_i \sigma^-_j \tau^+_j}{4}+\frac{\sigma^-_i \tau^+_i \sigma^+_j \tau^-_j}{4}+\frac{\sigma^-_i \tau^-_i \sigma^+_j \tau^+_j}{4} + \frac{\sigma^+_i \tau^+_i \sigma^-_j \tau^-_j}{4} + \frac{\sigma^+_i \tau^z_i \sigma^-_j \tau^z_j}{2}+\frac{\sigma^-_i \tau^z_i \sigma^+_j \tau^z_j}{2}+\frac{\sigma^z_i \tau^+_i \sigma^z_j \tau^-_j}{2} + \frac{\sigma^z_i \tau^-_i \sigma^z_j \tau^+_j}{2}\right)+\sigma^z_i \tau^z_i \sigma^z_j \tau^z_j
\)
...which I think can be written as...
\(
\frac{H}{J}=\sum_{<i,j>}\left( \frac{\sigma^+_i \tau^-_i \sigma^-_j \tau^+_j}{4}+\frac{\sigma^-_i \tau^-_i \sigma^+_j \tau^+_j}{4} + \frac{\sigma^+_i \tau^z_i \sigma^-_j \tau^z_j}{2}+\frac{\sigma^z_i \tau^+_i \sigma^z_j \tau^-_j}{2} +\text{H.c.}\right)+\sigma^z_i \tau^z_i \sigma^z_j \tau^z_j
\)
My attempt to implement this in TeNPy is then:
Python: Select all
for u1, u2, dx in self.lat.nearest_neighbors:
self.add_coupling(1 / 4 * J, u1, 'Spspin Smvalley', u2, 'Smspin Spvalley', dx)
self.add_coupling(np.conj(1 / 4 * J), u2, 'Spspin Smvalley', u1, 'Smspin Spvalley', -dx) # H.c.
self.add_coupling(1 / 4 * J, u1, 'Smspin Smvalley', u2, 'Spspin Spvalley', dx)
self.add_coupling(np.conj(1 / 4 * J), u2, 'Smspin Smvalley', u1, 'Spspin Spvalley', -dx) # H.c.
self.add_coupling(1 / 2 * J, u1, 'Spspin Szvalley', u2, 'Smspin Szvalley', dx)
self.add_coupling(np.conj(1 / 2 * J), u2, 'Spspin Szvalley', u1, 'Smspin Szvalley', -dx) # H.c.
self.add_coupling(1 / 2 * J, u1, 'Szspin Spvalley', u2, 'Szspin Smvalley', dx)
self.add_coupling(np.conj(1 / 2 * J), u2, 'Szspin Spvalley', u1, 'Szspin Smvalley', -dx) # H.c.
self.add_coupling(J, u1, 'Szspin Szvalley', u2, 'Szspin Szvalley', dx)
The code runs at least... Does this implementation look correct to you?