ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
LR::OperatorLRDiag< T, Device > Class Template Reference

Diag part of A operator: [AX]_iak = (e_ak - e_ik) X_iak. More...

#include <operator_lr_diag.h>

Inheritance diagram for LR::OperatorLRDiag< T, Device >:
Collaboration diagram for LR::OperatorLRDiag< T, Device >:

Public Member Functions

 OperatorLRDiag (const double *eig_ks, const Parallel_Blkcyclic &pX_in, const int &nk_in, const int &nocc_in, const int &nvirt_in, const bool add_on)
void init (const int ik_in) override
virtual void act (const int nbands, const int nbasis, const int npol, const T *psi_in, T *hpsi, const int ngk_ik=0, const bool is_first_node=false) const override
Public Member Functions inherited from hamilt::Operator< double, base_device::DEVICE_CPU >
 Operator ()
virtual ~Operator ()
virtual hpsi_info hPsi (hpsi_info &input) const
 Core hot-path: compute H|psi> by traversing the operator chain.
virtual void add (Operator *next)
virtual int get_ik () const
virtual void act (const int nbands, const int nbasis, const int npol, const double *tmpsi_in, double *tmhpsi, const int ngk_ik=0, const bool is_first_node=false) const
int get_act_type () const
calculation_type get_cal_type () const

Private Attributes

const Parallel_Blkcyclic & pX
ModuleBase::matrix eig_ks_diff
const int nk = 1
const int nocc = 1
const int nvirt = 1
const bool add_on_ = false
Device * ctx = {}

Additional Inherited Members

Public Types inherited from hamilt::Operator< double, base_device::DEVICE_CPU >
typedef std::tuple< const psi::Psi< double, base_device::DEVICE_CPU > *, const psi::Range, double * > hpsi_info
 input type of hPsi: (psi_input, range, hpsi_pointer)
Public Attributes inherited from hamilt::Operator< double, base_device::DEVICE_CPU >
Operator * next_op
 interface type 3: return a Psi-type HPsi
Protected Types inherited from hamilt::Operator< double, base_device::DEVICE_CPU >
using set_memory_op
Protected Member Functions inherited from hamilt::Operator< double, base_device::DEVICE_CPU >
double * get_hpsi (const hpsi_info &info) const
Protected Attributes inherited from hamilt::Operator< double, base_device::DEVICE_CPU >
int ik
int act_type
 determine which act() interface would be called in hPsi()
bool in_place
enum calculation_type cal_type
Operator * next_sub_op
bool is_first_node
psi::Psi< double, base_device::DEVICE_CPU > * hpsi
base_device::DEVICE_CPU * ctx

Detailed Description

template<typename T = double, typename Device = base_device::DEVICE_CPU>
class LR::OperatorLRDiag< T, Device >

Diag part of A operator: [AX]_iak = (e_ak - e_ik) X_iak.

Constructor & Destructor Documentation

◆ OperatorLRDiag()

template<typename T = double, typename Device = base_device::DEVICE_CPU>
LR::OperatorLRDiag< T, Device >::OperatorLRDiag ( const double * eig_ks,
const Parallel_Blkcyclic & pX_in,
const int & nk_in,
const int & nocc_in,
const int & nvirt_in,
const bool add_on )
inline
Here is the call graph for this function:

Member Function Documentation

◆ act()

template<typename T = double, typename Device = base_device::DEVICE_CPU>
virtual void LR::OperatorLRDiag< T, Device >::act ( const int nbands,
const int nbasis,
const int npol,
const T * psi_in,
T * hpsi,
const int ngk_ik = 0,
const bool is_first_node = false ) const
inlineoverridevirtual

By default this ASSIGNS to hpsi, so it has to be the head of its operator list. That is fine for a single-chain Hamiltonian, but an open-shell 2x2 spin-block operator writes into the same output buffer from four chains: the diagonal block of the DOWN channel runs last and its assignment wipes the up->down contribution that the off-diagonal chain wrote earlier. Those callers pass add_on = true and zero the output themselves.

Here is the call graph for this function:

◆ init()

template<typename T = double, typename Device = base_device::DEVICE_CPU>
void LR::OperatorLRDiag< T, Device >::init ( const int ik_in)
inlineoverridevirtual

Member Data Documentation

◆ add_on_

template<typename T = double, typename Device = base_device::DEVICE_CPU>
const bool LR::OperatorLRDiag< T, Device >::add_on_ = false
private

◆ ctx

template<typename T = double, typename Device = base_device::DEVICE_CPU>
Device* LR::OperatorLRDiag< T, Device >::ctx = {}
private

◆ eig_ks_diff

template<typename T = double, typename Device = base_device::DEVICE_CPU>
ModuleBase::matrix LR::OperatorLRDiag< T, Device >::eig_ks_diff
private

◆ nk

template<typename T = double, typename Device = base_device::DEVICE_CPU>
const int LR::OperatorLRDiag< T, Device >::nk = 1
private

◆ nocc

template<typename T = double, typename Device = base_device::DEVICE_CPU>
const int LR::OperatorLRDiag< T, Device >::nocc = 1
private

◆ nvirt

template<typename T = double, typename Device = base_device::DEVICE_CPU>
const int LR::OperatorLRDiag< T, Device >::nvirt = 1
private

◆ pX

template<typename T = double, typename Device = base_device::DEVICE_CPU>
const Parallel_Blkcyclic& LR::OperatorLRDiag< T, Device >::pX
private

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