MADNESS 0.10.1
madness::Exchange< T, NDIM > Class Template Reference

#include <SCFOperators.h>

Inheritance diagram for madness::Exchange< T, NDIM >:
Collaboration diagram for madness::Exchange< T, NDIM >:

Classes

class  ExchangeImpl

Public Types

enum  ExchangeAlgorithm {
  small_memory , large_memory , multiworld_efficient , multiworld_efficient_row ,
  fetch_compute
}
typedef Function< T, NDIM > functionT
using implT = std::shared_ptr<ExchangeImpl>
typedef Tensor< T > tensorT
typedef std::vector< functionT > vecfuncT
Public Types inherited from madness::SCFOperatorBase< T, NDIM >
typedef Function< T, NDIM > functionT
typedef Tensor< T > tensorT
typedef std::vector< functionT > vecfuncT

Public Member Functions

 Exchange (World &world, const double lo, const double thresh=FunctionDefaults< NDIM >::get_thresh())
 ctor
 Exchange (World &world, const Nemo *nemo, const int ispin)
 ctor with a nemo calculation
 Exchange (World &world, const Nemo *nemo, const std::vector< Function< double, NDIM > > &R2mo, const int ispin)
 ctor with a nemo calculation whose bra R^2 F is already at hand; neither bra nor ket is copied
 Exchange (World &world, const SCF *calc, const int ispin)
 ctor with a conventional calculation
std::string info () const
 print some information about this operator
bool is_symmetric () const
T operator() (const Function< T, NDIM > &bra, const Function< T, NDIM > &ket) const
 compute the matrix element <bra | K | ket>
Function< T, NDIM > operator() (const Function< T, NDIM > &ket) const
Tensor< T > operator() (const vecfuncT &vbra, const vecfuncT &vket) const
 compute the matrix < vbra | K | vket >
vecfuncT operator() (const vecfuncT &vket) const
 apply the exchange operator on a vector of functions
Exchange & set_accumulation_mode (const int mode)
 1 = gather tile results per subworld, 2 = also gather per node first
Exchange & set_algorithm (const ExchangeAlgorithm &alg)
Exchange & set_batch_granularity (const long level)
 batches per rank in the owner-pinned symmetric partition (>= 1)
Exchange & set_bra_and_ket (const vecfuncT &bra, const vecfuncT &ket)
Exchange & set_cost_aware_assignment (const bool flag)
 place tasks by their measured cost rather than by counting them
Exchange & set_macro_task_info (const MacroTaskInfo &info)
 how the cloud will handle the data
Exchange & set_macro_task_info (const std::vector< std::string > &info)
Exchange & set_printlevel (const long &level)
Exchange & set_symmetric (const bool flag)
Exchange & set_taskq (std::shared_ptr< MacroTaskQ > taskq1)
Public Member Functions inherited from madness::SCFOperatorBase< T, NDIM >
 SCFOperatorBase ()=default
 SCFOperatorBase (std::shared_ptr< MacroTaskQ > taskq)
virtual ~SCFOperatorBase ()

Static Public Member Functions

static ExchangeAlgorithm string2algorithm (const std::string &alg_string)
static std::string to_string (const ExchangeAlgorithm alg)

Private Attributes

implT impl

Friends

std::ostream & operator<< (std::ostream &os, const ExchangeAlgorithm &alg)

Additional Inherited Members

Public Attributes inherited from madness::SCFOperatorBase< T, NDIM >
nlohmann::json statistics
std::shared_ptr< MacroTaskQ > taskq =0

Member Typedef Documentation

◆ functionT

template<typename T, std::size_t NDIM>
typedef Function<T,NDIM> madness::Exchange< T, NDIM >::functionT

◆ implT

template<typename T, std::size_t NDIM>
using madness::Exchange< T, NDIM >::implT = std::shared_ptr<ExchangeImpl>

◆ tensorT

template<typename T, std::size_t NDIM>
typedef Tensor<T> madness::Exchange< T, NDIM >::tensorT

◆ vecfuncT

template<typename T, std::size_t NDIM>
typedef std::vector<functionT> madness::Exchange< T, NDIM >::vecfuncT

Member Enumeration Documentation

◆ ExchangeAlgorithm

template<typename T, std::size_t NDIM>
enum madness::Exchange::ExchangeAlgorithm
Enumerator
small_memory 
large_memory 
multiworld_efficient 
multiworld_efficient_row 
fetch_compute 

Constructor & Destructor Documentation

◆ Exchange() [1/4]

◆ Exchange() [2/4]

template<typename T, std::size_t NDIM>
madness::Exchange< T, NDIM >::Exchange ( World & world,
const SCF * calc,
const int ispin )

ctor with a conventional calculation

References Exchange(), impl, and NDIM.

◆ Exchange() [3/4]

template<typename T, std::size_t NDIM>
madness::Exchange< T, NDIM >::Exchange ( World & world,
const Nemo * nemo,
const int ispin )

ctor with a nemo calculation

References Exchange(), impl, and NDIM.

◆ Exchange() [4/4]

template<typename T, std::size_t NDIM>
madness::Exchange< T, NDIM >::Exchange ( World & world,
const Nemo * nemo,
const std::vector< Function< double, NDIM > > & R2mo,
const int ispin )

ctor with a nemo calculation whose bra R^2 F is already at hand; neither bra nor ket is copied

