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

#include <rdmft.h>

Collaboration diagram for rdmft::RDMFT< TK, TR >:

Public Member Functions

 RDMFT ()
 ~RDMFT ()
void init (Parallel_Orbitals &ParaV_in, UnitCell &ucell_in, const Grid_Driver &gd_in, K_Vectors &kv_in, elecstate::ElecState &pelec_in, LCAO_Orbitals &orb_in, TwoCenterBundle &two_center_bundle_in, std::string XC_func_rdmft_in, double alpha_power_in, const Exx_Info &exx_info)
 initialization of rdmft calculation
void update_ion (UnitCell &ucell_in, ModulePW::PW_Basis &rho_basis_in, ModuleBase::matrix &vloc_in, ModuleBase::ComplexMatrix &sf_in)
 update in ion-step and get V_TV
void update_elec (UnitCell &ucell, const ModuleBase::matrix &occ_number_in, const psi::Psi< TK > &wfc_in, const Charge *charge_in=nullptr)
 update in elec-step
double cal_E_grad_wfc_occ_num ()
 obtain the gradient of total energy with respect to occupation number and wfc
void cal_Energy (const int cal_type=1)
void update_occNumber (const ModuleBase::matrix &occ_number_in)
 update occ_number for optimization algorithms that depend on Hamilton
void update_wg (const ModuleBase::matrix &wg_in)
 update occ_number for optimization algorithms that depend on Hamilton
double run (ModuleBase::matrix &E_gradient_occNum, psi::Psi< TK > &E_gradient_wfc)
 do all calculation after update occNum&wfc, get Etotal and the gradient of energy with respect to the occNum&wfc

Public Attributes

const Parallel_Orbitals * ParaV = nullptr
Parallel_Blkcyclic para_Eij
elecstate::ElecState * pelec = nullptr
 obain Ewald and this->pelec->pot
const K_Vectors * kv = nullptr
 update after ion step
int nk_total = 0
int nbands_total
int nspin = 1
std::string XC_func_rdmft
double alpha_power = 0.656
 0.656 for soilds, 0.525 for dissociation of H2, 0.55~0.58 for HEG
ModuleBase::matrix occ_number
 natrual occupation numbers and wavefunction
psi::Psi< TK > wfc
ModuleBase::matrix wg
ModuleBase::matrix wk_fun_occNum
ModuleBase::matrix occNum_wfcHamiltWfc
 gradients of total energy with respect to the natural occupation numbers and wfc
psi::Psi< TK > occNum_HamiltWfc
double E_RDMFT [4] = {0.0}
 E_RDMFT[4] stores ETV, Ehartree, Exc, Etotal.
double Etotal = 0.0

Protected Member Functions

void get_DM_XC (std::vector< std::vector< TK > > &DM_XC)
 get the special density matrix DM_XC(nk*nbasis_local*nbasis_local)
void cal_V_TV ()
void cal_V_hartree ()
void cal_V_XC (const UnitCell &ucell)
 construct V_XC based on different XC_functional( i.e. RDMFT class member XC_func_rdmft)
void cal_Hk_Hpsi ()
 get the total Hamilton in k-space
void update_charge (UnitCell &ucell)

Private Attributes

hamilt::HContainer< TR > * HR_TV = nullptr
 Hamiltonian matrices in real space.
hamilt::HContainer< TR > * HR_hartree = nullptr
hamilt::HContainer< TR > * HR_dft_XC = nullptr
hamilt::HContainer< TR > * HR_exx_XC = nullptr
hamilt::HS_Matrix_K< TK > * hsk_TV = nullptr
 Hamiltonian matrices in reciprocal space.
