Hello
I got a ground state of a nearest-neighbour hubbard model by DMRG and called the state psi.I saved the psi by using ITensors.HDF5. I want to get the time evolution of psi and use the modified code from enter link description here
However,when the program is running the
psi = apply(gates, psi; cutoff=cutoff)
It can't work and get the output:
ERROR: BoundsError: attempt to access 0-element Vector{Int64} at index
Stacktrace:
[1] getindex
@ ./array.jl:861 [inlined]
[2] product(o::ITensor, ψ::MPS, ns::Vector{Int64}; move_sites_back::Bool, apply_dag::Bool, kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:cutoff,), Tuple{Float64}}})
@ ITensors ~/.julia/packages/ITensors/cu9Bo/src/mps/abstractmps.jl:1751
[3] product(As::Vector{ITensor}, ψ::MPS; move_sites_back::Bool, kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:cutoff,), Tuple{Float64}}})
@ ITensors ~/.julia/packages/ITensors/cu9Bo/src/mps/abstractmps.jl:1859
[4] top-level scope
@ REPL[1]:1
I can make sure the Hamiltonian in TEBD is right.When I used
psi = productMPS(s, n -> isodd(n) ? "Up" : "Dn");
to set a random MPS to replace psi. The TEBD works well.
Having tried the hubbard model and the Heisenberg model,I think the question results from the relation between "h5"file and the function"apply".If I can't run time evolution for a ground state from h5 file by this way,Is there another way?
Thanks