## Autotest for cutoffs optimization

General discussion of the Cambridge quantum Monte Carlo code CASINO; how to install and setup; how to use it; what it does; applications.
Posts: 138
Joined: Wed Apr 15, 2015 3:14 pm

### Autotest for cutoffs optimization

Hello casino developers

I encountered a not completely clear issue in the latest version - JASTROW cutoff values are either not optimized at all or optimized worse than in previous CASINO versions.

I tried to understand whether this case is checked in autotests and how, but I did not find it.
Perhaps this is difficult to verify due to the random value of optimized VMC energy, but now even for simple monatomic systems the optimized VMC energies are underestimated by a dozen standard errors.

I will be grateful if you help me write the appropriate autotest.

PS: I apologize that my post is again in the top.
In Soviet Russia Casino plays you.
Pablo_Lopez_Rios
Posts: 52
Joined: Thu Jan 30, 2014 1:25 am

### Re: Autotest for cutoffs optimization

Could you post input/output files for an example in which the Jastrow cutoffs are well optimised by an older version (which?) and poorly optimised by the latest version of CASINO?

Thanks,
Pablo
Hey there! I am using CASINO.
Neil Drummond
Posts: 95
Joined: Fri May 31, 2013 10:42 am
Location: Lancaster
Contact:

### Re: Autotest for cutoffs optimization

Here's a very quick test. For a 27-electron r_s=4 3D electron gas with a Jastrow factor containing a U term only, if I start from a cutoff length of L=4 a.u. and optimise the linear parameters together with the cutoff using variance minimisation:

Code: Select all

``````  VMC #1: E     = -0.0497(1) ; var  = 1.30(4) (correlation.out.0)
VMC #2: E     = -0.06432(9) ; var  = 0.395(6) (correlation.out.1)
VMC #3: E     = -0.06907(7) ; var  = 0.247(3) (correlation.out.2)
VMC #4: E     = -0.07327(5) ; var  = 0.134(2) (correlation.out.3)
VMC #5: E     = -0.07340(5) ; var  = 0.124(2) (correlation.out.4)
VMC #6: E     = -0.07581(3) ; var  = 0.0552(8) (correlation.out.5)
VMC #7: E     = -0.07644(3) ; var  = 0.0401(8) (correlation.out.6)
VMC #8: E     = -0.07637(3) ; var  = 0.0397(8) (correlation.out.7)
VMC #9: E     = -0.07639(3) ; var  = 0.0397(8) (correlation.out.8)
``````
C.f., if L is fixed:

Code: Select all

``````  VMC #1: E     = -0.0500(2) ; var  = 1.34(7) (correlation.out.0)
VMC #2: E     = -0.0578(1) ; var  = 0.612(7) (correlation.out.1)
VMC #3: E     = -0.0580(1) ; var  = 0.613(7) (correlation.out.2)
VMC #4: E     = -0.0581(1) ; var  = 0.614(7) (correlation.out.3)
VMC #5: E     = -0.0582(1) ; var  = 0.603(7) (correlation.out.4)
VMC #6: E     = -0.0578(1) ; var  = 0.609(7) (correlation.out.5)
VMC #7: E     = -0.0578(1) ; var  = 0.610(7) (correlation.out.6)
VMC #8: E     = -0.0578(1) ; var  = 0.615(7) (correlation.out.7)
VMC #9: E     = -0.0577(1) ; var  = 0.627(9) (correlation.out.8)
``````
So optimising the cutoff length does seem to work in this case at least.

Best wishes,

Neil.
Posts: 138
Joined: Wed Apr 15, 2015 3:14 pm

### Re: Autotest for cutoffs optimization

Could you post input/output files for an example in which the Jastrow cutoffs are well optimised by an older version (which?) and poorly optimised by the latest version of CASINO?

Thanks,
Pablo
Yes, here is a simple example that I found - old version and new version
8_8_44__test.tgz
new version
archive symlinks point to the same files in the old version.

old VMC energy

Code: Select all

`````` VMC #1: E     = -24.531(5) ; var  = 5.2(4) (correlation.out.0, parameters.0.casl)
VMC #2: E     = -24.6101(7) ; var  = 0.111(1) (correlation.out.1, parameters.1.casl)
VMC #3: E     = -24.6208(7) ; var  = 0.1724(9) (correlation.out.2, parameters.2.casl)
VMC #4: E     = -24.6214(7) ; var  = 0.179(2) (correlation.out.3, parameters.3.casl)
VMC #5: E     = -24.6240(7) ; var  = 0.179(1) (correlation.out.4, parameters.4.casl)
VMC #6: E     = -24.6240(9) ; var  = 0.3(2) (correlation.out.5, parameters.5.casl)
VMC #7: E     = -24.6244(7) ; var  = 0.168(1) (correlation.out.6, parameters.6.casl)
VMC #8: E     = -24.6242(7) ; var  = 0.169(2) (correlation.out.7, parameters.7.casl)
VMC #9: E     = -24.6240(7) ; var  = 0.171(3) (correlation.out.8, parameters.8.casl)
VMC #10: E     = -24.6244(7) ; var  = 0.170(1) (correlation.out.9, parameters.9.casl)``````
new VMC energy

Code: Select all

