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">
- +We propose different exercises to understand quantum Monte Carlo (QMC) @@ -366,8 +366,8 @@ interpreted as a single precision value
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*}
@@ -491,8 +491,8 @@ and returns the potential.
@@ -527,8 +527,8 @@ input arguments, and returns a scalar.
@@ -609,8 +609,8 @@ So the local kinetic energy is
@@ -653,14 +653,14 @@ local energy.
@@ -777,8 +777,8 @@ plot './data' index 0 using 1:2 with lines title 'a=0.1', \
If the space is discretized in small volume elements \(\mathbf{r}_i\) @@ -808,8 +808,8 @@ The energy is biased because:
@@ -919,8 +919,8 @@ a = 2.0000000000000000 E = -8.0869806678448772E-002
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.
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 \]
@@ -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
Numerical integration with deterministic methods is very efficient @@ -1113,8 +1102,8 @@ interval.
To compute the statistical error, you need to perform \(M\) @@ -1154,8 +1143,8 @@ And the confidence interval is given by
@@ -1204,8 +1193,8 @@ input array.
We will now do our first Monte Carlo calculation to compute the @@ -1239,8 +1228,8 @@ statistical error.
@@ -1350,8 +1339,8 @@ E = -0.49588321986667677 +/- 7.1758863546737969E-004
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.
@@ -1569,8 +1558,8 @@ A = 0.51737800000000000 +/- 4.1827406733181444E-004
To obtain Gaussian-distributed random numbers, you can apply the @@ -1624,8 +1613,8 @@ following sections.
One can use more efficient numerical schemes to move the electrons. @@ -1724,8 +1713,8 @@ The transition probability becomes:
@@ -1761,8 +1750,8 @@ Write a function to compute the drift vector \(\frac{\nabla \Psi(\mathbf{r})}{\P
@@ -1914,17 +1903,17 @@ A = 0.78861366666666655 +/- 3.5096729498002445E-004