Template Class IrrepContext

Class Documentation

template<IrrepAlgebra A>
class IrrepContext

Combines an IRREP algebra with a resolver that determines the IRREPs of leaf tensors. Objects of this type are the context needed to determine the IRREPs of arbitrary expressions via irreps_of.

Public Types

using algebra_type = A
using irrep_type = typename A::irrep_type
using set_type = IrrepSet<irrep_type>
using resolver_type = std::function<set_type(const Tensor&)>
using variable_resolver_type = std::function<std::optional<set_type>(const Variable&)>
using parser_type = std::function<irrep_type(std::string_view)>

Public Functions

inline IrrepContext(A algebra, resolver_type resolver, parser_type parser = {}, variable_resolver_type variable_resolver = {})
Parameters:
  • parser – Converts the name of an IRREP into the IRREP. Only needed for canonical_irrep.

  • variable_resolver – Determines the IRREPs of scalar variables. Variables for which it returns no value (or all, if not given) are totally symmetric.

inline explicit IrrepContext(resolver_type resolver)
inline const A &algebra() const
inline const resolver_type &resolver() const
inline set_type irreps_of(const Tensor &tensor) const
Returns:

The IRREPs of the given (leaf) tensor. Tensors with reserved labels (Kronecker delta, overlap, (anti)symmetrizers, reference densities, …) are considered to be totally symmetric. All others are handed to the resolver.

inline set_type irreps_of(const Variable &variable) const
Returns:

The IRREPs of the given variable. Unless the variable resolver says otherwise, variables are totally symmetric.

inline set_type totally_symmetric() const
inline bool is_totally_symmetric(const set_type &set) const
Returns:

Whether the given set contains nothing but the totally symmetric IRREP

inline irrep_type canonical_irrep(std::string_view name) const
Throws:

Exception – if this context has no parser or if the name does not refer to exactly one IRREP

Returns:

The IRREP of the given name in the algebra’s canonical form (e.g. with relations between IRREPs applied)

inline set_type empty_set() const
inline set_type any_set() const
Returns:

the set of every IRREP

inline set_type product(const set_type &lhs, const set_type &rhs) const
inline set_type conjugate(const set_type &set) const