Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
uni20::BlockTensor< T, DomainType, CodomainType, Storage > Class Template Reference

Fixed-order tensor whose blocks obey a bosonic abelian selection rule. More...

#include <block_tensor.hpp>

Public Types

using backend_selector_type = typename storage_policy::backend_selector_type
 
using codomain_type = CodomainType
 
using const_block_type = typename storage_type::const_block_type
 
using domain_type = DomainType
 
using element_type = T
 
using key_type = BlockKey< static_key_coordinate_count >
 
using mutable_block_type = typename storage_type::mutable_block_type
 
using storage_policy = Storage
 
using storage_type = typename storage_policy::template storage_t< element_type, static_key_coordinate_count, static_dense_block_order >
 
using value_type = std::remove_cv_t< T >
 

Public Member Functions

auto allocate_like () const -> BlockTensor
 Allocate a tensor with identical validated structure.
 
auto allocate_like (uninitialized_t) const -> BlockTensor
 Allocate uninitialized blocks with identical validated structure.
 
decltype(auto) allocation_context () const noexcept
 Return the leaf context used for compatible result allocations.
 
decltype(auto) async_block (key_type const &key)
 Return the independently scheduled value for one stored key.
 
decltype(auto) async_block (key_type const &key) const
 Return the independently scheduled value for one stored key.
 
decltype(auto) async_block_by_ordinal (std::size_t ordinal)
 Return one independently scheduled value by stable canonical ordinal.
 
decltype(auto) async_block_by_ordinal (std::size_t ordinal) const
 Return one independently scheduled value by stable canonical ordinal.
 
auto block (key_type const &key) -> mutable_block_type
 Return a writable stored block.
 
auto block (key_type const &key) const -> const_block_type
 Return a read-only stored block.
 
auto block_by_ordinal (std::size_t ordinal) -> mutable_block_type
 Return a writable block TensorView by stable canonical ordinal.
 
auto block_by_ordinal (std::size_t ordinal) const -> const_block_type
 Return a read-only block TensorView by stable canonical ordinal.
 
 BlockTensor (Symmetry symmetry, domain_type domain, codomain_type codomain)
 Construct zero-initialized blocks for every symmetry-legal key.
 
template<class Context >
requires CompleteBlockStorage<storage_policy> && std::constructible_from< storage_type, std::vector<detail::BlockSpec<static_key_coordinate_count, static_dense_block_order>> const&, Context&, StorageInitialization>
 BlockTensor (Symmetry symmetry, domain_type domain, codomain_type codomain, Context &context)
 Construct a complete tensor in an explicit leaf allocation context.
 
 BlockTensor (Symmetry symmetry, domain_type domain, codomain_type codomain, std::initializer_list< key_type > stored_keys)
 Construct a sparse tensor from an initializer list of stored keys.
 
 BlockTensor (Symmetry symmetry, domain_type domain, codomain_type codomain, std::vector< key_type > stored_keys)
 Construct zero-initialized sparse blocks from an explicit stored-key list.
 
template<class Context >
requires SparseBlockStorage<storage_policy> && std::constructible_from< storage_type, std::vector<detail::BlockSpec<static_key_coordinate_count, static_dense_block_order>> const&, Context&, StorageInitialization>
 BlockTensor (Symmetry symmetry, domain_type domain, codomain_type codomain, std::vector< key_type > stored_keys, Context &context)
 Construct a sparse tensor in an explicit leaf allocation context.
 
 BlockTensor (uninitialized_t, Symmetry symmetry, domain_type domain, codomain_type codomain)
 Allocate every symmetry-legal block without numerical initialization.
 
