Exchange-correlation potential: programming module

The exchange potential in local density approximation (LDA) has a form [see Ref. 1]

  1. $${V^X}\left[ \rho  \right] =  - {\left( {\frac{3}{\pi }\rho } \right)^{\frac{1}{3}}}$$

The correlation potential in LDA in the form of Ceperley-Alder with Perdew-Zunger parameterization for unpolarized case has a form [Ref. 2]:

  1. $${V^C}\left[ \rho  \right] = \left\{ \begin{array}{l}A\ln {r_s} + \left( {B - \frac{1}{3}A} \right) + \frac{2}{3}C{r_s}\ln {r_s} + \frac{1}{3}\left( {2D - C} \right){r_s},\;\;\;\;{\rm{if}}\;{r_s} < 1;\\\gamma \frac{{\left( {1 + \frac{7}{6}{\beta _1}\sqrt {{r_s}}  + \frac{4}{3}{\beta _2}{r_s}} \right)}}{{{{\left( {1 + {\beta _1}\sqrt {{r_s}}  + {\beta _2}{r_s}} \right)}^2}}},\;\;\;\;\;\;\;{\rm{if}}\;\;\;{r_s} \ge 1;\end{array} \right.$$

where ${r_s} = {\left( {\frac{3}{{4\pi \rho }}} \right)^{\frac{1}{3}}}$, $A=0.0311$, $B=-0.048$, $C=0.002$, $D=-0.0116$, ${\beta _1} = 1.0529$, ${\beta _2} = 0.3334$, $\gamma  =  - 0.1423$.

The following modules calculate exchange-correlation potential $V^{XC}=V^X+V^C$: 

Fortran, C++, and Python.

References:

[1] Parr, R.G.; Yang, W. Density functional theory of atoms and molecules. Oxford University. Press, New York, 1989.

[2] Perdew, J.P.; Zunger, A. Self-interaction correction to density-functional approximations for many-electron systems. Phys. Rev. B 23, 5048, 1981.