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

Fix single det + WFOpt #2683

Merged
merged 4 commits into from
Sep 8, 2020
Merged

Fix single det + WFOpt #2683

merged 4 commits into from
Sep 8, 2020

Conversation

ye-luo
Copy link
Contributor

@ye-luo ye-luo commented Sep 7, 2020

Proposed changes

Fix #2496, both cases
The bug affected single det + WF optimization. When the optimizer reset WF, the single det was not reset clean.
A safeguard is introduced to check recomputed variance against the earlier VMC variance.

The bug affects NLPP evaluation in WFOpt only when the first electron in NLPP radius needing NLPP evaluation is the same as the last electron in NLPP radius of the previous sample. This can occur only when the system has very few electrons and the electron density is low.

This PR can be reviewed independent of #2682 but be sure to merge after #2682

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

  • Bugfix

Does this introduce a breaking change?

  • No

What systems has this change been tested on?

Bora

Checklist

  • 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

@ye-luo ye-luo added the bug label Sep 7, 2020
@prckent
Copy link
Contributor

prckent commented Sep 7, 2020

Thanks Ye. Assuming this fixes all the issues, do you have any opinions as to how to avoid mistakes like this in future?

@ye-luo
Copy link
Contributor Author

ye-luo commented Sep 7, 2020

I tried to make a precise and trimmed reproducer but it was not successful. So I put this approximate safeguard which is more universally valid like our NaN checks. Apart from what developers adding more tests or checks, I'm wondering if we can build more diagnosis on the statistics in the code or workflow tools to help catching issues in the code.

@prckent
Copy link
Contributor

prckent commented Sep 8, 2020

Does the new check catch both reported errors?

We are clearly lacking in deterministic optimizer checks for different wavefunctions.

@ye-luo
Copy link
Contributor Author

ye-luo commented Sep 8, 2020

Does the new check catch both reported errors?

We are clearly lacking in deterministic optimizer checks for different wavefunctions.

Yes. The added safeguard traps the reported bugs.

Copy link
Contributor

@prckent prckent left a comment

Choose a reason for hiding this comment

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

Adding internal checks is very worthwhile, particularly between the optimizer and the vmc driver where there is a big handoff.

@prckent prckent merged commit d5a6d0d into QMCPACK:develop Sep 8, 2020
@ye-luo ye-luo deleted the fix-opt branch September 19, 2020 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Variance minimization failure between v3.6.0 and v3.7.0
2 participants