Xped
Loading...
Searching...
No Matches
Xped::Qbasis< Symmetry, depth, AllocationPolicy > Class Template Reference

#include <Qbasis.hpp>

Public Member Functions

 Qbasis ()=default
 
template<typename Container >
 Qbasis (const Container &qins, const size_t &dim)
 
qType getQ (const size_t &num) const
 
qType qn (std::size_t index) const
 
void remove (const qType &q)
 
qType maxQ () const
 
qType minQ () const
 
void truncate (const std::unordered_set< qType > &qs, const std::size_t &M)
 
size_t leftOffset (const FusionTree< depth, Symmetry > &tree, const std::array< size_t, depth > &plain=std::array< std::size_t, depth >()) const
 
size_t rightOffset (const FusionTree< depth, Symmetry > &tree, const std::array< size_t, depth > &plain=std::array< std::size_t, depth >()) const
 
void push_back (const qType &q, const size_t &inner_dim)
 
void push_back (const qType &q, const size_t &inner_dim, const TreeVector< depth > &tree)
 
void setRandom (const std::size_t &fullSize, const std::size_t &max_sectorSize=5ul)
 
void clear ()
 
Qbasis< Symmetry, depth+1, AllocationPolicy > combine (const Qbasis< Symmetry, 1, AllocationPolicy > &other, bool CONJ=false) const
 
Qbasis< Symmetry, depth, AllocationPolicy > add (const Qbasis< Symmetry, depth, AllocationPolicy > &other) const
 
std::pair< std::vector< std::size_t >, Qbasis< Symmetry, depth, AllocationPolicy > > shift (qType qshift) const
 
Qbasis< Symmetry, depth, AllocationPolicy > intersection (const Qbasis< Symmetry, depth, AllocationPolicy > &other) const
 
Qbasis< Symmetry, depth, AllocationPolicy > conj () const
 
Qbasis< Symmetry, 1, AllocationPolicy > forgetHistory () const
 
std::string print () const
 
std::string info () const
 
std::string printTrees () const
 
bool operator== (const Qbasis< Symmetry, depth, AllocationPolicy > &other) const
 
auto begin ()
 
auto end ()
 
auto cbegin () const
 
auto cend () const
 
std::vector< std::size_t > sort ()
 
bool IS_SORTED () const
 
bool IS_CONJ () const
 
void SET_CONJ ()
 
const auto & tree (const qType &q) const
 
TreeType & allTrees ()
 
template<typename Ar >
void serialize (Ar &ar)
 
std::size_t dim () const
 
std::size_t fullDim () const
 
std::size_t largestSector () const
 
std::size_t Nq () const
 
std::vector< qType > qs () const
 
std::unordered_set< qType > unordered_qs () const
 
std::vector< std::size_t > dims () const
 
bool IS_PRESENT (const qType &q) const
 
bool NOT_PRESENT (const qType &q) const
 
size_t inner_num (const size_t &outer_num) const
 
size_t inner_dim (const size_t &num_in) const
 
size_t inner_dim (const qType &q) const
 
size_t outer_num (const qType &q) const
 
size_t full_outer_num (const qType &q) const
 
size_t index (const qType &q) const
 

Static Public Member Functions

static Qbasis< Symmetry, 1, AllocationPolicy > TrivialBasis ()
 

Friends

template<typename Symmetry_ , std::size_t depth_, typename AllocationPolicy_ >
class Qbasis
 

Detailed Description

template<typename Symmetry, std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
class Xped::Qbasis< Symmetry, depth, AllocationPolicy >

\describe_Symmetry

This class is a container like class for a basis of a Hilbert space in which global symmetries are present. For each irreducible representation (irrep) of the global symmetry (for each quantum number), the states of the Hilbert states that transforms under that irrep are collected together in a plain Basis object.

One central function is the combine() method, which combine two instances of Qbasis to the tensor product basis, already proper sorted into irreps.

Constructor & Destructor Documentation

◆ Qbasis() [1/2]

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
Xped::Qbasis< Symmetry, depth, AllocationPolicy >::Qbasis ( )
default

Does nothing.

◆ Qbasis() [2/2]

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
template<typename Container >
Xped::Qbasis< Symmetry, depth, AllocationPolicy >::Qbasis ( const Container &  qins,
const size_t &  dim 
)
inline

Inserts all quantum numbers in the Container qins with constant dimension dim into the basis.

Here is the call graph for this function:

Member Function Documentation

◆ add()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
Qbasis< Symmetry, depth, AllocationPolicy > Xped::Qbasis< Symmetry, depth, AllocationPolicy >::add ( const Qbasis< Symmetry, depth, AllocationPolicy > &  other) const

Adds two bases together.

Here is the call graph for this function:

◆ allTrees()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
TreeType & Xped::Qbasis< Symmetry, depth, AllocationPolicy >::allTrees ( )
inline

