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

Ordered block space whose quantum-number sectors may repeat. More...

#include <irregular_space.hpp>

Public Member Functions

auto begin () const
 Return an iterator to the first block.
 
auto contains (QNum q) const -> bool
 Return whether any block carries the requested quantum number.
 
auto empty () const -> bool
 Return whether the space contains no blocks.
 
auto end () const
 Return an iterator past the last block.
 
template<std::ranges::input_range Sectors>
requires std::constructible_from<BlockSector, std::ranges::range_reference_t<Sectors>>
 IrregularSpace (Symmetry sym, Sectors &&sectors, std::string label={})
 Construct an irregular space from an input range.
 
 IrregularSpace (Symmetry sym, std::initializer_list< BlockSector > sectors, std::string label={})
 Construct an irregular space from an ordered block list.
 
 IrregularSpace (Symmetry sym, std::string label={})
 Construct an empty irregular space tied to one symmetry.
 
auto label () const -> std::string const &
 Return the semantic leg label.
 
auto operator== (IrregularSpace const &other) const -> bool=default
 Compare symmetry, ordered segmented blocks, and label.
 
auto operator[] (std::size_t index) const -> BlockSector const &
 Return indexed block access.
 
auto sectors () const -> std::span< BlockSector const >
 Return the ordered block list.
 
void set_label (std::string label)
 Replace the semantic leg label without changing block structure.
 
auto size () const -> std::size_t
 Return the number of stored blocks.
 
auto symmetry () const -> Symmetry
 Return the symmetry shared by all blocks.
 
auto total_dim () const -> std::size_t
 Return the total dimension across all blocks.
 

Detailed Description

Ordered block space whose quantum-number sectors may repeat.

IrregularSpace preserves construction order and segmentation. Its structure is immutable, while its semantic leg label is mutable.

Constructor & Destructor Documentation

◆ IrregularSpace() [1/3]

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

Construct an empty irregular space tied to one symmetry.

Parameters
symSymmetry carried by every block.
labelSemantic leg label.

◆ IrregularSpace() [2/3]

uni20::IrregularSpace::IrregularSpace ( Symmetry  sym,
std::initializer_list< BlockSector >  sectors,
std::string  label = {} 
)
inline

Construct an irregular space from an ordered block list.

Parameters
symSymmetry carried by every block.
sectorsOrdered blocks; repeated quantum numbers are preserved.
labelSemantic leg label.

◆ IrregularSpace() [3/3]

template<std::ranges::input_range Sectors>
requires std::constructible_from<BlockSector, std::ranges::range_reference_t<Sectors>>
uni20::IrregularSpace::IrregularSpace ( Symmetry  sym,
Sectors &&  sectors,
std::string  label = {} 
)
inline

Construct an irregular space from an input range.

Template Parameters
SectorsInput range whose elements construct BlockSector.
Parameters
symSymmetry carried by every block.
sectorsOrdered blocks; repeated quantum numbers are preserved.
labelSemantic leg label.

Member Function Documentation

◆ begin()

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

Return an iterator to the first block.

Returns
Begin iterator.

◆ contains()

auto uni20::IrregularSpace::contains ( QNum  q) const -> bool
inline

Return whether any block carries the requested quantum number.

Parameters
qQuantum number to search for.
Returns
true when at least one matching block exists.

◆ empty()

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

Return whether the space contains no blocks.

Returns
true when the ordered block list is empty.

◆ end()

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

Return an iterator past the last block.

Returns
End iterator.

◆ label()

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

Return the semantic leg label.

Returns
Label, which may be empty.

◆ operator==()

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

Compare symmetry, ordered segmented blocks, and label.

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

◆ operator[]()

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

Return indexed block access.

Parameters
indexZero-based block index.
Returns
Block at the requested position.

◆ sectors()

auto uni20::IrregularSpace::sectors ( ) const -> std::span<BlockSector const>
inline

Return the ordered block list.

Returns
Read-only span over the blocks.

◆ set_label()

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

Replace the semantic leg label without changing block structure.

Parameters
labelNew label.

◆ size()

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

Return the number of stored blocks.

Returns
Block count.

◆ symmetry()

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

Return the symmetry shared by all blocks.

Returns
Irregular-space symmetry.

◆ total_dim()

auto uni20::IrregularSpace::total_dim ( ) const -> std::size_t
inline

Return the total dimension across all blocks.

Returns
Sum of all block dimensions.

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