14.09.2014 Views

CASINO manual - Theory of Condensed Matter

CASINO manual - Theory of Condensed Matter

CASINO manual - Theory of Condensed Matter

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

the energy becomes roughly constant (at around 500 moves in this case). This splits the graph quite<br />

neatly into an equilibration phase and a statistics-accumulation phase. When we average energies to<br />

produce the final energy and error bar, we should only include those moves between 500 and the end<br />

<strong>of</strong> the run. More detailed information about choosing the number <strong>of</strong> moves for equilibration is given<br />

in Sec. 24.3.<br />

To see DMC in action, go to ~/<strong>CASINO</strong>/examples/molecule/h2/RHF/dmc/ and let’s calculate the<br />

DMC energy <strong>of</strong> a hydrogen molecule. The input files should already be set up correctly (though as<br />

before you may need to gunzip the gwfn.data file). We see that an equilibrated VMC run is set to<br />

go for vmc nstep= 1000 moves in order to produce vmc nconfig write= 1000 configurations or<br />

walkers 10 . For DMC equilibration, we run for dmc equil nstep= 2000 moves, and for the statistics<br />

accumulation we run here for dmc stats nstep= 100000 moves (note that unlike vmc nstep, these<br />

are per processor quantities, since in DMC the parallelization is done over configurations, not steps.<br />

Study the definition <strong>of</strong> these keywords carefully in Sec. 7.3). The dmc stats nblock keyword is set<br />

to 5; this does not mean we do 5 blocks <strong>of</strong> 100000 moves each; rather, that we do 100000 moves and we<br />

checkpoint the data (write to output etc.) 5 times over the course <strong>of</strong> that calculation, i.e., every 20000<br />

moves. The dmc target weight parameter is set to 1000.0—the same as vmc nconfig write, but<br />

note that they are allowed to differ. The dtdmc parameter is the DMC time step—note that it is<br />

much smaller than the VMC time step (it needs to be small because the DMC Green’s function is<br />

only exact in the limit that the time step goes to zero). A typical value in a DMC simulation with<br />

all-electron ions might be 0.003, while a typical value in a simulation with pseudopotentials might be<br />

0.02. Note that for accurate work, you need to consider extrapolating your DMC results to zero time<br />

step (see the utility extrapolate tau, described in Sec. 10). Now type runqmc.<br />

When casino has finished running, type reblock in the directory containing the dmc.hist file. reblock<br />

will read these files and then starting asking you questions. How many initial lines <strong>of</strong> data do you<br />

wish to discard? Usually the same as the number <strong>of</strong> lines <strong>of</strong> equilibration data—which is printed<br />

out—though look at the ‘graphdmc’ plot to be sure. Find the move number where the green line in<br />

the plot becomes approximately constant (e.g., 501 in the NiO case). Then, what units do you want<br />

the answer in? Whatever you want. reblock will then show you the correlation-time analysis <strong>of</strong> the<br />

error bar, and start the reblocking analysis, where you need to choose a block length. Choose a value<br />

where the ‘Std err <strong>of</strong> mean’ column starts to plateau (again, the plot reblock utility can help you<br />

visualize this). A value in the thousands might be typical; the value increases as you reduce the time<br />

step. reblock will then print out the final DMC energies and error bars, together with an analysis <strong>of</strong><br />

the population fluctuations, effective time steps and acceptance ratios.<br />

In the case <strong>of</strong> molecular hydrogen, for my short 5-minute run the final energy is −1.174322 ±<br />

0.00018 a.u. The exact energy is −1.1744757 a.u., which is within our reblocked error bar, so this<br />

result is pretty good without paying particular attention to getting it absolutely right—this is due to<br />

the system being exactly solvable in DMC due to the lack <strong>of</strong> nodes in the wave function.<br />

6.5 How to perform QMC calculations for periodic systems<br />

Suppose you wish to use QMC to study condensed matter rather than isolated atoms or molecules.<br />

For example, you might be interested in the bulk properties <strong>of</strong> a crystalline solid. Obviously, in a<br />

QMC simulation you can only study a small ‘simulation cell’ <strong>of</strong> such a crystal. Hopefully this cell will<br />

be sufficiently large that you are able to obtain the bulk properties <strong>of</strong> the material. Fortunately the<br />

boundary conditions on the simulation cell can be chosen to maximise the rate <strong>of</strong> convergence <strong>of</strong> the<br />

bulk properties with respect to the size <strong>of</strong> the cell. Periodic boundary conditions are a highly efficient<br />

and convenient choice, and are ubiquitous in computational studies <strong>of</strong> condensed matter.<br />

According to Bloch’s theorem, single-particle orbitals in a periodic crystal can be written as ψ k (r) =<br />

u k (r) exp(ik · r), where u k (r) has the periodicity <strong>of</strong> the primitive cell and k lies in the first Brillouin<br />

zone <strong>of</strong> the primitive cell. The allowed Bloch vectors k are determined by the boundary conditions on<br />

the simulation supercell. Under periodic boundary conditions the allowed k are the reciprocal lattice<br />

points <strong>of</strong> the supercell. Under so-called twisted boundary conditions the allowed k are the reciprocal<br />

10 What is a typical number <strong>of</strong> DMC walkers? We usually say ‘around 1000’. Of course this is a bit like the length <strong>of</strong> a<br />

piece <strong>of</strong> string. Nevertheless, for most systems with most wave functions on most computers it ensures that populationcontrol<br />

bias—see later—is completely negligible, but still lets you gather data for a sufficiently long period in imaginary<br />

time that you can see a plateau on your reblock.plot without heroic computational effort. If one has to give a single<br />

number for the target weight, clearly 1000 configurations is as sensible a suggestion as any. Obviously if you want to<br />

run on 20000 cores or whatever then you need a larger number <strong>of</strong> configurations.<br />

23

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!