Exchange and Correlation functional calculations

source: xc.FLoading...

...

SUBROUTINE

xc_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.

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)

SUBROUTINE

xc_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

SUBROUTINE

xc_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

...

TYPE(xc_derivative_set_type), |
POINTER |
:: | deriv_set | ... | |

TYPE(xc_rho_set_type), |
POINTER |
:: | rho_set | ... | |

LOGICAL, |
INTENT(in) |
:: | lsd | ... |

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.

TYPE(pw_p_type), |
POINTER |
:: | v_xc(:) | ... | |

TYPE(xc_derivative_set_type), |
POINTER |
:: | deriv_set | object containing the potentials | |

TYPE(xc_rho_set_type), |
POINTER |
:: | rho_set | object containing the density at which the derivatives were calculated | |

TYPE(xc_rho_set_type), |
POINTER |
:: | rho1_set | object containing the density with which to fold | |

TYPE(pw_pool_type), |
POINTER |
:: | pw_pool | the pool for the grids | |

TYPE(section_vals_type), |
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) |

calculates just the exchange and correlation energy (no vxc)

Return Value :: REAL(dp)

TYPE(pw_p_type), |
POINTER |
:: | rho_r(:) | ... | |

TYPE(pw_p_type), |
POINTER |
:: | rho_g(:) | ... | |

TYPE(pw_p_type), |
POINTER |
:: | tau(:) | ... | |

TYPE(section_vals_type), |
POINTER |
:: | xc_section | ... | |

TYPE(pw_pool_type), |
POINTER |
:: | pw_pool | ... |

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)

TYPE(xc_derivative_set_type), |
POINTER |
:: | deriv_set | object containing the potentials | |

TYPE(xc_rho_set_type), |
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 | |

TYPE(pw_pool_type), |
POINTER |
:: | pw_pool | the pool for the grids | |

TYPE(section_vals_type), |
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 |

Exchange and Correlation functional calculations

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) | |

TYPE(section_vals_type), |
POINTER |
:: | xc_section | which functional to calculate, and how to do it | |

TYPE(pw_pool_type), |
POINTER |
:: | pw_pool | the pool for the grids | |

LOGICAL |
:: | compute_virial | ... | ||

REAL(dp), |
INTENT(out) |
:: | virial_xc(3,3) | ... |

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

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 | |

TYPE(section_vals_type), |
POINTER |
:: | xc_section | parameters selecting the xc and the method used to calculate it | |

TYPE(pw_pool_type), |
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 |