+1 vote
asked by (260 points)
edited by

Hi,

I have codes in which I perform DMRG and then compute < S^2 >.
Before I updated ITensor to the latest version, these codes were giving correct results and now they are not. I know that the previous results were correct because I benchmarked with simple models for which I can do exact diagonalization.

One simple example that may help to identify this apparent bug is the following:

Model: DMRG for S=1 antiferromagnetic Heisenberg dimer.
The groundstate should be a singlet.
I compute < Sz > and I get 0. That's good.
I compute < S^2 > and I get different than 0. That's not right.

I defined the S^2 operator as follows:

function S2_op(Nsites,sites)
ampo = AutoMPO()

for i in 1:Nsites
    for j in 1:Nsites
        ampo += 1.,"S+",i,"S-",j
        ampo += 1.,"Sz",i,"Sz",j
    end
    ampo += -1.,"Sz",i
end

S2 = MPO(ampo,sites)

return S2
end

I also tried to define it in a different manner: (EDIT: this is wrong)

function S2_op_other(Nsites,sites)
ampo = AutoMPO()

for i in 1:Nsites
    ampo += 1.,"S+*S-",i
    ampo += 1.,"Sz*Sz",i
    ampo += -1.,"Sz",i
end

S2 = MPO(ampo,sites)

return S2
end

Both cases give values that are not 0. Also, they give different results, which I think is also telling. In the first case, I get 2/3. In the second case, I get 4. None of these numbers makes any physical sense.

The exact same thing happened when I tried to create an MPO of the Sz^2 operator and compute its average.

Best,
Gonçalo Catarina

commented by (43.4k points)
Thanks - yes I see then & it's a good way to write it.

When you say that you get "different from zero" for <S^2>, how different? I wouldn't be surprised at all if it's not numerically exactly zero. But how large is it?
commented by (260 points)
I get <S^2> = 2/3.
I also get <Sz^2> = 2/3.
You can check this out by copying the code I sent above and run it in the latest version of ITensor Julia.

In previous versions, I was obtaining values very close to 0.

If it helps, in the comments above we seem to have understood that the occurrence of this discrepancy happened in some update between June 9 and June 19.
commented by (43.4k points)
That does help - thanks for pointing that out again about the results changing for (apparently) the same ground state MPS. You know, I did make a pretty significant change to the AutoMPO code around that very time (it was on June 12) so it could very much be related to what you're observing. I'll look into it - I'm filing an issue right now so it doesn't get overlooked.
commented by (43.4k points)
Just to let you know, there's definitely a bug in AutoMPO that's responsible for part of what you're seeing. I'm working on it and will let you know when that's done.
commented by (260 points)
Thanks for the update!

1 Answer

+1 vote
answered by (43.4k points)
selected ago by
 
Best answer

This bug should be fixed now in version 0.1.14 of Julia ITensor (ITensors.jl). Please let me know if it isn't! Thanks for pointing out this issue.

Best,
Miles

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

...