OrbOpt parameters are not correctly reported if read from vp.h5 file
- Dominant language
- C++
- Stars
- 403
- Forks
- 154
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 82
Description
**Describe the bug**
In an orbopt calculation, one can specify parameters manually using the "opt_vars" parameter:
```
0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
```
And QMCPACK properly reports these parameters at the start of a calculation:
```
Orbital rotation using global rotation
nparams_active: 80 params2.size(): 80
Parameter name Value
rot-spo-up_orb_rot_0000_0004 1.000000e-01 0 1 ON 0
rot-spo-up_orb_rot_0000_0005 1.000000e-01 0 1 ON 1
rot-spo-up_orb_rot_0000_0006 1.000000e-01 0 1 ON 2
rot-spo-up_orb_rot_0000_0007 1.000000e-01 0 1 ON 3
rot-spo-up_orb_rot_0000_0008 1.000000e-01 0 1 ON 4
rot-spo-up_orb_rot_0000_0009 1.000000e-01 0 1 ON 5
rot-spo-up_orb_rot_0000_0010 1.000000e-01 0 1 ON 6
rot-spo-up_orb_rot_0000_0011 1.000000e-01 0 1 ON 7
rot-spo-up_orb_rot_0000_0012 0.000000e+00 0 1 ON 8
rot-spo-up_orb_rot_0000_0013 0.000000e+00 0 1 ON 9
rot-spo-up_orb_rot_0000_0014 0.000000e+00 0 1 ON 10
rot-spo-up_orb_rot_0000_0015 0.000000e+00 0 1 ON 11
rot-spo-up_orb_rot_0000_0016 0.000000e+00 0 1 ON 12
rot-spo-up_orb_rot_0000_0017 0.000000e+00 0 1 ON 13
rot-spo-up_orb_rot_0000_0018 0.000000e+00 0 1 ON 14
rot-spo-up_orb_rot_0000_0019 0.000000e+00 0 1 ON 15
rot-spo-up_orb_rot_0000_0020 0.000000e+00 0 1 ON 16
rot-spo-up_orb_rot_0000_0021 0.000000e+00 0 1 ON 17
rot-spo-up_orb_rot_0000_0022 0.000000e+00 0 1 ON 18
...
```
However, if instead the tag is not used and the parameters are supplied via "override_variational_parameters", QMCPACK incorrectly reports zero rotation. Starting a fresh calculation with ``:
```
```
Results in zero rotations being reported:
```
Orbital rotation using global rotation
nparams_active: 80 params2.size(): 0
Parameter name Value
rot-spo-up_orb_rot_0000_0004 0.000000e+00 0 1 ON 0
rot-spo-up_orb_rot_0000_0005 0.000000e+00 0 1 ON 1
rot-spo-up_orb_rot_0000_0006 0.000000e+00 0 1 ON 2
rot-spo-up_orb_rot_0000_0007 0.000000e+00 0 1 ON 3
rot-spo-up_orb_rot_0000_0008 0.000000e+00 0 1 ON 4
rot-spo-up_orb_rot_0000_0009 0.000000e+00 0 1 ON 5
rot-spo-up_orb_rot_0000_0010 0.000000e+00 0 1 ON 6
rot-spo-up_orb_rot_0000_0011 0.000000e+00 0 1 ON 7
rot-spo-up_orb_rot_0000_0012 0.000000e+00 0 1 ON 8
rot-spo-up_orb_rot_0000_0013 0.000000e+00 0 1 ON 9
rot-spo-up_orb_rot_0000_0014 0.000000e+00 0 1 ON 10
...
```
This matters because it makes it look as rotation i/o does not work. One can easily verify that the rotations are recorded in the vp.h5 file, and that the energy/variance is different from no rotation. But looking only at the output file one might conclude that no rotation was applied. But it is applied, just not accurately reported.
**To Reproduce**
Tested using qmcpack/develop 8658ea9bec1271069c5779e79180fba0adc3a68e (27 July)
**Expected behavior**
I expected the wavefunction parameters to be read and reported accurately.
**System:**
RHEL8
gcc
**Additional context**
Add any other context about the problem here.
Contributor guide
Assessment
This issue has not been assessed yet.