Expansion coefficient

General discussion of the Cambridge quantum Monte Carlo code CASINO; how to install and setup; how to use it; what it does; applications.
samaneh
Posts: 9
Joined: Thu Jun 27, 2013 6:22 am

Expansion coefficient

Post by samaneh »

I am working with CASINO code.
While studying the manual
it is not easy for me to understand
how to make the cut off or parameter values (expansion coefficients)
in the correlation.data file in CASINO.
Also I run the examples without this file
and it runs with the default Jastrow factor
which I can not distinguish.
I will be so grateful if you help me with this problem.
Mike Towler
Posts: 239
Joined: Thu May 30, 2013 11:03 pm
Location: Florence
Contact:

Re: Expansion coefficient

Post by Mike Towler »

Hi Samaneh,

If you set the Jastrow cutoffs to zero in the correlation.data file, they will be given suitable default values (they can be optimized later if you wish).

To make a 'starting Jastrow', find any sections labelled 'Parameter values' and delete all the numbers that follow that label. Optimized values for these numbers will be inserted into their place by CASINO later.

You then optimize the parameters using e.g. variance or energy minimization. See the manual (linked at the top left of this page) for how to do this; e.g. 'Introductory guide to wave function opimization' (p. 17), discussion of the correlation.data file (p. 56) and 'Wave function optimization' (p. 148).

There are also various relevant earlier threads on this forum, see e.g. 'Cutoff lengths in the Jastrow factor', 'Varmin and emin energies', 'Difficulties in vmc optimising', 'Strategies in vmc optimization' etc.

Best wishes,
Mike
samaneh
Posts: 9
Joined: Thu Jun 27, 2013 6:22 am

Re: Expansion coefficient

Post by samaneh »

Hi Prof. Towler
I optimized the Jastrow factors (the attached file)
for one of the examples of CASINO (crystal/pw/silicon/222G)
but the results are not the same as the real correlation.data
for this example.
Also I am wondering which of the correlation.out is the main result
since one of them has the minimum energy and the other
minimum variance!!
Would you please explain it.

VE v0.50: Script to extract VMC energies from CASINO output files.
Usage: ve [-kei] [-ti] [-fisq] [-pe] [-vee] [-vei] [-vnl] [-nc]
[-vr] [-rel] [-ct] [-nf <no-figures>] [files]

File: ./out
(energies in au/prim.cell, variances in au)
VMC #1: E = -7.635(4) ; var = 7.2(2) (correlation.out.0)
VMC #2: E = -7.883(1) ; var = 0.93(3) (correlation.out.1)
VMC #3: E = -7.886(1) ; var = 0.93(4) (correlation.out.2)
VMC #4: E = -7.883(1) ; var = 1.02(8) (correlation.out.3)
VMC #5: E = -7.887(1) ; var = 0.97(3) (correlation.out.4)
VMC #6: E = -7.886(1) ; var = 1.1(2) (correlation.out.5)
VMC #7: E = -7.887(1) ; var = 0.96(3) (correlation.out.6)
Total CASINO CPU time ::: 203416.3438 seconds
Attachments
222G-varmin.tar.gz
(178.83 KiB) Downloaded 1100 times
Mike Towler
Posts: 239
Joined: Thu May 30, 2013 11:03 pm
Location: Florence
Contact:

Re: Expansion coefficient

Post by Mike Towler »

Hi Samaneh,

Before I answer, when you say 'the results are not the same as the real correlation.data' - what exactly are the results for the 'real correlation.data' given in the examples?

Best wishes,
Mike
samaneh
Posts: 9
Joined: Thu Jun 27, 2013 6:22 am

Re: Expansion coefficient

Post by samaneh »

Hi Prof Towler,
the results (optimized correlation .out0, 1, 2, ..)
are not the same as the defaulte correlation.data
for this example.
Also I optimized the considered example by minimizing
the energy(emin method, the attached file) but the results are out of orders.
The results are:
VE v0.50: Script to extract VMC energies from CASINO output files.
Usage: ve [-kei] [-ti] [-fisq] [-pe] [-vee] [-vei] [-vnl] [-nc]
[-vr] [-rel] [-ct] [-nf <no-figures>] [files]

File: ./out
(energies in au/prim.cell, variances in au)
VMC #1: E = 93.3(2) ; var = 1599(100) (correlation.out.0)
VMC #2: E = 92.8(2) ; var = 1499(100) (correlation.out.1)
VMC #3: E = 93.0(2) ; var = 1589(90) (correlation.out.2)
VMC #4: E = 92.7(2) ; var = 1499(90) (correlation.out.3)
VMC #5: E = 93.3(3) ; var = 1699(100) (correlation.out.4)
VMC #6: E = 93.3(2) ; var = 1599(100) (correlation.out.5)
VMC #7: E = 93.1(2) ; var = 1599(100) (correlation.out.6)
VMC #8: E = 93.3(2) ; var = 1999(2000) (correlation.out.7)
VMC #9: E = 93.2(2) ; var = 1599(100) (correlation.out.8)
VMC #10: E = 93.0(3) ; var = 1699(100) (correlation.out.9)
VMC #11: E = 93.1(2) ; var = 1599(100) (correlation.out.10)
Total CASINO CPU time ::: 229308.7031 seconds
Attachments
222G-emin.tar.gz
(165.45 KiB) Downloaded 1011 times
Mike Towler
Posts: 239
Joined: Thu May 30, 2013 11:03 pm
Location: Florence
Contact:

Re: Expansion coefficient

Post by Mike Towler »

