Skip to content

Commit 1b6d97a

Browse files
committed
Change all 'psi' into 'phi' in DeePKS.
1 parent 59ac548 commit 1b6d97a

29 files changed

+165
-165
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2060,7 +2060,7 @@ Warning: this function is not robust enough for the current version. Please try
20602060
- **Type**: int
20612061
- **Availability**: numerical atomic orbital basis
20622062
- **Description**: Include V_delta label for DeePKS training. When `deepks_out_labels` is true and `deepks_v_delta` > 0, ABACUS will output h_base.npy, v_delta.npy and h_tot.npy(h_tot=h_base+v_delta).
2063-
Meanwhile, when `deepks_v_delta` equals 1, ABACUS will also output v_delta_precalc.npy, which is used to calculate V_delta during DeePKS training. However, when the number of atoms grows, the size of v_delta_precalc.npy will be very large. In this case, it's recommended to set `deepks_v_delta` as 2, and ABACUS will output psialpha.npy and grad_evdm.npy but not v_delta_precalc.npy. These two files are small and can be used to calculate v_delta_precalc in the procedure of training DeePKS.
2063+
Meanwhile, when `deepks_v_delta` equals 1, ABACUS will also output v_delta_precalc.npy, which is used to calculate V_delta during DeePKS training. However, when the number of atoms grows, the size of v_delta_precalc.npy will be very large. In this case, it's recommended to set `deepks_v_delta` as 2, and ABACUS will output phialpha.npy and grad_evdm.npy but not v_delta_precalc.npy. These two files are small and can be used to calculate v_delta_precalc in the procedure of training DeePKS.
20642064
- **Default**: 0
20652065

20662066
### deepks_out_unittest

source/Makefile.Objects

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ OBJS_DEEPKS=LCAO_deepks.o\
194194
LCAO_deepks_io.o\
195195
LCAO_deepks_mpi.o\
196196
LCAO_deepks_pdm.o\
197-
LCAO_deepks_psialpha.o\
197+
LCAO_deepks_phialpha.o\
198198
LCAO_deepks_torch.o\
199199
LCAO_deepks_vdelta.o\
200200
deepks_hmat.o\

source/module_esolver/lcao_before_scf.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,19 +205,19 @@ void ESolver_KS_LCAO<TK, TR>::before_scf(UnitCell& ucell, const int istep)
205205
}
206206

207207
#ifdef __DEEPKS
208-
// for each ionic step, the overlap <psi|alpha> must be rebuilt
208+
// for each ionic step, the overlap <phi|alpha> must be rebuilt
209209
// since it depends on ionic positions
210210
if (PARAM.globalv.deepks_setorb)
211211
{
212212
const Parallel_Orbitals* pv = &this->pv;
213-
// allocate <psi(0)|alpha(R)>, psialpha is different every ion step, so it is allocated here
214-
GlobalC::ld.allocate_psialpha(PARAM.inp.cal_force, ucell, orb_, this->gd);
215-
// build and save <psi(0)|alpha(R)> at beginning
216-
GlobalC::ld.build_psialpha(PARAM.inp.cal_force, ucell, orb_, this->gd, *(two_center_bundle_.overlap_orb_alpha));
213+
// allocate <phi(0)|alpha(R)>, phialpha is different every ion step, so it is allocated here
214+
GlobalC::ld.allocate_phialpha(PARAM.inp.cal_force, ucell, orb_, this->gd);
215+
// build and save <phi(0)|alpha(R)> at beginning
216+
GlobalC::ld.build_phialpha(PARAM.inp.cal_force, ucell, orb_, this->gd, *(two_center_bundle_.overlap_orb_alpha));
217217

218218
if (PARAM.inp.deepks_out_unittest)
219219
{
220-
GlobalC::ld.check_psialpha(PARAM.inp.cal_force, ucell, orb_, this->gd);
220+
GlobalC::ld.check_phialpha(PARAM.inp.cal_force, ucell, orb_, this->gd);
221221
}
222222
}
223223
#endif

source/module_esolver/lcao_others.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,19 +211,19 @@ void ESolver_KS_LCAO<TK, TR>::others(UnitCell& ucell, const int istep)
211211
}
212212

213213
#ifdef __DEEPKS
214-
// for each ionic step, the overlap <psi|alpha> must be rebuilt
214+
// for each ionic step, the overlap <phi|alpha> must be rebuilt
215215
// since it depends on ionic positions
216216
if (PARAM.globalv.deepks_setorb)
217217
{
218218
const Parallel_Orbitals* pv = &this->pv;
219-
// allocate <psi(0)|alpha(R)>, psialpha is different every ion step, so it is allocated here
220-
GlobalC::ld.allocate_psialpha(PARAM.inp.cal_force, ucell, orb_, this->gd);
221-
// build and save <psi(0)|alpha(R)> at beginning
222-
GlobalC::ld.build_psialpha(PARAM.inp.cal_force, ucell, orb_, this->gd, *(two_center_bundle_.overlap_orb_alpha));
219+
// allocate <phi(0)|alpha(R)>, phialpha is different every ion step, so it is allocated here
220+
GlobalC::ld.allocate_phialpha(PARAM.inp.cal_force, ucell, orb_, this->gd);
221+
// build and save <phi(0)|alpha(R)> at beginning
222+
GlobalC::ld.build_phialpha(PARAM.inp.cal_force, ucell, orb_, this->gd, *(two_center_bundle_.overlap_orb_alpha));
223223

224224
if (PARAM.inp.deepks_out_unittest)
225225
{
226-
GlobalC::ld.check_psialpha(PARAM.inp.cal_force, ucell, orb_, this->gd);
226+
GlobalC::ld.check_phialpha(PARAM.inp.cal_force, ucell, orb_, this->gd);
227227
}
228228
}
229229
#endif

source/module_hamilt_lcao/hamilt_lcaodft/FORCE_STRESS.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ void Force_Stress_LCAO<T>::getForceStress(UnitCell& ucell,
516516
gd,
517517
kv.get_nks(),
518518
kv.kvec_d,
519-
GlobalC::ld.psialpha,
519+
GlobalC::ld.phialpha,
520520
isstress);
521521
}
522522
else
@@ -527,7 +527,7 @@ void Force_Stress_LCAO<T>::getForceStress(UnitCell& ucell,
527527
->get_DMK_vector();
528528

529529
GlobalC::ld
530-
.cal_gdmx(dm_k, ucell, orb, gd, kv.get_nks(), kv.kvec_d, GlobalC::ld.psialpha, isstress);
530+
.cal_gdmx(dm_k, ucell, orb, gd, kv.get_nks(), kv.kvec_d, GlobalC::ld.phialpha, isstress);
531531
}
532532
if (PARAM.inp.deepks_out_unittest)
533533
{

source/module_hamilt_lcao/hamilt_lcaodft/FORCE_gamma.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ void Force_LCAO<double>::ftable(const bool isforce,
266266
GlobalC::ld.lmaxd,
267267
nks,
268268
kv->kvec_d,
269-
GlobalC::ld.psialpha,
269+
GlobalC::ld.phialpha,
270270
GlobalC::ld.gedm,
271271
GlobalC::ld.inl_index,
272272
GlobalC::ld.F_delta,

source/module_hamilt_lcao/hamilt_lcaodft/FORCE_k.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ void Force_LCAO<std::complex<double>>::ftable(const bool isforce,
360360
GlobalC::ld.lmaxd,
361361
kv->get_nks(),
362362
kv->kvec_d,
363-
GlobalC::ld.psialpha,
363+
GlobalC::ld.phialpha,
364364
GlobalC::ld.gedm,
365365
GlobalC::ld.inl_index,
366366
GlobalC::ld.F_delta,

source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/deepks_lcao.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ void hamilt::DeePKS<hamilt::OperatorLCAO<TK, TR>>::calculate_HR()
251251
const Parallel_Orbitals* paraV = this->H_V_delta->get_paraV();
252252
const int npol = this->ucell->get_npol();
253253

254-
// 1. calculate <psi|alpha> for each pair of atoms
254+
// 1. calculate <phi|alpha> for each pair of atoms
255255
for (int iat0 = 0; iat0 < this->ucell->nat; iat0++)
256256
{
257257
auto tau0 = ucell->get_tau(iat0);
@@ -318,7 +318,7 @@ void hamilt::DeePKS<hamilt::OperatorLCAO<TK, TR>>::calculate_HR()
318318
}
319319
std::vector<std::unordered_map<int, std::vector<double>>>& nlm_iat = nlm_tot[iat00];
320320

321-
// 2. calculate <psi_I|beta>D<beta|psi_{J,R}> for each pair of <IJR> atoms
321+
// 2. calculate <phi_I|beta>D<beta|phi_{J,R}> for each pair of <IJR> atoms
322322
for (int ad1 = 0; ad1 < adjs.adj_num + 1; ++ad1)
323323
{
324324
const int T1 = adjs.ntype[ad1];

source/module_hamilt_lcao/module_deepks/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if(ENABLE_DEEPKS)
66
LCAO_deepks_io.cpp
77
LCAO_deepks_mpi.cpp
88
LCAO_deepks_pdm.cpp
9-
LCAO_deepks_psialpha.cpp
9+
LCAO_deepks_phialpha.cpp
1010
LCAO_deepks_torch.cpp
1111
LCAO_deepks_vdelta.cpp
1212
deepks_hmat.cpp

source/module_hamilt_lcao/module_deepks/LCAO_deepks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ LCAO_Deepks::LCAO_Deepks()
3434
inl_index = new ModuleBase::IntArray[1];
3535
inl_l = nullptr;
3636
gedm = nullptr;
37-
this->psialpha.resize(1);
37+
this->phialpha.resize(1);
3838
}
3939

4040
// Desctructor of the class

0 commit comments

Comments
 (0)