|
10 | 10 | #include "deepks_hmat.h" |
11 | 11 | #include "deepks_orbital.h" |
12 | 12 | #include "deepks_orbpre.h" |
| 13 | +#include "deepks_pdm.h" |
13 | 14 | #include "deepks_spre.h" |
14 | 15 | #include "deepks_vdelta.h" |
15 | 16 | #include "deepks_vdpre.h" |
|
20 | 21 | #include "module_basis/module_ao/parallel_orbitals.h" |
21 | 22 | #include "module_basis/module_nao/two_center_integrator.h" |
22 | 23 | #include "module_cell/module_neighbor/sltk_grid_driver.h" |
23 | | -#include "module_elecstate/module_dm/density_matrix.h" |
24 | 24 | #include "module_hamilt_lcao/module_hcontainer/hcontainer.h" |
25 | 25 | #include "module_io/winput.h" |
26 | 26 |
|
27 | 27 | #include <torch/script.h> |
28 | 28 | #include <torch/torch.h> |
29 | | -#include <unordered_map> |
30 | 29 |
|
31 | 30 | /// |
32 | 31 | /// The LCAO_Deepks contains subroutines for implementation of the DeePKS method in atomic basis. |
@@ -102,7 +101,7 @@ class LCAO_Deepks |
102 | 101 | ModuleBase::IntArray* alpha_index; // seems not used in the code |
103 | 102 | ModuleBase::IntArray* inl_index; // caoyu add 2021-05-07 |
104 | 103 |
|
105 | | - bool init_pdm = false; // for DeePKS NSCF calculation |
| 104 | + bool init_pdm = false; // for DeePKS NSCF calculation, set init_pdm to skip the calculation of pdm in SCF iteration |
106 | 105 |
|
107 | 106 | // deep neural network module that provides corrected Hamiltonian term and |
108 | 107 | // related derivatives. Used in cal_gedm. |
@@ -194,52 +193,6 @@ class LCAO_Deepks |
194 | 193 | const LCAO_Orbitals& orb, |
195 | 194 | const Grid_Driver& GridD); |
196 | 195 |
|
197 | | - //------------------- |
198 | | - // LCAO_deepks_pdm.cpp |
199 | | - //------------------- |
200 | | - |
201 | | - // This file contains subroutines for calculating pdm, |
202 | | - // which is defind as sum_mu,nu rho_mu,nu (<chi_mu|alpha><alpha|chi_nu>); |
203 | | - // as well as gdmx, which is the gradient of pdm, defined as |
204 | | - // sum_mu,nu rho_mu,nu d/dX(<chi_mu|alpha><alpha|chi_nu>) |
205 | | - |
206 | | - // It also contains subroutines for printing pdm and gdmx |
207 | | - // for checking purpose |
208 | | - |
209 | | - // There are 2 subroutines in this file: |
210 | | - // 1. cal_projected_DM, which is used for calculating pdm |
211 | | - // 2. check_projected_dm, which prints pdm to descriptor.dat |
212 | | - |
213 | | - public: |
214 | | - /** |
215 | | - * @brief calculate projected density matrix: |
216 | | - * pdm = sum_i,occ <phi_i|alpha1><alpha2|phi_k> |
217 | | - * 3 cases to skip calculation of pdm: |
218 | | - * 1. NSCF calculation of DeePKS, init_chg = file and pdm has been read |
219 | | - * 2. SCF calculation of DeePKS with init_chg = file and pdm has been read for restarting SCF |
220 | | - * 3. Relax/Cell-Relax/MD calculation, non-first step will use the convergence pdm from the last step as initial |
221 | | - * pdm |
222 | | - */ |
223 | | - template <typename TK> |
224 | | - void cal_projected_DM(const elecstate::DensityMatrix<TK, double>* dm, |
225 | | - const UnitCell& ucell, |
226 | | - const LCAO_Orbitals& orb, |
227 | | - const Grid_Driver& GridD); |
228 | | - |
229 | | - void check_projected_dm(); |
230 | | - |
231 | | - /** |
232 | | - * @brief set init_pdm to skip the calculation of pdm in SCF iteration |
233 | | - */ |
234 | | - void set_init_pdm(bool ipdm) |
235 | | - { |
236 | | - this->init_pdm = ipdm; |
237 | | - } |
238 | | - /** |
239 | | - * @brief read pdm from file, do it only once in whole calculation |
240 | | - */ |
241 | | - void read_projected_DM(bool read_pdm_file, bool is_equiv, const Numerical_Orbital& alpha); |
242 | | - |
243 | 196 | public: |
244 | 197 | //! a temporary interface for cal_e_delta_band |
245 | 198 | template <typename TK> |
|
0 commit comments