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

Speed up AtomicLocal forces #1024

Merged
merged 2 commits into from
Nov 22, 2024
Merged

Speed up AtomicLocal forces #1024

merged 2 commits into from
Nov 22, 2024

Conversation

abussy
Copy link
Contributor

@abussy abussy commented Nov 22, 2024

This PR greatly increases the efficiency of forces calculations when using UPF pseudos.

Up to now, that vast majority of the time was spent calculating the form factors. It turn out that this issue was already solved when calculating the AtomicLocal potential, by pre-computing the form factors for each unique |G+q|. The same approach is now applied to the forces.

While the form factors are not cached, as suggested in #1009, this is already a huge step forward. Cost of calculating the forces goes from ~30-40% of the total, to <5% (on a handful of small tests).

@mfherbst mfherbst enabled auto-merge (squash) November 22, 2024 16:00
@mfherbst mfherbst merged commit 4040702 into JuliaMolSim:master Nov 22, 2024
8 checks passed
@antoine-levitt
Copy link
Member

Nice!

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.

3 participants