qmcpack icon indicating copy to clipboard operation
qmcpack copied to clipboard

Make SPOSet a class template

Open ye-luo opened this issue 2 years ago • 5 comments

Proposed changes

  1. Make SPOSet a class template
  2. port FakeSPO based on SPOSetT with minimal change
  3. always use extern template to avoid redundant compilation.

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

  • New feature

Does this introduce a breaking change?

  • No

What systems has this change been tested on?

laptop

Checklist

  • Yes. This PR is up to date with current the current state of 'develop'

ye-luo avatar Jul 24 '23 21:07 ye-luo

Is there any possibility for odd interactions with classes like CompositeSPOSet? That class merges other SPOSets into a single one. Since with this PR each SPOSet might have a distinct value type, I was wondering if that might produce odd corner cases and/or break that class for some value type combinations.

jtkrogel avatar Jul 25 '23 13:07 jtkrogel

Is there any possibility for odd interactions with classes like CompositeSPOSet? That class merges other SPOSets into a single one. Since with this PR each SPOSet might have a distinct value type, I was wondering if that might produce odd corner cases and/or break that class for some value type combinations.

The type/precision restriction from the base class only applies to the API. The derived class has all the freedom to use any type internally, for example single precision splines orbitals in the full precision build. Making SPOSet template doesn't change the fact that this restriction applies to CompositeSPOSet when it talks to its owned SPOSets but the latter have all the freedom to make their internal precision individually.

ye-luo avatar Jul 25 '23 13:07 ye-luo

@jtkrogel Wondering if your https://doi.org/10.1063/1.4994817 went through the composite SPOset path? I don't think we have an example of this use case and that paper was a good justification for the generality of the present code. Another example would be supporting CP2K's Gaussian+plane wave basis, but I don't think we have even the beginnings of a converter.

prckent avatar Jul 25 '23 14:07 prckent

Yes, that paper used the composite sposet path. The 1RDM code also uses it currently to support memory savings (make one sposet for occupied and one for virtual; determinantset uses only the occupied sposet while density matrix merges the two for use as a basis).

See e.g.: https://github.com/QMCPACK/qmcpack/blob/develop/tests/solids/diamondC_1x1x1_pp/qmc_1rdm_noJ_short.in.xml

jtkrogel avatar Jul 25 '23 14:07 jtkrogel

Test this please

ye-luo avatar Nov 09 '23 04:11 ye-luo

Superseded by #5306 and #5315

ye-luo avatar Mar 10 '25 20:03 ye-luo