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

What an iterative eigensolver needs from the generalized eigenproblem H x = e S x: the ability to apply H and S to a block of vectors, and nothing else. More...

#include <hs_operator.h>

Inheritance diagram for hsolver::HSOperator< T, Device >:
Collaboration diagram for hsolver::HSOperator< T, Device >:

Public Member Functions

virtual ~HSOperator ()=default
virtual void update_k (const int ik)=0
 switch H and S to k point ik; must precede hpsi()/spsi() for that k
virtual void hpsi (const T *x, T *hx, const int ld, const int nvec) const =0
 hx[:, 0:nvec) = H * x[:, 0:nvec), both with leading dimension ld
virtual void spsi (const T *x, T *sx, const int ld, const int nvec) const =0
 sx[:, 0:nvec) = S * x[:, 0:nvec), both with leading dimension ld
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

Detailed Description

template<typename T, typename Device = base_device::DEVICE_CPU>
class hsolver::HSOperator< T, Device >

What an iterative eigensolver needs from the generalized eigenproblem H x = e S x: the ability to apply H and S to a block of vectors, and nothing else.

The solvers never see how H is built. The code that owns the Hamiltonian implements this interface (hamilt::HamiltHSOperator in source_hamilt/hamilt_hs_adapter.h) and the solvers only call hpsi()/spsi(). Unit tests implement it with a dense matrix.

Block vectors are column major: vector i occupies x[i*ld, i*ld + ld). Only the first npw rows carry data, ld is the leading dimension.

Constructor & Destructor Documentation

◆ ~HSOperator()

template<typename T, typename Device = base_device::DEVICE_CPU>
virtual hsolver::HSOperator< T, Device >::~HSOperator ( )
virtualdefault

Member Function Documentation

◆ add_to_subspace_h()

template<typename T, typename Device = base_device::DEVICE_CPU>
virtual void hsolver::HSOperator< T, Device >::add_to_subspace_h ( T * hcc,
const int n ) const
inlinevirtual

Hook used by DiagoIterAssist::diag_subspace_init: hcc is the n*n subspace Hamiltonian (column major, ld n). A Hamiltonian carrying a term that hpsi() does not cover (EXX in lcao_in_pw) adds it here.

Here is the caller graph for this function:

◆ export_subspace_vec()

template<typename T, typename Device = base_device::DEVICE_CPU>
virtual void hsolver::HSOperator< T, Device >::export_subspace_vec ( const T * vcc,
const int n,
const int nband ) const
inlinevirtual

Hook used by DiagoIterAssist::diag_subspace_init: vcc is the n*nband matrix of subspace eigenvectors, handed out right after the subspace diagonalization.

Here is the caller graph for this function:

◆ hpsi()

template<typename T, typename Device = base_device::DEVICE_CPU>
virtual void hsolver::HSOperator< T, Device >::hpsi ( const T * x,
T * hx,
const int ld,
const int nvec ) const
pure virtual

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

Implemented in hamilt::HamiltHSOperator< T, Device >, hamilt::HamiltHSOperator< T, base_device::DEVICE_CPU >, hamilt::HamiltHSOperator< T, Device >, HSOperatorMock< T >, IdentityHSOperator< T >, IdentityHSOperator< std::complex< double > >, IdentityHSOperator< std::complex< float > >, LR::HSolver::LRHSOperator< T, THamilt >, and pw::TDHamiltPW< T, Device >.

Here is the caller graph for this function:

◆ spsi()

template<typename T, typename Device = base_device::DEVICE_CPU>
virtual void hsolver::HSOperator< T, Device >::spsi ( const T * x,
T * sx,
const int ld,
const int nvec ) const
pure virtual

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

Implemented in hamilt::HamiltHSOperator< T, Device >, hamilt::HamiltHSOperator< T, base_device::DEVICE_CPU >, hamilt::HamiltHSOperator< T, Device >, HSOperatorMock< T >, IdentityHSOperator< T >, IdentityHSOperator< std::complex< double > >, IdentityHSOperator< std::complex< float > >, LR::HSolver::LRHSOperator< T, THamilt >, and pw::TDHamiltPW< T, Device >.

Here is the caller graph for this function:

◆ update_k()

template<typename T, typename Device = base_device::DEVICE_CPU>
virtual void hsolver::HSOperator< T, Device >::update_k ( const int ik)
pure virtual

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

Implemented in hamilt::HamiltHSOperator< T, Device >, hamilt::HamiltHSOperator< T, base_device::DEVICE_CPU >, hamilt::HamiltHSOperator< T, Device >, HSOperatorMock< T >, IdentityHSOperator< T >, IdentityHSOperator< std::complex< double > >, IdentityHSOperator< std::complex< float > >, LR::HSolver::LRHSOperator< T, THamilt >, and pw::TDHamiltPW< T, Device >.

Here is the caller graph for this function:

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