I have a Hamiltonian which is not hermitian, but I know that its eigenvalues are real. I can do DMRG with the option ishermitian=false . However, the algorithm treats the eigenvalues as complex. At times, it converges to a real value of the eigenvalues (i.e. with a very small imaginary part of the energy). At other times, it converges to a complex value of the energy.

Is there a way to tell the algorithm that I want a real result? For example, besides minimizing the energy, I would also want to minimize the absolute value of the imaginary part of the energy.

If needed, I can give a working example of what I’m referring to

Hi @Bernardo,
It’s a good question. Inside dmrg, we use the KrylovKit.eigsolve function to solve the reduced eigenproblem. That function takes a parameter called which that has the options given on this page. The one we use in ITensor is which=:SR but would one of the other options solve your problem? If not, perhaps the custom EigSorter mentioned there could help.

To try this out, you can put ITensors.jl into “dev” mode by inputting the command:

julia> ]
pkg> dev ITensors

then navigate to the corresponding source code folder that Julia will tell you about. Then in the ITensors.jl/src/mps/ folder if you go to line 180 of dmrg.jl and edit that, you can try the other options. If one of them works well for you, we can make a small change to the library to allow that to be set from outside of the dmrg function. If you run into any issues editing the code just let us know and we can do things another way.