Skip to content
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

Jastrow radial-cutoff default values in Nexus #5188

Open
aannabe opened this issue Sep 25, 2024 · 5 comments
Open

Jastrow radial-cutoff default values in Nexus #5188

aannabe opened this issue Sep 25, 2024 · 5 comments

Comments

@aannabe
Copy link
Contributor

aannabe commented Sep 25, 2024

This issue is to discuss some possible improvements for Jastrow radial-cutoff default values. Particularly, in Nexus, J12 defaults to the largest radial cutoff allowed by the supercell in periodic boundary conditions. However, J3's radial cutoff is limited at 5.0 Bohr by default, presumably due to possible difficulties in optimizing extended Jastrows. However, this cutoff seems a bit aggressively small. Using the monolayer CrI3, spinor trial wavefunctions, and J12_rcut = 12.93483855, the total energies and variances are below. They all start from the same J12 and go for about 8 iterations using OneShiftOnly. The lowest energy data was chosen for each one.

j3_rcuts

Note that the default J3_rcut = 5 in this case is too far away from the optimal value. Values for J3_rcut => 10.0 all seem comparable.

For open boundary conditions, Nexus seems to default to J1_rcut_open = 5.0 and J2_rcut_open = 10.0. I haven't explored these values. However, I noticed the below study did this using qmcpack, obtaining optimal values close to 10.0 Bohr, similar to the J3_rcut data above.

From https://pubs.acs.org/doi/10.1021/acs.jctc.1c00467 :

image

From the limited data above, it suggests the default Jastrow cutoffs J1_rcut_open = 5.0 and J3_rcut = 5.0 could be bumped to about 10.0 Bohr.

Data for the first Figure:
J3_rcuts.zip

@camelto2
Copy link
Contributor

The default I have tended to use the wiger-seitz radius, which can be obtained from the structure class. Maybe using something like this which is physically motivated

@aannabe
Copy link
Contributor Author

aannabe commented Sep 25, 2024

Agreed. J1, J2, and J3 all defaulting to the WS-radius is the most intuitive default for PBC.

@prckent
Copy link
Contributor

prckent commented Sep 25, 2024

@kayahans What have you found successful in your 2D runs?

@kayahans
Copy link
Contributor

kayahans commented Sep 26, 2024

@prckent I optimized jastrows using the bilayers. Here are my results for AFM bilayer CrI3, for 2x2x1 tiling with J2 and J3 jastrows.
opt_pbe_u_1.0_2x2x1_3000_ccecparep/opt series 19 -1935.513503 +/- 0.014367 32.889841 +/- 0.528421 0.0170
optJ3_pbe_u_1.0_2x2x1_3000_ccecparep/optJ3 series 7 -1935.994760 +/- 0.013629 30.785014 +/- 0.265862 0.0159

Looking at Gani's results, he has a variance/energy ratio of a value slightly larger than 15/-967.6=0.0155 and then his best variance ~15-15.5 is about half of my value considering it is monolayer vs bilayer. I have used a J3 cutoff of 4.0 Bohr. I didn't test the J3 convergence as detailed as Gani. His highest variance J3 calculation has the variance energy ratio of 20/967=0.021 which is worse than the J2 optimization I had. I am using equal cutoffs (WS) for J1 and J2, that could explain the difference if Gani is using smaller cutoff for J1. I guess there is no right answer here, I have always thought of J1 and J2 complement each other so I use the same cutoff for both.

I would consider checking how well your 1-body parameters converged in the previous J2-only calculation. The rpa based initial values (available in nexus) for the 2-body jastrow parameters seemed to be pretty good as the starting point. My J2 optimization calculations mainly improved the 1-body parameters (they start from zero). If you in case start from all zeros (for J1 and J2) or have a small cutoff for J1, then the 1-body parameters may be stuck in some configuration and then the 3-body parameters may try to compensate for them in the J3 optimization calculation.

Going from 2x2x1 supercell to larger supercells(3x3x1 and 4x4x1), I had difficulty optimizing 1-body parameters even when initial J1 values are selected to be all zeros and J2 initial values are from rpa. That is why I would guess that 1-body parameters may be the issue. For my case, the reason for the difficulty could be due to the large cutoff I choose. Then I tried reusing the 1-body parameters from 2x2x1 to run J2 optimization calculations for larger supercells. I set the J1 cutoff equal to WS radius, but copy-pasted the J1 parameters from the smaller supercell. In a way this stretches the shape of Jastrow, but at the end it was much easier to get reasonable variance energy ratios on par with 0.0159 value I got in 2x2x1.

@romanfanta4
Copy link

For large supercells, I would recommend not to use Jastrow cutoff values exceeding approximately 10 Å. At distances greater than this, interactions tend to be negligible and make minimal contributions to the total correlation energy. Additionally, optimization of these large cutoffs can be difficult and computationally expensive, often without significant gain in accuracy.

For the molecules we tested in the paper mentioned by Gani, the problem is that the tails of Jastrows terms for large cutoffs will lack samples and become poorly defined (noisy). Such places in configuration space are only rarely visited by walkers within QMC simulations (with importance sampling and branching). Nevertheless, this may happen and in such a case, poor local energy with large variance will result and likely affect the total energy.

To visualize the effect of cutoff choices, one can plot spline-based Jastrow functions. For example, plotting the J1 term for Argon in the FCl-Ar dimer, as well as for an isolated Argon atom with varying cutoffs, can illustrate how the function behavior changes with short versus longer cutoffs.
image
Similarly, plotting the J2 term can help to identify appropriate cutoff ranges that avoid excessive truncation or unnecessary extension.
image.

The J3 (three-body Jastrow) term cutoff is influenced by the distances set for both electron-electron (ee) and electron-nucleus (en) interactions, with the en cutoff being half of the total J3 cutoff. This effectively zeros out correlations at distances beyond this range for each interaction type. The interactions modeled by the J3 term therefore interact with those of the J1 and J2 terms, which is why we set the J1 cutoff to half of the J2/J3 cutoff.

As a possible improvement, it might be beneficial to allow separate cutoff settings for en and ee cutoffs within the J3 term. This flexibility would enable users to independently optimize these cutoffs, achieving a balanced contribution from all Jastrow components while improving correlation modeling and minimizing unnecessary noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants