Octopus
xc.F90 File Reference

Go to the source code of this file.

Modules

module  xc_oct_m
 

Data Types

type  xc_oct_m::internal_quantities_t
 
type  xc_oct_m::xc_t
 

Functions/Subroutines

subroutine, public xc_oct_m::xc_write_info (xcs, iunit, namespace)
 
subroutine, public xc_oct_m::xc_init (xcs, namespace, ndim, periodic_dim, nel, x_id, c_id, xk_id, ck_id, hartree_fock, ispin)
 
subroutine parse ()
 
subroutine, public xc_oct_m::xc_end (xcs)
 
logical pure function, public xc_oct_m::xc_is_orbital_dependent (xcs)
 Is the xc family orbital dependent. More...
 
pure logical function xc_oct_m::family_is_gga (family, only_collinear)
 Is the xc function part of the GGA family. More...
 
pure logical function xc_oct_m::family_is_supported (family)
 Is the xc family internally supported by Octopus. More...
 
pure logical function, public xc_oct_m::family_is_mgga (family, only_collinear)
 Is the xc function part of the mGGA family. More...
 
logical pure function, public xc_oct_m::family_is_mgga_with_exc (xcs)
 Is the xc function part of the mGGA family with an energy functional. More...
 
logical pure function, public xc_oct_m::family_is_hybrid (xcs)
 Returns true if the functional is an hybrid functional. More...
 
pure logical function, public xc_oct_m::in_family (family, xc_families)
 
subroutine xc_oct_m::copy_global_to_local (global, local, n_block, nspin, ip)
 make a local copy with the correct memory order for libxc More...
 
subroutine xc_oct_m::copy_local_to_global (local, global, n_block, spin_channels, ip)
 
subroutine xc_oct_m::set_hybrid_params (xcs, namespace)
 Sets external parameters for some hybrid functionals. More...
 
logical function, public xc_oct_m::xc_is_not_size_consistent (xcs, namespace)
 Is one of the x or c functional is not size consistent. More...
 
logical pure function, public xc_oct_m::xc_is_energy_functional (xcs)
 Is one of the x or c functional is not an energy functional. More...
 
subroutine, public xc_oct_m::xc_get_vxc (gr, xcs, st, kpoints, psolver, namespace, space, rho, ispin, rcell_volume, vxc, ex, ec, deltaxc, vtau, ex_density, ec_density, stress_xc, force_orbitalfree)
 
subroutine xc_oct_m::xc_update_internal_quantities (gr, xcs, st, kpoints, namespace, space, rho, quantities, ispin, rcell_volume, force_orbitalfree)
 Given a functional, we are updating/transfering/computing the needed internal quantities that are later needed to perform an actual call to xc_compute_vxc. More...
 
subroutine xc_oct_m::xc_release_internal_quantities (quantities)
 
subroutine xc_oct_m::xc_compute_vxc (der, xcs, st, psolver, namespace, space, quantities, ispin, vxc, ex, ec, deltaxc, vtau, ex_density, ec_density, stress_xc)
 
subroutine space_loop_init (ip, np, nblock)
 
subroutine lda_init ()
 Takes care of the initialization of the LDA part of the functionals *) allocates density and dedd, and their local variants *) calculates the density taking into account nlcc and non-collinear spin. More...
 
subroutine lda_end ()
 deallocate variables allocated in lda_init More...
 
subroutine lda_process ()
 calculates the LDA part of vxc, taking into account non-collinear spin More...
 
subroutine gga_init ()
 initialize GGAs *) allocates gradient of the density (gdens), dedgd, and its local variants More...
 
subroutine gga_end ()
 cleans up memory allocated in gga_init More...
 
subroutine gga_process ()
 calculates the GGA contribution to vxc More...
 
subroutine mgga_init ()
 initialize meta-GGAs *) allocate the kinetic-energy density, dedtau, and local variants More...
 
subroutine mgga_end ()
 clean up memory allocated in mgga_init More...
 
subroutine local_allocate ()
 THREADSAFE (no SAFE ALLOCATE or PUSH/POP SUB) More...
 
subroutine local_deallocate ()
 THREADSAFE (no SAFE ALLOCATE or PUSH/POP SUB) More...
 
subroutine mgga_process ()
 calculate the mgga contribution to vxc More...
 
pure logical function xc_oct_m::functional_needs_laplacian (functl)
 
