Phonon computations
This is a quick sketch how to run a simple phonon calculation using DFTK.
Practical phonon computations have only seen rudimentary testing as of now. As of now we do not yet recommend relying on this feature for production calculations. We appreciate any issues, bug reports or PRs.
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.916447551106 -0.69 4.8 115ms
2 -7.921211080850 -2.32 -1.52 1.0 59.0ms
3 -7.921406046421 -3.71 -2.49 1.4 62.7ms
4 -7.921440897745 -4.46 -2.83 2.5 81.0ms
5 -7.921441621771 -6.14 -3.01 1.1 73.1ms
6 -7.921442002836 -6.42 -4.39 1.0 59.1ms
7 -7.921442021628 -7.73 -4.52 2.8 88.5ms
8 -7.921442022117 -9.31 -5.18 1.0 61.5ms
9 -7.921442022121 -11.41 -4.89 1.8 69.1ms
10 -7.921442022143 -10.65 -5.81 1.0 60.5ms
11 -7.921442022144 -12.06 -6.84 1.4 64.5ms
12 -7.921442022144 -13.10 -6.57 2.9 98.3ms
13 -7.921442022144 -14.15 -7.56 1.0 59.9ms
14 -7.921442022144 + -Inf -7.94 1.4 65.9ms
15 -7.921442022144 -15.05 -8.56 1.2 63.3msNext 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]);Iter Restart Krydim log10(res) avg(CG) Δtime Comment
---- ------- ------ ---------- ------- ------ ---------------
73.0 3.20s Non-interacting
1 0 1 0.31 52.3 3.63s
2 0 2 -0.52 46.9 1.32s
3 0 3 -2.40 41.6 1.21s
4 0 4 -4.46 29.6 968ms
5 0 5 -6.46 17.4 708ms
6 0 6 -8.91 4.0 423ms
7 1 1 -7.86 55.2 1.90s Restart
8 1 2 -8.94 5.5 470ms
72.8 1.76s Final orbitals
Iter Restart Krydim log10(res) avg(CG) Δtime Comment
---- ------- ------ ---------- ------- ------ ---------------
72.9 1.60s Non-interacting
1 0 1 0.31 52.3 1.57s
2 0 2 -0.52 46.9 1.34s
3 0 3 -2.40 41.6 1.21s
4 0 4 -4.46 29.6 973ms
5 0 5 -6.46 17.4 720ms
6 0 6 -8.91 4.0 429ms
7 1 1 -7.86 55.2 1.85s Restart
8 1 2 -8.94 5.5 465ms
72.7 1.75s Final orbitals
Iter Restart Krydim log10(res) avg(CG) Δtime Comment
---- ------- ------ ---------- ------- ------ ---------------
72.9 1.60s Non-interacting
1 0 1 0.31 52.3 1.57s
2 0 2 -0.52 46.9 1.34s
3 0 3 -2.40 41.6 1.22s
4 0 4 -4.46 29.6 963ms
5 0 5 -6.46 17.4 729ms
6 0 6 -8.91 4.0 435ms
7 1 1 -7.86 55.2 1.86s Restart
8 1 2 -8.94 5.5 450ms
72.7 1.75s Final orbitals
Iter Restart Krydim log10(res) avg(CG) Δtime Comment
---- ------- ------ ---------- ------- ------ ---------------
73.0 1.60s Non-interacting
1 0 1 0.31 52.3 1.52s
2 0 2 -0.52 46.9 1.32s
3 0 3 -2.40 41.6 1.22s
4 0 4 -4.46 29.6 968ms
5 0 5 -6.46 17.4 702ms
6 0 6 -8.91 4.0 427ms
7 1 1 -7.85 55.4 3.31s Restart
8 1 2 -8.89 5.5 416ms
72.7 1.69s Final orbitals
Iter Restart Krydim log10(res) avg(CG) Δtime Comment
---- ------- ------ ---------- ------- ------ ---------------
72.9 1.58s Non-interacting
1 0 1 0.31 52.3 1.53s
2 0 2 -0.52 46.9 1.32s
3 0 3 -2.40 41.6 1.21s
4 0 4 -4.46 29.6 969ms
5 0 5 -6.46 17.4 711ms
6 0 6 -8.91 4.0 426ms
7 1 1 -7.85 55.4 1.85s Restart
8 1 2 -8.89 5.5 470ms
72.7 1.76s Final orbitals
Iter Restart Krydim log10(res) avg(CG) Δtime Comment
---- ------- ------ ---------- ------- ------ ---------------
72.9 1.60s Non-interacting
1 0 1 0.31 52.3 1.53s
2 0 2 -0.52 46.9 1.35s
3 0 3 -2.40 41.6 1.21s
4 0 4 -4.46 29.6 982ms
5 0 5 -6.46 17.4 703ms
6 0 6 -8.91 4.0 424ms
7 1 1 -7.85 55.4 1.86s Restart
8 1 2 -8.89 5.5 451ms
72.8 1.77s Final orbitals
86.673550 seconds (101.17 M allocations: 80.175 GiB, 8.22% gc time, 7.48% compilation time: 100% of which was recompilation)These are the final phonon frequencies:
phret_q0.frequencies6-element Vector{Float64}:
-0.0034981553564837043
-0.0029774511563585735
-0.0029774511561556955
0.004302230628190337
0.004302230628502932
0.004353201758421689