Allow exact spin integration for SOECP alongside wave function optimization#5173
Conversation
ye-luo
left a comment
There was a problem hiding this comment.
LGTM. Only need to improve the documentation of functions.
| std::vector<ValueType>& ratios, | ||
| Matrix<ValueType>& dratios); | ||
|
|
||
| // Used by SOECPComponent for faster SOC evaluation |
There was a problem hiding this comment.
Could you document this more like evaluateDerivRatios explaining what is evaluated?
| Vector<ValueType>& dhpsioverpsi) | ||
| { | ||
| #ifndef QMC_COMPLEX | ||
| throw std::runtime_error("SOECPComponent::evaluateValueAndDerivatives should not be called in real build\n"); |
There was a problem hiding this comment.
Need to deal with this in separate PRs. If SOECP only makes sense in complex builds, we should avoid compiling the class completely in real builds and thus we don't need this ifdef.
There was a problem hiding this comment.
anything related to spinors/spin-orbit uses complex wave functions and complex spin functions. So that would be a nice change
| Matrix<ValueType>& dratio); | ||
|
|
||
| /** Used by SOECPComponent to do faster SOC evaluation with derivatives of ratio | ||
| */ |
There was a problem hiding this comment.
Could you document this more like evaluateDerivRatios explaining what is evaluated?
|
Test this please |
|
Do we still have any feature relying on the non-exact code path? |
In terms of missing functionality, for legacy/single walker multidets right now it would need the slow code path until the evaluateSpinorRatios and evaluateSpinorDeriv is implemented for multidets. There is no mw_ support in multidets yet for any of the spinor stuff. I just haven't had the time or need for it yet So single walker multidets is the only piece as far as I'm aware |
Please review the developer documentation
on the wiki of this project that contains help and requirements.
Proposed changez
Describe what this PR changes and why. If it closes an issue, link to it here
with a supported keyword.
This PR enables the use of the exact spin integration in the SOECP alongside wave function optimization. This is both a new feature and a bug fix. Prior to this PR, we set the default execution path of the SOECP to be the exact spin integration, which specifies some of the data structure sizes upon construction. However, there wasn't an evaluateValueAndDerivatives which utilized the exact spin stuff, so there was an array size mismatch since it was going down the code path using the simpsons rule for spin integration and the data structures weren't sized correctly for that. This PR make everything consistent, so that WF optimization will work regardless of which spin integration scheme you use.
Note that I didn't implement the functionality to work with RotatedSPOs for this PR. This just makes sure everything works correctly with normal jastrow optimization. A separate PR for enabling this alongside OrbOpt will happen later when I have time to write a test
What type(s) of changes does this code introduce?
Delete the items that do not apply
Does this introduce a breaking change?
What systems has this change been tested on?
M1 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.