-
Notifications
You must be signed in to change notification settings - Fork 90
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
More flexible mixing interface #225
Conversation
I don't think we should have that logic here. Instead this can be implemented as a custom mixing provided it has sufficient info (like the iteration number). This we can do eg with an info named tuple like we do for the stopping criterion |
Sounds reasonable. Thanks for the suggestion! |
src/scf/mixing.jl
Outdated
Gsq = [sum(abs2, basis.model.recip_lattice * G) | ||
for G in G_vectors(basis)] | ||
ρin = ρin.fourier | ||
ρout = ρout.fourier | ||
ρnext = @. ρin + m.α * (ρout - ρin) * Gsq / (m.G0^2 + Gsq) | ||
ρnext = @. ρin + T(params.α) * (ρout - ρin) * Gsq / (T(params.kF)^2 + Gsq) |
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.
something that's beginning to irritate me is that we manipulate densities in at least three different formats (fourier, real, and RFA). Maybe we should begin thinking of a convention on how to call them to make it clear? Maybe not...
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 agree with that, but for the moment I don't see a simple solution but to annotate the types. Like if it is an RFA, then we annotate, otherwise not. I'll leave it for now as is.
Brought forward from mixing. Needs to be polished.