References Exchange(), impl, and NDIM.

Member Function Documentation

◆ info()

template<typename T, std::size_t NDIM>
std::string madness::Exchange< T, NDIM >::info ( ) const
inlinevirtual

print some information about this operator

Implements madness::SCFOperatorBase< T, NDIM >.

Referenced by set_macro_task_info().

◆ is_symmetric()

◆ operator()() [1/4]

template<typename T, std::size_t NDIM>
T madness::Exchange< T, NDIM >::operator() ( const Function< T, NDIM > & bra,
const Function< T, NDIM > & ket ) const
inlinevirtual

compute the matrix element <bra | K | ket>

Parameters
[in]brareal_function_3d, the bra state
[in]ketreal_function_3d, the ket state

Implements madness::SCFOperatorBase< T, NDIM >.

◆ operator()() [2/4]

template<typename T, std::size_t NDIM>
Function< T, NDIM > madness::Exchange< T, NDIM >::operator() ( const Function< T, NDIM > & ket) const
inlinevirtual

apply this operator on the argument function

Parameters
ketthe argument function
Returns
op(ket)

Implements madness::SCFOperatorBase< T, NDIM >.

Referenced by madness::ExchangeAlgorithm< T, NDIM >::operator()(), and madness::ExchangeAlgorithm< T, NDIM >::operator()().

◆ operator()() [3/4]

template<typename T, std::size_t NDIM>
Tensor< T > madness::Exchange< T, NDIM >::operator() ( const vecfuncT & vbra,
const vecfuncT & vket ) const
inlinevirtual

compute the matrix < vbra | K | vket >

Parameters
[in]vbravector of real_function_3d, the set of bra states
[in]vketvector of real_function_3d, the set of ket states
Returns
K_ij

Implements madness::SCFOperatorBase< T, NDIM >.

◆ operator()() [4/4]

template<typename T, std::size_t NDIM>
vecfuncT madness::Exchange< T, NDIM >::operator() ( const vecfuncT & vket) const
virtual

apply the exchange operator on a vector of functions

note that only one spin is used (either alpha or beta orbitals)

Parameters
[in]vketthe orbitals |i> that the operator is applied on
Returns
a vector of orbitals K| i>

Implements madness::SCFOperatorBase< T, NDIM >.

◆ set_accumulation_mode()

template<typename T, std::size_t NDIM>
Exchange< T, NDIM > & madness::Exchange< T, NDIM >::set_accumulation_mode ( const int mode)

1 = gather tile results per subworld, 2 = also gather per node first

References Exchange(), and impl.

◆ set_algorithm()

template<typename T, std::size_t NDIM>
Exchange< T, NDIM > & madness::Exchange< T, NDIM >::set_algorithm ( const ExchangeAlgorithm & alg)

References Exchange(), and impl.

Referenced by madness::Nemo::make_fock_operator().

◆ set_batch_granularity()

template<typename T, std::size_t NDIM>
Exchange< T, NDIM > & madness::Exchange< T, NDIM >::set_batch_granularity ( const long level)

batches per rank in the owner-pinned symmetric partition (>= 1)

References Exchange(), and impl.

◆ set_bra_and_ket()

template<typename T, std::size_t NDIM>
Exchange< T, NDIM > & madness::Exchange< T, NDIM >::set_bra_and_ket ( const vecfuncT & bra,
const vecfuncT & ket )

◆ set_cost_aware_assignment()

template<typename T, std::size_t NDIM>
Exchange< T, NDIM > & madness::Exchange< T, NDIM >::set_cost_aware_assignment ( const bool flag)

place tasks by their measured cost rather than by counting them

References Exchange(), and impl.

◆ set_macro_task_info() [1/2]

template<typename T, std::size_t NDIM>
Exchange< T, NDIM > & madness::Exchange< T, NDIM >::set_macro_task_info ( const MacroTaskInfo & info)

how the cloud will handle the data

References Exchange(), impl, and info().

◆ set_macro_task_info() [2/2]

template<typename T, std::size_t NDIM>
Exchange & madness::Exchange< T, NDIM >::set_macro_task_info ( const std::vector< std::string > & info)
inline

◆ set_printlevel()

template<typename T, std::size_t NDIM>
Exchange< T, NDIM > & madness::Exchange< T, NDIM >::set_printlevel ( const long & level)

◆ set_symmetric()

template<typename T, std::size_t NDIM>
Exchange< T, NDIM > & madness::Exchange< T, NDIM >::set_symmetric ( const bool flag)

◆ set_taskq()

template<typename T, std::size_t NDIM>
Exchange & madness::Exchange< T, NDIM >::set_taskq ( std::shared_ptr< MacroTaskQ > taskq1)
inline

◆ string2algorithm()

template<typename T, std::size_t NDIM>
ExchangeAlgorithm madness::Exchange< T, NDIM >::string2algorithm ( const std::string & alg_string)
inlinestatic

◆ to_string()

template<typename T, std::size_t NDIM>
std::string madness::Exchange< T, NDIM >::to_string ( const ExchangeAlgorithm alg)
inlinestatic

◆ operator<<

template<typename T, std::size_t NDIM>
std::ostream & operator<< ( std::ostream & os,
const ExchangeAlgorithm & alg )
friend

Member Data Documentation

◆ impl


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