+1 vote
asked by (700 points)

Hi Miles,

I used

f = h5open("mps.h5","r")
psi = read(f,"mps",MPS)

to read the ground state MPS from the file mps.h5. However, I got the error:
"ERROR: LoadError: HDF5 group or file does not contain BlockSparse{Complex{Float64}} data"

Is this because the file contains complex numbers? I tried with real MPS and it worked out fine. If this is the case, then is there a way around this?

Thanks a lot for your time,
-Mason

commented by (70k points)
Hi Mason, what version of ITensor are you using? I ask because I only finished implementing this feature very recently, though there may be some cases still missing.

Also, how did you create the file MPs.h5? Did the tensors used to create it contain complex numbers?

Thank you, Miles
commented by (700 points)
The version I'm using is v0.1.41. To create the mps.h5 file, I used
f = h5open("mps.h5","w")
write(f,"mps",psi)
close(f)
Thank you
commented by (14.1k points)
Hi Mason,

You should upgrade to the latest version of ITensors.jl (v0.2.6), since new HDF5 reading and writing features were added in recent releases. You can see a succinct list of recent changes in the NEWS.md file here: https://github.com/ITensor/ITensors.jl/blob/main/NEWS.md#itensor-v026-release-notes which is helpful for seeing if there were any changes to features you are interested in.

If you upgrading your code causes any errors, please try to follow the upgrade guide (https://itensor.github.io/ITensors.jl/stable/UpgradeGuide_0.1_to_0.2.html).

-Matt
commented by (700 points)
Hi Matt, thanks a lot, this is really helpful. Everything worked out fine after the update and some minor changes in the code.

1 Answer

+1 vote
answered by (14.1k points)

Answer is in the comment above.

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

...