@@ -312,7 +312,16 @@ void ESolver_KS_PW<T, Device>::before_scf(const int istep)
312312 // does is only to initialize for once...
313313 if (((PARAM.inp .init_wfc == " random" ) && (istep == 0 )) || (PARAM.inp .init_wfc != " random" ))
314314 {
315- this ->p_wf_init ->initialize_psi (this ->psi , this ->kspw_psi , this ->p_hamilt , GlobalV::ofs_running);
315+ this ->p_wf_init ->initialize_psi (this ->psi ,
316+ this ->kspw_psi ,
317+ this ->p_hamilt ,
318+ GlobalV::ofs_running,
319+ this ->already_initpsi );
320+
321+ if (this ->already_initpsi == false )
322+ {
323+ this ->already_initpsi = true ;
324+ }
316325 }
317326}
318327
@@ -362,20 +371,20 @@ void ESolver_KS_PW<T, Device>::hamilt2density_single(const int istep, const int
362371 // ---------------------------------------------------------------------------------------------------------------
363372 // ---------------------------------for psi init guess!!!!--------------------------------------------------------
364373 // ---------------------------------------------------------------------------------------------------------------
365- if (!PARAM.inp .psi_initializer && PARAM.inp .basis_type == " pw" && this ->init_psi == false )
366- {
367- for (int ik = 0 ; ik < this ->pw_wfc ->nks ; ++ik)
368- {
369- // ! Update Hamiltonian from other kpoint to the given one
370- this ->p_hamilt ->updateHk (ik);
371-
372- // ! Fix the wavefunction to initialize at given kpoint
373- this ->kspw_psi ->fix_k (ik);
374-
375- // / for psi init guess!!!!
376- hamilt::diago_PAO_in_pw_k2 (this ->ctx , ik, *(this ->kspw_psi ), this ->pw_wfc , &this ->wf , this ->p_hamilt );
377- }
378- }
374+ // if (!PARAM.inp.psi_initializer && PARAM.inp.basis_type == "pw" && this->already_initpsi == false)
375+ // {
376+ // for (int ik = 0; ik < this->pw_wfc->nks; ++ik)
377+ // {
378+ // //! Update Hamiltonian from other kpoint to the given one
379+ // this->p_hamilt->updateHk(ik);
380+
381+ // //! Fix the wavefunction to initialize at given kpoint
382+ // this->kspw_psi->fix_k(ik);
383+
384+ // /// for psi init guess!!!!
385+ // hamilt::diago_PAO_in_pw_k2(this->ctx, ik, *(this->kspw_psi), this->pw_wfc, &this->wf, this->p_hamilt);
386+ // }
387+ // }
379388 // ---------------------------------------------------------------------------------------------------------------
380389 // ---------------------------------END: for psi init guess!!!!--------------------------------------------------------
381390 // ---------------------------------------------------------------------------------------------------------------
@@ -400,7 +409,7 @@ void ESolver_KS_PW<T, Device>::hamilt2density_single(const int istep, const int
400409 GlobalV::NPROC_IN_POOL,
401410 skip_charge);
402411
403- this ->init_psi = true ;
412+ // this->already_initpsi = true;
404413
405414 Symmetry_rho srho;
406415 for (int is = 0 ; is < PARAM.inp .nspin ; is++)
0 commit comments