Skip to content

Commit 72e7023

Browse files
committed
reconstruct the constructor of p_hamilt
1 parent 3c36487 commit 72e7023

File tree

5 files changed

+15
-33
lines changed

5 files changed

+15
-33
lines changed

source/source_esolver/esolver_double_xc.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,8 @@ void ESolver_DoubleXC<TK, TR>::before_scf(UnitCell& ucell, const int istep)
154154
this->kv,
155155
this->two_center_bundle_,
156156
this->orb_,
157-
DM
158-
#ifdef __MLALGO
159-
,
160-
&this->ld
161-
#endif
157+
DM,
158+
this->deepks
162159
#ifdef __EXX
163160
,
164161
istep,

source/source_esolver/lcao_before_scf.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,7 @@ void ESolver_KS_LCAO<TK, TR>::before_scf(UnitCell& ucell, const int istep)
129129
PARAM.globalv.gamma_only_local ? &(this->GG) : nullptr,
130130
PARAM.globalv.gamma_only_local ? nullptr : &(this->GK),
131131
ucell, this->gd, &this->pv, this->pelec->pot, this->kv,
132-
two_center_bundle_, orb_, DM
133-
#ifdef __MLALGO
134-
,
135-
&this->ld
136-
#endif
132+
two_center_bundle_, orb_, DM, this->deepks
137133
#ifdef __EXX
138134
,
139135
istep,

source/source_esolver/lcao_others.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,8 @@ void ESolver_KS_LCAO<TK, TR>::others(UnitCell& ucell, const int istep)
230230
this->kv,
231231
two_center_bundle_,
232232
orb_,
233-
DM
234-
#ifdef __MLALGO
235-
,
236-
&this->ld
237-
#endif
233+
DM,
234+
this->deepks
238235
#ifdef __EXX
239236
,
240237
istep,

source/source_lcao/hamilt_lcao.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,8 @@ HamiltLCAO<TK, TR>::HamiltLCAO(Gint_Gamma* GG_in,
7979
const K_Vectors& kv_in,
8080
const TwoCenterBundle& two_center_bundle,
8181
const LCAO_Orbitals& orb,
82-
elecstate::DensityMatrix<TK, double>* DM_in
83-
#ifdef __MLALGO
84-
,
85-
LCAO_Deepks<TK>* ld_in
86-
#endif
82+
elecstate::DensityMatrix<TK, double>* DM_in,
83+
DeePKS<TK> &deepks
8784
#ifdef __EXX
8885
,
8986
const int istep,
@@ -214,7 +211,7 @@ HamiltLCAO<TK, TR>::HamiltLCAO(Gint_Gamma* GG_in,
214211
&orb,
215212
this->kv->get_nks(),
216213
DM_in,
217-
ld_in);
214+
deepks.ld);
218215
this->getOperator()->add(deepks);
219216
this->V_delta_R = dynamic_cast<DeePKS<OperatorLCAO<TK, TR>>*>(deepks)->get_V_delta_R();
220217
}
@@ -330,7 +327,7 @@ HamiltLCAO<TK, TR>::HamiltLCAO(Gint_Gamma* GG_in,
330327
#ifdef __MLALGO
331328
if (PARAM.inp.deepks_scf)
332329
{
333-
Operator<TK>* deepks = new DeePKS<OperatorLCAO<TK, TR>>(this->hsk,
330+
Operator<TK>* deepks_op = new DeePKS<OperatorLCAO<TK, TR>>(this->hsk,
334331
this->kv->kvec_d,
335332
hR,
336333
&ucell,
@@ -339,9 +336,9 @@ HamiltLCAO<TK, TR>::HamiltLCAO(Gint_Gamma* GG_in,
339336
&orb,
340337
this->kv->get_nks(),
341338
DM_in,
342-
ld_in);
343-
this->getOperator()->add(deepks);
344-
this->V_delta_R = dynamic_cast<DeePKS<OperatorLCAO<TK, TR>>*>(deepks)->get_V_delta_R();
339+
deepks.ld);
340+
this->getOperator()->add(deepks_op);
341+
this->V_delta_R = dynamic_cast<DeePKS<OperatorLCAO<TK, TR>>*>(deepks_op)->get_V_delta_R();
345342
}
346343
#endif
347344
// TDDFT_velocity_gauge

source/source_lcao/hamilt_lcao.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414

1515
#include <vector>
1616

17-
#ifdef __MLALGO
18-
#include "source_lcao/module_deepks/LCAO_deepks.h"
19-
#endif
17+
#include "source_lcao/setup_deepks.h" // mohan add 20251008
2018

2119
#ifdef __EXX
2220
#include "source_lcao/module_ri/Exx_LRI.h"
@@ -50,11 +48,8 @@ class HamiltLCAO : public Hamilt<TK>
5048
const K_Vectors& kv_in,
5149
const TwoCenterBundle& two_center_bundle,
5250
const LCAO_Orbitals& orb,
53-
elecstate::DensityMatrix<TK, double>* DM_in
54-
#ifdef __MLALGO
55-
,
56-
LCAO_Deepks<TK>* ld_in
57-
#endif
51+
elecstate::DensityMatrix<TK, double>* DM_in,
52+
DeePKS<TK> &deepks
5853
#ifdef __EXX
5954
,
6055
const int istep,

0 commit comments

Comments
 (0)