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

#include <hamilt_lcao.h>

Inheritance diagram for hamilt::HamiltLCAO< TK, TR >:
Collaboration diagram for hamilt::HamiltLCAO< TK, TR >:

Public Member Functions

 HamiltLCAO (const UnitCell &ucell, const Grid_Driver &grid_d, const Parallel_Orbitals *paraV, const BasisFlattenedIndexing &basis, const Parallel_Blkcyclic &layout, elecstate::Potential *pot_in, const K_Vectors &kv_in, const TwoCenterBundle &two_center_bundle, const LCAO_Orbitals &orb, module_dm::DensityMatrix< TK, double > *DM_in, Plus_U_Base *p_dftu, Setup_DeePKS< TK > &deepks, const int istep, Exx_NAO< TK > &exx_nao, const Exx_Info &exx_info, const Input_para &inp, const bool load_exx_flag, TD_info *td_info)
 Constructor of Hamiltonian for LCAO base HR and SR will be allocated with Operators.
 HamiltLCAO (const UnitCell &ucell, const Grid_Driver &grid_d, const Parallel_Orbitals *paraV, const BasisFlattenedIndexing &basis, const Parallel_Blkcyclic &layout, const K_Vectors &kv_in, const TwoCenterIntegrator &intor_overlap_orb, const std::vector< double > &orb_cutoff)
 Constructor of vacuum Operators, only HR and SR will be initialed as empty HContainer.
 ~HamiltLCAO ()
Operator< TK > *& getOperator ()
 get pointer of Operator<TK> ops
TK * getHk () const
 get H(k) pointer
TK * getSk () const
 get S(k) pointer
HContainer< TR > * getHR ()
 get HR pointer of *this->hR, which is a HContainerand contains H(R)
const HContainer< TR > * getHR () const
HContainer< TR > * getSR ()
 get SR pointer of *this->sR, which is a HContainerand contains S(R)
const HContainer< TR > * getSR () const
const BasisFlattenedIndexing & basis () const
const Parallel_Blkcyclic & layout () const
HContainer< TR > *& get_V_delta_R ()
 get V_delta_R pointer of *this->V_delta_R, which is a HContainerand contains V_delta(R)
std::vector< TR > & getHRS2 ()
 get hRS2 buffer for NSPIN=2 case (spin-up in first half, spin-down in second half)
std::vector< HContainer< TR > * > getHR_vector ()
void refresh (bool yes) override
 refresh the status of HR
void updateHk (const int ik) override
 for target K point, update consequence of hPsi() and matrix()
void updateSk (const int ik, const int hk_type)
 special for LCAO, update SK only
void matrix (MatrixBlock< TK > &hk_in, MatrixBlock< TK > &sk_in) override
Public Member Functions inherited from hamilt::Hamilt< TK >
virtual ~Hamilt ()
std::string get_classname () const override
 get the class name
void * get_ops () override
 get the operator chain
virtual void hPsi (const TK *psi_in, TK *hpsi, const size_t size) const
 core function: for solving eigenvalues of Hamiltonian with iterative method
virtual void sPsi (const TK *psi_in, TK *spsi, const int nrow, const int npw, const int nbands) const
virtual void matrix (MatrixBlock< std::complex< double > > &hk_in, MatrixBlock< std::complex< double > > &sk_in)
 core function: return H(k) and S(k) matrixs for direct solving eigenvalues.
Public Member Functions inherited from hamilt::HamiltBase
virtual ~HamiltBase ()

Private Member Functions

void synchronize_spin_storage ()
 Keep both spin channels aligned with dynamically added H(R) blocks.
OperatorLCAO< TK, TR > * getOperatorLCAO ()
 get this->ops downcast to OperatorLCAO<TK, TR>*, cached in ops_lcao_

Private Attributes

const BasisFlattenedIndexing & basis_
const Parallel_Blkcyclic & layout_
const K_Vectors * kv = nullptr
std::unique_ptr< HContainer< TR > > hR
 Real space Hamiltonian H(R), where R is the Bravis lattice vector.
std::unique_ptr< HContainer< TR > > sR
 Real space overlap matrix S(R), where R is the Bravis lattice vector.
HContainer< TR > * V_delta_R = nullptr
std::unique_ptr< HS_Matrix_K< TK > > hsk
 Hamiltonian and overlap matrices for a specific k point.
std::vector< TR > hRS2
std::unique_ptr< HContainer< TR > > hr_spin_up_
std::unique_ptr< HContainer< TR > > hr_spin_dn_
int refresh_times = 1
int current_spin = 0
int nspin = 1
 snapshot of inp.nspin taken at construction; avoids PARAM dependency
bool vl_in_h = true
 snapshot of inp.vl_in_h taken at construction; avoids PARAM dependency
OperatorLCAO< TK, TR > * ops_lcao_ = nullptr

Additional Inherited Members