template<class Context >
requires CompleteBlockStorage<storage_policy> && std::constructible_from< storage_type, std::vector<detail::BlockSpec<static_key_coordinate_count, static_dense_block_order>> const&, Context&, StorageInitialization>
 BlockTensor (uninitialized_t, Symmetry symmetry, domain_type domain, codomain_type codomain, Context &context)
 Allocate uninitialized complete blocks in an explicit leaf allocation context.
 
 BlockTensor (uninitialized_t, Symmetry symmetry, domain_type domain, codomain_type codomain, std::initializer_list< key_type > stored_keys)
 Allocate uninitialized sparse blocks from an initializer list of stored keys.
 
 BlockTensor (uninitialized_t, Symmetry symmetry, domain_type domain, codomain_type codomain, std::vector< key_type > stored_keys)
 Allocate uninitialized sparse blocks from an explicit stored-key list.
 
template<class Context >
requires SparseBlockStorage<storage_policy> && std::constructible_from< storage_type, std::vector<detail::BlockSpec<static_key_coordinate_count, static_dense_block_order>> const&, Context&, StorageInitialization>
 BlockTensor (uninitialized_t, Symmetry symmetry, domain_type domain, codomain_type codomain, std::vector< key_type > stored_keys, Context &context)
 Allocate uninitialized sparse blocks in an explicit leaf allocation context.
 
auto codomain () const -> codomain_type const &
 Return the ordered codomain value.
 
auto contains (key_type const &key) const -> bool
 Return whether a key has an allocated numerical block.
 
decltype(auto) diagonal_values (key_type const &key)
 Return the compressed writable diagonal values for one stored key.
 
decltype(auto) diagonal_values (key_type const &key) const
 Return the compressed read-only diagonal values for one stored key.
 
decltype(auto) diagonal_values_by_ordinal (std::size_t ordinal)
 Return compressed writable diagonal values by stable block ordinal.
 
decltype(auto) diagonal_values_by_ordinal (std::size_t ordinal) const
 Return compressed read-only diagonal values by stable block ordinal.
 
auto domain () const -> domain_type const &
 Return the ordered domain value.
 
auto find_block (key_type const &key) -> std::optional< mutable_block_type >
 Find a writable block without changing tensor structure.
 
auto find_block (key_type const &key) const -> std::optional< const_block_type >
 Find a read-only block without changing tensor structure.
 
auto has_all_legal_blocks () const -> bool
 Return whether this value currently stores every legal block.
 
auto is_legal (key_type const &key) const -> bool
 Return whether a key is in range and satisfies charge conservation.
 
auto legal_block_count () const -> std::size_t
 Return the number of symmetry-legal blocks.
 
auto legal_block_keys () const -> std::vector< key_type >
 Enumerate every symmetry-legal block key in canonical order.
 
auto storage () const noexcept -> storage_type const &
 Return the concrete storage value.
 
auto storage () noexcept -> storage_type &
 Return the concrete storage value.
 
auto stored_block_count () const noexcept -> std::size_t
 Return the number of stored blocks.
 
auto stored_keys () const noexcept -> std::span< key_type const >
 Return stored keys in canonical lexicographic order.
 
auto symmetry () const -> Symmetry
 Return the explicit symmetry context.
 

Static Public Member Functions

static constexpr auto backend_selector () noexcept -> backend_selector_type
 Return the default dense-leaf backend selector for this storage.
 
static constexpr auto dense_block_order () noexcept -> std::size_t
 Return the dense mdspan order of each numerical block.
 
static constexpr auto key_coordinate_count () noexcept -> std::size_t
 Return the number of coordinates stored in each block key.
 
static constexpr auto order () noexcept -> std::size_t
 Return the compile-time tensor order.
 

Static Public Attributes

static constexpr std::size_t static_dense_block_order
 
static constexpr std::size_t static_key_coordinate_count
 
static constexpr std::size_t static_order = domain_type::size() + codomain_type::size()
 

Detailed Description

template<typename T, class DomainType, class CodomainType, BlockTensorStorage Storage>
requires (detail::IsDomain<DomainType>::value && detail::IsCodomain<CodomainType>::value && detail::PrototypeBoundary<DomainType>::value && detail::PrototypeBoundary<CodomainType>::value)
class uni20::BlockTensor< T, DomainType, CodomainType, Storage >

Fixed-order tensor whose blocks obey a bosonic abelian selection rule.

This first slice supports orders zero through four and boundaries containing BlockSpace, LocalSpace, QNumSpace, and their explicit Dual<S> adaptors.

