I am trying to calculate an Ehrenfest theorem for the Fermi-Hubbard model which requires the expectation value of a commutator of onsite and hopping terms. I have determined what seems to be the simplest form of this commutator which is

\( \sum_{1 \leq k \leq L - 1} -\hat{n}_{k+1,\uparrow} \hat{c}^\dag_{k,\downarrow} \hat{c}_{k+1,\downarrow} + \hat{n}_{k,\uparrow} \hat{c}^\dag_{k,\downarrow} \hat{c}_{k+1,\downarrow} - \hat{c}^\dag_{k,\uparrow} \hat{c}_{k+1,\uparrow} \hat{n}_{k+1,\downarrow} + \hat{c}^\dag_{k,\uparrow} \hat{c}_{k+1,\uparrow} \hat{n}_{k,\downarrow} \)

but I cannot figure out how to create an operator of this form in Tenpy. My current attempt is defining my own operator with:

Code: Select all

```
def init_terms(self, model_params):
L = model_params.get('L', 10)
for i in range(L-1):
self.add_local_term(-1., [("Nu", [i+1, 0]), ("Cdd", [i, 0]), ("Cd", [i+1, 0])])
self.add_local_term(1., [("Nu", [i, 0]), ("Cdd", [i, 0]), ("Cd", [i+1, 0])])
self.add_local_term(-1., [("Cdu", [i, 0]), ("Cu", [i+1, 0]), ("Nd", [i+1, 0])])
self.add_local_term(1., [("Cdu", [i, 0]), ("Cu", [i+1, 0]), ("Nd", [i, 0])])
```

File "/opt/anaconda3/envs/tenpy/lib/python3.10/site-packages/tenpy/models/model.py", line 1669, in add_term_function

res = f(self, *args, **kwargs)

File "/opt/anaconda3/envs/tenpy/lib/python3.10/site-packages/tenpy/models/model.py", line 777, in add_local_term

args = ct.multi_coupling_term_handle_JW(strength, term, sites)

File "/opt/anaconda3/envs/tenpy/lib/python3.10/site-packages/tenpy/networks/terms.py", line 974, in multi_coupling_term_handle_JW

assert all([i < j for i, j in zip(ijkl, ijkl[1:])]) # ascending?

AssertionError

Am I just doing something simple wrong? Am I using the wrong method for adding this term? Do I need to handle to Jordan-Wigner strings myself? Is this just not currently possible in Tenpy?

I appreciate any help I can get.

Thanks,

Jacob