|
4 | 4 | //========================================================== |
5 | 5 |
|
6 | 6 | #include "rdmft.h" |
| 7 | +#include "module_rdmft/rdmft_tools.h" |
7 | 8 |
|
8 | | -// #ifdef __EXX |
9 | | -// #include "module_ri/RI_2D_Comm.h" |
10 | | -// #include "module_ri/Exx_LRI.h" |
11 | | -// #endif |
12 | | -// #include "module_hamilt_general/operator.h" |
13 | | -// #include "module_hamilt_lcao/module_hcontainer/hcontainer.h" |
14 | | -// #include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/operator_lcao.h" |
15 | | -// #include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_exx_lcao.h" |
16 | | -// #include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/ekinetic_new.h" |
17 | | -// #include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/nonlocal_new.h" |
18 | | -// #include "module_hamilt_lcao/hamilt_lcaodft/operator_lcao/veff_lcao.h" |
| 9 | +#include "module_psi/psi.h" |
| 10 | +#include "module_elecstate/module_dm/cal_dm_psi.h" |
19 | 11 |
|
20 | 12 | namespace rdmft |
21 | 13 | { |
22 | 14 |
|
23 | 15 |
|
| 16 | + |
| 17 | +template <typename TK, typename TR> |
| 18 | +void RDMFT<TK, TR>::get_DM_XC(std::vector< std::vector<TK> >& DM_XC) |
| 19 | +{ |
| 20 | + // get wk_funEta_wfc = wk*g(eta)*conj(wfc) |
| 21 | + psi::Psi<TK> wk_funEta_wfc(wfc); |
| 22 | + conj_psi(wk_funEta_wfc); |
| 23 | + occNum_MulPsi(ParaV, wk_fun_occNum, wk_funEta_wfc, 0); |
| 24 | + |
| 25 | + // get the special DM_XC used in constructing V_exx_XC |
| 26 | + for(int ik=0; ik<wfc.get_nk(); ++ik) |
| 27 | + { |
| 28 | + // after this, be careful with wfc.get_pointer(), we can use &wfc(ik,inbn,inbs) instead |
| 29 | + wfc.fix_k(ik); |
| 30 | + wk_funEta_wfc.fix_k(ik); |
| 31 | + TK* DM_Kpointer = DM_XC[ik].data(); |
| 32 | +#ifdef __MPI |
| 33 | + elecstate::psiMulPsiMpi(wk_funEta_wfc, wfc, DM_Kpointer, ParaV->desc_wfc, ParaV->desc); |
| 34 | +#else |
| 35 | + elecstate::psiMulPsi(wk_funEta_wfc, wfc, DM_Kpointer); |
| 36 | +#endif |
| 37 | + } |
| 38 | +} |
| 39 | + |
| 40 | + |
24 | 41 | template <typename TK, typename TR> |
25 | 42 | void RDMFT<TK, TR>::cal_V_TV() |
26 | 43 | { |
@@ -315,22 +332,8 @@ void RDMFT<TK, TR>::cal_V_XC() |
315 | 332 |
|
316 | 333 |
|
317 | 334 |
|
318 | | - |
319 | | - |
320 | | - |
321 | | - |
322 | | - |
323 | | - |
324 | | - |
325 | | - |
326 | | - |
327 | | - |
328 | | - |
329 | | - |
330 | | - |
331 | | - |
332 | | - |
333 | | - |
334 | | - |
| 335 | +template class RDMFT<double, double>; |
| 336 | +template class RDMFT<std::complex<double>, double>; |
| 337 | +template class RDMFT<std::complex<double>, std::complex<double>>; |
335 | 338 |
|
336 | 339 | } |
0 commit comments