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 1RDM estimator data written to stat.h5 #4568

Merged
merged 4 commits into from Apr 27, 2023

Conversation

camelto2
Copy link
Contributor

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

Proposed changes

As I was looking at generalizing the new 1rdm estimator to work with spinor wave functions, I noticed there is an indexing bug for the 1rdm, similar to what was described in #4533 and fixed by #4552.

To verify the bug, I used the files from @aannabe in the #1052 and modified them for the new batched drivers. The down component written to the hdf5 is not being indexed into correctly, so the down data written to stat.h5 ends up being exactly the same as the up data.

This PR sets the correct starting index for the down 1rdm in registerOperatorEstimator, and adds a test. The test has unique 1rdm data for the up and down components and checks that what is written to the hdf5 agrees with the actual unique data.

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?

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.

  • 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)

Copy link
Contributor

@rcclay rcclay left a comment

Choose a reason for hiding this comment

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

LGTM

@prckent
Copy link
Contributor

prckent commented Apr 26, 2023

Test this please

@prckent prckent self-requested a review April 26, 2023 22:47
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.

LGTM

Thanks for catching this Cody.

@prckent prckent enabled auto-merge April 26, 2023 22:48
@prckent prckent merged commit 29ba77e into QMCPACK:develop Apr 27, 2023
38 checks passed
@camelto2 camelto2 deleted the 1rdm_index_fix branch April 27, 2023 00:35
@prckent prckent mentioned this pull request Aug 18, 2023
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.

None yet

3 participants