77#include " source_estate/module_charge/symmetry_rho.h"
88#include " source_lcao/LCAO_domain.h" // need DeePKS_init
99#include " source_lcao/module_dftu/dftu.h"
10- #ifdef __MLALGO
11- #include " source_lcao/module_deepks/LCAO_deepks.h"
12- #include " source_lcao/module_deepks/LCAO_deepks_interface.h"
13- #endif
1410#include " source_lcao/FORCE_STRESS.h"
1511#include " source_estate/elecstate_lcao.h"
1612#include " source_lcao/hamilt_lcao.h"
@@ -203,6 +199,8 @@ void ESolver_KS_LCAO<TK, TR>::cal_force(UnitCell& ucell, ModuleBase::matrix& for
203199
204200 Force_Stress_LCAO<TK> fsl (this ->RA , ucell.nat );
205201
202+ deepks.dpks_out_type = " tot" ; // for deepks method
203+
206204 fsl.getForceStress (ucell,
207205 PARAM.inp .cal_force ,
208206 PARAM.inp .cal_stress ,
@@ -223,10 +221,7 @@ void ESolver_KS_LCAO<TK, TR>::cal_force(UnitCell& ucell, ModuleBase::matrix& for
223221 this ->kv ,
224222 this ->pw_rho ,
225223 this ->solvent ,
226- #ifdef __MLALGO
227- this ->deepks .ld ,
228- " tot" ,
229- #endif
224+ this ->deepks ,
230225 this ->exx_nao ,
231226 &ucell.symm );
232227
@@ -337,43 +332,6 @@ void ESolver_KS_LCAO<TK, TR>::iter_init(UnitCell& ucell, const int istep, const
337332 }
338333#endif
339334 elecstate::setup_dm<TK>(ucell, estate, this ->psi , this ->chr , iter, exx_two_level_step);
340-
341- /*
342- if (iter == 1 && exx_two_level_step == 0)
343- {
344- std::cout << " WAVEFUN -> CHARGE " << std::endl;
345-
346- // calculate the density matrix using read in wave functions
347- // and then calculate the charge density on grid.
348-
349- estate->skip_weights = true;
350- elecstate::calculate_weights(estate->ekb,
351- estate->wg,
352- estate->klist,
353- estate->eferm,
354- estate->f_en,
355- estate->nelec_spin,
356- estate->skip_weights);
357-
358- elecstate::calEBand(estate->ekb, estate->wg, estate->f_en);
359- elecstate::cal_dm_psi(estate->DM->get_paraV_pointer(), estate->wg, *this->psi, *(estate->DM));
360- estate->DM->cal_DMR();
361-
362- estate->psiToRho(*this->psi);
363- estate->skip_weights = false;
364-
365- elecstate::cal_ux(ucell);
366-
367- //! update the potentials by using new electron charge density
368- estate->pot->update_from_charge(&this->chr, &ucell);
369-
370- //! compute the correction energy for metals
371- estate->f_en.descf = estate->cal_delta_escf();
372- }
373-
374- */
375-
376-
377335 }
378336
379337#ifdef __EXX
@@ -410,11 +368,6 @@ void ESolver_KS_LCAO<TK, TR>::iter_init(UnitCell& ucell, const int istep, const
410368 {
411369 this ->p_hamilt ->refresh ();
412370 }
413- // if (iter == 1 && istep == 0)
414- // {
415- // // initialize DMR
416- // this->deepks.ld.init_DMR(ucell, orb_, this->pv, this->gd);
417- // }
418371#endif
419372
420373 if (PARAM.inp .vl_in_h )
@@ -591,11 +544,8 @@ void ESolver_KS_LCAO<TK, TR>::iter_finish(UnitCell& ucell, const int istep, int&
591544 // control the output related to the finished iteration
592545 ModuleIO::ctrl_iter_lcao<TK, TR>(ucell, PARAM.inp , this ->kv , estate,
593546 this ->pv , this ->gd , this ->psi , this ->chr , this ->p_chgmix ,
594- hamilt_lcao, this ->orb_ ,
595- #ifdef __MLALGO
596- this ->deepks .ld ,
597- #endif
598- exx_nao, iter, istep, conv_esolver, this ->scf_ene_thr );
547+ hamilt_lcao, this ->orb_ , this ->deepks ,
548+ this ->exx_nao , iter, istep, conv_esolver, this ->scf_ene_thr );
599549
600550}
601551
0 commit comments