Skip to content

Replace J3 Finite Difference Ion Derivatives with Analytic - #5380

Merged
ye-luo merged 10 commits into
QMCPACK:developfrom
rcclay:j3_ion_deriv
Mar 16, 2025
Merged

Replace J3 Finite Difference Ion Derivatives with Analytic #5380
ye-luo merged 10 commits into
QMCPACK:developfrom
rcclay:j3_ion_deriv

Conversation

@rcclay

@rcclay rcclay commented Mar 14, 2025

Copy link
Copy Markdown
Contributor

Please review the developer documentation
on the wiki of this project that contains help and requirements.

Proposed changes

For ion gradient, ion gradient of electron gradients, and ion gradients of the Laplacians, all these were originally calculated using finite differences on the ion particle set. This is slow and adds complexity to porting force code to batch. This PR bites the bullet and replaces these with proper analytic gradients.

What type(s) of changes does this code introduce?

Delete the items that do not apply

  • New feature
  • Testing changes (e.g. new unit/integration/performance tests)

Does this introduce a breaking change?

  • No

What systems has this change been tested on?

Intel with g++

Checklist

Update the following with a yes where the items apply. If you're unsure about any of them, don't hesitate to ask. This is
simply a reminder of what we are going to look for before merging your code.

  • Yes. This PR is up to date with current the current state of 'develop'
  • Yes. Code added or changed in the PR has been clang-formatted
  • Yes. This PR adds tests to cover any new code, or to catch a bug that is being fixed
  • No. Documentation has been added (if appropriate)

@prckent

prckent commented Mar 14, 2025

Copy link
Copy Markdown
Contributor

Test this please

@prckent prckent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great to see this improvement. Q. Where did the reference values used in the test come from?

@rcclay

rcclay commented Mar 14, 2025

Copy link
Copy Markdown
Contributor Author

Great to see this improvement. Q. Where did the reference values used in the test come from?

It always amazes me how slow finite differences are. Reference values are from finite difference of J3 values, gradients, and laplacians.

@ye-luo ye-luo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we don't have any other finite difference code left
virtual function needs to be adjusted with const

const ParticleSet& P,
const ParticleSet& source,

In a separate PR.

Comment thread src/QMCWaveFunctions/Jastrow/JeeIOrbitalSoA.h Outdated
Comment thread src/QMCWaveFunctions/Jastrow/JeeIOrbitalSoA.h Outdated
Comment thread src/QMCWaveFunctions/Jastrow/JeeIOrbitalSoA.h Outdated
Comment thread src/QMCWaveFunctions/Jastrow/JeeIOrbitalSoA.h Outdated
Comment thread src/QMCWaveFunctions/Jastrow/JeeIOrbitalSoA.h Outdated
@ye-luo

ye-luo commented Mar 15, 2025

Copy link
Copy Markdown
Contributor

Test this please

@ye-luo
ye-luo enabled auto-merge March 15, 2025 23:38
@ye-luo
ye-luo merged commit eb1203e into QMCPACK:develop Mar 16, 2025
@rcclay
rcclay deleted the j3_ion_deriv branch March 18, 2025 15:47
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