Public Attributes inherited from hamilt::Hamilt< TK >
std::string classname
Operator< TK, base_device::DEVICE_CPU > * ops
 first node operator, add operations from each operators
Protected Types inherited from hamilt::Hamilt< TK >
using syncmem_op
Protected Attributes inherited from hamilt::Hamilt< TK >
base_device::DEVICE_CPU * ctx

Constructor & Destructor Documentation

◆ HamiltLCAO() [1/2]

template<typename TK, typename TR>
hamilt::HamiltLCAO< TK, TR >::HamiltLCAO ( const UnitCell & ucell,
const Grid_Driver & grid_d,
const Parallel_Orbitals * paraV,
const BasisFlattenedIndexing & basis,
const Parallel_Blkcyclic & layout,
elecstate::Potential * pot_in,
const K_Vectors & kv_in,
const TwoCenterBundle & two_center_bundle,
const LCAO_Orbitals & orb,
module_dm::DensityMatrix< TK, double > * DM_in,
Plus_U_Base * p_dftu,
Setup_DeePKS< TK > & deepks,
const int istep,
Exx_NAO< TK > & exx_nao,
const Exx_Info & exx_info,
const Input_para & inp,
const bool load_exx_flag,
TD_info * td_info )

Constructor of Hamiltonian for LCAO base HR and SR will be allocated with Operators.

Here is the call graph for this function:

◆ HamiltLCAO() [2/2]

template<typename TK, typename TR>
hamilt::HamiltLCAO< TK, TR >::HamiltLCAO ( const UnitCell & ucell,
const Grid_Driver & grid_d,
const Parallel_Orbitals * paraV,
const BasisFlattenedIndexing & basis,
const Parallel_Blkcyclic & layout,
const K_Vectors & kv_in,
const TwoCenterIntegrator & intor_overlap_orb,
const std::vector< double > & orb_cutoff )

Constructor of vacuum Operators, only HR and SR will be initialed as empty HContainer.

Here is the call graph for this function:

◆ ~HamiltLCAO()

template<typename TK, typename TR>
hamilt::HamiltLCAO< TK, TR >::~HamiltLCAO ( )
inline

Member Function Documentation

◆ basis()

template<typename TK, typename TR>
const BasisFlattenedIndexing & hamilt::HamiltLCAO< TK, TR >::basis ( ) const
inline
Here is the caller graph for this function:

◆ get_V_delta_R()

template<typename TK, typename TR>
HContainer< TR > *& hamilt::HamiltLCAO< TK, TR >::get_V_delta_R ( )
inline

get V_delta_R pointer of *this->V_delta_R, which is a HContainerand contains V_delta(R)

Here is the caller graph for this function:

◆ getHk()

template<typename TK, typename TR>
TK * hamilt::HamiltLCAO< TK, TR >::getHk ( ) const
inline

get H(k) pointer

Here is the caller graph for this function:

◆ getHR() [1/2]

template<typename TK, typename TR>
HContainer< TR > * hamilt::HamiltLCAO< TK, TR >::getHR ( )
inline

get HR pointer of *this->hR, which is a HContainerand contains H(R)

Here is the caller graph for this function:

◆ getHR() [2/2]

template<typename TK, typename TR>
const HContainer< TR > * hamilt::HamiltLCAO< TK, TR >::getHR ( ) const
inline

◆ getHR_vector()

template<typename TK, typename TR>
std::vector< HContainer< TR > * > hamilt::HamiltLCAO< TK, TR >::getHR_vector ( )

Get HR as a vector of HContainer pointers (one per spin). For nspin=2, vl_in_h=0 shares the active H(R), matching updateHk. Returned pointers are owned by this class; caller must NOT delete them.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getHRS2()

template<typename TK, typename TR>
std::vector< TR > & hamilt::HamiltLCAO< TK, TR >::getHRS2 ( )
inline

get hRS2 buffer for NSPIN=2 case (spin-up in first half, spin-down in second half)

Here is the caller graph for this function:

◆ getOperator()

template<typename TK, typename TR>
Operator< TK > *& hamilt::HamiltLCAO< TK, TR >::getOperator ( )

get pointer of Operator<TK> ops

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOperatorLCAO()

template<typename TK, typename TR>
OperatorLCAO< TK, TR > * hamilt::HamiltLCAO< TK, TR >::getOperatorLCAO ( )
private

get this->ops downcast to OperatorLCAO<TK, TR>*, cached in ops_lcao_

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSk()

template<typename TK, typename TR>
TK * hamilt::HamiltLCAO< TK, TR >::getSk ( ) const
inline

get S(k) pointer

Here is the caller graph for this function:

◆ getSR() [1/2]

template<typename TK, typename TR>
HContainer< TR > * hamilt::HamiltLCAO< TK, TR >::getSR ( )
inline

get SR pointer of *this->sR, which is a HContainerand contains S(R)