subroutine xc_oct_m::xc_density_correction_calc (xcs, der, psolver, namespace, space, nspin, density, refvx, vxc, deltaxc)
 
real(real64) function xc_oct_m::get_qxc (mesh, nxc, density, ncutoff)
 
subroutine, public xc_oct_m::xc_get_fxc (xcs, mesh, namespace, rho, ispin, fxc, zfxc)
 
subroutine, public xc_oct_m::xc_get_kxc (xcs, mesh, namespace, rho, ispin, kxc)
 
subroutine, public xc_oct_m::xc_get_nc_vxc (gr, xcs, st, kpoints, space, namespace, rho, vxc, ex, ec, vtau, ex_density, ec_density)
 This routines is similar to xc_get_vxc but for noncollinear functionals, which are not implemented in libxc. More...
 
subroutine xc_oct_m::xc_nc_update_internal_quantities (gr, xcs, st, kpoints, space, namespace, rho, quantities)
 Given a functional, we are updating/transfering/computing the needed internal quantities that are later needed to perform an actual call to xc_compute_vxc. More...
 
subroutine xc_oct_m::xc_compute_vxc_nc (gr, xcs, st, namespace, quantities, vxc, ex, ec, vtau, ex_density, ec_density)
 This routines is similar to xc_update_internal_quantities but for noncollinear functionals, which are not implemented in libxc. More...
 
subroutine nc_lda_init ()
 Takes care of the initialization of the LDA part of the functionals *) allocates density and dedd, and their local variants *) calculates the density taking into account nlcc and non-collinear spin. More...
 
subroutine nc_lda_end ()
 deallocate variables allocated in nc_lda_init More...
 
subroutine nc_lda_process ()
 calculates the LDA part of vxc More...
 
subroutine nc_gga_init ()
 initialize GGAs *) allocates gradient of the density (gdens), dedgd, and its local variants More...
 
subroutine nc_gga_end ()
 cleans up memory allocated in gga_init More...
 
subroutine nc_gga_process ()
 calculates the GGA contribution to vxc More...
 
subroutine nc_mgga_init ()
 initialize meta-GGAs *) allocate the kinetic-energy density, dedtau, and local variants More...
 
subroutine nc_mgga_end ()
 clean up memory allocated in nc_mgga_init More...
 
subroutine nc_mgga_process ()
 calculate the mgga contribution to vxc More...
 
pure logical function xc_oct_m::family_is_nc_mgga (family)
 Returns true is the functional is a noncollinear functional. More...
 
subroutine xc_oct_m::nc_mgga_exc_vxc (functl, namespace, n_block, l_dens, l_sigma, l_ldens, l_tau, l_dedd, l_vsigma, l_deddldens, l_dedtau, l_zk)
 Interface between the generic call to get the energy and potential and the calls to each specific functionals. More...
 
subroutine xc_oct_m::nc_br_vxc_exc (l_dens, l_sigma, l_ldens, l_tau, gamma, explicit, l_dedd, l_vsigma, l_dedldens, l_dedtau, l_zk)
 Computes the local curvature of the exchange-hole and get the corresponding values of x and b. More...
 
real(real64) function xc_oct_m::nc_br_get_x (ldens, lcurv)
 Computes the coefficient x from the local density and the local curvature of the exchange hole, see Eq. B7 in PRB 107, 165111 (2023) More...
 
real(real64) function xc_oct_m::nc_br_get_x_explicit (ldens, lcurv)
 Computes the coefficient x from the local density and the local curvature of the exchange hole, see Eq. B7 in PRB 107, 165111 (2023) More...
 
real(real64) function xc_oct_m::nc_br_rtsafe (rhs, tol)
 This is inspired by the safe Newton-Raphson method from numerical recipies This function returns the value of x that fulfill the equation \(x exp(-2/3*x)/(x-2) = rhs\). More...
 
subroutine xc_oct_m::nc_cs_vxc_exc (l_dens, l_sigma, l_ldens, l_tau, l_dedd, l_vsigma, l_dedldens, l_dedtau, l_zk)
 Implements the correlation energy functional defined in Tancogne-Dejean et al., PRB 107, 165111 (2023) More...
 

Variables

real(real64), parameter xc_oct_m::tiny = 1.0e-12_real64
 
integer, parameter xc_oct_m::lr_none = 0
 
integer, parameter xc_oct_m::lr_x = 1
 

