Trace files - QWalk/mainline GitHub Wiki
Introduction
(this feature is supported for versions after 0.97.3)
In diffusion Monte Carlo (DMC), the many-body wave function is represented by a collection of walkers. The SAVE_TRACE directive instructs QWalk to save the position and weights of all the walkers each block. This file allows DMC expectation values to be taken after the simulation has completed.
Example
Refer to the CH4 example from the tutorial. Run DMC as follows:
method { DMC timestep .02 save_trace ch4.trace }
include ch4.sys
trialfunc { include ch4.opt.wfout }
The walker configurations will be saved to ch4.trace. This is a binary file, so you cannot see much in it. Once the DMC calculation is done, we can now obtain mixed estimators of non-energy properties. This is done using the POSTPROCESS tool. Put the following in ch4.dipole:
method { POSTPROCESS nskip 4096
readconfig ch4.trace
average { dipole }
}
include ch4.sys
trialfunc { include ch4.opt.wfout }
Since QWalk by default uses 2048 walkers in DMC, NSKIP 4096 skips the first 4096 records in the trace file, assuming that they are warmup configurations. average { dipole } will create a new Average_generator object that will evaluate the electric dipole moment. Any Average_generator or density object can be used in its place.
Common problems (and solutions)
Endian-ness
Since the trace file is in binary, some computers may not be able to read files created on other machines. For that reason, we have provided a utility, swap_endian, which switches between big and little endian. Most major operating systems, including Linux, Mac, and Windows, are little endian. Big endian computers include Blue Gene.
File corruption
If QWalk is interrupted while writing the trace file, corruption can occur. There is some limited amount of error correction based on checksums that can protect against bit flips and a file that was interrupted.