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.916415432387                   -0.69    4.8    101ms
  2   -7.921202037726       -2.32       -1.52    1.0   49.0ms
  3   -7.921407051124       -3.69       -2.49    1.5   55.1ms
  4   -7.921441000205       -4.47       -2.84    2.4   68.1ms
  5   -7.921441680153       -6.17       -3.04    1.0   58.9ms
  6   -7.921442009345       -6.48       -4.55    1.0   50.7ms
  7   -7.921442021881       -7.90       -4.65    3.0   80.9ms
  8   -7.921442022131       -9.60       -5.29    1.0   51.2ms
  9   -7.921442022143      -10.91       -6.08    1.5   56.4ms
 10   -7.921442022144      -11.95       -6.06    2.2   72.8ms
 11   -7.921442022144      -12.82       -6.81    1.0   52.3ms
 12   -7.921442022144      -14.27       -7.30    1.4   55.6ms
 13   -7.921442022144   +    -Inf       -7.68    1.5   64.1ms
 14   -7.921442022144      -14.45       -8.33    1.1   54.5ms

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]);
109.641352 seconds (109.19 M allocations: 102.421 GiB, 6.84% 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.0034981553596799054
 -0.002977451163298685
 -0.0029774511629386494
  0.004302230635037461
  0.004302230635469627
  0.0043532017652727