hamilt::HS_Matrix_K< TK > * hsk_hartree = nullptr
hamilt::HS_Matrix_K< TK > * hsk_dft_XC = nullptr
hamilt::HS_Matrix_K< TK > * hsk_exx_XC = nullptr
std::vector< TK > HK_XC
std::unique_ptr< BasisFlattenedIndexing > basis_index_
std::vector< std::vector< TK > > DM_XC_pass
ModuleBase::matrix Etotal_n_k
ModuleBase::matrix wfcHwfc_TV
ModuleBase::matrix wfcHwfc_hartree
ModuleBase::matrix wfcHwfc_XC
ModuleBase::matrix wfcHwfc_exx_XC
ModuleBase::matrix wfcHwfc_dft_XC
psi::Psi< TK > H_wfc_TV
psi::Psi< TK > H_wfc_hartree
psi::Psi< TK > H_wfc_XC
psi::Psi< TK > H_wfc_exx_XC
psi::Psi< TK > H_wfc_dft_XC
std::vector< TK > Eij_TV
std::vector< TK > Eij_hartree
std::vector< TK > Eij_XC
std::vector< TK > Eij_exx_XC
hamilt::OperatorLCAO< TK, TR > * V_ekinetic_potential = nullptr
hamilt::OperatorLCAO< TK, TR > * V_nonlocal = nullptr
hamilt::OperatorLCAO< TK, TR > * V_local = nullptr
hamilt::OperatorLCAO< TK, TR > * V_hartree = nullptr
hamilt::OperatorLCAO< TK, TR > * V_exx_XC = nullptr
hamilt::OperatorLCAO< TK, TR > * V_dft_XC = nullptr
double etxc = 0.0
double vtxc = 0.0
bool only_exx_type = false
const int cal_E_type = 1
Charge * charge = nullptr
const UnitCell * ucell = nullptr
const Grid_Driver * gd = nullptr
const ModulePW::PW_Basis * rho_basis = nullptr
const ModuleBase::matrix * vloc = nullptr
const ModuleBase::ComplexMatrix * sf = nullptr
const LCAO_Orbitals * orb = nullptr
const TwoCenterBundle * two_center_bundle = nullptr

Constructor & Destructor Documentation

◆ RDMFT()

template<typename TK, typename TR>
rdmft::RDMFT< TK, TR >::RDMFT ( )

◆ ~RDMFT()

template<typename TK, typename TR>
rdmft::RDMFT< TK, TR >::~RDMFT ( )

Member Function Documentation

◆ cal_E_grad_wfc_occ_num()

template<typename TK, typename TR>
double rdmft::RDMFT< TK, TR >::cal_E_grad_wfc_occ_num ( )

obtain the gradient of total energy with respect to occupation number and wfc

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

◆ cal_Energy()

template<typename TK, typename TR>
void rdmft::RDMFT< TK, TR >::cal_Energy ( const int cal_type = 1)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cal_Hk_Hpsi()

template<typename TK, typename TR>
void rdmft::RDMFT< TK, TR >::cal_Hk_Hpsi ( )
protected

get the total Hamilton in k-space

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

◆ cal_V_hartree()

template<typename TK, typename TR>
void rdmft::RDMFT< TK, TR >::cal_V_hartree ( )
protected
Here is the caller graph for this function:

◆ cal_V_TV()

template<typename TK, typename TR>
void rdmft::RDMFT< TK, TR >::cal_V_TV ( )
protected
Here is the caller graph for this function:

◆ cal_V_XC()

template<typename TK, typename TR>
void rdmft::RDMFT< TK, TR >::cal_V_XC ( const UnitCell & ucell)
protected

construct V_XC based on different XC_functional( i.e. RDMFT class member XC_func_rdmft)

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

◆ get_DM_XC()

template<typename TK, typename TR>
void rdmft::RDMFT< TK, TR >::get_DM_XC ( std::vector< std::vector< TK > > & DM_XC)
protected

get the special density matrix DM_XC(nk*nbasis_local*nbasis_local)

This file is to get each potential matrix in NAOs, 'V' represents the potential matrix.

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

◆ init()

template<typename TK, typename TR>
void rdmft::RDMFT< TK, TR >::init ( Parallel_Orbitals & ParaV_in,
UnitCell & ucell_in,
const Grid_Driver & gd_in,
K_Vectors & kv_in,
elecstate::ElecState & pelec_in,
LCAO_Orbitals & orb_in,
TwoCenterBundle & two_center_bundle_in,
std::string XC_func_rdmft_in,
double alpha_power_in,
const Exx_Info & exx_info )

