120#include "../base/base_uses.f90"
126 LOGICAL,
PARAMETER :: debug_this_module = .false.
127 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'xc_derivatives'
147 needs, max_deriv, print_warn)
149 LOGICAL,
INTENT(in) :: lsd
150 CHARACTER(LEN=*),
INTENT(OUT),
OPTIONAL :: reference, shortform
152 INTEGER,
INTENT(out),
OPTIONAL :: max_deriv
153 LOGICAL,
INTENT(IN),
OPTIONAL :: print_warn
156 REAL(kind=
dp) :: r_param
158 cpassert(
ASSOCIATED(functional))
159 SELECT CASE (functional%section%name)
162 CALL b97_lsd_info(reference=reference, shortform=shortform, &
163 needs=needs, max_deriv=max_deriv, b97_params=functional)
165 CALL b97_lda_info(reference=reference, shortform=shortform, &
166 needs=needs, max_deriv=max_deriv, b97_params=functional)
168 CASE (
"BECKE88_LR_ADIABATIC")
171 needs=needs, max_deriv=max_deriv)
174 needs=needs, max_deriv=max_deriv)
176 CASE (
"LYP_ADIABATIC")
179 needs=needs, max_deriv=max_deriv)
182 needs=needs, max_deriv=max_deriv)
187 needs=needs, max_deriv=max_deriv)
190 needs=needs, max_deriv=max_deriv)
194 CALL xb88_lsd_info(reference=reference, shortform=shortform, &
195 needs=needs, max_deriv=max_deriv)
197 CALL xb88_lda_info(reference=reference, shortform=shortform, &
198 needs=needs, max_deriv=max_deriv)
203 needs=needs, max_deriv=max_deriv)
206 needs=needs, max_deriv=max_deriv)
210 CALL lyp_lsd_info(reference=reference, shortform=shortform, &
211 needs=needs, max_deriv=max_deriv)
213 CALL lyp_lda_info(reference=reference, shortform=shortform, &
214 needs=needs, max_deriv=max_deriv)
217 CALL pade_info(reference, shortform, lsd=lsd, needs=needs)
221 CALL hcth_lda_info(i_param, reference, shortform, needs, max_deriv)
230 CALL cs1_lsd_info(reference, shortform, needs, max_deriv)
232 CALL cs1_lda_info(reference, shortform, needs=needs, max_deriv=max_deriv)
236 CALL xgga_info(i_param, lsd, reference, shortform, needs, max_deriv)
239 CALL ke_gga_info(i_param, lsd, reference, shortform, needs, max_deriv)
242 cpabort(
"BP functional not implemented with LSD")
244 CALL p86_lda_info(reference, shortform, needs, max_deriv)
248 CALL perdew_wang_info(i_param, lsd, reference, shortform, needs, max_deriv, &
252 CALL pz_info(i_param, lsd, reference, shortform, needs, max_deriv)
255 CALL tfw_lsd_info(reference, shortform, needs, max_deriv)
257 CALL tfw_lda_info(reference, shortform, needs, max_deriv)
263 CALL vwn_lsd_info(reference, shortform, needs, max_deriv)
265 CALL vwn_lda_info(reference, shortform, needs, max_deriv)
269 CALL xalpha_info(lsd, reference, shortform, needs, max_deriv, &
270 xa_parameter=r_param)
273 cpabort(
"TPSS functional not implemented with LSD. Use the LIBXC version instead.")
275 CALL tpss_lda_info(functional, reference, shortform, needs, max_deriv)
279 CALL pbe_lsd_info(functional, reference, shortform, needs, max_deriv)
281 CALL pbe_lda_info(functional, reference, shortform, needs, max_deriv)
284 CALL skala_info(functional, lsd, reference, shortform, needs, max_deriv)
293 CASE (
"BECKE_ROUSSEL")
299 CASE (
"LDA_HOLE_T_C_LR")
305 CASE (
"PBE_HOLE_T_C_LR")
320 CALL libxc_lsd_info(functional, reference, shortform, needs, max_deriv, print_warn)
322 CALL libxc_lda_info(functional, reference, shortform, needs, max_deriv, print_warn)
346 SUBROUTINE xc_functional_eval(functional, lsd, rho_set, deriv_set, deriv_order)
349 LOGICAL,
INTENT(in) :: lsd
352 INTEGER,
INTENT(IN) :: deriv_order
354 CHARACTER(len=*),
PARAMETER :: abort_message_skala = &
355 "GauXC functionals are evaluated only through the QS GauXC path. "// &
356 "Higher XC derivatives for response and kernel properties are not implemented.", &
357 routinen =
'xc_functional_eval'
359 INTEGER :: handle, i_param
360 LOGICAL :: fun_active
361 REAL(kind=
dp) :: density_cut, gradient_cut, r_param
363 CALL timeset(routinen, handle)
366 drho_cutoff=gradient_cut)
369 IF (.NOT. fun_active)
THEN
370 CALL timestop(handle)
374 SELECT CASE (functional%section%name)
377 CALL b97_lsd_eval(rho_set, deriv_set, deriv_order, functional)
379 CALL b97_lda_eval(rho_set, deriv_set, deriv_order, functional)
381 CASE (
"BECKE88_LR_ADIABATIC")
387 CASE (
"LYP_ADIABATIC")
395 CALL xb88_lsd_eval(rho_set, deriv_set, deriv_order, functional)
397 CALL xb88_lda_eval(rho_set, deriv_set, deriv_order, functional)
413 CALL lyp_lsd_eval(rho_set, deriv_set, deriv_order, functional)
415 CALL lyp_lda_eval(rho_set, deriv_set, deriv_order, functional)
430 CALL optx_lsd_eval(rho_set, deriv_set, deriv_order, functional)
432 CALL optx_lda_eval(rho_set, deriv_set, deriv_order, functional)
442 CALL xgga_eval(i_param, lsd, rho_set, deriv_set, deriv_order)
452 CALL p86_lda_eval(rho_set, deriv_set, deriv_order, functional)
466 CALL pz_lsd_eval(i_param, rho_set, deriv_set, deriv_order, functional)
468 CALL pz_lda_eval(i_param, rho_set, deriv_set, deriv_order, functional)
484 CALL vwn_lsd_eval(rho_set, deriv_set, deriv_order, functional)
486 CALL vwn_lda_eval(rho_set, deriv_set, deriv_order, functional)
492 xa_parameter=r_param, xa_params=functional)
495 xa_parameter=r_param, xa_params=functional)
499 cpabort(
"TPSS functional not implemented with LSD. Use the LIBXC version instead.")
501 CALL tpss_lda_eval(rho_set, deriv_set, deriv_order, functional)
505 CALL pbe_lsd_eval(rho_set, deriv_set, deriv_order, functional)
507 CALL pbe_lda_eval(rho_set, deriv_set, deriv_order, functional)
510 cpabort(abort_message_skala)
517 CASE (
"BECKE_ROUSSEL")
523 CASE (
"LDA_HOLE_T_C_LR")
529 CASE (
"PBE_HOLE_T_C_LR")
552 CALL timestop(handle)
553 END SUBROUTINE xc_functional_eval
576 LOGICAL,
INTENT(in) :: lsd
579 INTEGER,
INTENT(in) :: deriv_order
584 cpassert(
ASSOCIATED(functionals))
589 IF (.NOT.
ASSOCIATED(xc_fun))
EXIT
590 CALL xc_functional_eval(xc_fun, &
593 deriv_set=deriv_set, &
594 deriv_order=deriv_order)
611 LOGICAL,
INTENT(in) :: lsd
612 LOGICAL,
INTENT(in),
OPTIONAL :: calc_potential
616 LOGICAL :: my_calc_potential
619 my_calc_potential = .false.
620 IF (
PRESENT(calc_potential)) my_calc_potential = calc_potential
622 cpassert(
ASSOCIATED(functionals))
629 IF (.NOT.
ASSOCIATED(xc_fun))
EXIT
633 IF (my_calc_potential)
THEN
635 needs%rho_spin = .true.
636 needs%tau_spin = needs%tau_spin .OR. needs%tau
640 IF (needs%norm_drho .OR. needs%norm_drho_spin)
THEN
642 needs%drho_spin = .true.
Defines the basic variable types.
integer, parameter, public dp
calculates the b97 correlation functional
subroutine, public b97_lda_info(b97_params, reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public b97_lda_eval(rho_set, deriv_set, grad_deriv, b97_params)
evaluates the b97 correlation functional for lda
subroutine, public b97_lsd_info(b97_params, reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public b97_lsd_eval(rho_set, deriv_set, grad_deriv, b97_params)
evaluates the b 97 xc functional for lsd
Calculate the CS1 Functional (Handy s improved LYP functional)
subroutine, public cs1_lda_eval(rho_set, deriv_set, order)
...
subroutine, public cs1_lsd_eval(rho_set, deriv_set, order)
...
subroutine, public cs1_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public cs1_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
represent a group ofunctional derivatives
type(xc_rho_cflags_type) function, public xc_functionals_get_needs(functionals, lsd, calc_potential)
...
subroutine, public xc_functional_get_info(functional, lsd, reference, shortform, needs, max_deriv, print_warn)
get the information about the given functional
subroutine, public xc_functionals_eval(functionals, lsd, rho_set, deriv_set, deriv_order)
...
Calculate several different exchange energy functionals with a GGA form.
subroutine, public xgga_eval(functional, lsd, rho_set, deriv_set, order)
evaluates different exchange gga
subroutine, public xgga_info(functional, lsd, reference, shortform, needs, max_deriv)
return various information on the xgga functionals
subroutine, public skala_info(functional, lsd, reference, shortform, needs, max_deriv)
Return information about the Skala functional.
calculate the Hamprecht, Cohen, Tozer, and Handy (HCTH) exchange functional
subroutine, public hcth_lda_info(iparset, reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public hcth_lda_eval(iparset, rho_set, deriv_set, grad_deriv)
evaluates the hcth functional for lda
Calculate the several different kinetic energy functionals with a GGA form.
subroutine, public ke_gga_lsd_eval(functional, rho_set, deriv_set, order)
...
subroutine, public ke_gga_info(functional, lsd, reference, shortform, needs, max_deriv)
...
subroutine, public ke_gga_lda_eval(functional, rho_set, deriv_set, order)
...
calculates a functional from libxc and its derivatives
subroutine, public libxc_lda_eval(rho_set, deriv_set, grad_deriv, libxc_params)
evaluates the functional from libxc
subroutine, public libxc_lsd_eval(rho_set, deriv_set, grad_deriv, libxc_params)
evaluates the functional from libxc
subroutine, public libxc_lsd_info(libxc_params, reference, shortform, needs, max_deriv, print_warn)
info about the functional from libxc
subroutine, public libxc_lda_info(libxc_params, reference, shortform, needs, max_deriv, print_warn)
info about the functional from libxc
Calculates the density_scaled Lyp functional when used in adiabatic hybrids. The energy is given as.
subroutine, public lyp_adiabatic_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public lyp_adiabatic_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public lyp_adiabatic_lda_eval(rho_set, deriv_set, grad_deriv, lyp_adiabatic_params)
...
subroutine, public lyp_adiabatic_lsd_eval(rho_set, deriv_set, grad_deriv, lyp_adiabatic_params)
...
calculates the lyp correlation functional
subroutine, public lyp_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public lyp_lsd_eval(rho_set, deriv_set, grad_deriv, lyp_params)
evaluates the becke 88 exchange functional for lsd
subroutine, public lyp_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public lyp_lda_eval(rho_set, deriv_set, grad_deriv, lyp_params)
evaluates the lyp correlation functional for lda
subroutine, public optx_lda_info(reference, shortform, needs, max_deriv)
info about the optx functional
subroutine, public optx_lsd_eval(rho_set, deriv_set, grad_deriv, optx_params)
evaluates the optx functional for lsd
subroutine, public optx_lda_eval(rho_set, deriv_set, grad_deriv, optx_params)
evaluates the optx functional for lda
subroutine, public optx_lsd_info(reference, shortform, needs, max_deriv)
info about the optx functional (LSD)
Calculate the LDA functional in the Pade approximation Literature: S. Goedecker, M....
subroutine, public pade_init(cutoff, debug)
...
subroutine, public pade_lsd_pw_eval(deriv_set, rho_set, order)
...
subroutine, public pade_info(reference, shortform, lsd, needs, max_deriv)
...
subroutine, public pade_lda_pw_eval(deriv_set, rho_set, order)
...
calculates the pbe correlation functional
subroutine, public pbe_lda_eval(rho_set, deriv_set, grad_deriv, pbe_params)
evaluates the pbe correlation functional for lda
subroutine, public pbe_lsd_info(pbe_params, reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public pbe_lsd_eval(rho_set, deriv_set, grad_deriv, pbe_params)
evaluates the becke 88 exchange functional for lsd
subroutine, public pbe_lda_info(pbe_params, reference, shortform, needs, max_deriv)
return various information on the functional
Calculate the Perdew Correlation from 1986.
subroutine, public p86_lda_info(reference, shortform, needs, max_deriv)
...
subroutine, public p86_lda_eval(rho_set, deriv_set, order, p86_params)
...
Calculate the Perdew-Wang correlation potential and energy density and ist derivatives with respect t...
subroutine, public perdew_wang_lda_eval(method, rho_set, deriv_set, order, scale)
Calculate the correlation energy and its derivatives wrt to rho (the electron density) up to 3rd orde...
subroutine, public perdew_wang_info(method, lsd, reference, shortform, needs, max_deriv, scale)
Return some info on the functionals.
subroutine, public perdew_wang_lsd_eval(method, rho_set, deriv_set, order, scale)
Calculate the correlation energy and its derivatives wrt to rho (the electron density) up to 3rd orde...
Calculate the Perdew-Zunger correlation potential and energy density and ist derivatives with respect...
subroutine, public pz_lda_eval(method, rho_set, deriv_set, order, pz_params)
Calculate the correlation energy and its derivatives wrt to rho (the electron density) up to 3rd orde...
subroutine, public pz_lsd_eval(method, rho_set, deriv_set, order, pz_params)
Calculate the correlation energy and its derivatives wrt to rho (the electron density) up to 3rd orde...
subroutine, public pz_info(method, lsd, reference, shortform, needs, max_deriv)
Return some info on the functionals.
elemental subroutine, public xc_rho_cflags_setall(cflags, value)
sets all the flags to the given value
subroutine, public xc_rho_set_get(rho_set, can_return_null, rho, drho, norm_drho, rhoa, rhob, norm_drhoa, norm_drhob, rho_1_3, rhoa_1_3, rhob_1_3, laplace_rho, laplace_rhoa, laplace_rhob, drhoa, drhob, rho_cutoff, drho_cutoff, tau_cutoff, tau, tau_a, tau_b, local_bounds)
returns the various attributes of rho_set
Calculate the Thomas-Fermi kinetic energy functional plus the von Weizsaecker term.
subroutine, public tfw_lda_info(reference, shortform, needs, max_deriv)
...
subroutine, public tfw_lda_eval(rho_set, deriv_set, order)
...
subroutine, public tfw_lsd_info(reference, shortform, needs, max_deriv)
...
subroutine, public tfw_lsd_eval(rho_set, deriv_set, order)
...
Calculate the Thomas-Fermi kinetic energy functional.
subroutine, public thomas_fermi_lsd_eval(rho_set, deriv_set, order)
...
subroutine, public thomas_fermi_lda_eval(rho_set, deriv_set, order)
...
subroutine, public thomas_fermi_info(lsd, reference, shortform, needs, max_deriv)
...
Calculates the tpss functional.
subroutine, public tpss_lda_eval(rho_set, deriv_set, grad_deriv, tpss_params)
evaluates the tpss functional in the spin unpolarized (lda) case
subroutine, public tpss_lda_info(tpss_params, reference, shortform, needs, max_deriv)
return various information on the functional
Calculate the LDA functional according to Vosk, Wilk and Nusair Literature: S. H. Vosko,...
subroutine, public vwn_lda_info(reference, shortform, needs, max_deriv)
...
subroutine, public vwn_lda_eval(rho_set, deriv_set, order, vwn_params)
...
subroutine, public vwn_lsd_eval(rho_set, deriv_set, order, vwn_params)
...
subroutine, public vwn_lsd_info(reference, shortform, needs, max_deriv)
...
Calculate the local exchange functional.
subroutine, public xalpha_lda_eval(rho_set, deriv_set, order, xa_params, xa_parameter)
...
subroutine, public xalpha_info(lsd, reference, shortform, needs, max_deriv, xa_parameter, scaling)
...
subroutine, public xalpha_lsd_eval(rho_set, deriv_set, order, xa_params, xa_parameter)
...
calculates the longrange part of Becke 88 exchange functional
subroutine, public xb88_lr_lda_eval(rho_set, deriv_set, grad_deriv, xb88_lr_params)
evaluates the becke 88 longrange exchange functional for lda
subroutine, public xb88_lr_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public xb88_lr_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public xb88_lr_lsd_eval(rho_set, deriv_set, grad_deriv, xb88_lr_params)
evaluates the becke 88 longrange exchange functional for lsd
Calculates the density_scaled BECKE88 long-range functional when used in adiabatic hybrids....
subroutine, public xb88_lr_adiabatic_lda_eval(rho_set, deriv_set, grad_deriv, xb88_lr_ad_params)
evaluates the becke 88 longrange exchange functional for lda
subroutine, public xb88_lr_adiabatic_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public xb88_lr_adiabatic_lsd_eval(rho_set, deriv_set, grad_deriv, xb88_lr_ad_params)
evaluates the becke 88 longrange exchange functional for lsd
subroutine, public xb88_lr_adiabatic_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional
calculates the Becke 88 exchange functional
subroutine, public xb88_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public xb88_lda_eval(rho_set, deriv_set, grad_deriv, xb88_params)
evaluates the becke 88 exchange functional for lda
subroutine, public xb88_lsd_eval(rho_set, deriv_set, grad_deriv, xb88_params)
evaluates the becke 88 exchange functional for lsd
subroutine, public xb88_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
Calculates the exchange energy based on the Becke-Roussel exchange hole. Takes advantage of an analyt...
subroutine, public xbecke_roussel_lsd_eval(rho_set, deriv_set, grad_deriv, br_params)
evaluates the Becke Roussel exchange functional for lda
subroutine, public xbecke_roussel_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public xbecke_roussel_lda_eval(rho_set, deriv_set, grad_deriv, br_params)
evaluates the Becke Roussel exchange functional for lda
subroutine, public xbecke_roussel_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional
calculates the Exchange contribution in the BEEF-vdW functional
subroutine, public xbeef_lda_eval(rho_set, deriv_set, grad_deriv, xbeef_params)
evaluates the beef exchange functional for lda
subroutine, public xbeef_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public xbeef_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public xbeef_lsd_eval(rho_set, deriv_set, grad_deriv, xbeef_params)
evaluates the beef 88 exchange functional for lsd
This functional is a combination of three different exchange hole models. The ingredients are:
subroutine, public xbr_pbe_lda_hole_tc_lr_lsd_eval(rho_set, deriv_set, grad_deriv, params)
Intermediate routine that gets grids, derivatives and some params.
subroutine, public xbr_pbe_lda_hole_tc_lr_lda_eval(rho_set, deriv_set, grad_deriv, params)
Intermediate routine that gets grids, derivatives and some params.
subroutine, public xbr_pbe_lda_hole_tc_lr_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public xbr_pbe_lda_hole_tc_lr_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional
Calculates the lda exchange hole in a truncated coulomb potential. Can be used as longrange correctio...
subroutine, public xlda_hole_t_c_lr_lda_eval(rho_set, deriv_set, order, params)
evaluates the truncated lda exchange hole
subroutine, public xlda_hole_t_c_lr_lda_info(reference, shortform, needs, max_deriv)
returns various information on the functional
subroutine, public xlda_hole_t_c_lr_lsd_eval(rho_set, deriv_set, order, params)
evaluates the truncated lsd exchange hole. Calls the lda routine and applies spin scaling relation
subroutine, public xlda_hole_t_c_lr_lsd_info(reference, shortform, needs, max_deriv)
returns various information on the functional
Calculates the exchange energy for the pbe hole model in a truncated coulomb potential,...
subroutine, public xpbe_hole_t_c_lr_lda_info(reference, shortform, needs, max_deriv)
returns various information on the functional
subroutine, public xpbe_hole_t_c_lr_lda_eval(rho_set, deriv_set, order, params)
evaluates the pbe-hole exchange in a truncated coulomb potential
subroutine, public xpbe_hole_t_c_lr_lsd_eval(rho_set, deriv_set, order, params)
evaluates the pbe-hole exchange in a truncated coulomb potential
subroutine, public xpbe_hole_t_c_lr_lsd_info(reference, shortform, needs, max_deriv)
returns various information on the functional
Calculates short range exchange part for wPBE functional and averaged PBE exchange-hole functional (o...
subroutine, public xwpbe_lda_eval(rho_set, deriv_set, order, xwpbe_params)
evaluates the screened hole averaged PBE exchange functional for lda
subroutine, public xwpbe_lsd_eval(rho_set, deriv_set, order, xwpbe_params)
evaluates the screened hole averaged PBE exchange functional for lsd
subroutine, public xwpbe_lda_info(reference, shortform, needs, max_deriv)
return various information on the functional
subroutine, public xwpbe_lsd_info(reference, shortform, needs, max_deriv)
return various information on the functional
A derivative set contains the different derivatives of a xc-functional in form of a linked list.
contains a flag for each component of xc_rho_set, so that you can use it to tell which components you...
represent a density, with all the representation and data needed to perform a functional evaluation