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.916423066257                   -0.69    4.8    105ms
  2   -7.921198750575       -2.32       -1.52    1.0   50.8ms
  3   -7.921401738380       -3.69       -2.49    1.2   53.5ms
  4   -7.921440922803       -4.41       -2.82    2.8   82.2ms
  5   -7.921441576082       -6.18       -2.98    1.0   51.6ms
  6   -7.921442005345       -6.37       -4.51    1.0   51.0ms
  7   -7.921442021883       -7.78       -4.65    2.8   77.2ms
  8   -7.921442022131       -9.61       -5.30    1.1   53.1ms
  9   -7.921442022124   +  -11.11       -4.96    1.9   67.5ms
 10   -7.921442022143      -10.70       -5.91    1.0   52.4ms
 11   -7.921442022144      -12.22       -6.60    1.2   64.2ms
 12   -7.921442022144      -13.27       -6.60    2.2   85.4ms
 13   -7.921442022144      -13.94       -7.60    1.0   57.1ms
 14   -7.921442022144      -15.05       -8.17    1.5   59.8ms

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]);
113.138432 seconds (108.95 M allocations: 102.030 GiB, 6.80% gc time, 0.30% compilation time: 100% of which was recompilation)

These are the final phonon frequencies:

phret_q0.frequencies
6-element Vector{Float64}:
 -0.003498155349463381
 -0.002977451146713302
 -0.0029774511461650183
  0.004302230626118408
  0.004302230626449245
  0.004353201758628323