<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wikis.ch.cam.ac.uk/thom/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sc2018</id>
	<title>Thom Group Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wikis.ch.cam.ac.uk/thom/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sc2018"/>
	<link rel="alternate" type="text/html" href="https://wikis.ch.cam.ac.uk/thom/wiki/index.php/Special:Contributions/Sc2018"/>
	<updated>2026-06-10T16:34:03Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.7</generator>
	<entry>
		<id>https://wikis.ch.cam.ac.uk/thom/wiki/index.php?title=SimpleDMC&amp;diff=175</id>
		<title>SimpleDMC</title>
		<link rel="alternate" type="text/html" href="https://wikis.ch.cam.ac.uk/thom/wiki/index.php?title=SimpleDMC&amp;diff=175"/>
		<updated>2017-04-18T15:47:19Z</updated>

		<summary type="html">&lt;p&gt;Sc2018: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Theory =&lt;br /&gt;
&lt;br /&gt;
= Compilation of SimpleDMC =&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== The Hydrogen Atom ==&lt;br /&gt;
&lt;br /&gt;
=== Gaussian ===&lt;br /&gt;
Let&#039;s begin by generating a trial wavefunction with Gaussian03. To start with, we need to define an atomic orbital basis, then tell Gaussian03 to use it in conjunction with some &#039;&#039;ab initio&#039;&#039; method. We&#039;ll use the STO-6G basis set, where 6 Gaussian primitives are used to represent an atomic orbital. We&#039;ll create an input file for Gaussian03, called H.com,&lt;br /&gt;
&lt;br /&gt;
   $ cat -n H.com&lt;br /&gt;
      1   %chk=H.chk&lt;br /&gt;
      2   #p UHF/STO-6G 6d 10f SCF Test IOP(3/24=10) IOP(3/81=1) Pop=Full&lt;br /&gt;
      3   &lt;br /&gt;
      4   Hydrogen Atom - UHF STO-6G&lt;br /&gt;
      5&lt;br /&gt;
      6   0 2&lt;br /&gt;
      7   H   0.000   0.000   0.000&lt;br /&gt;
      8&lt;br /&gt;
&lt;br /&gt;
This may seem cryptic for the moment, but each line (and entry therein) is necessary. Line 1 tells Gaussian03 to put some output in an encrypted file called H.chk. Line 2 is the ``route section&amp;quot;: The IOP arguments are &#039;&#039;internal options&#039;&#039;, and tell Gaussian03 to spit out data in a certain format. Line 4 contains a title section, and must be included, as must the sandwiching blank lines. Line 6 specifies the charge and multiplicity (number of unpaired electrons + 1). Finally, on line 7, we specify the molecular configuration; atom types and Cartesian position vectors of the constituent atoms are enumerated here.&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s run Gaussian03,&lt;br /&gt;
&lt;br /&gt;
   $ g03 H.com&lt;br /&gt;
&lt;br /&gt;
No return value is normally a good sign- you&#039;ll typically be greeted with an (unhelpful) SEGFAULT of some kind if the calculation was unsuccessful. It&#039;s also worth explicitly checking for errors, since Gaussian is also able to die silently&lt;br /&gt;
&lt;br /&gt;
   $ grep &amp;quot;Error&amp;quot; H.log&lt;br /&gt;
&lt;br /&gt;
Gaussian03 writes to two files- H.log and H.chk; the contents of the former are obvious while we&#039;ve already briefly discussed the contents of the latter. In the output, all we care about is the energy, so invoke&lt;br /&gt;
&lt;br /&gt;
   $ grep -n &amp;quot;SCF Done&amp;quot; H.log&lt;br /&gt;
   219: SCF Done:  E(UHF) = -0.471039054196     A.U. after     1 cycles&lt;br /&gt;
&lt;br /&gt;
This is a rather poor value relative to the analytical -0.5 Hartrees, but at least we have something to improve upon. We must now do some conversions to extract information from the checkpoint file&lt;br /&gt;
&lt;br /&gt;
   $ formchk H.chk H.fchk&lt;br /&gt;
   Read checkpoint file H.chk&lt;br /&gt;
   Write formatted file H.fchk&lt;br /&gt;
   Rotating derivatives, DoTrsp=T IDiff= 1 LEDeriv=    197 LFDPrp=       0 LDFDPr=       0.&lt;br /&gt;
&lt;br /&gt;
formchk is a Gaussian utility that converts the unreadable H.chk to a formatted checkpoint file, H.fchk. Since this formatted file is more amenable to parsing, it can be used by a number of visualisation/ post-Gaussian tools.&lt;br /&gt;
&lt;br /&gt;
=== qWalk ===&lt;br /&gt;
qWalk is a piece of software we can benchmark the simpleDMC software against, possessing both variational&lt;br /&gt;
and diffusion Monte Carlo (VMC and DMC, respectively) functionalities. The simpleDMC software also uses &lt;br /&gt;
the same input file formats as qWalk, and so we are able to use their file conversion tools to extract data &lt;br /&gt;
from a host of &#039;&#039;ab initio&#039;&#039; software suites.&lt;br /&gt;
&lt;br /&gt;
First, we parse the H.fchk file into a number of qWalk input files:&lt;br /&gt;
&lt;br /&gt;
   $ ./g032qmc -log H.log -fchk H.fchk &lt;br /&gt;
   --- read fchk file ---&lt;br /&gt;
   Number of atoms: 1&lt;br /&gt;
   Number of basis functions: 1&lt;br /&gt;
   Number of independant functions: 1&lt;br /&gt;
   Multiplicity: 2&lt;br /&gt;
   Number of alpha electrons: 1&lt;br /&gt;
   Number of beta electrons: 0&lt;br /&gt;
   Total Energy: -0.471039054195684&lt;br /&gt;
   Pure/Cartesian d shells: 6D&lt;br /&gt;
   Pure/Cartesian f shells: 10F&lt;br /&gt;
   found beta component, scftpe=UHF&lt;br /&gt;
   --- read log file ---&lt;br /&gt;
   basis set is from &#039;AO basis set&#039; section&lt;br /&gt;
   --- have read files ---&lt;br /&gt;
   norb=1&lt;br /&gt;
   spin up end size=1&lt;br /&gt;
   moCoeff total size=2&lt;br /&gt;
   writing qwalk input files ... &lt;br /&gt;
   writing orb file.  This could take a few seconds.&lt;br /&gt;
   output: sample.orb&lt;br /&gt;
   output: sample.basis&lt;br /&gt;
   output: sample.slater&lt;br /&gt;
   output: sample.jast2&lt;br /&gt;
   output: sample.sys&lt;br /&gt;
   output: sample.hf&lt;br /&gt;
   output: sample.opt&lt;br /&gt;
   Done&lt;br /&gt;
    &lt;br /&gt;
   Warning: Now the basisset must be the same for the same specie of atoms&lt;br /&gt;
