@@ -84,7 +84,7 @@ template<typename T, typename TR>
8484void LR ::ESolver_LR<T, TR >::parameter_check()const
8585{
8686 const std::set<std::string> lr_solvers = { " dav" , " lapack" , " spectrum" , " dav_subspace" , " cg" };
87- const std::set<std::string> xc_kernels = { " rpa" , " lda" , " pwlda" , " pbe" , " hf" , " hse" };
87+ const std::set<std::string> xc_kernels = { " rpa" , " lda" , " pwlda" , " pbe" , " hf" , " hse" , " pbe0 " };
8888 if (lr_solvers.find (this ->input .lr_solver ) == lr_solvers.end ())
8989 {
9090 throw std::invalid_argument (" ESolver_LR: unknown type of lr_solver" );
@@ -255,7 +255,7 @@ LR::ESolver_LR<T, TR>::ESolver_LR(ModuleESolver::ESolver_KS_LCAO<T, TR>&& ks_sol
255255 init_pot (*ks_sol.pelec ->charge );
256256
257257#ifdef __EXX
258- if (xc_kernel == " hf " || xc_kernel == " hse " )
258+ if (exx_kernel_list (). find ( xc_kernel) != exx_kernel_list (). end () )
259259 {
260260 // if the same kernel is calculated in the esolver_ks, move it
261261 std::string dft_functional = LR_Util::tolower (input.dft_functional );
@@ -266,10 +266,10 @@ LR::ESolver_LR<T, TR>::ESolver_LR(ModuleESolver::ESolver_KS_LCAO<T, TR>&& ks_sol
266266 } else // construct C, V from scratch
267267 {
268268 // set ccp_type according to the xc_kernel
269- if (xc_kernel == " hf" ) { exx_info.info_global .ccp_type = Conv_Coulomb_Pot_K::Ccp_Type::Hf; }
269+ if (xc_kernel == " hf" || xc_kernel == " pbe0 " ) { exx_info.info_global .ccp_type = Conv_Coulomb_Pot_K::Ccp_Type::Hf; }
270270 else if (xc_kernel == " hse" ) { exx_info.info_global .ccp_type = Conv_Coulomb_Pot_K::Ccp_Type::Erfc; }
271271 this ->exx_lri = std::make_shared<Exx_LRI<T>>(exx_info.info_ri );
272- this ->exx_lri ->init (MPI_COMM_WORLD , ucell,this ->kv , ks_sol.orb_ );
272+ this ->exx_lri ->init (MPI_COMM_WORLD , ucell,this ->kv , ks_sol.orb_ );
273273 this ->exx_lri ->cal_exx_ions (ucell,input.out_ri_cv );
274274 }
275275 }
@@ -442,8 +442,8 @@ LR::ESolver_LR<T, TR>::ESolver_LR(const Input_para& inp, UnitCell& ucell) : inpu
442442 // 1. EXX xc_kernel
443443 // 2. cal_force with ground state with EXX functional
444444#ifdef __EXX
445- if (((xc_kernel == " hf " || xc_kernel == " hse " ) && this ->input .lr_solver != " spectrum" )
446- || (PARAM .inp .cal_force && (PARAM . inp . dft_functional == " hf " || PARAM .inp .dft_functional == " hse " )))
445+ if (((exx_kernel_list (). count ( xc_kernel) ) && this ->input .lr_solver != " spectrum" )
446+ || (PARAM .inp .cal_force && (exx_kernel_list (). count ( PARAM .inp .dft_functional ) )))
447447 {
448448 // set ccp_type according to the xc_kernel
449449 if (xc_kernel == " hf" ) { exx_info.info_global .ccp_type = Conv_Coulomb_Pot_K::Ccp_Type::Hf; }
@@ -516,6 +516,7 @@ void LR::ESolver_LR<T, TR>::runner(UnitCell& ucell, const int istep)
516516 if (input.lr_solver != " lapack" ) { pre_op.act (1 , nloc_per_band, 1 , precondition.data (), precondition.data ()); }
517517 // auto spin_types = std::vector<std::string>({ "singlet", "triplet" });
518518 this ->spin_types = { " singlet" , " triplet" };
519+ // for (int is = 0;is < nspin - 1;++is)
519520 for (int is = 0 ;is < nspin;++is)
520521 {
521522 std::cout << " Calculating " << spin_types[is] << " excitations" << std::endl;
@@ -605,6 +606,7 @@ void LR::ESolver_LR<T, TR>::after_all_runners(UnitCell& ucell)
605606 double lambda_min = std::min (abs_wavelen_range[1 ], abs_wavelen_range[0 ]);
606607 for (int i = 0 ;i < freq.size ();++i) { freq[i] = 91.126664 / (lambda_min + 0.01 * static_cast <double >(i + 1 ) * lambda_diff); }
607608 // auto spin_types = (nspin == 2 && !openshell) ? std::vector<std::string>({ "singlet", "triplet" }) : std::vector<std::string>({ "updown" });
609+ // for (int is = 0;is < this->X.size() - 1;++is)
608610 for (int is = 0 ;is < this ->X .size ();++is)
609611 {
610612 LR_Spectrum<T> spectrum (nspin, this ->nbasis , this ->nocc , this ->nvirt , this ->gint_ , *this ->pw_rho , *this ->psi_ks ,
0 commit comments