+1 vote
asked by (1.2k points)


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;

    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});

    return 0;

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


commented by (70.1k 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 (1.2k points)
Yes, it works. Thanks.
commented by (70.1k 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.

1 Answer

0 votes
answered by (14.1k points)

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.


commented by (14.1k points)
I raised an issue about it on github here: https://github.com/ITensor/ITensor/issues/311
Welcome to ITensor Support Q&A, where you can ask questions and receive answers from other members of the community.

Formatting Tips:
  • To format code, indent by four spaces
  • To format inline LaTeX, surround it by @@ on both sides
  • To format LaTeX on its own line, surround it by $$ above and below
  • For LaTeX, it may be necessary to backslash-escape underscore characters to obtain proper formatting. So for example writing \sum\_i to represent a sum over i.
If you cannot register due to firewall issues (e.g. you cannot see the capcha box) please email Miles Stoudenmire to ask for an account.

To report ITensor bugs, please use the issue tracker.