ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Exx_LRI_Interface< T, Tdata > Class Template Reference

#include <exx_lri_interface.h>

Collaboration diagram for Exx_LRI_Interface< T, Tdata >:

Classes

struct  Flag_Finish

Public Types

using TA = int
using TC = std::array<int, 3>
using TAC = std::pair<TA, TC>

Public Member Functions

 Exx_LRI_Interface (const Exx_Info_RI &info_ri, const Exx_Info_Global &info_global)
 Constructor for Exx_LRI_Interface.
 Exx_LRI_Interface ()=delete
void set_gpu (const bool use_gpu)
std::vector< std::map< TA, std::map< TAC, RI::Tensor< Tdata > > > > & get_Hexxs () const
double & get_Eexx () const
ModuleBase::matrix & get_force () const
ModuleBase::matrix & get_stress () const
int get_two_level_step () const
void init (const MPI_Comm &mpi_comm, const UnitCell &ucell, const K_Vectors &kv, const LCAO_Orbitals &orb, const bool use_gpu)
 in init: Exx_LRI::init()
void cal_exx_ions (const UnitCell &ucell, const bool write_cv=false)
 : in cal_exx_ions: Exx_LRI::cal_exx_ions()
void cal_exx_elec (const std::vector< std::map< TA, std::map< TAC, RI::Tensor< Tdata > > > > &Ds, const UnitCell &ucell, const Parallel_Orbitals &pv, const ModuleSymmetry::Symmetry_rotation *p_symrot=nullptr)
 : in cal_exx_elec: Exx_LRI::cal_exx_elec()
void cal_exx_force (const int &nat)
 : in cal_exx_force: Exx_LRI::cal_exx_force()
void cal_exx_stress (const double &omega, const double &lat0)
 : in cal_exx_stress: Exx_LRI::cal_exx_stress()
void exx_before_all_runners (const K_Vectors &kv, const UnitCell &ucell, const Parallel_Blkcyclic &pv)
 Initialize EXX symmetry before the first ionic step.
void refresh_symmetry (const K_Vectors &kv, const UnitCell &ucell, const Parallel_Blkcyclic &pv)
 Discard old atom mappings, lattice returns and rotation caches before rebuilding.
void exx_beforescf (const int istep, const K_Vectors &kv, const Charge_Mixing &chgmix, const UnitCell &ucell, const LCAO_Orbitals &orb, const Parallel_Blkcyclic &pv, const bool update_symmetry, const bool use_gpu)
 in beforescf: set xc type, opt_orb, do DM mixing
void exx_eachiterinit (const int istep, const UnitCell &ucell, const module_dm::DensityMatrix< T, double > &dm, const K_Vectors &kv, const Parallel_Orbitals &pv, const int &iter, const elecstate::ElecState &elec)
 in eachiterinit: do DM mixing and calculate Hexx when entering 2nd SCF
void exx_hamilt2rho (elecstate::ElecState &elec, const Parallel_Orbitals &pv, const int iter)
 in hamilt2rho: calculate Hexx and Eexx
void exx_iter_finish (const K_Vectors &kv, const UnitCell &ucell, hamilt::Hamilt< T > &hamilt, elecstate::ElecState &elec, module_dm::DensityMatrix< T, double > *dm, const Parallel_Orbitals &pv, Charge_Mixing &chgmix, const double &scf_ene_thr, int &iter, const int istep, bool &conv_esolver)
 in iter_finish: write Hexx, do something according to whether SCF is converged
bool exx_after_converge (const UnitCell &ucell, hamilt::Hamilt< T > &hamilt, const module_dm::DensityMatrix< T, double > &dm, const K_Vectors &kv, const Parallel_Orbitals &pv, const int &nspin, int &iter, const int &istep, const double &etot, const double &scf_ene_thr, const elecstate::TDFieldManager *field)
 : in do_after_converge: add exx operators; do DM mixing if seperate loop
size_t hybrid_step () const
void set_hybrid_step (size_t s)

Public Attributes

int two_level_step = 0
 the step of the outer loop. nullptr: no dependence on the number of two_level_step, contributeHk will do enerything normally. 0: the first outer loop. If restart, contributeHk will directly add Hexx to Hloc. else, do nothing. >0: not the first outer loop. contributeHk will do enerything normally.