&lt;br /&gt;
We&#039;ll try to reproduce the UHF results by use of VMC with qWalk. Let&#039;s have a look at sample.hf:&lt;br /&gt;
&lt;br /&gt;
   $ cat sample.hf&lt;br /&gt;
   METHOD { VMC nconfig 1000 } &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
   INCLUDE sample.sys  &lt;br /&gt;
   TRIALFUNC { INCLUDE sample.slater}&lt;br /&gt;
&lt;br /&gt;
Note that we have added &amp;quot;nconfig 1000&amp;quot;, which gives us control over how many walkers are to be used&lt;br /&gt;
for the VMC. sample.sys contains the system configuration (number of electrons with a given spin, &lt;br /&gt;
atomic coordinates, etc.), while sample.slater contains the orbital information for the Slater&lt;br /&gt;
determinant (in conjunction with sample.orb and sample.basis). This Slater determinant will be used&lt;br /&gt;
to sample the trial wavefunction created by g03. We now run qWalk:&lt;br /&gt;
&lt;br /&gt;
   $ ./qwalk sample.hf&lt;br /&gt;
   output to sample.hf.o&lt;br /&gt;
   System&lt;br /&gt;
   Wave function&lt;br /&gt;
   Pseudopotential&lt;br /&gt;
   Could not open sample.hf.config. Generating configurations from scratch&lt;br /&gt;
  &lt;br /&gt;
and upon completion, are left with three files,&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|sample.hf.o&lt;br /&gt;
|Information about the run.&lt;br /&gt;
|-&lt;br /&gt;
|sample.hf.log&lt;br /&gt;
|Log for statistical analysis.&lt;br /&gt;
|-&lt;br /&gt;
|sample.hf.config&lt;br /&gt;
|Checkfile for the run.&lt;br /&gt;
|}   &lt;br /&gt;
&lt;br /&gt;
We can extract averages from the VMC by invoking&lt;br /&gt;
&lt;br /&gt;
   $ ./gosling sample.hf.log      &lt;br /&gt;
   #####################&lt;br /&gt;
   vmc:  100 total blocks reblocked into 100&lt;br /&gt;
   #####################&lt;br /&gt;
   Threw out the first 0 blocks in the averaging.&lt;br /&gt;
   total_energy0        -0.4702684082 +/-  0.000922386677 (sigma     0.425114576 ) &lt;br /&gt;
   kinetic0              0.7706545412 +/-  0.003605881864 (sigma     1.448514687 ) &lt;br /&gt;
   potential0            -1.240922949 +/-  0.003148015019 (sigma      1.21325133 ) &lt;br /&gt;
   nonlocal0                        0 +/-               0 (sigma               0 ) &lt;br /&gt;
   weight0                          1 +/- 6.661338148e-17 (sigma               0 ) &lt;br /&gt;
   &lt;br /&gt;
   --------Properties differences-------------&lt;br /&gt;
   approximate number of independent points: 212415.3753&lt;br /&gt;
