# Metals {#DFPTMetal}

Performing DFPT calculations for systems with zero electronic band-gap
is essentially the same as calculations which are covered is previous
sections, e.g. see `dmandbe`{.interpreted-text role="ref"}. However,
there are two fundamental differences between DFPT calculations with and
without electronic band-gap \[[G95](#G95){.citation},
[BGCG01](#BGCG01){.citation}\]:

-   Response to an electric field perturbation is not well-defined for
    zero band-gap systems
-   Fermi energy is zero band-gap systems may vary in presence of
    perturbations which in turn may modify occupations of electronic
    states

In this section we highlight the important aspects of DFPT calculations
for metals by looking at aluminum (Al) example.

We begin by simulating Al ground state using a self-consistent
calculation:

``` matlab
info.calculationType = 'self-consistent'
info.savepath = './results/al_real_scf'
element(1).species = 'Al'
element(1).path = './Al_AtomicData.mat' 
atom.element = [1]
atom.xyz = [0 0 0]
domain.latvec = 7.665*[0.5,0.5,0.0;0.0,0.5,0.5;0.5,0.0,0.5]
domain.lowres = 0.2
functional.libxc = true
functional.list = {'XC_LDA_X','XC_LDA_C_PW'}
kpoint.gridn = [5 5 5] 
kpoint.sampling = 'gauss'   % required for dfpt for metals
kpoint.sigma = 0.025        % required for dfpt for metals
mixing.tol = 1e-8*[1 1]     % advised for dfpt
option.saveWavefunction = 1 % required for dfpt
diffop.method = 'fft'       % required for dfpt
domain.fourierInit = false  % required for dfpt
```

Unlike calculations in `dmandbe`{.interpreted-text role="ref"},
`kpoint.sigma` has a non-zero value which is used to distinguish a
metallic calculation from a non-metallic one in DFPT.

:::: important
::: title
Important
:::

Non-zero value of `kpoint.sigma` triggers a subsequent metallic DFPT
calculation. Also `kpoin.sampling` determines the type of smearing that
is used in simulations, and current implementation of DFPT supports
`gauss` and `fermi-dirac` smearings.
::::

RESCU is executed as follows

``` shell
rescu -i al_real_scf
```

Next, we perform a DFPT phonon calculation to compute the dynamical
matrix:

``` matlab
info.calculationType = 'dfpt-phonon'
info.savepath = './results/al_real_phonon'
rho.in = './results/al_real_scf.mat'
psi.in = './results/al_real_scf.h5'
mixing.tol = 1e-5*[1 1]     % advised for dfpt
option.saveWavefunction = 0 
symmetry.spacesymmetry = 1 
symmetry.pointsymmetry = 1 
symmetry.timereversal = 1 
```

Here, there is no need to save the perturbed wavefunctions so
`option.saveWavefunction = 0`.

``` shell
rescu -i al_real_phonon
```

After obtaining the dynamical matrix by a self-consistent phonon
calculation, we can proceed to compute full phonons band-structure and
density of states. The band-structure calculation can be performed using
the following input file:

``` matlab
info.calculationType = 'dfpt-phonon-bs'
info.savepath = './results/al_real_phonon_bs'
dfpt.phononData = './results/al_real_phonon.mat'
dfpt.qpointGridn = 96
dfpt.asr = [1,1,1]
```

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

Metals do not have a well-defined dielectric constant and there is no
LO-TO splitting present in their phonons band-structure.
::::

RESCU is executed as:

``` shell
rescu -i al_real_phonon_bs
```

The band-structure can be visualized, as in
`fig:EphvsK_al`{.interpreted-text role="numref"}, using plotting option
of RESCU:

``` shell
rescu -p ./results/al_real_phonon_bs.mat
```

<figure>
<img src="figs/al_phonon_bs.png" id="fig:EphvsK_al"
alt="figs/al_phonon_bs.png" />
<figcaption>Phonons band-structure of aluminum</figcaption>
</figure>

The following input file can be used to compute phonons density of
states:

``` matlab
info.calculationType = 'dfpt-phonon-dos'
info.savepath = './results/al_real_phonon_dos'
dfpt.phononData = './results/al_real_phonon.mat'
dfpt.qpointGridn = [10 10 10]
dfpt.asr = [1,1,1]
```

RESCU is executed as follows

``` shell
rescu -i al_real_phonon_dos
```

and Al phonons DOS, `fig:phdos_al`{.interpreted-text role="numref"}, is
plotted using:

``` shell
rescu -p ./results/al_real_phonon_dos.mat
```

<figure>
<img src="figs/al_phonon_dos.png" id="fig:phdos_al"
alt="figs/al_phonon_dos.png" />
<figcaption>Phonons DOS of aluminum</figcaption>
</figure>

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

[G95]{#G95 .citation-label}

:   Stefano de Gironcoli.
    `Lattice dynamics of metals from density-functional perturbation theory. <10.1103/PhysRevB.51.6773>`{.interpreted-text
    role="doi"} Physical Review B 51.10 (1995), p. 6773.
:::
