qmcpack icon indicating copy to clipboard operation
qmcpack copied to clipboard

mw_evalGradWithSpin for DiracDeterminantBatched

Open camelto2 opened this issue 3 years ago • 1 comments

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

Proposed changes

This PR incorporates #4234 to implement mw_evalGradWithSpin for DiracDeterminantBatched. In this implementation, we recompute the spin gradients from scratch similar to how it was done for the legacy implementation.

Ideally, we would be storing and using the accept/reject to avoid recomputing the spin gradients from the SPOSets each time we need it. I would eventually like to change to this approach, but for now this should be correct and not result in too large of a penalty. After discussing offline with @ye-luo, this was the preferred approach for now.

Also in #4234, @PDoakORNL mentioned he would help with the CUDA implementation after this is working and tested for the offload. So for now, I just added a runtime_error for the CUDA version.

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

Delete the items that do not apply

  • New feature

Does this introduce a breaking change?

  • No

What systems has this change been tested on?

mac

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)

camelto2 avatar Oct 06 '22 19:10 camelto2

I have a number of questions and see no testing.

The test was already in test_DiracDeterminantBatched for the spinor_update test. I had added the test and reference values in a previous PR, but commented them out so that when I added mw_evaluateGradWithSpin I could uncomment. So the MatrixUpdateOMPTarget is indirectly tested because it is called inside the DiracDeterminantBatched::mw_evaluateGradWithSpin

camelto2 avatar Oct 06 '22 23:10 camelto2

Test this please

ye-luo avatar Dec 15 '22 23:12 ye-luo

Test this please

ye-luo avatar Dec 19 '22 18:12 ye-luo