# Libxc

Libxc is a library of exchange-correlation and kinetic energy functionals for density-functional theory. The original aim was to provide a portable, well tested and reliable set of these functionals to be used by all the codes of the European Theoretical Spectroscopy Facility (ETSF), but the library has since grown to be used in several other types of codes as well; see below for a partial list.

Libxc is written in C, but it also comes with Fortran and Python bindings. It is released under the MPL license (v. 2.0). Contributions are welcome. Bug reports and patches should be submitted over gitlab.

## Citing Libxc

Following good scientific practice, any publication using functionals from Libxc should cite Libxc. To cite Libxc, the current reference is

Any program interfacing Libxc should analogously

- print out a message when Libxc is used in a calculation
- print out the used version of Libxc, provided by e.g. the
`xc_version_string()`

function, and - print out the literature reference of Libxc, which is provided by the
`xc_reference()`

function, in addition to the literature references of the used density functionals which are also provided by Libxc

Documenting the use of Libxc for the density functional is important, since many functionals have dissimilar implementations in various programs; see

# Capabilities

In Libxc you can find various types of functionals: LDA, GGA, and meta-GGA (mGGA) functionals. LDAs, GGAs, and meta-GGAs depend on local information, in the sense that the value of the density functional part of the energy density at a given point depends only on the values of the density, the gradient of the density, and the kinetic energy density and/or the density laplacian, respectively, at the given point:

$$ E^\mathrm{LDA}_\mathrm{xc} = E^\mathrm{LDA}_\mathrm{xc}[n(\vec{r})], $$

$$ E^\mathrm{GGA}_\mathrm{xc} = E^\mathrm{GGA}_{xc}[n(\vec{r}), \vec{\nabla}n(\vec{r})], $$

$$ E^\mathrm{mGGA}_\mathrm{xc} = E^\mathrm{mGGA}_\mathrm{xc}[n(\vec{r}), \vec{\nabla}n(\vec{r}), \nabla^2 n(\vec{r}), \tau(\vec{r})]. $$

Libxc is designed to evaluate this energy density and its derivatives in a correct fashion. Because several functionals are complicated in form, Libxc is based on the use of computer algebra and automatic code generation to enable the generation of bug-free code. Libxc can calculate both the functional itself, as well as its first through fourth derivatives, satisfying even the stringest requirements for applications.

Global hybrid (GH) and range-separated hybrid (RSH) functionals are also supported by Libxc: $$ E^\mathrm{GH}_\mathrm{xc} = c_x E^\mathrm{EXX} + E^\mathrm{DFT}_\mathrm{xc}[n(\vec{r}), \dots], $$

$$ E^\mathrm{RSH}_\mathrm{xc} = c_\mathrm{sr} E^\mathrm{EXX}_\mathrm{sr} + c_\mathrm{lr} E^\mathrm{EXX}_\mathrm{lr} + E^\mathrm{DFT}_\mathrm{xc}[n(\vec{r}), \dots]. $$

For these functionals, Libxc only handles the local part (as above); the evaluation of the exact exchange components must be done in the calling program. Libxc, however, does contain all the information necessary to perform the calculations (fraction of exact exchange, range separation parameter(s)).

The same can be said about dispersion corrections: several functionals are available in Libxc that were parametrized with either semiclassical dispersion corrections à la Grimme, or various van der Waals functionals; neither of these can be evaluated with the local density information provided to Libxc, and must be handled by the calling program. The necessary parameters for VV10-type correlation kernels are, however, provided by Libxc as part of the functional definition.

# Support in codes

At the moment, we are aware of Libxc being used in the following codes (in alphabetical order):

- Abinit - a software suite to calculate the optical, mechanical, vibrational, and other observable properties of materials
- ACE-Molecule - a quantum chemistry package based on a real-space numerical grid
- ADF - a density functional theory program for molecules and condensed matter
- APE - a computer package designed to generate and test norm-conserving pseudopotentials within density functional theory
- AtomPAW - a program for generating projector augmented wave functions
- BAGEL - a parallel electronic-structure program
- BigDFT - a fast, precise, and flexible density functional theory code for ab-initio atomistic simulation
- CASTEP - a code for calculating the properties of materials from first principles
- Chronus Quantum - a computational chemistry software package focused on explicitly time-dependent and post-SCF methods
- CPMD - a parallelized plane wave / pseudopotential implementation of density functional theory which is particularly designed for ab-initio molecular dynamics
- CP2K - a program to perform atomistic and molecular simulations of solid state, liquid, molecular, and biological systems
- deMon2k - a software package for DFT calculations within the auxiliary density functional theory formalism
- DFT-FE - a massively parallel real-space code for first principles based materials modelling using Kohn-Sham density functional theory
- DP - a linear response time-dependent density functional theory code with a plane wave basis set
- Elk - an all-electron full-potential linearised augmented-plane wave code
- entos - a software package for Gaussian-basis ab initio molecular dynamics calculations on molecular and condensed-phase chemical reactions and other processes
- ERKALE - a DFT/HF molecular electronic structure code based on Gaussian-type orbitals
- exciting - a full-potential all-electron density-functional-theory package implementing the families of linearized augmented planewave methods
- FHI-AIMS - an efficient, accurate, all-electron, full-potential electronic structure code package for computational molecular and materials science
- GAMESS (US) - a general ab initio quantum chemistry package
- GPAW - a density-functional theory Python code based on the projector-augmented wave method
- HelFEM - Finite element methods for electronic structure calculations on small systems
- Horton - Python development platform for electronic structure methods
- INQ - a modern GPU-accelerated computational framework for (time-dependent) density functional theory
- JDFTx - plane-wave code designed for joint density functional theory
- MADNESS - a multiwave adaptive numerical grid program for electroni
- MOLGW - many-body perturbation theory for atoms, molecules, and clusters
- Molpro - a comprehensive system of ab initio programs for advanced molecular electronic structure calculations
- MRCC - a suite of ab initio and density functional quantum chemistry programs for high-accuracy electronic structure calculations
- NWChem - an open source, high-performance computational chemistry program
- Octopus - a program aimed at the ab initio virtual experimentation on a hopefully ever-increasing range of system types
- OpenMolcas - a quantum chemistry software package specializing in multiconfigurational approaches
- ORCA - ab initio quantum chemistry program that contains modern electronic structure methods
- PROFESS - orbital-free density functional theory implementation to simulate condensed matter and molecules
- Psi4 - an open-source suite of ab initio quantum chemistry programs designed for efficient, high-accuracy simulations of molecular properties
- PySCF - Python-based Simulations of Chemistry Framework
- QuantumATK - code including pseudopotential-based density functional theory methods with LCAO and plane-wave basis sets in one framework
- Quantum Espresso - an integrated suite of open source computer codes for electronic-structure calculations and materials modeling at the nanoscale
- Serenity - an open-source quantum chemistry code in C++ especially designed for calculations on systems composed of several subsystems
- Turbomole - a program package for electronic structure calculations
- Vasp - the Vienna Ab initio Simulation Package: atomic scale materials modelling from first principles
- VeloxChem - a Python-based open source quantum chemistry package developed for the calculation of molecular properties and for the simulation of various spectroscopies
- WIEN2k - program for electronic structure calculations of solids using density functional theory based on the full-potential (linearized) augmented plane-wave + local orbitals method
- Yambo - a program that implements many-body perturbation theory methods such as GW and BSE and time-dependent density functional theory