double etot_last_outer_loop = 0.0
module_dm::DensityMatrix< T, double > * dm_last_step
std::shared_ptr< Exx_LRI< Tdata > > exx_ptr

Private Member Functions

std::vector< std::map< TA, std::map< TAC, RI::Tensor< Tdata > > > > prepare_exx_density (const std::vector< std::vector< T > > &dmk, const UnitCell &ucell, const K_Vectors &kv, const Parallel_Orbitals &pv, const int nspin, const bool restart, const ModuleBase::Vector3< double > *source_A)
void mix_common_density (RI_2D_Comm::HybridGaugeComplexDensity &density, const UnitCell &ucell, const ModuleBase::Vector3< double > &source_A, const bool restart)
void mix_common_density (std::vector< std::map< TA, std::map< TAC, RI::Tensor< double > > > > &density, const UnitCell &ucell, const ModuleBase::Vector3< double > &source_A, const bool restart)

Private Attributes

Mix_DMk_2D< T > mix_DMk_2D
Mix_DMk_2D< std::complex< double > > mix_common_density_
RI_2D_Comm::HybridDensityLayout common_density_layout_
Exx_Info_Global info_global
size_t hybrid_step_ = 1
const Charge_Mixing * p_chgmix_ = nullptr
const void * last_borrowed_mixing_ = nullptr
bool exx_spacegroup_symmetry = false
ModuleSymmetry::Symmetry_rotation symrot_
Flag_Finish flag_finish

Member Typedef Documentation

◆ TA

template<typename T, typename Tdata>
using Exx_LRI_Interface< T, Tdata >::TA = int

◆ TAC

template<typename T, typename Tdata>
using Exx_LRI_Interface< T, Tdata >::TAC = std::pair<TA, TC>

◆ TC

template<typename T, typename Tdata>
using Exx_LRI_Interface< T, Tdata >::TC = std::array<int, 3>

Constructor & Destructor Documentation

◆ Exx_LRI_Interface() [1/2]

template<typename T, typename Tdata>
Exx_LRI_Interface< T, Tdata >::Exx_LRI_Interface ( const Exx_Info_RI & info_ri,
const Exx_Info_Global & info_global )
inline

Constructor for Exx_LRI_Interface.

◆ Exx_LRI_Interface() [2/2]

template<typename T, typename Tdata>
Exx_LRI_Interface< T, Tdata >::Exx_LRI_Interface ( )
delete

Member Function Documentation

◆ cal_exx_elec()

template<typename T, typename Tdata>
void Exx_LRI_Interface< T, Tdata >::cal_exx_elec ( const std::vector< std::map< TA, std::map< TAC, RI::Tensor< Tdata > > > > & Ds,
const UnitCell & ucell,
const Parallel_Orbitals & pv,
const ModuleSymmetry::Symmetry_rotation * p_symrot = nullptr )

: in cal_exx_elec: Exx_LRI::cal_exx_elec()

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

◆ cal_exx_force()

template<typename T, typename Tdata>
void Exx_LRI_Interface< T, Tdata >::cal_exx_force ( const int & nat)

: in cal_exx_force: Exx_LRI::cal_exx_force()

Here is the call graph for this function:

◆ cal_exx_ions()

template<typename T, typename Tdata>
void Exx_LRI_Interface< T, Tdata >::cal_exx_ions ( const UnitCell & ucell,
const bool write_cv = false )

: in cal_exx_ions: Exx_LRI::cal_exx_ions()

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

◆ cal_exx_stress()

template<typename T, typename Tdata>
void Exx_LRI_Interface< T, Tdata >::cal_exx_stress ( const double & omega,
const double & lat0 )

: in cal_exx_stress: Exx_LRI::cal_exx_stress()

Here is the call graph for this function:

◆ exx_after_converge()

template<typename T, typename Tdata>
bool Exx_LRI_Interface< T, Tdata >::exx_after_converge ( const UnitCell & ucell,
hamilt::Hamilt< T > & hamilt,
const module_dm::DensityMatrix< T, double > & dm,
const K_Vectors & kv,
const Parallel_Orbitals & pv,
const int & nspin,
int & iter,
const int & istep,
const double & etot,
const double & scf_ene_thr,
const elecstate::TDFieldManager * field )