initialization of rdmft calculation

Here is the call graph for this function:

◆ run()

template<typename TK, typename TR>
double rdmft::RDMFT< TK, TR >::run ( ModuleBase::matrix & E_gradient_occNum,
psi::Psi< TK > & E_gradient_wfc )

do all calculation after update occNum&wfc, get Etotal and the gradient of energy with respect to the occNum&wfc

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

◆ update_charge()

template<typename TK, typename TR>
void rdmft::RDMFT< TK, TR >::update_charge ( UnitCell & ucell)
protected
Here is the caller graph for this function:

◆ update_elec()

template<typename TK, typename TR>
void rdmft::RDMFT< TK, TR >::update_elec ( UnitCell & ucell,
const ModuleBase::matrix & occ_number_in,
const psi::Psi< TK > & wfc_in,
const Charge * charge_in = nullptr )

update in elec-step

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

◆ update_ion()

template<typename TK, typename TR>
void rdmft::RDMFT< TK, TR >::update_ion ( UnitCell & ucell_in,
ModulePW::PW_Basis & rho_basis_in,
ModuleBase::matrix & vloc_in,
ModuleBase::ComplexMatrix & sf_in )

update in ion-step and get V_TV

Here is the call graph for this function:

◆ update_occNumber()

template<typename TK, typename TR>
void rdmft::RDMFT< TK, TR >::update_occNumber ( const ModuleBase::matrix & occ_number_in)

update occ_number for optimization algorithms that depend on Hamilton

Here is the call graph for this function:

◆ update_wg()

template<typename TK, typename TR>
void rdmft::RDMFT< TK, TR >::update_wg ( const ModuleBase::matrix & wg_in)

update occ_number for optimization algorithms that depend on Hamilton

Here is the call graph for this function:

Member Data Documentation

◆ alpha_power

template<typename TK, typename TR>
double rdmft::RDMFT< TK, TR >::alpha_power = 0.656

0.656 for soilds, 0.525 for dissociation of H2, 0.55~0.58 for HEG

◆ basis_index_

template<typename TK, typename TR>
std::unique_ptr<BasisFlattenedIndexing> rdmft::RDMFT< TK, TR >::basis_index_
private

◆ cal_E_type

template<typename TK, typename TR>
const int rdmft::RDMFT< TK, TR >::cal_E_type = 1
private

◆ charge

template<typename TK, typename TR>
Charge* rdmft::RDMFT< TK, TR >::charge = nullptr
private

◆ DM_XC_pass

template<typename TK, typename TR>
std::vector< std::vector<TK> > rdmft::RDMFT< TK, TR >::DM_XC_pass
private

◆ E_RDMFT

template<typename TK, typename TR>
double rdmft::RDMFT< TK, TR >::E_RDMFT[4] = {0.0}

E_RDMFT[4] stores ETV, Ehartree, Exc, Etotal.

◆ Eij_exx_XC

template<typename TK, typename TR>
std::vector<TK> rdmft::RDMFT< TK, TR >::Eij_exx_XC
private

◆ Eij_hartree

template<typename TK, typename TR>
std::vector<TK> rdmft::RDMFT< TK, TR >::Eij_hartree
private

◆ Eij_TV

template<typename TK, typename TR>
std::vector<TK> rdmft::RDMFT< TK, TR >::Eij_TV
private

◆ Eij_XC

template<typename TK, typename TR>
std::vector<TK> rdmft::RDMFT< TK, TR >::Eij_XC
private

◆ Etotal

template<typename TK, typename TR>
double rdmft::RDMFT< TK, TR >::Etotal = 0.0

◆ Etotal_n_k

template<typename TK, typename TR>
ModuleBase::matrix rdmft::RDMFT< TK, TR >::Etotal_n_k
private

◆ etxc

template<typename TK, typename TR>
double rdmft::RDMFT< TK, TR >::etxc = 0.0
private

◆ gd

