Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
uni20::tensor_network::RabcContractionPlan< Scalar, RKey, AKey, BKey, CKey > Class Template Reference

Immutable sparse coefficient tensor for an R/A/B/C contraction. More...

#include <rabc_contraction_plan.hpp>

Public Types

using a_key_type = AKey
 
using b_key_type = BKey
 
using c_key_type = CKey
 
using r_key_type = RKey
 
using scalar_type = Scalar
 
using term_type = RabcTerm< scalar_type >
 

Public Member Functions

auto a_keys () const noexcept -> std::span< a_key_type const >
 Return left-environment logical keys addressed by term indices.
 
auto b_keys () const noexcept -> std::span< b_key_type const >
 Return input-center logical keys addressed by term indices.
 
auto c_keys () const noexcept -> std::span< c_key_type const >
 Return right-environment logical keys addressed by term indices.
 
auto r_keys () const noexcept -> std::span< r_key_type const >
 Return output logical keys addressed by term indices.
 
 RabcContractionPlan ()=default
 Construct an empty sparse coefficient plan.
 
 RabcContractionPlan (std::vector< r_key_type > r_keys, std::vector< a_key_type > a_keys, std::vector< b_key_type > b_keys, std::vector< c_key_type > c_keys, std::vector< term_type > terms)
 Retain logical key tables and canonicalize sparse coefficients.
 
auto term_count () const noexcept -> std::size_t
 Return the number of canonical nonzero terms.
 
auto terms () const noexcept -> std::span< term_type const >
 Return the canonical nonzero terms.
 

Detailed Description

template<uni20::RealOrComplex Scalar, class RKey, class AKey, class BKey, class CKey>
class uni20::tensor_network::RabcContractionPlan< Scalar, RKey, AKey, BKey, CKey >

Immutable sparse coefficient tensor for an R/A/B/C contraction.

The four sorted key tables provide logical block identity relative to the symmetry and boundaries for which the caller constructs the plan. Terms index those tables and are canonicalized by (r,a,b,c); duplicate coefficients are summed and exact zeros are omitted. Storage ordinals and placement are resolved only during backend preparation. The plan contains no left-first, right-first, placement, or communication decisions. Binding a plan to operands with different symmetry or boundary semantics violates the contraction precondition; the plan deliberately does not retain or compare that metadata at runtime.

Template Parameters
ScalarReal or complex coefficient type.
RKeyOutput logical block-key type.
AKeyLeft-environment logical block-key type.
BKeyInput-center logical block-key type.
CKeyRight-environment logical block-key type.

Member Typedef Documentation

◆ a_key_type

template<uni20::RealOrComplex Scalar, class RKey , class AKey , class BKey , class CKey >
using uni20::tensor_network::RabcContractionPlan< Scalar, RKey, AKey, BKey, CKey >::a_key_type = AKey

◆ b_key_type

template<uni20::RealOrComplex Scalar, class RKey , class AKey , class BKey , class CKey >
using uni20::tensor_network::RabcContractionPlan< Scalar, RKey, AKey, BKey, CKey >::b_key_type = BKey

◆ c_key_type

template<uni20::RealOrComplex Scalar, class RKey , class AKey , class BKey , class CKey >
using uni20::tensor_network::RabcContractionPlan< Scalar, RKey, AKey, BKey, CKey >::c_key_type = CKey

◆ r_key_type

template<uni20::RealOrComplex Scalar, class RKey , class AKey , class BKey , class CKey >
using uni20::tensor_network::RabcContractionPlan< Scalar, RKey, AKey, BKey, CKey >::r_key_type = RKey

◆ scalar_type

template<uni20::RealOrComplex Scalar, class RKey , class AKey , class BKey , class CKey >
using uni20::tensor_network::RabcContractionPlan< Scalar, RKey, AKey, BKey, CKey >::scalar_type = Scalar

◆ term_type

template<uni20::RealOrComplex Scalar, class RKey , class AKey , class BKey , class CKey >
using uni20::tensor_network::RabcContractionPlan< Scalar, RKey, AKey, BKey, CKey >::term_type = RabcTerm<scalar_type>

Constructor & Destructor Documentation

◆ RabcContractionPlan() [1/2]

template<uni20::RealOrComplex Scalar, class RKey , class AKey , class BKey , class CKey >
uni20::tensor_network::RabcContractionPlan< Scalar, RKey, AKey, BKey, CKey >::RabcContractionPlan ( )
default

Construct an empty sparse coefficient plan.

◆ RabcContractionPlan() [2/2]

template<uni20::RealOrComplex Scalar, class RKey , class AKey , class BKey , class CKey >
uni20::tensor_network::RabcContractionPlan< Scalar, RKey, AKey, BKey, CKey >::RabcContractionPlan ( std::vector< r_key_type >  r_keys,
std::vector< a_key_type >  a_keys,
std::vector< b_key_type >  b_keys,
std::vector< c_key_type >  c_keys,
std::vector< term_type >  terms 
)
inline

Retain logical key tables and canonicalize sparse coefficients.

Parameters
r_keysSorted unique output logical keys.
a_keysSorted unique left-environment logical keys.
b_keysSorted unique input-center logical keys.
c_keysSorted unique right-environment logical keys.
termsPossibly unordered terms with possible duplicate coordinates.

Member Function Documentation

◆ a_keys()

template<uni20::RealOrComplex Scalar, class RKey , class AKey , class BKey , class CKey >
auto uni20::tensor_network::RabcContractionPlan< Scalar, RKey, AKey, BKey, CKey >::a_keys ( ) const -> std::span<a_key_type const>
inlinenoexcept

Return left-environment logical keys addressed by term indices.

◆ b_keys()

template<uni20::RealOrComplex Scalar, class RKey , class AKey , class BKey , class CKey >
auto uni20::tensor_network::RabcContractionPlan< Scalar, RKey, AKey, BKey, CKey >::b_keys ( ) const -> std::span<b_key_type const>
inlinenoexcept

Return input-center logical keys addressed by term indices.

◆ c_keys()

template<uni20::RealOrComplex Scalar, class RKey , class AKey , class BKey , class CKey >
auto uni20::tensor_network::RabcContractionPlan< Scalar, RKey, AKey, BKey, CKey >::c_keys ( ) const -> std::span<c_key_type const>
inlinenoexcept

Return right-environment logical keys addressed by term indices.

◆ r_keys()

template<uni20::RealOrComplex Scalar, class RKey , class AKey , class BKey , class CKey >
auto uni20::tensor_network::RabcContractionPlan< Scalar, RKey, AKey, BKey, CKey >::r_keys ( ) const -> std::span<r_key_type const>
inlinenoexcept

Return output logical keys addressed by term indices.

◆ term_count()

template<uni20::RealOrComplex Scalar, class RKey , class AKey , class BKey , class CKey >
auto uni20::tensor_network::RabcContractionPlan< Scalar, RKey, AKey, BKey, CKey >::term_count ( ) const -> std::size_t
inlinenoexcept

Return the number of canonical nonzero terms.

◆ terms()

template<uni20::RealOrComplex Scalar, class RKey , class AKey , class BKey , class CKey >
auto uni20::tensor_network::RabcContractionPlan< Scalar, RKey, AKey, BKey, CKey >::terms ( ) const -> std::span<term_type const>
inlinenoexcept

Return the canonical nonzero terms.


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