@@ -52,7 +52,6 @@ void Veff<OperatorPW<T, Device>>::act(
5252 {
5353 setmem_complex_op ()(tmhpsi, 0 , nbasis*nbands/npol);
5454 }
55-
5655 int max_npw = nbasis / npol;
5756 const int current_spin = this ->isk [this ->ik ];
5857 const int psi_offset= max_npw * npol;
@@ -69,7 +68,7 @@ void Veff<OperatorPW<T, Device>>::act(
6968 this ->veff + current_spin * this ->veff_col ,
7069 tmhpsi,
7170 true );
72- tmhpsi += psi_offset;
71+ tmhpsi += psi_offset;
7372 tmpsi_in += psi_offset;
7473 }
7574 }else if (npol == 2 && this ->veff_col !=0 )
@@ -87,7 +86,7 @@ void Veff<OperatorPW<T, Device>>::act(
8786 veff_op ()(this ->ctx , this ->veff_col , this ->porter , this ->porter1 , current_veff);
8887 wfcpw->real_to_recip <T, Device>(this ->porter , tmhpsi, this ->ik , true );
8988 wfcpw->real_to_recip <T, Device>(this ->porter1 , tmhpsi + max_npw, this ->ik , true );
90- tmhpsi += psi_offset;
89+ tmhpsi += psi_offset;
9190 tmpsi_in += psi_offset;
9291 }
9392 }else {
@@ -124,8 +123,8 @@ void Veff<OperatorPW<T, Device>>::act(
124123 // FFT back to G space.
125124 wfcpw->real_to_recip <T, Device>(this ->porter , tmhpsi, this ->ik , true );
126125 wfcpw->real_to_recip <T, Device>(this ->porter1 , tmhpsi + max_npw, this ->ik , true );
127- tmhpsi += max_npw * npol ;
128- tmpsi_in += max_npw * npol ;
126+ tmhpsi += psi_offset ;
127+ tmpsi_in += psi_offset ;
129128 }
130129 }else {
131130 ModuleBase::WARNING_QUIT (" VeffPW" , " npol should be 1 or 2 or veff_col equal to 0\n " );
0 commit comments