ITensor 3 gives wrong results for fermions without particle number conservation

+1 vote

Hi,

ITensor 3 fails to give correct results for fermonic system without particle number conservation. Maybe this is a bug. This can be tested with free fermions.

#include "itensor/all.h"

using namespace itensor;

int
main()
{
auto N = 20;

auto sites = Spinless(N,{"ConserveQNs",false});

auto ampo = AutoMPO(sites);

for(int b = 1; b <= N-1; ++b)
{
ampo += "Cdag",b,"C",b+1;
ampo += "Cdag",b+1,"C",b;
}

auto H = toMPO(ampo);
// auto state = InitState(sites);
// for(int is = 1; is <= N; ++is)
// {
// state.set(is,is%2==1 ? "1" : "0");
// }
// auto psi0 = MPS(state);
auto psi0 = randomMPS(sites);

auto sweeps = Sweeps(20);
sweeps.maxdim() = 20,20,40,40,100,200,300,400;
sweeps.cutoff() = 1E-10;

auto [energy0, psi] = dmrg(H, psi0, sweeps, {"Quiet=",true});
Print(energy0);

return 0;
}


The bond dimension just keeps going up, never converge. It works for ConserveQNs=true. ITensor 2 has no this problem. Thanks.

Jin

commented by (43.5k points)
As a workaround, could you please try just setting "ConserveNf=",false and do not set "ConserveQNs=",false? Then it ought to work, and will still not conserve particle number (just fermion parity).
commented by (950 points)
Yes, it works. Thanks.
commented by (43.5k points)
Great - thanks for confirming. To permanently fix this, we may just make it impossible to fully disable QNs for fermions. We'll have to think about which approach is best though - appreciate your feedback.

Hi Jin,

Thanks for pointing out this issue. Indeed, it seems like AutoMPO in ITensor v3 is creating the wrong MPO when QNs are not conserved in this case. For example, here are the Hamiltonians made by AutoMPO for N = 2 (the MPO tensors are contracted together to get the full Hamiltonian):

ITensor v3, no QNs conserved:

H(1)*H(2) =
ITensor ord=4: (2|id=794|n=1,Site,Fermion)' (2|id=794|n=1,Site,Fermion) (2|id=230|n=2,Site,Fermion) (2|id=230|n=2,Site,Fermion)'
{norm=1.41 (Dense Real)}
(2,1,2,1) -1.000000
(1,2,1,2) 1.0000000

ITensor v2, no QNs conserved:

H.A(1)*H.A(2) =
ITensor r=4: ("Spinless 1",2,Site|573)' ("Spinless 1",2,Site|573) ("Spinless 2",2,Site|989) ("Spinless 2",2,Site|989)'
{norm=1.41 (Dense Real)}
(2,1,2,1) -1.000000
(1,2,1,2) -1.000000

When QNs are conserved, they both give the same correct Hamiltonian. It looks like in v3 when QNs are not conserved, the Fermion sign is not being put in correctly when the "Cdag" and "C" operators are being used, we will look into this.

Cheers,
Matt

commented by (7.3k points)
I raised an issue about it on github here: https://github.com/ITensor/ITensor/issues/311