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

Presents a Hamilt as the H/S block-vector operator the iterative eigensolvers work on (hsolver::HSOperator). More...

#include <hamilt_hs_adapter.h>

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

Public Member Functions

 HamiltHSOperator (Hamilt< T, Device > *hm, const ModulePW::PW_Basis_K *wfc_basis)
void update_k (const int ik) override
 switch H and S to k point ik; must precede hpsi()/spsi() for that k
void hpsi (const T *x, T *hx, const int ld, const int nvec) const override
 hx[:, 0:nvec) = H * x[:, 0:nvec), both with leading dimension ld
void spsi (const T *x, T *sx, const int ld, const int nvec) const override
 sx[:, 0:nvec) = S * x[:, 0:nvec), both with leading dimension ld
Public Member Functions inherited from hsolver::HSOperator< T, base_device::DEVICE_CPU >
virtual ~HSOperator ()=default
virtual void add_to_subspace_h (T *hcc, const int n) const
virtual void export_subspace_vec (const T *vcc, const int n, const int nband) const

Protected Attributes

Hamilt< T, Device > * hm_ = nullptr
const ModulePW::PW_Basis_K * wfc_basis_ = nullptr
int ik_ = 0
 k point set by the last update_k()
int npw_ = 0
 number of plane waves of that k point (without npol)

Detailed Description

template<typename T, typename Device = base_device::DEVICE_CPU>
class hamilt::HamiltHSOperator< T, Device >

Presents a Hamilt as the H/S block-vector operator the iterative eigensolvers work on (hsolver::HSOperator).

This is the only place that wraps raw pointers into Psi / hpsi_info for the operator chain; hsolver itself never sees Hamilt.

Constructor & Destructor Documentation

◆ HamiltHSOperator()

template<typename T, typename Device = base_device::DEVICE_CPU>
hamilt::HamiltHSOperator< T, Device >::HamiltHSOperator ( Hamilt< T, Device > * hm,
const ModulePW::PW_Basis_K * wfc_basis )
inline

Member Function Documentation

◆ hpsi()

template<typename T, typename Device = base_device::DEVICE_CPU>
void hamilt::HamiltHSOperator< T, Device >::hpsi ( const T * x,
T * hx,
const int ld,
const int nvec ) const
inlineoverridevirtual

hx[:, 0:nvec) = H * x[:, 0:nvec), both with leading dimension ld

Implements hsolver::HSOperator< T, base_device::DEVICE_CPU >.

Here is the call graph for this function:

◆ spsi()

template<typename T, typename Device = base_device::DEVICE_CPU>
void hamilt::HamiltHSOperator< T, Device >::spsi ( const T * x,
T * sx,
const int ld,
const int nvec ) const
inlineoverridevirtual

sx[:, 0:nvec) = S * x[:, 0:nvec), both with leading dimension ld

Implements hsolver::HSOperator< T, base_device::DEVICE_CPU >.

◆ update_k()

template<typename T, typename Device = base_device::DEVICE_CPU>
void hamilt::HamiltHSOperator< T, Device >::update_k ( const int ik)
inlineoverridevirtual

switch H and S to k point ik; must precede hpsi()/spsi() for that k

Implements hsolver::HSOperator< T, base_device::DEVICE_CPU >.

Here is the caller graph for this function:

Member Data Documentation

◆ hm_

template<typename T, typename Device = base_device::DEVICE_CPU>
Hamilt<T, Device>* hamilt::HamiltHSOperator< T, Device >::hm_ = nullptr
protected

◆ ik_

template<typename T, typename Device = base_device::DEVICE_CPU>
int hamilt::HamiltHSOperator< T, Device >::ik_ = 0
protected

k point set by the last update_k()

◆ npw_

template<typename T, typename Device = base_device::DEVICE_CPU>
int hamilt::HamiltHSOperator< T, Device >::npw_ = 0
protected

number of plane waves of that k point (without npol)

◆ wfc_basis_

template<typename T, typename Device = base_device::DEVICE_CPU>
const ModulePW::PW_Basis_K* hamilt::HamiltHSOperator< T, Device >::wfc_basis_ = nullptr
protected

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