template<typename TK, typename TR>
const Grid_Driver* rdmft::RDMFT< TK, TR >::gd = nullptr
private

◆ H_wfc_dft_XC

template<typename TK, typename TR>
psi::Psi<TK> rdmft::RDMFT< TK, TR >::H_wfc_dft_XC
private

◆ H_wfc_exx_XC

template<typename TK, typename TR>
psi::Psi<TK> rdmft::RDMFT< TK, TR >::H_wfc_exx_XC
private

◆ H_wfc_hartree

template<typename TK, typename TR>
psi::Psi<TK> rdmft::RDMFT< TK, TR >::H_wfc_hartree
private

◆ H_wfc_TV

template<typename TK, typename TR>
psi::Psi<TK> rdmft::RDMFT< TK, TR >::H_wfc_TV
private

◆ H_wfc_XC

template<typename TK, typename TR>
psi::Psi<TK> rdmft::RDMFT< TK, TR >::H_wfc_XC
private

◆ HK_XC

template<typename TK, typename TR>
std::vector<TK> rdmft::RDMFT< TK, TR >::HK_XC
private

◆ HR_dft_XC

template<typename TK, typename TR>
hamilt::HContainer<TR>* rdmft::RDMFT< TK, TR >::HR_dft_XC = nullptr
private

◆ HR_exx_XC

template<typename TK, typename TR>
hamilt::HContainer<TR>* rdmft::RDMFT< TK, TR >::HR_exx_XC = nullptr
private

◆ HR_hartree

template<typename TK, typename TR>
hamilt::HContainer<TR>* rdmft::RDMFT< TK, TR >::HR_hartree = nullptr
private

◆ HR_TV

template<typename TK, typename TR>
hamilt::HContainer<TR>* rdmft::RDMFT< TK, TR >::HR_TV = nullptr
private

Hamiltonian matrices in real space.

◆ hsk_dft_XC

template<typename TK, typename TR>
hamilt::HS_Matrix_K<TK>* rdmft::RDMFT< TK, TR >::hsk_dft_XC = nullptr
private

◆ hsk_exx_XC

template<typename TK, typename TR>
hamilt::HS_Matrix_K<TK>* rdmft::RDMFT< TK, TR >::hsk_exx_XC = nullptr
private

◆ hsk_hartree

template<typename TK, typename TR>
hamilt::HS_Matrix_K<TK>* rdmft::RDMFT< TK, TR >::hsk_hartree = nullptr
private

◆ hsk_TV

template<typename TK, typename TR>
hamilt::HS_Matrix_K<TK>* rdmft::RDMFT< TK, TR >::hsk_TV = nullptr
private

Hamiltonian matrices in reciprocal space.

◆ kv

template<typename TK, typename TR>
const K_Vectors* rdmft::RDMFT< TK, TR >::kv = nullptr

update after ion step

◆ nbands_total

template<typename TK, typename TR>
int rdmft::RDMFT< TK, TR >::nbands_total

◆ nk_total

template<typename TK, typename TR>
int rdmft::RDMFT< TK, TR >::nk_total = 0

◆ nspin

template<typename TK, typename TR>
int rdmft::RDMFT< TK, TR >::nspin = 1

◆ occ_number

template<typename TK, typename TR>
ModuleBase::matrix rdmft::RDMFT< TK, TR >::occ_number

natrual occupation numbers and wavefunction

◆ occNum_HamiltWfc

template<typename TK, typename TR>
psi::Psi<TK> rdmft::RDMFT< TK, TR >::occNum_HamiltWfc

◆ occNum_wfcHamiltWfc

template<typename TK, typename TR>
ModuleBase::matrix rdmft::RDMFT< TK, TR >::occNum_wfcHamiltWfc

gradients of total energy with respect to the natural occupation numbers and wfc

◆ only_exx_type

template<typename TK, typename TR>
bool rdmft::RDMFT< TK, TR >::only_exx_type = false
private

◆ orb

template<typename TK, typename TR>
const LCAO_Orbitals* rdmft::RDMFT< TK, TR >::orb = nullptr
private