&lt;br /&gt;
We see that the VMC estimate of the energy of the trial wavefunction (-0.470(2)) matches&lt;br /&gt;
relatively well with the UHF energy (-0.471039054195684). We have also obtained the&lt;br /&gt;
sample.hf.config file, containing the distribution of walkers sampling the&lt;br /&gt;
trial wavefunction.&lt;br /&gt;
&lt;br /&gt;
   $ head -8 sample.hf.config&lt;br /&gt;
   walker { &lt;br /&gt;
   nElec 1 ndim 3&lt;br /&gt;
   -0.731706383078456 0.620589802605041 -0.092157439050284 &lt;br /&gt;
   } &lt;br /&gt;
   walker { &lt;br /&gt;
   nElec 1 ndim 3&lt;br /&gt;
   0.366970593352899 0.216757302067973 -0.48313699793852 &lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
=== simpleDMC ===&lt;br /&gt;
&lt;br /&gt;
We can use this distribution of walkers as a starting point for our DMC calculations with&lt;br /&gt;
simpleDMC. We require an input file to run simpleDMC, sample.simple:&lt;br /&gt;
&lt;br /&gt;
   $ cat sample.simple&lt;br /&gt;
   simple { &lt;br /&gt;
      nWalkers             1000     # Number of walkers&lt;br /&gt;
      nSteps              10000     # Maximum number of steps&lt;br /&gt;
      dTau                0.001     # Timestep&lt;br /&gt;
      dETrial              -0.5     # Trial energy should start (&amp;gt; FCI energy but close to it)&lt;br /&gt;
      dWeightInit           1.0     # Initial weight&lt;br /&gt;
      bConstWalkerNum     false     # Are we enforcing a constant number of walkers? (Currently not working)&lt;br /&gt;
      nWalkersSpace       20480	    # Walker growth space (Maximum number of walkers permitted)&lt;br /&gt;
      dWeightTarget     10000.0     # Total weight above which we undertake population control&lt;br /&gt;
      dWeightMin         1500.0     # Total weight below which we undertake population control&lt;br /&gt;
      dLowThresh            1.0     # If walker has weight below this, try to either kill or recombine it&lt;br /&gt;
      dWeightBranch         1.5     # If walker has weight above this, we branch the walker&lt;br /&gt;
      nShiftSteps             1     # Vary the shift every nShiftSteps steps.&lt;br /&gt;
      dShiftDamp            1.0     # Larger shift damping is more radical damping&lt;br /&gt;
      dOldWeight            0.0     # The total weight at the previous cycle for calculating the shift&lt;br /&gt;
      bUpdateShift        false     # Are we updating the shift every nShiftSteps cycles?&lt;br /&gt;
   }&lt;br /&gt;
                                                             &lt;br /&gt;
simpleDMC reuses the input files of qWalk, and can be invoked by listing the files as command line &lt;br /&gt;
arguments (in any order)&lt;br /&gt;
   &lt;br /&gt;
   $ ./simpleDMC.x sample.{sys,slater,orb,basis,simple,hf.config,hf.log} &amp;gt;&amp;gt; sample.log&lt;br /&gt;
&lt;br /&gt;
We pass all of the output to sample.log since the majority of information concerning the simulation is&lt;br /&gt;
streamed straight to STDOUT. We are primarily concerned with the final nSteps lines, since these give&lt;br /&gt;
the various energetic quantities associated with the system of walkers at each timestep. In fact, with&lt;br /&gt;
a little foresight, the fifth column corresponds to the total energy averaged over all walkers at that&lt;br /&gt;
timestep. Averaging over this column, we obtain the DMC energy:&lt;br /&gt;
&lt;br /&gt;
   $ export nsteps=10000&lt;br /&gt;
   $ tail -n $nsteps sample.log | awk &#039;{ sum += $5; n++ } END { if (n &amp;gt; 0) print sum / n; }&#039;&lt;br /&gt;
   -0.498772&lt;br /&gt;
&lt;br /&gt;
This quantity is in very good agreement with the exact energy of -0.5 Hartrees.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{\epsilon}{2} \sum_{i&amp;lt;j} \left[ \left(\frac{r_{ij}}{\sigma}\right)^2+\left(\frac{\sigma}{r_{ij}}\right)^2 \right]&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sc2018</name></author>
	</entry>
	<entry>
		<id>https://wikis.ch.cam.ac.uk/thom/wiki/index.php?title=SimpleDMC&amp;diff=161</id>
		<title>SimpleDMC</title>
		<link rel="alternate" type="text/html" href="https://wikis.ch.cam.ac.uk/thom/wiki/index.php?title=SimpleDMC&amp;diff=161"/>
		<updated>2016-11-22T01:17:46Z</updated>

		<summary type="html">&lt;p&gt;Sc2018: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Theory =&lt;br /&gt;
&lt;br /&gt;
= Compilation of SimpleDMC =&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&lt;br /&gt;
== The Hydrogen Atom ==&lt;br /&gt;
&lt;br /&gt;
=== Gaussian ===&lt;br /&gt;
Let&#039;s begin by generating a trial wavefunction with Gaussian03. To start with, we need to define an atomic orbital basis, then tell Gaussian03 to use it in conjunction with some &#039;&#039;ab initio&#039;&#039; method. We&#039;ll use the STO-6G basis set, where 6 Gaussian primitives are used to represent an atomic orbital. We&#039;ll create an input file for Gaussian03, called H.com,&lt;br /&gt;
&lt;br /&gt;
   $ cat -n H.com&lt;br /&gt;
      1   %chk=H.chk&lt;br /&gt;
      2   #p UHF/STO-6G 6d 10f SCF Test IOP(3/24=10) IOP(3/81=1) Pop=Full&lt;br /&gt;
      3   &lt;br /&gt;
      4   Hydrogen Atom - UHF STO-6G&lt;br /&gt;
      5&lt;br /&gt;
      6   0 2&lt;br /&gt;
      7   H   0.000   0.000   0.000&lt;br /&gt;
      8&lt;br /&gt;
&lt;br /&gt;
This may seem cryptic for the moment, but each line (and entry therein) is necessary. Line 1 tells Gaussian03 to put some output in an encrypted file called H.chk. Line 2 is the ``route section&amp;quot;: The IOP arguments are &#039;&#039;internal options&#039;&#039;, and tell Gaussian03 to spit out data in a certain format. Line 4 contains a title section, and must be included, as must the sandwiching blank lines. Line 6 specifies the charge and multiplicity (number of unpaired electrons + 1). Finally, on line 7, we specify the molecular configuration; atom types and Cartesian position vectors of the constituent atoms are enumerated here.&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s run Gaussian03,&lt;br /&gt;
&lt;br /&gt;
   $ g03 H.com&lt;br /&gt;
&lt;br /&gt;
No return value is normally a good sign- you&#039;ll typically be greeted with an (unhelpful) SEGFAULT of some kind if the calculation was unsuccessful. It&#039;s also worth explicitly checking for errors, since Gaussian is also able to die silently&lt;br /&gt;
&lt;br /&gt;
   $ grep &amp;quot;Error&amp;quot; H.log&lt;br /&gt;
&lt;br /&gt;
Gaussian03 writes to two files- H.log and H.chk; the contents of the former are obvious while we&#039;ve already briefly discussed the contents of the latter. In the output, all we care about is the energy, so invoke&lt;br /&gt;
&lt;br /&gt;
   $ grep -n &amp;quot;SCF Done&amp;quot; H.log&lt;br /&gt;
   219: SCF Done:  E(UHF) = -0.471039054196     A.U. after     1 cycles&lt;br /&gt;
&lt;br /&gt;
This is a rather poor value relative to the analytical -0.5 Hartrees, but at least we have something to improve upon. We must now do some conversions to extract information from the checkpoint file&lt;br /&gt;
&lt;br /&gt;
   $ formchk H.chk H.fchk&lt;br /&gt;
   Read checkpoint file H.chk&lt;br /&gt;
   Write formatted file H.fchk&lt;br /&gt;
   Rotating derivatives, DoTrsp=T IDiff= 1 LEDeriv=    197 LFDPrp=       0 LDFDPr=       0.&lt;br /&gt;
&lt;br /&gt;
formchk is a Gaussian utility that converts the unreadable H.chk to a formatted checkpoint file, H.fchk. Since this formatted file is more amenable to parsing, it can be used by a number of visualisation/ post-Gaussian tools.&lt;br /&gt;
&lt;br /&gt;
=== qWalk ===&lt;br /&gt;
qWalk is a piece of software we can benchmark the simpleDMC software against, possessing both variational&lt;br /&gt;
and diffusion Monte Carlo (VMC and DMC, respectively) functionalities. The simpleDMC software also uses &lt;br /&gt;
the same input file formats as qWalk, and so we are able to use their file conversion tools to extract data &lt;br /&gt;
from a host of &#039;&#039;ab initio&#039;&#039; software suites.&lt;br /&gt;
&lt;br /&gt;
First, we parse the H.fchk file into a number of qWalk input files:&lt;br /&gt;
&lt;br /&gt;
   $ ./g032qmc -log H.log -fchk H.fchk &lt;br /&gt;
   --- read fchk file ---&lt;br /&gt;
   Number of atoms: 1&lt;br /&gt;
   Number of basis functions: 1&lt;br /&gt;
   Number of independant functions: 1&lt;br /&gt;
   Multiplicity: 2&lt;br /&gt;
   Number of alpha electrons: 1&lt;br /&gt;
   Number of beta electrons: 0&lt;br /&gt;
   Total Energy: -0.471039054195684&lt;br /&gt;
   Pure/Cartesian d shells: 6D&lt;br /&gt;
   Pure/Cartesian f shells: 10F&lt;br /&gt;
   found beta component, scftpe=UHF&lt;br /&gt;
   --- read log file ---&lt;br /&gt;
   basis set is from &#039;AO basis set&#039; section&lt;br /&gt;
   --- have read files ---&lt;br /&gt;
   norb=1&lt;br /&gt;
   spin up end size=1&lt;br /&gt;
   moCoeff total size=2&lt;br /&gt;
   writing qwalk input files ... &lt;br /&gt;
   writing orb file.  This could take a few seconds.&lt;br /&gt;
   output: sample.orb&lt;br /&gt;
   output: sample.basis&lt;br /&gt;
   output: sample.slater&lt;br /&gt;
   output: sample.jast2&lt;br /&gt;
   output: sample.sys&lt;br /&gt;
   output: sample.hf&lt;br /&gt;
   output: sample.opt&lt;br /&gt;
   Done&lt;br /&gt;
    &lt;br /&gt;
   Warning: Now the basisset must be the same for the same specie of atoms&lt;br /&gt;
&lt;br /&gt;
We&#039;ll try to reproduce the UHF results by use of VMC with qWalk. Let&#039;s have a look at sample.hf:&lt;br /&gt;
&lt;br /&gt;
   $ cat sample.hf&lt;br /&gt;
   METHOD { VMC nconfig 1000 } &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
   INCLUDE sample.sys  &lt;br /&gt;
   TRIALFUNC { INCLUDE sample.slater}&lt;br /&gt;
&lt;br /&gt;
Note that we have added &amp;quot;nconfig 1000&amp;quot;, which gives us control over how many walkers are to be used&lt;br /&gt;
for the VMC. sample.sys contains the system configuration (number of electrons with a given spin, &lt;br /&gt;
atomic coordinates, etc.), while sample.slater contains the orbital information for the Slater&lt;br /&gt;
determinant (in conjunction with sample.orb and sample.basis). This Slater determinant will be used&lt;br /&gt;
to sample the trial wavefunction created by g03. We now run qWalk:&lt;br /&gt;
&lt;br /&gt;
   $ ./qwalk sample.hf&lt;br /&gt;
   output to sample.hf.o&lt;br /&gt;
   System&lt;br /&gt;
   Wave function&lt;br /&gt;
   Pseudopotential&lt;br /&gt;
   Could not open sample.hf.config. Generating configurations from scratch&lt;br /&gt;
  &lt;br /&gt;
and upon completion, are left with three files,&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|sample.hf.o&lt;br /&gt;
|Information about the run.&lt;br /&gt;
|-&lt;br /&gt;
|sample.hf.log&lt;br /&gt;
|Log for statistical analysis.&lt;br /&gt;
|-&lt;br /&gt;
|sample.hf.config&lt;br /&gt;
|Checkfile for the run.&lt;br /&gt;
|}   &lt;br /&gt;
&lt;br /&gt;
We can extract averages from the VMC by invoking&lt;br /&gt;
&lt;br /&gt;
   $ ./gosling sample.hf.log      &lt;br /&gt;
   #####################&lt;br /&gt;
   vmc:  100 total blocks reblocked into 100&lt;br /&gt;
   #####################&lt;br /&gt;
   Threw out the first 0 blocks in the averaging.&lt;br /&gt;
   total_energy0        -0.4702684082 +/-  0.000922386677 (sigma     0.425114576 ) &lt;br /&gt;
   kinetic0              0.7706545412 +/-  0.003605881864 (sigma     1.448514687 ) &lt;br /&gt;
   potential0            -1.240922949 +/-  0.003148015019 (sigma      1.21325133 ) &lt;br /&gt;
   nonlocal0                        0 +/-               0 (sigma               0 ) &lt;br /&gt;
   weight0                          1 +/- 6.661338148e-17 (sigma               0 ) &lt;br /&gt;
   &lt;br /&gt;
   --------Properties differences-------------&lt;br /&gt;
   approximate number of independent points: 212415.3753&lt;br /&gt;