: in do_after_converge: add exx operators; do DM mixing if seperate loop

Parameters
dmdouble should be Tdata if complex-PBE-DM is supported
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exx_before_all_runners()

template<typename T, typename Tdata>
void Exx_LRI_Interface< T, Tdata >::exx_before_all_runners ( const K_Vectors & kv,
const UnitCell & ucell,
const Parallel_Blkcyclic & pv )

Initialize EXX symmetry before the first ionic step.

Here is the call graph for this function:

◆ exx_beforescf()

template<typename T, typename Tdata>
void Exx_LRI_Interface< T, Tdata >::exx_beforescf ( const int istep,
const K_Vectors & kv,
const Charge_Mixing & chgmix,
const UnitCell & ucell,
const LCAO_Orbitals & orb,
const Parallel_Blkcyclic & pv,
const bool update_symmetry,
const bool use_gpu )

in beforescf: set xc type, opt_orb, do DM mixing

Here is the call graph for this function:

◆ exx_eachiterinit()

template<typename T, typename Tdata>
void Exx_LRI_Interface< T, Tdata >::exx_eachiterinit ( const int istep,
const UnitCell & ucell,
const module_dm::DensityMatrix< T, double > & dm,
const K_Vectors & kv,
const Parallel_Orbitals & pv,
const int & iter,
const elecstate::ElecState & elec )

in eachiterinit: do DM mixing and calculate Hexx when entering 2nd SCF

Parameters
dmdouble should be Tdata if complex-PBE-DM is supported
Here is the call graph for this function:

◆ exx_hamilt2rho()

template<typename T, typename Tdata>
void Exx_LRI_Interface< T, Tdata >::exx_hamilt2rho ( elecstate::ElecState & elec,
const Parallel_Orbitals & pv,
const int iter )

in hamilt2rho: calculate Hexx and Eexx

Here is the call graph for this function:

◆ exx_iter_finish()

template<typename T, typename Tdata>
void Exx_LRI_Interface< T, Tdata >::exx_iter_finish ( const K_Vectors & kv,
const UnitCell & ucell,
hamilt::Hamilt< T > & hamilt,
elecstate::ElecState & elec,
module_dm::DensityMatrix< T, double > * dm,
const Parallel_Orbitals & pv,
Charge_Mixing & chgmix,
const double & scf_ene_thr,
int & iter,
const int istep,
bool & conv_esolver )

in iter_finish: write Hexx, do something according to whether SCF is converged

Here is the call graph for this function:

◆ get_Eexx()

template<typename T, typename Tdata>
double & Exx_LRI_Interface< T, Tdata >::get_Eexx ( ) const
inline
Here is the caller graph for this function:

◆ get_force()

template<typename T, typename Tdata>
ModuleBase::matrix & Exx_LRI_Interface< T, Tdata >::get_force ( ) const
inline

◆ get_Hexxs()

template<typename T, typename Tdata>
std::vector< std::map< TA, std::map< TAC, RI::Tensor< Tdata > > > > & Exx_LRI_Interface< T, Tdata >::get_Hexxs ( ) const
inline
Here is the caller graph for this function:

◆ get_stress()

template<typename T, typename Tdata>
ModuleBase::matrix & Exx_LRI_Interface< T, Tdata >::get_stress ( ) const
inline

◆ get_two_level_step()

template<typename T, typename Tdata>
int Exx_LRI_Interface< T, Tdata >::get_two_level_step ( ) const
inline

◆ hybrid_step()

template<typename T, typename Tdata>
size_t Exx_LRI_Interface< T, Tdata >::hybrid_step ( ) const
inline

◆ init()

template<typename T, typename Tdata>
void Exx_LRI_Interface< T, Tdata >::init ( const MPI_Comm & mpi_comm,
const UnitCell & ucell,
const K_Vectors & kv,
const LCAO_Orbitals & orb,
const bool use_gpu )

in init: Exx_LRI::init()

Here is the call graph for this function:

◆ mix_common_density() [1/2]

template<typename T, typename Tdata>
void Exx_LRI_Interface< T, Tdata >::mix_common_density ( RI_2D_Comm::HybridGaugeComplexDensity & density,
const UnitCell & ucell,
const ModuleBase::Vector3< double > & source_A,
const bool restart )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mix_common_density() [2/2]

