Skip to content

Commit

Permalink
Added illustrations
Browse files Browse the repository at this point in the history
  • Loading branch information
scemama committed Jan 24, 2023
1 parent 2c57107 commit 2ffd2af
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Binary file added H2_traj.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added H2_traj2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletions QMC.org
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion qmc_uniform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2ffd2af

Please sign in to comment.