◆ begin()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
auto Xped::Qbasis< Symmetry, depth, AllocationPolicy >::begin ( )
inline

◆ cbegin()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
auto Xped::Qbasis< Symmetry, depth, AllocationPolicy >::cbegin ( ) const
inline

◆ cend()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
auto Xped::Qbasis< Symmetry, depth, AllocationPolicy >::cend ( ) const
inline
Here is the caller graph for this function:

◆ clear()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
void Xped::Qbasis< Symmetry, depth, AllocationPolicy >::clear ( )
inline

Completely clear the basis.

◆ combine()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
Qbasis< Symmetry, depth+1, AllocationPolicy > Xped::Qbasis< Symmetry, depth, AllocationPolicy >::combine ( const Qbasis< Symmetry, 1, AllocationPolicy > &  other,
bool  CONJ = false 
) const

Returns the tensor product basis, already properly sorted with respect to the resulting irreps. This function also saves the history of the combination process for later use. See leftOffset() and rightOffset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ conj()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
Qbasis< Symmetry, depth, AllocationPolicy > Xped::Qbasis< Symmetry, depth, AllocationPolicy >::conj
Here is the call graph for this function:

◆ dim()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
std::size_t Xped::Qbasis< Symmetry, depth, AllocationPolicy >::dim ( ) const
inline

Returns the number of (reduced) basis states.

Here is the caller graph for this function:

◆ dims()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
std::vector< std::size_t > Xped::Qbasis< Symmetry, depth, AllocationPolicy >::dims ( ) const
inline
Here is the call graph for this function:

◆ end()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
auto Xped::Qbasis< Symmetry, depth, AllocationPolicy >::end ( )
inline

◆ forgetHistory()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
Qbasis< Symmetry, 1, AllocationPolicy > Xped::Qbasis< Symmetry, depth, AllocationPolicy >::forgetHistory
Here is the call graph for this function:

◆ full_outer_num()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
size_t Xped::Qbasis< Symmetry, depth, AllocationPolicy >::full_outer_num ( const qType &  q) const

Computes the total number with which the sector with quantum number q begins and takes into account the dimension of each irrep.

◆ fullDim()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
std::size_t Xped::Qbasis< Symmetry, depth, AllocationPolicy >::fullDim ( ) const
inline

Returns the full number of basis states. If irreps has internal states, the basis states transforming under this irreps are multiplied by this degeneracy.

◆ getQ()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
Symmetry::qType Xped::Qbasis< Symmetry, depth, AllocationPolicy >::getQ ( const size_t &  num) const

Returns the quantum number of the state with number num.

◆ index()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
size_t Xped::Qbasis< Symmetry, depth, AllocationPolicy >::index ( const qType &  q) const

Returns the index of a given quantum number.

Here is the caller graph for this function:

◆ info()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
std::string Xped::Qbasis< Symmetry, depth, AllocationPolicy >::info

Prints rough infob.

Here is the caller graph for this function:

◆ inner_dim() [1/2]

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
size_t Xped::Qbasis< Symmetry, depth, AllocationPolicy >::inner_dim ( const qType &  q) const

Computes the sector size of a state with quantum number q.

◆ inner_dim() [2/2]

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
size_t Xped::Qbasis< Symmetry, depth, AllocationPolicy >::inner_dim ( const size_t &  num_in) const

Computes the sector size of a state with number num_in.

Here is the caller graph for this function:

◆ inner_num()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
size_t Xped::Qbasis< Symmetry, depth, AllocationPolicy >::inner_num ( const size_t &  outer_num) const

Computes the number within the sector from the total number of the state

◆ intersection()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
Qbasis< Symmetry, depth, AllocationPolicy > Xped::Qbasis< Symmetry, depth, AllocationPolicy >::intersection ( const Qbasis< Symmetry, depth, AllocationPolicy > &  other) const

Returns the intersection of this and other.

Here is the call graph for this function:

◆ IS_CONJ()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
bool Xped::Qbasis< Symmetry, depth, AllocationPolicy >::IS_CONJ ( ) const
inline

◆ IS_PRESENT()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
bool Xped::Qbasis< Symmetry, depth, AllocationPolicy >::IS_PRESENT ( const qType &  q) const
inline

Checks whether states with quantum number q are in the basis. Returns true if the state is present.

Here is the caller graph for this function:

◆ IS_SORTED()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
bool Xped::Qbasis< Symmetry, depth, AllocationPolicy >::IS_SORTED ( ) const
inline

◆ largestSector()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
std::size_t Xped::Qbasis< Symmetry, depth, AllocationPolicy >::largestSector

Returns the largest state sector.

◆ leftOffset()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
size_t Xped::Qbasis< Symmetry, depth, AllocationPolicy >::leftOffset ( const FusionTree< depth, Symmetry > &  tree,
const std::array< size_t, depth > &  plain = std::array<std::size_t, depth>() 
) const

