diff --git a/index.html b/index.html index f746ae4..4caf686 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Quantum Monte Carlo @@ -257,65 +257,65 @@ for the JavaScript code in this tag.

Table of Contents

@@ -323,8 +323,8 @@ for the JavaScript code in this tag.
-
-

1 Introduction

+
+

1 Introduction

We propose different exercises to understand quantum Monte Carlo (QMC) @@ -366,8 +366,8 @@ interpreted as a single precision value

-
-

2 Numerical evaluation of the energy

+
+

2 Numerical evaluation of the energy

In this section we consider the Hydrogen atom with the following @@ -441,13 +441,13 @@ E & = & \frac{\langle \Psi| \hat{H} | \Psi\rangle}{\langle \Psi |\Psi \rangle} \end{eqnarray*}

-
-

2.1 Local energy

+
+

2.1 Local energy

-
-

2.1.1 Exercise 1

+
+

2.1.1 Exercise 1

@@ -491,8 +491,8 @@ and returns the potential.

-
-

2.1.2 Exercise 2

+
+

2.1.2 Exercise 2

@@ -527,8 +527,8 @@ input arguments, and returns a scalar.

-
-

2.1.3 Exercise 3

+
+

2.1.3 Exercise 3

@@ -609,8 +609,8 @@ So the local kinetic energy is

-
-

2.1.4 Exercise 4

+
+

2.1.4 Exercise 4

@@ -653,14 +653,14 @@ local energy.

-
-

2.2 Plot of the local energy along the \(x\) axis

+
+

2.2 Plot of the local energy along the \(x\) axis

-
-

2.2.1 Exercise

+
+

2.2.1 Exercise

@@ -777,8 +777,8 @@ plot './data' index 0 using 1:2 with lines title 'a=0.1', \

-
-

2.3 Numerical estimation of the energy

+
+

2.3 Numerical estimation of the energy

If the space is discretized in small volume elements \(\mathbf{r}_i\) @@ -808,8 +808,8 @@ The energy is biased because:

-
-

2.3.1 Exercise

+
+

2.3.1 Exercise

@@ -919,8 +919,8 @@ a = 2.0000000000000000 E = -8.0869806678448772E-002

-
-

2.4 Variance of the local energy

+
+

2.4 Variance of the local energy

The variance of the local energy is a functional of \(\Psi\) @@ -947,21 +947,21 @@ energy can be used as a measure of the quality of a wave function.

-
-

2.4.1 Exercise (optional)

+
+

2.4.1 Exercise (optional)

Prove that : -\[ \sigma^2(E_L) = \langle E^2 \rangle - \langle E \rangle^2 \] +\[\langle E - \langle E \rangle \rangle^2 = \langle E^2 \rangle - \langle E \rangle^2 \]

-
-

2.4.2 Exercise

+
+

2.4.2 Exercise

@@ -1017,6 +1017,7 @@ in a grid of \(50\times50\times50\) points in the range implicit none double precision, external :: e_loc, psi double precision :: x(50), w, delta, energy, dx, r(3), a(6), norm, s2 + double precision :: e, energy2 integer :: i, k, l, j a = (/ 0.1d0, 0.2d0, 0.5d0, 1.d0, 1.5d0, 2.d0 /) @@ -1032,6 +1033,7 @@ in a grid of \(50\times50\times50\) points in the range do j=1,size(a) energy = 0.d0 + energy2 = 0.d0 norm = 0.d0 do i=1,size(x) r(1) = x(i) @@ -1041,29 +1043,16 @@ in a grid of \(50\times50\times50\) points in the range r(3) = x(l) w = psi(a(j),r) w = w * w * delta - energy = energy + w * e_loc(a(j), r) + e = e_loc(a(j), r) + energy = energy + w * e + energy2 = energy2 + w * e * e norm = norm + w end do end do end do - energy = energy / norm - - s2 = 0.d0 - norm = 0.d0 - do i=1,size(x) - r(1) = x(i) - do k=1,size(x) - r(2) = x(k) - do l=1,size(x) - r(3) = x(l) - w = psi(a(j),r) - w = w * w * delta - s2 = s2 + w * ( e_loc(a(j), r) - energy )**2 - norm = norm + w - end do - end do - end do - s2 = s2 / norm + energy = energy / norm + energy2 = energy2 / norm + s2 = energy2 - energy*energy print *, 'a = ', a(j), ' E = ', energy, ' s2 = ', s2 end do @@ -1082,12 +1071,12 @@ To compile and run:

