Skip to content

Add NLCC support for phonon computations#1311

Open
Technici4n wants to merge 6 commits intomasterfrom
phonon-nlcc
Open

Add NLCC support for phonon computations#1311
Technici4n wants to merge 6 commits intomasterfrom
phonon-nlcc

Conversation

@Technici4n
Copy link
Copy Markdown
Collaborator

Cleaner than I expected. Nice framework that you built @epolack and @antoine-levitt, especially the automated testing!

@Technici4n
Copy link
Copy Markdown
Collaborator Author

I had to remove @inferred from a test unfortunately, but I just ran the full GPU (CUDA) test suite and it still works, so that shouldn't be a problem.

Copy link
Copy Markdown
Member

@antoine-levitt antoine-levitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't checked everything but looks reasonable!

Comment thread examples/phonons.jl Outdated
Comment thread src/postprocess/phonon.jl
in reduced coordinates:
```
dynmat[β, t, α, s] = ∂²E/∂u_sα(-q)∂u_tβ(q).
```
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really not a fan of this interpretation, defining it as the derivative of the R -> F map seems much simpler to me...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's basically what it is since dE/du is the force. But with an extra q dependency here. The main reason I put the formula there is to know in which order to write the dynmat entries, otherwise you can get the transpose by mistake.

Comment thread src/postprocess/phonon.jl
for s = 1:n_atoms, α = 1:basis.model.n_dim
# Get δH ψ
δHψs_αs = compute_δHψ_αs(basis, ψ, α, s, q)
δHψs_αs = compute_δHψ_αs(basis, ψ, α, s, q; ρ)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really need this state refactor business...

Comment thread src/terms/xc.jl
# however since the potential is real, we conjugate to obtain the -q term:
# δV = Kxc (∂ρ/∂u_sα(-q) + ∂ρcore/∂u_sα(-q))
# = conj( Kxc (∂ρ/∂u_sα( q) + ∂ρcore/∂u_sα( q)) )
δV_αs = conj.(apply_kernel(term, basis, δρs[α, s] + δρcores[α, s]; ρ, q))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't followed the complete derivation but I'm scared by this line; the whole point of the explanation I gave in #1310 is that we never conjugate q stuff. Are you sure about this conj?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes 100% sure. It's also there in the local term, just hidden by Parseval's theorem. For a real function (the density is real) the conjugate should always be fine. You only get problems if you directly conjugate the psis since those are complex. I am not sure how DFPT works for spin orbit coupling or magnetic fields. Surely Dal Corso has some paper about it, but I haven't read it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants