template <typename FPTYPE, typename Device>
void ESolver_KS_PW<FPTYPE, Device>::Init(Input& inp, UnitCell& ucell)
ESolver_KS<FPTYPE, Device>::Init(inp, ucell); // <- we just leave from here
if (this->phsol == nullptr)
this->phsol = new hsolver::HSolverPW<FPTYPE, Device>(this->pw_wfc, &this->wf);
if (this->pelec == nullptr)
this->pelec = new elecstate::ElecStatePW<FPTYPE, Device>(this->pw_wfc, &(this->chr), &(this->kv), this->pw_rho, this->pw_big);
// Initialize the charge density
this->pelec->charge->allocate(GlobalV::NSPIN);
this->pelec->omega = GlobalC::ucell.omega;
// Initialize the potential
if (this->pelec->pot == nullptr)
this->pelec->pot = new elecstate::Potential(this->pw_rho, &GlobalC::ucell, &(GlobalC::ppcell.vloc), &(this->sf), &(this->pelec->f_en.etxc), &(this->pelec->f_en.vtxc));
this->Init_GlobalC(inp, ucell);
if (GlobalV::ocp) this->pelec->fixed_weights(GlobalV::ocp_kb);