Documentation for module xc

Exchange and Correlation functional calculations

source: xc.F
Loading...

public Subroutines/Functions:

...
Calculates the second derivative of E_xc at rho in the direction rho1 (if you see the second derivative as bilinear form) partial_rho|_(rho=rho) partial_rho|_(rho=rho) E_xc drho(rho1)drho The other direction is still indetermined, thus it returns a potential (partial integration is performed to reduce it to function of rho, removing the dependence from its partial derivs) Has to be called after the setup by xc_prep_2nd_deriv.
calculates just the exchange and correlation energy (no vxc)
Does the first prepartions for the calculation of the 2nd deriv The calculation must then be performed with xc_calc_2nd_deriv Calculates the second derivative of E_xc at rho in the direction rho1 (if you see the second derivative as bilinear form) partial_rho|_(rho=rho) partial_rho|_(rho=rho) E_xc drho(rho1)drho The other direction is still indetermined, thus it returns a potential (partial integration is performed to reduce it to function of rho, removing the dependence from its partial derivs)
Exchange and Correlation functional calculations
Exchange and Correlation functional calculations. depending on the selected functional_routine calls the correct routine

SUBROUTINEdivide_by_norm_drho(deriv_set, rho_set, lsd)

...

Arguments:
POINTER
:: deriv_set ...
POINTER
:: rho_set ...
LOGICAL,
INTENT(in)
:: lsd ...

SUBROUTINExc_calc_2nd_deriv(v_xc, deriv_set, rho_set, rho1_set, pw_pool, xc_section, gapw, vxg, tddfpt_fac)

Calculates the second derivative of E_xc at rho in the direction rho1 (if you see the second derivative as bilinear form) partial_rho|_(rho=rho) partial_rho|_(rho=rho) E_xc drho(rho1)drho The other direction is still indetermined, thus it returns a potential (partial integration is performed to reduce it to function of rho, removing the dependence from its partial derivs) Has to be called after the setup by xc_prep_2nd_deriv.

Arguments:
TYPE(pw_p_type),
POINTER
:: v_xc(:) ...
POINTER
:: deriv_set object containing the potentials
POINTER
:: rho_set object containing the density at which the derivatives were calculated
POINTER
:: rho1_set object containing the density with which to fold
POINTER
:: pw_pool the pool for the grids
POINTER
:: xc_section ...
LOGICAL,
INTENT(in),
OPTIONAL
:: gapw ...
REAL(dp),
OPTIONAL, POINTER
:: vxg(:,:,:,:) ...
REAL(dp),
INTENT(in),
OPTIONAL
:: tddfpt_fac factor that multiplies the crossterms (tddfpt triplets on a closed shell sistem it should be -1, defaults to 1)

FUNCTIONxc_exc_calc(rho_r, rho_g, tau, xc_section, pw_pool)

calculates just the exchange and correlation energy (no vxc)

Return Value ::
REAL(dp)
Arguments:
TYPE(pw_p_type),
POINTER
:: rho_r(:) ...
TYPE(pw_p_type),
POINTER
:: rho_g(:) ...
TYPE(pw_p_type),
POINTER
:: tau(:) ...
POINTER
:: xc_section ...
POINTER
:: pw_pool ...

SUBROUTINExc_prep_2nd_deriv(deriv_set, rho_set, rho_r, pw_pool, xc_section, tau_r)

Does the first prepartions for the calculation of the 2nd deriv The calculation must then be performed with xc_calc_2nd_deriv Calculates the second derivative of E_xc at rho in the direction rho1 (if you see the second derivative as bilinear form) partial_rho|_(rho=rho) partial_rho|_(rho=rho) E_xc drho(rho1)drho The other direction is still indetermined, thus it returns a potential (partial integration is performed to reduce it to function of rho, removing the dependence from its partial derivs)

Arguments:
POINTER
:: deriv_set object containing the potentials
POINTER
:: rho_set object that will contain the density at which the derivatives were calculated
TYPE(pw_p_type),
POINTER
:: rho_r(:) the place where you evaluate the derivative
POINTER
:: pw_pool the pool for the grids
POINTER
:: xc_section which functional should be used and how to calculate it
TYPE(pw_p_type),
OPTIONAL, POINTER
:: tau_r(:) kinetic energy density in real space

SUBROUTINExc_vxc_pw_create(vxc_rho, vxc_tau, exc, rho_r, rho_g, tau, xc_section, pw_pool, compute_virial, virial_xc)

Exchange and Correlation functional calculations

Arguments:
TYPE(pw_p_type),
POINTER
:: vxc_rho(:) will contain the v_xc part that depend on rho (if one of the choosen xc functionals has it it is allocated and you are responsible for it)
TYPE(pw_p_type),
POINTER
:: vxc_tau(:) will contain the kinetic (tau) part of v_xc (if one of the choosen xc functionals has it it is allocated and you are responsible for it)
REAL(dp),
INTENT(out)
:: exc the xc energy
TYPE(pw_p_type),
POINTER
:: rho_r(:) the value of the density in the real space
TYPE(pw_p_type),
POINTER
:: rho_g(:) value of the density in the g space (needs to be associated only for gradient corrections)
TYPE(pw_p_type),
POINTER
:: tau(:) value of the kinetic density tau on the grid (can be null, used only with meta functionals)
POINTER
:: xc_section which functional to calculate, and how to do it
POINTER
:: pw_pool the pool for the grids
LOGICAL
:: compute_virial ...
REAL(dp),
INTENT(out)
:: virial_xc(3,3) ...

SUBROUTINExc_vxc_pw_create1(vxc_rho, vxc_tau, rho_r, rho_g, tau, exc, xc_section, pw_pool, compute_virial, virial_xc)

Exchange and Correlation functional calculations. depending on the selected functional_routine calls the correct routine

Arguments:
TYPE(pw_p_type),
POINTER
:: vxc_rho(:) will contain the v_xc part that depend on rho (if one of the choosen xc functionals has it it is allocated and you are responsible for it)
TYPE(pw_p_type),
POINTER
:: vxc_tau(:) will contain the kinetic (tau) part of v_xcthe functional (if one of the choosen xc functionals has it it is allocated and you are responsible for it)
TYPE(pw_p_type),
POINTER
:: rho_r(:) the value of the density in the real space
TYPE(pw_p_type),
POINTER
:: rho_g(:) value of the density in the g space (needs to be associated only for gradient corrections)
TYPE(pw_p_type),
POINTER
:: tau(:) value of the kinetic density tau on the grid (can be null, used only with meta functionals)
REAL(dp),
INTENT(out)
:: exc the xc energy
POINTER
:: xc_section parameters selecting the xc and the method used to calculate it
POINTER
:: pw_pool the pool for the grids
LOGICAL
:: compute_virial should the virial be computed... if so virial_xc must be present
REAL(dp),
INTENT(out)
:: virial_xc(3,3) for calculating the GGA part of the stress