Class QuantumNumbersAttr

Inheritance Relationships

Derived Type

Class Documentation

class QuantumNumbersAttr

denotes other quantum numbers (particle type, spin, etc.)

Subclassed by sequant::IndexSpace::Attr

Public Functions

constexpr QuantumNumbersAttr() noexcept = default

default ctor creates a null QuantumNumbersAttr

Post:

static_cast<bool>(*this) == false

inline explicit constexpr QuantumNumbersAttr(bitset_t bitset) noexcept

Constructs from a bitset representation.

Warning

first (most significant) bit is reserved for internal use

Parameters:

bitset – bitset representation of this Type

Pre:

(bitset & make_reserved().bitset()) == null.bitset()

template<typename QN, typename = std::enable_if_t<meta::is_statically_castable_v<std::decay_t<QN>, bitset_t> && !std::is_same_v<std::decay_t<QN>, bool> && !std::is_same_v<std::decay_t<QN>, TypeAttr> && !std::is_same_v<std::decay_t<QN>, QuantumNumbersAttr>>>
inline constexpr QuantumNumbersAttr(QN &&value) noexcept
inline explicit constexpr operator int64_t() const
inline explicit constexpr operator bitset_t() const
inline constexpr int32_t to_int32() const
inline explicit constexpr operator bool() const
Returns:

true if this object is non-null (i.e. has any bits set)

inline constexpr QuantumNumbersAttr xOr(QuantumNumbersAttr other) const

Note

equivalent to this->to_int32() ^ other.to_int32()

Returns:

*this XOR other

inline constexpr QuantumNumbersAttr unIon(QuantumNumbersAttr other) const

Note

equivalent to this->to_int32() | other.to_int32()

Returns:

union of *this and other, i.e. *this AND other

inline constexpr QuantumNumbersAttr intersection(QuantumNumbersAttr other) const

Note

equivalent to this->to_int32() & other.to_int32()

Returns:

intersection of *this AND other

inline constexpr QuantumNumbersAttr operator~() const

Note

equivalent to ~this->to_int32()

Returns:

complement of *this

inline bool includes(QuantumNumbersAttr other) const
Returns:

true if other is included in this object

Public Static Attributes

static const QuantumNumbersAttr null

the null TypeAttr

Friends

inline friend constexpr QuantumNumbersAttr operator^(const QuantumNumbersAttr a, const QuantumNumbersAttr b)
Returns:

a XOR b

inline friend constexpr QuantumNumbersAttr operator|(const QuantumNumbersAttr a, const QuantumNumbersAttr b)
Returns:

union of a and b, i.e. a AND b

inline friend constexpr QuantumNumbersAttr operator&(const QuantumNumbersAttr a, const QuantumNumbersAttr b)
Returns:

intersection of a AND b

inline friend constexpr bool operator==(QuantumNumbersAttr lhs, QuantumNumbersAttr rhs)
inline friend constexpr bool operator!=(QuantumNumbersAttr lhs, QuantumNumbersAttr rhs)
inline friend constexpr bool operator<(QuantumNumbersAttr lhs, QuantumNumbersAttr rhs)
Returns:

true if in canonical order this object preceeds other