CASINO manual - Theory of Condensed Matter
CASINO manual - Theory of Condensed Matter
CASINO manual - Theory of Condensed Matter
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
ENVMC v0.60: Script to extract VMC energies from <strong>CASINO</strong> output files.<br />
Usage: envmc [-kei] [-ti] [-fisq] [-pe] [-vee] [-vei] [-vnl] [-nc]<br />
[-vr] [-rel] [-ct] [-nf ] [files]<br />
File: ./out<br />
(energies in au, variances in au)<br />
E = -0.49999(4) ; var = 0.000083(4)<br />
Total <strong>CASINO</strong> CPU time ::: 3.3700 seconds<br />
If any warnings are present in the output file, then envmc will print them out, but there shouldn’t be<br />
in this case. Note that, because <strong>of</strong> the stochastic nature <strong>of</strong> the method, the energy has an associated<br />
error bar (users <strong>of</strong> DFT, etc., may find this disconcerting!). The true HF energy <strong>of</strong> the hydrogen atom<br />
is exactly −0.5 a.u., so we have seemingly correctly performed our first VMC calculation!<br />
A point about parallel machines: if you try to run this calculation on your machine then you may<br />
get a slightly different answer. The numbers above were obtained on a single processing core; if your<br />
computer has more than one core (these days, most new machines do) and your <strong>CASINO</strong> ARCH is a<br />
parallel one, then the runqmc script will automatically detect the number <strong>of</strong> cores on your machine<br />
and run casino in parallel using that number. If you wish to reproduce the single-core result, you<br />
may use runqmc -p 1.<br />
For example, my (=MDT) personal machine has dual hex-core processors (i.e., 12 cores in total),<br />
though if I interrogate it using a command like<br />
cat /proc/cpuinfo 2> /dev/null | grep -cE "ˆprocessor"<br />
it thinks it has 24. This is because these are Intel chips with hyperthreading enabled, i.e., for each<br />
processor core that is physically present, the operating system addresses two virtual processors, and<br />
shares the workload between them when possible. This is not really useful for casino, so by default<br />
runqmc will ignore this, hence we have 12 cores.<br />
So if I execute runqmc then I get the following 12-core result:<br />
ENVMC v0.60: Script to extract VMC energies from <strong>CASINO</strong> output files.<br />
Usage: envmc [-kei] [-ti] [-fisq] [-pe] [-vee] [-vei] [-vnl] [-nc]<br />
[-vr] [-rel] [-ct] [-nf ] [files]<br />
File: ./out<br />
(energies in au, variances in au)<br />
E = -0.50000(4) ; var = 0.000088(7)<br />
Total <strong>CASINO</strong> CPU time ::: 0.4309 seconds<br />
Note the behaviour here. The second run is a lot faster but gives roughly the same error bar as the<br />
first one. This is because vmc nstep gives the total number <strong>of</strong> configuration space samples—in this<br />
case 100,000—not (as was the case with early versions <strong>of</strong> casino using the old nmove keyword) the<br />
number <strong>of</strong> samples done by each core. Giving the total number is better since it means that the input<br />
files are then independent <strong>of</strong> the number <strong>of</strong> processors on which the job is run. With 12 cores, the<br />
100000 samples to be taken will be divided by 12 (to give 8333.333). Because this is not an integer,<br />
this number is rounded up to 8334, and so 8334×12=100008 samples will actually be done in total.<br />
Because each processor is doing less work, the calculation as a whole is much faster (not exactly 12<br />
times faster because the setup is a significant fraction <strong>of</strong> such a short calculation). The answer will<br />
be different, however, because 12 short random walks initialized with different random number seeds<br />
sample the space differently to 1 long random walk.<br />
Next, look in the out file. We see a complete report <strong>of</strong> the calculation and at the end we see the total<br />
energy and its components. Just before the total energy, we see the ‘acceptance ratio’ which should<br />
be around 50% (the acceptance ratio depends on the VMC time step, and we have set opt dtvmc to<br />
1 to automagically adjust the time step so that the acceptance ratio <strong>of</strong> 50% is achieved). 2 .<br />
Next, look at the file vmc.hist (see Sec. 7.10). This contains mainly energy data produced at each<br />
step <strong>of</strong> the random walk (you can average over successive steps using the vmc ave period keyword<br />
2 If the time step is small then the electrons only attempt to move very short distances at each step <strong>of</strong> the random<br />
walk. Although the acceptance ratio is therefore high, the electrons are likely to bumble about in one corner <strong>of</strong> the<br />
configuration space, and serial correlation is likely to be significant. If the time step is large then the electrons attempt<br />
very large jumps—which are likely to be to regions <strong>of</strong> lower probability—and are thus likely to be rejected by the<br />
Metropolis algorithm. Hence the electrons don’t move very much, and the serial correlation is again large. This is the<br />
reason why an acceptance ratio <strong>of</strong> 50% usually implies nearly optimal sampling efficiency.<br />
15