!=======================================================!
!                 Diffusion Monte Carlo                 !
!                 Bowman Group @ Emory                  !
!=======================================================!

This program was originally written by Yimin Wang. It can
be used to calculate the vibrational zero-point energy 
nuclear wavefunction of molecules. It can also be an
efficient approach to detect holes in potential energy
surfaces.

1. Algorithm
This program uses the unbiased algorithm described in the
paper [Kosztin, I.; Faber, B.; Schulten, K.; Am. J. Phys.
1996, 64, 633-644]

2. Code
In order to run this program, a potential energy surface
(PES) must be supplied by the users. Here a simple PES of
CH4 is provided as an example. This PES is a PIP fit to
energies and gradients of 4500 configurations. See [Nandi,
A.; Qu, C.; Bowman, J. M.; J. Chem. Theory Comput. 2019,
15, 2826-2835]. Parameters of the PES (i.e., linear coefs)
are stored in file coeff-ch4.dat. This coefs file and the
executable must be in the same directory, unless the users
modify the pes_shell.f90 and specify a different location
in pes_init()

All the codes are in the folder "src":
(0) The global.f90 defines frequently used parameters,
such as mass of different atoms, conversion coefficient
between Angstrom and Bohr, etc.

(1) bemsa.f90, dbemsa.f90, and pes_shell.f90 are codes
for the CH4 PES. Important subroutines/functions are
pes_init() and f(x). pes_init() initializes the PES, that
is, reads in the coefs. f(x) is the function to compute
the potential energy; the input x is a 1D array of size
3*natom, which is the Cartesian coordinates of all the
atoms in bohr. The input must be in order H H H H C; due
to permutational invariance, all H atoms can be permuted.

(2) dmc_proc.f90 and dmc.f90 are code for DMC.

3. Input and output files for DMC:

An example input file, ch4.inp, is given. CSTEP is
number of steps for equilibration. After CSTEP, the
reference energies are used to compute the ZPE. Alpha
is a feedback parameter that controls the fluctuation
in the number of walkers and the reference energy; it
is usually inversely proportional to the step size. The
minimum geometry is the equilibrium geometry of the
molecule, and the reference geometry is the geometry
where the DMC calculation starts. Usually the minimum
geometry could be used as the reference geometry, but
others could be the reference geometry, too, as long
as it has suffient overlap with the ground-state
nuclear wavefunction.

For rigorous calculations of ZPE and wavefunction,
typically ~10^4 walkers and ~10^4 steps are needed.

A couple of files are generated during the DMC
calculation.
(1) *.log: this is just a file that summarizes the
calculation and the results
(2) *.ref: number of walkers and the reference energy
at each step of the calculation
(3) err.xyz: records the "holes" encountered in the
calculation. This file can be huge (tens of gigabytes)
if the PES is newly developed without thorough test
for holes. So in this case, using hundreds of walkers
and steps intially and then gradually increasing the
numbers is recommended.
(4) last.xyz: coordinates of walkers at the end of the
calculation. These can be used to obtain the nuclear
wavefunction.

4. Running the program
./dmc.x ch4.inp

If this is run on a cluster, submission the job to a
node is recommend, as the calculation is usually
computationally demanding (need to evaluate the
potential energy nwalker*nstep times)

5. Contact
If you have any questions about this program, feel
free to contact Chen Qu (szquchen@gmail.com, or
cqu3@emory.edu).