Template Parameters
TNumerical block element type.
DomainTypeOrdered domain value type.
CodomainTypeOrdered codomain value type.
StorageBlock storage policy. Sparse policies accept an explicit key set; complete policies derive every legal key.

Member Typedef Documentation

◆ backend_selector_type

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
using uni20::BlockTensor< T, DomainType, CodomainType, Storage >::backend_selector_type = typename storage_policy::backend_selector_type

◆ codomain_type

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
using uni20::BlockTensor< T, DomainType, CodomainType, Storage >::codomain_type = CodomainType

◆ const_block_type

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
using uni20::BlockTensor< T, DomainType, CodomainType, Storage >::const_block_type = typename storage_type::const_block_type

◆ domain_type

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
using uni20::BlockTensor< T, DomainType, CodomainType, Storage >::domain_type = DomainType

◆ element_type

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
using uni20::BlockTensor< T, DomainType, CodomainType, Storage >::element_type = T

◆ key_type

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
using uni20::BlockTensor< T, DomainType, CodomainType, Storage >::key_type = BlockKey<static_key_coordinate_count>

◆ mutable_block_type

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
using uni20::BlockTensor< T, DomainType, CodomainType, Storage >::mutable_block_type = typename storage_type::mutable_block_type

◆ storage_policy

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
using uni20::BlockTensor< T, DomainType, CodomainType, Storage >::storage_policy = Storage

◆ storage_type

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
using uni20::BlockTensor< T, DomainType, CodomainType, Storage >::storage_type = typename storage_policy::template storage_t<element_type, static_key_coordinate_count, static_dense_block_order>

◆ value_type

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
using uni20::BlockTensor< T, DomainType, CodomainType, Storage >::value_type = std::remove_cv_t<T>

Constructor & Destructor Documentation

◆ BlockTensor() [1/10]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
uni20::BlockTensor< T, DomainType, CodomainType, Storage >::BlockTensor ( Symmetry  symmetry,
domain_type  domain,
codomain_type  codomain,
std::vector< key_type >  stored_keys 
)
inline

Construct zero-initialized sparse blocks from an explicit stored-key list.

Parameters
symmetryExplicit tensor symmetry context.
domainOrdered domain spaces.
codomainOrdered codomain spaces.
stored_keysLegal keys to allocate; order is canonicalized.

◆ BlockTensor() [2/10]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
template<class Context >
requires SparseBlockStorage<storage_policy> && std::constructible_from< storage_type, std::vector<detail::BlockSpec<static_key_coordinate_count, static_dense_block_order>> const&, Context&, StorageInitialization>
uni20::BlockTensor< T, DomainType, CodomainType, Storage >::BlockTensor ( Symmetry  symmetry,
domain_type  domain,
codomain_type  codomain,
std::vector< key_type >  stored_keys,
Context &  context 
)
inline

Construct a sparse tensor in an explicit leaf allocation context.

◆ BlockTensor() [3/10]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
uni20::BlockTensor< T, DomainType, CodomainType, Storage >::BlockTensor ( Symmetry  symmetry,
domain_type  domain,
codomain_type  codomain,
std::initializer_list< key_type >  stored_keys 
)
inline

Construct a sparse tensor from an initializer list of stored keys.

Parameters
symmetryExplicit tensor symmetry context.
domainOrdered domain spaces.
codomainOrdered codomain spaces.
stored_keysLegal keys to allocate; order is canonicalized.

◆ BlockTensor() [4/10]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
uni20::BlockTensor< T, DomainType, CodomainType, Storage >::BlockTensor ( Symmetry  symmetry,
domain_type  domain,
codomain_type  codomain 
)
inline

Construct zero-initialized blocks for every symmetry-legal key.

Parameters
symmetryExplicit tensor symmetry context.
domainOrdered domain spaces.
codomainOrdered codomain spaces.

