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.916479900165                   -0.69    4.5   98.2ms
  2   -7.921213614119       -2.32       -1.52    1.0   49.3ms
  3   -7.921405694429       -3.72       -2.49    1.4   60.8ms
  4   -7.921440959299       -4.45       -2.82    2.8   71.1ms
  5   -7.921441625176       -6.18       -3.00    1.0   49.3ms
  6   -7.921442008963       -6.42       -4.57    1.0   49.6ms
  7   -7.921442021836       -7.89       -4.61    3.0   78.1ms
  8   -7.921442022133       -9.53       -5.38    1.0   56.3ms
  9   -7.921442022139      -11.24       -5.35    2.1   62.2ms
 10   -7.921442022144      -11.29       -6.06    1.0   50.7ms
 11   -7.921442022144      -12.60       -6.69    1.1   52.5ms
 12   -7.921442022144      -13.57       -6.97    1.6   64.1ms
 13   -7.921442022144      -14.75       -8.69    1.4   56.1ms

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]);
110.201500 seconds (107.55 M allocations: 102.431 GiB, 7.09% 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.003498155360781905
 -0.002977451162412103
 -0.0029774511594258726
  0.00430223062451875
  0.004302230626039989
  0.004353201756944874