qmcpack icon indicating copy to clipboard operation
qmcpack copied to clipboard

[WIP]Prototype orbital rotation

Open markdewing opened this issue 3 years ago • 1 comments

Replaces #4146 and #4147 Includes the changes in OptimizableObject and the wavefunction optimization API changes. The PR isn't intended to be checked in. The intent to update the previous prototypes and make it visible for testing.

Implements options 2 and 3 in https://github.com/QMCPACK/qmcpack/issues/3983#issuecomment-1197380631

The options are switched by a flag (use_global_rot_ in RotatedSPOs). There's no input option for it - the constructor needs to be changed in the source and recompiled.

  • false - use the history list (like #4146)
  • true - use global rotation (like #4147)

Loading a vp.h5 will restore the rotation state based on what type of data is stored in the file (history list or global rotation)

Status of various system types:

  • LCAO
    • STO basis functions with single determinant - works
    • pp/ECP with GTO basis functions with single determinant - work s(with the #4196 changes, which are included here)
    • GTO basis functions with cusp correction. Does not work. Probably will require recomputing the cusp correction after every rotation.
  • B-splines
    • multideterminant - doesn't crash, but the parameter gradients don't match in the gradient test
    • single determinant - crashes - will require fixes similar to #4196

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

Delete the items that do not apply

  • New feature

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

markdewing avatar Aug 24 '22 17:08 markdewing

Updated with some fixes so it works with splines SPO's and single determinants. Replaces the in-place multiplication of the rotation matrix and the coefficient matrix.

Note on the gradient test: the default settings for the finite difference delta (1e-5) and using "float" precision for the splines will produce concerning relative differences (few percent) between the finite difference and analytic gradients for the rotation parameters. Switching the spline precision to "double" for the gradient test produces much better relative differences. Or increasing delta will lower the relative difference.

markdewing avatar Aug 26 '22 04:08 markdewing

Replaced by #4351

markdewing avatar Dec 01 '22 02:12 markdewing