Skip to content

Commit 174ea92

Browse files
committed
fix bug in wavefunc
1 parent c969972 commit 174ea92

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

source/module_hsolver/test/hsolver_pw_sup.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ void diago_PAO_in_pw_k2(
192192
wavefunc* p_wf,
193193
const ModuleBase::realArray& tab_at,
194194
const int& lmaxkb,
195+
const UnitCell& ucell,
195196
hamilt::Hamilt<std::complex<float>, base_device::DEVICE_CPU>* phm_in) {
196197
for (int i = 0; i < wvf.size(); i++) {
197198
wvf.get_pointer()[i] = std::complex<float>((float)i + 1, 0);
@@ -207,6 +208,7 @@ void diago_PAO_in_pw_k2(
207208
wavefunc* p_wf,
208209
const ModuleBase::realArray& tab_at,
209210
const int& lmaxkb,
211+
const UnitCell& ucell,
210212
hamilt::Hamilt<std::complex<double>, base_device::DEVICE_CPU>* phm_in) {
211213
for (int i = 0; i < wvf.size(); i++) {
212214
wvf.get_pointer()[i] = std::complex<double>((double)i + 1, 0);

source/module_psi/wavefunc.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_CPU* ctx,
292292
p_wf->atomic_wfc(ucell,
293293
ik,
294294
current_nbasis,
295-
ucell.lmax_ppwf,
296295
lmaxkb,
297296
wfc_basis,
298297
wfcatom,
@@ -387,7 +386,7 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
387386
ModuleIO::read_wfc_pw(filename.str(), wfc_basis, ik, p_wf->nkstot, wfcatom);
388387
}
389388

390-
starting_nw = p_wf->get_starting_nw();
389+
starting_nw = p_wf->get_starting_nw(ucell.natomwfc);
391390
if (starting_nw == 0)
392391
return;
393392
assert(starting_nw > 0);
@@ -399,7 +398,6 @@ void diago_PAO_in_pw_k2(const base_device::DEVICE_GPU* ctx,
399398
p_wf->atomic_wfc(ucell,
400399
ik,
401400
current_nbasis,
402-
lmax_ppwf,
403401
lmaxkb,
404402
wfc_basis,
405403
wfcatom,

source/module_psi/wf_atomic.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ void WF_atomic::print_PAOs(const UnitCell& ucell) const
263263
void WF_atomic::atomic_wfc(const UnitCell& ucell,
264264
const int& ik,
265265
const int& np,
266-
const int& lmax_wfc,
267266
const int& lmaxkb,
268267
const ModulePW::PW_Basis_K* wfc_basis,
269268
ModuleBase::ComplexMatrix& wfcatom,
@@ -280,7 +279,7 @@ void WF_atomic::atomic_wfc(const UnitCell& ucell,
280279
// This routine computes the superposition of atomic
281280
// WF_atomictions for a given k-point.
282281
//=========================================================
283-
const int total_lm = (lmax_wfc + 1) * (lmax_wfc + 1);
282+
const int total_lm = (ucell.lmax_ppwf + 1) * (ucell.lmax_ppwf + 1);
284283
ModuleBase::matrix ylm(total_lm, np);
285284
std::complex<double>* aux = new std::complex<double>[np];
286285
double* chiaux = nullptr;

source/module_psi/wf_atomic.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class WF_atomic
4747
void atomic_wfc(const UnitCell& ucell,
4848
const int& ik,
4949
const int& np,
50-
const int& lmax_wfc,
5150
const int& lmaxkb,
5251
const ModulePW::PW_Basis_K* wfc_basis,
5352
ModuleBase::ComplexMatrix& wfcatom,

0 commit comments

Comments
 (0)