@@ -938,24 +938,7 @@ void ESolver_KS_LCAO<TK, TR>::iter_finish(const int istep, int& iter)
938938 }
939939 }
940940
941- // 2.5) determine whether rdmft needs to get the initial value, added by jghan, 2024-10-25
942- int one_step_exx = false ;
943- bool get_init_value_rdmft = false ;
944- if ( iter == 1 ) get_init_value_rdmft = true ; // the case without hybrid functionals
945941#ifdef __EXX
946- if ( GlobalC::exx_info.info_global .cal_exx )
947- {
948- if ( this ->conv_esolver ) one_step_exx = true ;
949- // the case with hybrid functionals, calculate rdmft just after updateExx, cal once in one inner loop
950- if ( one_step_exx ) get_init_value_rdmft = true ;
951- else get_init_value_rdmft = false ;
952- }
953- #endif
954-
955- #ifdef __EXX
956-
957- if ( GlobalC::exx_info.info_global .cal_exx && this ->conv_esolver ) one_step_exx = true ;
958-
959942 // 3) save exx matrix
960943 if (PARAM.inp .calculation != " nscf" )
961944 {
@@ -1037,23 +1020,6 @@ void ESolver_KS_LCAO<TK, TR>::iter_finish(const int istep, int& iter)
10371020 {
10381021 GlobalC::dftu.initialed_locale = true ;
10391022 }
1040-
1041- // 7) rdmft, added by jghan, 2024-10-25
1042- if ( PARAM.inp .rdmft == true && get_init_value_rdmft )
1043- {
1044- ModuleBase::matrix occ_number_ks (this ->pelec ->wg );
1045- for (int ik=0 ; ik < occ_number_ks.nr ; ++ik) { for (int inb=0 ; inb < occ_number_ks.nc ; ++inb) occ_number_ks (ik, inb) /= this ->kv .wk [ik]; }
1046- this ->rdmft_solver .update_elec (occ_number_ks, *(this ->psi ));
1047-
1048- // initialize the gradients of Etotal on occupation numbers and wfc, and set all elements to 0.
1049- ModuleBase::matrix dE_dOccNum (this ->pelec ->wg .nr , this ->pelec ->wg .nc , true );
1050- psi::Psi<TK> dE_dWfc (this ->psi ->get_nk (), this ->psi ->get_nbands (), this ->psi ->get_nbasis ());
1051- dE_dWfc.zero_out ();
1052-
1053- double Etotal_RDMFT = this ->rdmft_solver .run (dE_dOccNum, dE_dWfc);
1054- // break;
1055- }
1056-
10571023}
10581024
10591025// ------------------------------------------------------------------------------
0 commit comments