Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
uni20::LocalSpace Class Reference

Ordered local-state space whose quantum numbers may repeat. More...

#include <local_space.hpp>

Public Member Functions

auto begin () const
 Return an iterator to the first local state.
 
auto empty () const -> bool
 Return whether the local space has no states.
 
auto end () const
 Return an iterator past the last local state.
 
auto label () const -> std::string const &
 Return the semantic leg label.
 
 LocalSpace (QNumList const &qnums, std::string label={})
 Construct an immutable local space from a QNumList.
 
template<std::ranges::input_range QNums>
requires std::constructible_from<QNum, std::ranges::range_reference_t<QNums>>
 LocalSpace (Symmetry sym, QNums &&qnums, std::string label={})
 Construct a local space from an input range.
 
 LocalSpace (Symmetry sym, std::initializer_list< QNum > qnums, std::string label={})
 Construct a local space from an initializer list.
 
 LocalSpace (Symmetry sym, std::string label={})
 Construct an empty local space in an explicit symmetry.
 
auto operator== (LocalSpace const &other) const -> bool=default
 Compare symmetry, ordered local states, and label.
 
auto operator[] (std::size_t index) const -> QNum const &
 Return indexed local-state access.
 
auto qnums () const -> std::span< QNum const >
 Return the ordered local-state quantum numbers.
 
void set_label (std::string label)
 Replace the semantic leg label without changing the space structure.
 
auto size () const -> std::size_t
 Return the number of explicit local states.
 
auto symmetry () const -> Symmetry
 Return the symmetry shared by every local state.
 

Detailed Description

Ordered local-state space whose quantum numbers may repeat.

The symmetry and ordered quantum-number structure are immutable. The semantic leg label may be changed without altering that structure.

Constructor & Destructor Documentation

◆ LocalSpace() [1/4]

uni20::LocalSpace::LocalSpace ( Symmetry  sym,
std::string  label = {} 
)
inlineexplicit

Construct an empty local space in an explicit symmetry.

Parameters
symSymmetry context retained even for an empty state list.
labelSemantic leg label.

◆ LocalSpace() [2/4]

uni20::LocalSpace::LocalSpace ( Symmetry  sym,
std::initializer_list< QNum >  qnums,
std::string  label = {} 
)
inline

Construct a local space from an initializer list.

Parameters
symSymmetry shared by every local state.
qnumsOrdered local-state quantum numbers; repeated values are preserved.
labelSemantic leg label.

◆ LocalSpace() [3/4]

template<std::ranges::input_range QNums>
requires std::constructible_from<QNum, std::ranges::range_reference_t<QNums>>
uni20::LocalSpace::LocalSpace ( Symmetry  sym,
QNums &&  qnums,
std::string  label = {} 
)
inline

Construct a local space from an input range.

Template Parameters
QNumsInput range whose elements construct QNum.
Parameters
symSymmetry shared by every local state.
qnumsOrdered local-state quantum numbers; repeated values are preserved.
labelSemantic leg label.

◆ LocalSpace() [4/4]

uni20::LocalSpace::LocalSpace ( QNumList const &  qnums,
std::string  label = {} 
)
inlineexplicit

Construct an immutable local space from a QNumList.

Parameters
qnumsOrdered local-state quantum numbers and their symmetry.
labelSemantic leg label.

Member Function Documentation

◆ begin()

auto uni20::LocalSpace::begin ( ) const
inline

Return an iterator to the first local state.

Returns
Begin iterator.

◆ empty()

auto uni20::LocalSpace::empty ( ) const -> bool
inline

Return whether the local space has no states.

Returns
true when the local-state list is empty.

◆ end()

auto uni20::LocalSpace::end ( ) const
inline

Return an iterator past the last local state.

Returns
End iterator.

◆ label()

auto uni20::LocalSpace::label ( ) const -> std::string const&
inline

Return the semantic leg label.

Returns
Label, which may be empty.

◆ operator==()

auto uni20::LocalSpace::operator== ( LocalSpace const &  other) const -> bool=default
default

Compare symmetry, ordered local states, and label.

Parameters
otherOther local space.
Returns
true when structure and label are equal.

◆ operator[]()

auto uni20::LocalSpace::operator[] ( std::size_t  index) const -> QNum const&
inline

Return indexed local-state access.

Parameters
indexZero-based local-state index.
Returns
Quantum number at the requested index.

◆ qnums()

auto uni20::LocalSpace::qnums ( ) const -> std::span<QNum const>
inline

Return the ordered local-state quantum numbers.

Returns
Read-only span over the local-state list.

◆ set_label()

void uni20::LocalSpace::set_label ( std::string  label)
inline

Replace the semantic leg label without changing the space structure.

Parameters
labelNew label.

◆ size()

auto uni20::LocalSpace::size ( ) const -> std::size_t
inline

Return the number of explicit local states.

Returns
Local-state count.

◆ symmetry()

auto uni20::LocalSpace::symmetry ( ) const -> Symmetry
inline

Return the symmetry shared by every local state.

Returns
Local-space symmetry.

The documentation for this class was generated from the following file: