Hi everybody,
I was trying to update my code to exploit the new GPU backends, which seems to allow much faster computations, amazing!
I am evolving my MPS in time with TEBD and the Hamiltonian I am using is a sum of two-site local Hamiltonians. In particular for each time step I first perform all the gates on the odd bonds and then on the even bonds
psi=apply(gates_odd, psi; cutoff=cutoff, maxdim=maxdim)
normalize!(psi)
psi=apply(gates_even, psi; cutoff=cutoff, maxdim=maxdim)
normalize!(psi)
Everything works fine as long as I am not using the GPU or use the apply function without any cutoff and maxdim, yet in this case the max link dim explodes immediately.
If instead I set some cutoff and maxdim, once I apply the second layer (i.e. the gates acting on the even bonds), I get the following error message
ERROR: LoadError: ArgumentError: Trying to perform the eigendecomposition of a matrix containing NaNs or Infs
Stacktrace:
[1] eigen(T::Hermitian{ComplexF32, NDTensors.DenseTensor{ComplexF32, 2, Tuple{Index{Int64}, Index{Int64}}, NDTensors.Dense{ComplexF32, CuArray{ComplexF32, 1, CUDA.Mem.DeviceBuffer}}}}; mindim::Nothing, maxdim::Int64, cutoff::Float64, use_absolute_cutoff::Nothing, use_relative_cutoff::Nothing)
@ NDTensors /scratch/user/.julia/packages/NDTensors/voe3z/src/linearalgebra/linearalgebra.jl:191
[2] eigen(A::ITensor, Linds::Vector{Index{Int64}}, Rinds::Vector{Index{Int64}}; mindim::Nothing, maxdim::Int64, cutoff::Float64, use_absolute_cutoff::Nothing, use_relative_cutoff::Nothing, ishermitian::Bool, tags::String, lefttags::Nothing, righttags::Nothing, plev::Nothing, leftplev::Nothing, rightplev::Nothing)
@ ITensors /scratch/user/.julia/packages/ITensors/w2KHv/src/tensor_operations/matrix_decomposition.jl:377
[3] factorize_eigen(A::ITensor, Linds::Vector{Index{Int64}}; ortho::String, eigen_perturbation::Nothing, mindim::Nothing, maxdim::Int64, cutoff::Float64, tags::String)
@ ITensors /scratch/user/.julia/packages/ITensors/w2KHv/src/tensor_operations/matrix_decomposition.jl:667
[4] factorize(A::ITensor, Linds::Vector{Index{Int64}}; mindim::Nothing, maxdim::Int64, cutoff::Float64, ortho::String, tags::String, plev::Nothing, which_decomp::Nothing, eigen_perturbation::Nothing, svd_alg::Nothing, use_absolute_cutoff::Nothing, use_relative_cutoff::Nothing, min_blockdim::Nothing, singular_values!::Nothing, dir::Nothing)
@ ITensors /scratch/user/.julia/packages/ITensors/w2KHv/src/tensor_operations/matrix_decomposition.jl:785
[5] MPS(A::ITensor, sites::Vector{Vector{Index{Int64}}}; leftinds::Index{Int64}, orthocenter::Int64, kwargs::Base.Pairs{Symbol, Real, Tuple{Symbol, Symbol}, NamedTuple{(:cutoff, :maxdim), Tuple{Float64, Int64}}})
@ ITensors /scratch/user/.julia/packages/ITensors/w2KHv/src/mps/abstractmps.jl:1947
[6] setindex!(ψ::MPS, A::ITensor, r::UnitRange{Int64}; orthocenter::Int64, perm::Nothing, kwargs::Base.Pairs{Symbol, Real, Tuple{Symbol, Symbol}, NamedTuple{(:cutoff, :maxdim), Tuple{Float64, Int64}}})
@ ITensors /scratch/user/.julia/packages/ITensors/w2KHv/src/mps/abstractmps.jl:1887
[7] setindex!(::MPS, ::ITensor, ::UnitRange{Int64}, ::Pair{Symbol, Real}, ::Vararg{Pair{Symbol, Real}}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ ITensors /scratch/user/.julia/packages/ITensors/w2KHv/src/mps/abstractmps.jl:1898
[8] setindex!(::MPS, ::ITensor, ::UnitRange{Int64}, ::Pair{Symbol, Real}, ::Pair{Symbol, Real})
@ ITensors /scratch/user/.julia/packages/ITensors/w2KHv/src/mps/abstractmps.jl:1895
[9] product(o::ITensor, ψ::MPS, ns::Vector{Int64}; move_sites_back::Bool, apply_dag::Bool, kwargs::Base.Pairs{Symbol, Real, Tuple{Symbol, Symbol}, NamedTuple{(:cutoff, :maxdim), Tuple{Float64, Int64}}})
@ ITensors /scratch/user/.julia/packages/ITensors/w2KHv/src/mps/abstractmps.jl:2126
[10] product(As::Vector{ITensor}, ψ::MPS; move_sites_back_between_gates::Bool, move_sites_back::Bool, kwargs::Base.Pairs{Symbol, Real, Tuple{Symbol, Symbol}, NamedTuple{(:cutoff, :maxdim), Tuple{Float64, Int64}}})
@ ITensors /scratch/user/.julia/packages/ITensors/w2KHv/src/mps/abstractmps.jl:2241
[11] macro expansion
@ ~/TestGPU/TimeEvolutionGPU.jl:389 [inlined]
[12] macro expansion
@ ./timing.jl:382 [inlined]
[13] TEBD_obs(psi_start::MPS, N::Int64, sites::Vector{Index{Int64}}, H::MPO, tau::Float64, T::Int64, lambda::Float64, v::Float64, chi::Int64, kappa::Int64, path::String, path_HDF5::String, appendix_h5::String, mps_path::String, time_path::String; restart_time::Int64, cutoff::Float64, maxdim::Int64, save_interval::Int64, psi_0::MPS, delta::Float64)
@ Main ~/TestGPU/TimeEvolutionGPU.jl:382
[14] top-level scope
@ /gpfs/gpfs1/scratch/user/TestGPU/timeevol_test_GPU.jl:97
in expression starting at /gpfs/gpfs1/scratch/user/TestGPU/timeevol_test_GPU.jl:97
I am working on an HPC cluster with the latest version of ITensors (v0.3.49).
Instead if I am using previous version of ITensors (e.g. v0.3.48) I get another error message once I try to apply the first layer of gates on the odd bonds
ERROR: LoadError: MethodError: no method matching eigen(::Hermitian{ComplexF32, NDTensors.DenseTensor{ComplexF32, 2, Tuple{Index{Int64}, Index{Int64}}, NDTensors.Dense{ComplexF32, CuArray{ComplexF32, 1, CUDA.Mem.DeviceBuffer}}}}; ishermitian=true, cutoff=1.0e-9, tags="Link,n=1", ortho="left", maxdim=13)
Closest candidates are:
eigen(::Hermitian{ElT, <:NDTensors.DenseTensor{ElT, 2, IndsT}}; mindim, maxdim, cutoff, use_absolute_cutoff, use_relative_cutoff) where {ElT<:Union{Real, Complex}, IndsT} at /scratch/user/.julia/packages/NDTensors/voe3z/src/linearalgebra/linearalgebra.jl:179 got unsupported keyword arguments "ishermitian", "tags", "ortho"
eigen(::Union{Hermitian{T, S}, Hermitian{Complex{T}, S}, Symmetric{T, S}} where {T<:Real, S}; sortby) at /gpfs/gpfs1/scratch/user/julia-1.8.5/share/julia/stdlib/v1.8/LinearAlgebra/src/symmetriceigen.jl:7 got unsupported keyword arguments "ishermitian", "cutoff", "tags", "ortho", "maxdim"
eigen(::Union{Hermitian{T, S}, Hermitian{Complex{T}, S}, Symmetric{T, S}} where {T<:Real, S}, ::UnitRange) at /gpfs/gpfs1/scratch/user/julia-1.8.5/share/julia/stdlib/v1.8/LinearAlgebra/src/symmetriceigen.jl:33 got unsupported keyword arguments "ishermitian", "cutoff", "tags", "ortho", "maxdim"
...
Stacktrace:
[1] kwerr(::NamedTuple{(:ishermitian, :cutoff, :tags, :ortho, :maxdim), Tuple{Bool, Float64, String, String, Int64}}, ::Function, ::Hermitian{ComplexF32, NDTensors.DenseTensor{ComplexF32, 2, Tuple{Index{Int64}, Index{Int64}}, NDTensors.Dense{ComplexF32, CuArray{ComplexF32, 1, CUDA.Mem.DeviceBuffer}}}})
@ Base ./error.jl:165
[2] eigen(A::ITensor, Linds::Vector{Index{Int64}}, Rinds::Vector{Index{Int64}}; kwargs::Base.Pairs{Symbol, Any, NTuple{5, Symbol}, NamedTuple{(:ishermitian, :cutoff, :tags, :ortho, :maxdim), Tuple{Bool, Float64, String, String, Int64}}})
@ ITensors /scratch/user/.julia/packages/ITensors/0GazL/src/tensor_operations/matrix_decomposition.jl:338
[3] factorize_eigen(A::ITensor, Linds::Vector{Index{Int64}}; kwargs::Base.Pairs{Symbol, Any, NTuple{4, Symbol}, NamedTuple{(:cutoff, :tags, :ortho, :maxdim), Tuple{Float64, String, String, Int64}}})
@ ITensors /scratch/user/.julia/packages/ITensors/0GazL/src/tensor_operations/matrix_decomposition.jl:602
[4] factorize(A::ITensor, Linds::Vector{Index{Int64}}; maxdim::Int64, kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:cutoff, :tags, :ortho), Tuple{Float64, String, String}}})
@ ITensors /scratch/user/.julia/packages/ITensors/0GazL/src/tensor_operations/matrix_decomposition.jl:708
[5] MPS(A::ITensor, sites::Vector{Vector{Index{Int64}}}; leftinds::Nothing, orthocenter::Int64, kwargs::Base.Pairs{Symbol, Real, Tuple{Symbol, Symbol}, NamedTuple{(:cutoff, :maxdim), Tuple{Float64, Int64}}})
@ ITensors /scratch/user/.julia/packages/ITensors/0GazL/src/mps/abstractmps.jl:1941
[6] setindex!(ψ::MPS, A::ITensor, r::UnitRange{Int64}; orthocenter::Int64, perm::Nothing, kwargs::Base.Pairs{Symbol, Real, Tuple{Symbol, Symbol}, NamedTuple{(:cutoff, :maxdim), Tuple{Float64, Int64}}})
@ ITensors /scratch/user/.julia/packages/ITensors/0GazL/src/mps/abstractmps.jl:1881
[7] setindex!(::MPS, ::ITensor, ::UnitRange{Int64}, ::Pair{Symbol, Real}, ::Vararg{Pair{Symbol, Real}}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ ITensors /scratch/user/.julia/packages/ITensors/0GazL/src/mps/abstractmps.jl:1892
[8] setindex!(::MPS, ::ITensor, ::UnitRange{Int64}, ::Pair{Symbol, Real}, ::Pair{Symbol, Real})
@ ITensors /scratch/user/.julia/packages/ITensors/0GazL/src/mps/abstractmps.jl:1889
[9] product(o::ITensor, ψ::MPS, ns::Vector{Int64}; move_sites_back::Bool, apply_dag::Bool, kwargs::Base.Pairs{Symbol, Real, Tuple{Symbol, Symbol}, NamedTuple{(:cutoff, :maxdim), Tuple{Float64, Int64}}})
@ ITensors /scratch/user/.julia/packages/ITensors/0GazL/src/mps/abstractmps.jl:2120
[10] product(As::Vector{ITensor}, ψ::MPS; move_sites_back_between_gates::Bool, move_sites_back::Bool, kwargs::Base.Pairs{Symbol, Real, Tuple{Symbol, Symbol}, NamedTuple{(:cutoff, :maxdim), Tuple{Float64, Int64}}})
@ ITensors /scratch/user/.julia/packages/ITensors/0GazL/src/mps/abstractmps.jl:2235
[11] macro expansion
@ ~/TestGPU/TimeEvolutionGPU.jl:386 [inlined]
[12] macro expansion
@ ./timing.jl:382 [inlined]
[13] TEBD_obs(psi_start::MPS, N::Int64, sites::Vector{Index{Int64}}, H::MPO, tau::Float64, T::Int64, lambda::Float64, v::Float64, chi::Int64, kappa::Int64, path::String, path_HDF5::String, appendix_h5::String, mps_path::String, time_path::String; restart_time::Int64, cutoff::Float64, maxdim::Int64, save_interval::Int64, psi_0::MPS, delta::Float64)
@ Main ~/TestGPU/TimeEvolutionGPU.jl:382
[14] top-level scope
@ /gpfs/gpfs1/scratch/user/TestGPU/timeevol_test_GPU.jl:97
in expression starting at /gpfs/gpfs1/scratch/user/TestGPU/timeevol_test_GPU.jl:97
How can I solve this issue?
Thanks!