Phonon computations

This is a quick sketch how to run a simple phonon calculation using DFTK. First we run an SCF calculation.

using AtomsBuilder
using DFTK
using PseudoPotentialData

pseudopotentials = PseudoFamily("cp2k.nc.sr.lda.v0_1.semicore.gth")
model  = model_DFT(bulk(:Si); pseudopotentials, functionals=LDA())
basis  = PlaneWaveBasis(model; Ecut=10, kgrid=[4, 4, 4])
scfres = self_consistent_field(basis, tol=1e-8);
n     Energy            log10(ΔE)   log10(Δρ)   Diag   Δtime
---   ---------------   ---------   ---------   ----   ------
  1   -7.916463904290                   -0.69    4.8    104ms
  2   -7.921212947958       -2.32       -1.52    1.0   51.0ms
  3   -7.921407256314       -3.71       -2.49    1.4   56.3ms
  4   -7.921440978474       -4.47       -2.83    2.5   73.1ms
  5   -7.921441668515       -6.16       -3.03    1.2   55.8ms
  6   -7.921442009005       -6.47       -4.57    1.0   63.0ms
  7   -7.921442021783       -7.89       -4.59    2.9   84.0ms
  8   -7.921442022127       -9.46       -5.34    1.0   53.1ms
  9   -7.921442022143      -10.81       -5.86    1.9   63.1ms
 10   -7.921442022144      -11.96       -6.08    1.2   57.0ms
 11   -7.921442022144      -12.70       -6.79    1.0   59.6ms
 12   -7.921442022144      -13.69       -7.42    2.0   66.2ms
 13   -7.921442022144   +  -15.05       -8.00    1.6   64.2ms

Next we compute the phonon modes at the q-point [1/4, 1/4, 1/4].

scfres = DFTK.unfold_bz(scfres)
phret_q0 = @time DFTK.phonon_modes(scfres; q=[0.25, 0.25, 0.25]);
112.160271 seconds (107.33 M allocations: 102.046 GiB, 6.97% gc time, 0.29% compilation time: 100% of which was recompilation)

These are the final phonon frequencies:

phret_q0.frequencies
6-element Vector{Float64}:
 -0.0034981553336162737
 -0.0029774511377431844
 -0.0029774511370990004
  0.004302230668712064
  0.004302230669100563
  0.004353201796830219