◆ BlockTensor() [5/10]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
template<class Context >
requires CompleteBlockStorage<storage_policy> && std::constructible_from< storage_type, std::vector<detail::BlockSpec<static_key_coordinate_count, static_dense_block_order>> const&, Context&, StorageInitialization>
uni20::BlockTensor< T, DomainType, CodomainType, Storage >::BlockTensor ( Symmetry  symmetry,
domain_type  domain,
codomain_type  codomain,
Context &  context 
)
inline

Construct a complete tensor in an explicit leaf allocation context.

◆ BlockTensor() [6/10]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
uni20::BlockTensor< T, DomainType, CodomainType, Storage >::BlockTensor ( uninitialized_t  ,
Symmetry  symmetry,
domain_type  domain,
codomain_type  codomain,
std::vector< key_type >  stored_keys 
)
inline

Allocate uninitialized sparse blocks from an explicit stored-key list.

Parameters
symmetryExplicit tensor symmetry context.
domainOrdered domain spaces.
codomainOrdered codomain spaces.
stored_keysLegal keys to allocate; order is canonicalized.

◆ BlockTensor() [7/10]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
template<class Context >
requires SparseBlockStorage<storage_policy> && std::constructible_from< storage_type, std::vector<detail::BlockSpec<static_key_coordinate_count, static_dense_block_order>> const&, Context&, StorageInitialization>
uni20::BlockTensor< T, DomainType, CodomainType, Storage >::BlockTensor ( uninitialized_t  ,
Symmetry  symmetry,
domain_type  domain,
codomain_type  codomain,
std::vector< key_type >  stored_keys,
Context &  context 
)
inline

Allocate uninitialized sparse blocks in an explicit leaf allocation context.

◆ BlockTensor() [8/10]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
uni20::BlockTensor< T, DomainType, CodomainType, Storage >::BlockTensor ( uninitialized_t  ,
Symmetry  symmetry,
domain_type  domain,
codomain_type  codomain,
std::initializer_list< key_type >  stored_keys 
)
inline

Allocate uninitialized sparse blocks from an initializer list of stored keys.

Parameters
symmetryExplicit tensor symmetry context.
domainOrdered domain spaces.
codomainOrdered codomain spaces.
stored_keysLegal keys to allocate; order is canonicalized.

◆ BlockTensor() [9/10]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
uni20::BlockTensor< T, DomainType, CodomainType, Storage >::BlockTensor ( uninitialized_t  ,
Symmetry  symmetry,
domain_type  domain,
codomain_type  codomain 
)
inline

Allocate every symmetry-legal block without numerical initialization.

Parameters
symmetryExplicit tensor symmetry context.
domainOrdered domain spaces.
codomainOrdered codomain spaces.

◆ BlockTensor() [10/10]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
template<class Context >
requires CompleteBlockStorage<storage_policy> && std::constructible_from< storage_type, std::vector<detail::BlockSpec<static_key_coordinate_count, static_dense_block_order>> const&, Context&, StorageInitialization>
uni20::BlockTensor< T, DomainType, CodomainType, Storage >::BlockTensor ( uninitialized_t  ,
Symmetry  symmetry,
domain_type  domain,
codomain_type  codomain,
Context &  context 
)
inline

Allocate uninitialized complete blocks in an explicit leaf allocation context.

Member Function Documentation

◆ allocate_like() [1/2]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::allocate_like ( ) const -> BlockTensor
inline

Allocate a tensor with identical validated structure.

This operation is available when the storage implementation can reproduce its block placement without rebuilding it from the tensor boundaries. Stored numerical values are initialized to zero.

Returns
Independent tensor with the same symmetry, boundaries, keys, and placement.

◆ allocate_like() [2/2]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::allocate_like ( uninitialized_t  ) const -> BlockTensor
inline

Allocate uninitialized blocks with identical validated structure.

Each numerical element must be written before it is read. Alignment padding remains zero, and the source tensor is unchanged.

◆ allocation_context()

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
decltype(auto) uni20::BlockTensor< T, DomainType, CodomainType, Storage >::allocation_context ( ) const
inlinenoexcept

Return the leaf context used for compatible result allocations.

