PAOFLOW.basis_gen.xc#

Exchange-correlation functionals for the radial pseudo-atom solver.

Spin-unpolarised only. All inputs and outputs in Hartree atomic units.

Two functionals are supported:

  • LDA-PW92 – Slater exchange + Perdew-Wang 1992 correlation.

  • PBE – spin-unpolarised PBE GGA, for a spherical density on a user-supplied 1D radial mesh.

The select_functional() helper inspects a UPF and returns the string 'LDA' or 'PBE'. Pseudos tagged with any GGA flavour other than PBE fall back to PBE (the user-requested policy) with a RuntimeWarning.

Functions#

lda_pw92(n)

Spin-unpolarised LDA (Slater exchange + PW92 correlation).

pbe(n, r[, rab])

Spin-unpolarised PBE GGA for a spherical density on a radial mesh.

select_functional(upf)

Return 'LDA' or 'PBE' for the XC functional carried by upf.

Module Contents#

PAOFLOW.basis_gen.xc.lda_pw92(n)[source]#

Spin-unpolarised LDA (Slater exchange + PW92 correlation).

Parameters:

n (ndarray) – Electron density (Bohr^-3). Zero/negative entries return zero.

Returns:

  • eps_xc (ndarray) – XC energy per particle (Hartree).

  • v_xc (ndarray) – XC potential (Hartree).

PAOFLOW.basis_gen.xc.pbe(n, r, rab=None)[source]#

Spin-unpolarised PBE GGA for a spherical density on a radial mesh.

Parameters:
  • n (ndarray, shape (N,)) – Electron density n(r) (Bohr^-3).

  • r (ndarray, shape (N,)) – Radial mesh (Bohr). Need not be uniform; np.gradient is used with the actual r spacing for the derivative.

  • rab (ndarray, optional) – Unused; kept for signature symmetry with the radial routines.

Returns:

  • eps_xc (ndarray) – XC energy per particle (Hartree).

  • v_xc (ndarray) – XC potential,

    \[v_{xc}(r) = \frac{\partial F}{\partial n} - \frac{1}{r^2}\frac{d}{dr}\!\left[r^2 \cdot 2\frac{\partial F}{\partial\sigma}\frac{dn}{dr}\right].\]

PAOFLOW.basis_gen.xc.select_functional(upf)[source]#

Return 'LDA' or 'PBE' for the XC functional carried by upf.

Inspects upf.qexc (UPF PP_HEADER functional attribute). Tokens are matched case-insensitively:

  • any token in {PBE, PBX, PBC, GGA} -> 'PBE'.

  • tokens are a subset of {SLA, PW, PZ, LDA, NOGX, NOGC, VWN} -> 'LDA'.

  • any other GGA flavour (BLYP, BP, B3LYP, B88, …) -> 'PBE' with a RuntimeWarning. This matches the user-requested “fall back to PBE for any other GGA” policy: the pseudopotential was built with gradient corrections, so a GGA-level frozen potential is a much closer match than LDA.