Skip to content

Environments

Reference for MPSKit's environment machinery — the caches that store the partially contracted tensor networks reused throughout the algorithms. For an explanation of what environments are and why they exist see the concept page on Environments; this page only lists the API. The full, canonical docstrings for the whole package live in the Library index.

Constructing environments

MPSKit.environments Function
julia
environments(below, operator, above, [alg]; kwargs...)
environments(below, above)

Construct the environments for the operator sandwiched between the states below (bra) and above (ket). The keyword arguments or alg struct can be used to control the settings needed for computing the environments.

The two-argument form environments(below, above) (with two states) constructs the overlap environments, i.e. the operator-free environments between the bra below and the ket above.

Note

The operator form requires an explicit above; there is no two-argument environments(below, operator) shorthand. Because a two-argument call is the overlap form, the second argument cannot be disambiguated between a ket (overlap) and an operator — this is genuinely undecidable for density matrices, where states and operators share a representation.

source

Querying environments

MPSKit.leftenv Function
julia
leftenv(envs, site, state)

Return the left environment stored in envs at site for the given state: the contraction of everything to the left of site in the network the environments were built for. The result is gauge-compatible with the tensor of state at site and can be contracted onto it directly.

See also rightenv and environments.

source
MPSKit.rightenv Function
julia
rightenv(envs, site, state)

Return the right environment stored in envs at site for the given state: the contraction of everything to the right of site in the network the environments were built for. The result is gauge-compatible with the tensor of state at site and can be contracted onto it directly.

See also leftenv and environments.

source

Environment types

The concrete environment types below are returned by environments and are managed automatically by the algorithms. They are implementation details — you normally obtain them from environments rather than constructing them directly — and are not part of the public API.

MPSKit.AbstractMPSEnvironments Type
julia
abstract type AbstractEnvironments end

Abstract supertype for all environment types.

source
MPSKit.FiniteEnvironments Type
julia
struct FiniteEnvironments <: AbstractMPSEnvironments

Environment manager for FiniteMPS and WindowMPS. This structure is responsible for automatically checking if the queried environment is still correctly cached and if not recalculates.

source
MPSKit.InfiniteEnvironments Type
julia
InfiniteEnvironments <: AbstractMPSEnvironments

Environments for an infinite MPS-MPO-MPS combination. These solve the corresponding fixedpoint equations:

where T_LL and T_RR are the (regularized) transfer matrix operators on a give site for AL-O-AL and AR-O-AR respectively.

source
MPSKit.InfiniteQPEnvironments Type
julia
InfiniteQPEnvironments <: AbstractMPSEnvironments

Environments for an infinite QP-MPO-QP combination. These solve the corresponding fixedpoint equations:

where T_BL, T_BR, T_RL and T_LR are the (regularized) transfer matrix operators on a given site for B-O-AL, B-O-AR, AR-O-AL and AL-O-AR respectively.

source