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.916427166748 -0.69 5.1 118ms
2 -7.921200157247 -2.32 -1.52 1.0 57.2ms
3 -7.921406354027 -3.69 -2.50 1.5 63.7ms
4 -7.921441112758 -4.46 -2.84 2.5 81.7ms
5 -7.921441673240 -6.25 -3.01 1.2 59.9ms
6 -7.921442009572 -6.47 -4.54 1.0 69.1ms
7 -7.921442021826 -7.91 -4.62 3.0 90.5ms
8 -7.921442022128 -9.52 -5.25 1.0 59.0ms
9 -7.921442022143 -10.84 -5.70 1.4 63.3ms
10 -7.921442022144 -11.96 -6.41 1.5 64.1ms
11 -7.921442022144 -12.72 -7.10 1.9 72.0ms
12 -7.921442022144 -14.15 -7.44 1.8 69.3ms
13 -7.921442022144 + -Inf -7.78 1.2 74.5ms
14 -7.921442022144 -15.05 -8.00 1.2 62.7ms
15 -7.921442022144 + -15.05 -8.62 1.0 60.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
---- ------- ------ ---------- ------- ------ ---------------
72.9 2.04s Non-interacting
1 0 1 0.31 52.4 3.84s
2 0 2 -0.52 47.1 1.37s
3 0 3 -2.40 41.6 1.24s
4 0 4 -4.46 29.6 2.66s
5 0 5 -6.46 17.3 887ms
6 0 6 -8.91 4.0 441ms
7 1 1 -7.80 55.7 1.88s Restart
8 1 2 -8.83 5.6 481ms
72.8 1.78s Final orbitals
Iter Restart Krydim log10(res) avg(CG) Δtime Comment
---- ------- ------ ---------- ------- ------ ---------------
72.9 1.61s Non-interacting
1 0 1 0.31 52.4 1.60s
2 0 2 -0.52 47.1 1.38s
3 0 3 -2.40 41.6 1.24s
4 0 4 -4.46 29.6 996ms
5 0 5 -6.46 17.3 728ms
6 0 6 -8.91 4.0 426ms
7 1 1 -7.80 55.7 1.92s Restart
8 1 2 -8.83 5.6 470ms
72.7 1.79s Final orbitals
Iter Restart Krydim log10(res) avg(CG) Δtime Comment
---- ------- ------ ---------- ------- ------ ---------------
72.9 1.64s Non-interacting
1 0 1 0.31 52.4 1.59s
2 0 2 -0.52 47.1 1.38s
3 0 3 -2.40 41.6 1.28s
4 0 4 -4.46 29.6 989ms
5 0 5 -6.46 17.3 721ms
6 0 6 -8.91 4.0 441ms
7 1 1 -7.80 55.7 1.91s Restart
8 1 2 -8.83 5.6 465ms
72.8 1.81s Final orbitals
Iter Restart Krydim log10(res) avg(CG) Δtime Comment
---- ------- ------ ---------- ------- ------ ---------------
72.9 1.66s Non-interacting
1 0 1 0.31 52.4 1.59s
2 0 2 -0.52 47.1 1.36s
3 0 3 -2.40 41.7 1.26s
4 0 4 -4.46 29.6 1.01s
5 0 5 -6.46 17.4 730ms
6 0 6 -8.91 4.0 438ms
7 1 1 -7.81 55.7 1.90s Restart
8 1 2 -8.84 5.5 463ms
72.7 1.80s Final orbitals
Iter Restart Krydim log10(res) avg(CG) Δtime Comment
---- ------- ------ ---------- ------- ------ ---------------
72.9 1.66s Non-interacting
1 0 1 0.31 52.4 1.60s
2 0 2 -0.52 47.1 1.37s
3 0 3 -2.40 41.7 2.69s
4 0 4 -4.46 29.6 972ms
5 0 5 -6.46 17.4 675ms
6 0 6 -8.91 4.0 434ms
7 1 1 -7.81 55.7 1.89s Restart
8 1 2 -8.84 5.5 458ms
72.7 1.76s Final orbitals
Iter Restart Krydim log10(res) avg(CG) Δtime Comment
---- ------- ------ ---------- ------- ------ ---------------
72.9 1.59s Non-interacting
1 0 1 0.31 52.4 1.56s
2 0 2 -0.52 47.1 1.36s
3 0 3 -2.40 41.7 1.24s
4 0 4 -4.46 29.6 998ms
5 0 5 -6.46 17.4 721ms
6 0 6 -8.91 4.0 426ms
7 1 1 -7.81 55.7 1.92s Restart
8 1 2 -8.84 5.5 462ms
72.7 1.78s Final orbitals
90.298858 seconds (101.48 M allocations: 80.385 GiB, 8.71% gc time, 8.45% compilation time: 100% of which was recompilation)These are the final phonon frequencies:
phret_q0.frequencies6-element Vector{Float64}:
-0.003498155355249743
-0.0029774511554350328
-0.0029774511552142662
0.00430223063028264
0.004302230630474988
0.004353201761277312