@@ -213,7 +213,7 @@ void DiagoIterAssist<T, Device>::diagH_subspace_init(hamilt::Hamilt<T, Device>*
213213 {
214214 // psi_temp is one band psi, psi is all bands psi, the range always is 1 for the only band in psi_temp
215215 syncmem_complex_op ()(ctx, ctx, ppsi, psi + i * psi_nc, psi_nc);
216- psi::Range band_by_band_range (1 , 0 , 0 , 0 );
216+ psi::Range band_by_band_range (true , 0 , 0 , 0 );
217217 hpsi_info hpsi_in (&psi_temp, band_by_band_range, hpsi);
218218
219219 // H|Psi> to get hpsi for target band
@@ -258,7 +258,7 @@ void DiagoIterAssist<T, Device>::diagH_subspace_init(hamilt::Hamilt<T, Device>*
258258
259259 T* hpsi = temp;
260260 // do hPsi for all bands
261- psi::Range all_bands_range (1 , 0 , 0 , nstart - 1 );
261+ psi::Range all_bands_range (true , 0 , 0 , nstart - 1 );
262262 hpsi_info hpsi_in (&psi_temp, all_bands_range, hpsi);
263263 pHamilt->ops ->hPsi (hpsi_in);
264264
@@ -588,8 +588,9 @@ bool DiagoIterAssist<T, Device>::test_exit_cond(const int& ntry, const int& notc
588588 // ================================================================
589589
590590 bool scf = true ;
591- if (PARAM.inp .calculation == " nscf" )
591+ if (PARAM.inp .calculation == " nscf" ) {
592592 scf = false ;
593+ }
593594
594595 // If ntry <=5, try to do it better, if ntry > 5, exit.
595596 const bool f1 = (ntry <= 5 );
0 commit comments