1
0
mirror of https://github.com/TREX-CoE/qmc-lttc.git synced 2024-12-22 20:36:15 +01:00
This commit is contained in:
scemama 2021-01-13 17:07:39 +00:00
parent fe43770574
commit e5cb286634

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2021-01-13 Wed 17:02 --> <!-- 2021-01-13 Wed 17:07 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Quantum Monte Carlo</title> <title>Quantum Monte Carlo</title>
@ -257,63 +257,63 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<div id="text-table-of-contents"> <div id="text-table-of-contents">
<ul> <ul>
<li><a href="#org31dc30f">1. Introduction</a></li> <li><a href="#orgc777be1">1. Introduction</a></li>
<li><a href="#orgb89441e">2. Numerical evaluation of the energy</a> <li><a href="#orga3ef4eb">2. Numerical evaluation of the energy</a>
<ul> <ul>
<li><a href="#orge4ea296">2.1. Local energy</a> <li><a href="#org3c36fbd">2.1. Local energy</a>
<ul> <ul>
<li><a href="#org511db1c">2.1.1. Exercise 1</a></li> <li><a href="#org434b5d3">2.1.1. Exercise 1</a></li>
<li><a href="#orgf63cbdc">2.1.2. Exercise 2</a></li> <li><a href="#orga9bd823">2.1.2. Exercise 2</a></li>
<li><a href="#org940cdda">2.1.3. Exercise 3</a></li> <li><a href="#org19f7ef1">2.1.3. Exercise 3</a></li>
<li><a href="#org02a260b">2.1.4. Exercise 4</a></li> <li><a href="#orgb7ba480">2.1.4. Exercise 4</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org1293483">2.2. Plot of the local energy along the \(x\) axis</a> <li><a href="#orge0a15c9">2.2. Plot of the local energy along the \(x\) axis</a>
<ul> <ul>
<li><a href="#org2e081e5">2.2.1. Exercise</a></li> <li><a href="#org58344c8">2.2.1. Exercise</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org5b4de1d">2.3. Numerical estimation of the energy</a> <li><a href="#org8216be8">2.3. Numerical estimation of the energy</a>
<ul> <ul>
<li><a href="#orgbb0ee7a">2.3.1. Exercise</a></li> <li><a href="#org8e43312">2.3.1. Exercise</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org9aa7ee1">2.4. Variance of the local energy</a> <li><a href="#org3c4621e">2.4. Variance of the local energy</a>
<ul> <ul>
<li><a href="#orgf9e560c">2.4.1. Exercise</a></li> <li><a href="#orgd7606c8">2.4.1. Exercise</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</li> </li>
<li><a href="#org8d2871a">3. Variational Monte Carlo</a> <li><a href="#org2082f05">3. Variational Monte Carlo</a>
<ul> <ul>
<li><a href="#orgbe405a0">3.1. Computation of the statistical error</a> <li><a href="#orgbcaa16b">3.1. Computation of the statistical error</a>
<ul> <ul>
<li><a href="#org30799a0">3.1.1. Exercise</a></li> <li><a href="#orga919e66">3.1.1. Exercise</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org73254a4">3.2. Uniform sampling in the box</a> <li><a href="#org3f0ebe8">3.2. Uniform sampling in the box</a>
<ul> <ul>
<li><a href="#org2a5387b">3.2.1. Exercise</a></li> <li><a href="#orgbbdcb31">3.2.1. Exercise</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org3a7aca4">3.3. Gaussian sampling</a> <li><a href="#org51cfa79">3.3. Gaussian sampling</a>
<ul> <ul>
<li><a href="#org9884247">3.3.1. Exercise</a></li> <li><a href="#orgbec6ea5">3.3.1. Exercise</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org3c79f95">3.4. Sampling with \(\Psi^2\)</a> <li><a href="#org39b0dd3">3.4. Sampling with \(\Psi^2\)</a>
<ul> <ul>
<li><a href="#org13a00c1">3.4.1. Importance sampling</a></li> <li><a href="#org174a24c">3.4.1. Importance sampling</a></li>
<li><a href="#org10a5ef8">3.4.2. Metropolis algorithm</a></li> <li><a href="#org1a431c2">3.4.2. Metropolis algorithm</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</li> </li>
<li><a href="#org1d9a2fb">4. <span class="todo TODO">TODO</span> Diffusion Monte Carlo</a> <li><a href="#org767855f">4. <span class="todo TODO">TODO</span> Diffusion Monte Carlo</a>
<ul> <ul>
<li><a href="#org959e256">4.1. Hydrogen atom</a></li> <li><a href="#org50b0f1f">4.1. Hydrogen atom</a></li>
<li><a href="#org8ff5e05">4.2. Dihydrogen</a></li> <li><a href="#org64f2d1e">4.2. Dihydrogen</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -321,8 +321,8 @@ for the JavaScript code in this tag.
</div> </div>
<div id="outline-container-org31dc30f" class="outline-2"> <div id="outline-container-orgc777be1" class="outline-2">
<h2 id="org31dc30f"><span class="section-number-2">1</span> Introduction</h2> <h2 id="orgc777be1"><span class="section-number-2">1</span> Introduction</h2>
<div class="outline-text-2" id="text-1"> <div class="outline-text-2" id="text-1">
<p> <p>
We propose different exercises to understand quantum Monte Carlo (QMC) We propose different exercises to understand quantum Monte Carlo (QMC)
@ -364,8 +364,8 @@ interpreted as a single precision value
</div> </div>
<div id="outline-container-orgb89441e" class="outline-2"> <div id="outline-container-orga3ef4eb" class="outline-2">
<h2 id="orgb89441e"><span class="section-number-2">2</span> Numerical evaluation of the energy</h2> <h2 id="orga3ef4eb"><span class="section-number-2">2</span> Numerical evaluation of the energy</h2>
<div class="outline-text-2" id="text-2"> <div class="outline-text-2" id="text-2">
<p> <p>
In this section we consider the Hydrogen atom with the following In this section we consider the Hydrogen atom with the following
@ -439,13 +439,13 @@ E & = & \frac{\langle \Psi| \hat{H} | \Psi\rangle}{\langle \Psi |\Psi \rangle}
\end{eqnarray*} \end{eqnarray*}
</div> </div>
<div id="outline-container-orge4ea296" class="outline-3"> <div id="outline-container-org3c36fbd" class="outline-3">
<h3 id="orge4ea296"><span class="section-number-3">2.1</span> Local energy</h3> <h3 id="org3c36fbd"><span class="section-number-3">2.1</span> Local energy</h3>
<div class="outline-text-3" id="text-2-1"> <div class="outline-text-3" id="text-2-1">
</div> </div>
<div id="outline-container-org511db1c" class="outline-4"> <div id="outline-container-org434b5d3" class="outline-4">
<h4 id="org511db1c"><span class="section-number-4">2.1.1</span> Exercise 1</h4> <h4 id="org434b5d3"><span class="section-number-4">2.1.1</span> Exercise 1</h4>
<div class="outline-text-4" id="text-2-1-1"> <div class="outline-text-4" id="text-2-1-1">
<div class="exercise"> <div class="exercise">
<p> <p>
@ -489,8 +489,8 @@ and returns the potential.
</div> </div>
</div> </div>
<div id="outline-container-orgf63cbdc" class="outline-4"> <div id="outline-container-orga9bd823" class="outline-4">
<h4 id="orgf63cbdc"><span class="section-number-4">2.1.2</span> Exercise 2</h4> <h4 id="orga9bd823"><span class="section-number-4">2.1.2</span> Exercise 2</h4>
<div class="outline-text-4" id="text-2-1-2"> <div class="outline-text-4" id="text-2-1-2">
<div class="exercise"> <div class="exercise">
<p> <p>
@ -525,8 +525,8 @@ input arguments, and returns a scalar.
</div> </div>
</div> </div>
<div id="outline-container-org940cdda" class="outline-4"> <div id="outline-container-org19f7ef1" class="outline-4">
<h4 id="org940cdda"><span class="section-number-4">2.1.3</span> Exercise 3</h4> <h4 id="org19f7ef1"><span class="section-number-4">2.1.3</span> Exercise 3</h4>
<div class="outline-text-4" id="text-2-1-3"> <div class="outline-text-4" id="text-2-1-3">
<div class="exercise"> <div class="exercise">
<p> <p>
@ -607,8 +607,8 @@ So the local kinetic energy is
</div> </div>
</div> </div>
<div id="outline-container-org02a260b" class="outline-4"> <div id="outline-container-orgb7ba480" class="outline-4">
<h4 id="org02a260b"><span class="section-number-4">2.1.4</span> Exercise 4</h4> <h4 id="orgb7ba480"><span class="section-number-4">2.1.4</span> Exercise 4</h4>
<div class="outline-text-4" id="text-2-1-4"> <div class="outline-text-4" id="text-2-1-4">
<div class="exercise"> <div class="exercise">
<p> <p>
@ -651,14 +651,14 @@ local energy.
</div> </div>
</div> </div>
<div id="outline-container-org1293483" class="outline-3"> <div id="outline-container-orge0a15c9" class="outline-3">
<h3 id="org1293483"><span class="section-number-3">2.2</span> Plot of the local energy along the \(x\) axis</h3> <h3 id="orge0a15c9"><span class="section-number-3">2.2</span> Plot of the local energy along the \(x\) axis</h3>
<div class="outline-text-3" id="text-2-2"> <div class="outline-text-3" id="text-2-2">
</div> </div>
<div id="outline-container-org2e081e5" class="outline-4"> <div id="outline-container-org58344c8" class="outline-4">
<h4 id="org2e081e5"><span class="section-number-4">2.2.1</span> Exercise</h4> <h4 id="org58344c8"><span class="section-number-4">2.2.1</span> Exercise</h4>
<div class="outline-text-4" id="text-2-2-1"> <div class="outline-text-4" id="text-2-2-1">
<div class="exercise"> <div class="exercise">
<p> <p>
@ -775,8 +775,8 @@ plot './data' index 0 using 1:2 with lines title 'a=0.1', \
</div> </div>
</div> </div>
<div id="outline-container-org5b4de1d" class="outline-3"> <div id="outline-container-org8216be8" class="outline-3">
<h3 id="org5b4de1d"><span class="section-number-3">2.3</span> Numerical estimation of the energy</h3> <h3 id="org8216be8"><span class="section-number-3">2.3</span> Numerical estimation of the energy</h3>
<div class="outline-text-3" id="text-2-3"> <div class="outline-text-3" id="text-2-3">
<p> <p>
If the space is discretized in small volume elements \(\mathbf{r}_i\) If the space is discretized in small volume elements \(\mathbf{r}_i\)
@ -806,8 +806,8 @@ The energy is biased because:
</div> </div>
<div id="outline-container-orgbb0ee7a" class="outline-4"> <div id="outline-container-org8e43312" class="outline-4">
<h4 id="orgbb0ee7a"><span class="section-number-4">2.3.1</span> Exercise</h4> <h4 id="org8e43312"><span class="section-number-4">2.3.1</span> Exercise</h4>
<div class="outline-text-4" id="text-2-3-1"> <div class="outline-text-4" id="text-2-3-1">
<div class="exercise"> <div class="exercise">
<p> <p>
@ -917,8 +917,8 @@ a = 2.0000000000000000 E = -8.0869806678448772E-002
</div> </div>
</div> </div>
<div id="outline-container-org9aa7ee1" class="outline-3"> <div id="outline-container-org3c4621e" class="outline-3">
<h3 id="org9aa7ee1"><span class="section-number-3">2.4</span> Variance of the local energy</h3> <h3 id="org3c4621e"><span class="section-number-3">2.4</span> Variance of the local energy</h3>
<div class="outline-text-3" id="text-2-4"> <div class="outline-text-3" id="text-2-4">
<p> <p>
The variance of the local energy is a functional of \(\Psi\) The variance of the local energy is a functional of \(\Psi\)
@ -940,8 +940,8 @@ energy can be used as a measure of the quality of a wave function.
</p> </p>
</div> </div>
<div id="outline-container-orgf9e560c" class="outline-4"> <div id="outline-container-orgd7606c8" class="outline-4">
<h4 id="orgf9e560c"><span class="section-number-4">2.4.1</span> Exercise</h4> <h4 id="orgd7606c8"><span class="section-number-4">2.4.1</span> Exercise</h4>
<div class="outline-text-4" id="text-2-4-1"> <div class="outline-text-4" id="text-2-4-1">
<div class="exercise"> <div class="exercise">
<p> <p>
@ -1083,8 +1083,8 @@ a = 2.0000000000000000 E = -8.0869806678448772E-002 s2 = 1.806881
</div> </div>
<div id="outline-container-org8d2871a" class="outline-2"> <div id="outline-container-org2082f05" class="outline-2">
<h2 id="org8d2871a"><span class="section-number-2">3</span> Variational Monte Carlo</h2> <h2 id="org2082f05"><span class="section-number-2">3</span> Variational Monte Carlo</h2>
<div class="outline-text-2" id="text-3"> <div class="outline-text-2" id="text-3">
<p> <p>
Numerical integration with deterministic methods is very efficient Numerical integration with deterministic methods is very efficient
@ -1100,8 +1100,8 @@ interval.
</p> </p>
</div> </div>
<div id="outline-container-orgbe405a0" class="outline-3"> <div id="outline-container-orgbcaa16b" class="outline-3">
<h3 id="orgbe405a0"><span class="section-number-3">3.1</span> Computation of the statistical error</h3> <h3 id="orgbcaa16b"><span class="section-number-3">3.1</span> Computation of the statistical error</h3>
<div class="outline-text-3" id="text-3-1"> <div class="outline-text-3" id="text-3-1">
<p> <p>
To compute the statistical error, you need to perform \(M\) To compute the statistical error, you need to perform \(M\)
@ -1141,8 +1141,8 @@ And the confidence interval is given by
</p> </p>
</div> </div>
<div id="outline-container-org30799a0" class="outline-4"> <div id="outline-container-orga919e66" class="outline-4">
<h4 id="org30799a0"><span class="section-number-4">3.1.1</span> Exercise</h4> <h4 id="orga919e66"><span class="section-number-4">3.1.1</span> Exercise</h4>
<div class="outline-text-4" id="text-3-1-1"> <div class="outline-text-4" id="text-3-1-1">
<div class="exercise"> <div class="exercise">
<p> <p>
@ -1191,8 +1191,8 @@ input array.
</div> </div>
</div> </div>
<div id="outline-container-org73254a4" class="outline-3"> <div id="outline-container-org3f0ebe8" class="outline-3">
<h3 id="org73254a4"><span class="section-number-3">3.2</span> Uniform sampling in the box</h3> <h3 id="org3f0ebe8"><span class="section-number-3">3.2</span> Uniform sampling in the box</h3>
<div class="outline-text-3" id="text-3-2"> <div class="outline-text-3" id="text-3-2">
<p> <p>
We will now do our first Monte Carlo calculation to compute the We will now do our first Monte Carlo calculation to compute the
@ -1226,8 +1226,8 @@ statistical error.
</p> </p>
</div> </div>
<div id="outline-container-org2a5387b" class="outline-4"> <div id="outline-container-orgbbdcb31" class="outline-4">
<h4 id="org2a5387b"><span class="section-number-4">3.2.1</span> Exercise</h4> <h4 id="orgbbdcb31"><span class="section-number-4">3.2.1</span> Exercise</h4>
<div class="outline-text-4" id="text-3-2-1"> <div class="outline-text-4" id="text-3-2-1">
<div class="exercise"> <div class="exercise">
<p> <p>
@ -1337,8 +1337,8 @@ E = -0.49588321986667677 +/- 7.1758863546737969E-004
</div> </div>
</div> </div>
<div id="outline-container-org3a7aca4" class="outline-3"> <div id="outline-container-org51cfa79" class="outline-3">
<h3 id="org3a7aca4"><span class="section-number-3">3.3</span> Gaussian sampling</h3> <h3 id="org51cfa79"><span class="section-number-3">3.3</span> Gaussian sampling</h3>
<div class="outline-text-3" id="text-3-3"> <div class="outline-text-3" id="text-3-3">
<p> <p>
We will now improve the sampling and allow to sample in the whole We will now improve the sampling and allow to sample in the whole
@ -1434,8 +1434,8 @@ average energy can be computed as
</div> </div>
<div id="outline-container-org9884247" class="outline-4"> <div id="outline-container-orgbec6ea5" class="outline-4">
<h4 id="org9884247"><span class="section-number-4">3.3.1</span> Exercise</h4> <h4 id="orgbec6ea5"><span class="section-number-4">3.3.1</span> Exercise</h4>
<div class="outline-text-4" id="text-3-3-1"> <div class="outline-text-4" id="text-3-3-1">
<div class="exercise"> <div class="exercise">
<p> <p>
@ -1546,8 +1546,8 @@ E = -0.49517104619091717 +/- 1.0685523607878961E-004
</div> </div>
</div> </div>
<div id="outline-container-org3c79f95" class="outline-3"> <div id="outline-container-org39b0dd3" class="outline-3">
<h3 id="org3c79f95"><span class="section-number-3">3.4</span> Sampling with \(\Psi^2\)</h3> <h3 id="org39b0dd3"><span class="section-number-3">3.4</span> Sampling with \(\Psi^2\)</h3>
<div class="outline-text-3" id="text-3-4"> <div class="outline-text-3" id="text-3-4">
<p> <p>
We will now use the square of the wave function to make the sampling: We will now use the square of the wave function to make the sampling:
@ -1572,8 +1572,8 @@ the local energies, each with a weight of 1.
</div> </div>
<div id="outline-container-org13a00c1" class="outline-4"> <div id="outline-container-org174a24c" class="outline-4">
<h4 id="org13a00c1"><span class="section-number-4">3.4.1</span> Importance sampling</h4> <h4 id="org174a24c"><span class="section-number-4">3.4.1</span> Importance sampling</h4>
<div class="outline-text-4" id="text-3-4-1"> <div class="outline-text-4" id="text-3-4-1">
<p> <p>
To generate the probability density \(\Psi^2\), we consider a To generate the probability density \(\Psi^2\), we consider a
@ -1686,7 +1686,7 @@ variance \(\tau\,2D\).
</div> </div>
<ol class="org-ol"> <ol class="org-ol">
<li><a id="orgda1b7b9"></a>Exercise 1<br /> <li><a id="orgfcbecfe"></a>Exercise 1<br />
<div class="outline-text-5" id="text-3-4-1-1"> <div class="outline-text-5" id="text-3-4-1-1">
<div class="exercise"> <div class="exercise">
<p> <p>
@ -1722,7 +1722,7 @@ Write a function to compute the drift vector \(\frac{\nabla \Psi(\mathbf{r})}{\P
</div> </div>
</li> </li>
<li><a id="orgfa7eb12"></a><span class="todo TODO">TODO</span> Exercise 2<br /> <li><a id="orge541cc5"></a><span class="todo TODO">TODO</span> Exercise 2<br />
<div class="outline-text-5" id="text-3-4-1-2"> <div class="outline-text-5" id="text-3-4-1-2">
<div class="exercise"> <div class="exercise">
<p> <p>
@ -1834,8 +1834,8 @@ E = -0.48584030499187431 +/- 1.0411743995438257E-004
</ol> </ol>
</div> </div>
<div id="outline-container-org10a5ef8" class="outline-4"> <div id="outline-container-org1a431c2" class="outline-4">
<h4 id="org10a5ef8"><span class="section-number-4">3.4.2</span> Metropolis algorithm</h4> <h4 id="org1a431c2"><span class="section-number-4">3.4.2</span> Metropolis algorithm</h4>
<div class="outline-text-4" id="text-3-4-2"> <div class="outline-text-4" id="text-3-4-2">
<p> <p>
Discretizing the differential equation to generate the desired Discretizing the differential equation to generate the desired
@ -1896,7 +1896,7 @@ the simulation.
</div> </div>
<ol class="org-ol"> <ol class="org-ol">
<li><a id="org05f76be"></a>Exercise<br /> <li><a id="orgdec27ad"></a>Exercise<br />
<div class="outline-text-5" id="text-3-4-2-1"> <div class="outline-text-5" id="text-3-4-2-1">
<div class="exercise"> <div class="exercise">
<p> <p>
@ -2052,17 +2052,17 @@ A = 0.78861366666666655 +/- 3.5096729498002445E-004
</div> </div>
<div id="outline-container-org1d9a2fb" class="outline-2"> <div id="outline-container-org767855f" class="outline-2">
<h2 id="org1d9a2fb"><span class="section-number-2">4</span> <span class="todo TODO">TODO</span> Diffusion Monte Carlo</h2> <h2 id="org767855f"><span class="section-number-2">4</span> <span class="todo TODO">TODO</span> Diffusion Monte Carlo</h2>
<div class="outline-text-2" id="text-4"> <div class="outline-text-2" id="text-4">
</div> </div>
<div id="outline-container-org959e256" class="outline-3"> <div id="outline-container-org50b0f1f" class="outline-3">
<h3 id="org959e256"><span class="section-number-3">4.1</span> Hydrogen atom</h3> <h3 id="org50b0f1f"><span class="section-number-3">4.1</span> Hydrogen atom</h3>
<div class="outline-text-3" id="text-4-1"> <div class="outline-text-3" id="text-4-1">
</div> </div>
<ol class="org-ol"> <ol class="org-ol">
<li><a id="orga7d10ea"></a>Exercise<br /> <li><a id="org6dfc9ee"></a>Exercise<br />
<div class="outline-text-5" id="text-4-1-0-1"> <div class="outline-text-5" id="text-4-1-0-1">
<div class="exercise"> <div class="exercise">
<p> <p>
@ -2221,8 +2221,8 @@ A = 0.78861366666666655 +/- 3.5096729498002445E-004
</div> </div>
<div id="outline-container-org8ff5e05" class="outline-3"> <div id="outline-container-org64f2d1e" class="outline-3">
<h3 id="org8ff5e05"><span class="section-number-3">4.2</span> Dihydrogen</h3> <h3 id="org64f2d1e"><span class="section-number-3">4.2</span> Dihydrogen</h3>
<div class="outline-text-3" id="text-4-2"> <div class="outline-text-3" id="text-4-2">
<p> <p>
We will now consider the H<sub>2</sub> molecule in a minimal basis composed of the We will now consider the H<sub>2</sub> molecule in a minimal basis composed of the
@ -2244,7 +2244,7 @@ the nuclei.
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: Anthony Scemama, Claudia Filippi</p> <p class="author">Author: Anthony Scemama, Claudia Filippi</p>
<p class="date">Created: 2021-01-13 Wed 17:02</p> <p class="date">Created: 2021-01-13 Wed 17:07</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>