# Ion-clamped dielectric tensor {#IonCD}

In this section we consider response of materials to a static electric
field perturbations. Corresponding response function is the ion-clamped
dielectric constant $\epsilon^{\infty}_{\alpha\beta}$, which
characterizes electronic cloud reaction in $\beta$ direction due to an
applied electric field in $\alpha$ direction. The electric field is
assumed to have long-wavelength so that it cannot cause excitations
between electronic states, and simulations are performed at clamped
ions, hence the term ion-clamped.

:::: note
::: title
Note
:::

Response to a static electric field is not well-defined for metallic
systems.
::::

RESCU assumes electric fields along three Cartesian directions by
default, and calculates the full $3\times 3$ dielectric constant. At the
end of this DFPT calculation, one can also have access to perturbed
wavefunctions and self-consistent potential, which can be used in
various kinds of nonself-consistent calculations (e.g. see
`sec:dfptraman`{.interpreted-text role="ref"}). If desired, direction of
electric field perturbation can be set through `dfpt.eField` keyword,
explained in more details in the following.

Here, we use the ground state data of boron nitride obtained in
`dfptprep`{.interpreted-text role="ref"}. Below, a sample input file for
DFPT calculation is shown:

``` matlab
info.calculationType = 'dfpt-dielectric'
info.savepath = './results/bn_real_dielectric'
rho.in = './results/bn_real_scf.mat'
psi = './results/bn_real_scf.h5'
dfpt.eField = [1 0 0;0 1 0;0 0 1]   % optional
mixing.tol = 1e-5*[1 1]             % advised for dfpt
option.saveWavefunction = 1         % only required if perturbed wavefunctions are supposed 
                                    % to be used for subsequent nonself-consistent calculation 
```

The important keywords for this type of DFPT calculation are as follows:

-   `info.calculationType` this central keyword determines the type of
    the DFPT calculation to perform;
-   `info.savepath` points to the file which stores the output data DFPT
    calculation;
-   `rho.in` this DFPT calculation loads the ground state electronic
    density at the beginning of the computation, and this keyword points
    to the file which contains the output of the ground state
    calculation, so that RESCU can load corresponding electronic density
    data;
-   `psi` this DFPT calculation also loads the ground state
    wavefunctions at the beginning of the computation, and this keyword
    points to the file which contains the stored ground state
    wavefunctions;
-   `dfpt.eField` the electric field directions along which the
    ion-clamped dielectric tensor is calculated. Three linearly
    independent directions are required to obtain the dielectric tensor.
    This keyword is optional and the default are the three Cartesian
    directions;
-   `mixing.tol` first entry sets the convergence criterion for the
    perturbed self-consistent density and the second entry sets the
    criterion for the perturbed self-consistent potential.
-   `option.saveWavefunction` determines whether first-order perturbed
    wavefunctions should be saved to disk. This is only necessary if one
    wishes to perform a subsequent DFPT calculation based \"2n+1\"
    theorem to compute non-linear response functions.

:::: warning
::: title
Warning
:::

Storing the perturbed wavefunctions requires a large amount of disk
space, and one must make sure that they are only saved if are to be used
later
::::

Once the input file is created, RESCU can be invoked by

``` shell
rescu -i bn_real_dielectric
```

RESCU computes perturbed wavefunctions with respect to each electric
field direction, from which the polarization and dielectric tensor are
calculates according to [\[BGCG01\]](#BGCG01){.citation}:

[$$P_{\alpha} = -\frac{4e}{V}\sum_{n=1}^{N/2} \langle \bar{\psi_{n}^{\alpha}}| \Delta^{\mathbf{E}}\psi_{n}\rangle$$]{label="eq:dfptpolarization"}

[$$\epsilon_{\infty}^{\alpha\beta} =  \delta_{\alpha\beta} - \frac{16\pi e}{VE_{\beta}}\sum_{n=1}^{N/2} 
\langle \bar{\psi_{n}^{\alpha}}| \Delta^{E_{\beta}}\psi_{n}\rangle$$]{label="eq:dfptdietensor"}

Various output information can be found in `dfpt` field of structure
found in `./results/bn_real_dielectric.mat`.

``` matlab
>> load ./results/bn_real_dielectric.mat
>> dfpt

dfpt = 

struct with fields:

               desc: [1x1 struct]
   dielectricTensor: [3x3 double]
            eField: [3x3 double]
      polarization: [3x3 double]
      qpointDirect: [0 0 0]
         qpointGridn: [1 1 1]
               type: 'dielectric'
```

Polarization and ion-clamped dielectric tensor data can be found as a
$3\times 3$ matrix in `dfpt.polarization` and `dfpt.dielectricTensor`,
respectively. In our case, we have

``` matlab
>> dfpt.polarization

ans =

   0.4007   -0.0000   -0.0000
  -0.0000    0.4007   -0.0000
  -0.0000   -0.0000    0.4007   


>> dfpt.dielectricTensor

ans =

   6.0352   -0.0000   -0.0000
  -0.0000    6.0352   -0.0000
  -0.0000   -0.0000    6.0352
```

These quantities already provide valuable information regarding the
simulated material. However, together with perturbed wavefunctions, they
can also be used in post-analysis DFPT calculations to obtain further
insight about response functions of materials.

::: {#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.
:::
