# Reading MPS from mps.h5 that contains complex numbers

+1 vote

Hi Miles,

I used

f = h5open("mps.h5","r")


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 (70.1k 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.