|
Uni20
Asynchronous tensor and runtime library.
|
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() |
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.
| T | Numerical block element type. |
| DomainType | Ordered domain value type. |
| CodomainType | Ordered codomain value type. |
| Storage | Block storage policy. Sparse policies accept an explicit key set; complete policies derive every legal key. |
| using uni20::BlockTensor< T, DomainType, CodomainType, Storage >::backend_selector_type = typename storage_policy::backend_selector_type |
| using uni20::BlockTensor< T, DomainType, CodomainType, Storage >::codomain_type = CodomainType |
| using uni20::BlockTensor< T, DomainType, CodomainType, Storage >::const_block_type = typename storage_type::const_block_type |
| using uni20::BlockTensor< T, DomainType, CodomainType, Storage >::domain_type = DomainType |
| using uni20::BlockTensor< T, DomainType, CodomainType, Storage >::element_type = T |
| using uni20::BlockTensor< T, DomainType, CodomainType, Storage >::key_type = BlockKey<static_key_coordinate_count> |
| using uni20::BlockTensor< T, DomainType, CodomainType, Storage >::mutable_block_type = typename storage_type::mutable_block_type |
| using uni20::BlockTensor< T, DomainType, CodomainType, Storage >::storage_policy = 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> |
| using uni20::BlockTensor< T, DomainType, CodomainType, Storage >::value_type = std::remove_cv_t<T> |
|
inline |
Construct zero-initialized sparse blocks from an explicit stored-key list.
| symmetry | Explicit tensor symmetry context. |
| domain | Ordered domain spaces. |
| codomain | Ordered codomain spaces. |
| stored_keys | Legal keys to allocate; order is canonicalized. |
|
inline |
Construct a sparse tensor in an explicit leaf allocation context.
|
inline |
Construct a sparse tensor from an initializer list of stored keys.
| symmetry | Explicit tensor symmetry context. |
| domain | Ordered domain spaces. |
| codomain | Ordered codomain spaces. |
| stored_keys | Legal keys to allocate; order is canonicalized. |
|
inline |
Construct zero-initialized blocks for every symmetry-legal key.
| symmetry | Explicit tensor symmetry context. |
| domain | Ordered domain spaces. |
| codomain | Ordered codomain spaces. |
|
inline |
Construct a complete tensor in an explicit leaf allocation context.
|
inline |
Allocate uninitialized sparse blocks from an explicit stored-key list.
| symmetry | Explicit tensor symmetry context. |
| domain | Ordered domain spaces. |
| codomain | Ordered codomain spaces. |
| stored_keys | Legal keys to allocate; order is canonicalized. |
|
inline |
Allocate uninitialized sparse blocks in an explicit leaf allocation context.
|
inline |
Allocate uninitialized sparse blocks from an initializer list of stored keys.
| symmetry | Explicit tensor symmetry context. |
| domain | Ordered domain spaces. |
| codomain | Ordered codomain spaces. |
| stored_keys | Legal keys to allocate; order is canonicalized. |
|
inline |
Allocate every symmetry-legal block without numerical initialization.
| symmetry | Explicit tensor symmetry context. |
| domain | Ordered domain spaces. |
| codomain | Ordered codomain spaces. |
|
inline |
Allocate uninitialized complete blocks in an explicit leaf allocation context.
|
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.
|
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.
|
inlinenoexcept |
Return the leaf context used for compatible result allocations.
|
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.
| key | Stored logical block key. |
| std::out_of_range | If the key is not stored. |
|
inline |
Return the independently scheduled value for one stored key.
| key | Stored logical block key. |
| std::out_of_range | If the key is not stored. |
|
inline |
Return one independently scheduled value by stable canonical ordinal.
| ordinal | Position in stored_keys(). |
| std::out_of_range | If ordinal is not a stored-block position. |
|
inline |
Return one independently scheduled value by stable canonical ordinal.
| ordinal | Position in stored_keys(). |
| std::out_of_range | If ordinal is not a stored-block position. |
|
inlinestaticconstexprnoexcept |
Return the default dense-leaf backend selector for this storage.
|
inline |
Return a writable stored block.
| std::out_of_range | If the key is not stored. |
|
inline |
Return a read-only stored block.
| std::out_of_range | If the key is not stored. |
|
inline |
Return a writable block TensorView by stable canonical ordinal.
| ordinal | Position in stored_keys(). |
| std::out_of_range | If ordinal is not a stored-block position. |
|
inline |
Return a read-only block TensorView by stable canonical ordinal.
| ordinal | Position in stored_keys(). |
| std::out_of_range | If ordinal is not a stored-block position. |
|
inline |
Return the ordered codomain value.
|
inline |
Return whether a key has an allocated numerical block.
|
inlinestaticconstexprnoexcept |
Return the dense mdspan order of each numerical block.
|
inline |
Return the compressed writable diagonal values for one stored key.
This member is available only when the storage policy exposes generalized diagonal blocks.
| std::out_of_range | If the key is not stored. |
|
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.
| std::out_of_range | If the key is not stored. |
|
inline |
Return compressed writable diagonal values by stable block ordinal.
| std::out_of_range | If ordinal is not a stored-block position. |
|
inline |
Return compressed read-only diagonal values by stable block ordinal.
| std::out_of_range | If ordinal is not a stored-block position. |
|
inline |
Return the ordered domain value.
|
inline |
Find a writable block without changing tensor structure.
|
inline |
Find a read-only block without changing tensor structure.
|
inline |
Return whether this value currently stores every legal block.
|
inline |
Return whether a key is in range and satisfies charge conservation.
|
inlinestaticconstexprnoexcept |
Return the number of coordinates stored in each block key.
|
inline |
Return the number of symmetry-legal blocks.
|
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.
|
inlinestaticconstexprnoexcept |
Return the compile-time tensor order.
|
inlinenoexcept |
Return the concrete storage value.
|
inlinenoexcept |
Return the concrete storage value.
|
inlinenoexcept |
Return the number of stored blocks.
|
inlinenoexcept |
Return stored keys in canonical lexicographic order.
|
inline |
Return the explicit symmetry context.
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |