23struct LibxcWeightedDerivatives
26 std::vector<double> drho;
27 std::vector<double> dsigma;
35struct NclSfDiscreteData
37 std::vector<ModuleXC::NcggaSpinMapPoint> spin_map;
38 std::vector<double> rho;
39 std::vector<std::vector<ModuleBase::Vector3<double>>> spin_gradient;
48extern std::pair<int, std::vector<int>> set_xc_type_libxc(
const std::string &xc_func_in);
66extern std::vector<xc_func_type> init_func(
67 const std::vector<int> &func_id,
68 const int xc_polarized,
69 const double hybrid_alpha,
70 const double hse_omega);
72extern std::vector<xc_func_type> init_func(
73 const std::vector<int> &func_id,
74 const int xc_polarized,
75 const double hybrid_alpha,
76 const double hse_omega,
101extern std::vector<std::vector<double>> ext_params_for(
102 const std::vector<int> &func_id,
const double hybrid_alpha,
const double hse_omega);
104extern void finish_func(std::vector<xc_func_type> &funcs);
110extern std::tuple<double, double, ModuleBase::matrix> v_xc_libxc(
111 const std::vector<int> &func_id,
115 const Charge *
const chr,
120 const std::map<int, double> *scaling_factor,
121 const double hybrid_alpha,
122 const double hse_omega);
124extern std::tuple<double, double, ModuleBase::matrix> v_xc_libxc(
125 const std::vector<int> &func_id,
129 const Charge *
const chr,
134 const std::map<int, double> *scaling_factor,
135 const double hybrid_alpha,
136 const double hse_omega,
142extern void gradcorr_ncgga_sf_libxc(
143 const std::vector<int> &func_id,
144 const std::size_t nrxx,
146 const Charge *
const chr,
147 const std::map<int, double> *scaling_factor,
148 const double hybrid_alpha,
149 const double hse_omega,
150 std::vector<double> &stress_gga);
153extern std::tuple<double, double, ModuleBase::matrix, ModuleBase::matrix> v_xc_meta(
154 const std::vector<int> &func_id,
158 const Charge *
const chr,
160 const double hybrid_alpha,
161 const double hse_omega);
168extern std::vector<double> convert_rho(
const int nspin,
const std::size_t nrxx,
const Charge *
const chr);
171extern std::tuple<std::vector<double>, std::vector<double>> convert_rho_amag_nspin4(
172 const int nspin,
const std::size_t nrxx,
const Charge *
const chr);
176extern NclSfDiscreteData make_ncl_sf_discrete_data(
177 const std::size_t nrxx,
179 const Charge *
const chr,
180 const bool need_gradient);
185extern ModuleBase::matrix reverse_ncl_sf_discrete(
186 const std::size_t nrxx,
187 const NclSfDiscreteData &data,
188 const std::vector<double> &drho,
189 const std::vector<double> &dsigma,
191 const Charge *
const chr);
194extern std::vector<std::vector<ModuleBase::Vector3<double>>> cal_gdr(
196 const std::size_t nrxx,
197 const std::vector<double> &rho,
199 const Charge *
const chr);
201extern void cal_gdr_and_lapl(
203 const std::size_t nrxx,
204 const std::vector<double> &rho,
206 const Charge *
const chr,
207 std::vector<std::vector<ModuleBase::Vector3<double>>> &gdr,
208 std::vector<double> &lapl,
209 const bool need_laplacian =
true);
212extern std::vector<double> convert_sigma(
const std::vector<std::vector<ModuleBase::Vector3<double>>> &gdr);
215extern std::vector<double>
cal_sgn(
216 const double rho_threshold,
217 const double grho_threshold,
218 const xc_func_type &
func,
220 const std::size_t nrxx,
221 const std::vector<double> &rho,
222 const std::vector<double> &sigma);
226extern std::pair<std::vector<double>, std::vector<double>> cal_sgn_vxc(
227 const double rho_threshold_vrho,
228 const double rho_threshold_vsigma,
229 const double grho_threshold_vsigma,
230 const xc_func_type &
func,
232 const std::size_t nrxx,
233 const std::vector<double> &rho,
234 const std::vector<double> &sigma);
237extern double convert_etxc(
239 const std::size_t nrxx,
240 const std::vector<double> &sgn,
241 const std::vector<double> &rho,
242 std::vector<double> exc);
247extern LibxcWeightedDerivatives make_libxc_weighted_derivatives(
248 const xc_func_type &
func,
250 const std::size_t nrxx,
251 const std::vector<double> &sgn,
252 const std::vector<double> &rho,
253 const std::vector<double> &sigma,
254 const std::vector<double> &exc,
255 const std::vector<double> &vrho,
256 const std::vector<double> &vsigma);
259extern std::pair<double, ModuleBase::matrix> convert_vtxc_v(
260 const xc_func_type &
func,
262 const std::size_t nrxx,
263 const std::vector<double> &sgn_vrho,
264 const std::vector<double> &sgn_vsigma,
265 const std::vector<double> &rho,
266 const std::vector<std::vector<ModuleBase::Vector3<double>>> &gdr,
267 const std::vector<double> &vrho,
268 const std::vector<double> &vsigma,
270 const Charge *
const chr);
273extern std::vector<std::vector<double>> cal_dh(
275 const std::size_t nrxx,
276 const std::vector<double> &sgn,
277 const std::vector<std::vector<ModuleBase::Vector3<double>>> &gdr,
278 const std::vector<double> &vsigma,
280 const Charge *
const chr);
285extern ModuleBase::matrix convert_v_nspin4(
286 const std::size_t nrxx,
287 const Charge *
const chr,
288 const std::vector<double> &amag,
289 const ModuleBase::matrix &v,
296extern void xc_spin_libxc(
297 const std::vector<int> &func_id,
303 const double hybrid_alpha,
304 const double hse_omega);
311extern void gcxc_libxc(
312 const std::vector<int> &func_id,
318 const double hybrid_alpha,
319 const double hse_omega);
324extern void gcxc_libxc(
325 const std::vector<xc_func_type> &funcs,
333extern void gcxc_spin_libxc(
334 const std::vector<int> &func_id,
337 const ModuleBase::Vector3<double> gdr1,
338 const ModuleBase::Vector3<double> gdr2,
345 const double hybrid_alpha,
346 const double hse_omega);
349extern void gcxc_spin_libxc(
350 const std::vector<xc_func_type> &funcs,
353 const ModuleBase::Vector3<double> gdr1,
354 const ModuleBase::Vector3<double> gdr2,
368 const std::vector<int> &func_id,
378 const double &hybrid_alpha,
379 const double &hse_omega);
384 const std::vector<xc_func_type> &funcs,
394 const double hybrid_alpha);
396extern void tau_xc_spin(
397 const std::vector<int> &func_id,
400 ModuleBase::Vector3<double> gdr1,
401 ModuleBase::Vector3<double> gdr2,
416 const double &hybrid_alpha,
417 const double &hse_omega);
421extern void tau_xc_spin(
422 const std::vector<xc_func_type> &funcs,
425 ModuleBase::Vector3<double> gdr1,
426 ModuleBase::Vector3<double> gdr2,
441 const double hybrid_alpha);
void lapl_rho(const double &tpiba2, const std::complex< double > *rhog, double *lapn, const ModulePW::PW_Basis *rho_basis)
Definition cal_vcav.cpp:8
Definition libxc_host.h:11
std::vector< double > cal_sgn(const double, const double, const xc_func_type &, const int nspin, const std::size_t nrxx, const std::vector< double > &, const std::vector< double > &)
Definition test_pot_grad_xc.cpp:120
double func(const Vec3 &r, const std::vector< Vec3 > &R, const std::vector< double > &a, const std::vector< double > &n)
Definition test_partition.cpp:50