Loading mps bug?

+1 vote
asked Jan 18 by siyuphysic (380 points)

I have written an IQMPS obect to disk in my DMRG calculation. I found that to load the mps, we need to construct a sites object first. Otherwise something will be wrong with the mps. Below is an example.

If we try to load a mps as,
//Exeception
int main(){
IQMPS psi;
readFromFile("psi_file", psi); // Here psi.N() > 2
psi.position(2);
return 0;
}
psi.position(2) will throw an exception which says "Mismatched IQIndex arrows";

But if we construct a sites object before reading it, everything is OK.
// OK.
int main(){
SpinHalf sites(1); // SpinHalf sites(0) doesn't work either.
IQMPS psi;
readFromFile("psi_file", psi); // Here psi.N() > 2
psi.position(2); // Works
return 0;
}

I check the constructor of BasicSiteSet, but I didn't see any global variables set there. Anyone has similar problem as I described above?

Thanks.

1 Answer

+1 vote
answered Jan 18 by miles (19,400 points)

Hi Ruizhen,
Thanks for the bug report. I think I know what's going on. It does appear mysterious but I was recently changing the Index/IQIndex id numbering system which keeps a global state to be able to generate id numbers.

If you pull the latest version of the master branch of ITensor hopefully you should see that this bug is fixed. If not please let me know and I will take a closer look!

Miles

commented Jan 18 by siyuphysic (380 points)
Hi Miles,
Thanks. I will try the latest version today. I will tell you the result later.
commented Jan 19 by siyuphysic (380 points)
Hi Miles,
The latest version works! 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.
...