Class IndexSpace¶
Defined in File space.hpp
Nested Relationships¶
Nested Types¶
Class Documentation¶
-
class IndexSpace¶
a collection of attributes which define a space of (1-particle) states
IndexSpace has a base_label, TypeAttr or interpretable bitset in the context of other spaces. IndexSpace may also have QuantumNumberAttr which differentiate spaces with different quanta, such as spin projection quantum numbers. IndexSpace may additionally have an approximate extent which is useful in symbolic manipulation of indexed expressions, such as tensor network evaluation.
Public Functions
-
inline QuantumNumbers qns() const noexcept¶
-
IndexSpace() noexcept = default¶
Default ctor creates null space (with null label, type and quantum numbers)
-
inline explicit operator bool() const¶
-
template<basic_string_convertible S>
inline IndexSpace(S &&type_label, TypeAttr typeattr, QuantumNumbersAttr qnattr = QuantumNumbersAttr{0}, unsigned long approximate_size = 10)¶
-
explicit IndexSpace(std::string_view label)¶
-
explicit IndexSpace(std::wstring_view label)¶
-
IndexSpace(const IndexSpace &other) = default¶
-
inline IndexSpace(IndexSpace &&other) noexcept¶
move constructor
- Parameters:
other – [inout] on output is null
- Post:
state of this object is identical to the input state of
other
-
IndexSpace &operator=(const IndexSpace &other) = default¶
-
inline IndexSpace &operator=(IndexSpace &&other)¶
move constructor
- Parameters:
other – [inout] on output is null
- Post:
state of this object is identical to the input state of
other
-
inline const std::wstring &base_key() const¶
-
inline std::size_t approximate_size() const¶
- Returns:
approximate size of a space
-
inline void approximate_size(size_t n)¶
Set the approximate size of a space.
Public Static Functions
-
static inline std::wstring_view reduce_key(std::wstring_view key)¶
-
static inline std::wstring reduce_key(std::string_view key)¶
Public Static Attributes
-
static const IndexSpace null¶
Friends
-
friend constexpr bool operator==(IndexSpace const&, IndexSpace const&) noexcept¶
IndexSpace are equal if they have equal
IndexSpace::attr()andIndexSpace::base_key().
-
friend constexpr std::strong_ordering operator<=>(const IndexSpace &s1, const IndexSpace &s2) noexcept¶
IndexSpace is ordered by its attributes and (if attributes are default, i.e., reserved) by labels
-
struct Attr : public sequant::TypeAttr, public sequant::QuantumNumbersAttr¶
Attr describes all attributes of a space (occupancy + quantum numbers)
Public Functions
-
inline Attr(TypeAttr type, QuantumNumbersAttr qns) noexcept¶
-
inline Attr(int32_t type, int32_t qns) noexcept¶
-
inline constexpr const QuantumNumbersAttr &qns() const¶
-
inline constexpr QuantumNumbersAttr &qns()¶
-
inline explicit constexpr operator int64_t() const¶
-
inline Attr unIon(Attr other) const¶
union of Attr = union of TypeAttr and union of QuantumNumbersAttr
- Returns:
union of
*thisandother, i.e.*thisANDother
Public Static Attributes
-
static const Attr reserved = IndexSpace::Attr::make_reserved()¶
this Attr is reserved for creating default space used by Index that is distinct from the null space
-
inline Attr(TypeAttr type, QuantumNumbersAttr qns) noexcept¶
-
struct AttrCompare¶
Public Types
-
using is_transparent = void¶
Public Functions
-
inline bool operator()(const IndexSpace &a, const IndexSpace &b) const¶
-
inline bool operator()(const IndexSpace &a, const IndexSpace::Attr &b) const¶
-
inline bool operator()(const IndexSpace::Attr &a, const IndexSpace &b) const¶
-
using is_transparent = void¶
-
struct bad_key : public std::invalid_argument¶
exception type thrown when ancountered unknown/invalid IndexSpace::base_key() or Index::label()
-
struct KeyCompare¶
Public Types
-
using is_transparent = void¶
Public Functions
-
inline bool operator()(const IndexSpace &a, const IndexSpace &b) const¶
-
inline bool operator()(const std::wstring &a, const IndexSpace &b) const¶
-
inline bool operator()(const std::wstring_view &a, const IndexSpace &b) const¶
-
inline bool operator()(const IndexSpace &a, const std::wstring &b) const¶
-
inline bool operator()(const IndexSpace &a, const std::wstring_view &b) const¶
-
inline bool operator()(const std::wstring &a, const std::wstring &b) const¶
-
inline bool operator()(const std::wstring &a, const std::wstring_view &b) const¶
-
inline bool operator()(const std::wstring_view &a, const std::wstring &b) const¶
-
using is_transparent = void¶
-
inline QuantumNumbers qns() const noexcept¶