Exchange-Correlation Functionals

by Ute Werner & Pasquale Pavone for exciting neon

Purpose: In this tutorial, you will learn how to use different exchange-correlation (XC) functionals and the libxc library. As an example, the optimal volume and bulk modulus of silicon are calculated.

1. Introduction

In this tutorial, we use ideas and scripts which are fully described in Volume optimization for cubic systems. Here, we will use these scripts to compare XC functionals, without going into the details of the scripts. The comparison of results obtained for the equilibrium volume and bulk modulus for different XC functionals gives information on the validity and applicability of the functionals.

2. Directly implemented functionals

i) Preparation of the input file

The first step is to create a directory for the system that you want to investigate.

$ mkdir XC-functionals
$ cd XC-functionals

In this tutorial, we consider as an example the calculation of the energy-vs-volume curves for silicon in the fcc cubic structure. Inside the directory XC-functionals, we create the file input.xml corresponding to a SCF calculation at a reference lattice constant. The input file employing the experimental lattice constant could look like the following.

   <structure speciespath="$EXCITINGROOT/species">
      <crystal scale="10.261">
         <basevect> 0.0     0.5     0.5 </basevect>
         <basevect> 0.5     0.0     0.5 </basevect>
         <basevect> 0.5     0.5     0.0 </basevect>
      <species speciesfile="Si.xml">
         <atom coord="0.00 0.00 0.00" />
         <atom coord="0.25 0.25 0.25" />
      ngridk="8 8 8"

The parameter xctype specifies the XC functional that will be used in the calculation. In this example, the local spin density approximation (LDA_PW) is used. For further details and pararmeters see Input Reference. Set the correct path for the exciting root directory ($EXCITINGROOT) to the one pointing to the place where the exciting directory is placed.

ii) Execute calculations at different volumes

Using the input file created above, you can perform calculations at different volumes for the xctype = "LDA_PW" functional, as you learn more in details in the tutorial Volume optimization for cubic systems. For a given exchenge-correlation functional, the recommended number of volume values for which a calculation should be done is 11.


Enter the number of volume values >>>> 11


To execute the calculations, run


After completing the calculation for the LDA_PW functional, you can investigate other functionals. For instance, you can change in the input file input.xml the value of the attribute xctype to "GGA_PBE_SOL" (general gradient approximation, GGA). Then, you can run exciting as above but changing the directory name to GGA_PBE_SOL, etc.

iii) Post processing: Comparison of XC functionals

In order to compare the different XC functionals, you may calculate the lattice constant and the bulk modulus by entering the directory related to the exchange-correlation functional you choose and running there the script (cf. Volume optimization for cubic systems).

$ cd LDA_PW

     V0        B0         Bp        a-sc       a-bcc      a-fcc     log(chi)
  266.07236    96.128     4.272     6.4318     8.1036    10.2099      -5.87


Compare your results to the experimental values, which you can obtain, e.g., from the WebElements site. You can also use the Python script for a graphical comparison of the energy-versus-volume values for different functionals. The script will produce the following output on the screen.

$ cd /home/tutorials/XC-functionals


 Enter the names of the working directories. 

 Enter "(Q)uit" or "(q)uit" to terminate input


 Directory name ==> LDA_PW
 Directory name ==> GGA_PBE_SOL
 Directory name ==> q



In this example, the input entry is preceded by "directory name: ". The entry values must be typed on the screen and must be the name of the directories which contain your results for different XC functionals. In the example, the first entry contains results obtained using the LDA_PW exchange-correlation functional and the second the ones corresponding to GGA_PBE_SOL calculation. If you enter q, the input will be terminated. The script produces a PostScript (PLOT.eps) and a PNG (PLOT.png) output file, as well as an image on the screen. Using the given example you will obtain the following plot.


For a better comparison, the minima of the energy-vs-volume values are shifted to zero.

3. Use of libxc

In order to use a wider variety of XC functionals or to combine different functionals for exchange and correlation, the libxc library can be used. For this purpose, the element libxc can be added to the groundstate element in the exciting input. The XC functional can then be chosen with the attributes xc or exchange and correlation, as described in detail in Input Reference.


  • Not every functional, especially not every combination of exchange and correlation, may give stable results. For more details on the validity and applicability of different functionals, please look at the tables shown here.
  • Further details concerning different functionals can be found in the libxc wiki.
Example calculation

Repeat the calculation for silicon from the previous section, but this time employing the libxc library. For this purpose, use the previous input file and replace the groundstate element with the following lines.

      ngridk="8 8 8"

If you plot your new results together with the previous results from LDA_PW and GGA_PBE_SOL using the script (see above), you will obtain the following plot:


4. Exercises

  • Repeat the example of silicon for different XC functionals and try to find the best agreement with the experimental values.
  • Investigate the influence of different combinations of exchange and correlation functionals on calculations performed for another material, e.g., silver.

5. Literature

  • LDA_PW: J. P. Perdew and Y. Wang, Phys. Rev. B 23, 5048 (1981); D.M. Ceperly and B.J. Alder, Phys. Rev. Lett. 45, 566 (1980)
  • GGA_PBE_SOL: J. P. Perdew, A. Ruzsinszky, G. I. Csonka, O. A. Vydrov, G. E. Scuseria, L. A. Constantin, X. Zhou, and K. Burke, Phys. Rev. Lett. 100, 136406 (2008); Erratum: Phys. Rev. Lett. 102, 039902 (2009)
  • GGA_PBE: J. P. Perdew, K. Burke, and M. Ernzerhof, Phys. Rev. Lett. 77, 3865 (1996)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License