the results (optimized correlation .out0, 1, 2, ..)
are not the same as the defaulte correlation.data
for this example.
I know that. To repeat the question, what exactly are the results with the default correlation.data that you are comparing with?
i.e. the actual numbers.

Obviously it won't be exactly the same (you will be using a different random number sequence, different number of configs, a version of the code about 10 years later, etc. etc.). Do you mean that it is significantly different, or just not exactly the same numbers?

Mike
samaneh
Posts: 9
Joined: Thu Jun 27, 2013 6:22 am

Re: Expansion coefficient

Post by samaneh »

Hi Prof Towler,
I know about the effect of random numbers and . . . but I mean these results have
different variance and energy minimum !
one of them has minimum variance and the other
has minimum energy. Is this correct? what should we infer from these results?
Mike Towler
Posts: 239
Joined: Thu May 30, 2013 11:03 pm
Location: Florence
Contact:

Re: Expansion coefficient

Post by Mike Towler »

Hi Samaneh,

Sorry - look, I'm just trying to gather all the information I need before I answer your question.

If I understood correctly, your original question was asking why the VMC energy from your varmin-optimized Jastrow differs from the energy obtained with the Jastrow in the examples. You did not tell me what the result was for the examples correlation.data, so I can't usefully comment. And I just checked that this number is not in your attachment. So for the third time, can you tell me what that result is? :)

As for the difference between varmin and emin (a later question) - well the varmin looks more or less like what you expect, the emin just looks like nonsense so there's probably something wrong. When you send me all the information, I'll try to give you an informed comment about why..

Mike
Mike Towler
Posts: 239
Joined: Thu May 30, 2013 11:03 pm
Location: Florence
Contact:

Re: Expansion coefficient

Post by Mike Towler »

Hi Samaneh,

OK, to answer my own question, for a short run with 2000 equilibration steps and 10000 VMC steps, the files in the CASINO examples (which include a Jastrow factor in correlation.data probably optimized about 10 years ago) give:

Total energy (au) = -7.885437252830
Standard error +/- 0.001207947251

Your attempt at doing a variance minimization gives:

VMC #1: E = -7.635(4) ; var = 7.2(2) (correlation.out.0)
VMC #2: E = -7.883(1) ; var = 0.93(3) (correlation.out.1)
VMC #3: E = -7.886(1) ; var = 0.93(4) (correlation.out.2)
VMC #4: E = -7.883(1) ; var = 1.02(8) (correlation.out.3)
VMC #5: E = -7.887(1) ; var = 0.97(3) (correlation.out.4)
VMC #6: E = -7.886(1) ; var = 1.1(2) (correlation.out.5)
VMC #7: E = -7.887(1) ; var = 0.96(3) (correlation.out.6)

which is actually a better answer than that obtained with the Jastrow factor in the examples (lower energy, smaller standard error).

Note the difference between the standard error in the mean - which is the (1) in brackets after the quoted energies (the variance of the mean would be the square of this), and the sample variance (the 'var =' numbers) - this refers to the spread of energies obtained in the 10000 samples we took from the configuration space, and is the thing that you're minimizing (it would be zero if you had the exact wave function).

Now as I said earlier the Jastrow factor in the examples was generated with a much older version of CASINO a long time ago. The optimization was probably done in parallel (you're running in serial), with a different random number sequence, and a different number of configurations. The CASINO varmin algorithm has probably been improved since then, so it is (a) obvious you will get a different answer, and (b) not surprising that you get a better one.

Right, that was your question (1), now for your question (2):

If I run an emin calculation with everything else the same -- as you correctly say -- the VMC config generation gives a different and seemingly silly result:

Total energy (au) = 93.008774804287
Standard error +/- 0.048774568388

So what's different between varmin and emin? Two things:

(1) Note first that having an empty Jastrow factor is not the same as having no Jastrow at all (there is a cusp present even if all the parameters are zero). See the formulae for the various Jastrow terms in section 22 of the manual. In a varmin (vmc_opt) calculation the Jastrow is turned off entirely (equivalent to 'use_jastrow=F' in input) during the first VMC config generation run -- so that the initial HF configurations match the supposed starting wave function. In emin (vmc_opt) by contrast the 'empty Jastrow' with the cusp is used in the first config generation -- equivalent to 'use_jastrow = T' -- since this supposedly makes the energy minimization work better (for technical reasons I won't bore you with).

(2) You don't give a value for the input_keyword opt_fixnl, and the default value of this is different for varmin and emin (T and F, respectively). This has no bearing on the VMC result in the config generation however.

So here the problem appears to be the fact that the 'empty Jastrow factor' makes the VMC config generation give a particularly stupid answer. (You can see this explicitly by running a VMC calculation with Jastrow parameters that are actually set to zero - as opposed to being simply omitted).

Anyway, it's not immediately obvious why the answer should be that silly for this particular case (even though the initial empty Jastrow is obviously very bad). Let me think about it some more tomorrow (I have something else urgent to do now) and I'll see if I can see what the problem is.

Best wishes,
Mike

PS: Some other comments:

(1) I note that your runs were done on only 1 processor core. Is your machine really a serial one? In which case, your QMC career is not going to be much fun. QMC is an expensive technique, and possession of a parallel computer is generally advisable.

(2) You've been doing plane-wave calculations. Just so you know, don't use plane-wave basis sets in general - since they're incredible slow and inefficient in QMC. I suppose we should put fewer PW examples and more blip ones in the examples directory, but we haven't got round to it yet!
samaneh
Posts: 9
Joined: Thu Jun 27, 2013 6:22 am

Re: Expansion coefficient

Post by samaneh »

Dear Prof Tower
Thank you very much.
Post Reply