◆ async_block() [1/2]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
decltype(auto) uni20::BlockTensor< T, DomainType, CodomainType, Storage >::async_block ( key_type const &  key)
inline

Return the independently scheduled value for one stored key.

The returned Async<Tensor> owns the block's dependency timeline. Submitted work must retain a read or write buffer.

Parameters
keyStored logical block key.
Returns
Mutable async dense-block value.
Exceptions
std::out_of_rangeIf the key is not stored.

◆ async_block() [2/2]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
decltype(auto) uni20::BlockTensor< T, DomainType, CodomainType, Storage >::async_block ( key_type const &  key) const
inline

Return the independently scheduled value for one stored key.

Parameters
keyStored logical block key.
Returns
Read-only async dense-block value.
Exceptions
std::out_of_rangeIf the key is not stored.

◆ async_block_by_ordinal() [1/2]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
decltype(auto) uni20::BlockTensor< T, DomainType, CodomainType, Storage >::async_block_by_ordinal ( std::size_t  ordinal)
inline

Return one independently scheduled value by stable canonical ordinal.

Parameters
ordinalPosition in stored_keys().
Returns
Mutable async dense-block value.
Exceptions
std::out_of_rangeIf ordinal is not a stored-block position.

◆ async_block_by_ordinal() [2/2]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
decltype(auto) uni20::BlockTensor< T, DomainType, CodomainType, Storage >::async_block_by_ordinal ( std::size_t  ordinal) const
inline

Return one independently scheduled value by stable canonical ordinal.

Parameters
ordinalPosition in stored_keys().
Returns
Read-only async dense-block value.
Exceptions
std::out_of_rangeIf ordinal is not a stored-block position.

◆ backend_selector()

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
static constexpr auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::backend_selector ( ) -> backend_selector_type
inlinestaticconstexprnoexcept

Return the default dense-leaf backend selector for this storage.

◆ block() [1/2]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::block ( key_type const &  key) -> mutable_block_type
inline

Return a writable stored block.

Exceptions
std::out_of_rangeIf the key is not stored.

◆ block() [2/2]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::block ( key_type const &  key) const -> const_block_type
inline

Return a read-only stored block.

Exceptions
std::out_of_rangeIf the key is not stored.

◆ block_by_ordinal() [1/2]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::block_by_ordinal ( std::size_t  ordinal) -> mutable_block_type
inline

Return a writable block TensorView by stable canonical ordinal.

Parameters
ordinalPosition in stored_keys().
Returns
TensorView whose mdspec is selected by storage.
Exceptions
std::out_of_rangeIf ordinal is not a stored-block position.

◆ block_by_ordinal() [2/2]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::block_by_ordinal ( std::size_t  ordinal) const -> const_block_type
inline

Return a read-only block TensorView by stable canonical ordinal.

Parameters
ordinalPosition in stored_keys().
Returns
TensorView whose mdspec is selected by storage.
Exceptions
std::out_of_rangeIf ordinal is not a stored-block position.

◆ codomain()

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::codomain ( ) const -> codomain_type const&
inline

Return the ordered codomain value.

◆ contains()

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::contains ( key_type const &  key) const -> bool
inline

Return whether a key has an allocated numerical block.

◆ dense_block_order()

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
static constexpr auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::dense_block_order ( ) -> std::size_t
inlinestaticconstexprnoexcept

Return the dense mdspan order of each numerical block.

◆ diagonal_values() [1/2]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
decltype(auto) uni20::BlockTensor< T, DomainType, CodomainType, Storage >::diagonal_values ( key_type const &  key)
inline

Return the compressed writable diagonal values for one stored key.

This member is available only when the storage policy exposes generalized diagonal blocks.

Exceptions
std::out_of_rangeIf the key is not stored.

◆ diagonal_values() [2/2]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
decltype(auto) uni20::BlockTensor< T, DomainType, CodomainType, Storage >::diagonal_values ( key_type const &  key) const
inline

Return the compressed read-only diagonal values for one stored key.

This member is available only when the storage policy exposes generalized diagonal blocks.

