-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nexus: enable improved generation of QMCPACK inputs #1471
Conversation
okay to test |
Can one of the maintainers verify this patch? |
What is the main reason for yes |
Please also remove in OneShiftOnly
Please follow the example in the manual for one shift only. Two optimization sections are recommended. |
With hdf5=yes the scalar data is written to the stat.h5. Why should the cost function be removed? It is simply user choice. The shift values are just the defaults, so I don't see why this is harmful. I can enable a way to use separate minwalkers if desired. |
|
I don't personally see why it's such a big issue, but I am willing to change (1) and (3) according to @ye-luo's requests. I'm confused about your statements regarding the cost function. Is oneshift only ever optimizing according to a fixed cost function regardless of user input? If so, which is it (energy?)? |
Quartic optimizer makes the decision whether a new set of parameter is accepted or ignored based on fitting the CostFunction values to a quartic function. OneShiftOnly is pure energy minimization and has a different strategy. It almost always accept new parameter set unless miniwalkers screens crazy bad parameters. CostFunction is calculated and printed only for user to have a feeling of the optimization but it doesn't get involved in any decision making of OSO. |
OK, so OSO cost function is fixed internally regardless of user input. Is it fixed to pure energy (1.0energy) or 0.9energy+0.1*reweightedvariance? You mention both above. (NB: recent commits address (1) above) |
The optimization has two stages. In the first stage, the optimizer just compute WF and LocalEnergy derivatives and propose a new set of parameters. All choices of optimizer are doing linear method energy minimization rescale/quartic/OSO. In the second stage, |
@jtkrogel It is not fixed because the energy minimization doesn't even know the costfunction. user input of cost function is respected but used differently. |
OK, perhaps we are conflating two things: cost function as input, and the actual target of optimization. Does OSO find the lowest energy solution? If not energy, what is it minimizing by default? Is there (and what is) a way to influence what it is minimizing via user input? |
In the first stage, OSO is targetting energy. In the second stage, OSO doesn't pursuit the absolute lowest CostFunction because each VMC section has limited samples and the energy fluctuates. The parameter set gives the lowest CostFunction is not necessarily the best parameter set. For this reason, OSO let the optimization continue while the quartic struggles with the `optimal' CostFunction. As long as stage 1 is correct, OSO should converge statistically. |
See #1494 (the final result of this line of discussion via phone). Next, I will make commits addressing points 2 and 3 above. |
Points 2 and 3 have been addressed. Cost function and defaults are now suppressed for OneShiftOnly. A simple means is added to request a split loop w/ smaller and larger minwalkers as follows:
|
@ye-luo OK to merge now? |
I feel there is some inconsistency between blocks, steps and samples. At least one parameter will be dropped. But it is a overall parameter design problem. |
This PR pulls in QMCPACK input generation methods from qmcpack_worfklows into the main code (now made accessible via generate_qmcpack). This update is fully backwards compatible with existing Nexus scripts, as confirmed by passing tests for unchanged example inputs.
The main advantages of the changes are to enable more compact user input to request sensible defaults for initial Jastrow factors and OPT/VMC/DMC calculation sections.
For example, good default Jastrow factors are generated by setting, e.g.
J2=True
orJ3=True
ingenerate_qmcpack
rather than providing more detailed inputs via thejastrows
keyword:The default cutoffs for J1/J2 are the n.n. wigner radius and the number of B-spline coeffecients is one per 0.5 Bohr.
QMC sections are autogenerated by setting
qmc='XXX'
instead of providing structured input viacalculations
. Examples for optimization (quartic/oneshiftonly), VMC, and DMC (direct and timestep extrapolation) are shown below.Optimization:
VMC:
DMC:
DMC timestep extrapolation: