ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
esolver_ks_lcao.h
Go to the documentation of this file.
1#ifndef ESOLVER_KS_LCAO_H
2#define ESOLVER_KS_LCAO_H
3
4#include "esolver_ks.h"
5#include "source_lcao/record_adj.h" // adjacent atoms
7#include "source_lcao/module_gint/gint.h" // gint
9#include "source_lcao/setup_deepks.h" // for deepks, mohan add 20251008
10#include "source_lcao/setup_exx.h" // for exx, mohan add 20251008
11#include "source_lcao/module_rdmft/rdmft.h" // rdmft
12#include "source_lcao/setup_dm.h" // mohan add 2025-10-30
13
14#include <memory>
15
16
17// for Linear Response
18namespace LR
19{
20template <typename T, typename TR>
21class ESolver_LR;
22}
23
24//-----------------------------------
25// ESolver for LCAO
26//-----------------------------------
27namespace ModuleESolver
28{
29
30template <typename TK, typename TR>
31class ESolver_KS_LCAO : public ESolver_KS<TK>
32{
33 public:
36
37 void before_all_runners(UnitCell& ucell, const Input_para& inp) override;
38
39 double cal_energy() override;
40
41 void cal_force(UnitCell& ucell, ModuleBase::matrix& force) override;
42
43 void cal_stress(UnitCell& ucell, ModuleBase::matrix& stress) override;
44
45 void after_all_runners(UnitCell& ucell) override;
46
47 protected:
48 virtual void before_scf(UnitCell& ucell, const int istep) override;
49
50 virtual void iter_init(UnitCell& ucell, const int istep, const int iter) override;
51
52 virtual void hamilt2rho_single(UnitCell& ucell, const int istep, const int iter, const double ethr) override;
53
54 virtual void iter_finish(UnitCell& ucell, const int istep, int& iter, bool& conv_esolver) override;
55
56 virtual void after_scf(UnitCell& ucell, const int istep, const bool conv_esolver) override;
57
58 virtual void others(UnitCell& ucell, const int istep) override;
59
62
65
68
70 std::unique_ptr<ModuleGint::GintInfo> gint_info_;
71
74
77
80
83
84 // Temporarily store the stress to unify the interface with PW,
85 // because it's hard to seperate force and stress calculation in LCAO.
87 bool have_force = false;
88
89 // deepks method, mohan add 2025-10-08
91
92 // exact-exchange energy, mohan add 2025-10-08
94
95 friend class LR::ESolver_LR<double, double>;
96 friend class LR::ESolver_LR<std::complex<double>, double>;
97
98
99 public:
100 const Record_adj & get_RA() const { return RA; }
101 const Grid_Driver & get_gd() const { return gd; }
102 const Parallel_Orbitals & get_pv() const { return pv; }
103 const std::unique_ptr<ModuleGint::GintInfo> & get_gint_info() const { return gint_info_; }
106 const LCAO_Orbitals & get_orb() const { return orb_; }
107 const ModuleBase::matrix & get_scs() const { return scs; }
108 const Setup_DeePKS<TK> & get_deepks() const { return deepks; }
109 const Exx_NAO<TK> & get_exx_nao() const { return exx_nao; }
110};
111} // namespace ModuleESolver
112#endif
Definition setup_exx.h:19
Definition sltk_grid_driver.h:43
Definition ORB_read.h:19
Definition setup_dm.h:14
Excited State Solver: Linear Response TDDFT (Tamm Dancoff Approximation)
Definition esolver_lrtd_lcao.h:27
Definition matrix.h:19
Definition esolver_ks_lcao.h:32
Grid_Driver gd
Store information about Adjacent Atoms.
Definition esolver_ks_lcao.h:64
virtual void iter_finish(UnitCell &ucell, const int istep, int &iter, bool &conv_esolver) override
Something to do after hamilt2rho function in each iter loop.
Definition esolver_ks_lcao.cpp:476
const Grid_Driver & get_gd() const
Definition esolver_ks_lcao.h:101
const std::unique_ptr< ModuleGint::GintInfo > & get_gint_info() const
Definition esolver_ks_lcao.h:103
void cal_stress(UnitCell &ucell, ModuleBase::matrix &stress) override
calcualte stress of given cell
Definition esolver_ks_lcao.cpp:289
const rdmft::RDMFT< TK, TR > & get_rdmft_solver() const
Definition esolver_ks_lcao.h:105
virtual void others(UnitCell &ucell, const int istep) override
Definition lcao_others.cpp:37
TwoCenterBundle two_center_bundle_
NAO orbitals: two-center integrations.
Definition esolver_ks_lcao.h:73
LCAO_Orbitals orb_
NAO: store related information.
Definition esolver_ks_lcao.h:82
void cal_force(UnitCell &ucell, ModuleBase::matrix &force) override
calcualte forces for the atoms in the given cell
Definition esolver_ks_lcao.cpp:263
ModuleBase::matrix scs
Definition esolver_ks_lcao.h:86
const TwoCenterBundle & get_two_center_bundle() const
Definition esolver_ks_lcao.h:104
virtual void before_scf(UnitCell &ucell, const int istep) override
Something to do before SCF iterations.
Definition esolver_ks_lcao.cpp:148
ESolver_KS_LCAO()
Definition esolver_ks_lcao.cpp:30
Setup_DeePKS< TK > deepks
Definition esolver_ks_lcao.h:90
~ESolver_KS_LCAO()
Definition esolver_ks_lcao.cpp:38
rdmft::RDMFT< TK, TR > rdmft_solver
For RDMFT calculations, added by jghan, 2024-03-16.
Definition esolver_ks_lcao.h:79
bool have_force
Definition esolver_ks_lcao.h:87
std::unique_ptr< ModuleGint::GintInfo > gint_info_
GintInfo: used to store some basic infomation about module_gint.
Definition esolver_ks_lcao.h:70
const Setup_DeePKS< TK > & get_deepks() const
Definition esolver_ks_lcao.h:108
Record_adj RA
Store information about Adjacent Atoms.
Definition esolver_ks_lcao.h:61
Parallel_Orbitals pv
NAO orbitals: 2d block-cyclic distribution info.
Definition esolver_ks_lcao.h:67
Exx_NAO< TK > exx_nao
Definition esolver_ks_lcao.h:93
virtual void after_scf(UnitCell &ucell, const int istep, const bool conv_esolver) override
Something to do after SCF iterations when SCF is converged or comes to the max iter step.
Definition esolver_ks_lcao.cpp:546
LCAO_domain::Setup_DM< TK > dmat
Add density matrix class, mohan add 2025-10-30.
Definition esolver_ks_lcao.h:76
const ModuleBase::matrix & get_scs() const
Definition esolver_ks_lcao.h:107
void after_all_runners(UnitCell &ucell) override
perform post processing calculations
Definition esolver_ks_lcao.cpp:308
double cal_energy() override
calculate total energy of a given system
Definition esolver_ks_lcao.cpp:257
const Parallel_Orbitals & get_pv() const
Definition esolver_ks_lcao.h:102
void before_all_runners(UnitCell &ucell, const Input_para &inp) override
Initialize of the first-principels energy solver.
Definition esolver_ks_lcao.cpp:46
const Record_adj & get_RA() const
Definition esolver_ks_lcao.h:100
const Exx_NAO< TK > & get_exx_nao() const
Definition esolver_ks_lcao.h:109
virtual void hamilt2rho_single(UnitCell &ucell, const int istep, const int iter, const double ethr) override
Definition esolver_ks_lcao.cpp:411
const LCAO_Orbitals & get_orb() const
Definition esolver_ks_lcao.h:106
virtual void iter_init(UnitCell &ucell, const int istep, const int iter) override
Something to do before hamilt2rho function in each iter loop.
Definition esolver_ks_lcao.cpp:334
Definition esolver_ks.h:16
bool conv_esolver
Definition esolver.h:47
Definition parallel_orbitals.h:9
Definition record_adj.h:12
Definition setup_deepks.h:23
Definition two_center_bundle.h:11
Definition unitcell.h:17
Definition rdmft.h:41
std::complex< double > complex
Definition diago_cusolver.cpp:13
Definition esolver_ks_lcao.h:19
The First-Principles (FP) Energy Solver Class.
Definition opt_test_tools.cpp:93
Definition input_parameter.h:13