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.StateEnvs
— Typemutable 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
.
TenNetLib.getpsi
— Methodfunction getpsi(sysenv::StateEnvs)
Returns (shallow copy of) the state psi
.
TenNetLib.getenv
— Methodfunction getenv(sysenv::StateEnvs)
Returns (shallow copy of) the environment PH
.
TenNetLib.StateEnvs
— Methodfunction StateEnvs(psi::MPS, H::MPO)
Constructor of the StateEnvs
from a single MPO
.
TenNetLib.StateEnvs
— Methodfunction StateEnvs(psi::MPS, Hs::Vector{MPO})
Constructor of the StateEnvs
from a vector of MPO
. Environments are contracted in parallel.
TenNetLib.StateEnvs
— Methodfunction 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.
TenNetLib.StateEnvs
— Methodfunction 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 MPO
s are contracted in parallel.
TenNetLib.StateEnvs
— Methodfunction StateEnvs(psi::MPS, H::CouplingModel)
Constructor of the StateEnvs
from a CouplingModel
. Each terms in the CouplingModel
are contracted in parallel.
TenNetLib.StateEnvs
— Methodfunction 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.
TenNetLib.updateH!
— Methodfunction updateH!(sysenv::StateEnvs{ProjMPO}, H::MPO; recalcEnv::Bool = true)
Update Hamiltonian H
in sysenv::StateEnvs
. If recalcEnv = false
, it reuses previous environments.
TenNetLib.updateH!
— Methodfunction updateH!(sysenv::StateEnvs{ProjMPOSum2}, Hs::Vector{MPO}; recalcEnv::Bool = true)
Update Hamiltonian H
in sysenv::StateEnvs
. recalcEnv = false
is not supported.
TenNetLib.updateH!
— Methodfunction 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
.
TenNetLib.updateH!
— Methodfunction 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
.
TenNetLib.updateH!
— Methodfunction 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
.
ITensors.nsite
— Methodfunction 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
.
ITensors.set_nsite!
— Methodfunction 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
.
ITensors.position!
— Methodfunction position!(sysenv::StateEnvs, pos::Int)
Compute the left and right environments at position pos
.
TenNetLib.product
— Methodfunction product(sysenv::StateEnvs, v::ITensor)
Returns the Matrix-Vector
product between the environment and input ITensor v
.
Base.copy
— Methodfunction Base.copy(sysenv::StateEnvs)
Shallow copy of StateEnvs
.
Base.length
— Methodfunction Base.length(sysenv::StateEnvs)
Returns the length of the underlying MPS/Environment.