◆ maxQ()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
qType Xped::Qbasis< Symmetry, depth, AllocationPolicy >::maxQ ( ) const
inline
Here is the call graph for this function:

◆ minQ()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
qType Xped::Qbasis< Symmetry, depth, AllocationPolicy >::minQ ( ) const
inline
Here is the call graph for this function:

◆ NOT_PRESENT()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
bool Xped::Qbasis< Symmetry, depth, AllocationPolicy >::NOT_PRESENT ( const qType &  q) const
inline

Checks whether states with quantum number q are not in the basis. Returns true if the state is absent.

Here is the call graph for this function:

◆ Nq()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
std::size_t Xped::Qbasis< Symmetry, depth, AllocationPolicy >::Nq ( ) const
inline

Returns the number of quantum numbers (irreps) contained in this basis.

Here is the caller graph for this function:

◆ operator==()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
bool Xped::Qbasis< Symmetry, depth, AllocationPolicy >::operator== ( const Qbasis< Symmetry, depth, AllocationPolicy > &  other) const

◆ outer_num()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
size_t Xped::Qbasis< Symmetry, depth, AllocationPolicy >::outer_num ( const qType &  q) const

Computes the total number with which the sector with quantum number q begins.

◆ print()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
std::string Xped::Qbasis< Symmetry, depth, AllocationPolicy >::print

Prints the basis.

Here is the caller graph for this function:

◆ printTrees()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
std::string Xped::Qbasis< Symmetry, depth, AllocationPolicy >::printTrees

Prints the trees.

◆ push_back() [1/2]

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
void Xped::Qbasis< Symmetry, depth, AllocationPolicy >::push_back ( const qType &  q,
const size_t &  inner_dim 
)

Insert the quantum number q with dimension inner_dim into the basis.

Here is the caller graph for this function:

◆ push_back() [2/2]

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
void Xped::Qbasis< Symmetry, depth, AllocationPolicy >::push_back ( const qType &  q,
const size_t &  inner_dim,
const TreeVector< depth > &  tree 
)

◆ qn()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
qType Xped::Qbasis< Symmetry, depth, AllocationPolicy >::qn ( std::size_t  index) const
inline

Inverse function to index(const qType&).

Here is the call graph for this function:

◆ qs()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
std::vector< qType > Xped::Qbasis< Symmetry, depth, AllocationPolicy >::qs ( ) const
inline
Here is the caller graph for this function:

◆ remove()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
void Xped::Qbasis< Symmetry, depth, AllocationPolicy >::remove ( const qType &  q)

◆ rightOffset()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
size_t Xped::Qbasis< Symmetry, depth, AllocationPolicy >::rightOffset ( const FusionTree< depth, Symmetry > &  tree,
const std::array< size_t, depth > &  plain = std::array<std::size_t, depth>() 
) const

◆ serialize()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
template<typename Ar >
void Xped::Qbasis< Symmetry, depth, AllocationPolicy >::serialize ( Ar &  ar)
inline

◆ SET_CONJ()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
void Xped::Qbasis< Symmetry, depth, AllocationPolicy >::SET_CONJ ( )
inline

◆ setRandom()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
void Xped::Qbasis< Symmetry, depth, AllocationPolicy >::setRandom ( const std::size_t &  fullSize,
const std::size_t &  max_sectorSize = 5ul 
)

◆ shift()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
std::pair< std::vector< std::size_t >, Qbasis< Symmetry, depth, AllocationPolicy > > Xped::Qbasis< Symmetry, depth, AllocationPolicy >::shift ( qType  qshift) const
Here is the call graph for this function:

◆ sort()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
std::vector< std::size_t > Xped::Qbasis< Symmetry, depth, AllocationPolicy >::sort

Swaps with another Qbasis.

Here is the caller graph for this function:

◆ tree()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
const auto & Xped::Qbasis< Symmetry, depth, AllocationPolicy >::tree ( const qType &  q) const
inline
Here is the caller graph for this function:

◆ TrivialBasis()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
Qbasis< Symmetry, 1, AllocationPolicy > Xped::Qbasis< Symmetry, depth, AllocationPolicy >::TrivialBasis
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ truncate()

template<typename Symmetry , std::size_t depth, typename AllocationPolicy >
void Xped::Qbasis< Symmetry, depth, AllocationPolicy >::truncate ( const std::unordered_set< qType > &  qs,
const std::size_t &  M 
)

◆ unordered_qs()

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
std::unordered_set< qType > Xped::Qbasis< Symmetry, depth, AllocationPolicy >::unordered_qs ( ) const
inline

Friends And Related Function Documentation

◆ Qbasis

template<typename Symmetry , std::size_t depth = 1, typename AllocationPolicy = HeapPolicy>
template<typename Symmetry_ , std::size_t depth_, typename AllocationPolicy_ >
friend class Qbasis
friend

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