qmcpack icon indicating copy to clipboard operation
qmcpack copied to clipboard

Give ParticleSet& W a better name

Open quantumsteve opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

As discussed in #4127 ParticleSet& W; is a terrible variable name.

Describe the solution you'd like A clear and concise description of what you want to happen.

Change it to something more descriptive. Suggestions? @PDoakORNL @ye-luo

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

Keep the same name, but won't improve readability.

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

See #4127

quantumsteve avatar Jul 28 '22 15:07 quantumsteve

walker_configurations_ I think is descriptive of what this particle set is doing. I think. @markdewing should weight in.

ParticleSet is a garbage bag that can contain anything from just a set of positions to a set of positions, or positions and some energy values or... I believe it or its subtypes can also have quite complex historical state contained in them.

As a result the type itself is almost worthless in terms of reasoning about what an instance of it might be for or be able to do.

PDoakORNL avatar Sep 27 '22 21:09 PDoakORNL

The value of ParticleSet& W; declared in QMCCostFunctionBase is used for two purposes:

  1. Get the number of particles for allocating temporary storage.
  2. Create particle resources in DriverWalkerResourceCollection in the CostFunctionCrowdData constructor.

The uses are only concerned with a single particle set, not a set of configurations. It could be called P, though single letter names are hard to search for. Maybe 'pset_' or 'elec_'?

The other uses of W in files in WFOpt are from the declaration inherited QMCDriver.

markdewing avatar Sep 28 '22 20:09 markdewing