-
Notifications
You must be signed in to change notification settings - Fork 145
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
Fix Lattice + OpenBC in batched drivers #5210
Conversation
Test this please |
…ialized_sdj reference values. serialize calls makeMoveAndCheck which has outOfBound(displ) check.
d1add4e
to
431e3ad
Compare
Test this please |
Series 0 is VMC, 1 is DMC.
batch before fix
batch after fix
|
Test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for tracking this down.
I was tempted to ask about masking the work in the use_drift section of VMCBatches.cpp:136+ and the similar section of DMCBatched.cpp:201+, where we might have invalid moves… but do you agree that updating the function signatures wouldn’t bring enough benefit given it is a rare event?
I will ask if we are certain it is safe to call the functions in these regions with invalid moves?
I think it is safe with the current implementations but the comments/docs for the WaveFunctionComponents and ParticleSet should be updated with a suitable note/warning that they have to handle arbitrary positions.
Calculating drift (flex_calcRatioGrad) is fine even positions are invalid because all our SPOs can be evaluated at any position. Jastrows are always defined throughout the space as required by LCAO molecule cases. There is no need to mask "handle arbitrary positions" is a vague requirement. Sometimes, we just need WFCs to run as the results will be discarded regardless. I don't think feel the necessity to put extra note on WFC which might cause unnecessary confusion to developers. The handling is at driver level with both ParticleSet and TWF involved, Individual WFC doesn't need to take responsibility. PaticleSet yes, I added an extra note |
The code coverage report reminds us that the CoordsType::POS_SPIN code path is not hit here. Not a big deal given the simplicity and that we are presumably missing that in lots of places. Something to chip away at in future. |
Proposed changes
When using spline orbitals with boundary condition "n", legacy drivers does one more check when a step is proposed. If the new position is located out of the box in any of the direction marked "n", the proposed move is marked invalid. This bug fixes handled this case.
Think about running a single atom VMC using HF with QE WF and then use "n n n". if electrons are allowed outside the box, the wavefunction norm is infinite due to finite electron density everywhere. Confining electrons within the box prevents this bad situation effectively making electron density 0 outside the box.
Another note. makeMoveAndCheck also rejects moves larger than half of the box as long as a lattice is defined. This is not implemented in the batched API. However, this requires me to regenerate reference numbers for
deterministic-diamondC_2x1x1_pp-vmcbatch-dmcbatch-mwalkers-serialized_sdj
tests.What type(s) of changes does this code introduce?
Does this introduce a breaking change?
What systems has this change been tested on?
Bora
Checklist