Skip to content
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

Merged
merged 13 commits into from
Jun 9, 2020
Merged

More flexible mixing interface #225

merged 13 commits into from
Jun 9, 2020

Conversation

mfherbst
Copy link
Member

Brought forward from mixing. Needs to be polished.

@antoine-levitt
Copy link
Member

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

@mfherbst
Copy link
Member Author

Sounds reasonable. Thanks for the suggestion!

src/scf/mixing.jl Outdated Show resolved Hide resolved
@mfherbst mfherbst marked this pull request as ready for review June 9, 2020 09:00
@mfherbst mfherbst changed the title A few small changes More flexible mixing interface Jun 9, 2020
src/scf/mixing.jl Outdated Show resolved Hide resolved
src/scf/mixing.jl Outdated Show resolved Hide resolved
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)
Copy link
Member

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...

Copy link
Member Author

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.

src/scf/mixing.jl Outdated Show resolved Hide resolved
examples/custom_solvers.jl Show resolved Hide resolved
examples/custom_solvers.jl Outdated Show resolved Hide resolved
examples/custom_solvers.jl Show resolved Hide resolved
@mfherbst mfherbst merged commit 4250c15 into master Jun 9, 2020
@mfherbst mfherbst deleted the small_changes branch June 9, 2020 18:18
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