Negative energy variance

Hi all,

I am computing the energy variance of the resulting MPSs of DMRG calculations as suggested here but I start getting negative results when using larger bond dimensions \chi. For example, for \chi=200 the GS has a variance of \Delta E \sim 0.2 and energy E = \sim -109.7, but for \chi=300 it has \Delta E \sim -1 and E \sim -110.7. These results correspond to a large (~100 spins) spin-1/2 system

I noticed \langle H^2 \rangle < E^2, which must be due to a numerical error since \Delta E=\langle H^2 \rangle - E ^2 is always non-negative. Any ideas of what can be causing this error and how to fix it? I am using a GPU and Float32 values, could this be related to this problem?

Best,
Ines

It’s a little hard to know without having a minimal working code or access to the exact states you are computing with, but I think the Float32 is a very likely culprit here.

Here are two ideas:

  1. you could print out \langle H^2 \rangle and E separately, or even convert these numbers back into Float64, before subtracting them. If one or both are very small, then subtracting them could be leading to a large cancellation which can cause a loss of precision beyond what Float32 can handle.
  2. you could move your MPS tensors back to CPU and also convert them to Float64 before doing the computation

Please see if one of those might shed more light on what’s causing this result.