Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
c83e361
Use template to reconstruct parse_expression
1041176461 Jan 21, 2023
cdf3c0c
Feature: output R matrix at each MD step
1041176461 Jan 23, 2023
cff6e08
Modify'matrix_HS' to 'matrix' for R matrix output
1041176461 Jan 23, 2023
b9db1f1
Merge branch 'develop' into develop
1041176461 Jan 23, 2023
6c1a77b
Merge branch 'develop' of https://github.com/1041176461/abacus-develo…
1041176461 Jan 31, 2023
cc149a5
Merge branches 'develop' and 'develop' of https://github.com/10411764…
Feb 11, 2023
992ba96
Merge branch 'develop' of https://github.com/1041176461/abacus-develo…
Feb 11, 2023
0c753e2
Merge branch 'deepmodeling:develop' into develop
1041176461 Feb 12, 2023
3fd87f3
Merge branch 'develop' of https://github.com/1041176461/abacus-develo…
Feb 14, 2023
2a81795
Fix: modify index in parse_expression
1041176461 Feb 15, 2023
3523c57
Merge branch 'deepmodeling:develop' into develop
1041176461 Mar 27, 2023
afe397c
Fix: add regfree for parse_expression
May 10, 2023
d7775cf
Merge branch 'develop' into develop
1041176461 May 10, 2023
aad3e5a
Merge branch 'develop' into develop
Qianruipku May 10, 2023
4375864
Merge branch 'deepmodeling:develop' into develop
1041176461 May 21, 2023
d91a9e9
Doc: update phonopy doc
1041176461 Jun 5, 2023
238d73f
Merge branch 'deepmodeling:develop' into develop
1041176461 Jun 5, 2023
cdc685a
Doc: update phonopy doc
1041176461 Jun 5, 2023
47bc26b
Merge branch 'develop' of https://github.com/1041176461/abacus-develo…
1041176461 Jun 5, 2023
2ecdcca
Merge branch 'deepmodeling:develop' into develop
1041176461 Jun 24, 2023
53eeedf
Merge branch 'deepmodeling:develop' into develop
1041176461 Aug 30, 2023
b22769e
Merge branch 'deepmodeling:develop' into develop
1041176461 Sep 4, 2023
89d7394
Merge branch 'deepmodeling:develop' into develop
1041176461 Oct 30, 2023
d09f2d8
Merge branch 'deepmodeling:develop' into develop
1041176461 Apr 8, 2024
2673ecc
fix tdos plot for nspin=2
1041176461 Apr 8, 2024
3d2d8dd
optimize dosplot for nspin=2
1041176461 Apr 8, 2024
d919681
fix legend for dosplot
1041176461 Apr 8, 2024
76defcd
Merge branch 'develop' into develop
1041176461 Apr 8, 2024
560a60c
Merge branch 'deepmodeling:develop' into develop
1041176461 May 8, 2024
47d5cac
Merge branch 'deepmodeling:develop' into develop
1041176461 Jul 3, 2024
8e0c6d8
Merge branch 'deepmodeling:develop' into develop
1041176461 Oct 13, 2024
90e4750
Merge branch 'deepmodeling:develop' into develop
1041176461 Oct 19, 2024
d0bedae
Add files via upload
ESROAMER Nov 2, 2024
25a77b3
Update cal_edm_tddft.cpp
ESROAMER Nov 2, 2024
e21da57
Refactor: modify exx loop for relax/md
1041176461 Nov 2, 2024
74651ac
Update result.ref
ESROAMER Nov 2, 2024
b67c43c
Fix wrong parameters in integrate test
ESROAMER Nov 2, 2024
0cb9cbb
Update result.ref
ESROAMER Nov 2, 2024
2ba948c
Update result.ref
ESROAMER Nov 2, 2024
58cc693
Update result.ref
ESROAMER Nov 2, 2024
6513db5
Update result.ref
ESROAMER Nov 2, 2024
0fc246b
Update result.ref
ESROAMER Nov 2, 2024
0721fbb
Update result.ref
ESROAMER Nov 2, 2024
63e59b5
Update result.ref
ESROAMER Nov 2, 2024
22058e3
Update result.ref
ESROAMER Nov 2, 2024
ced029a
add exx when istep>0
maki49 Nov 2, 2024
7740356
Merge pull request #8 from maki49/new_loop
1041176461 Nov 3, 2024
d15217c
Merge pull request #7 from 1041176461/new_loop
1041176461 Nov 3, 2024
2755221
Merge branch 'develop' into develop
1041176461 Nov 4, 2024
9b7df7d
Update dos.py
1041176461 Nov 4, 2024
a8a9051
Update esolver_sdft_pw.cpp
1041176461 Nov 4, 2024
ba09ba9
Update lcao_before_scf.cpp
1041176461 Nov 4, 2024
f5734d4
Update Exx_LRI_interface.h
1041176461 Nov 4, 2024
cacaf93
Update Exx_LRI_interface.hpp
1041176461 Nov 4, 2024
894cb25
Fix: compile error
1041176461 Nov 4, 2024
7c54ec6
Fix: compile error
1041176461 Nov 4, 2024
8c7c0e6
Fix: change HSE relax/md result.ref for new framework
1041176461 Nov 5, 2024
3df2804
Merge branch 'pr/1041176461/9' into develop
1041176461 Nov 6, 2024
9a820d2
Fix: compile error
1041176461 Nov 6, 2024
ebfdadc
compatible with exx_iter_finish
1041176461 Nov 6, 2024
eca5f43
Merge branch 'deepmodeling:develop' into develop
ESROAMER Nov 7, 2024
bac726b
Add files via upload
ESROAMER Nov 7, 2024
6965e9e
Update esolver_ks_lcao_tddft.h
ESROAMER Nov 8, 2024
09aa1a1
Update esolver_ks_lcao_tddft.cpp
ESROAMER Nov 8, 2024
2373c13
Merge pull request #10 from ESROAMER/no_force
1041176461 Nov 8, 2024
0ca4e04
Merge branch 'deepmodeling-develop' into develop
1041176461 Nov 27, 2024
7e3e147
Merge branch 'develop' of https://github.com/1041176461/abacus-develo…
1041176461 Nov 27, 2024
289036b
Merge branch 'deepmodeling:develop' into develop
1041176461 Jan 6, 2025
db653b7
Fix: support negative value in parse_expression
1041176461 Jan 6, 2025
4b82a10
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Jan 6, 2025
7e0c98e
Merge branch 'deepmodeling:develop' into develop
1041176461 Jan 30, 2025
eb353a8
Fix: parse_expression for scientific notation
1041176461 Jan 30, 2025
c1235ac
Update input_conv.h
1041176461 Jan 30, 2025
477c87a
Merge branch 'deepmodeling:develop' into develop
1041176461 Feb 22, 2025
15d4fca
Merge branch 'deepmodeling:develop' into develop
1041176461 May 13, 2025
d7771a8
Merge branch 'deepmodeling:develop' into develop
1041176461 Jun 5, 2025
4ee5b2c
Merge branch 'deepmodeling:develop' into develop
1041176461 Jun 17, 2025
a6d828d
add complex erf function
1041176461 Jun 17, 2025
9cb6230
Merge branch 'develop' of https://github.com/deepmodeling/abacus-deve…
1041176461 Jul 1, 2025
8328df9
refactor ccp framework
1041176461 Jul 1, 2025
0ad01df
fix compile
1041176461 Jul 1, 2025
c2d6085
fix compile
1041176461 Jul 1, 2025
18cc44e
fix compile
1041176461 Jul 1, 2025
29517df
fix compile
1041176461 Jul 1, 2025
a40e993
fix compile
1041176461 Jul 1, 2025
f87ee41
fix compile
1041176461 Jul 1, 2025
9d5b757
fix compile
1041176461 Jul 1, 2025
4cfbc17
fix empty error
1041176461 Jul 2, 2025
4ed708d
add revised spencer
1041176461 Jul 2, 2025
89d8284
add cal_psi_erfc_spencer
1041176461 Jul 2, 2025
0cb8873
add exx_singularity_correction
1041176461 Jul 2, 2025
d6f78a1
add exx_singularity_correction test
1041176461 Jul 2, 2025
eb7204c
add lc-corrected hybrid functionals
1041176461 Jul 2, 2025
abdce6c
fix compile
1041176461 Jul 2, 2025
4b52538
fix compile
1041176461 Jul 2, 2025
3b47cdc
fix compile error
1041176461 Jul 2, 2025
043c9f6
fix libxc error
1041176461 Jul 2, 2025
fa1fe10
fix libxc error
1041176461 Jul 2, 2025
c941284
fix libxc error
1041176461 Jul 2, 2025
eb5c5b4
add klist.h in RI_Util.h
1041176461 Jul 2, 2025
0813999
fix include
1041176461 Jul 2, 2025
9d4e3f6
Merge branch 'develop' into rsh_spencer
1041176461 Jul 3, 2025
82ef3ee
fix ptest for hse
1041176461 Jul 3, 2025
caca763
Merge branch 'rsh_spencer' of https://github.com/1041176461/abacus-de…
1041176461 Jul 3, 2025
f5969ca
fix lc_pbe name for vdw autoset
1041176461 Jul 3, 2025
6a57a04
fix test error
1041176461 Jul 3, 2025
22936b1
fix cam_pbeh test
1041176461 Jul 3, 2025
a78ad6e
fix fock settings
1041176461 Jul 4, 2025
e195da0
support rsh functionals
1041176461 Jul 4, 2025
1532955
fix libxc param
1041176461 Jul 4, 2025
85831ad
Merge branch 'develop' into rsh_spencer
1041176461 Jul 4, 2025
673e842
add input
1041176461 Jul 4, 2025
39bd8d9
fix input
1041176461 Jul 4, 2025
775bb75
refactor lri_cv
1041176461 Jul 7, 2025
a97defc
Merge branch 'deepmodeling:develop' into develop
1041176461 Jul 7, 2025
de40f75
Merge branch 'develop' into new_lri_cv
1041176461 Jul 7, 2025
b9701f1
fix compile
1041176461 Jul 7, 2025
fb7b076
fix compile
1041176461 Jul 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions source/source_lcao/module_ri/ABFs_Construct-PCA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,12 @@ namespace PCA
}

Matrix_Orbs21 m_abfslcaos_lcaos;
m_abfslcaos_lcaos.init( 1, ucell , orb, kmesh_times, 1 );
m_abfslcaos_lcaos.init_radial( abfs, lcaos, lcaos );
ORB_gaunt_table MGT;
int Lmax;
m_abfslcaos_lcaos.init( 1, ucell , orb, kmesh_times, orb.get_Rmax(), Lmax );
MGT.init_Gaunt_CH(Lmax);
MGT.init_Gaunt(Lmax);
m_abfslcaos_lcaos.init_radial( abfs, lcaos, lcaos, MGT );

std::map<std::size_t,std::map<std::size_t,std::set<double>>> delta_R;
for( std::size_t it=0; it!=abfs.size(); ++it ) {
Expand Down
1 change: 1 addition & 0 deletions source/source_lcao/module_ri/Exx_LRI.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class Exx_LRI
const Exx_Info::Exx_Info_RI &info;
MPI_Comm mpi_comm;
const K_Vectors *p_kv = nullptr;
ORB_gaunt_table MGT;
std::vector<double> orb_cutoff_;

std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> lcaos;
Expand Down
4 changes: 3 additions & 1 deletion source/source_lcao/module_ri/Exx_LRI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ void Exx_LRI<Tdata>::init(const MPI_Comm &mpi_comm_in,

this->coulomb_settings = RI_Util::update_coulomb_settings(this->info.coulomb_param, ucell, this->p_kv);

bool init_MGT = true;
for(const auto &settings_list : this->coulomb_settings)
{
this->exx_objs[settings_list.first].abfs_ccp = Conv_Coulomb_Pot_K::cal_orbs_ccp(this->abfs, settings_list.second.second, this->info.ccp_rmesh_times);
this->exx_objs[settings_list.first].cv.set_orbitals(ucell, orb,
this->lcaos, this->abfs, this->exx_objs[settings_list.first].abfs_ccp,
this->info.kmesh_times, this->info.ccp_rmesh_times );
this->info.kmesh_times, this->MGT, init_MGT, settings_list.second.first );
init_MGT = false; // only init once
}

ModuleBase::timer::tick("Exx_LRI", "init");
Expand Down
22 changes: 14 additions & 8 deletions source/source_lcao/module_ri/LRI_CV.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ class LRI_CV
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> &abfs_in,
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> &abfs_ccp_in,
const double &kmesh_times,
const double &ccp_rmesh_times_in);
ORB_gaunt_table& MGT,
const bool& init_MGT,
const bool& init_C);
inline std::map<TA,std::map<TAC,RI::Tensor<Tdata>>>
cal_Vs(
const UnitCell &ucell,
Expand All @@ -64,13 +66,13 @@ class LRI_CV
size_t get_index_abfs_size(const size_t &iat){return this->index_abfs[iat].count_size; }

private:
std::vector<double> orb_cutoff_;
std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> lcaos;
std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> abfs;
std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> abfs_ccp;
ModuleBase::Element_Basis_Index::IndexLNM index_lcaos;
ModuleBase::Element_Basis_Index::IndexLNM index_abfs;
double ccp_rmesh_times;
std::vector<double> lcaos_rcut;
std::vector<double> abfs_ccp_rcut;

public:
std::map<int,std::map<int,std::map<Abfs::Vector3_Order<double>,RI::Tensor<Tdata>>>> Vws;
Expand All @@ -92,15 +94,19 @@ class LRI_CV
const int it1,
const Abfs::Vector3_Order<double> &R,
const std::map<std::string,bool> &flags)>;
using T_func_cal_Rcut = std::function<double(const int it0, const int it1)>;
template<typename Tresult>
std::map<TA,std::map<TAC,Tresult>>
cal_datas(
const UnitCell &ucell,
const std::vector<TA> &list_A0,
const std::vector<TAC> &list_A1,
const std::map<std::string,bool> &flags,
const double &rmesh_times,
const T_func_DPcal_data<Tresult> &func_DPcal_data);
const std::vector<TA>& list_A0,
const std::vector<TAC>& list_A1,
const std::map<std::string, bool>& flags,
const T_func_cal_Rcut& func_cal_Rcut,
const T_func_DPcal_data<Tresult>& func_DPcal_data);

inline double cal_V_Rcut(const int it0, const int it1);
inline double cal_C_Rcut(const int it0, const int it1);

inline RI::Tensor<Tdata>
DPcal_V(
Expand Down
87 changes: 66 additions & 21 deletions source/source_lcao/module_ri/LRI_CV.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "LRI_CV.h"
#include "LRI_CV_Tools.h"
#include "exx_abfs-abfs_index.h"
#include "exx_abfs-construct_orbs.h"
#include "RI_Util.h"
#include "../../source_base/tool_title.h"
#include "../../source_base/timer.h"
Expand Down Expand Up @@ -43,16 +44,22 @@ void LRI_CV<Tdata>::set_orbitals(
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> &abfs_in,
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>> &abfs_ccp_in,
const double &kmesh_times,
const double &ccp_rmesh_times_in)
ORB_gaunt_table& MGT,
const bool& init_MGT,
const bool& init_C)
{
ModuleBase::TITLE("LRI_CV", "set_orbitals");
ModuleBase::timer::tick("LRI_CV", "set_orbitals");

this->orb_cutoff_ = orb.cutoffs();
this->lcaos = lcaos_in;
this->abfs = abfs_in;
this->abfs_ccp = abfs_ccp_in;
this->ccp_rmesh_times = ccp_rmesh_times_in;

this->lcaos_rcut = Exx_Abfs::Construct_Orbs::get_Rcut(this->lcaos);
this->abfs_ccp_rcut = Exx_Abfs::Construct_Orbs::get_Rcut(this->abfs_ccp);
const double lcaos_rmax = Exx_Abfs::Construct_Orbs::get_Rmax(this->lcaos);
const double abfs_ccp_rmax
= Exx_Abfs::Construct_Orbs::get_Rmax(this->abfs_ccp);

const ModuleBase::Element_Basis_Index::Range
range_lcaos = Exx_Abfs::Abfs_Index::construct_range( lcaos );
Expand All @@ -62,27 +69,50 @@ void LRI_CV<Tdata>::set_orbitals(
range_abfs = Exx_Abfs::Abfs_Index::construct_range( abfs );
this->index_abfs = ModuleBase::Element_Basis_Index::construct_index( range_abfs );

this->m_abfs_abfs.init( 2, ucell,orb, kmesh_times, (1+this->ccp_rmesh_times)/2.0 );
this->m_abfs_abfs.init_radial( this->abfs_ccp, this->abfs );
this->m_abfs_abfs.init_radial_table();

this->m_abfslcaos_lcaos.init( 1, ucell , orb, kmesh_times, 1 );
this->m_abfslcaos_lcaos.init_radial( this->abfs_ccp, this->lcaos, this->lcaos );
this->m_abfslcaos_lcaos.init_radial_table();
int Lmax_v = std::numeric_limits<double>::min();
this->m_abfs_abfs.init(2, ucell, orb, kmesh_times, lcaos_rmax + abfs_ccp_rmax, Lmax_v);
int Lmax_c = std::numeric_limits<double>::min();
if (init_C)
this->m_abfslcaos_lcaos.init(1, ucell, orb, kmesh_times, lcaos_rmax, Lmax_c);
int Lmax = std::max(Lmax_v, Lmax_c);

if (init_MGT) {
MGT.init_Gaunt_CH(Lmax);
MGT.init_Gaunt(Lmax);
}

this->m_abfs_abfs.init_radial(this->abfs_ccp, this->abfs, MGT);
this->m_abfs_abfs.init_radial_table();
if (init_C) {
this->m_abfslcaos_lcaos.init_radial(this->abfs_ccp,
this->lcaos,
this->lcaos,
MGT);
this->m_abfslcaos_lcaos.init_radial_table();
}

ModuleBase::timer::tick("LRI_CV", "set_orbitals");
}

template <typename Tdata>
double LRI_CV<Tdata>::cal_V_Rcut(const int it0, const int it1) {
return this->abfs_ccp_rcut[it0] + this->lcaos_rcut[it1];
}

template <typename Tdata>
double LRI_CV<Tdata>::cal_C_Rcut(const int it0, const int it1) {
return std::min(this->abfs_ccp_rcut[it0], this->lcaos_rcut[it0])
+ this->lcaos_rcut[it1];
}

template<typename Tdata> template<typename Tresult>
auto LRI_CV<Tdata>::cal_datas(
const UnitCell &ucell,
const std::vector<TA> &list_A0,
const std::vector<TAC> &list_A1,
const std::map<std::string,bool> &flags,
const double &rmesh_times,
const T_func_DPcal_data<Tresult> &func_DPcal_data)
const std::vector<TA>& list_A0,
const std::vector<TAC>& list_A1,
const std::map<std::string, bool>& flags,
const T_func_cal_Rcut& func_cal_Rcut,
const T_func_DPcal_data<Tresult>& func_DPcal_data)
-> std::map<TA,std::map<TAC,Tresult>>
{
ModuleBase::TITLE("LRI_CV","cal_datas");
Expand All @@ -104,9 +134,8 @@ auto LRI_CV<Tdata>::cal_datas(
const int ia1 = ucell.iat2ia[iat1];
const ModuleBase::Vector3<double> tau0 = ucell.atoms[it0].tau[ia0];
const ModuleBase::Vector3<double> tau1 = ucell.atoms[it1].tau[ia1];
const double Rcut = std::min(
orb_cutoff_[it0] * rmesh_times + orb_cutoff_[it1],
orb_cutoff_[it1] * rmesh_times + orb_cutoff_[it0]);
const double Rcut
= std::min(func_cal_Rcut(it0, it1), func_cal_Rcut(it1, it0));
const Abfs::Vector3_Order<double> R_delta = -tau0+tau1+(RI_Util::array3_to_Vector3(cell1)*ucell.latvec);
if( R_delta.norm()*ucell.lat0 < Rcut )
{
Expand Down Expand Up @@ -137,7 +166,12 @@ auto LRI_CV<Tdata>::cal_Vs(
func_DPcal_V = std::bind(
&LRI_CV<Tdata>::DPcal_V, this,
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4);
return this->cal_datas(ucell,list_A0, list_A1, flags, this->ccp_rmesh_times, func_DPcal_V);
const T_func_cal_Rcut func_cal_Rcut = std::bind(&LRI_CV<Tdata>::cal_V_Rcut,
this,
std::placeholders::_1,
std::placeholders::_2);

return this->cal_datas(ucell,list_A0, list_A1, flags, func_cal_Rcut, func_DPcal_V);
}

template<typename Tdata>
Expand All @@ -153,7 +187,13 @@ auto LRI_CV<Tdata>::cal_dVs(
func_DPcal_dV = std::bind(
&LRI_CV<Tdata>::DPcal_dV, this,
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4);
return this->cal_datas(ucell,list_A0, list_A1, flags, this->ccp_rmesh_times, func_DPcal_dV);

const T_func_cal_Rcut func_cal_Rcut = std::bind(&LRI_CV<Tdata>::cal_V_Rcut,
this,
std::placeholders::_1,
std::placeholders::_2);

return this->cal_datas(ucell,list_A0, list_A1, flags, func_cal_Rcut, func_DPcal_dV);
}

template<typename Tdata>
Expand All @@ -171,8 +211,13 @@ auto LRI_CV<Tdata>::cal_Cs_dCs(
func_DPcal_C_dC = std::bind(
&LRI_CV<Tdata>::DPcal_C_dC, this,
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4);
const T_func_cal_Rcut func_cal_Rcut = std::bind(&LRI_CV<Tdata>::cal_C_Rcut,
this,
std::placeholders::_1,
std::placeholders::_2);

std::map<TA,std::map<TAC, std::pair<RI::Tensor<Tdata>, std::array<RI::Tensor<Tdata>,3>>>>
Cs_dCs_tmp = this->cal_datas(ucell,list_A0, list_A1, flags, std::min(1.0,this->ccp_rmesh_times), func_DPcal_C_dC);
Cs_dCs_tmp = this->cal_datas(ucell,list_A0, list_A1, flags, func_cal_Rcut, func_DPcal_C_dC);

std::map<TA, std::map<TAC, RI::Tensor<Tdata>>> Cs;
std::map<TA, std::map<TAC, std::array<RI::Tensor<Tdata>, 3>>> dCs;
Expand Down
20 changes: 11 additions & 9 deletions source/source_lcao/module_ri/Matrix_Orbs11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ void Matrix_Orbs11::init(const int mode,
const UnitCell& ucell,
const LCAO_Orbitals& orb,
const double kmesh_times,
const double rmesh_times)
const double rmax,
int& Lmax)
{
ModuleBase::TITLE("Matrix_Orbs11", "init");
ModuleBase::timer::tick("Matrix_Orbs11", "init");

int Lmax_used, Lmax;
int Lmax_used;
this->lat0 = &ucell.lat0;
const int ntype = orb.get_ntype();
int lmax_orb = -1, lmax_beta = -1;
Expand All @@ -30,7 +31,7 @@ void Matrix_Orbs11::init(const int mode,
const double dr = orb.get_dR();
const double dk = orb.get_dk();
const int kmesh = orb.get_kmesh() * kmesh_times + 1;
int Rmesh = static_cast<int>(orb.get_Rmax() * rmesh_times / dr) + 4;
int Rmesh = static_cast<int>(rmax / dr) + 4;
Rmesh += 1 - Rmesh % 2;

Center2_Orb::init_Table_Spherical_Bessel(2,
Expand All @@ -49,14 +50,15 @@ void Matrix_Orbs11::init(const int mode,
//=========================================
// (3) make Gaunt coefficients table
//=========================================
this->MGT.init_Gaunt_CH(Lmax);
this->MGT.init_Gaunt(Lmax);
// this->MGT.init_Gaunt_CH(Lmax);
// this->MGT.init_Gaunt(Lmax);

ModuleBase::timer::tick("Matrix_Orbs11", "init");
}

void Matrix_Orbs11::init_radial(const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>>& orb_A,
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>>& orb_B)
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>>& orb_B,
const ORB_gaunt_table& MGT)
{
ModuleBase::TITLE("Matrix_Orbs11", "init_radial");
ModuleBase::timer::tick("Matrix_Orbs11", "init_radial");
Expand All @@ -68,7 +70,7 @@ void Matrix_Orbs11::init_radial(const std::vector<std::vector<std::vector<Numeri
for (size_t NB = 0; NB != orb_B[TB][LB].size(); ++NB) {
center2_orb11_s[TA][TB][LA][NA][LB].insert(std::make_pair(
NB,
Center2_Orb::Orb11(orb_A[TA][LA][NA], orb_B[TB][LB][NB], psb_, this->MGT)));
Center2_Orb::Orb11(orb_A[TA][LA][NA], orb_B[TB][LB][NB], psb_, MGT)));
}
}
}
Expand All @@ -78,7 +80,7 @@ void Matrix_Orbs11::init_radial(const std::vector<std::vector<std::vector<Numeri
ModuleBase::timer::tick("Matrix_Orbs11", "init_radial");
}

void Matrix_Orbs11::init_radial(const LCAO_Orbitals& orb_A, const LCAO_Orbitals& orb_B)
void Matrix_Orbs11::init_radial(const LCAO_Orbitals& orb_A, const LCAO_Orbitals& orb_B, const ORB_gaunt_table& MGT)
{
ModuleBase::TITLE("Matrix_Orbs11", "init_radial");
ModuleBase::timer::tick("Matrix_Orbs11", "init_radial");
Expand All @@ -93,7 +95,7 @@ void Matrix_Orbs11::init_radial(const LCAO_Orbitals& orb_A, const LCAO_Orbitals&
Center2_Orb::Orb11(orb_A.Phi[TA].PhiLN(LA, NA),
orb_B.Phi[TB].PhiLN(LB, NB),
psb_,
this->MGT)));
MGT)));
}
}
}
Expand Down
9 changes: 5 additions & 4 deletions source/source_lcao/module_ri/Matrix_Orbs11.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ class Matrix_Orbs11
const UnitCell& ucell,
const LCAO_Orbitals& orb,
const double kmesh_times, // extend Kcut, keep dK
const double rmesh_times); // extend Rcut, keep dR
const double rmax,
int& Lmax);

void init_radial(const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>>& orb_A,
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>>& orb_B);
void init_radial(const LCAO_Orbitals& orb_A, const LCAO_Orbitals& orb_B);
const std::vector<std::vector<std::vector<Numerical_Orbital_Lm>>>& orb_B,
const ORB_gaunt_table& MGT);
void init_radial(const LCAO_Orbitals& orb_A, const LCAO_Orbitals& orb_B, const ORB_gaunt_table& MGT);

void init_radial_table();
void init_radial_table(const std::map<size_t, std::map<size_t, std::set<double>>>& Rs); // unit: ucell.lat0
Expand Down Expand Up @@ -69,7 +71,6 @@ class Matrix_Orbs11

private:
ModuleBase::Sph_Bessel_Recursive::D2* psb_ = nullptr;
ORB_gaunt_table MGT;
const double lcao_dr_ = 0.01;
double* lat0=nullptr; // restore ucell.lat0
std::map<size_t, // TA
Expand Down
Loading
Loading