|
Uni20
Asynchronous tensor and runtime library.
|
Directional MPO environment cache borrowed from finite MPS and MPO owners. More...
#include <environment_cache.hpp>
Public Types | |
| using | auxiliary_space_type = typename mpo_type::auxiliary_space_type |
| using | bond_space_type = typename mps_type::bond_space_type |
| using | environment_type = MpoEnvironment< value_type, bond_space_type, auxiliary_space_type, bond_space_type, EnvironmentStorage > |
| using | mpo_block_type = block_tensor_const_block_t< typename mpo_type::site_type > |
| using | mpo_type = std::remove_cvref_t< MpoChain > |
| using | mps_type = std::remove_cvref_t< MpsChain > |
| using | value_type = typename mps_type::value_type |
Public Member Functions | |
| void | build_all () |
| Build every left and right environment entry. | |
| auto | is_attached_to (mps_type const &mps, mpo_type const &mpo) const noexcept -> bool |
| Return whether this cache observes the supplied chain objects. | |
| auto | left_cached (std::size_t bond) -> bool |
| Return whether the left environment at a bond is currently cached. | |
| auto | left_environment (std::size_t bond) -> environment_type const & |
| Build and return the left environment at one bond. | |
| MpoEnvironmentCache (mps_type const &mps, mpo_type const &mpo, std::size_t left_auxiliary_index, std::size_t right_auxiliary_index) | |
| Construct boundary entries and validate the coupled chains. | |
| auto | right_cached (std::size_t bond) -> bool |
| Return whether the right environment at a bond is currently cached. | |
| auto | right_environment (std::size_t bond) -> environment_type const & |
| Build and return the right environment at one bond. | |
| auto | size () const noexcept -> std::size_t |
| Return the number of physical sites. | |
Directional MPO environment cache borrowed from finite MPS and MPO owners.
The cache stores one left and one right environment at every bond. Entries are built lazily or with build_all(). Site revisions automatically invalidate the exact directional suffix or prefix that depends on a replacement.
| using uni20::tensor_network::MpoEnvironmentCache< MpsChain, MpoChain, EnvironmentStorage >::auxiliary_space_type = typename mpo_type::auxiliary_space_type |
| using uni20::tensor_network::MpoEnvironmentCache< MpsChain, MpoChain, EnvironmentStorage >::bond_space_type = typename mps_type::bond_space_type |
| using uni20::tensor_network::MpoEnvironmentCache< MpsChain, MpoChain, EnvironmentStorage >::environment_type = MpoEnvironment<value_type, bond_space_type, auxiliary_space_type, bond_space_type, EnvironmentStorage> |
| using uni20::tensor_network::MpoEnvironmentCache< MpsChain, MpoChain, EnvironmentStorage >::mpo_block_type = block_tensor_const_block_t<typename mpo_type::site_type> |
| using uni20::tensor_network::MpoEnvironmentCache< MpsChain, MpoChain, EnvironmentStorage >::mpo_type = std::remove_cvref_t<MpoChain> |
| using uni20::tensor_network::MpoEnvironmentCache< MpsChain, MpoChain, EnvironmentStorage >::mps_type = std::remove_cvref_t<MpsChain> |
| using uni20::tensor_network::MpoEnvironmentCache< MpsChain, MpoChain, EnvironmentStorage >::value_type = typename mps_type::value_type |
|
inline |
Construct boundary entries and validate the coupled chains.
| mps | Borrowed finite MPS owner. |
| mpo | Borrowed finite MPO owner of the same length. |
| left_auxiliary_index | Identity-charge state at the left MPO boundary. |
| right_auxiliary_index | Identity-charge state at the right MPO boundary. |
| std::invalid_argument | If chain sizes, symmetries, or physical spaces differ, or either boundary state is invalid. |
|
inline |
Build every left and right environment entry.
|
inlinenoexcept |
Return whether this cache observes the supplied chain objects.
This identity check lets compound algorithms reject a cache constructed for different owners of the same concrete types.
| mps | Candidate finite MPS owner. |
| mpo | Candidate finite MPO owner. |
|
inline |
Return whether the left environment at a bond is currently cached.
| bond | Bond index in [0, size()]. |
| std::out_of_range | If bond is invalid. |
|
inline |
Build and return the left environment at one bond.
Bond zero is the left identity boundary. Bond i+1 extends bond i across site i.
| bond | Bond index in [0, size()]. |
| std::out_of_range | If bond is invalid. |
|
inline |
Return whether the right environment at a bond is currently cached.
| bond | Bond index in [0, size()]. |
| std::out_of_range | If bond is invalid. |
|
inline |
Build and return the right environment at one bond.
Bond size() is the right identity boundary. Bond i extends bond i+1 across site i from right to left.
| bond | Bond index in [0, size()]. |
| std::out_of_range | If bond is invalid. |
|
inlinenoexcept |
Return the number of physical sites.