Tutorial
From QWalkWiki
Contents |
Tutorial
For a basic compile, with no parallel libraries and no special options, just get the source distribution, change directory to src, and type make(or perhaps gmake). On Linux, AIX, IRIX, and some alphas, that should work immediately. If this doesn't work, or you want to compile with the libraries, etc, look at the README file in the qwalk/ directory, which will explain how to modify the makefile(it's pretty easy, don't worry). There may also be some already made makefiles for specific machines, which you can access by typing make PLATFORM=ARCH.
After a few minutes, you should see three new executables in the src/ directory: qwalk-ARCH, and gosling-ARCH, where ARCH is probably 'Linux'. The suffix is so you can do multiple compiles on the same source tree with different options or even on different computers. 'qwalk' is the main number-crunching program that will be eating up your computer time. 'gosling' is a tool that allows you to analyze the log files that 'qwalk' generates.
Now change directory to utils/converter and type make, which will not take too much time, and should produce 'gamess2qmc' and possibly some other files. Fo
r this tutorial, we'll need 'qwalk', 'gosling', and 'gamess2qmc', so put them somewhere in your PATH (like /home/yourname/bin/) under the name
s given here.(ie, do 'cp qwalk-Linux ~/bin/qwalk')
CH4 molecule: conversion
Change to qwalk/examples/ch4. There you should see the results of a GAMESS run: ch4.inp ch4.pun, and ch4.out. Type:
$ gamess2qmc ch4
It will produce several files:
ch4.sys: This holds the 'system' information in QWalk format, which in this case consists of the atomic positions and charges, the fact that our simul ation is being done on a molecule, and the pseudopotentials being used to represent the atoms. These things are held constant throughout the calculation. M ore on this at \ref SystemDoc
ch4.slater: This file encapsulates the main result of a GAMESS calculation, which is the Hartree-Fock solution, AKA 'Slater determinant'. The basis a nd orbital coefficients are encoded in the auxillary files 'ch4.basis' and 'ch4.orb'. These files are generally set up when you do the conversion, and you w on't have to worry about them much, but a good place to start is \ref Slat_wfDoc
ch4.jast2: This is the Jastrow correlation factor that we'll add onto the Slater determinant. More about that at \ref Jastrow2_wfDoc.
CH4: Hartree-Fock wave function
We'll first evaluate the energy of the Hartree-Fock wave function using the variational Monte Carlo technique. Create a new file 'ch4.hf' and enter the following:
method { VMC
nconfig 500 nstep 10 nblock 10
timestep 1.0 storeconfig ch4.config
}
include ch4.sys
trialfunc { include ch4.slater }
now run
$ qwalk ch4.hf
It should take a little while and perhaps print out a few diagnostic lines. There should be two new files now: ch4.hf.log and ch4.hf.o.
The .log file is the computer-readable file and is the most important. All the relevant information for a normal simulation is written here, and the file is not overwritten, only appended to, if you perform the run again. After using QWalk a while, you'll see why this is a good idea.
The .o file is more human-readable, and is considered expendable by the code, so it is overwritten each time you run QWalk on a input file. Go ahead and look at ch4.hf.o. There should be lots of information about the system, like where the atoms are, what type of wave function you used, etc. Near the bottom, after 'Starting VMC', is where the run starts. It prints out the values of the energy, kinetic energy, potential energy and pseudopotential energy (nonlocal energy) on the first line, and the standard deviation of each on the second line. Skipping down to the bottom, we see that the average energy with an error bar is printed out. This should match the GAMESS input within one error bar about 66 percent of the time, and within two error bars about 90 percent of the time. If you want to reduce the error bar, you need to run longer.
Let's try reducing our error bars now. Edit ch4.hf so that it looks like this
method { VMC
nconfig 500 nstep 10 nblock 10
timestep 1.0 storeconfig ch4.config
readconfig ch4.config
}
include ch4.sys
trialfunc { include ch4.slater }
We added the 'readconfig' keyword, which reads the last configurations from our previous runs, and starts the calculation from there. Run
$ qwalk ch4.hf
again, and wait a little bit again. Note that the .o file is overwritten and only contains information from the current run. This is where the .log file is useful. It is appended to, and you can get the information out by using 'gosling'. Run
$ gosling ch4.hf.log
to get the new average and error bars. You can also use gosling to check on the progress of a long run, even as QWalk is running!
Some more input files (fill these in nicely later)
Optimize the correlation factor
method { OPTIMIZE
iterations 30 nconfig 500
eref -7.85
readconfig ch4.config
}
include ch4.sys
trialfunc { SLATER-JASTROW
wf1 { include ch4.slater }
wf2 { include ch4.jast2 }
}
Energy with the optimized correlation factor
method { VMC
nconfig 500 nstep 10 nblock 10
timestep 1.0
readconfig ch4.config
storeconfig ch4.config
}
include ch4.sys
trialfunc { include ch4.opt.wfout }
Diffusion Monte Carlo
method { DMC
nconfig 500 nstep 100 timestep .01
nblock 10
readconfig ch4.config
storeconfig ch4.config
}
include ch4.sys
trialfunc { include ch4.opt.wfout }
Reptation Monte Carlo
method { REPTATION
nblock 10 nstep 50000
timestep .01 length 301
readconfig ch4.config
storeconfig ch4_rmc.config
}
include ch4.sys
trialfunc { include ch4.opt.wfout }
Advanced topics
Improving the accuracy and precision of the calculation

