+1 vote
asked by (260 points)

Hi,

Using the code below

using HDF5
 fo = h5open("output.h5", "w")
 write(fo, "MPS", psi)
 close(fo)

I manage to write an MPS to a file, but only when QNs are not conserved.
Is there any way to do the same with QNs conserved?

Thanks a lot.
Best regards,
Gonçalo Catarina

commented by (44k points)
moved by

Hi Goncalo,
Unfortunately we haven’t implemented writing QN conserving ITensors to HDF5 yet in Julia. We plan to soon! This is the second request for it I’ve gotten in two days so I’ll move it up on my priority list.

Thanks for asking -

Miles

1 Answer

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

Hi Goncalo,
An update: I recently added this capability to the Julia version of ITensor, beginning in version 0.1.12 which is the latest tagged version. Please now try doing "update ITensors" in the Julia package manager then re-running your code above and it should work. If it doesn't, please comment below to let me know.

Thanks,
Miles

commented by (260 points)
Hi Miles,

I confirm that it now works.
I also checked that it also works for arrays of MPS.

Thanks a lot.
Best,
Gonçalo Catarina
commented by (44k points)
Thanks for that feedback! Glad it’s working well for you. Please let us know if the generated file sizes are ok for your purposes.
commented by (260 points)
Yes, it is ok!

I forgot to say that I also tested reading the MPS and using it afterwards. Everything works well.
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

...