The dynamical matrix is supposed to be a mixed derivative wrt one monochromatic displacement at $+q$ and one monochromatic displacement at $-q$. From the code it seems to me that we compute the $\delta \rho$ at momentum $+q$. So for example I would expect something like $\delta V_{-q} \delta \rho_{+q}$ for the local term, but instead I see that the potential change is also computed at +q?
|
# dynmat_δH, which is ∫δρδV. |
|
dynmat_δH = zeros(S, 3, n_atoms, 3, n_atoms) |
|
for s = 1:n_atoms, α = 1:n_dim |
|
dynmat_δH[:, :, α, s] .-= stack(forces_local(S, basis, δρs[α, s], q)) |
|
end |
Maybe we are lucky by chance and we are actually computing $D(-q)$ consistently by accident (I think this could be the case but I am not 100% sure).
The dynamical matrix is supposed to be a mixed derivative wrt one monochromatic displacement at$+q$ and one monochromatic displacement at $-q$ . From the code it seems to me that we compute the $\delta \rho$ at momentum $+q$ . So for example I would expect something like $\delta V_{-q} \delta \rho_{+q}$ for the local term, but instead I see that the potential change is also computed at +q?
DFTK.jl/src/terms/local.jl
Lines 193 to 197 in b6b1f7d
Maybe we are lucky by chance and we are actually computing$D(-q)$ consistently by accident (I think this could be the case but I am not 100% sure).