One irrep label together with the symmetry context needed to interpret it.
More...
#include <qnum.hpp>
|
| auto | operator== (QNum const &other) const -> bool=default |
| | Compare two quantum numbers for exact identity.
|
| |
| | QNum ()=default |
| | Construct an invalid quantum number.
|
| |
| | QNum (Symmetry sym, std::uint64_t code) |
| | Construct from a symmetry handle and a 63-bit inline packed code.
|
| |
| auto | raw_code () const -> std::uint64_t |
| | Return the inline packed irrep code.
|
| |
| auto | symmetry () const -> Symmetry |
| | Return the symmetry context of this quantum number.
|
| |
| auto | valid () const -> bool |
| | Return whether the quantum number carries a valid symmetry context.
|
| |
|
| auto | coerce (QNum const &, Symmetry) -> QNum |
| | Coerce a quantum number into a related symmetry by named components.
|
| |
| auto | degree (QNum const &) -> int |
| | Return the integral degree of a quantum number.
|
| |
| auto | dual (QNum const &) -> QNum |
| | Return the dual irrep of a quantum number.
|
| |
| auto | is_identity (QNum const &) -> bool |
| | Return whether a quantum number is the identity irrep.
|
| |
| auto | make_qnum (Symmetry, std::initializer_list< std::pair< std::string_view, U1 > >) -> QNum |
| | Construct a packed QNum from named U(1) component values.
|
| |
| auto | operator+ (QNum const &, QNum const &) -> QNum |
| | Add two quantum numbers when the fusion result is uniquely defined.
|
| |
| auto | qdim (QNum const &) -> double |
| | Return the quantum dimension of a quantum number.
|
| |
| auto | to_string (QNum const &) -> std::string |
| | Format a quantum number as comma-separated named components.
|
| |
| auto | u1_component (QNum const &, std::string_view) -> U1 |
| | Read one named U(1) component from a quantum number.
|
| |
One irrep label together with the symmetry context needed to interpret it.
QNum is the packed runtime label used by the tensor code. See docs/symmetry/qnum.md.
◆ QNum() [1/2]
Construct an invalid quantum number.
◆ QNum() [2/2]
| uni20::QNum::QNum |
( |
Symmetry |
sym, |
|
|
std::uint64_t |
code |
|
) |
| |
|
inlineexplicit |
Construct from a symmetry handle and a 63-bit inline packed code.
- Parameters
-
| sym | Symmetry context. |
| code | Inline packed irrep code. Bit 63 is reserved for an out-of-line representation. |
◆ identity()
Return the identity irrep of a given symmetry.
- Parameters
-
- Returns
- Identity quantum number.
◆ operator==()
| auto uni20::QNum::operator== |
( |
QNum const & |
other | ) |
const -> bool=default |
|
default |
Compare two quantum numbers for exact identity.
- Parameters
-
| other | Other quantum number. |
- Returns
true if both symmetry context and packed code match.
◆ raw_code()
| auto uni20::QNum::raw_code |
( |
| ) |
const -> std::uint64_t
|
|
inline |
Return the inline packed irrep code.
- Returns
- Canonical code in the low 63 bits.
◆ symmetry()
| auto uni20::QNum::symmetry |
( |
| ) |
const -> Symmetry
|
|
inline |
Return the symmetry context of this quantum number.
- Returns
- Symmetry handle corresponding to this quantum number.
◆ valid()
| auto uni20::QNum::valid |
( |
| ) |
const -> bool |
|
inline |
Return whether the quantum number carries a valid symmetry context.
- Returns
true if this quantum number is initialized.
◆ coerce
Coerce a quantum number into a related symmetry by named components.
- Parameters
-
| q | Source quantum number. |
| target | Target symmetry. |
- Returns
- Coerced quantum number in the target symmetry.
◆ degree
| auto degree |
( |
QNum const & |
q | ) |
-> int |
|
friend |
Return the integral degree of a quantum number.
- Parameters
-
| q | Quantum number to inspect. |
- Returns
- Product of factor degrees.
◆ dual
Return the dual irrep of a quantum number.
- Parameters
-
| q | Quantum number to dualize. |
- Returns
- Dual quantum number in the same symmetry.
◆ is_identity
| auto is_identity |
( |
QNum const & |
q | ) |
-> bool |
|
friend |
Return whether a quantum number is the identity irrep.
- Parameters
-
- Returns
true if every factor is the identity.
◆ make_qnum
| auto make_qnum |
( |
Symmetry |
sym, |
|
|
std::initializer_list< std::pair< std::string_view, U1 > > |
values |
|
) |
| -> QNum |
|
friend |
Construct a packed QNum from named U(1) component values.
- Parameters
-
| sym | Target symmetry. |
| values | Named component assignments. Missing components default to the identity. |
- Returns
- Packed quantum number in the requested symmetry.
◆ operator+
| auto operator+ |
( |
QNum const & |
lhs, |
|
|
QNum const & |
rhs |
|
) |
| -> QNum |
|
friend |
Add two quantum numbers when the fusion result is uniquely defined.
- Parameters
-
| lhs | Left operand. |
| rhs | Right operand. |
- Returns
- Sum in the shared symmetry context.
◆ qdim
| auto qdim |
( |
QNum const & |
q | ) |
-> double |
|
friend |
Return the quantum dimension of a quantum number.
- Parameters
-
| q | Quantum number to inspect. |
- Returns
- Product of factor quantum dimensions.
◆ to_string
| auto to_string |
( |
QNum const & |
q | ) |
-> std::string |
|
friend |
Format a quantum number as comma-separated named components.
- Parameters
-
| q | Quantum number to format. |
- Returns
- Human-readable string form.
◆ u1_component
| auto u1_component |
( |
QNum const & |
q, |
|
|
std::string_view |
name |
|
) |
| -> U1 |
|
friend |
Read one named U(1) component from a quantum number.
- Parameters
-
| q | Quantum number to decode. |
| name | Name of the requested symmetry component. |
- Returns
- U(1) charge for that component.
The documentation for this class was generated from the following file: