ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
hamilt::Operator< T, Device > Class Template Reference

#include <operator.h>

Inheritance diagram for hamilt::Operator< T, Device >:
Collaboration diagram for hamilt::Operator< T, Device >:

Public Types

typedef std::tuple< const psi::Psi< T, Device > *, const psi::Range, T * > hpsi_info
 

Public Member Functions

 Operator ()
 
virtual ~Operator ()
 
virtual hpsi_info hPsi (hpsi_info &input) const
 
virtual void init (const int ik_in)
 
virtual void add (Operator *next)
 
virtual int get_ik () const
 
virtual void act (const int nbands, const int nbasis, const int npol, const T *tmpsi_in, T *tmhpsi, const int ngk_ik=0, const bool is_first_node=false) const
 
virtual void act (const psi::Psi< T, Device > &psi_in, psi::Psi< T, Device > &psi_out, const int nbands) const
 
int get_act_type () const
 
calculation_type get_cal_type () const
 

Public Attributes

Operatornext_op = nullptr
 interface type 3: return a Psi-type HPsi
 

Protected Types

using set_memory_op = base_device::memory::set_memory_op< T, Device >
 

Protected Member Functions

Tget_hpsi (const hpsi_info &info) const
 

Protected Attributes

int ik = 0
 
int act_type = 1
 determine which act() interface would be called in hPsi()
 
bool in_place = false
 
enum calculation_type cal_type
 
Operatornext_sub_op = nullptr
 
bool is_first_node = true
 
psi::Psi< T, Device > * hpsi = nullptr
 
Device * ctx = {}
 

Member Typedef Documentation

◆ hpsi_info

template<typename T , typename Device = base_device::DEVICE_CPU>
typedef std::tuple<const psi::Psi<T, Device>*, const psi::Range, T*> hamilt::Operator< T, Device >::hpsi_info

as default, different operators donate hPsi independently run this->act function for the first operator and run all act() for other nodes in chain table if this procedure is not suitable for your operator, just override this function. output of hpsi would be first member of the returned tuple

◆ set_memory_op

template<typename T , typename Device = base_device::DEVICE_CPU>
using hamilt::Operator< T, Device >::set_memory_op = base_device::memory::set_memory_op<T, Device>
protected

Constructor & Destructor Documentation

◆ Operator()

template<typename T , typename Device = base_device::DEVICE_CPU>
hamilt::Operator< T, Device >::Operator ( )

◆ ~Operator()

template<typename T , typename Device = base_device::DEVICE_CPU>
virtual hamilt::Operator< T, Device >::~Operator ( )
virtual

Member Function Documentation

◆ act() [1/2]

template<typename T , typename Device = base_device::DEVICE_CPU>
virtual void hamilt::Operator< T, Device >::act ( const int  nbands,
const int  nbasis,
const int  npol,
const T tmpsi_in,
T tmhpsi,
const int  ngk_ik = 0,
const bool  is_first_node = false 
) const
inlinevirtual

do operation : |hpsi_choosed> = V|psi_choosed> V is the target operator act on choosed psi, the consequence should be added to choosed hpsi interface type 1: pointer-only (default)

Note
PW: nbasis = max_npw * npol, nbands = nband * npol, npol = npol. Strange but PAY ATTENTION!!!

Reimplemented in LR::OperatorLRDiag< T, Device >, LR::OperatorLRHxc< T, Device >, RI_Benchmark::OperatorRIHartree< T >, hamilt::OnsiteProj< OperatorPW< T, Device > >, OperatorMock< T >, hamilt::Ekinetic< OperatorPW< T, Device > >, hamilt::Meta< OperatorPW< T, Device > >, hamilt::Nonlocal< OperatorPW< T, Device > >, hamilt::OperatorEXXPW< T, Device >, hamilt::Veff< OperatorPW< T, Device > >, and TestOp< T, Device >.

Here is the caller graph for this function:

◆ act() [2/2]

template<typename T , typename Device = base_device::DEVICE_CPU>
virtual void hamilt::Operator< T, Device >::act ( const psi::Psi< T, Device > &  psi_in,
psi::Psi< T, Device > &  psi_out,
const int  nbands 
) const
inlinevirtual

developer-friendly interfaces for act() function interface type 2: input and change the Psi-type HPsi

◆ add()

template<typename T , typename Device = base_device::DEVICE_CPU>
virtual void hamilt::Operator< T, Device >::add ( Operator< T, Device > *  next)
virtual
Here is the caller graph for this function:

◆ get_act_type()

template<typename T , typename Device = base_device::DEVICE_CPU>
int hamilt::Operator< T, Device >::get_act_type ( ) const
inline

type 1 (default): pointer-only act(const T* psi_in, T* psi_out) type 2: use the Psiclass act(const Psi& psi_in, Psi& psi_out)

◆ get_cal_type()

template<typename T , typename Device = base_device::DEVICE_CPU>
calculation_type hamilt::Operator< T, Device >::get_cal_type ( ) const
inline

◆ get_hpsi()

template<typename T , typename Device = base_device::DEVICE_CPU>
T * hamilt::Operator< T, Device >::get_hpsi ( const hpsi_info info) const
protected

◆ get_ik()

template<typename T , typename Device = base_device::DEVICE_CPU>
virtual int hamilt::Operator< T, Device >::get_ik ( ) const
inlinevirtual

◆ hPsi()

template<typename T , typename Device = base_device::DEVICE_CPU>
virtual hpsi_info hamilt::Operator< T, Device >::hPsi ( hpsi_info input) const
virtual
Here is the caller graph for this function:

◆ init()

template<typename T , typename Device = base_device::DEVICE_CPU>
virtual void hamilt::Operator< T, Device >::init ( const int  ik_in)
virtual

Reimplemented in LR::OperatorLRDiag< T, Device >, LR::OperatorLRHxc< T, Device >, hamilt::OperatorLCAO< TK, TR >, hamilt::OperatorLCAO< std::complex< double >, TR >, hamilt::Nonlocal< OperatorPW< T, Device > >, and hamilt::OnsiteProj< OperatorPW< T, Device > >.

Here is the caller graph for this function:

Member Data Documentation

◆ act_type

template<typename T , typename Device = base_device::DEVICE_CPU>
int hamilt::Operator< T, Device >::act_type = 1
protected

determine which act() interface would be called in hPsi()

◆ cal_type

template<typename T , typename Device = base_device::DEVICE_CPU>
enum calculation_type hamilt::Operator< T, Device >::cal_type
protected

◆ ctx

template<typename T , typename Device = base_device::DEVICE_CPU>
Device* hamilt::Operator< T, Device >::ctx = {}
protected

◆ hpsi

template<typename T , typename Device = base_device::DEVICE_CPU>
psi::Psi<T, Device>* hamilt::Operator< T, Device >::hpsi = nullptr
mutableprotected

◆ ik

template<typename T , typename Device = base_device::DEVICE_CPU>
int hamilt::Operator< T, Device >::ik = 0
protected

◆ in_place

template<typename T , typename Device = base_device::DEVICE_CPU>
bool hamilt::Operator< T, Device >::in_place = false
mutableprotected

◆ is_first_node

template<typename T , typename Device = base_device::DEVICE_CPU>
bool hamilt::Operator< T, Device >::is_first_node = true
protected

◆ next_op

template<typename T , typename Device = base_device::DEVICE_CPU>
Operator* hamilt::Operator< T, Device >::next_op = nullptr

interface type 3: return a Psi-type HPsi

◆ next_sub_op

template<typename T , typename Device = base_device::DEVICE_CPU>
Operator* hamilt::Operator< T, Device >::next_sub_op = nullptr
protected

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