`````` VMC #1: E     = -24.527(5) ; var  = 5.2(3) (correlation.out.0, parameters.0.casl)
VMC #2: E     = -24.6110(8) ; var  = 0.163(1) (correlation.out.1, parameters.1.casl)
VMC #3: E     = -24.6117(8) ; var  = 0.167(1) (correlation.out.2, parameters.2.casl)
VMC #4: E     = -24.6118(8) ; var  = 0.183(1) (correlation.out.3, parameters.3.casl)
VMC #5: E     = -24.6155(8) ; var  = 0.190(1) (correlation.out.4, parameters.4.casl)
VMC #6: E     = -24.6149(8) ; var  = 0.191(2) (correlation.out.5, parameters.5.casl)
VMC #7: E     = -24.6154(8) ; var  = 0.190(1) (correlation.out.6, parameters.6.casl)
VMC #8: E     = -24.6147(8) ; var  = 0.192(2) (correlation.out.7, parameters.7.casl)
VMC #9: E     = -24.6149(8) ; var  = 0.191(2) (correlation.out.8, parameters.8.casl)
VMC #10: E     = -24.6154(8) ; var  = 0.192(3) (correlation.out.9, parameters.9.casl)
``````
I haven’t done calculations for a long time so I can’t say exactly when an issue occurred.

In Soviet Russia Casino plays you.
Pablo_Lopez_Rios
Posts: 52
Joined: Thu Jan 30, 2014 1:25 am

### Re: Autotest for cutoffs optimization

After a quick bisect, this seems to be due to commit v2.13.819 (a1a58085 by Neil) in which some BLAS calls were replaced with inline code. Maybe this commit just introduced numerical instabilities hindering the optimisation of gjastrow cut-offs, but it might be worth verifying that this is not a bug, and perhaps check if undoing the changes to the gjastrow and gbasis modules fixes this.

Best,
Pablo
Hey there! I am using CASINO.
Neil Drummond
Posts: 95
Joined: Fri May 31, 2013 10:42 am
Location: Lancaster
Contact:

### Re: Autotest for cutoffs optimization

Dear Both,

Optimisation of cutoff lengths has always been challenging and numerically sensitive. These days I tend to fix the cutoff lengths at sensible values rather than attempt to optimise them. In the present case, fixing L_u=10, L_chi=8 and L_f=7 a.u. works OK:

Code: Select all

``````  VMC #1: E     = -24.588(2) ; var  = 0.809(4) (correlation.out.0)
VMC #2: E     = -24.625(1) ; var  = 0.177(2) (correlation.out.1)
VMC #3: E     = -24.624(1) ; var  = 0.176(1) (correlation.out.2)
VMC #4: E     = -24.625(1) ; var  = 0.180(3) (correlation.out.3)
VMC #5: E     = -24.625(1) ; var  = 0.177(2) (correlation.out.4)
VMC #6: E     = -24.626(1) ; var  = 0.176(1) (correlation.out.5)
VMC #7: E     = -24.628(1) ; var  = 0.180(2) (correlation.out.6)
VMC #8: E     = -24.627(1) ; var  = 0.178(3) (correlation.out.7)
VMC #9: E     = -24.6264(8) ; var  = 0.177(1) (correlation.out.8)
``````
Using different f terms for parallel and antiparallel spin pairs gives slightly better results:

Code: Select all

``````  VMC #1: E     = -24.601(1) ; var  = 0.278(1) (correlation.out.0)
VMC #2: E     = -24.6276(9) ; var  = 0.17(5) (correlation.out.1)
VMC #3: E     = -24.6297(8) ; var  = 0.135(1) (correlation.out.2)
VMC #4: E     = -24.6303(8) ; var  = 0.138(2) (correlation.out.3)
VMC #5: E     = -24.6292(8) ; var  = 0.137(2) (correlation.out.4)
``````
Best wishes,

Neil.
Posts: 138
Joined: Wed Apr 15, 2015 3:14 pm

### Re: Autotest for cutoffs optimization

thanks Nail for intriguing me...I used the CASL format so there are no u, chi, f terms, at least in the configuration file.

For each maximum degree of polynomial approximation of each term there is an optimal cutoff.

Is it possible to see the complete set of files for the above example, and it is also interesting how the WFN was obtained.

I tried to figure out how much better JASTROW approximation improves the quality of subsequent BACKFLOW approximation.

In Soviet Russia Casino plays you.
Neil Drummond
Posts: 95
Joined: Fri May 31, 2013 10:42 am
Location: Lancaster
Contact:

### Re: Autotest for cutoffs optimization

The form of Jastrow that you are using is essentially the same that I used: the three terms in your Jastrow factor are u (homogeneous electron-electron), chi (electron-nucleus) and f (electron-electron-nucleus).

Best wishes,

Neil.
Posts: 138
Joined: Wed Apr 15, 2015 3:14 pm

### Re: Autotest for cutoffs optimization

Neil Drummond wrote:Dear Vladimir,

The form of Jastrow that you are using is essentially the same that I used: the three terms in your Jastrow factor are u (homogeneous electron-electron), chi (electron-nucleus) and f (electron-electron-nucleus).

Best wishes,

Neil.
I meant that JASTROW factor in CASINO can be described in two significantly different formats - "Drummond-Towler-Needs form" or "Pablo Lopez Rios form"

I made additional calculations and found out that for the first form, optimization of cutoffs works, but for the second one it doesn’t, as Pablo wrote after commit v2.13.819.

In Soviet Russia Casino plays you.
Neil Drummond
Posts: 95
Joined: Fri May 31, 2013 10:42 am
Location: Lancaster
Contact:

### Re: Autotest for cutoffs optimization

Dear Vladimir & Pablo,

You're right: I broke gjastrow optimisation in the patch that Pablo indicated. I've just sent a patch fixing the issue to Mike. Thanks very much for pointing out the problem, and I'm very sorry about the inconvenience.

The above results of playing around with the pjastrow wave function still apply, however: you can get a good wave function by fixing the cutoff lengths at a plausible value, and there is scope for improving the wave function by using different electron-electron-nucleus terms for parallel and antiparallel spins. Bases other than natural powers (available in gjastrow) might give further improvements to the wave function for an isolated atom.

Best wishes,

Neil.