-a =   0.10000000000000001       E =  -0.24518438948809140       s2 =    2.6965218719733813E-002
-a =   0.20000000000000001       E =  -0.26966057967803236       s2 =    3.7197072370217653E-002
-a =   0.50000000000000000       E =  -0.38563576125173815       s2 =    5.3185967578488862E-002
+a =   0.10000000000000001       E =  -0.24518438948809140       s2 =    2.6965218719722767E-002
+a =   0.20000000000000001       E =  -0.26966057967803236       s2 =    3.7197072370201284E-002
+a =   0.50000000000000000       E =  -0.38563576125173815       s2 =    5.3185967578480653E-002
 a =    1.0000000000000000       E =  -0.50000000000000000       s2 =    0.0000000000000000     
-a =    1.5000000000000000       E =  -0.39242967082602065       s2 =   0.31449670909180444     
-a =    2.0000000000000000       E =   -8.0869806678448772E-002  s2 =    1.8068814270851303     
+a =    1.5000000000000000       E =  -0.39242967082602065       s2 =   0.31449670909172917     
+a =    2.0000000000000000       E =   -8.0869806678448772E-002  s2 =    1.8068814270846534     
 
 
@@ -1096,8 +1085,8 @@ a = 2.0000000000000000 E = -8.0869806678448772E-002 s2 = 1.806881
-
-

3 Variational Monte Carlo

+
+

3 Variational Monte Carlo

Numerical integration with deterministic methods is very efficient @@ -1113,8 +1102,8 @@ interval.

-
-

3.1 Computation of the statistical error

+
+

3.1 Computation of the statistical error

To compute the statistical error, you need to perform \(M\) @@ -1154,8 +1143,8 @@ And the confidence interval is given by

-
-

3.1.1 Exercise

+
+

3.1.1 Exercise

@@ -1204,8 +1193,8 @@ input array.

-
-

3.2 Uniform sampling in the box

+
+

3.2 Uniform sampling in the box

We will now do our first Monte Carlo calculation to compute the @@ -1239,8 +1228,8 @@ statistical error.

-
-

3.2.1 Exercise

+
+

3.2.1 Exercise

@@ -1350,8 +1339,8 @@ E = -0.49588321986667677 +/- 7.1758863546737969E-004

-
-

3.3 Metropolis sampling with \(\Psi^2\)

+
+

3.3 Metropolis sampling with \(\Psi^2\)

We will now use the square of the wave function to sample random @@ -1438,8 +1427,8 @@ step such that the acceptance rate is close to 0.5 is a good compromise.

-
-

3.3.1 Exercise

+
+

3.3.1 Exercise

@@ -1569,8 +1558,8 @@ A = 0.51737800000000000 +/- 4.1827406733181444E-004

-
-

3.4 Gaussian random number generator

+
+

3.4 Gaussian random number generator

To obtain Gaussian-distributed random numbers, you can apply the @@ -1624,8 +1613,8 @@ following sections.

-
-

3.5 Generalized Metropolis algorithm

+
+

3.5 Generalized Metropolis algorithm

One can use more efficient numerical schemes to move the electrons. @@ -1724,8 +1713,8 @@ The transition probability becomes:

-
-

3.5.1 Exercise 1

+
+

3.5.1 Exercise 1

@@ -1761,8 +1750,8 @@ Write a function to compute the drift vector \(\frac{\nabla \Psi(\mathbf{r})}{\P

-
-

3.5.2 Exercise 2

+
+

3.5.2 Exercise 2

@@ -1914,17 +1903,17 @@ A = 0.78861366666666655 +/- 3.5096729498002445E-004

-
-

4 TODO Diffusion Monte Carlo

+
+

4 TODO Diffusion Monte Carlo

-
-

4.1 Hydrogen atom

+
+

4.1 Hydrogen atom

    -
  1. Exercise
    +
  2. Exercise

    @@ -2083,8 +2072,8 @@ A = 0.78861366666666655 +/- 3.5096729498002445E-004

    -
    -

    4.2 Dihydrogen

    +
    +

    4.2 Dihydrogen

    We will now consider the H2 molecule in a minimal basis composed of the @@ -2106,7 +2095,7 @@ the nuclei.

    Author: Anthony Scemama, Claudia Filippi

    -

    Created: 2021-01-20 Wed 18:13

    +

    Created: 2021-01-20 Wed 20:19

    Validate