◆ para_Eij

template<typename TK, typename TR>
Parallel_Blkcyclic rdmft::RDMFT< TK, TR >::para_Eij

◆ ParaV

template<typename TK, typename TR>
const Parallel_Orbitals* rdmft::RDMFT< TK, TR >::ParaV = nullptr

◆ pelec

template<typename TK, typename TR>
elecstate::ElecState* rdmft::RDMFT< TK, TR >::pelec = nullptr

obain Ewald and this->pelec->pot

◆ rho_basis

template<typename TK, typename TR>
const ModulePW::PW_Basis* rdmft::RDMFT< TK, TR >::rho_basis = nullptr
private

◆ sf

template<typename TK, typename TR>
const ModuleBase::ComplexMatrix* rdmft::RDMFT< TK, TR >::sf = nullptr
private

◆ two_center_bundle

template<typename TK, typename TR>
const TwoCenterBundle* rdmft::RDMFT< TK, TR >::two_center_bundle = nullptr
private

◆ ucell

template<typename TK, typename TR>
const UnitCell* rdmft::RDMFT< TK, TR >::ucell = nullptr
private

◆ V_dft_XC

template<typename TK, typename TR>
hamilt::OperatorLCAO<TK, TR>* rdmft::RDMFT< TK, TR >::V_dft_XC = nullptr
private

◆ V_ekinetic_potential

template<typename TK, typename TR>
hamilt::OperatorLCAO<TK, TR>* rdmft::RDMFT< TK, TR >::V_ekinetic_potential = nullptr
private

◆ V_exx_XC

template<typename TK, typename TR>
hamilt::OperatorLCAO<TK, TR>* rdmft::RDMFT< TK, TR >::V_exx_XC = nullptr
private

◆ V_hartree

template<typename TK, typename TR>
hamilt::OperatorLCAO<TK, TR>* rdmft::RDMFT< TK, TR >::V_hartree = nullptr
private

◆ V_local

template<typename TK, typename TR>
hamilt::OperatorLCAO<TK, TR>* rdmft::RDMFT< TK, TR >::V_local = nullptr
private

◆ V_nonlocal

template<typename TK, typename TR>
hamilt::OperatorLCAO<TK, TR>* rdmft::RDMFT< TK, TR >::V_nonlocal = nullptr
private

◆ vloc

template<typename TK, typename TR>
const ModuleBase::matrix* rdmft::RDMFT< TK, TR >::vloc = nullptr
private

◆ vtxc

template<typename TK, typename TR>
double rdmft::RDMFT< TK, TR >::vtxc = 0.0
private

◆ wfc

template<typename TK, typename TR>
psi::Psi<TK> rdmft::RDMFT< TK, TR >::wfc

◆ wfcHwfc_dft_XC

template<typename TK, typename TR>
ModuleBase::matrix rdmft::RDMFT< TK, TR >::wfcHwfc_dft_XC
private

◆ wfcHwfc_exx_XC

template<typename TK, typename TR>
ModuleBase::matrix rdmft::RDMFT< TK, TR >::wfcHwfc_exx_XC
private

◆ wfcHwfc_hartree

template<typename TK, typename TR>
ModuleBase::matrix rdmft::RDMFT< TK, TR >::wfcHwfc_hartree
private

◆ wfcHwfc_TV

template<typename TK, typename TR>
ModuleBase::matrix rdmft::RDMFT< TK, TR >::wfcHwfc_TV
private

◆ wfcHwfc_XC

template<typename TK, typename TR>
ModuleBase::matrix rdmft::RDMFT< TK, TR >::wfcHwfc_XC
private

◆ wg

template<typename TK, typename TR>
ModuleBase::matrix rdmft::RDMFT< TK, TR >::wg

◆ wk_fun_occNum

template<typename TK, typename TR>
ModuleBase::matrix rdmft::RDMFT< TK, TR >::wk_fun_occNum

◆ XC_func_rdmft

template<typename TK, typename TR>
std::string rdmft::RDMFT< TK, TR >::XC_func_rdmft

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