diff --git a/H2_traj.png b/H2_traj.png new file mode 100644 index 0000000..575121c Binary files /dev/null and b/H2_traj.png differ diff --git a/H2_traj2.png b/H2_traj2.png new file mode 100644 index 0000000..addc2f7 Binary files /dev/null and b/H2_traj2.png differ diff --git a/QMC.org b/QMC.org index 4b3aab3..226e779 100644 --- a/QMC.org +++ b/QMC.org @@ -1014,7 +1014,6 @@ plot './data' index 0 using 1:2 with lines title 'a=0.1', \ - The energy is evaluated only inside the box (incompleteness of the space) #+end_note - *** Exercise #+begin_exercise Compute a numerical estimate of the energy using a grid of @@ -2731,10 +2730,14 @@ gcc hydrogen.c qmc_stats.c qmc_metropolis.c -lm -o qmc_metropolis where $\chi$ is a Gaussian random variable with zero mean and variance $\delta t$. + + Here is an illustration of a trajectory: + [[./H2_traj.png]] + + Averaging all the trajectories converges to the density of the + hydrogen atom. + [[./H2_traj2.png]] - # TODO - # prod = np.dot((d_new + d_old), (r_new - r_old)) - # argexpo = 0.5 * (d2_new - d2_old)*dt + prod The algorithm of the previous exercise is only slightly modified as: 1) Evaluate the local energy at $\mathbf{r}_{n}$ and accumulate it diff --git a/qmc_uniform.py b/qmc_uniform.py index 09bfd4a..e966e55 100644 --- a/qmc_uniform.py +++ b/qmc_uniform.py @@ -19,7 +19,7 @@ def MonteCarlo(a, nmax): return energy / normalization a = 1.2 -nmax = 10000 +nmax = 100000 X = [MonteCarlo(a,nmax) for i in range(30)] E, deltaE = ave_error(X)