diff --git a/source/module_hamilt_general/module_xc/exx_info.h b/source/module_hamilt_general/module_xc/exx_info.h index 5fd3dd5413..9167b99262 100644 --- a/source/module_hamilt_general/module_xc/exx_info.h +++ b/source/module_hamilt_general/module_xc/exx_info.h @@ -6,7 +6,6 @@ #include #include -#include #include struct Exx_Info @@ -15,7 +14,8 @@ struct Exx_Info { bool cal_exx = false; - std::unordered_map>> coulomb_param; + std::map>> coulomb_param; + // Fock: // "alpha": "0" // "Rcut_type": "limits" / "spencer" @@ -34,7 +34,6 @@ struct Exx_Info bool separate_loop = true; size_t hybrid_step = 1; - bool exx_symmetry_realspace = true; }; Exx_Info_Global info_global; @@ -52,7 +51,8 @@ struct Exx_Info struct Exx_Info_RI { - const std::unordered_map>> &coulomb_param; + const std::map>> &coulomb_param; + bool real_number = false; @@ -66,6 +66,7 @@ struct Exx_Info double C_grad_R_threshold = 0; double V_grad_R_threshold = 0; double ccp_rmesh_times = 10; + bool exx_symmetry_realspace = true; double kmesh_times = 4; int abfs_Lmax = 0; // tmp diff --git a/source/module_io/input_conv.cpp b/source/module_io/input_conv.cpp index a6d77f2ae6..549348dd0f 100644 --- a/source/module_io/input_conv.cpp +++ b/source/module_io/input_conv.cpp @@ -446,7 +446,6 @@ void Input_Conv::Convert() GlobalC::exx_info.info_global.separate_loop = PARAM.inp.exx_separate_loop; GlobalC::exx_info.info_global.hybrid_step = PARAM.inp.exx_hybrid_step; GlobalC::exx_info.info_global.mixing_beta_for_loop1 = PARAM.inp.exx_mixing_beta; - GlobalC::exx_info.info_global.exx_symmetry_realspace = PARAM.inp.exx_symmetry_realspace; GlobalC::exx_info.info_ri.real_number = std::stoi(PARAM.inp.exx_real_number); GlobalC::exx_info.info_ri.pca_threshold = PARAM.inp.exx_pca_threshold; @@ -458,6 +457,7 @@ void Input_Conv::Convert() GlobalC::exx_info.info_ri.C_grad_R_threshold = PARAM.inp.exx_c_grad_r_threshold; GlobalC::exx_info.info_ri.V_grad_R_threshold = PARAM.inp.exx_v_grad_r_threshold; GlobalC::exx_info.info_ri.ccp_rmesh_times = std::stod(PARAM.inp.exx_ccp_rmesh_times); + GlobalC::exx_info.info_ri.exx_symmetry_realspace = PARAM.inp.exx_symmetry_realspace; #ifdef __EXX Exx_Abfs::Jle::Lmax = PARAM.inp.exx_opt_orb_lmax; diff --git a/source/module_rdmft/rdmft_pot.cpp b/source/module_rdmft/rdmft_pot.cpp index e576c17942..5ded972395 100644 --- a/source/module_rdmft/rdmft_pot.cpp +++ b/source/module_rdmft/rdmft_pot.cpp @@ -262,7 +262,7 @@ void RDMFT::cal_V_XC(const UnitCell& ucell) : RI_2D_Comm::split_m2D_ktoR(ucell,*kv, DM_XC_pointer, *ParaV, nspin, this->exx_spacegroup_symmetry); // provide the Ds_XC to Vxc_fromRI(V_exx_XC) - if (this->exx_spacegroup_symmetry && GlobalC::exx_info.info_global.exx_symmetry_realspace) + if (this->exx_spacegroup_symmetry && GlobalC::exx_info.info_ri.exx_symmetry_realspace) { Vxc_fromRI_d->cal_exx_elec(Ds_XC_d, ucell,*ParaV, &this->symrot_exx); } @@ -291,7 +291,7 @@ void RDMFT::cal_V_XC(const UnitCell& ucell) : RI_2D_Comm::split_m2D_ktoR>(ucell,*kv, DM_XC_pointer, *ParaV, nspin, this->exx_spacegroup_symmetry); // // provide the Ds_XC to Vxc_fromRI(V_exx_XC) - if (this->exx_spacegroup_symmetry && GlobalC::exx_info.info_global.exx_symmetry_realspace) + if (this->exx_spacegroup_symmetry && GlobalC::exx_info.info_ri.exx_symmetry_realspace) { Vxc_fromRI_c->cal_exx_elec(Ds_XC_c, ucell,*ParaV, &this->symrot_exx); } diff --git a/source/module_ri/Exx_LRI.hpp b/source/module_ri/Exx_LRI.hpp index 54d401c02e..3b3cb1a13e 100644 --- a/source/module_ri/Exx_LRI.hpp +++ b/source/module_ri/Exx_LRI.hpp @@ -48,7 +48,8 @@ void Exx_LRI::init(const MPI_Comm &mpi_comm_in, { this->abfs = Exx_Abfs::IO::construct_abfs( abfs_same_atom, orb, this->info.files_abfs, this->info.kmesh_times ); } Exx_Abfs::Construct_Orbs::print_orbs_size(ucell, this->abfs, GlobalV::ofs_running); - const std::unordered_map>> + const std::map>> + coulomb_param_updated = RI_Util::update_coulomb_param(this->info.coulomb_param, ucell.omega, this->p_kv->get_nkstot_full()); this->abfs_ccp = Conv_Coulomb_Pot_K::cal_orbs_ccp(this->abfs, coulomb_param_updated, this->info.ccp_rmesh_times); diff --git a/source/module_ri/Exx_LRI_interface.hpp b/source/module_ri/Exx_LRI_interface.hpp index 73a0f8b4b2..2d04ec5139 100644 --- a/source/module_ri/Exx_LRI_interface.hpp +++ b/source/module_ri/Exx_LRI_interface.hpp @@ -254,7 +254,7 @@ void Exx_LRI_Interface::exx_eachiterinit(const int istep, PARAM.inp.nspin, this->exx_spacegroup_symmetry); - if (this->exx_spacegroup_symmetry && GlobalC::exx_info.info_global.exx_symmetry_realspace) + if (this->exx_spacegroup_symmetry && GlobalC::exx_info.info_ri.exx_symmetry_realspace) { this->cal_exx_elec(Ds, ucell,*dm_in.get_paraV_pointer(), &this->symrot_); } else { this->cal_exx_elec(Ds, ucell,*dm_in.get_paraV_pointer()); } @@ -445,7 +445,7 @@ bool Exx_LRI_Interface::exx_after_converge( ? RI_2D_Comm::split_m2D_ktoR(ucell,*this->exx_ptr->p_kv, this->mix_DMk_2D.get_DMk_gamma_out(), *dm.get_paraV_pointer(), nspin) : RI_2D_Comm::split_m2D_ktoR(ucell,*this->exx_ptr->p_kv, this->mix_DMk_2D.get_DMk_k_out(), *dm.get_paraV_pointer(), nspin, this->exx_spacegroup_symmetry); - if (this->exx_spacegroup_symmetry && GlobalC::exx_info.info_global.exx_symmetry_realspace) + if (this->exx_spacegroup_symmetry && GlobalC::exx_info.info_ri.exx_symmetry_realspace) { this->cal_exx_elec(Ds, ucell, *dm.get_paraV_pointer(), &this->symrot_); } else { this->cal_exx_elec(Ds, ucell, *dm.get_paraV_pointer()); } // restore DM but not Hexx diff --git a/source/module_ri/RI_Util.h b/source/module_ri/RI_Util.h index 5478d6d2ff..f90c194844 100644 --- a/source/module_ri/RI_Util.h +++ b/source/module_ri/RI_Util.h @@ -15,7 +15,6 @@ #include #include #include -#include #include namespace RI_Util @@ -63,9 +62,9 @@ namespace RI_Util return m_new; } - std::unordered_map>> + std::map>> update_coulomb_param( - const std::unordered_map>> &coulomb_param, + const std::map>> &coulomb_param, const double volumn, const int nkstot); } diff --git a/source/module_ri/RI_Util.hpp b/source/module_ri/RI_Util.hpp index a076d94f66..d8c027df42 100644 --- a/source/module_ri/RI_Util.hpp +++ b/source/module_ri/RI_Util.hpp @@ -67,13 +67,13 @@ namespace RI_Util } */ - inline std::unordered_map>> + inline std::map>> update_coulomb_param( - const std::unordered_map>> &coulomb_param, + const std::map>> &coulomb_param, const double volumn, const int nkstot) { - std::unordered_map>> coulomb_param_updated = coulomb_param; + std::map>> coulomb_param_updated = coulomb_param; for(auto ¶m_list : coulomb_param_updated) { for(auto ¶m : param_list.second) diff --git a/source/module_ri/conv_coulomb_pot_k.cpp b/source/module_ri/conv_coulomb_pot_k.cpp index 29b48e1512..d9936c37e7 100644 --- a/source/module_ri/conv_coulomb_pot_k.cpp +++ b/source/module_ri/conv_coulomb_pot_k.cpp @@ -44,7 +44,7 @@ namespace Conv_Coulomb_Pot_K template<> Numerical_Orbital_Lm cal_orbs_ccp( const Numerical_Orbital_Lm &orbs, - const std::unordered_map>> &coulomb_param, + const std::map>> &coulomb_param, const double rmesh_times) { std::vector psik2_ccp(orbs.get_psif().size(), 0.0); diff --git a/source/module_ri/conv_coulomb_pot_k.h b/source/module_ri/conv_coulomb_pot_k.h index 7daca7e1d7..fd269b7d4e 100644 --- a/source/module_ri/conv_coulomb_pot_k.h +++ b/source/module_ri/conv_coulomb_pot_k.h @@ -3,7 +3,6 @@ #include #include -#include #include namespace Conv_Coulomb_Pot_K @@ -17,7 +16,7 @@ namespace Conv_Coulomb_Pot_K template extern T cal_orbs_ccp( const T &orbs, - const std::unordered_map>> &coulomb_param, + const std::map>> &coulomb_param, const double rmesh_times); //private: diff --git a/source/module_ri/conv_coulomb_pot_k.hpp b/source/module_ri/conv_coulomb_pot_k.hpp index 4e67215bd9..eceaf6656c 100644 --- a/source/module_ri/conv_coulomb_pot_k.hpp +++ b/source/module_ri/conv_coulomb_pot_k.hpp @@ -11,7 +11,7 @@ namespace Conv_Coulomb_Pot_K template< typename T > std::vector cal_orbs_ccp( const std::vector & orbs, - const std::unordered_map>> &coulomb_param, + const std::map>> &coulomb_param, const double rmesh_times) { std::vector orbs_ccp(orbs.size()); diff --git a/tests/02_NAO_Gamma/002_NO_GO_AF/threshold b/tests/02_NAO_Gamma/002_NO_GO_AF/threshold new file mode 100644 index 0000000000..b59841877b --- /dev/null +++ b/tests/02_NAO_Gamma/002_NO_GO_AF/threshold @@ -0,0 +1 @@ +threshold 0.000001 \ No newline at end of file