Exchange and correlation functionals
Libxc
GPAW offers access to the functionals from libxc. …
Known Problems
MGGAs: Some MGGAs (e.g. a functional utilizing the exchange from Becke-Roussel 89, ‘MGGA_X_BR89+MGGA_C_TPSS’) need the laplacian which we don’t provide at the time of this writing. Therefore the utilization of these functionals will raise an exception.
MGGAs: The libxc enforces the Fermi hole curvature by default, which leads to errornous results and convergence problems in codes using pseudopotentials. In versions of libxc > 7.0 this behaviour can and will be switched of during runtime. In versions below 7.0 this must be switch off during compile time by using ‘–disable-fhc’ during installtion of libxc.
You can check this running the following code snippet:
"""check is libxc is compiled with --disable-fhc (needed for mggas)"""
from ase.build import molecule
from gpaw import GPAW, KohnShamConvergenceError
from gpaw.utilities.adjust_cell import adjust_cell
vacuum = 4.0
h = 0.3
def test_mgga_lxc_fhc():
cluster = molecule('CO')
adjust_cell(cluster, border=vacuum, h=h)
calc = GPAW(xc='MGGA_X_TPSS+MGGA_C_TPSS',
mode='fd',
h=h,
maxiter=14,
convergence={
'energy': 0.5,
'density': 1.0e-1,
'eigenstates': 4.0e-1})
cluster.calc = calc
try:
cluster.get_potential_energy()
except KohnShamConvergenceError:
pass
assert calc.scf.converged
if __name__ == '__main__':
test_mgga_lxc_fhc()
Technical details
Calculation of GGA potential
In libxc we have (see also “Standard subroutine calls” on ccg_dft_design) \(\sigma_0=\sigma_{\uparrow\uparrow}\), \(\sigma_1=\sigma_{\uparrow\downarrow}\) and \(\sigma_2=\sigma_{\downarrow\downarrow}\) with
Uniform 3D grid
We use a finite-difference stencil to calculate the gradients:
The \(x\)-component of \(\mathbf{D}_{gg'}\) will be non-zero only when \(g\) and \(g'\) grid points are neighbors in the \(x\)-direction, where the values will be \(1/(2h)\) when \(g'\) is to the right of \(g\) and \(-1/(2h)\) when \(g'\) is to the left of \(g\). Similar story for the \(y\) and \(z\) components.
Let’s look at the spin-\(k\) XC potential from the energy expression \(\sum_g\epsilon(\sigma_{ijg})\):
Using \(v_{ijg}=\partial \epsilon(\sigma_{ijg})/\partial \sigma_{ijg}\), \(\mathbf{D}_{gg'}=-\mathbf{D}_{g'g}\) and
we get:
The potentials from the general energy expression \(\sum_g\epsilon(\sigma_{0g}, \sigma_{1g}, \sigma_{2g})\) will be:
and
PAW correction
Spin-paired case:
where \(w\) is the weight …
where
and
Notice that \(r \mathbf{\nabla} Y_L\) is independent of \(r\) - just as \(Y_L\) is. From the two contributions, which are orthogonal (\(\hat{\mathbf{r}} \cdot \mathbf{b}_g = 0\)), we get
Inserting
we get