Skip to content

Commit 4cf51c6

Browse files
authored
fix: get_pchg_lcao.cpp with c^* c^T (deepmodeling#7821)
* fix pchg with c^* c^T * fix: upadate pchg ref
1 parent 899ad88 commit 4cf51c6

4 files changed

Lines changed: 15 additions & 10 deletions

File tree

source/source_estate/module_dm/cal_dm_psi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ void psiMulPsiMpi(const psi::Psi<std::complex<double>>& psi1,
192192
const int* desc_psi,
193193
const int* desc_dm)
194194
{
195-
ModuleBase::timer::start("psiMulPsiMpi", "pdgemm");
195+
ModuleBase::timer::start("psiMulPsiMpi", "pzgemm");
196196
const std::complex<double> one_complex = {1.0, 0.0}, zero_complex = {0.0, 0.0};
197197
const int one_int = 1;
198198
const char N_char = 'N', T_char = 'T';
@@ -217,7 +217,7 @@ void psiMulPsiMpi(const psi::Psi<std::complex<double>>& psi1,
217217
one_int,
218218
one_int,
219219
desc_dm);
220-
ModuleBase::timer::end("psiMulPsiMpi", "pdgemm");
220+
ModuleBase::timer::end("psiMulPsiMpi", "pzgemm");
221221
}
222222

223223
#endif

source/source_io/module_chgpot/get_pchg_lcao.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,11 @@ void Get_pchg_lcao::idmatrix(const int& ib,
436436
this->psi_k->get_nbasis(),
437437
true);
438438
wg_wfc.set_all_psi(this->psi_k->get_pointer(), wg_wfc.size());
439+
std::complex<double>* wg_wfc_ptr = wg_wfc.get_pointer();
440+
for (int i = 0; i < wg_wfc.size(); ++i)
441+
{
442+
wg_wfc_ptr[i] = std::conj(wg_wfc_ptr[i]);
443+
}
439444

440445
for (int ir = 0; ir < wg_wfc.get_nbands(); ++ir)
441446
{
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
pchgi1s1.cube 0.9999969968
2-
pchgi1s2.cube 0.9999969968
1+
pchgi1s1.cube 0.999999265
2+
pchgi1s2.cube 0.999999265
33
totaltimeref 0.13
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
pchgi1s1k1.cube 0.9999996697
2-
pchgi1s1k2.cube 0.9999956604
3-
pchgi1s1k3.cube 0.9999956604
4-
pchgi1s2k1.cube 0.9999996697
5-
pchgi1s2k2.cube 0.9999956604
6-
pchgi1s2k3.cube 0.9999956604
1+
pchgi1s1k1.cube 0.9999996473
2+
pchgi1s1k2.cube 0.9999991015
3+
pchgi1s1k3.cube 0.9999991015
4+
pchgi1s2k1.cube 0.9999996473
5+
pchgi1s2k2.cube 0.9999991015
6+
pchgi1s2k3.cube 0.9999991015
77
totaltimeref 0.25

0 commit comments

Comments
 (0)