I saved an MPS using ITensors.HDF5 but while loading it, I get the error unable to determine if "filename.h5" is accessible in the HDF5 format (file may not exist) (assuming that the file is filename.h5).
I even ran the program in the same directory as the .h5 file itself but I keep getting the same error. The file doesn’t seem to be corrupted (it’s quite heavy, around 1.8 GB).
Unfortunately I don’t think we can provide very much help with this. It sounds to me like a bug or issue with the Julia HDF5 library, or the underlying C HDF5 library that Julia HDF5 wraps around. (ITensors.HDF5 is just a shorthand for the HDF5.jl Julia library which we do not maintain.)
You may make some progress searched on the Julia language Discourse forum to see if others have gotten a similar error message.
Hi Kartikeya,
I’m really not sure why this error is happening without more information. Could you share the code you are using? Also did you get a longer printout of the error showing a “backtrace” of where the problem is occurring?
Presumably the continuous integration server jenkins is not picking up this problem, or all PRs would fail, no?
It looks like dense tensors can write, but diag/block tensors cannot !!?! (but only for some people)
The unit test error you’re seeing is probably because Diag tensor has an error and doesn’t close the file data.h5. Support for Diag ITensors was added after the latest release (v0.3.20) .
I just tried to save an MPS for the first time with my own code and I am also getting this error. I am using ITensors v0.3.23. Below is some code get replicates the issue for me.
using ITensors, ITensors.HDF5
begin
d = 2
N = 10
n = d^N
x = LinRange(0, 1, n)
y = 2 * x
inds = siteinds(d, N)
ȳ = MPS(y, inds)
end
h5open("mps.hdf5", "w") do fid
create_group(fid, "mps")
fid["mps"]["y"] = ȳ
end
h5open("mps.hdf5", "r") # error happens here