Skip to content

Handle disabled variational parameters in rotation derivatives - #4581

Merged
mdewing merged 3 commits into
QMCPACK:developfrom
mdewing:disabled_vp
May 3, 2023
Merged

Handle disabled variational parameters in rotation derivatives#4581
mdewing merged 3 commits into
QMCPACK:developfrom
mdewing:disabled_vp

Conversation

@mdewing

@mdewing mdewing commented May 2, 2023

Copy link
Copy Markdown
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)

@mdewing

mdewing commented May 2, 2023

Copy link
Copy Markdown
Contributor Author

The RHF case is described in #4582

@mdewing

mdewing commented May 2, 2023

Copy link
Copy Markdown
Contributor Author

Test this please

@mdewing
mdewing merged commit 0cefe09 into QMCPACK:develop May 3, 2023
@mdewing
mdewing 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.

2 participants