Function/Subroutine Documentation

◆ parse()

subroutine xc_init::parse
private

Definition at line 377 of file xc.F90.

◆ space_loop_init()

subroutine space_loop_init ( integer, intent(in)  ip,
integer, intent(in)  np,
integer, intent(out)  nblock 
)
private

Definition at line 1371 of file xc.F90.

◆ lda_init()

subroutine lda_init
private

Takes care of the initialization of the LDA part of the functionals *) allocates density and dedd, and their local variants *) calculates the density taking into account nlcc and non-collinear spin.

Definition at line 1415 of file xc.F90.

◆ lda_end()

subroutine lda_end
private

deallocate variables allocated in lda_init

Definition at line 1443 of file xc.F90.

◆ lda_process()

subroutine lda_process
private

calculates the LDA part of vxc, taking into account non-collinear spin

Definition at line 1460 of file xc.F90.

◆ gga_init()

subroutine xc_compute_vxc::gga_init
private

initialize GGAs *) allocates gradient of the density (gdens), dedgd, and its local variants

Definition at line 1504 of file xc.F90.

◆ gga_end()

subroutine xc_compute_vxc::gga_end
private

cleans up memory allocated in gga_init

Definition at line 1517 of file xc.F90.

◆ gga_process()

subroutine xc_compute_vxc::gga_process
private

calculates the GGA contribution to vxc

For the spinor case, we follow Peralta, Scuseria, and Frisch, PRB 75, 125119 (2007). This correspond to compute the GGAs in the local frame and then rotate back. This does not lead to any exchange-correlation torque

Definition at line 1532 of file xc.F90.

◆ mgga_init()

subroutine xc_compute_vxc::mgga_init
private

initialize meta-GGAs *) allocate the kinetic-energy density, dedtau, and local variants

Definition at line 1596 of file xc.F90.

◆ mgga_end()

subroutine xc_compute_vxc::mgga_end
private

clean up memory allocated in mgga_init

Definition at line 1608 of file xc.F90.

◆ local_allocate()

subroutine local_allocate
private

THREADSAFE (no SAFE ALLOCATE or PUSH/POP SUB)

Definition at line 1618 of file xc.F90.

◆ local_deallocate()

subroutine local_deallocate
private

THREADSAFE (no SAFE ALLOCATE or PUSH/POP SUB)

Definition at line 1644 of file xc.F90.

◆ mgga_process()

subroutine xc_compute_vxc::mgga_process
private

calculate the mgga contribution to vxc

Definition at line 1666 of file xc.F90.

◆ nc_lda_init()

subroutine xc_compute_vxc_nc::nc_lda_init
private

Takes care of the initialization of the LDA part of the functionals *) allocates density and dedd, and their local variants *) calculates the density taking into account nlcc and non-collinear spin.

Definition at line 2798 of file xc.F90.

◆ nc_lda_end()

subroutine xc_compute_vxc_nc::nc_lda_end
private

deallocate variables allocated in nc_lda_init

Definition at line 2826 of file xc.F90.

◆ nc_lda_process()

subroutine xc_compute_vxc_nc::nc_lda_process
private

calculates the LDA part of vxc

Definition at line 2842 of file xc.F90.

◆ nc_gga_init()

subroutine xc_compute_vxc_nc::nc_gga_init
private

initialize GGAs *) allocates gradient of the density (gdens), dedgd, and its local variants

Definition at line 2857 of file xc.F90.

◆ nc_gga_end()

subroutine xc_compute_vxc_nc::nc_gga_end
private

cleans up memory allocated in gga_init

Definition at line 2869 of file xc.F90.

◆ nc_gga_process()

subroutine xc_compute_vxc_nc::nc_gga_process
private

calculates the GGA contribution to vxc

Definition at line 2879 of file xc.F90.

◆ nc_mgga_init()

subroutine xc_compute_vxc_nc::nc_mgga_init
private

initialize meta-GGAs *) allocate the kinetic-energy density, dedtau, and local variants

Definition at line 2900 of file xc.F90.

◆ nc_mgga_end()

subroutine xc_compute_vxc_nc::nc_mgga_end
private

clean up memory allocated in nc_mgga_init

Definition at line 2912 of file xc.F90.

◆ nc_mgga_process()

subroutine xc_compute_vxc_nc::nc_mgga_process
private

calculate the mgga contribution to vxc

Definition at line 2922 of file xc.F90.