![]() |
(git:4a2d255)
|
Exchange and Correlation functional calculations. More...
Functions/Subroutines | |
| logical function, public | xc_uses_kinetic_energy_density (xc_fun_section, lsd) |
| ... | |
| logical function, public | xc_uses_norm_drho (xc_fun_section, lsd) |
| ... | |
| subroutine, public | xc_vxc_pw_create1 (vxc_rho, vxc_tau, rho_r, rho_g, tau, exc, xc_section, pw_pool, compute_virial, virial_xc, exc_r) |
| Exchange and Correlation functional calculations. depending on the selected functional_routine calls the correct routine. | |
| subroutine, public | smooth_cutoff (pot, rho, rhoa, rhob, rho_cutoff, rho_smooth_cutoff_range, e_0, e_0_scale_factor) |
| smooths the cutoff on rho with a function smoothderiv_rho that is 0 for rho<rho_cutoff and 1 for rho>rho_cutoff*rho_smooth_cutoff_range: E= integral e_0*smoothderiv_rho => dE/d...= de/d... * smooth, dE/drho = de/drho * smooth + e_0 * dsmooth/drho | |
| subroutine, public | calc_xc_density (pot, rho, rho_cutoff) |
| subroutine, public | xc_vxc_pw_create (vxc_rho, vxc_tau, exc, rho_r, rho_g, tau, xc_section, pw_pool, compute_virial, virial_xc, exc_r) |
| Exchange and Correlation functional calculations. | |
| real(kind=dp) function, public | xc_exc_calc (rho_r, rho_g, tau, xc_section, pw_pool) |
| calculates just the exchange and correlation energy (no vxc) | |
| subroutine, public | xc_calc_2nd_deriv (v_xc, v_xc_tau, deriv_set, rho_set, rho1_r, rho1_g, tau1_r, pw_pool, xc_section, gapw, vxg, do_excitations, do_sf, do_triplet, compute_virial, virial_xc) |
| Caller routine to calculate the second order potential in the direction of rho1_r. | |
| subroutine, public | xc_calc_2nd_deriv_numerical (v_xc, v_tau, rho_set, rho1_r, rho1_g, tau1_r, pw_pool, xc_section, do_triplet, calc_virial, virial_xc, deriv_set) |
| calculates 2nd derivative numerically | |
| subroutine, public | xc_calc_2nd_deriv_analytical (v_xc, v_xc_tau, deriv_set, rho_set, rho1_set, pw_pool, xc_section, gapw, vxg, tddfpt_fac, compute_virial, virial_xc, spinflip) |
| 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 undetermined, 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. | |
| subroutine, public | xc_calc_3rd_deriv_analytical (v_xc, v_xc_tau, deriv_set, rho_set, rho1_set, pw_pool, xc_section, spinflip) |
| Calculates the third functional derivative of the exchange-correlation functional, E_xc. Any GGA functional can be written as: | |
| subroutine, public | xc_prep_2nd_deriv (deriv_set, rho_set, rho_r, pw_pool, xc_section, tau_r) |
| Prepare objects for the calculation of the 2nd derivatives of the density functional. The calculation must then be performed with xc_calc_2nd_deriv. | |
| subroutine, public | xc_prep_3rd_deriv (deriv_set, rho_set, rho_r, pw_pool, xc_section, tau_r, do_sf) |
| Prepare deriv_set for the calculation of the 3rd derivatives of the density functional. The calculation must then be performed with xc_calc_3rd_deriv. | |
| subroutine, public | divide_by_norm_drho (deriv_set, rho_set, lsd) |
| divides derivatives from deriv_set by norm_drho | |
Exchange and Correlation functional calculations.
| logical function, public xc::xc_uses_kinetic_energy_density | ( | type(section_vals_type), intent(in), pointer | xc_fun_section, |
| logical, intent(in) | lsd | ||
| ) |
| logical function, public xc::xc_uses_norm_drho | ( | type(section_vals_type), intent(in), pointer | xc_fun_section, |
| logical, intent(in) | lsd | ||
| ) |
| subroutine, public xc::xc_vxc_pw_create1 | ( | type(pw_r3d_rs_type), dimension(:), pointer | vxc_rho, |
| type(pw_r3d_rs_type), dimension(:), pointer | vxc_tau, | ||
| type(pw_r3d_rs_type), dimension(:), pointer | rho_r, | ||
| type(pw_c1d_gs_type), dimension(:), pointer | rho_g, | ||
| type(pw_r3d_rs_type), dimension(:), pointer | tau, | ||
| real(kind=dp), intent(out) | exc, | ||
| type(section_vals_type), pointer | xc_section, | ||
| type(pw_pool_type), pointer | pw_pool, | ||
| logical, intent(in) | compute_virial, | ||
| real(kind=dp), dimension(3, 3), intent(out) | virial_xc, | ||
| type(pw_r3d_rs_type), intent(inout), optional | exc_r | ||
| ) |
Exchange and Correlation functional calculations. depending on the selected functional_routine calls the correct routine.
| vxc_rho | will contain the v_xc part that depend on rho (if one of the chosen xc functionals has it it is allocated and you are responsible for it) |
| vxc_tau | will contain the kinetic tau part of v_xcthe functional (if one of the chosen xc functionals has it it is allocated and you are responsible for it) |
| rho_r | the value of the density in the real space |
| rho_g | value of the density in the g space (needs to be associated only for gradient corrections) |
| tau | value of the kinetic density tau on the grid (can be null, used only with meta functionals) |
| exc | the xc energy |
| xc_section | parameters selecting the xc and the method used to calculate it |
| pw_pool | the pool for the grids |
| compute_virial | should the virial be computed... if so virial_xc must be present |
| virial_xc | for calculating the GGA part of the stress |
| exc_r | ... |
Definition at line 148 of file xc.F.
| subroutine, public xc::smooth_cutoff | ( | real(kind=dp), dimension(:, :, :), intent(in), pointer | pot, |
| real(kind=dp), dimension(:, :, :), intent(in), pointer | rho, | ||
| real(kind=dp), dimension(:, :, :), intent(in), pointer | rhoa, | ||
| real(kind=dp), dimension(:, :, :), intent(in), pointer | rhob, | ||
| real(kind=dp), intent(in) | rho_cutoff, | ||
| real(kind=dp), intent(in) | rho_smooth_cutoff_range, | ||
| real(kind=dp), dimension(:, :, :), optional, pointer | e_0, | ||
| real(kind=dp), intent(in), optional | e_0_scale_factor | ||
| ) |
smooths the cutoff on rho with a function smoothderiv_rho that is 0 for rho<rho_cutoff and 1 for rho>rho_cutoff*rho_smooth_cutoff_range: E= integral e_0*smoothderiv_rho => dE/d...= de/d... * smooth, dE/drho = de/drho * smooth + e_0 * dsmooth/drho
| pot | the potential to smooth |
| rho,rhoa,rhob | the value of the density (used to apply the cutoff) |
| rhoa | ... |
| rhob | ... |
| rho_cutoff | the value at whch the cutoff function must go to 0 |
| rho_smooth_cutoff_range | range of the smoothing |
| e_0 | value of e_0, if given it is assumed that pot is the derivative wrt. to rho, and needs the dsmooth*e_0 contribution |
| e_0_scale_factor | ... |
Definition at line 912 of file xc.F.
| subroutine, public xc::calc_xc_density | ( | type(pw_r3d_rs_type), intent(inout) | pot, |
| type(pw_r3d_rs_type), dimension(:), intent(inout) | rho, | ||
| real(kind=dp), intent(in) | rho_cutoff | ||
| ) |
| subroutine, public xc::xc_vxc_pw_create | ( | type(pw_r3d_rs_type), dimension(:), pointer | vxc_rho, |
| type(pw_r3d_rs_type), dimension(:), pointer | vxc_tau, | ||
| real(kind=dp), intent(out) | exc, | ||
| type(pw_r3d_rs_type), dimension(:), pointer | rho_r, | ||
| type(pw_c1d_gs_type), dimension(:), pointer | rho_g, | ||
| type(pw_r3d_rs_type), dimension(:), pointer | tau, | ||
| type(section_vals_type), pointer | xc_section, | ||
| type(pw_pool_type), pointer | pw_pool, | ||
| logical | compute_virial, | ||
| real(kind=dp), dimension(3, 3), intent(out) | virial_xc, | ||
| type(pw_r3d_rs_type), intent(inout), optional | exc_r | ||
| ) |
Exchange and Correlation functional calculations.
| vxc_rho | will contain the v_xc part that depend on rho (if one of the chosen xc functionals has it it is allocated and you are responsible for it) |
| vxc_tau | will contain the kinetic tau part of v_xc (if one of the chosen xc functionals has it it is allocated and you are responsible for it) |
| exc | the xc energy |
| rho_r | the value of the density in the real space |
| rho_g | value of the density in the g space (needs to be associated only for gradient corrections) |
| tau | value of the kinetic density tau on the grid (can be null, used only with meta functionals) |
| xc_section | which functional to calculate, and how to do it |
| pw_pool | the pool for the grids |
| compute_virial | ... |
| virial_xc | ... |
| exc_r | the value of the xc functional in the real space |
Definition at line 1143 of file xc.F.
| real(kind=dp) function, public xc::xc_exc_calc | ( | type(pw_r3d_rs_type), dimension(:), pointer | rho_r, |
| type(pw_c1d_gs_type), dimension(:), pointer | rho_g, | ||
| type(pw_r3d_rs_type), dimension(:), pointer | tau, | ||
| type(section_vals_type), pointer | xc_section, | ||
| type(pw_pool_type), pointer | pw_pool | ||
| ) |
calculates just the exchange and correlation energy (no vxc)
| rho_r | realspace density on the grid |
| rho_g | g-space density on the grid |
| tau | kinetic energy density on the grid |
| xc_section | XC parameters |
| pw_pool | pool of plain-wave grids |
Definition at line 1458 of file xc.F.
| subroutine, public xc::xc_calc_2nd_deriv | ( | type(pw_r3d_rs_type), dimension(:), pointer | v_xc, |
| type(pw_r3d_rs_type), dimension(:), pointer | v_xc_tau, | ||
| type(xc_derivative_set_type) | deriv_set, | ||
| type(xc_rho_set_type) | rho_set, | ||
| type(pw_r3d_rs_type), dimension(:), pointer | rho1_r, | ||
| type(pw_c1d_gs_type), dimension(:), pointer | rho1_g, | ||
| type(pw_r3d_rs_type), dimension(:), pointer | tau1_r, | ||
| type(pw_pool_type), intent(in), pointer | pw_pool, | ||
| type(section_vals_type), intent(in), pointer | xc_section, | ||
| logical, intent(in) | gapw, | ||
| real(kind=dp), dimension(:, :, :, :), optional, pointer | vxg, | ||
| logical, intent(in), optional | do_excitations, | ||
| logical, intent(in), optional | do_sf, | ||
| logical, intent(in), optional | do_triplet, | ||
| logical, intent(in), optional | compute_virial, | ||
| real(kind=dp), dimension(3, 3), intent(inout), optional | virial_xc | ||
| ) |
Caller routine to calculate the second order potential in the direction of rho1_r.
| v_xc | XC potential, will be allocated, to be integrated with the KS density |
| v_xc_tau | ... |
| deriv_set | XC derivatives from xc_prep_2nd_deriv |
| rho_set | XC rho set from KS rho from xc_prep_2nd_deriv |
| rho1_r | first-order density in r space |
| rho1_g | first-order density in g space |
| tau1_r | ... |
| pw_pool | pw pool to create new grids |
| xc_section | XC section to calculate the derivatives from |
| gapw | whether to carry out GAPW (not possible with numerical derivatives) |
| vxg | GAPW potential |
| do_excitations | ... |
| do_triplet | ... |
| compute_virial | ... |
| virial_xc | virial terms will be collected here |
Definition at line 1528 of file xc.F.
| subroutine, public xc::xc_calc_2nd_deriv_numerical | ( | type(pw_r3d_rs_type), dimension(:), intent(in), pointer | v_xc, |
| type(pw_r3d_rs_type), dimension(:), intent(in), pointer | v_tau, | ||
| type(xc_rho_set_type), intent(in) | rho_set, | ||
| type(pw_r3d_rs_type), dimension(:), intent(in), pointer | rho1_r, | ||
| type(pw_c1d_gs_type), dimension(:), intent(in), pointer | rho1_g, | ||
| type(pw_r3d_rs_type), dimension(:), intent(in), pointer | tau1_r, | ||
| type(pw_pool_type), intent(in), pointer | pw_pool, | ||
| type(section_vals_type), intent(in), pointer | xc_section, | ||
| logical, intent(in) | do_triplet, | ||
| logical, intent(in), optional | calc_virial, | ||
| real(kind=dp), dimension(3, 3), intent(inout), optional | virial_xc, | ||
| type(xc_derivative_set_type), optional | deriv_set | ||
| ) |
calculates 2nd derivative numerically
| v_xc | potential to be calculated (has to be allocated already) |
| v_tau | tau-part of the potential to be calculated (has to be allocated already) |
| rho_set | KS density from xc_prep_2nd_deriv |
| rho1_r | first-order density in r-space |
| rho1_g | first-order density in g-space |
| tau1_r | first-order kinetic-energy density in r-space |
| pw_pool | pw pool for new grids |
| xc_section | XC section to calculate the derivatives from |
| do_triplet | ... |
| calc_virial | whether to calculate virial terms |
| virial_xc | collects stress tensor components (no metaGGAs!) |
| deriv_set | deriv set from xc_prep_2nd_deriv (only for virials) |
Definition at line 1660 of file xc.F.
| subroutine, public xc::xc_calc_2nd_deriv_analytical | ( | type(pw_r3d_rs_type), dimension(:), pointer | v_xc, |
| type(pw_r3d_rs_type), dimension(:), pointer | v_xc_tau, | ||
| type(xc_derivative_set_type) | deriv_set, | ||
| type(xc_rho_set_type), intent(in) | rho_set, | ||
| type(xc_rho_set_type), intent(in) | rho1_set, | ||
| type(pw_pool_type), pointer | pw_pool, | ||
| type(section_vals_type), pointer | xc_section, | ||
| logical, intent(in), optional | gapw, | ||
| real(kind=dp), dimension(:, :, :, :), optional, pointer | vxg, | ||
| real(kind=dp), intent(in), optional | tddfpt_fac, | ||
| logical, intent(in), optional | compute_virial, | ||
| real(kind=dp), dimension(3, 3), intent(inout), optional | virial_xc, | ||
| logical, intent(in), optional | spinflip | ||
| ) |
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 undetermined, 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.
| v_xc | exchange-correlation potential |
| v_xc_tau | ... |
| deriv_set | derivatives of the exchange-correlation potential |
| rho_set | object containing the density at which the derivatives were calculated |
| rho1_set | object containing the density with which to fold |
| pw_pool | the pool for the grids |
| xc_section | XC parameters |
| gapw | Gaussian and augmented plane waves calculation |
| vxg | ... |
| tddfpt_fac | factor that multiplies the crossterms (tddfpt triplets on a closed shell system it should be -1, defaults to 1) |
| compute_virial | ... |
| virial_xc | ... |
Definition at line 2647 of file xc.F.
| subroutine, public xc::xc_calc_3rd_deriv_analytical | ( | type(pw_r3d_rs_type), dimension(:), pointer | v_xc, |
| type(pw_r3d_rs_type), dimension(:), pointer | v_xc_tau, | ||
| type(xc_derivative_set_type) | deriv_set, | ||
| type(xc_rho_set_type), intent(in) | rho_set, | ||
| type(xc_rho_set_type), intent(in) | rho1_set, | ||
| type(pw_pool_type), pointer | pw_pool, | ||
| type(section_vals_type), pointer | xc_section, | ||
| logical, intent(in), optional | spinflip | ||
| ) |
Calculates the third functional derivative of the exchange-correlation functional, E_xc. Any GGA functional can be written as:
E_xc[\rho] = \int e_xc(\rho,\nabla\rho)dr
This routine gives you back the contraction of the derivatives of e_xc with respect to the alpha or beta density or with respect to the norm of their gradients contracted with rho1. For example, the alpha component would be (d stands for total derivative):
d^3 e_xc
v_xc(1) = \sum_{s,s'}^{a,b} ------------------—\rhos1\rho1s' d\rhoa d\rhos d\rhos'
| v_xc | Third derivative of the exchange-correlation functional |
| v_xc_tau | ... |
| deriv_set | derivatives of the exchange-correlation potential, e_xc |
| rho_set | object containing the density at which the derivatives were calculated, \rho |
| rho1_set | object containing the density with which to fold, \rho1s |
| pw_pool | the pool for the grids |
| xc_section | XC parameters |
Definition at line 5326 of file xc.F.
| subroutine, public xc::xc_prep_2nd_deriv | ( | type(xc_derivative_set_type) | deriv_set, |
| type(xc_rho_set_type) | rho_set, | ||
| type(pw_r3d_rs_type), dimension(:), pointer | rho_r, | ||
| type(pw_pool_type), pointer | pw_pool, | ||
| type(section_vals_type), pointer | xc_section, | ||
| type(pw_r3d_rs_type), dimension(:), optional, pointer | tau_r | ||
| ) |
Prepare objects for the calculation of the 2nd derivatives of the density functional. The calculation must then be performed with xc_calc_2nd_deriv.
| deriv_set | object containing the XC derivatives (out) |
| rho_set | object that will contain the density at which the derivatives were calculated |
| rho_r | the place where you evaluate the derivative |
| pw_pool | the pool for the grids |
| xc_section | which functional should be used and how to calculate it |
| tau_r | kinetic energy density in real space |
Definition at line 6129 of file xc.F.
| subroutine, public xc::xc_prep_3rd_deriv | ( | type(xc_derivative_set_type) | deriv_set, |
| type(xc_rho_set_type) | rho_set, | ||
| type(pw_r3d_rs_type), dimension(:), pointer | rho_r, | ||
| type(pw_pool_type), pointer | pw_pool, | ||
| type(section_vals_type), pointer | xc_section, | ||
| type(pw_r3d_rs_type), dimension(:), optional, pointer | tau_r, | ||
| logical, optional | do_sf | ||
| ) |
Prepare deriv_set for the calculation of the 3rd derivatives of the density functional. The calculation must then be performed with xc_calc_3rd_deriv.
| deriv_set | object containing the XC derivatives (out) |
| rho_set | object that will contain the density at which the derivatives were calculated |
| rho_r | the place where you evaluate the derivative |
| pw_pool | the pool for the grids |
| xc_section | which functional should be used and how to calculate it |
| tau_r | kinetic energy density in real space |
| do_sf | Flag to activate the noncollinear kernel for spin flip calculations |
Definition at line 6186 of file xc.F.
| subroutine, public xc::divide_by_norm_drho | ( | type(xc_derivative_set_type), intent(inout) | deriv_set, |
| type(xc_rho_set_type), intent(in) | rho_set, | ||
| logical, intent(in) | lsd | ||
| ) |