StateEnvs: A container to store the MPS and its environments

At the lowest-level of abstraction, TenNetLib.jl defines StateEnvs to hold an MPS and its environments to be modified in place.

Skip this part if you want to avoid lower-level abstraction.

TenNetLib.StateEnvsType
mutable struct StateEnvs{T <: Union{ProjMPO,
                              ProjMPO_MPS2,
                              ProjMPOSum2,
                              ProjMPOSum_MPS,
                              ProjCouplingModel,
                              ProjCouplingModel_MPS}
                        }
    psi::MPS
    PH::T
end

Holds the MPS state psi and its environments PH.

source
TenNetLib.getenvMethod
function getenv(sysenv::StateEnvs)

Returns (shallow copy of) the environment PH.

source
TenNetLib.StateEnvsMethod
function StateEnvs(psi::MPS, Hs::Vector{MPO})

Constructor of the StateEnvs from a vector of MPO. Environments are contracted in parallel.

source
TenNetLib.StateEnvsMethod
function StateEnvs(psi::MPS, H::MPO, Ms::Vector{MPS}; weight::Float64)

Constructor of the StateEnvs from a single MPO and a vector of MPS used for excited state DMRG.

source
TenNetLib.StateEnvsMethod
function StateEnvs(psi::MPS, Hs::Vector{MPO}, Ms::Vector{MPS}; weight::Float64)

Constructor of the StateEnvs from a vector of MPO and a vector of MPS used for excited state DMRG. Environments for MPOs are contracted in parallel.

source
TenNetLib.StateEnvsMethod
function StateEnvs(psi::MPS, H::CouplingModel)

Constructor of the StateEnvs from a CouplingModel. Each terms in the CouplingModel are contracted in parallel.

source
TenNetLib.StateEnvsMethod
function StateEnvs(psi::MPS, H::CouplingModel, Ms::Vector{MPS}; weight::Float64)

Constructor of StateEnvs from a CouplingModel and a vector of MPS used for excited state DMRG. Each terms in the CouplingModel are contracted in parallel.

source
TenNetLib.updateH!Method
function updateH!(sysenv::StateEnvs{ProjMPO}, H::MPO; recalcEnv::Bool = true)

Update Hamiltonian H in sysenv::StateEnvs. If recalcEnv = false, it reuses previous environments.

source
TenNetLib.updateH!Method
function updateH!(sysenv::StateEnvs{ProjMPOSum2}, Hs::Vector{MPO}; recalcEnv::Bool = true)

Update Hamiltonian H in sysenv::StateEnvs. recalcEnv = false is not supported.

source
TenNetLib.updateH!Method
function updateH!(sysenv::StateEnvs{ProjMPO_MPS2}, H::MPO, Ms::Vector{MPS};
                  weight::Float64, recalcEnv::Bool = true)

Update Hamiltonian H in sysenv::StateEnvs. recalcEnv = false is not supported.

  • weight::Union{Nothing, Float64} = nothing.
source
TenNetLib.updateH!Method
function updateH!(sysenv::StateEnvs{ProjMPOSum_MPS}, Hs::Vector{MPO}, Ms::Vector{MPS};
                  weight::Float64, recalcEnv::Bool = true)

Update Hamiltonian H in sysenv::StateEnvs. recalcEnv = false is not supported.

  • weight::Union{Nothing, Float64} = nothing.
source
TenNetLib.updateH!Method
function updateH!(sysenv::StateEnvs{ProjCouplingModel_MPS}, H::CouplingModel, Ms::Vector{MPS};
                  weight::Float64, recalcEnv::Bool = true)

Update Hamiltonian H in sysenv::StateEnvs. recalcEnv = false is not supported.

  • weight::Union{Nothing, Float64} = nothing.
source
ITensors.nsiteMethod
function nsite(sysenv::StateEnvs)

Returns the nsite of the environment. nsite = 1 for single-site environment, nsite = 2 for two-site environmrnt, and so on. Currently, only uses nsite = 0, 1, or 2.

source
ITensors.set_nsite!Method
function set_nsite!(sysenv::StateEnvs, nsite::Int)

Set nsite of the environment. nsite = 1 for single-site environment, nsite = 2 for two-site environmrnt, and so on. Currently, only uses nsite = 0, 1, or 2.

source
ITensors.position!Method
function position!(sysenv::StateEnvs, pos::Int)

Compute the left and right environments at position pos.

source
TenNetLib.productMethod
function product(sysenv::StateEnvs, v::ITensor)

Returns the Matrix-Vector product between the environment and input ITensor v.

source
Base.copyMethod
function Base.copy(sysenv::StateEnvs)

Shallow copy of StateEnvs.

source
Base.lengthMethod
function Base.length(sysenv::StateEnvs)

Returns the length of the underlying MPS/Environment.

source