## Problems with add_local_term and H.c

General discussions on the ideas behind the algorithm.
Fabio_Mendez
Posts: 3
Joined: 01 Feb 2022, 01:50

### Problems with add_local_term and H.c

Hi,
I'm trying to decrease the number of terms appearing in the Hamiltonian MPO by using H. c. in add_coupling_term. However, when I use plus_hc I always get an error. I have tried this with different models, and I get the same error. I provide an example below.
I have a ladder of SpinHalfFermions on a Chain lattice with the following hopping coupling terms:
This case works without any problem. However, when I change to:
IndexError: tuple index out of range
Am I doing something wrong?

F. P. M. Méndez-Cordoba.
Johannes
Posts: 316
Joined: 21 Jul 2018, 12:52
Location: UC Berkeley

### Re: Problems with add_local_term and H.c

This case wasn't tested properly, so a bug could sneak in...
I've just fixed it in 72f79cce1f7dd04607027322763db2a6b80466e3 and added proper tests.

The index error indicates that you didn't actually set the option explicit_plus_hc=True, otherwise it would not have occured...
You need to do that as well to actually save MPO bond dimension.

PS: for the future, questions like this should probably go into the HowTo section...