Skip to content

Commit 13f58ff

Browse files
committed
Rename hphi and sphi to hpsi and spsi
1 parent 867c546 commit 13f58ff

File tree

2 files changed

+39
-39
lines changed

2 files changed

+39
-39
lines changed

source/source_hsolver/diago_dav_subspace.cpp

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ Diago_DavSubspace<T, Device>::Diago_DavSubspace(const std::vector<Real>& precond
5151
setmem_complex_op()(this->psi_in_iter, 0, this->nbase_x * this->dim);
5252

5353
// the product of H and psi in the reduced psi set
54-
resmem_complex_op()(this->hphi, this->nbase_x * this->dim, "DAV::hphi");
55-
setmem_complex_op()(this->hphi, 0, this->nbase_x * this->dim);
54+
resmem_complex_op()(this->hpsi, this->nbase_x * this->dim, "DAV::hpsi");
55+
setmem_complex_op()(this->hpsi, 0, this->nbase_x * this->dim);
5656

5757
// the product of S and psi in the reduced psi set
58-
resmem_complex_op()(this->sphi, this->nbase_x * this->dim, "DAV::sphi");
59-
setmem_complex_op()(this->sphi, 0, this->nbase_x * this->dim);
58+
resmem_complex_op()(this->spsi, this->nbase_x * this->dim, "DAV::spsi");
59+
setmem_complex_op()(this->spsi, 0, this->nbase_x * this->dim);
6060

6161
// Hamiltonian on the reduced psi set
6262
resmem_complex_op()(this->hcc, this->nbase_x * this->nbase_x, "DAV::hcc");
@@ -87,8 +87,8 @@ Diago_DavSubspace<T, Device>::~Diago_DavSubspace()
8787
{
8888
delmem_complex_op()(this->psi_in_iter);
8989

90-
delmem_complex_op()(this->hphi);
91-
delmem_complex_op()(this->sphi);
90+
delmem_complex_op()(this->hpsi);
91+
delmem_complex_op()(this->spsi);
9292
delmem_complex_op()(this->hcc);
9393
delmem_complex_op()(this->scc);
9494
delmem_complex_op()(this->vcc);
@@ -138,14 +138,14 @@ int Diago_DavSubspace<T, Device>::diag_once(const HPsiFunc& hpsi_func,
138138

139139
// compute h*psi_in_iter
140140
// NOTE: bands after the first n_band should yield zero
141-
// hphi[:, 0:nbase_x] = H * psi_in_iter[:, 0:nbase_x]
142-
hpsi_func(this->psi_in_iter, this->hphi, this->dim, this->notconv);
141+
// hpsi[:, 0:nbase_x] = H * psi_in_iter[:, 0:nbase_x]
142+
hpsi_func(this->psi_in_iter, this->hpsi, this->dim, this->notconv);
143143

144144
// compute s*psi_in_iter
145-
// sphi[:, 0:nbase_x] = S * psi_in_iter[:, 0:nbase_x]
146-
spsi_func(this->psi_in_iter, this->sphi, this->dim, this->notconv);
145+
// spsi[:, 0:nbase_x] = S * psi_in_iter[:, 0:nbase_x]
146+
spsi_func(this->psi_in_iter, this->spsi, this->dim, this->notconv);
147147

148-
this->cal_elem(this->dim, nbase, this->notconv, this->psi_in_iter, this->sphi, this->hphi, this->hcc, this->scc);
148+
this->cal_elem(this->dim, nbase, this->notconv, this->psi_in_iter, this->spsi, this->hpsi, this->hcc, this->scc);
149149

150150
this->diag_zhegvx(nbase, this->notconv, this->hcc, this->scc, this->nbase_x, &eigenvalue_iter, this->vcc);
151151

@@ -168,8 +168,8 @@ int Diago_DavSubspace<T, Device>::diag_once(const HPsiFunc& hpsi_func,
168168
nbase,
169169
this->notconv,
170170
this->psi_in_iter,
171-
this->hphi,
172-
this->sphi,
171+
this->hpsi,
172+
this->spsi,
173173
this->vcc,
174174
unconv.data(),
175175
&eigenvalue_iter);
@@ -178,8 +178,8 @@ int Diago_DavSubspace<T, Device>::diag_once(const HPsiFunc& hpsi_func,
178178
nbase,
179179
this->notconv,
180180
this->psi_in_iter,
181-
this->sphi,
182-
this->hphi,
181+
this->spsi,
182+
this->hpsi,
183183
this->hcc,
184184
this->scc);
185185

@@ -252,8 +252,8 @@ int Diago_DavSubspace<T, Device>::diag_once(const HPsiFunc& hpsi_func,
252252
nbase,
253253
eigenvalue_in_hsolver,
254254
this->psi_in_iter,
255-
this->hphi,
256-
this->sphi,
255+
this->hpsi,
256+
this->spsi,
257257
this->hcc,
258258
this->scc,
259259
this->vcc);
@@ -276,7 +276,7 @@ void Diago_DavSubspace<T, Device>::cal_grad(const HPsiFunc& hpsi_func,
276276
const int& nbase,
277277
const int& notconv,
278278
T* psi_iter,
279-
T* hphi,
279+
T* hpsi,
280280
T* spsi,
281281
T* vcc,
282282
const int* unconv,
@@ -304,7 +304,7 @@ void Diago_DavSubspace<T, Device>::cal_grad(const HPsiFunc& hpsi_func,
304304
notconv,
305305
nbase,
306306
this->one,
307-
hphi,
307+
hpsi,
308308
this->dim,
309309
vcc,
310310
this->nbase_x,
@@ -334,7 +334,7 @@ void Diago_DavSubspace<T, Device>::cal_grad(const HPsiFunc& hpsi_func,
334334
notconv,
335335
nbase,
336336
this->one,
337-
sphi,
337+
spsi,
338338
this->dim,
339339
vcc,
340340
this->nbase_x,
@@ -393,8 +393,8 @@ void Diago_DavSubspace<T, Device>::cal_grad(const HPsiFunc& hpsi_func,
393393

394394
// update hpsi[:, nbase:nbase+notconv]
395395
// hpsi[:, nbase:nbase+notconv] = H * psi_iter[:, nbase:nbase+notconv]
396-
hpsi_func(psi_iter + nbase * dim, hphi + nbase * this->dim, this->dim, notconv);
397-
spsi_func(psi_iter + nbase * dim, sphi + nbase * this->dim, this->dim, notconv);
396+
hpsi_func(psi_iter + nbase * dim, hpsi + nbase * this->dim, this->dim, notconv);
397+
spsi_func(psi_iter + nbase * dim, spsi + nbase * this->dim, this->dim, notconv);
398398

399399
ModuleBase::timer::tick("Diago_DavSubspace", "cal_grad");
400400
return;
@@ -406,7 +406,7 @@ void Diago_DavSubspace<T, Device>::cal_elem(const int& dim,
406406
const int& notconv,
407407
const T* psi_iter,
408408
const T* spsi,
409-
const T* hphi,
409+
const T* hpsi,
410410
T* hcc,
411411
T* scc)
412412
{
@@ -425,7 +425,7 @@ void Diago_DavSubspace<T, Device>::cal_elem(const int& dim,
425425
this->one,
426426
psi_iter,
427427
this->dim,
428-
&hphi[nbase * this->dim],
428+
&hpsi[nbase * this->dim],
429429
this->dim,
430430
this->zero,
431431
&hcc[nbase * this->nbase_x],
@@ -660,8 +660,8 @@ void Diago_DavSubspace<T, Device>::refresh(const int& dim,
660660
const Real* eigenvalue_in_hsolver,
661661
// const psi::Psi<T, Device>& psi,
662662
T* psi_iter,
663-
T* hphi,
664-
T* sphi,
663+
T* hpsi,
664+
T* spsi,
665665
T* hcc,
666666
T* scc,
667667
T* vcc)
@@ -679,16 +679,16 @@ void Diago_DavSubspace<T, Device>::refresh(const int& dim,
679679
nband,
680680
nbase,
681681
this->one,
682-
this->hphi,
682+
this->hpsi,
683683
this->dim,
684684
this->vcc,
685685
this->nbase_x,
686686
this->zero,
687687
psi_iter + nband * this->dim,
688688
this->dim);
689689

690-
// update hphi
691-
syncmem_complex_op()(hphi, psi_iter + nband * this->dim, this->dim * nband);
690+
// update hpsi
691+
syncmem_complex_op()(hpsi, psi_iter + nband * this->dim, this->dim * nband);
692692

693693
#ifdef __DSP
694694
ModuleBase::gemm_op_mt<T, Device>()
@@ -701,16 +701,16 @@ void Diago_DavSubspace<T, Device>::refresh(const int& dim,
701701
nband,
702702
nbase,
703703
this->one,
704-
this->sphi,
704+
this->spsi,
705705
this->dim,
706706
this->vcc,
707707
this->nbase_x,
708708
this->zero,
709709
psi_iter + nband * this->dim,
710710
this->dim);
711711

712-
// update sphi
713-
syncmem_complex_op()(sphi, psi_iter + nband * this->dim, this->dim * nband);
712+
// update spsi
713+
syncmem_complex_op()(spsi, psi_iter + nband * this->dim, this->dim * nband);
714714

715715
nbase = nband;
716716

source/source_hsolver/diago_dav_subspace.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ class Diago_DavSubspace
8080
T* psi_in_iter = nullptr;
8181

8282
/// the product of H and psi in the reduced basis set
83-
T* hphi = nullptr;
83+
T* hpsi = nullptr;
8484

8585
/// the product of S and psi in the reduced basis set
86-
T* sphi = nullptr;
86+
T* spsi = nullptr;
8787

8888
/// Hamiltonian on the reduced basis
8989
T* hcc = nullptr;
@@ -108,7 +108,7 @@ class Diago_DavSubspace
108108
const int& nbase,
109109
const int& notconv,
110110
T* psi_iter,
111-
T* hphi,
111+
T* hpsi,
112112
T* spsi,
113113
T* vcc,
114114
const int* unconv,
@@ -118,8 +118,8 @@ class Diago_DavSubspace
118118
int& nbase,
119119
const int& notconv,
120120
const T* psi_iter,
121-
const T* sphi,
122-
const T* hphi,
121+
const T* spsi,
122+
const T* hpsi,
123123
T* hcc,
124124
T* scc);
125125

@@ -128,8 +128,8 @@ class Diago_DavSubspace
128128
int& nbase,
129129
const Real* eigenvalue,
130130
T* psi_iter,
131-
T* hphi,
132-
T* sphi,
131+
T* hpsi,
132+
T* spsi,
133133
T* hcc,
134134
T* scc,
135135
T* vcc);

0 commit comments

Comments
 (0)