@@ -88,13 +88,11 @@ namespace rdmft
8888// }
8989
9090
91- // now support XC_func_rdmft = "hf", "muller", "power", "pbe", "pbe0". "wp22" and "cwp22" is realizing.
91+ // ! now support XC_func_rdmft = "hf", "muller", "power", "pbe", "pbe0". "wp22" and "cwp22" is realizing.
9292// for the dft-xc-functional part of xc-functional, just use the default is right! Or don't use the function
9393double occNum_func (double eta, int symbol = 0 , const std::string XC_func_rdmft = " hf" , const double alpha_power = 1.0 );
9494
9595
96-
97-
9896template <typename TK>
9997void conj_psi (psi::Psi<TK>& wfc)
10098{
@@ -109,7 +107,7 @@ void conj_psi<double>(psi::Psi<double>& wfc);
109107
110108
111109// wfc and H_wfc need to be k_firest and provide wfc(ik, 0, 0) and H_wfc(ik, 0, 0)
112- // psi::Psi<TK> psi's (), std::vector<TK> HK's [] operator overloading return TK
110+ // ! implement matrix multiplication of Hk^dagger and psi
113111template <typename TK>
114112void HkPsi (const Parallel_Orbitals* ParaV, const TK& HK, const TK& wfc, TK& H_wfc)
115113{
@@ -136,6 +134,7 @@ template <>
136134void HkPsi<double >(const Parallel_Orbitals* ParaV, const double & HK, const double & wfc, double & H_wfc);
137135
138136
137+ // ! implement matrix multiplication of psi^dagger and psi
139138template <typename TK>
140139void psiDotPsi (const Parallel_Orbitals* ParaV, const Parallel_2D& para_Eij_in, const TK& wfc, const TK& H_wfc, std::vector<TK>& Dmn, double * wfcHwfc)
141140{
@@ -176,7 +175,7 @@ void psiDotPsi<double>(const Parallel_Orbitals* ParaV, const Parallel_2D& para_w
176175 const double & wfc, const double & H_wfc, std::vector<double >& Dmn, double * wfcHwfc);
177176
178177
179- // realize occNum_wfc = occNum * wfc. Calling this function and we can get wfc = occNum*wfc.
178+ // ! realize occNum_wfc = occNum * wfc. Calling this function and we can get wfc = occNum*wfc.
180179template <typename TK>
181180void occNum_MulPsi (const Parallel_Orbitals* ParaV, const ModuleBase::matrix& occ_number, psi::Psi<TK>& wfc, int symbol = 0 ,
182181 const std::string XC_func_rdmft = " hf" , const double alpha = 1.0 )
@@ -200,7 +199,7 @@ void occNum_MulPsi(const Parallel_Orbitals* ParaV, const ModuleBase::matrix& occ
200199}
201200
202201
203- // add psi with eta and g(eta)
202+ // ! add psi with eta and g(eta)
204203template <typename TK>
205204void add_psi (const Parallel_Orbitals* ParaV,
206205 const K_Vectors* kv,
@@ -242,8 +241,8 @@ void add_psi(const Parallel_Orbitals* ParaV,
242241}
243242
244243
245- // occNum_wfcHwfc = occNum*wfcHwfc + occNum_wfcHwfc
246- // When symbol = 0, 1, 2, 3, 4, occNum = occNum, 0.5*occNum, g(occNum), 0.5*g(occNum), d_g(occNum)/d_occNum respectively. Default symbol=0.
244+ // ! occNum_wfcHwfc = occNum*wfcHwfc + occNum_wfcHwfc
245+ // ! When symbol = 0, 1, 2, 3, 4, occNum = occNum, 0.5*occNum, g(occNum), 0.5*g(occNum), d_g(occNum)/d_occNum respectively. Default symbol=0.
247246void occNum_Mul_wfcHwfc (const ModuleBase::matrix& occ_number,
248247 const ModuleBase::matrix& wfcHwfc,
249248 ModuleBase::matrix& occNum_wfcHwfc,
@@ -252,8 +251,8 @@ void occNum_Mul_wfcHwfc(const ModuleBase::matrix& occ_number,
252251 const double alpha = 1.0 );
253252
254253
255- // Default symbol = 0 for the gradient of Etotal with respect to occupancy
256- // symbol = 1 for the relevant calculation of Etotal
254+ // ! Default symbol = 0 for the gradient of Etotal with respect to occupancy
255+ // ! symbol = 1 for the relevant calculation of Etotal
257256void add_occNum (const K_Vectors& kv,
258257 const ModuleBase::matrix& occ_number,
259258 const ModuleBase::matrix& wfcHwfc_TV_in,
@@ -265,9 +264,7 @@ void add_occNum(const K_Vectors& kv,
265264 const double alpha = 1.0 );
266265
267266
268- // // do wk*g(occNum)*wfcHwfc and add for TV, hartree, XC. This function just use once, so it can be replace and delete
269- // void add_wfcHwfc(const std::vector<double>& wk_in, const ModuleBase::matrix& occ_number, const ModuleBase::matrix& wfcHwfc_TV_in, const ModuleBase::matrix& wfcHwfc_hartree_in,
270- // const ModuleBase::matrix& wfcHwfc_XC_in, ModuleBase::matrix& occNum_wfcHwfc, const std::string XC_func_rdmft, const double alpha);
267+ // ! do wk*g(occNum)*wfcHwfc and add for TV, hartree, XC. This function just use once, so it can be replace and delete
271268void add_wfcHwfc (const ModuleBase::matrix& wg,
272269 const ModuleBase::matrix& wk_fun_occNum,
273270 const ModuleBase::matrix& wfcHwfc_TV_in,
@@ -278,15 +275,15 @@ void add_wfcHwfc(const ModuleBase::matrix& wg,
278275 const double alpha);
279276
280277
281- // give certain occNum_wfcHwfc, get the corresponding energy
278+ // ! give certain occNum_wfcHwfc, get the corresponding energy
282279double getEnergy (const ModuleBase::matrix& occNum_wfcHwfc);
283280
284281
285282
286283
287284
288285
289- // this part of the code is copying from class Veff and do some modifications.
286+ // ! this part of the code is copying from class Veff and do some modifications.
290287template <typename TK, typename TR>
291288class Veff_rdmft : public hamilt ::OperatorLCAO<TK, TR>
292289{
@@ -429,9 +426,6 @@ class Veff_rdmft : public hamilt::OperatorLCAO<TK, TR>
429426
430427
431428
432-
433-
434-
435429}
436430
437431#endif
0 commit comments