Fix 1RDM estimator data written to stat.h5 #4568
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?
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.