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

Handle disabled variational parameters in rotation derivatives #4581

Merged
merged 3 commits into from
May 3, 2023

Conversation

markdewing
Copy link
Contributor

Disabled variational parameters will return -1 from a call to myVars.where, leading to an out-of-bounds array access. This PR adds a check to avoid this situation.

Variational parameters can be disabled due to choosing a variational subset.

Also in the case of a RHF wavefunction where there are different numbers of spin up/down electrons, there will be a different number of rotation parameters for each spin. At a higher level of managing the parameters, this case is not being handled correctly, but this fix will stop it from segfaulting on invalid array access in the meantime.

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

Delete the items that do not apply

  • Bugfix

Does this introduce a breaking change?

  • No

What systems has this change been tested on?

desktop

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
  • N/A. Documentation has been added (if appropriate)

@markdewing
Copy link
Contributor Author

markdewing commented May 2, 2023

The RHF case is described in #4582

@markdewing
Copy link
Contributor Author

Test this please

@markdewing markdewing merged commit 0cefe09 into QMCPACK:develop May 3, 2023
20 of 21 checks passed
@markdewing markdewing deleted the disabled_vp branch May 3, 2023 17:25
@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

2 participants