Template Class IrrepSet

Class Documentation

template<typename Irrep>
class IrrepSet

A set of IRREPs, i.e. the representation of a quantity spanning several IRREPs (as a direct sum). Besides holding a concrete (possibly empty) list of IRREPs, a set may also be in the special “any” state that represents a quantity of unknown symmetry (spanning all IRREPs of the group). The “any” state is absorbing under unification and under multiplication with a non-empty set. An empty set is the zero of the multiplication.

Public Types

using value_type = Irrep
using container_type = container::svector<Irrep, 2>
using const_iterator = typename container_type::const_iterator

Public Functions

IrrepSet() = default

Creates an empty set.

inline IrrepSet(std::initializer_list<Irrep> irreps)
inline bool is_any() const
inline bool empty() const
Returns:

Whether this set contains no IRREP at all. A set in the “any” state is not empty.

inline std::size_t size() const
Returns:

The amount of explicitly stored IRREPs (zero in the “any” state)

inline bool contains(const Irrep &irrep) const
Returns:

Whether the given IRREP is part of this set. Any IRREP is part of a set in the “any” state.

inline IrrepSet &insert(Irrep irrep)

Adds the given IRREP to this set.

inline IrrepSet &unite(const IrrepSet &other)

Turns this set into the union of itself and the given set.

inline const_iterator begin() const

Iteration over the explicitly stored IRREPs (in ascending order). A set in the “any” state doesn’t store any IRREPs explicitly.

inline const_iterator end() const

Public Static Functions

static inline IrrepSet any()
Returns:

A set spanning any (all) IRREPs

Friends

inline friend bool operator==(const IrrepSet &lhs, const IrrepSet &rhs)
inline friend auto operator<=>(const IrrepSet &lhs, const IrrepSet &rhs)