Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
uni20::tensor_network::FiniteMps< Scalar, Bond, Physical, Storage > Class Template Reference

Homogeneous finite MPS owner with exact bond connectivity. More...

#include <finite_chain.hpp>

Public Types

using bond_space_type = Bond
 
using physical_space_type = Physical
 
using site_type = MpsSite< Scalar, Bond, Physical, Bond, Storage >
 
using storage_policy = Storage
 
using value_type = std::remove_cv_t< Scalar >
 

Public Member Functions

 FiniteMps (std::vector< site_type > sites)
 Construct a nonempty chain and validate every shared bond.
 
void replace_pair (std::size_t first_index, site_type first, site_type second)
 Replace adjacent sites while permitting their shared bond to change.
 
void replace_site (std::size_t index, site_type replacement)
 Replace one site without changing any of its spaces.
 
auto revision (std::size_t index) const -> std::size_t
 Return the revision of one site.
 
auto site (std::size_t index) const -> site_type const &
 Return one read-only site.
 
auto sites () const noexcept -> std::span< site_type const >
 Return all sites in left-to-right order.
 
auto size () const noexcept -> std::size_t
 Return the number of sites.
 
auto symmetry () const -> Symmetry
 Return the common symmetry context.
 

Detailed Description

template<typename Scalar, Space Bond, Space Physical, BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
class uni20::tensor_network::FiniteMps< Scalar, Bond, Physical, Storage >

Homogeneous finite MPS owner with exact bond connectivity.

Sites are exposed read-only. Numerical or structural changes must use the replacement members so dependent environment caches can detect the changed sites through their revisions.

Template Parameters
ScalarNumerical site element type.
BondConcrete left and right bond-space type.
PhysicalConcrete physical-space type.
StorageBlock storage policy used by every site.

Member Typedef Documentation

◆ bond_space_type

template<typename Scalar , Space Bond, Space Physical, BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
using uni20::tensor_network::FiniteMps< Scalar, Bond, Physical, Storage >::bond_space_type = Bond

◆ physical_space_type

template<typename Scalar , Space Bond, Space Physical, BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
using uni20::tensor_network::FiniteMps< Scalar, Bond, Physical, Storage >::physical_space_type = Physical

◆ site_type

template<typename Scalar , Space Bond, Space Physical, BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
using uni20::tensor_network::FiniteMps< Scalar, Bond, Physical, Storage >::site_type = MpsSite<Scalar, Bond, Physical, Bond, Storage>

◆ storage_policy

template<typename Scalar , Space Bond, Space Physical, BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
using uni20::tensor_network::FiniteMps< Scalar, Bond, Physical, Storage >::storage_policy = Storage

◆ value_type

template<typename Scalar , Space Bond, Space Physical, BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
using uni20::tensor_network::FiniteMps< Scalar, Bond, Physical, Storage >::value_type = std::remove_cv_t<Scalar>

Constructor & Destructor Documentation

◆ FiniteMps()

template<typename Scalar , Space Bond, Space Physical, BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
uni20::tensor_network::FiniteMps< Scalar, Bond, Physical, Storage >::FiniteMps ( std::vector< site_type >  sites)
inlineexplicit

Construct a nonempty chain and validate every shared bond.

Parameters
sitesOrdered MPS sites from left to right.
Exceptions
std::invalid_argumentIf the chain is empty, mixes symmetries, or contains unequal adjacent bond spaces.

Member Function Documentation

◆ replace_pair()

template<typename Scalar , Space Bond, Space Physical, BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
void uni20::tensor_network::FiniteMps< Scalar, Bond, Physical, Storage >::replace_pair ( std::size_t  first_index,
site_type  first,
site_type  second 
)
inline

Replace adjacent sites while permitting their shared bond to change.

The pair's external bonds and physical spaces remain exactly equal to the current pair. The two replacement sites must share one exactly equal internal bond.

Parameters
first_indexIndex of the left site in the pair.
firstNew left site.
secondNew right site.
Exceptions
std::invalid_argumentIf symmetry, external spaces, physical spaces, or the new internal connection are incompatible.
std::out_of_rangeIf there is no adjacent pair at first_index.

◆ replace_site()

template<typename Scalar , Space Bond, Space Physical, BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
void uni20::tensor_network::FiniteMps< Scalar, Bond, Physical, Storage >::replace_site ( std::size_t  index,
site_type  replacement 
)
inline

Replace one site without changing any of its spaces.

This operation is the numerical-update path. A bond-space change requires replace_pair() so both ends change together.

Parameters
indexZero-based site index.
replacementNew site with exactly equal domain and codomain.
Exceptions
std::invalid_argumentIf symmetry or spaces differ.
std::out_of_rangeIf index is outside the chain.

◆ revision()

template<typename Scalar , Space Bond, Space Physical, BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
auto uni20::tensor_network::FiniteMps< Scalar, Bond, Physical, Storage >::revision ( std::size_t  index) const -> std::size_t
inline

Return the revision of one site.

Parameters
indexZero-based site index.
Exceptions
std::out_of_rangeIf index is outside the chain.

◆ site()

template<typename Scalar , Space Bond, Space Physical, BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
auto uni20::tensor_network::FiniteMps< Scalar, Bond, Physical, Storage >::site ( std::size_t  index) const -> site_type const&
inline

Return one read-only site.

Parameters
indexZero-based site index.
Exceptions
std::out_of_rangeIf index is outside the chain.

◆ sites()

template<typename Scalar , Space Bond, Space Physical, BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
auto uni20::tensor_network::FiniteMps< Scalar, Bond, Physical, Storage >::sites ( ) const -> std::span<site_type const>
inlinenoexcept

Return all sites in left-to-right order.

◆ size()

template<typename Scalar , Space Bond, Space Physical, BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
auto uni20::tensor_network::FiniteMps< Scalar, Bond, Physical, Storage >::size ( ) const -> std::size_t
inlinenoexcept

Return the number of sites.

◆ symmetry()

template<typename Scalar , Space Bond, Space Physical, BlockTensorStorage Storage = SeparateSparseBlockStorage<>>
auto uni20::tensor_network::FiniteMps< Scalar, Bond, Physical, Storage >::symmetry ( ) const -> Symmetry
inline

Return the common symmetry context.


The documentation for this class was generated from the following file: