I’m trying to both checkpoint a VUMPS calculation and force the increase in bond-dimension to follow a scheduler. What I have written here works fine for the scheduling.
for i in 1:outer_iters
wvfcn = input * "-" * string(maxdims[i]) * ".jld2"
println(wvfcn)
if isfile(wvfcn)
println("WaveFunction already exists")
ψ = load(wvfcn)["ψ"]
else
println("\nCheck translational invariance of initial infinite MPS")
@show norm(contract(ψ.AL[1:N]..., ψ.C[N]) - contract(ψ.C[0], ψ.AR[1:N]...))
vumps_kwargs = (tol=vumps_tol, maxiter=max_vumps_iters, outputlevel, eager)
subspace_expansion_kwargs = (cutoff=cutoff, maxdim=maxdims[i])
#ψ = vumps_subspace_expansion(H, ψ; outer_iters=iter, subspace_expansion_kwargs, vumps_kwargs)
ψ = @time subspace_expansion(ψ, H; subspace_expansion_kwargs...)
println("\nRun VUMPS with new bond dimension $(maxlinkdim(ψ))")
ψ = @time tdvp(H, ψ; time_step=-Inf, vumps_kwargs...)
data = Dict("ψ" => ψ)
save(wvfcn, data)
end
end
However, if I try and load a previous wavefunction from a jld2
file, I get the following error for both using the vumps_subspace_expansion
wrapper or not.
norm(contract(ψ.AL[1:N]..., ψ.C[N]) - contract(ψ.C[0], ψ.AR[1:N]...)) = 5.094392794687761e-7
The two-site subspace expansion produced a zero-norm expansion at (1, 2). This is likely due to the long-range nature of the QN conserving Hamiltonian.
The two-site subspace expansion produced a zero-norm expansion at (2, 3). This is likely due to the long-range nature of the QN conserving Hamiltonian.
16.511079 seconds (17.67 M allocations: 1.139 GiB, 7.27% gc time, 99.70% compilation time)
Run VUMPS with new bond dimension 8
Using VUMPS solver with time step -Inf
Running VUMPS with multisite_update_alg = sequential
ERROR: LoadError: DimensionMismatch: In scalar(T) or T[], ITensor T is not a scalar (it has indices ((dim=4|id=514|"Electron,Site,c=0,n=2"), (dim=4|id=265|"Electron,Site,c=0,n=2")', (dim=4|id=265|"Electron,Site,c=0,n=2"), (dim=4|id=514|"Electron,Site,c=0,n=2")', (dim=4|id=662|"Electron,Site,c=1,n=1"), (dim=4|id=257|"Electron,Site,c=1,n=1")', (dim=4|id=257|"Electron,Site,c=1,n=1"), (dim=4|id=662|"Electron,Site,c=1,n=1")')).
Stacktrace:
Could someone educate me on what is going wrong or the correct way to set-up such checkpoints?