Here is the caller graph for this function:

◆ getSR() [2/2]

template<typename TK, typename TR>
const HContainer< TR > * hamilt::HamiltLCAO< TK, TR >::getSR ( ) const
inline

◆ layout()

template<typename TK, typename TR>
const Parallel_Blkcyclic & hamilt::HamiltLCAO< TK, TR >::layout ( ) const
inline
Here is the caller graph for this function:

◆ matrix()

template<typename TK, typename TR>
void hamilt::HamiltLCAO< TK, TR >::matrix ( MatrixBlock< TK > & hk_in,
MatrixBlock< TK > & sk_in )
override
Here is the call graph for this function:
Here is the caller graph for this function:

◆ refresh()

template<typename TK, typename TR>
void hamilt::HamiltLCAO< TK, TR >::refresh ( bool yes)
overridevirtual

refresh the status of HR

Reimplemented from hamilt::Hamilt< TK >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ synchronize_spin_storage()

template<typename TK, typename TR>
void hamilt::HamiltLCAO< TK, TR >::synchronize_spin_storage ( )
private

Keep both spin channels aligned with dynamically added H(R) blocks.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateHk()

template<typename TK, typename TR>
void hamilt::HamiltLCAO< TK, TR >::updateHk ( const int ik)
overridevirtual

for target K point, update consequence of hPsi() and matrix()

Reimplemented from hamilt::Hamilt< TK >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateSk()

template<typename TK, typename TR>
void hamilt::HamiltLCAO< TK, TR >::updateSk ( const int ik,
const int hk_type )

special for LCAO, update SK only

Parameters
iktarget K point
kvec_ddirect coordinates of k-points
hk_type0: SK is row-major, 1: SK is collumn-major
Returns
void
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ basis_

template<typename TK, typename TR>
const BasisFlattenedIndexing& hamilt::HamiltLCAO< TK, TR >::basis_
private

◆ current_spin

template<typename TK, typename TR>
int hamilt::HamiltLCAO< TK, TR >::current_spin = 0
private

current_spin for NSPIN=2 case 0: Hamiltonian for spin up, 1: Hamiltonian for spin down

◆ hR

template<typename TK, typename TR>
std::unique_ptr<HContainer<TR> > hamilt::HamiltLCAO< TK, TR >::hR
private

Real space Hamiltonian H(R), where R is the Bravis lattice vector.

◆ hr_spin_dn_

template<typename TK, typename TR>
std::unique_ptr<HContainer<TR> > hamilt::HamiltLCAO< TK, TR >::hr_spin_dn_
private

◆ hr_spin_up_

template<typename TK, typename TR>
std::unique_ptr<HContainer<TR> > hamilt::HamiltLCAO< TK, TR >::hr_spin_up_
private

Per-spin HContainer wrappers for nspin=2 (owned by this class). Preserve the layout of hRS2 until an operator's HR growth is synchronized.

◆ hRS2

template<typename TK, typename TR>
std::vector<TR> hamilt::HamiltLCAO< TK, TR >::hRS2
private

◆ hsk

template<typename TK, typename TR>
std::unique_ptr<HS_Matrix_K<TK> > hamilt::HamiltLCAO< TK, TR >::hsk
private

Hamiltonian and overlap matrices for a specific k point.

◆ kv

template<typename TK, typename TR>
const K_Vectors* hamilt::HamiltLCAO< TK, TR >::kv = nullptr
private

◆ layout_

template<typename TK, typename TR>
const Parallel_Blkcyclic& hamilt::HamiltLCAO< TK, TR >::layout_
private

◆ nspin

template<typename TK, typename TR>
int hamilt::HamiltLCAO< TK, TR >::nspin = 1
private

snapshot of inp.nspin taken at construction; avoids PARAM dependency

◆ ops_lcao_

template<typename TK, typename TR>
OperatorLCAO<TK, TR>* hamilt::HamiltLCAO< TK, TR >::ops_lcao_ = nullptr
private

cached downcast of this->ops to OperatorLCAO, filled on first use to avoid repeating dynamic_cast in updateHk/refresh

◆ refresh_times

template<typename TK, typename TR>
int hamilt::HamiltLCAO< TK, TR >::refresh_times = 1
private

◆ sR

template<typename TK, typename TR>
std::unique_ptr<HContainer<TR> > hamilt::HamiltLCAO< TK, TR >::sR
private

Real space overlap matrix S(R), where R is the Bravis lattice vector.

◆ V_delta_R

template<typename TK, typename TR>
HContainer<TR>* hamilt::HamiltLCAO< TK, TR >::V_delta_R = nullptr
private

◆ vl_in_h

template<typename TK, typename TR>
bool hamilt::HamiltLCAO< TK, TR >::vl_in_h = true
private

snapshot of inp.vl_in_h taken at construction; avoids PARAM dependency


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