From another answer of mine, here is a code snippet to save/load infinite MPSs
using HDF5
using ITensorInfiniteMPS
using ITensorMPS
# do stuff to get a state
psi = ...
h5open("my_wavefunction.h5","w") do fo
write(fo,"psi",psi)
# example metadata, needs vector for hdf5 conversion
write(fo, "model_params", [model_params])
end
#######
psi, model_params = h5open("my_wavefunction.h5","r") do fi
read(fi,"psi",InfiniteCanonicalMPS), read(fi,"model_params")[1]
end
s = siteinds(psi)
model = #...
# load H using matching indices from old calculation
H = InfiniteSum{localham_type}(model, s; model_params...)
You can either pass outer_iters=0 and keep the same maxdim as the input, or you can directly call the vumps routine with tdvp(H, ψ; time_step=-Inf, vumps_kwargs...)