pomerol  2.1
Public Types | Public Member Functions | Friends
Pomerol::IndexClassification< IndexTypes > Class Template Reference

Contiguous list of operator index tuples. More...

#include <IndexClassification.hpp>

Public Types

using IndexInfo = std::tuple< IndexTypes... >
 Tuple of indices carried by a single creation/annihilation operator. More...
 

Public Member Functions

template<typename ScalarType >
 IndexClassification (Operators::expression< ScalarType, IndexTypes... > const &H)
 
 IndexClassification ()=default
 Construct an empty map. More...
 
void addInfo (IndexInfo const &info)
 
void addInfo (IndexTypes... indices)
 
bool checkIndex (ParticleIndex in) const
 
ParticleIndex getIndex (IndexInfo const &info) const
 
ParticleIndex getIndex (IndexTypes... indices) const
 
IndexInfo const & getInfo (ParticleIndex in) const
 
ParticleIndex getIndexSize () const
 Return the total number of elements in the map. More...
 

Friends

std::ostream & operator<< (std::ostream &os, IndexClassification const &ic)
 

Detailed Description

template<typename... IndexTypes>
class Pomerol::IndexClassification< IndexTypes >

Contiguous list of operator index tuples.

This class establishes correspondence between index tuples of fermionic creation/annihilation operators and values of a contiguous integer index (ParticleIndex).

Template Parameters
IndexTypesTypes of indices carried by a single creation/annihilation operator.

Definition at line 41 of file IndexClassification.hpp.

Member Typedef Documentation

◆ IndexInfo

template<typename... IndexTypes>
using Pomerol::IndexClassification< IndexTypes >::IndexInfo = std::tuple<IndexTypes...>

Tuple of indices carried by a single creation/annihilation operator.

Definition at line 44 of file IndexClassification.hpp.

Constructor & Destructor Documentation

◆ IndexClassification() [1/2]

template<typename... IndexTypes>
template<typename ScalarType >
Pomerol::IndexClassification< IndexTypes >::IndexClassification ( Operators::expression< ScalarType, IndexTypes... > const &  H)
inlineexplicit

Populate the index map by extracting all index tuples from a given polynomial expression. Mapped ParticleIndex values are assigned according to the order that keys (index tuples) are stored in.

Template Parameters
ScalarTypeCoefficient type of expression H.
Parameters
[in]HExpression to be analyzed.

Definition at line 59 of file IndexClassification.hpp.

◆ IndexClassification() [2/2]

template<typename... IndexTypes>
Pomerol::IndexClassification< IndexTypes >::IndexClassification ( )
default

Construct an empty map.

Member Function Documentation

◆ addInfo() [1/2]

template<typename... IndexTypes>
void Pomerol::IndexClassification< IndexTypes >::addInfo ( IndexInfo const &  info)
inline

Add an operator index tuple to the map.

Parameters
[in]infoIndex tuple to be added.

Definition at line 74 of file IndexClassification.hpp.

◆ addInfo() [2/2]

template<typename... IndexTypes>
void Pomerol::IndexClassification< IndexTypes >::addInfo ( IndexTypes...  indices)
inline

Create an operator index tuple and add it to the map.

Parameters
[in]indicesA pack of operator indices.

Definition at line 81 of file IndexClassification.hpp.

◆ checkIndex()

template<typename... IndexTypes>
bool Pomerol::IndexClassification< IndexTypes >::checkIndex ( ParticleIndex  in) const
inline

Check if a given ParticleIndex has a corresponding index tuple in the map.

Parameters
[in]inParticle index to check.

Definition at line 88 of file IndexClassification.hpp.

◆ getIndex() [1/2]

template<typename... IndexTypes>
ParticleIndex Pomerol::IndexClassification< IndexTypes >::getIndex ( IndexInfo const &  info) const
inline

Return the ParticleIndex corresponding to a given operator index tuple.

Parameters
[in]infoIndex tuple.

Definition at line 92 of file IndexClassification.hpp.

◆ getIndex() [2/2]

template<typename... IndexTypes>
ParticleIndex Pomerol::IndexClassification< IndexTypes >::getIndex ( IndexTypes...  indices) const
inline

Return the ParticleIndex corresponding to a given operator index tuple. Elements of the tuple are provided as a sequence of argument.

Parameters
[in]indicesA pack of operator indices.

Definition at line 106 of file IndexClassification.hpp.

◆ getIndexSize()

template<typename... IndexTypes>
ParticleIndex Pomerol::IndexClassification< IndexTypes >::getIndexSize ( ) const
inline

Return the total number of elements in the map.

Definition at line 117 of file IndexClassification.hpp.

◆ getInfo()

template<typename... IndexTypes>
IndexInfo const& Pomerol::IndexClassification< IndexTypes >::getInfo ( ParticleIndex  in) const
inline

Return the operator index tuple corresponding to a given ParticleIndex.

Parameters
[in]inParticle index to retrieve information for.

Definition at line 110 of file IndexClassification.hpp.

Friends And Related Function Documentation

◆ operator<<

template<typename... IndexTypes>
std::ostream& operator<< ( std::ostream &  os,
IndexClassification< IndexTypes > const &  ic 
)
friend

Print an entire IndexClassification map into an output stream.

Parameters
[out]osOutput stream.
[in]icThe IndexClassification object to be printed.
Returns
Reference to the output stream.

Definition at line 123 of file IndexClassification.hpp.


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