+1 vote
asked by (700 points)

Using the packages developed for fermions, I wrote a very simple code to calculate the GS energy of free fermions.

the code:

using ITensors
let
N = 4
numbsweeps = 5
sweeps = Sweeps(numb
sweeps)
maxdim!(sweeps,10,20,100,300,500)
cutoff!(sweeps,1e-10)

sites = siteinds("Fermion",N; conserve_qns = true)

# initialize a state at half-filling
states = vcat(["Occ" for n = 1:N/2],["Emp" for n = 1:N/2])
psi0 = productMPS(sites,states)

ampo = AutoMPO()    
for j = 1:N-1
    ampo += "C",j,"Cdag",j+1
    ampo += "Cdag",j,"C",j+1
end 
H = MPO(ampo,sites)

energy,psi = dmrg(H,psi0,sweeps)

println(inner(psi,*(H,psi)))

return  

end

However, the GS energy calculated from inner(psi,*(H,psi)) is quite different from the result from DMRG. I also tried this for Ising spin chain, and it checks out there. For the fermion case, I don't know where went wrong. Any help is greatly appreciated.

1 Answer

+2 votes
answered by (14.1k points)

Hi,

Thanks for the question. It looks like a problem with how the AutoMPO is defined. It should work if you change the definition to:

  ampo += "Cdag",j+1,"C",j
  ampo += "Cdag",j,"C",j+1

This is pretty tricky, and easy to mess up, but for the sake of getting the correct Fermion signs in your Hamiltonian the order of the operators matters. Please look over the nice tutorial on Fermions by Miles here: https://itensor.org/docs.cgi?page=tutorials/fermions to understand this better.

Cheers,
Matt

commented by (700 points)
Thanks a lot!
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.

Categories

...