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);
nothing # hide
n Energy log10(ΔE) log10(Δρ) Diag Δtime --- --------------- --------- --------- ---- ------ 1 -7.916435700389 -0.69 4.8 508ms 2 -7.921206001831 -2.32 -1.52 1.0 50.3ms 3 -7.921405819539 -3.70 -2.49 1.4 55.1ms 4 -7.921440921267 -4.45 -2.83 2.5 71.5ms 5 -7.921441656914 -6.13 -3.03 1.1 53.1ms 6 -7.921442008158 -6.45 -4.53 1.0 57.1ms 7 -7.921442021682 -7.87 -4.54 2.9 85.9ms 8 -7.921442022123 -9.36 -5.25 1.0 58.8ms 9 -7.921442022143 -10.69 -6.03 1.6 62.0ms 10 -7.921442022144 -12.16 -6.07 2.1 88.5ms 11 -7.921442022144 -12.71 -6.60 1.0 51.4ms 12 -7.921442022144 -13.97 -7.03 1.2 53.6ms 13 -7.921442022144 -14.75 -7.70 1.1 52.8ms 14 -7.921442022144 + -14.57 -8.12 1.8 108ms
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]);
nothing # hide
152.797460 seconds (159.01 M allocations: 104.604 GiB, 7.43% gc time, 25.39% compilation time)
These are the final phonon frequencies:
phret_q0.frequencies
6-element Vector{Float64}: -0.0034981553613516723 -0.0029774511663139334 -0.0029774511660595397 0.004302230638734129 0.004302230638938137 0.00435320176869754