qmc-fit: Add parameter fitting with jackknife for e.g. DFT+U, EXX scans#4475
Conversation
prckent
left a comment
There was a problem hiding this comment.
Please add documentation e.g. https://qmcpack.readthedocs.io/en/develop/analyzing.html
prckent
left a comment
There was a problem hiding this comment.
Caught some rst problems. It is worth checking the readthedocs preview.
|
Is there an error trap if |
|
Just noticed |
|
Test this please |
|
Disabled auto merge since Ye's question has not been answered. |
|
I have made a more recent commit improving the concerns that Ye raised. This commit removes the duplicate optparsers in both timestep and u fit functions and uses argparse instead. Optparse has deprecated and its website recommends that argparse is used instead (https://docs.python.org/3/library/optparse.html). In this commit some additional help comments are added hopefully can address #4479. U requested -u trap that Ye mentions is also added in this commit. In argparse, either -t, -u or --exx must be defined and within timestep_fit() or hubbard_u_fit() the existence of the relevant options are checked as well. |
|
@kayahans could you take a look at the test |
|
Sorry it took me a while to get back to this. I ran "ctest -R nexus" under build directory and got no errors on my end. The build I have is current with my qmcfit branch on my qmcpack fork which has the "updated argparse" as its latest commit. |
|
Test this please |
|
Running the self-hosted CI to get more info on the failures. |
|
@kayahans could you share your cmake? I'm afraid that due to python module difference, only a subset of tests were run on your machine compared to CI. |
|
I have found that the error is related to the default timestep fit function. In the nexus test, the default option is used (which was linear). I have modified the |
|
@ye-luo I am guessing that you are asking this CMakeCache.txt file. Please let me know if you would like to see something else. CMakeCache.txt |
Sorry that I didn't give a clear request. I was asking for cmake printout but it is not needed any more as you figured out the failure. |
|
Test this please |
Proposed changes
Hubbard U/exact exchange ratio parameter fitting capability is added to qmc-fit. Fits can be performed up to including 4th order polynomials using jackknife. To demonstrate use cases, I have used some of my own data as below. Minima is only printed out if the x value is within the range ([0,5] for examples below).
qmc-fit u -u "0 1 2 3 4 5" -f quadratic dmc_u_*/dmc.s001.scalar.datfit function : quadratic
fitted formula: (-1230.1084 +/- 0.0054) + (-0.0668 +/- 0.0050)*t + (0.00867 +/- 0.00093)*t^2
root 1 minimum_u : 3.85 +/- 0.15
root 1 minimum_e : -1230.2369 +/- 0.0027
qmc-fit u -u "0 1 2 3 4 5" -f cubic dmc_u_*/dmc.s001.scalar.datfit function : cubic
fitted formula: (-1230.1085 +/- 0.0057) + (-0.066 +/- 0.011)*t + (0.0083 +/- 0.0056)*t^2 + (0.00004 +/- 0.00071)*t^3
root 1 minimum_u : 3.87 +/- 0.14
root 1 minimum_e : -1230.2376 +/- 0.0044
root 1 curvature : 0.0176 +/- 0.0057
qmc-fit u -u "0 1 2 3 4 5" -f quartic dmc_u_*/dmc.s001.scalar.datfit function : quartic
fitted formula: (-1230.1105 +/- 0.0052) + (-0.0215 +/- 0.0057)*t + (-0.0419 +/- 0.0013)*t^2 + (0.01684 +/- 0.00068)*t^3 + (-0.00171 +/- 0.00013)*t^4
root 1 minimum_u : 3.09 +/- 0.12 eV
root 1 minimum_e : -1230.2360 +/- 0.0042 Ha
root 1 curvature : 0.0326 +/- 0.0033
Also close #4479
What type(s) of changes does this code introduce?
Does this introduce a breaking change?
What systems has this change been tested on?
macOS Monterey 12.6.3, Python 3.9.13
Checklist
Update the following with a yes where the items apply. If you're unsure about any of them, don't hesitate to ask. This is
simply a reminder of what we are going to look for before merging your code.