QMCPACK / QMCPACK/qmcpack

WaveFunctionComponent API is misleading and inconsistent.

Open
#3,459 2 comments 0 reactions 0 assignees View on GitHub
bug discussion enhancement
Dominant language
C++
Stars
403
Forks
154
Avg merge
1d 12h
Merged PRs (30d)
82

Description

**Is your feature request related to a problem? Please describe.**
WFC's are in the current wavefunction design basically state machines. The base class interface obscures and confuses this, the member function names and documentation are just confusing.

The significant effect of many functions is actually updating object state. The names of functions don't reflect their actual purpose or what they do.

Examples:
```c++
/** evaluate the value of the WaveFunctionComponent from scratch
* @param P active ParticleSet
* @param G Gradients, \f$\nabla\ln\Psi\f$
* @param L Laplacians, \f$\nabla^2\ln\Psi\f$
* @return the log value
*
*/
virtual LogValueType evaluateLog(const ParticleSet& P,
ParticleSet::ParticleGradient_t& G,
ParticleSet::ParticleLaplacian_t& L) = 0;
```
Actually the normal mode of getting the LogValue of a WFC is to access the data member log_value_ not call this function.
This actually recomputes most of the state of most WFC and provides an exception to the usual semantics for a WFC's LogValue. Later on in the getValue() function there is another definition for the value of a wfc that will not always match the value that evaluateLog returns.

There is infact another way to accomplish the same state transformation as evaluateLog by calling evaluateGL with a flag to get a fresh evaluation of GL.

This key API needs a real clean up.

**Describe the solution you'd like**
TBD

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.