pomerol  2.1
Public Member Functions
Pomerol::TermList< TermType > Class Template Reference

A list of terms contributing to the Lehmann representation of a correlation function. More...

#include <TermList.hpp>

Public Member Functions

 TermList (Hash const &hasher, KeyEqual const &key_equal, IsNegligible const &is_negligible)
 
void add_term (TermType const &term)
 
std::size_t size () const
 Number of terms in the container. More...
 
void clear ()
 Remove all terms from the container. More...
 
std::unordered_set< TermType, Hash, KeyEqual > const & as_set () const
 Access the underlying set of terms. More...
 
IsNegligible const & get_is_negligible () const
 Access the 'is negligible' predicate. More...
 
template<typename... Args>
ComplexType operator() (Args &&... args) const
 
void broadcast (MPI_Comm const &comm, int root)
 
bool check_terms () const
 Check if all terms in the container are not negligible. More...
 

Detailed Description

template<typename TermType>
class Pomerol::TermList< TermType >

A list of terms contributing to the Lehmann representation of a correlation function.

A set-like container storing a list of terms contributing to the Lehmann representation of a correlation function.

The terms must support hashing using a function TermType::Hash and a similarity check via TermType::KeyEqual. Similar terms are automatically collected and reduced to one term using operator+=(). A term T is considered negligible and is automatically removed from the container if TermType::IsNegligible(T, current_number_of_terms + 1) evaluates to true.

Template Parameters
TermTypeType of a single term.

Definition at line 41 of file TermList.hpp.

Constructor & Destructor Documentation

◆ TermList()

template<typename TermType >
Pomerol::TermList< TermType >::TermList ( Hash const &  hasher,
KeyEqual const &  key_equal,
IsNegligible const &  is_negligible 
)
inline

Constructor.

Parameters
[in]hasherHasher for the underlying std::unordered_set object.
[in]key_equalKeyEqual predicate for the underlying std::unordered_set object.
[in]is_negligiblePredicate that determines whether a term can be neglected.

Definition at line 60 of file TermList.hpp.

Member Function Documentation

◆ add_term()

template<typename TermType >
void Pomerol::TermList< TermType >::add_term ( TermType const &  term)
inline

Add a new term to the container

Parameters
[in]termTerm to be added

Definition at line 65 of file TermList.hpp.

◆ as_set()

template<typename TermType >
std::unordered_set<TermType, Hash, KeyEqual> const& Pomerol::TermList< TermType >::as_set ( ) const
inline

Access the underlying set of terms.

Definition at line 85 of file TermList.hpp.

◆ broadcast()

template<typename TermType >
void Pomerol::TermList< TermType >::broadcast ( MPI_Comm const &  comm,
int  root 
)
inline

Broadcast terms from a root MPI rank to all other ranks in a communicator.

Parameters
[in]commThe MPI communicator for the broadcast operation.
[in]rootRank of the root MPI process.

Definition at line 106 of file TermList.hpp.

◆ check_terms()

template<typename TermType >
bool Pomerol::TermList< TermType >::check_terms ( ) const
inline

Check if all terms in the container are not negligible.

Definition at line 130 of file TermList.hpp.

◆ clear()

template<typename TermType >
void Pomerol::TermList< TermType >::clear ( )
inline

Remove all terms from the container.

Definition at line 82 of file TermList.hpp.

◆ get_is_negligible()

template<typename TermType >
IsNegligible const& Pomerol::TermList< TermType >::get_is_negligible ( ) const
inline

Access the 'is negligible' predicate.

Definition at line 88 of file TermList.hpp.

◆ operator()()

template<typename TermType >
template<typename... Args>
ComplexType Pomerol::TermList< TermType >::operator() ( Args &&...  args) const
inline

Forward arguments to TermType:operator() of each term in the container and return a sum of their return values.

Template Parameters
ArgsTypes of the arguments.
Parameters
[in]argsArguments to be passes to the terms.

Definition at line 94 of file TermList.hpp.

◆ size()

template<typename TermType >
std::size_t Pomerol::TermList< TermType >::size ( ) const
inline

Number of terms in the container.

Definition at line 79 of file TermList.hpp.


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