@@ -209,180 +209,6 @@ void RDMFT<TK, TR>::init(Gint_Gamma& GG_in, Gint_k& GK_in, Parallel_Orbitals& Pa
209209}
210210
211211
212- // template <typename TK, typename TR>
213- // void RDMFT<TK, TR>::update_ion(UnitCell& ucell_in, ModulePW::PW_Basis& rho_basis_in,
214- // ModuleBase::matrix& vloc_in, ModuleBase::ComplexMatrix& sf_in)
215- // {
216- // ucell = &ucell_in;
217- // rho_basis = &rho_basis_in;
218- // vloc = &vloc_in;
219- // sf = &sf_in;
220-
221- // HR_TV->set_zero();
222- // this->cal_V_TV();
223- // #ifdef __EXX
224- // if( GlobalC::exx_info.info_global.cal_exx )
225- // {
226- // if (GlobalC::exx_info.info_ri.real_number)
227- // {
228- // Vxc_fromRI_d->cal_exx_ions();
229- // }
230- // else
231- // {
232- // Vxc_fromRI_c->cal_exx_ions();
233- // }
234- // }
235- // #endif
236-
237- // std::cout << "\n\n\n******\ndo rdmft_esolver.update_ion() successfully\n******\n\n\n" << std::endl;
238- // }
239-
240-
241- // template <typename TK, typename TR>
242- // void RDMFT<TK, TR>::update_elec(const ModuleBase::matrix& occ_number_in, const psi::Psi<TK>& wfc_in, const Charge* charge_in)
243- // {
244- // // update occ_number, wg, wk_fun_occNum
245- // occ_number = (occ_number_in);
246- // wg = (occ_number);
247-
248- // for(int ik=0; ik < wg.nr; ++ik)
249- // {
250- // for(int inb=0; inb < wg.nc; ++inb)
251- // {
252- // wg(ik, inb) *= kv->wk[ik];
253- // wk_fun_occNum(ik, inb) = kv->wk[ik] * occNum_func(occ_number(ik, inb), 2, XC_func_rdmft, alpha_power);
254- // }
255- // }
256-
257- // // update wfc
258- // TK* pwfc_in = &wfc_in(0, 0, 0);
259- // TK* pwfc = &wfc(0, 0, 0);
260- // for(int i=0; i<wfc.size(); ++i) { pwfc[i] = pwfc_in[i];
261- // }
262-
263- // // update charge
264- // this->update_charge();
265-
266- // // "default" = "pbe"
267- // // if( !only_exx_type || this->cal_E_type != 1 )
268- // if( this->cal_E_type != 1 )
269- // {
270- // // the second cal_E_type need the complete pot to get effctive_V to calEband and so on.
271- // this->pelec->pot->update_from_charge(charge, ucell);
272- // }
273-
274- // this->cal_V_hartree();
275- // this->cal_V_XC();
276- // this->cal_Hk_Hpsi();
277- // }
278-
279-
280- // // this code is copying from function ElecStateLCAO<TK>::psiToRho(), in elecstate_lcao.cpp
281- // template <typename TK, typename TR>
282- // void RDMFT<TK, TR>::update_charge()
283- // {
284- // if( PARAM.inp.gamma_only )
285- // {
286- // // calculate DMK and DMR
287- // elecstate::DensityMatrix<TK, double> DM_gamma_only(ParaV, nspin);
288- // elecstate::cal_dm_psi(ParaV, wg, wfc, DM_gamma_only);
289- // DM_gamma_only.init_DMR(&GlobalC::GridD, &GlobalC::ucell);
290- // DM_gamma_only.cal_DMR();
291-
292- // for (int is = 0; is < nspin; is++)
293- // {
294- // ModuleBase::GlobalFunc::ZEROS(charge->rho[is], charge->nrxx);
295- // }
296-
297- // GG->transfer_DM2DtoGrid(DM_gamma_only.get_DMR_vector());
298- // Gint_inout inout(charge->rho, Gint_Tools::job_type::rho, nspin);
299- // GG->cal_gint(&inout);
300-
301- // if (XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5)
302- // {
303- // // for (int is = 0; is < nspin; is++)
304- // // {
305- // // ModuleBase::GlobalFunc::ZEROS(charge->kin_r[is], charge->nrxx);
306- // // }
307- // // Gint_inout inout1(charge->kin_r, Gint_Tools::job_type::tau);
308- // // GG->cal_gint(&inout1);
309- // this->pelec->cal_tau(wfc);
310- // }
311-
312- // charge->renormalize_rho();
313- // }
314- // else
315- // {
316- // // calculate DMK and DMR
317- // elecstate::DensityMatrix<TK, double> DM(ParaV, nspin, kv->kvec_d, nk_total);
318- // elecstate::cal_dm_psi(ParaV, wg, wfc, DM);
319- // DM.init_DMR(&GlobalC::GridD, &GlobalC::ucell);
320- // DM.cal_DMR();
321-
322- // for (int is = 0; is < nspin; is++)
323- // {
324- // ModuleBase::GlobalFunc::ZEROS(charge->rho[is], charge->nrxx);
325- // }
326-
327- // GK->transfer_DM2DtoGrid(DM.get_DMR_vector());
328- // Gint_inout inout(charge->rho, Gint_Tools::job_type::rho, nspin);
329- // GK->cal_gint(&inout);
330-
331- // if (XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5)
332- // {
333- // // for (int is = 0; is < nspin; is++)
334- // // {
335- // // ModuleBase::GlobalFunc::ZEROS(charge->kin_r[is], charge->nrxx);
336- // // }
337- // // Gint_inout inout1(charge->kin_r, Gint_Tools::job_type::tau);
338- // // GK->cal_gint(&inout1);
339- // this->pelec->cal_tau(wfc);
340- // }
341-
342- // charge->renormalize_rho();
343- // }
344-
345- // /*********** what's this? When we use PBE-functional, this can't be deleted *************/
346- // // this->pelec->calculate_weights();
347- // // this->pelec->calEBand();
348- // Symmetry_rho srho;
349- // for (int is = 0; is < nspin; is++)
350- // {
351- // srho.begin(is, *(this->charge), rho_basis, GlobalC::ucell.symm);
352- // }
353- // /*********** what's this? When we use PBE-functional, this can't be deleted *************/
354-
355- // // // what this?
356- // // if(GlobalV::VL_IN_H)
357- // // {
358- // // // update Gint_K
359- // // if (!PARAM.inp.gamma_only)
360- // // {
361- // // this->UHM.GK.renew();
362- // // }
363- // // // update real space Hamiltonian
364- // // // this->p_hamilt->refresh();
365- // // }
366-
367- // }
368-
369-
370- // template <typename TK, typename TR>
371- // void RDMFT<TK, TR>::update_occNumber(const ModuleBase::matrix& occ_number_in)
372- // {
373- // occ_number = (occ_number_in);
374- // wg = (occ_number);
375- // for(int ik=0; ik < wg.nr; ++ik)
376- // {
377- // for(int inb=0; inb < wg.nc; ++inb)
378- // {
379- // wg(ik, inb) *= kv->wk[ik];
380- // wk_fun_occNum(ik, inb) = kv->wk[ik] * occNum_func(occ_number(ik, inb), 2, XC_func_rdmft, alpha_power);
381- // }
382- // }
383- // }
384-
385-
386212template <typename TK, typename TR>
387213void RDMFT<TK, TR>::get_DM_XC(std::vector< std::vector<TK> >& DM_XC)
388214{
0 commit comments