+1 vote
asked by (430 points)

Dear ITensor team,
Thanks for your reply. I want to save ground state by DMRG calculation, and I fellow the tutorial exactly https://itensor.org/docs.cgi?vers=cppv3&page=classes/readwrite
writeToFile("GSwavefunctionfile",psi);
But when I load ground state MPS in the other code:
auto psi = readFromFile("GSwavefunctionfile",sites)
I get following error:
"From line 568, file indexes.cc
In findIndex: more than one Index found, consider using findInds instead
In findIndex: more than one Index found, consider using findInds instead
"
and I print my MPS from the file and Hamiltonian(MPO) in the current code
Print(psi(1));
Print(H(1));
I find site information are not one-one correspondence. I want to know the correct way to write MPS and read MPS from the file, in order to do time-evolution operation. Please help me, many thanks!

1 Answer

0 votes
answered by (70.1k points)

Hi, thanks for the question. Did you also write the "sites" object to disk too, read it back in before reading the wavefunction, and then use this read sites object to pass to the auto psi = readFromFile(...) command?

Miles

commented by (430 points)
Thanks, Miles. I have solved my problem. I forgot save sites object to the disk.
commented by (70.1k points)
Glad that you found a solution. Thanks for replying to explain what it was.
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

...