Excited State DMRG with saving to disk

Hi there,

I am trying to target the 1st excited state through

energy,psi = dmrg(H,[psi0],psix,sweeps; write_when_maxdim_exceeds=500)

However, I got the following error message:

ERROR: LoadError: MethodError: no method matching disk(::ProjMPO_MPS; path=“/scratch/feng/tmp”)
Closest candidates are:
disk(::SerializedElementArrays.SerializedElementArray; kw…) at ~/.julia/packages/SerializedElementArrays/cdFxy/src/SerializedElementArrays.jl:153
disk(::AbstractArray; kw…) at ~/.julia/packages/SerializedElementArrays/cdFxy/src/SerializedElementArrays.jl:151
disk(::ITensors.AbstractSum; disk_kwargs…) at ~/.julia/dev/ITensors/src/mps/projmposum.jl:110

Stacktrace:
[1] dmrg(PH::ProjMPO_MPS, psi0::MPS, sweeps::Sweeps; kwargs::Base.Pairs{Symbol, Any, NTuple{6, Symbol}, NamedTuple{(:start_disk, :write_when_maxdim_exceeds, :write_step, :eigsolve_tol, :eigsolve_krylovdim, :weight), Tuple{Bool, Int64, String, Float64, Int64, Int64}}})
@ ITensors ~/.julia/dev/ITensors/src/mps/dmrg.jl:225
[2] dmrg(H::MPO, Ms::Vector{MPS}, psi0::MPS, sweeps::Sweeps; kwargs::Base.Pairs{Symbol, Any, NTuple{6, Symbol}, NamedTuple{(:start_disk, :write_when_maxdim_exceeds, :write_step, :eigsolve_tol, :eigsolve_krylovdim, :weight), Tuple{Bool, Int64, String, Float64, Int64, Int64}}})
@ ITensors ~/.julia/dev/ITensors/src/mps/dmrg.jl:55

It seems that disk() cannot treat ProjMPO_MPS type object. Can you help?

Best,
Simon

Thanks for the report, that will be simple to fix.

Hi Matthew,

Thanks for the reply. Can you explain how?

Best,
Simon

If you want something working for yourself, you could look at the design of DiskProjMPO: ITensors.jl/src/mps/diskprojmpo.jl at main · ITensor/ITensors.jl · GitHub.

The conceptually simplest strategy would be to make a DiskProjMPS type, based on combining the design of DiskProjMPO and ProjMPS (ITensors.jl/src/mps/projmps.jl at main · ITensor/ITensors.jl · GitHub). Then you could create a DiskProjMPO_MPS similar to the ProjMPO_MPS type (ITensors.jl/src/mps/projmpo_mps.jl at main · ITensor/ITensors.jl · GitHub).

If I were to do it myself, I think I would do a bigger rewrite of those types to share more code across the projected MPO/MPS types types that are stored in memory and on disk, so for example redesign ProjMPO, ProjMPS, and ProjMPO_MPS to be parametrized types that either can be fully in memory or partially on disk depending on what objects they are storing. I may go ahead and do that but if you want something done faster for yourself, you could take the strategy I outlined above.

1 Like

An update that @miles will be looking into implementing this.

Sounds great! Thank you!