# DFPT {#sec:DFPT}

Many materials properties can be formulated as response of their
perturbed ground-state to various perturbations. For example, optical
properties characterize interaction of materials with electromagnetic
field perturbations. These materials properties (response functions) can
be calculated (in most cases) as derivatives of total energy with
respect to perturbation factors. For example, in case of atomic
displacements perturbation, 1st, 2nd, and 3rd order derivatives
determine the atomic forces, harmonic, and anharmonic lattice dynamics,
respectively.

Traditionally, these derivatives can be calculated by means finite
difference (direct, also frozen phonon) method, i.e. total energy is
directly calculated for several values of perturbation parameter, and
derivatives are evaluated by differences in corresponding total energy
values. Although, finite difference method might be useful for certain
types of problems, it has major drawbacks in treating important
perturbations such as atomic displacements. For example it cannot handle
phonons with wavevectors incommensurate with systems unitcell, or
requires very large supercells to account for phonon with wavevectors
which span several unitcells, hence substantially increasing the
computation cost.

Density functional perturbation theory (DFPT) provides an efficient
framework to calculate various orders of total energy derivatives and
addresses the shortcomings of finite difference method
\[[BGCG01](#BGCG01){.citation}, [GC97](#GC97){.citation}\]. It also
opens the door to treating perturbations which might be very difficult
to fit into finite difference framework. In short, DFPT provides
necessary formalisms to obtain perturbed wavefunctions, self-consistent
potential and electronic density for a broad range of perturbations,
which are combined with ground-state quantities to calculate response
functions.

Current DFPT implementation in RESCU can calculate first order perturbed
quantities with respect to perturbation parameter by solving the
corresponding **Sternheimer** equations, and up to third order
derivatives of total energy by using **\"2n+1\"** theorem. It supports
real-space basis set with norm conserving pseudo potentials, and
following perturbations are covered:

-   Static electric field
-   Atomic displacements

The overall workflow of a DFPT calculation is consisted of the following
three main steps:

-   First, ground-state of the system is obtain by a self-consistent DFT
    calculation.
-   Second, for a given perturbation, DFPT equations are
    self-consistently solved to obtain perturbed wavefunctions,
    electronic density, and self-consistent potential.
-   Third, various response functions are calculated in a
    nonself-consistent manner using the results of previous two steps.

In the following sections, we demonstrate workflow of different DFPT
calculations in more details. Certain response functions, e.g.
dielectric response, are not well-defined in metallic system where there
is no electronic band-gap. Hence, details of DFPT calculations for
metals are covered in `DFPTMetal`{.interpreted-text role="ref"}.

::: {.toctree maxdepth="1"}
dfpt_prep.rst dfpt_diel.rst dfpt_dynm.rst dfpt_phbs.rst dfpt_phds.rst
dfpt_ir.rst dfpt_ram.rst dfpt_metals.rst dfpt_eph.rst
:::

::: {#citations}

[BGCG01]{#BGCG01 .citation-label}

:   Stefano Baroni, Stefano De Gironcoli, Andrea Dal Corso, and Paolo
    Giannozzi.
    `Phonons and related crystal properties from density-functional perturbation theory. <10.1103/RevModPhys.73.515>`{.interpreted-text
    role="doi"} Reviews of Modern Physics 73.2 (2001), p. 515

[GC97]{#GC97 .citation-label}

:   Xavier Gonze and Changyol Lee.
    `Dynamical matrices, Born effective charges, dielectric permittivity tensors, and interatomic force constants from density-functional perturbation theory. <10.1103/PhysRevB.55.10355>`{.interpreted-text
    role="doi"} Physical Review B 55 10355 (1997)
:::
