-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collinear spin GGA kernel #424
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM... indeed quite messy but at least relatively well localized. Biggest gripe is these libxc_spinindex functions.
σ_real[2, :, :, :] .+= ∇ρ_real[1, :, :, :, α] .* ∇ρ_real[2, :, :, :, α] | ||
σ_real[3, :, :, :] .+= ∇ρ_real[2, :, :, :, α] .* ∇ρ_real[2, :, :, :, α] | ||
σ_real[tσ(1, 2), :, :, :] .+= ∇ρ_real[1, :, :, :, α] .* ∇ρ_real[2, :, :, :, α] | ||
σ_real[tσ(2, 2), :, :, :] .+= ∇ρ_real[2, :, :, :, α] .* ∇ρ_real[2, :, :, :, α] | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All this is quite messy due to the multiple formats used. It's a bit better in the densities branch, so we should really try to merge the branches, but I understand if you don't want to do it yet. Once it's done, it would be good to document more clearly (maybe with variable names) what arrays are in "DFTK format" [i,j,k,sigma] and which are in "libxc" format [sigmatau,i,j,k]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe we should add one extra layer of indirection on top of the returned terms
object, which does the mapping and adds the strange (1/2) factor automatically, only returning a view into the 3D real-space grid. That could help to make the contractions more readable (because it's just elementwise multiplications and sums so no further indexing needed), but it hides which indices are contiguous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave that for next time when I'll merge the branches, but I think this might be the way to go.
No description provided.