11#include " esolver_ks_lcao.h"
2-
3- #include " source_base/global_variable.h"
4- #include " source_base/tool_title.h"
52#include " source_estate/elecstate_tools.h"
6-
7- #include " source_estate/module_dm/cal_dm_psi.h"
83#include " source_lcao/module_deltaspin/spin_constrain.h"
9- #include " source_lcao/module_dftu/dftu.h"
10- #include " source_io/cube_io.h"
11- #include " source_io/output_log.h"
124#include " source_io/read_wfc_nao.h"
13- #include " source_io/write_elecstat_pot.h"
14- #include " source_io/module_parameter/parameter.h"
15-
16- // be careful of hpp, there may be multiple definitions of functions, 20250302, mohan
17- #include " source_lcao/hs_matrix_k.hpp"
18-
19- #include " source_base/global_function.h"
20- #include " source_cell/module_neighbor/sltk_grid_driver.h"
5+ #include " source_lcao/hs_matrix_k.hpp" // there may be multiple definitions if using hpp
216#include " source_estate/cal_ux.h"
227#include " source_estate/module_charge/symmetry_rho.h"
23- #include " source_estate/occupy.h"
248#include " source_lcao/LCAO_domain.h" // need DeePKS_init
259#include " source_lcao/module_dftu/dftu.h"
26- #include " source_pw/module_pwdft/global.h"
27- #include " source_io/print_info.h"
28-
29- #include < memory>
30-
3110#ifdef __MLALGO
3211#include " source_lcao/module_deepks/LCAO_deepks.h"
3312#include " source_lcao/module_deepks/LCAO_deepks_interface.h"
3413#endif
35- // -----force& stress-------------------
3614#include " source_lcao/FORCE_STRESS.h"
37-
38- // -----HSolver ElecState Hamilt--------
3915#include " source_estate/elecstate_lcao.h"
4016#include " source_lcao/hamilt_lcao.h"
4117#include " source_hsolver/hsolver_lcao.h"
42-
4318#ifdef __EXX
4419#include " ../source_lcao/module_ri/exx_opt_orb.h"
4520#endif
46-
47- // test RDMFT
4821#include " source_lcao/module_rdmft/rdmft.h"
49- #include " source_lcao/module_gint/temp_gint/gint_info.h"
50-
5122#include " source_estate/module_charge/chgmixing.h" // use charge mixing, mohan add 20251006
5223#include " source_estate/module_dm/setup_dm.h" // setup dm from electronic wave functions
5324#include " source_io/ctrl_runner_lcao.h" // use ctrl_runner_lcao()
@@ -96,32 +67,31 @@ void ESolver_KS_LCAO<TK, TR>::before_all_runners(UnitCell& ucell, const Input_pa
9667 // 1) before_all_runners in ESolver_KS
9768 ESolver_KS<TK>::before_all_runners (ucell, inp);
9869
99- // 2) init ElecState
100- // autoset nbands in ElecState before init_basis (for Psi 2d division)
70+ // 2) autoset nbands in ElecState before init_basis (for Psi 2d division)
10171 if (this ->pelec == nullptr )
10272 {
10373 // TK stands for double and std::complex<double>?
10474 this ->pelec = new elecstate::ElecStateLCAO<TK>(&(this ->chr ), &(this ->kv ),
10575 this ->kv .get_nks (), &(this ->GG ), &(this ->GK ), this ->pw_rho , this ->pw_big );
10676 }
10777
108- // 3) read the LCAO orbitals/projectors and construct the interpolation tables.
78+ // 3) read LCAO orbitals/projectors and construct the interpolation tables.
10979 LCAO_domain::init_basis_lcao (this ->pv , inp.onsite_radius , inp.lcao_ecut ,
11080 inp.lcao_dk , inp.lcao_dr , inp.lcao_rmax , ucell, two_center_bundle_, orb_);
11181
11282 // 4) setup EXX calculations
11383 if (PARAM.inp .calculation == " gen_opt_abfs" )
11484 {
115- #ifdef __EXX
85+ #ifdef __EXX
11686 Exx_Opt_Orb exx_opt_orb;
11787 exx_opt_orb.generate_matrix (GlobalC::exx_info.info_opt_abfs , this ->kv , ucell, this ->orb_ );
118- #else
88+ #else
11989 ModuleBase::WARNING_QUIT (" ESolver_KS_LCAO::before_all_runners" , " calculation=gen_opt_abfs must compile __EXX" );
120- #endif
90+ #endif
12191 return ;
12292 }
12393
124- // 5) initialize electronic wave function psi
94+ // 5) init electronic wave function psi
12595 if (this ->psi == nullptr )
12696 {
12797 int nsk = 0 ;
@@ -160,11 +130,10 @@ void ESolver_KS_LCAO<TK, TR>::before_all_runners(UnitCell& ucell, const Input_pa
160130 }
161131 }
162132
163- // 7) initialize the density matrix
164- // DMK are allocated here, but DMR is constructed in before_scf()
133+ // 7) init DMK, but DMR is constructed in before_scf()
165134 dynamic_cast <elecstate::ElecStateLCAO<TK>*>(this ->pelec )->init_DM (&this ->kv , &(this ->pv ), inp.nspin );
166135
167- // 8) initialize exact exchange calculations
136+ // 8) init exact exchange calculations
168137#ifdef __EXX
169138 if (inp.calculation == " scf" || inp.calculation == " relax" || inp.calculation == " cell-relax"
170139 || inp.calculation == " md" )
@@ -198,23 +167,23 @@ void ESolver_KS_LCAO<TK, TR>::before_all_runners(UnitCell& ucell, const Input_pa
198167 dftu->init (ucell, &this ->pv , this ->kv .get_nks (), &orb_);
199168 }
200169
201- // 10) initialize local pseudopotentials
170+ // 10) init local pseudopotentials
202171 this ->locpp .init_vloc (ucell, this ->pw_rho );
203172 ModuleBase::GlobalFunc::DONE (GlobalV::ofs_running, " LOCAL POTENTIAL" );
204173
205- // 11) inititlize the charge density
174+ // 11) init charge density
206175 this ->chr .allocate (inp.nspin );
207176 this ->pelec ->omega = ucell.omega ;
208177
209- // 12) initialize the potential
178+ // 12) init potentials
210179 if (this ->pelec ->pot == nullptr )
211180 {
212181 this ->pelec ->pot = new elecstate::Potential (this ->pw_rhod , this ->pw_rho ,
213182 &ucell, &(this ->locpp .vloc ), &(this ->sf ), &(this ->solvent ),
214183 &(this ->pelec ->f_en .etxc ), &(this ->pelec ->f_en .vtxc ));
215184 }
216185
217- // 13) initialize deepks
186+ // 13) init deepks
218187#ifdef __MLALGO
219188 LCAO_domain::DeePKS_init (ucell, pv, this ->kv .get_nks (), orb_, this ->ld , GlobalV::ofs_running);
220189 if (inp.deepks_scf )
@@ -228,8 +197,7 @@ void ESolver_KS_LCAO<TK, TR>::before_all_runners(UnitCell& ucell, const Input_pa
228197 }
229198#endif
230199
231- // 14) set occupations
232- // tddft does not need to set occupations in the first scf
200+ // 14) set occupations, tddft does not need to set occupations in the first scf
233201 if (inp.ocp && inp.esolver_type != " tddft" )
234202 {
235203 elecstate::fixed_weights (inp.ocp_kb , inp.nbands , inp.nelec ,
@@ -257,7 +225,7 @@ void ESolver_KS_LCAO<TK, TR>::before_all_runners(UnitCell& ucell, const Input_pa
257225 }
258226 }
259227
260- // 16) initialize rdmft, added by jghan
228+ // 16) init rdmft, added by jghan
261229 if (inp.rdmft == true )
262230 {
263231 rdmft_solver.init (this ->GG , this ->GK , this ->pv , ucell,
0 commit comments