&lt;br /&gt;
We see that the VMC estimate of the energy of the trial wavefunction (-0.470(2)) matches&lt;br /&gt;
relatively well with the UHF energy (-0.471039054195684). We have also obtained the&lt;br /&gt;
sample.hf.config file, containing the distribution of walkers sampling the&lt;br /&gt;
trial wavefunction.&lt;br /&gt;
&lt;br /&gt;
   $ head -8 sample.hf.config&lt;br /&gt;
   walker { &lt;br /&gt;
   nElec 1 ndim 3&lt;br /&gt;
   -0.731706383078456 0.620589802605041 -0.092157439050284 &lt;br /&gt;
   } &lt;br /&gt;
   walker { &lt;br /&gt;
   nElec 1 ndim 3&lt;br /&gt;
   0.366970593352899 0.216757302067973 -0.48313699793852 &lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
=== simpleDMC ===&lt;br /&gt;
&lt;br /&gt;
We can use this distribution of walkers as a starting point for our DMC calculations with&lt;br /&gt;
simpleDMC. We require an input file to run simpleDMC, sample.simple:&lt;br /&gt;
&lt;br /&gt;
   $ cat sample.simple&lt;br /&gt;
   simple { &lt;br /&gt;
      nWalkers             1000     # Number of walkers&lt;br /&gt;
      nSteps              10000     # Maximum number of steps&lt;br /&gt;
      dTau                0.001     # Timestep&lt;br /&gt;
      dETrial              -0.5     # Trial energy should start (&amp;gt; FCI energy but close to it)&lt;br /&gt;
      dWeightInit           1.0     # Initial weight&lt;br /&gt;
      bConstWalkerNum     false     # Are we enforcing a constant number of walkers? (Currently not working)&lt;br /&gt;
      nWalkersSpace       20480	    # Walker growth space (Maximum number of walkers permitted)&lt;br /&gt;
      dWeightTarget     10000.0     # Total weight above which we undertake population control&lt;br /&gt;
      dWeightMin         1500.0     # Total weight below which we undertake population control&lt;br /&gt;
      dLowThresh            1.0     # If walker has weight below this, try to either kill or recombine it&lt;br /&gt;
      dWeightBranch         1.5     # If walker has weight above this, we branch the walker&lt;br /&gt;
      nShiftSteps             1     # Vary the shift every nShiftSteps steps.&lt;br /&gt;
      dShiftDamp            1.0     # Larger shift damping is more radical damping&lt;br /&gt;
      dOldWeight            0.0     # The total weight at the previous cycle for calculating the shift&lt;br /&gt;
      bUpdateShift        false     # Are we updating the shift every nShiftSteps cycles?&lt;br /&gt;
   }&lt;br /&gt;
                                                             &lt;br /&gt;
simpleDMC reuses the input files of qWalk, and can be invoked by listing the files as command line &lt;br /&gt;
arguments (in any order)&lt;br /&gt;
   &lt;br /&gt;
   $ ./simpleDMC.x sample.{sys,slater,orb,basis,simple,hf.config,hf.log} &amp;gt;&amp;gt; sample.log&lt;br /&gt;
&lt;br /&gt;
We pass all of the output to sample.log since the majority of information concerning the simulation is&lt;br /&gt;
streamed straight to STDOUT. We are primarily concerned with the final nSteps lines, since these give&lt;br /&gt;
the various energetic quantities associated with the system of walkers at each timestep. In fact, with&lt;br /&gt;
a little foresight, the fifth column corresponds to the total energy averaged over all walkers at that&lt;br /&gt;
timestep. Averaging over this column, we obtain the DMC energy:&lt;br /&gt;
&lt;br /&gt;
   $ export nsteps=10000&lt;br /&gt;
   $ tail -n $nsteps sample.log | awk &#039;{ sum += $5; n++ } END { if (n &amp;gt; 0) print sum / n; }&#039;&lt;br /&gt;
   -0.498772&lt;br /&gt;
&lt;br /&gt;
This quantity is in very good agreement with the exact energy of -0.5 Hartrees.&lt;/div&gt;</summary>
		<author><name>Sc2018</name></author>
	</entry>
	<entry>
		<id>https://wikis.ch.cam.ac.uk/thom/wiki/index.php?title=Main_Page&amp;diff=160</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wikis.ch.cam.ac.uk/thom/wiki/index.php?title=Main_Page&amp;diff=160"/>
		<updated>2016-11-22T01:16:26Z</updated>

		<summary type="html">&lt;p&gt;Sc2018: /* Useful Software */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Good Evening, Guten Abend, and Willkommen to ze new Thom Group Wiki&lt;br /&gt;
= Contents =&lt;br /&gt;
== [[Calendar | Calendar]] ==&lt;br /&gt;
https://calendar.google.com/calendar/render?mode=day&amp;amp;date=20160601T153539#main_7%7Cday-1+23745+23745+23745&lt;br /&gt;
&lt;br /&gt;
{{Special:IframePage}}&lt;br /&gt;
&lt;br /&gt;
== Group Meetings ==&lt;br /&gt;
&lt;br /&gt;
===Research Period===&lt;br /&gt;
{|&lt;br /&gt;
|+&lt;br /&gt;
|&#039;&#039;&#039;Date&#039;&#039;&#039;                || &#039;&#039;&#039;Mini-talk&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|15th August 2016    || Jonathan&lt;br /&gt;
|-&lt;br /&gt;
|30th August 2016    || Charlie&lt;br /&gt;
|-&lt;br /&gt;
|12th September 2016 || James&lt;br /&gt;
|-&lt;br /&gt;
|26th September 2016 || CANCELLED&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Michaelmas Term===&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Date&#039;&#039;&#039;                || &#039;&#039;&#039;Mini-talk&#039;&#039;&#039; ||| &#039;&#039;&#039;Cake&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|10th October 2016    || Charlie || Hugh&lt;br /&gt;
|-&lt;br /&gt;
|24th October 2016    || Verena || Sav&lt;br /&gt;
|-&lt;br /&gt;
|7th November 2016 || Choi  || Alex&lt;br /&gt;
|-&lt;br /&gt;
|21st November 2016 || Ruth  ||  Verena&lt;br /&gt;
|-&lt;br /&gt;
|5th December 2016 || [AJWT away]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Lent Term 2017===&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Date&#039;&#039;&#039;                || &#039;&#039;&#039;Mini-talk&#039;&#039;&#039; ||| &#039;&#039;&#039;Cake&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|9th January || ||&lt;br /&gt;
|-&lt;br /&gt;
|23rd January    || ||&lt;br /&gt;
|-&lt;br /&gt;
|6th February    ||  || &lt;br /&gt;
|-&lt;br /&gt;
|20th February ||   || &lt;br /&gt;
|-&lt;br /&gt;
|6th March ||   ||  &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== [[Group_List | Group List]] ==&lt;br /&gt;
(see also http://www.ch.cam.ac.uk/group/thom)&lt;br /&gt;
- An up to date list of group members&lt;br /&gt;
&lt;br /&gt;
== [[Computer_List | Computer List]] ==&lt;br /&gt;
- Group computers available.&lt;br /&gt;
== [[Introduction | Introduction to basic shell commands]] == &lt;br /&gt;
- There are a number of tutorials available which document basic operations that are useful including:&lt;br /&gt;
&lt;br /&gt;
# General bash commands&lt;br /&gt;
# Setting up cygwin&lt;br /&gt;
# Setting up ssh keys and general bash commands what are helpful&lt;br /&gt;
# using [[GIT]]&lt;br /&gt;
# Useful cerebro queue commands&lt;br /&gt;
# Some [[vim]] tidbits&lt;br /&gt;
&lt;br /&gt;
Currently undergoing construction.&lt;br /&gt;
&lt;br /&gt;
== Useful Software ==&lt;br /&gt;
# Using QChem&lt;br /&gt;
# Using [[QCMagic]]&lt;br /&gt;
# [[SimpleDMC]]&lt;br /&gt;
&lt;br /&gt;
== Useful Information ==&lt;br /&gt;
# Guidelines on [[Code Review]]&lt;br /&gt;
&lt;br /&gt;
== [[Archiving_data | Archiving data for the university repository]] ==&lt;br /&gt;
== [[Website_to_do | To-do list for the Thom Group Website]] ==&lt;br /&gt;
&lt;br /&gt;
= To Do List =&lt;br /&gt;
--A category containing all those affiliated with the group&lt;br /&gt;
&lt;br /&gt;
-a pretty picture&lt;br /&gt;
&lt;br /&gt;
-their research interests&lt;br /&gt;
&lt;br /&gt;
-current location and contact deets&lt;br /&gt;
&lt;br /&gt;
-publication history&lt;br /&gt;
&lt;br /&gt;
--A &amp;quot;How to:&amp;quot; page on setting up cygwin, ssh keys and general bash commands what are helpful&lt;br /&gt;
&lt;br /&gt;
--A &amp;quot;How to:&amp;quot; page on using qchem&lt;br /&gt;
&lt;br /&gt;
--A Pretty picture for the $wgLogo&lt;br /&gt;
&lt;br /&gt;
--A job opportunities page with method of contact for Monsieur Docteur Thom&lt;br /&gt;
&lt;br /&gt;
--A list of drinkable clarets from the past 5 years&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;A watched QCHEM calculation never converges&amp;quot;&lt;/div&gt;</summary>
		<author><name>Sc2018</name></author>
	</entry>
	<entry>
		<id>https://wikis.ch.cam.ac.uk/thom/wiki/index.php?title=SimpleDMC&amp;diff=159</id>
		<title>SimpleDMC</title>
		<link rel="alternate" type="text/html" href="https://wikis.ch.cam.ac.uk/thom/wiki/index.php?title=SimpleDMC&amp;diff=159"/>
		<updated>2016-11-22T01:14:21Z</updated>

		<summary type="html">&lt;p&gt;Sc2018: Created page with &amp;quot;= Examples =  == The Hydrogen Atom ==  === Gaussian === Let&amp;#039;s begin by generating a trial wavefunction with Gaussian03. To start with, we need to define an atomic orbital basi...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Examples =&lt;br /&gt;
&lt;br /&gt;
== The Hydrogen Atom ==&lt;br /&gt;
&lt;br /&gt;
=== Gaussian ===&lt;br /&gt;
Let&#039;s begin by generating a trial wavefunction with Gaussian03. To start with, we need to define an atomic orbital basis, then tell Gaussian03 to use it in conjunction with some &#039;&#039;ab initio&#039;&#039; method. We&#039;ll use the STO-6G basis set, where 6 Gaussian primitives are used to represent an atomic orbital. We&#039;ll create an input file for Gaussian03, called H.com,&lt;br /&gt;
&lt;br /&gt;
   $ cat -n H.com&lt;br /&gt;
      1   %chk=H.chk&lt;br /&gt;
      2   #p UHF/STO-6G 6d 10f SCF Test IOP(3/24=10) IOP(3/81=1) Pop=Full&lt;br /&gt;
      3   &lt;br /&gt;
      4   Hydrogen Atom - UHF STO-6G&lt;br /&gt;
      5&lt;br /&gt;
      6   0 2&lt;br /&gt;
      7   H   0.000   0.000   0.000&lt;br /&gt;
      8&lt;br /&gt;
&lt;br /&gt;
This may seem cryptic for the moment, but each line (and entry therein) is necessary. Line 1 tells Gaussian03 to put some output in an encrypted file called H.chk. Line 2 is the ``route section&amp;quot;: The IOP arguments are &#039;&#039;internal options&#039;&#039;, and tell Gaussian03 to spit out data in a certain format. Line 4 contains a title section, and must be included, as must the sandwiching blank lines. Line 6 specifies the charge and multiplicity (number of unpaired electrons + 1). Finally, on line 7, we specify the molecular configuration; atom types and Cartesian position vectors of the constituent atoms are enumerated here.&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s run Gaussian03,&lt;br /&gt;
&lt;br /&gt;
   $ g03 H.com&lt;br /&gt;
&lt;br /&gt;
No return value is normally a good sign- you&#039;ll typically be greeted with an (unhelpful) SEGFAULT of some kind if the calculation was unsuccessful. It&#039;s also worth explicitly checking for errors, since Gaussian is also able to die silently&lt;br /&gt;
&lt;br /&gt;
   $ grep &amp;quot;Error&amp;quot; H.log&lt;br /&gt;
&lt;br /&gt;
Gaussian03 writes to two files- H.log and H.chk; the contents of the former are obvious while we&#039;ve already briefly discussed the contents of the latter. In the output, all we care about is the energy, so invoke&lt;br /&gt;
&lt;br /&gt;
   $ grep -n &amp;quot;SCF Done&amp;quot; H.log&lt;br /&gt;
   219: SCF Done:  E(UHF) = -0.471039054196     A.U. after     1 cycles&lt;br /&gt;
&lt;br /&gt;
This is a rather poor value relative to the analytical -0.5 Hartrees, but at least we have something to improve upon. We must now do some conversions to extract information from the checkpoint file&lt;br /&gt;
&lt;br /&gt;
   $ formchk H.chk H.fchk&lt;br /&gt;
   Read checkpoint file H.chk&lt;br /&gt;
   Write formatted file H.fchk&lt;br /&gt;
   Rotating derivatives, DoTrsp=T IDiff= 1 LEDeriv=    197 LFDPrp=       0 LDFDPr=       0.&lt;br /&gt;
&lt;br /&gt;
formchk is a Gaussian utility that converts the unreadable H.chk to a formatted checkpoint file, H.fchk. Since this formatted file is more amenable to parsing, it can be used by a number of visualisation/ post-Gaussian tools.&lt;br /&gt;
&lt;br /&gt;
=== qWalk ===&lt;br /&gt;
qWalk is a piece of software we can benchmark the simpleDMC software against, possessing both variational&lt;br /&gt;
and diffusion Monte Carlo (VMC and DMC, respectively) functionalities. The simpleDMC software also uses &lt;br /&gt;
the same input file formats as qWalk, and so we are able to use their file conversion tools to extract data &lt;br /&gt;
from a host of &#039;&#039;ab initio&#039;&#039; software suites.&lt;br /&gt;
&lt;br /&gt;
First, we parse the H.fchk file into a number of qWalk input files:&lt;br /&gt;
&lt;br /&gt;
   $ ./g032qmc -log H.log -fchk H.fchk &lt;br /&gt;
   --- read fchk file ---&lt;br /&gt;
   Number of atoms: 1&lt;br /&gt;
   Number of basis functions: 1&lt;br /&gt;
   Number of independant functions: 1&lt;br /&gt;
   Multiplicity: 2&lt;br /&gt;
   Number of alpha electrons: 1&lt;br /&gt;
   Number of beta electrons: 0&lt;br /&gt;
   Total Energy: -0.471039054195684&lt;br /&gt;
   Pure/Cartesian d shells: 6D&lt;br /&gt;
   Pure/Cartesian f shells: 10F&lt;br /&gt;
   found beta component, scftpe=UHF&lt;br /&gt;
   --- read log file ---&lt;br /&gt;
   basis set is from &#039;AO basis set&#039; section&lt;br /&gt;
   --- have read files ---&lt;br /&gt;
   norb=1&lt;br /&gt;
   spin up end size=1&lt;br /&gt;
   moCoeff total size=2&lt;br /&gt;
   writing qwalk input files ... &lt;br /&gt;
   writing orb file.  This could take a few seconds.&lt;br /&gt;
   output: sample.orb&lt;br /&gt;
   output: sample.basis&lt;br /&gt;
   output: sample.slater&lt;br /&gt;
   output: sample.jast2&lt;br /&gt;
   output: sample.sys&lt;br /&gt;
   output: sample.hf&lt;br /&gt;
   output: sample.opt&lt;br /&gt;
   Done&lt;br /&gt;
    &lt;br /&gt;
   Warning: Now the basisset must be the same for the same specie of atoms&lt;br /&gt;
&lt;br /&gt;
We&#039;ll try to reproduce the UHF results by use of VMC with qWalk. Let&#039;s have a look at sample.hf:&lt;br /&gt;
&lt;br /&gt;
   $ cat sample.hf&lt;br /&gt;
   METHOD { VMC nconfig 1000 } &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
   INCLUDE sample.sys  &lt;br /&gt;
   TRIALFUNC { INCLUDE sample.slater}&lt;br /&gt;
&lt;br /&gt;
Note that we have added &amp;quot;nconfig 1000&amp;quot;, which gives us control over how many walkers are to be used&lt;br /&gt;
for the VMC. sample.sys contains the system configuration (number of electrons with a given spin, &lt;br /&gt;
atomic coordinates, etc.), while sample.slater contains the orbital information for the Slater&lt;br /&gt;
determinant (in conjunction with sample.orb and sample.basis). This Slater determinant will be used&lt;br /&gt;
to sample the trial wavefunction created by g03. We now run qWalk:&lt;br /&gt;
&lt;br /&gt;
   $ ./qwalk sample.hf&lt;br /&gt;
   output to sample.hf.o&lt;br /&gt;
   System&lt;br /&gt;
   Wave function&lt;br /&gt;
   Pseudopotential&lt;br /&gt;
   Could not open sample.hf.config. Generating configurations from scratch&lt;br /&gt;
  &lt;br /&gt;
and upon completion, are left with three files,&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|sample.hf.o&lt;br /&gt;
|Information about the run.&lt;br /&gt;
|-&lt;br /&gt;
|sample.hf.log&lt;br /&gt;
|Log for statistical analysis.&lt;br /&gt;
|-&lt;br /&gt;
|sample.hf.config&lt;br /&gt;
|Checkfile for the run.&lt;br /&gt;
|}   &lt;br /&gt;
&lt;br /&gt;
We can extract averages from the VMC by invoking&lt;br /&gt;
&lt;br /&gt;
   $ ./gosling sample.hf.log      &lt;br /&gt;
   #####################&lt;br /&gt;
   vmc:  100 total blocks reblocked into 100&lt;br /&gt;
   #####################&lt;br /&gt;
   Threw out the first 0 blocks in the averaging.&lt;br /&gt;
   total_energy0        -0.4702684082 +/-  0.000922386677 (sigma     0.425114576 ) &lt;br /&gt;
   kinetic0              0.7706545412 +/-  0.003605881864 (sigma     1.448514687 ) &lt;br /&gt;
   potential0            -1.240922949 +/-  0.003148015019 (sigma      1.21325133 ) &lt;br /&gt;
   nonlocal0                        0 +/-               0 (sigma               0 ) &lt;br /&gt;
   weight0                          1 +/- 6.661338148e-17 (sigma               0 ) &lt;br /&gt;
   &lt;br /&gt;
   --------Properties differences-------------&lt;br /&gt;
   approximate number of independent points: 212415.3753&lt;br /&gt;
&lt;br /&gt;
We see that the VMC estimate of the energy of the trial wavefunction (-0.470(2)) matches&lt;br /&gt;
relatively well with the UHF energy (-0.471039054195684). We have also obtained the&lt;br /&gt;
sample.hf.config file, containing the distribution of walkers sampling the&lt;br /&gt;
trial wavefunction.&lt;br /&gt;
&lt;br /&gt;
   $ head -8 sample.hf.config&lt;br /&gt;
   walker { &lt;br /&gt;
   nElec 1 ndim 3&lt;br /&gt;
   -0.731706383078456 0.620589802605041 -0.092157439050284 &lt;br /&gt;
   } &lt;br /&gt;
   walker { &lt;br /&gt;
   nElec 1 ndim 3&lt;br /&gt;
   0.366970593352899 0.216757302067973 -0.48313699793852 &lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
=== simpleDMC ===&lt;br /&gt;
&lt;br /&gt;
We can use this distribution of walkers as a starting point for our DMC calculations with&lt;br /&gt;
simpleDMC. We require an input file to run simpleDMC, sample.simple:&lt;br /&gt;
&lt;br /&gt;
   $ cat sample.simple&lt;br /&gt;
   simple { &lt;br /&gt;
      nWalkers             1000     # Number of walkers&lt;br /&gt;
      nSteps              10000     # Maximum number of steps&lt;br /&gt;
      dTau                0.001     # Timestep&lt;br /&gt;
      dETrial              -0.5     # Trial energy should start (&amp;gt; FCI energy but close to it)&lt;br /&gt;
      dWeightInit           1.0     # Initial weight&lt;br /&gt;
      bConstWalkerNum     false     # Are we enforcing a constant number of walkers? (Currently not working)&lt;br /&gt;
      nWalkersSpace       20480	    # Walker growth space (Maximum number of walkers permitted)&lt;br /&gt;
      dWeightTarget     10000.0     # Total weight above which we undertake population control&lt;br /&gt;
      dWeightMin         1500.0     # Total weight below which we undertake population control&lt;br /&gt;
      dLowThresh            1.0     # If walker has weight below this, try to either kill or recombine it&lt;br /&gt;
      dWeightBranch         1.5     # If walker has weight above this, we branch the walker&lt;br /&gt;
      nShiftSteps             1     # Vary the shift every nShiftSteps steps.&lt;br /&gt;
      dShiftDamp            1.0     # Larger shift damping is more radical damping&lt;br /&gt;
      dOldWeight            0.0     # The total weight at the previous cycle for calculating the shift&lt;br /&gt;
      bUpdateShift        false     # Are we updating the shift every nShiftSteps cycles?&lt;br /&gt;
   }&lt;br /&gt;
                                                             &lt;br /&gt;
simpleDMC reuses the input files of qWalk, and can be invoked by listing the files as command line &lt;br /&gt;
arguments (in any order)&lt;br /&gt;
   &lt;br /&gt;
   $ ./simpleDMC.x sample.{sys,slater,orb,basis,simple,hf.config,hf.log} &amp;gt;&amp;gt; sample.log&lt;br /&gt;
&lt;br /&gt;
We pass all of the output to sample.log since the majority of information concerning the simulation is&lt;br /&gt;
streamed straight to STDOUT. We are primarily concerned with the final nSteps lines, since these give&lt;br /&gt;
the various energetic quantities associated with the system of walkers at each timestep. In fact, with&lt;br /&gt;
a little foresight, the fifth column corresponds to the total energy averaged over all walkers at that&lt;br /&gt;
timestep. Averaging over this column, we obtain the DMC energy:&lt;br /&gt;
&lt;br /&gt;
   $ export nsteps=10000&lt;br /&gt;
   $ tail -n $nsteps sample.log | awk &#039;{ sum += $5; n++ } END { if (n &amp;gt; 0) print sum / n; }&#039;&lt;br /&gt;
   -0.498772&lt;br /&gt;
&lt;br /&gt;
This quantity is in very good agreement with the exact energy of -0.5 Hartrees.&lt;/div&gt;</summary>
		<author><name>Sc2018</name></author>
	</entry>
</feed>