Exceptions
std::out_of_rangeIf the key is not stored.

◆ diagonal_values_by_ordinal() [1/2]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
decltype(auto) uni20::BlockTensor< T, DomainType, CodomainType, Storage >::diagonal_values_by_ordinal ( std::size_t  ordinal)
inline

Return compressed writable diagonal values by stable block ordinal.

Exceptions
std::out_of_rangeIf ordinal is not a stored-block position.

◆ diagonal_values_by_ordinal() [2/2]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
decltype(auto) uni20::BlockTensor< T, DomainType, CodomainType, Storage >::diagonal_values_by_ordinal ( std::size_t  ordinal) const
inline

Return compressed read-only diagonal values by stable block ordinal.

Exceptions
std::out_of_rangeIf ordinal is not a stored-block position.

◆ domain()

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::domain ( ) const -> domain_type const&
inline

Return the ordered domain value.

◆ find_block() [1/2]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::find_block ( key_type const &  key) -> std::optional<mutable_block_type>
inline

Find a writable block without changing tensor structure.

◆ find_block() [2/2]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::find_block ( key_type const &  key) const -> std::optional<const_block_type>
inline

Find a read-only block without changing tensor structure.

◆ has_all_legal_blocks()

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::has_all_legal_blocks ( ) const -> bool
inline

Return whether this value currently stores every legal block.

Note
This observation does not change the storage policy's compile-time completeness guarantee.

◆ is_legal()

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::is_legal ( key_type const &  key) const -> bool
inline

Return whether a key is in range and satisfies charge conservation.

◆ key_coordinate_count()

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
static constexpr auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::key_coordinate_count ( ) -> std::size_t
inlinestaticconstexprnoexcept

Return the number of coordinates stored in each block key.

◆ legal_block_count()

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::legal_block_count ( ) const -> std::size_t
inline

Return the number of symmetry-legal blocks.

◆ legal_block_keys()

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::legal_block_keys ( ) const -> std::vector<key_type>
inline

Enumerate every symmetry-legal block key in canonical order.

This scans the full Cartesian product of key-bearing boundary factors and filters it through the selection rule. It is intended for structural planning and explicit sparse materialization, not repeated hot-path queries.

◆ order()

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
static constexpr auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::order ( ) -> std::size_t
inlinestaticconstexprnoexcept

Return the compile-time tensor order.

◆ storage() [1/2]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::storage ( ) const -> storage_type const&
inlinenoexcept

Return the concrete storage value.

◆ storage() [2/2]

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::storage ( ) -> storage_type&
inlinenoexcept

Return the concrete storage value.

◆ stored_block_count()

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::stored_block_count ( ) const -> std::size_t
inlinenoexcept

Return the number of stored blocks.

◆ stored_keys()

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::stored_keys ( ) const -> std::span<key_type const>
inlinenoexcept

Return stored keys in canonical lexicographic order.

◆ symmetry()

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
auto uni20::BlockTensor< T, DomainType, CodomainType, Storage >::symmetry ( ) const -> Symmetry
inline

Return the explicit symmetry context.

Member Data Documentation

◆ static_dense_block_order

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
constexpr std::size_t uni20::BlockTensor< T, DomainType, CodomainType, Storage >::static_dense_block_order
staticconstexpr
Initial value:
=
detail::BoundaryBlockShape<domain_type>::dense_block_order +
detail::BoundaryBlockShape<codomain_type>::dense_block_order

◆ static_key_coordinate_count

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
constexpr std::size_t uni20::BlockTensor< T, DomainType, CodomainType, Storage >::static_key_coordinate_count
staticconstexpr
Initial value:
=
detail::BoundaryBlockShape<domain_type>::key_coordinate_count +
detail::BoundaryBlockShape<codomain_type>::key_coordinate_count

◆ static_order

template<typename T , class DomainType , class CodomainType , BlockTensorStorage Storage>
constexpr std::size_t uni20::BlockTensor< T, DomainType, CodomainType, Storage >::static_order = domain_type::size() + codomain_type::size()
staticconstexpr

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