Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
qnum_space.hpp
Go to the documentation of this file.
1
7#pragma once
8
11
12#include <stdexcept>
13#include <string>
14#include <utility>
15
16namespace uni20
17{
18
20class QNumSpace {
21 public:
25 explicit QNumSpace(QNum qnum, std::string label = {}) : qnum_(qnum), label_(std::move(label))
26 {
27 if (!qnum_.valid())
28 {
29 throw std::invalid_argument("QNumSpace requires a valid quantum number");
30 }
31 }
32
35 auto symmetry() const -> Symmetry { return qnum_.symmetry(); }
36
39 auto qnum() const -> QNum const& { return qnum_; }
40
43 auto label() const -> std::string const& { return label_; }
44
47 void set_label(std::string label) { label_ = std::move(label); }
48
52 auto operator==(QNumSpace const& other) const -> bool = default;
53
54 private:
55 QNum qnum_;
56 std::string label_;
57};
58
59static_assert(SymmetrySpace<QNumSpace>);
60
61} // namespace uni20
Tensor space carrying one irreducible-representation label.
Definition qnum_space.hpp:20
auto symmetry() const -> Symmetry
Return the symmetry of the irrep label.
Definition qnum_space.hpp:35
void set_label(std::string label)
Replace the semantic leg label without changing the irrep.
Definition qnum_space.hpp:47
auto qnum() const -> QNum const &
Return the irrep label.
Definition qnum_space.hpp:39
auto operator==(QNumSpace const &other) const -> bool=default
Compare irrep and label.
QNumSpace(QNum qnum, std::string label={})
Construct a single-irrep space.
Definition qnum_space.hpp:25
auto label() const -> std::string const &
Return the semantic leg label.
Definition qnum_space.hpp:43
One irrep label together with the symmetry context needed to interpret it.
Definition qnum.hpp:29
auto symmetry() const -> Symmetry
Return the symmetry context of this quantum number.
Definition qnum.hpp:51
auto valid() const -> bool
Return whether the quantum number carries a valid symmetry context.
Definition qnum.hpp:47
Public handle to a canonicalized direct-product symmetry specification.
Definition symmetry.hpp:24
Space whose structure is interpreted in one explicit symmetry context.
Definition space.hpp:31
Definition qnum.hpp:403
Definition async/async.hpp:26
Defines packed quantum numbers and same-symmetry quantum-number containers.
Defines the common tensor-space concepts.