template<typename T, typename Tdata>
void Exx_LRI_Interface< T, Tdata >::mix_common_density ( std::vector< std::map< TA, std::map< TAC, RI::Tensor< double > > > > & density,
const UnitCell & ucell,
const ModuleBase::Vector3< double > & source_A,
const bool restart )
private

◆ prepare_exx_density()

template<typename T, typename Tdata>
std::vector< std::map< typename Exx_LRI_Interface< T, Tdata >::TA, std::map< typename Exx_LRI_Interface< T, Tdata >::TAC, RI::Tensor< Tdata > > > > Exx_LRI_Interface< T, Tdata >::prepare_exx_density ( const std::vector< std::vector< T > > & dmk,
const UnitCell & ucell,
const K_Vectors & kv,
const Parallel_Orbitals & pv,
const int nspin,
const bool restart,
const ModuleBase::Vector3< double > * source_A )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ refresh_symmetry()

template<typename T, typename Tdata>
void Exx_LRI_Interface< T, Tdata >::refresh_symmetry ( const K_Vectors & kv,
const UnitCell & ucell,
const Parallel_Blkcyclic & pv )

Discard old atom mappings, lattice returns and rotation caches before rebuilding.

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

◆ set_gpu()

template<typename T, typename Tdata>
void Exx_LRI_Interface< T, Tdata >::set_gpu ( const bool use_gpu)
inline

◆ set_hybrid_step()

template<typename T, typename Tdata>
void Exx_LRI_Interface< T, Tdata >::set_hybrid_step ( size_t s)
inline

Member Data Documentation

◆ common_density_layout_

template<typename T, typename Tdata>
RI_2D_Comm::HybridDensityLayout Exx_LRI_Interface< T, Tdata >::common_density_layout_
private

◆ dm_last_step

template<typename T, typename Tdata>
module_dm::DensityMatrix<T, double>* Exx_LRI_Interface< T, Tdata >::dm_last_step

◆ etot_last_outer_loop

template<typename T, typename Tdata>
double Exx_LRI_Interface< T, Tdata >::etot_last_outer_loop = 0.0

◆ exx_ptr

template<typename T, typename Tdata>
std::shared_ptr<Exx_LRI<Tdata> > Exx_LRI_Interface< T, Tdata >::exx_ptr

◆ exx_spacegroup_symmetry

template<typename T, typename Tdata>
bool Exx_LRI_Interface< T, Tdata >::exx_spacegroup_symmetry = false
private

◆ flag_finish

template<typename T, typename Tdata>
Flag_Finish Exx_LRI_Interface< T, Tdata >::flag_finish
private

◆ hybrid_step_

template<typename T, typename Tdata>
size_t Exx_LRI_Interface< T, Tdata >::hybrid_step_ = 1
private

◆ info_global

template<typename T, typename Tdata>
Exx_Info_Global Exx_LRI_Interface< T, Tdata >::info_global
private

◆ last_borrowed_mixing_

template<typename T, typename Tdata>
const void* Exx_LRI_Interface< T, Tdata >::last_borrowed_mixing_ = nullptr
private

◆ mix_common_density_

template<typename T, typename Tdata>
Mix_DMk_2D<std::complex<double> > Exx_LRI_Interface< T, Tdata >::mix_common_density_
private

◆ mix_DMk_2D

template<typename T, typename Tdata>
Mix_DMk_2D<T> Exx_LRI_Interface< T, Tdata >::mix_DMk_2D
private

◆ p_chgmix_

template<typename T, typename Tdata>
const Charge_Mixing* Exx_LRI_Interface< T, Tdata >::p_chgmix_ = nullptr
private

◆ symrot_

template<typename T, typename Tdata>
ModuleSymmetry::Symmetry_rotation Exx_LRI_Interface< T, Tdata >::symrot_
private

◆ two_level_step

template<typename T, typename Tdata>
int Exx_LRI_Interface< T, Tdata >::two_level_step = 0

the step of the outer loop. nullptr: no dependence on the number of two_level_step, contributeHk will do enerything normally. 0: the first outer loop. If restart, contributeHk will directly add Hexx to Hloc. else, do nothing. >0: not the first outer loop. contributeHk will do enerything normally.


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