mirror of
https://github.com/TREX-CoE/qmc-lttc.git
synced 2024-08-25 22:51:49 +02:00
deploy: 34481a8e3d
This commit is contained in:
parent
03fc1b3fab
commit
83a8af8fa7
433
index.html
433
index.html
@ -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-26 Tue 16:09 -->
|
<!-- 2021-01-27 Wed 00:06 -->
|
||||||
<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>
|
||||||
@ -329,79 +329,79 @@ 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="#orgf299333">1. Introduction</a></li>
|
<li><a href="#orge2d69a3">1. Introduction</a></li>
|
||||||
<li><a href="#orga498675">2. Numerical evaluation of the energy</a>
|
<li><a href="#org9d76d23">2. Numerical evaluation of the energy</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#orgb0829cd">2.1. Local energy</a>
|
<li><a href="#orgb4a6934">2.1. Local energy</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#org830c4df">2.1.1. Exercise 1</a></li>
|
<li><a href="#org33ea1f4">2.1.1. Exercise 1</a></li>
|
||||||
<li><a href="#org5e55b0e">2.1.2. Exercise 2</a></li>
|
<li><a href="#orgcda7ee9">2.1.2. Exercise 2</a></li>
|
||||||
<li><a href="#org157b696">2.1.3. Exercise 3</a></li>
|
<li><a href="#org956992e">2.1.3. Exercise 3</a></li>
|
||||||
<li><a href="#org8cf8d66">2.1.4. Exercise 4</a></li>
|
<li><a href="#org3bf1555">2.1.4. Exercise 4</a></li>
|
||||||
<li><a href="#org21ca8b1">2.1.5. Exercise 5</a></li>
|
<li><a href="#orgff7700a">2.1.5. Exercise 5</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#org08b548b">2.2. Plot of the local energy along the \(x\) axis</a>
|
<li><a href="#org7240b50">2.2. Plot of the local energy along the \(x\) axis</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#orgd0e451a">2.2.1. Exercise</a></li>
|
<li><a href="#orge76699d">2.2.1. Exercise</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#orge8741a2">2.3. Numerical estimation of the energy</a>
|
<li><a href="#org105965f">2.3. Numerical estimation of the energy</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#orge2b254a">2.3.1. Exercise</a></li>
|
<li><a href="#org47bfbe9">2.3.1. Exercise</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#org7265b92">2.4. Variance of the local energy</a>
|
<li><a href="#org1575190">2.4. Variance of the local energy</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#org6750e89">2.4.1. Exercise (optional)</a></li>
|
<li><a href="#org0150ff6">2.4.1. Exercise (optional)</a></li>
|
||||||
<li><a href="#orgf450472">2.4.2. Exercise</a></li>
|
<li><a href="#org55fc68f">2.4.2. Exercise</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#orga0d01b1">3. Variational Monte Carlo</a>
|
<li><a href="#orga7e4e97">3. Variational Monte Carlo</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#orgac99646">3.1. Computation of the statistical error</a>
|
<li><a href="#org45b26a4">3.1. Computation of the statistical error</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#org61acbfb">3.1.1. Exercise</a></li>
|
<li><a href="#org4c845e7">3.1.1. Exercise</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#orgb5f1313">3.2. Uniform sampling in the box</a>
|
<li><a href="#orgdc12f6e">3.2. Uniform sampling in the box</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#org7bd7aa4">3.2.1. Exercise</a></li>
|
<li><a href="#orgc2b6bc6">3.2.1. Exercise</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#orgb561165">3.3. Metropolis sampling with \(\Psi^2\)</a>
|
<li><a href="#org18426ef">3.3. Metropolis sampling with \(\Psi^2\)</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#org2cb3a9a">3.3.1. Exercise</a></li>
|
<li><a href="#org6a1822f">3.3.1. Exercise</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#org5488785">3.4. Gaussian random number generator</a></li>
|
<li><a href="#org8533557">3.4. Gaussian random number generator</a></li>
|
||||||
<li><a href="#orgdae1b8d">3.5. Generalized Metropolis algorithm</a>
|
<li><a href="#orge449a99">3.5. Generalized Metropolis algorithm</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#org0e82022">3.5.1. Exercise 1</a></li>
|
<li><a href="#orga7f252b">3.5.1. Exercise 1</a></li>
|
||||||
<li><a href="#orgff683d7">3.5.2. Exercise 2</a></li>
|
<li><a href="#org3464cd2">3.5.2. Exercise 2</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#org7be5c8a">4. <span class="todo TODO">TODO</span> Diffusion Monte Carlo</a>
|
<li><a href="#orgeaf3c62">4. Diffusion Monte Carlo</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#org28a37b3">4.1. <span class="todo TODO">TODO</span> Hydrogen atom</a>
|
<li><a href="#org9a1adba">4.1. <span class="todo TODO">TODO</span> Hydrogen atom</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#org6cce425">4.1.1. Exercise</a></li>
|
<li><a href="#orgd3bc2ab">4.1.1. Exercise</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#orgc2c13f0">4.2. <span class="todo TODO">TODO</span> Dihydrogen</a></li>
|
<li><a href="#org2731eaf">4.2. <span class="todo TODO">TODO</span> Dihydrogen</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="#org27720ac">5. <span class="todo TODO">TODO</span> <code>[0/1]</code> Last things to do</a></li>
|
<li><a href="#org49c6274">5. <span class="todo TODO">TODO</span> <code>[0/1]</code> Last things to do</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-orgf299333" class="outline-2">
|
<div id="outline-container-orge2d69a3" class="outline-2">
|
||||||
<h2 id="orgf299333"><span class="section-number-2">1</span> Introduction</h2>
|
<h2 id="orge2d69a3"><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)
|
||||||
@ -436,8 +436,8 @@ coordinates, etc).
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div id="outline-container-orga498675" class="outline-2">
|
<div id="outline-container-org9d76d23" class="outline-2">
|
||||||
<h2 id="orga498675"><span class="section-number-2">2</span> Numerical evaluation of the energy</h2>
|
<h2 id="org9d76d23"><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
|
||||||
@ -510,8 +510,8 @@ E & = & \frac{\langle \Psi| \hat{H} | \Psi\rangle}{\langle \Psi |\Psi \rangle}
|
|||||||
\end{eqnarray*}
|
\end{eqnarray*}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-orgb0829cd" class="outline-3">
|
<div id="outline-container-orgb4a6934" class="outline-3">
|
||||||
<h3 id="orgb0829cd"><span class="section-number-3">2.1</span> Local energy</h3>
|
<h3 id="orgb4a6934"><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">
|
||||||
<p>
|
<p>
|
||||||
Write all the functions of this section in a single file :
|
Write all the functions of this section in a single file :
|
||||||
@ -534,8 +534,8 @@ to catch the error.
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-org830c4df" class="outline-4">
|
<div id="outline-container-org33ea1f4" class="outline-4">
|
||||||
<h4 id="org830c4df"><span class="section-number-4">2.1.1</span> Exercise 1</h4>
|
<h4 id="org33ea1f4"><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>
|
||||||
@ -546,8 +546,8 @@ Find the theoretical value of \(a\) for which \(\Psi\) is an eigenfunction of \(
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-org5e55b0e" class="outline-4">
|
<div id="outline-container-orgcda7ee9" class="outline-4">
|
||||||
<h4 id="org5e55b0e"><span class="section-number-4">2.1.2</span> Exercise 2</h4>
|
<h4 id="orgcda7ee9"><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>
|
||||||
@ -567,7 +567,7 @@ and returns the potential.
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ol class="org-ol">
|
<ol class="org-ol">
|
||||||
<li><a id="orge961854"></a>Python<br />
|
<li><a id="org7d91de4"></a>Python<br />
|
||||||
<div class="outline-text-5" id="text-2-1-2-1">
|
<div class="outline-text-5" id="text-2-1-2-1">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">import</span> numpy <span style="color: #a020f0;">as</span> np
|
<pre class="src src-python"><span style="color: #a020f0;">import</span> numpy <span style="color: #a020f0;">as</span> np
|
||||||
@ -579,7 +579,7 @@ and returns the potential.
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org84057f7"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="org494b991"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-2-1-2-2">
|
<div class="outline-text-5" id="text-2-1-2-2">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">import</span> numpy <span style="color: #a020f0;">as</span> np
|
<pre class="src src-python"><span style="color: #a020f0;">import</span> numpy <span style="color: #a020f0;">as</span> np
|
||||||
@ -593,7 +593,7 @@ and returns the potential.
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="orgeea877e"></a>Fortran<br />
|
<li><a id="orgab29a76"></a>Fortran<br />
|
||||||
<div class="outline-text-5" id="text-2-1-2-3">
|
<div class="outline-text-5" id="text-2-1-2-3">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #228b22;">double precision </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">potential</span><span style="color: #000000; background-color: #ffffff;">(r)</span>
|
<pre class="src src-f90"><span style="color: #228b22;">double precision </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">potential</span><span style="color: #000000; background-color: #ffffff;">(r)</span>
|
||||||
@ -606,7 +606,7 @@ and returns the potential.
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="orgb7da713"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="org8d2870b"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-2-1-2-4">
|
<div class="outline-text-5" id="text-2-1-2-4">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #228b22;">double precision </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">potential</span><span style="color: #000000; background-color: #ffffff;">(r)</span>
|
<pre class="src src-f90"><span style="color: #228b22;">double precision </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">potential</span><span style="color: #000000; background-color: #ffffff;">(r)</span>
|
||||||
@ -627,8 +627,8 @@ and returns the potential.
|
|||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-org157b696" class="outline-4">
|
<div id="outline-container-org956992e" class="outline-4">
|
||||||
<h4 id="org157b696"><span class="section-number-4">2.1.3</span> Exercise 3</h4>
|
<h4 id="org956992e"><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>
|
||||||
@ -641,7 +641,7 @@ input arguments, and returns a scalar.
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ol class="org-ol">
|
<ol class="org-ol">
|
||||||
<li><a id="org2c9d379"></a>Python<br />
|
<li><a id="org94ba372"></a>Python<br />
|
||||||
<div class="outline-text-5" id="text-2-1-3-1">
|
<div class="outline-text-5" id="text-2-1-3-1">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">def</span> <span style="color: #0000ff;">psi</span>(a, r):
|
<pre class="src src-python"><span style="color: #a020f0;">def</span> <span style="color: #0000ff;">psi</span>(a, r):
|
||||||
@ -651,7 +651,7 @@ input arguments, and returns a scalar.
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="orgced12e9"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="orge092858"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-2-1-3-2">
|
<div class="outline-text-5" id="text-2-1-3-2">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">def</span> <span style="color: #0000ff;">psi</span>(a, r):
|
<pre class="src src-python"><span style="color: #a020f0;">def</span> <span style="color: #0000ff;">psi</span>(a, r):
|
||||||
@ -661,7 +661,7 @@ input arguments, and returns a scalar.
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="orgebf1a90"></a>Fortran<br />
|
<li><a id="org84a3e33"></a>Fortran<br />
|
||||||
<div class="outline-text-5" id="text-2-1-3-3">
|
<div class="outline-text-5" id="text-2-1-3-3">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #228b22;">double precision </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">psi</span><span style="color: #000000; background-color: #ffffff;">(a, r)</span>
|
<pre class="src src-f90"><span style="color: #228b22;">double precision </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">psi</span><span style="color: #000000; background-color: #ffffff;">(a, r)</span>
|
||||||
@ -674,7 +674,7 @@ input arguments, and returns a scalar.
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="orgd56cf60"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="org9de0a8e"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-2-1-3-4">
|
<div class="outline-text-5" id="text-2-1-3-4">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #228b22;">double precision </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">psi</span><span style="color: #000000; background-color: #ffffff;">(a, r)</span>
|
<pre class="src src-f90"><span style="color: #228b22;">double precision </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">psi</span><span style="color: #000000; background-color: #ffffff;">(a, r)</span>
|
||||||
@ -689,8 +689,8 @@ input arguments, and returns a scalar.
|
|||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-org8cf8d66" class="outline-4">
|
<div id="outline-container-org3bf1555" class="outline-4">
|
||||||
<h4 id="org8cf8d66"><span class="section-number-4">2.1.4</span> Exercise 4</h4>
|
<h4 id="org3bf1555"><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>
|
||||||
@ -749,7 +749,7 @@ So the local kinetic energy is
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ol class="org-ol">
|
<ol class="org-ol">
|
||||||
<li><a id="orgc7a7fcb"></a>Python<br />
|
<li><a id="orgacdc9db"></a>Python<br />
|
||||||
<div class="outline-text-5" id="text-2-1-4-1">
|
<div class="outline-text-5" id="text-2-1-4-1">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">def</span> <span style="color: #0000ff;">kinetic</span>(a,r):
|
<pre class="src src-python"><span style="color: #a020f0;">def</span> <span style="color: #0000ff;">kinetic</span>(a,r):
|
||||||
@ -759,7 +759,7 @@ So the local kinetic energy is
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="orgd3babda"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="orgfea2b7a"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-2-1-4-2">
|
<div class="outline-text-5" id="text-2-1-4-2">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">def</span> <span style="color: #0000ff;">kinetic</span>(a,r):
|
<pre class="src src-python"><span style="color: #a020f0;">def</span> <span style="color: #0000ff;">kinetic</span>(a,r):
|
||||||
@ -771,7 +771,7 @@ So the local kinetic energy is
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org06d7337"></a>Fortran<br />
|
<li><a id="org0c94762"></a>Fortran<br />
|
||||||
<div class="outline-text-5" id="text-2-1-4-3">
|
<div class="outline-text-5" id="text-2-1-4-3">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #228b22;">double precision </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">kinetic</span><span style="color: #000000; background-color: #ffffff;">(a,r)</span>
|
<pre class="src src-f90"><span style="color: #228b22;">double precision </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">kinetic</span><span style="color: #000000; background-color: #ffffff;">(a,r)</span>
|
||||||
@ -784,7 +784,7 @@ So the local kinetic energy is
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org25c9737"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="org93983d7"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-2-1-4-4">
|
<div class="outline-text-5" id="text-2-1-4-4">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #228b22;">double precision </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">kinetic</span><span style="color: #000000; background-color: #ffffff;">(a,r)</span>
|
<pre class="src src-f90"><span style="color: #228b22;">double precision </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">kinetic</span><span style="color: #000000; background-color: #ffffff;">(a,r)</span>
|
||||||
@ -805,8 +805,8 @@ So the local kinetic energy is
|
|||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-org21ca8b1" class="outline-4">
|
<div id="outline-container-orgff7700a" class="outline-4">
|
||||||
<h4 id="org21ca8b1"><span class="section-number-4">2.1.5</span> Exercise 5</h4>
|
<h4 id="orgff7700a"><span class="section-number-4">2.1.5</span> Exercise 5</h4>
|
||||||
<div class="outline-text-4" id="text-2-1-5">
|
<div class="outline-text-4" id="text-2-1-5">
|
||||||
<div class="exercise">
|
<div class="exercise">
|
||||||
<p>
|
<p>
|
||||||
@ -827,7 +827,7 @@ local kinetic energy.
|
|||||||
|
|
||||||
|
|
||||||
<ol class="org-ol">
|
<ol class="org-ol">
|
||||||
<li><a id="orgee522b1"></a>Python<br />
|
<li><a id="orgf0cdfee"></a>Python<br />
|
||||||
<div class="outline-text-5" id="text-2-1-5-1">
|
<div class="outline-text-5" id="text-2-1-5-1">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">def</span> <span style="color: #0000ff;">e_loc</span>(a,r):
|
<pre class="src src-python"><span style="color: #a020f0;">def</span> <span style="color: #0000ff;">e_loc</span>(a,r):
|
||||||
@ -837,7 +837,7 @@ local kinetic energy.
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="orgd621630"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="org969f0f3"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-2-1-5-2">
|
<div class="outline-text-5" id="text-2-1-5-2">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">def</span> <span style="color: #0000ff;">e_loc</span>(a,r):
|
<pre class="src src-python"><span style="color: #a020f0;">def</span> <span style="color: #0000ff;">e_loc</span>(a,r):
|
||||||
@ -847,7 +847,7 @@ local kinetic energy.
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org87e2046"></a>Fortran<br />
|
<li><a id="org3c963fb"></a>Fortran<br />
|
||||||
<div class="outline-text-5" id="text-2-1-5-3">
|
<div class="outline-text-5" id="text-2-1-5-3">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #228b22;">double precision </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">e_loc</span><span style="color: #000000; background-color: #ffffff;">(a,r)</span>
|
<pre class="src src-f90"><span style="color: #228b22;">double precision </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">e_loc</span><span style="color: #000000; background-color: #ffffff;">(a,r)</span>
|
||||||
@ -860,7 +860,7 @@ local kinetic energy.
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="orga1f7ab8"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="org3c5c2c6"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-2-1-5-4">
|
<div class="outline-text-5" id="text-2-1-5-4">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #228b22;">double precision </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">e_loc</span><span style="color: #000000; background-color: #ffffff;">(a,r)</span>
|
<pre class="src src-f90"><span style="color: #228b22;">double precision </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">e_loc</span><span style="color: #000000; background-color: #ffffff;">(a,r)</span>
|
||||||
@ -877,8 +877,8 @@ local kinetic energy.
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-org08b548b" class="outline-3">
|
<div id="outline-container-org7240b50" class="outline-3">
|
||||||
<h3 id="org08b548b"><span class="section-number-3">2.2</span> Plot of the local energy along the \(x\) axis</h3>
|
<h3 id="org7240b50"><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 class="note">
|
<div class="note">
|
||||||
<p>
|
<p>
|
||||||
@ -889,8 +889,8 @@ choose a grid which does not contain the origin.
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-orgd0e451a" class="outline-4">
|
<div id="outline-container-orge76699d" class="outline-4">
|
||||||
<h4 id="orgd0e451a"><span class="section-number-4">2.2.1</span> Exercise</h4>
|
<h4 id="orge76699d"><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>
|
||||||
@ -905,7 +905,7 @@ Gnuplot to plot the files.
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ol class="org-ol">
|
<ol class="org-ol">
|
||||||
<li><a id="org12fc222"></a>Python<br />
|
<li><a id="org62a6256"></a>Python<br />
|
||||||
<div class="outline-text-5" id="text-2-2-1-1">
|
<div class="outline-text-5" id="text-2-2-1-1">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">import</span> numpy <span style="color: #a020f0;">as</span> np
|
<pre class="src src-python"><span style="color: #a020f0;">import</span> numpy <span style="color: #a020f0;">as</span> np
|
||||||
@ -926,7 +926,7 @@ plt.savefig(<span style="color: #8b2252;">"plot_py.png"</span>)
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org21a57dd"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="org5107d23"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-2-2-1-2">
|
<div class="outline-text-5" id="text-2-2-1-2">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">import</span> numpy <span style="color: #a020f0;">as</span> np
|
<pre class="src src-python"><span style="color: #a020f0;">import</span> numpy <span style="color: #a020f0;">as</span> np
|
||||||
@ -955,7 +955,7 @@ plt.savefig(<span style="color: #8b2252;">"plot_py.png"</span>)
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org3f44ed4"></a>Fortran<br />
|
<li><a id="org90f9638"></a>Fortran<br />
|
||||||
<div class="outline-text-5" id="text-2-2-1-3">
|
<div class="outline-text-5" id="text-2-2-1-3">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #a020f0;">program</span> <span style="color: #0000ff;">plot</span>
|
<pre class="src src-f90"><span style="color: #a020f0;">program</span> <span style="color: #0000ff;">plot</span>
|
||||||
@ -1005,7 +1005,7 @@ plot './data' index 0 using 1:2 with lines title 'a=0.1', \
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="orgf455038"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="org8430122"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-2-2-1-4">
|
<div class="outline-text-5" id="text-2-2-1-4">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #a020f0;">program</span> <span style="color: #0000ff;">plot</span>
|
<pre class="src src-f90"><span style="color: #a020f0;">program</span> <span style="color: #0000ff;">plot</span>
|
||||||
@ -1077,8 +1077,8 @@ plot './data' index 0 using 1:2 with lines title 'a=0.1', \
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-orge8741a2" class="outline-3">
|
<div id="outline-container-org105965f" class="outline-3">
|
||||||
<h3 id="orge8741a2"><span class="section-number-3">2.3</span> Numerical estimation of the energy</h3>
|
<h3 id="org105965f"><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\)
|
||||||
@ -1108,8 +1108,8 @@ The energy is biased because:
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div id="outline-container-orge2b254a" class="outline-4">
|
<div id="outline-container-org47bfbe9" class="outline-4">
|
||||||
<h4 id="orge2b254a"><span class="section-number-4">2.3.1</span> Exercise</h4>
|
<h4 id="org47bfbe9"><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>
|
||||||
@ -1122,7 +1122,7 @@ Compute a numerical estimate of the energy in a grid of
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ol class="org-ol">
|
<ol class="org-ol">
|
||||||
<li><a id="org5d09f81"></a>Python<br />
|
<li><a id="orgc27ec9c"></a>Python<br />
|
||||||
<div class="outline-text-5" id="text-2-3-1-1">
|
<div class="outline-text-5" id="text-2-3-1-1">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">import</span> numpy <span style="color: #a020f0;">as</span> np
|
<pre class="src src-python"><span style="color: #a020f0;">import</span> numpy <span style="color: #a020f0;">as</span> np
|
||||||
@ -1142,7 +1142,7 @@ Compute a numerical estimate of the energy in a grid of
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org06002d5"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="org39baca5"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-2-3-1-2">
|
<div class="outline-text-5" id="text-2-3-1-2">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">import</span> numpy <span style="color: #a020f0;">as</span> np
|
<pre class="src src-python"><span style="color: #a020f0;">import</span> numpy <span style="color: #a020f0;">as</span> np
|
||||||
@ -1174,7 +1174,7 @@ Compute a numerical estimate of the energy in a grid of
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org83d5b57"></a>Fortran<br />
|
<li><a id="org880da72"></a>Fortran<br />
|
||||||
<div class="outline-text-5" id="text-2-3-1-3">
|
<div class="outline-text-5" id="text-2-3-1-3">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #a020f0;">program</span> <span style="color: #0000ff;">energy_hydrogen</span>
|
<pre class="src src-f90"><span style="color: #a020f0;">program</span> <span style="color: #0000ff;">energy_hydrogen</span>
|
||||||
@ -1211,7 +1211,7 @@ To compile the Fortran and run it:
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org23be867"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="orgd745979"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-2-3-1-4">
|
<div class="outline-text-5" id="text-2-3-1-4">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #a020f0;">program</span> <span style="color: #0000ff;">energy_hydrogen</span>
|
<pre class="src src-f90"><span style="color: #a020f0;">program</span> <span style="color: #0000ff;">energy_hydrogen</span>
|
||||||
@ -1280,8 +1280,8 @@ a = 2.0000000000000000 E = -8.0869806678448772E-002
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-org7265b92" class="outline-3">
|
<div id="outline-container-org1575190" class="outline-3">
|
||||||
<h3 id="org7265b92"><span class="section-number-3">2.4</span> Variance of the local energy</h3>
|
<h3 id="org1575190"><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\)
|
||||||
@ -1308,8 +1308,8 @@ energy can be used as a measure of the quality of a wave function.
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-org6750e89" class="outline-4">
|
<div id="outline-container-org0150ff6" class="outline-4">
|
||||||
<h4 id="org6750e89"><span class="section-number-4">2.4.1</span> Exercise (optional)</h4>
|
<h4 id="org0150ff6"><span class="section-number-4">2.4.1</span> Exercise (optional)</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>
|
||||||
@ -1321,8 +1321,8 @@ Prove that :
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-orgf450472" class="outline-4">
|
<div id="outline-container-org55fc68f" class="outline-4">
|
||||||
<h4 id="orgf450472"><span class="section-number-4">2.4.2</span> Exercise</h4>
|
<h4 id="org55fc68f"><span class="section-number-4">2.4.2</span> Exercise</h4>
|
||||||
<div class="outline-text-4" id="text-2-4-2">
|
<div class="outline-text-4" id="text-2-4-2">
|
||||||
<div class="exercise">
|
<div class="exercise">
|
||||||
<p>
|
<p>
|
||||||
@ -1337,7 +1337,7 @@ in a grid of \(50\times50\times50\) points in the range
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ol class="org-ol">
|
<ol class="org-ol">
|
||||||
<li><a id="org0ab88e8"></a>Python<br />
|
<li><a id="orgf3b63cb"></a>Python<br />
|
||||||
<div class="outline-text-5" id="text-2-4-2-1">
|
<div class="outline-text-5" id="text-2-4-2-1">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">import</span> numpy <span style="color: #a020f0;">as</span> np
|
<pre class="src src-python"><span style="color: #a020f0;">import</span> numpy <span style="color: #a020f0;">as</span> np
|
||||||
@ -1356,7 +1356,7 @@ in a grid of \(50\times50\times50\) points in the range
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="orga43af8f"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="org16ae8e3"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-2-4-2-2">
|
<div class="outline-text-5" id="text-2-4-2-2">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">import</span> numpy <span style="color: #a020f0;">as</span> np
|
<pre class="src src-python"><span style="color: #a020f0;">import</span> numpy <span style="color: #a020f0;">as</span> np
|
||||||
@ -1392,7 +1392,7 @@ in a grid of \(50\times50\times50\) points in the range
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org9c598ac"></a>Fortran<br />
|
<li><a id="org6a506e9"></a>Fortran<br />
|
||||||
<div class="outline-text-5" id="text-2-4-2-3">
|
<div class="outline-text-5" id="text-2-4-2-3">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #a020f0;">program</span> <span style="color: #0000ff;">variance_hydrogen</span>
|
<pre class="src src-f90"><span style="color: #a020f0;">program</span> <span style="color: #0000ff;">variance_hydrogen</span>
|
||||||
@ -1434,7 +1434,7 @@ To compile and run:
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="orgaf6bb3a"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="org798181a"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-2-4-2-4">
|
<div class="outline-text-5" id="text-2-4-2-4">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #a020f0;">program</span> <span style="color: #0000ff;">variance_hydrogen</span>
|
<pre class="src src-f90"><span style="color: #a020f0;">program</span> <span style="color: #0000ff;">variance_hydrogen</span>
|
||||||
@ -1511,8 +1511,8 @@ a = 2.0000000000000000 E = -8.0869806678448772E-002 s2 = 1.806881
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div id="outline-container-orga0d01b1" class="outline-2">
|
<div id="outline-container-orga7e4e97" class="outline-2">
|
||||||
<h2 id="orga0d01b1"><span class="section-number-2">3</span> Variational Monte Carlo</h2>
|
<h2 id="orga7e4e97"><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
|
||||||
@ -1528,8 +1528,8 @@ interval.
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-orgac99646" class="outline-3">
|
<div id="outline-container-org45b26a4" class="outline-3">
|
||||||
<h3 id="orgac99646"><span class="section-number-3">3.1</span> Computation of the statistical error</h3>
|
<h3 id="org45b26a4"><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\)
|
||||||
@ -1569,8 +1569,8 @@ And the confidence interval is given by
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-org61acbfb" class="outline-4">
|
<div id="outline-container-org4c845e7" class="outline-4">
|
||||||
<h4 id="org61acbfb"><span class="section-number-4">3.1.1</span> Exercise</h4>
|
<h4 id="org4c845e7"><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>
|
||||||
@ -1582,7 +1582,7 @@ input array.
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ol class="org-ol">
|
<ol class="org-ol">
|
||||||
<li><a id="orgf6abafc"></a>Python<br />
|
<li><a id="orgae03b17"></a>Python<br />
|
||||||
<div class="outline-text-5" id="text-3-1-1-1">
|
<div class="outline-text-5" id="text-3-1-1-1">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">from</span> math <span style="color: #a020f0;">import</span> sqrt
|
<pre class="src src-python"><span style="color: #a020f0;">from</span> math <span style="color: #a020f0;">import</span> sqrt
|
||||||
@ -1594,7 +1594,7 @@ input array.
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="orge1f431d"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="orgc54a9d0"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-3-1-1-2">
|
<div class="outline-text-5" id="text-3-1-1-2">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">from</span> math <span style="color: #a020f0;">import</span> sqrt
|
<pre class="src src-python"><span style="color: #a020f0;">from</span> math <span style="color: #a020f0;">import</span> sqrt
|
||||||
@ -1613,7 +1613,7 @@ input array.
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org97503d5"></a>Fortran<br />
|
<li><a id="orga563fa2"></a>Fortran<br />
|
||||||
<div class="outline-text-5" id="text-3-1-1-3">
|
<div class="outline-text-5" id="text-3-1-1-3">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #a020f0;">subroutine</span> <span style="color: #0000ff;">ave_error</span>(x,n,ave,err)
|
<pre class="src src-f90"><span style="color: #a020f0;">subroutine</span> <span style="color: #0000ff;">ave_error</span>(x,n,ave,err)
|
||||||
@ -1628,7 +1628,7 @@ input array.
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="orge014294"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="org860e0aa"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-3-1-1-4">
|
<div class="outline-text-5" id="text-3-1-1-4">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #a020f0;">subroutine</span> <span style="color: #0000ff;">ave_error</span>(x,n,ave,err)
|
<pre class="src src-f90"><span style="color: #a020f0;">subroutine</span> <span style="color: #0000ff;">ave_error</span>(x,n,ave,err)
|
||||||
@ -1656,8 +1656,8 @@ input array.
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-orgb5f1313" class="outline-3">
|
<div id="outline-container-orgdc12f6e" class="outline-3">
|
||||||
<h3 id="orgb5f1313"><span class="section-number-3">3.2</span> Uniform sampling in the box</h3>
|
<h3 id="orgdc12f6e"><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
|
||||||
@ -1691,8 +1691,8 @@ compute the statistical error.
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-org7bd7aa4" class="outline-4">
|
<div id="outline-container-orgc2b6bc6" class="outline-4">
|
||||||
<h4 id="org7bd7aa4"><span class="section-number-4">3.2.1</span> Exercise</h4>
|
<h4 id="orgc2b6bc6"><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>
|
||||||
@ -1706,7 +1706,7 @@ compute the average energy and the associated error bar.
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ol class="org-ol">
|
<ol class="org-ol">
|
||||||
<li><a id="org712007d"></a>Python<br />
|
<li><a id="orgbd2460b"></a>Python<br />
|
||||||
<div class="outline-text-5" id="text-3-2-1-1">
|
<div class="outline-text-5" id="text-3-2-1-1">
|
||||||
<div class="note">
|
<div class="note">
|
||||||
<p>
|
<p>
|
||||||
@ -1732,7 +1732,7 @@ the <a href="https://numpy.org/doc/stable/reference/random/generated/numpy.rando
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="orgaae2178"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="org72e35dc"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-3-2-1-2">
|
<div class="outline-text-5" id="text-3-2-1-2">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">from</span> hydrogen <span style="color: #a020f0;">import</span> *
|
<pre class="src src-python"><span style="color: #a020f0;">from</span> hydrogen <span style="color: #a020f0;">import</span> *
|
||||||
@ -1759,7 +1759,7 @@ the <a href="https://numpy.org/doc/stable/reference/random/generated/numpy.rando
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org1c6621e"></a>Fortran<br />
|
<li><a id="org19444fc"></a>Fortran<br />
|
||||||
<div class="outline-text-5" id="text-3-2-1-3">
|
<div class="outline-text-5" id="text-3-2-1-3">
|
||||||
<div class="note">
|
<div class="note">
|
||||||
<p>
|
<p>
|
||||||
@ -1819,7 +1819,7 @@ well as the index of the current step.
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org3f1df6b"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="org3fe88a8"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-3-2-1-4">
|
<div class="outline-text-5" id="text-3-2-1-4">
|
||||||
<div class="note">
|
<div class="note">
|
||||||
<p>
|
<p>
|
||||||
@ -1892,8 +1892,8 @@ E = -0.49588321986667677 +/- 7.1758863546737969E-004
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-orgb561165" class="outline-3">
|
<div id="outline-container-org18426ef" class="outline-3">
|
||||||
<h3 id="orgb561165"><span class="section-number-3">3.3</span> Metropolis sampling with \(\Psi^2\)</h3>
|
<h3 id="org18426ef"><span class="section-number-3">3.3</span> Metropolis sampling with \(\Psi^2\)</h3>
|
||||||
<div class="outline-text-3" id="text-3-3">
|
<div class="outline-text-3" id="text-3-3">
|
||||||
<p>
|
<p>
|
||||||
We will now use the square of the wave function to sample random
|
We will now use the square of the wave function to sample random
|
||||||
@ -1981,8 +1981,8 @@ step such that the acceptance rate is close to 0.5 is a good compromise.
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div id="outline-container-org2cb3a9a" class="outline-4">
|
<div id="outline-container-org6a1822f" class="outline-4">
|
||||||
<h4 id="org2cb3a9a"><span class="section-number-4">3.3.1</span> Exercise</h4>
|
<h4 id="org6a1822f"><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>
|
||||||
@ -2003,7 +2003,7 @@ Can you observe a reduction in the statistical error?
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ol class="org-ol">
|
<ol class="org-ol">
|
||||||
<li><a id="org2c38f53"></a>Python<br />
|
<li><a id="orga5398a4"></a>Python<br />
|
||||||
<div class="outline-text-5" id="text-3-3-1-1">
|
<div class="outline-text-5" id="text-3-3-1-1">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">from</span> hydrogen <span style="color: #a020f0;">import</span> *
|
<pre class="src src-python"><span style="color: #a020f0;">from</span> hydrogen <span style="color: #a020f0;">import</span> *
|
||||||
@ -2033,7 +2033,7 @@ Can you observe a reduction in the statistical error?
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org5b331dc"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="org2393dd5"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-3-3-1-2">
|
<div class="outline-text-5" id="text-3-3-1-2">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">from</span> hydrogen <span style="color: #a020f0;">import</span> *
|
<pre class="src src-python"><span style="color: #a020f0;">from</span> hydrogen <span style="color: #a020f0;">import</span> *
|
||||||
@ -2076,7 +2076,7 @@ Can you observe a reduction in the statistical error?
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org2aefa5a"></a>Fortran<br />
|
<li><a id="orgae9a599"></a>Fortran<br />
|
||||||
<div class="outline-text-5" id="text-3-3-1-3">
|
<div class="outline-text-5" id="text-3-3-1-3">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #a020f0;">subroutine</span> <span style="color: #0000ff;">metropolis_montecarlo</span>(a,nmax,tau,energy,accep)
|
<pre class="src src-f90"><span style="color: #a020f0;">subroutine</span> <span style="color: #0000ff;">metropolis_montecarlo</span>(a,nmax,tau,energy,accep)
|
||||||
@ -2129,7 +2129,7 @@ Can you observe a reduction in the statistical error?
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org302096b"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="org221e131"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-3-3-1-4">
|
<div class="outline-text-5" id="text-3-3-1-4">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #a020f0;">subroutine</span> <span style="color: #0000ff;">metropolis_montecarlo</span>(a,nmax,tau,energy,accep)
|
<pre class="src src-f90"><span style="color: #a020f0;">subroutine</span> <span style="color: #0000ff;">metropolis_montecarlo</span>(a,nmax,tau,energy,accep)
|
||||||
@ -2209,8 +2209,8 @@ A = 0.51713866666666664 +/- 3.7072551835783688E-004
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-org5488785" class="outline-3">
|
<div id="outline-container-org8533557" class="outline-3">
|
||||||
<h3 id="org5488785"><span class="section-number-3">3.4</span> Gaussian random number generator</h3>
|
<h3 id="org8533557"><span class="section-number-3">3.4</span> Gaussian random number generator</h3>
|
||||||
<div class="outline-text-3" id="text-3-4">
|
<div class="outline-text-3" id="text-3-4">
|
||||||
<p>
|
<p>
|
||||||
To obtain Gaussian-distributed random numbers, you can apply the
|
To obtain Gaussian-distributed random numbers, you can apply the
|
||||||
@ -2267,8 +2267,8 @@ In Python, you can use the <a href="https://numpy.org/doc/stable/reference/rando
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="outline-container-orgdae1b8d" class="outline-3">
|
<div id="outline-container-orge449a99" class="outline-3">
|
||||||
<h3 id="orgdae1b8d"><span class="section-number-3">3.5</span> Generalized Metropolis algorithm</h3>
|
<h3 id="orge449a99"><span class="section-number-3">3.5</span> Generalized Metropolis algorithm</h3>
|
||||||
<div class="outline-text-3" id="text-3-5">
|
<div class="outline-text-3" id="text-3-5">
|
||||||
<p>
|
<p>
|
||||||
One can use more efficient numerical schemes to move the electrons,
|
One can use more efficient numerical schemes to move the electrons,
|
||||||
@ -2367,8 +2367,8 @@ The transition probability becomes:
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div id="outline-container-org0e82022" class="outline-4">
|
<div id="outline-container-orga7f252b" class="outline-4">
|
||||||
<h4 id="org0e82022"><span class="section-number-4">3.5.1</span> Exercise 1</h4>
|
<h4 id="orga7f252b"><span class="section-number-4">3.5.1</span> Exercise 1</h4>
|
||||||
<div class="outline-text-4" id="text-3-5-1">
|
<div class="outline-text-4" id="text-3-5-1">
|
||||||
<div class="exercise">
|
<div class="exercise">
|
||||||
<p>
|
<p>
|
||||||
@ -2379,7 +2379,7 @@ Write a function to compute the drift vector \(\frac{\nabla \Psi(\mathbf{r})}{\P
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ol class="org-ol">
|
<ol class="org-ol">
|
||||||
<li><a id="orgd1a5652"></a>Python<br />
|
<li><a id="org2dc42f4"></a>Python<br />
|
||||||
<div class="outline-text-5" id="text-3-5-1-1">
|
<div class="outline-text-5" id="text-3-5-1-1">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">def</span> <span style="color: #0000ff;">drift</span>(a,r):
|
<pre class="src src-python"><span style="color: #a020f0;">def</span> <span style="color: #0000ff;">drift</span>(a,r):
|
||||||
@ -2389,7 +2389,7 @@ Write a function to compute the drift vector \(\frac{\nabla \Psi(\mathbf{r})}{\P
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org9592ea3"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="orgba9a4b2"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-3-5-1-2">
|
<div class="outline-text-5" id="text-3-5-1-2">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">def</span> <span style="color: #0000ff;">drift</span>(a,r):
|
<pre class="src src-python"><span style="color: #a020f0;">def</span> <span style="color: #0000ff;">drift</span>(a,r):
|
||||||
@ -2400,7 +2400,7 @@ Write a function to compute the drift vector \(\frac{\nabla \Psi(\mathbf{r})}{\P
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org295599b"></a>Fortran<br />
|
<li><a id="org73a3d56"></a>Fortran<br />
|
||||||
<div class="outline-text-5" id="text-3-5-1-3">
|
<div class="outline-text-5" id="text-3-5-1-3">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #a020f0;">subroutine</span> <span style="color: #0000ff;">drift</span>(a,r,b)
|
<pre class="src src-f90"><span style="color: #a020f0;">subroutine</span> <span style="color: #0000ff;">drift</span>(a,r,b)
|
||||||
@ -2414,7 +2414,7 @@ Write a function to compute the drift vector \(\frac{\nabla \Psi(\mathbf{r})}{\P
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org60f9564"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="org8b12c06"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-3-5-1-4">
|
<div class="outline-text-5" id="text-3-5-1-4">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #a020f0;">subroutine</span> <span style="color: #0000ff;">drift</span>(a,r,b)
|
<pre class="src src-f90"><span style="color: #a020f0;">subroutine</span> <span style="color: #0000ff;">drift</span>(a,r,b)
|
||||||
@ -2432,8 +2432,8 @@ Write a function to compute the drift vector \(\frac{\nabla \Psi(\mathbf{r})}{\P
|
|||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-orgff683d7" class="outline-4">
|
<div id="outline-container-org3464cd2" class="outline-4">
|
||||||
<h4 id="orgff683d7"><span class="section-number-4">3.5.2</span> Exercise 2</h4>
|
<h4 id="org3464cd2"><span class="section-number-4">3.5.2</span> Exercise 2</h4>
|
||||||
<div class="outline-text-4" id="text-3-5-2">
|
<div class="outline-text-4" id="text-3-5-2">
|
||||||
<div class="exercise">
|
<div class="exercise">
|
||||||
<p>
|
<p>
|
||||||
@ -2445,7 +2445,7 @@ Modify the previous program to introduce the drifted diffusion scheme.
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ol class="org-ol">
|
<ol class="org-ol">
|
||||||
<li><a id="org27aa025"></a>Python<br />
|
<li><a id="org4c192aa"></a>Python<br />
|
||||||
<div class="outline-text-5" id="text-3-5-2-1">
|
<div class="outline-text-5" id="text-3-5-2-1">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">from</span> hydrogen <span style="color: #a020f0;">import</span> *
|
<pre class="src src-python"><span style="color: #a020f0;">from</span> hydrogen <span style="color: #a020f0;">import</span> *
|
||||||
@ -2474,7 +2474,7 @@ Modify the previous program to introduce the drifted diffusion scheme.
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org75cf942"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="org991d484"></a>Python   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-3-5-2-2">
|
<div class="outline-text-5" id="text-3-5-2-2">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">from</span> hydrogen <span style="color: #a020f0;">import</span> *
|
<pre class="src src-python"><span style="color: #a020f0;">from</span> hydrogen <span style="color: #a020f0;">import</span> *
|
||||||
@ -2529,7 +2529,7 @@ Modify the previous program to introduce the drifted diffusion scheme.
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="orga1d0593"></a>Fortran<br />
|
<li><a id="org5337621"></a>Fortran<br />
|
||||||
<div class="outline-text-5" id="text-3-5-2-3">
|
<div class="outline-text-5" id="text-3-5-2-3">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #a020f0;">subroutine</span> <span style="color: #0000ff;">variational_montecarlo</span>(a,tau,nmax,energy,accep_rate)
|
<pre class="src src-f90"><span style="color: #a020f0;">subroutine</span> <span style="color: #0000ff;">variational_montecarlo</span>(a,tau,nmax,energy,accep_rate)
|
||||||
@ -2579,7 +2579,7 @@ Modify the previous program to introduce the drifted diffusion scheme.
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li><a id="org1f6e47d"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
<li><a id="org6855d0c"></a>Fortran   <span class="tag"><span class="solution">solution</span></span><br />
|
||||||
<div class="outline-text-5" id="text-3-5-2-4">
|
<div class="outline-text-5" id="text-3-5-2-4">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #a020f0;">subroutine</span> <span style="color: #0000ff;">variational_montecarlo</span>(a,tau,nmax,energy,accep_rate)
|
<pre class="src src-f90"><span style="color: #a020f0;">subroutine</span> <span style="color: #0000ff;">variational_montecarlo</span>(a,tau,nmax,energy,accep_rate)
|
||||||
@ -2672,8 +2672,8 @@ A = 0.78861366666666666 +/- 3.7855335138754813E-004
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-org7be5c8a" class="outline-2">
|
<div id="outline-container-orgeaf3c62" class="outline-2">
|
||||||
<h2 id="org7be5c8a"><span class="section-number-2">4</span> <span class="todo TODO">TODO</span> Diffusion Monte Carlo</h2>
|
<h2 id="orgeaf3c62"><span class="section-number-2">4</span> Diffusion Monte Carlo</h2>
|
||||||
<div class="outline-text-2" id="text-4">
|
<div class="outline-text-2" id="text-4">
|
||||||
<p>
|
<p>
|
||||||
Consider the time-dependent Schrödinger equation:
|
Consider the time-dependent Schrödinger equation:
|
||||||
@ -2713,7 +2713,7 @@ Now, let's replace the time variable \(t\) by an imaginary time variable
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
\[
|
\[
|
||||||
-\frac{\partial \psi(\mathbf{r}, t)}{\partial \tau} = \hat{H} \psi(\mathbf{r}, t)
|
-\frac{\partial \psi(\mathbf{r}, \tau)}{\partial \tau} = \hat{H} \psi(\mathbf{r}, \tau)
|
||||||
\]
|
\]
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@ -2724,16 +2724,146 @@ and
|
|||||||
\psi(\mathbf{r},\tau) = \sum_k a_k \exp( -E_k\, \tau) \phi_k(\mathbf{r}).
|
\psi(\mathbf{r},\tau) = \sum_k a_k \exp( -E_k\, \tau) \phi_k(\mathbf{r}).
|
||||||
\]
|
\]
|
||||||
For large positive values of \(\tau\), \(\psi\) is dominated by the
|
For large positive values of \(\tau\), \(\psi\) is dominated by the
|
||||||
\(k=0\) term, namely the ground state.
|
\(k=0\) term, namely the lowest eigenstate.
|
||||||
|
So we can expect that simulating the differetial equation in
|
||||||
|
imaginary time will converge to the exact ground state of the
|
||||||
|
system.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The <a href="https://en.wikipedia.org/wiki/Diffusion_equation">diffusion equation</a> of particles is given by
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
\[
|
||||||
|
\frac{\partial \phi(\mathbf{r},t)}{\partial t} = D\, \Delta \phi(\mathbf{r},t).
|
||||||
|
\]
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The <a href="https://en.wikipedia.org/wiki/Reaction_rate">rate of reaction</a> \(v\) is the speed at which a chemical reaction
|
||||||
|
takes place. In a solution, the rate is given as a function of the
|
||||||
|
concentration \([A]\) by
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
\[
|
||||||
|
v = \frac{d[A]}{dt},
|
||||||
|
\]
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
where the concentration \([A]\) is proportional to the number of particles.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
These two equations allow us to interpret the Schrödinger equation
|
||||||
|
in imaginary time as the combination of:
|
||||||
|
</p>
|
||||||
|
<ul class="org-ul">
|
||||||
|
<li>a diffusion equation with a diffusion coefficient \(D=1/2\) for the
|
||||||
|
kinetic energy, and</li>
|
||||||
|
<li>a rate equation for the potential.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The diffusion equation can be simulated by a Brownian motion:
|
||||||
|
\[ \mathbf{r}_{n+1} = \mathbf{r}_{n} + \sqrt{\tau}\, \chi \]
|
||||||
|
where \(\chi\) is a Gaussian random variable, and the rate equation
|
||||||
|
can be simulated by creating or destroying particles over time.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<i>Diffusion Monte Carlo</i> (DMC) consists in obtaining the ground state of a
|
||||||
|
system by simulating the Schrödinger equation in imaginary time, by
|
||||||
|
the combination of a diffusion process and a rate process.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
In a molecular system, the potential is far from being constant,
|
||||||
|
and diverges at inter-particle coalescence points. Hence, when the
|
||||||
|
rate equation is simulated, it results in very large fluctuations
|
||||||
|
in the numbers of particles, making the calculations impossible in
|
||||||
|
practice.
|
||||||
|
Fortunately, if we multiply the Schrödinger equation by a chosen
|
||||||
|
<i>trial wave function</i> \(\Psi_T(\mathbf{r})\) (Hartree-Fock, Kohn-Sham
|
||||||
|
determinant, CI wave function, <i>etc</i>), one obtains
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
\begin{eqnarray*}
|
||||||
|
\end{eqnarray*}
|
||||||
|
<p>
|
||||||
|
\[
|
||||||
|
-\frac{\partial \psi(\mathbf{r},\tau)}{\partial \tau} \Psi_T(\mathbf{r}) =
|
||||||
|
\left[ -\frac{1}{2} \Delta \psi(\mathbf{r},\tau) + V(\mathbf{r}) \psi(\mathbf{r},\tau) \right] \Psi_T(\mathbf{r})
|
||||||
|
\]
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
\[
|
||||||
|
-\frac{\partial \big[ \psi(\mathbf{r},\tau) \Psi_T(\mathbf{r}) \big]}{\partial \tau}
|
||||||
|
= -\frac{1}{2} \Big( \Delta \big[
|
||||||
|
\psi(\mathbf{r},\tau) \Psi_T(\mathbf{r}) \big] -
|
||||||
|
\psi(\mathbf{r},\tau) \Delta \Psi_T(\mathbf{r}) - 2
|
||||||
|
\nabla \psi(\mathbf{r},\tau) \nabla \Psi_T(\mathbf{r}) \Big) + V(\mathbf{r}) \psi(\mathbf{r},\tau) \Psi_T(\mathbf{r})
|
||||||
|
\]
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
\[
|
||||||
|
-\frac{\partial \big[ \psi(\mathbf{r},\tau) \Psi_T(\mathbf{r}) \big]}{\partial \tau}
|
||||||
|
= -\frac{1}{2} \Delta \big[\psi(\mathbf{r},\tau) \Psi_T(\mathbf{r}) \big] +
|
||||||
|
\frac{1}{2} \psi(\mathbf{r},\tau) \Delta \Psi_T(\mathbf{r}) +
|
||||||
|
\Psi_T(\mathbf{r})\nabla \psi(\mathbf{r},\tau) \frac{\nabla \Psi_T(\mathbf{r})}{\Psi_T(\mathbf{r})} + V(\mathbf{r}) \psi(\mathbf{r},\tau) \Psi_T(\mathbf{r})
|
||||||
|
\]
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
\[
|
||||||
|
-\frac{\partial \big[ \psi(\mathbf{r},\tau) \Psi_T(\mathbf{r}) \big]}{\partial \tau}
|
||||||
|
= -\frac{1}{2} \Delta \big[\psi(\mathbf{r},\tau) \Psi_T(\mathbf{r}) \big] +
|
||||||
|
\psi(\mathbf{r},\tau) \Delta \Psi_T(\mathbf{r}) +
|
||||||
|
\Psi_T(\mathbf{r})\nabla \psi(\mathbf{r},\tau) \frac{\nabla \Psi_T(\mathbf{r})}{\Psi_T(\mathbf{r})} + E_L(\mathbf{r}) \psi(\mathbf{r},\tau) \Psi_T(\mathbf{r})
|
||||||
|
\]
|
||||||
|
\[
|
||||||
|
-\frac{\partial \big[ \psi(\mathbf{r},\tau) \Psi_T(\mathbf{r}) \big]}{\partial \tau}
|
||||||
|
= -\frac{1}{2} \Delta \big[\psi(\mathbf{r},\tau) \Psi_T(\mathbf{r}) \big] +
|
||||||
|
\nabla \left[ \psi(\mathbf{r},\tau) \Psi_T(\mathbf{r})
|
||||||
|
\frac{\nabla \Psi_T(\mathbf{r})}{\Psi_T(\mathbf{r})}
|
||||||
|
\right] + E_L(\mathbf{r}) \psi(\mathbf{r},\tau) \Psi_T(\mathbf{r})
|
||||||
|
\]
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Defining \(\Pi(\mathbf{r},t) = \psi(\mathbf{r},\tau)
|
||||||
|
\Psi_T(\mathbf{r})\),
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
\[
|
||||||
|
-\frac{\partial \Pi(\mathbf{r},\tau)}{\partial \tau}
|
||||||
|
= -\frac{1}{2} \Delta \Pi(\mathbf{r},\tau) +
|
||||||
|
\nabla \left[ \Pi(\mathbf{r},\tau) \frac{\nabla \Psi_T(\mathbf{r})}{\Psi_T(\mathbf{r})}
|
||||||
|
\right] + E_L(\mathbf{r}) \Pi(\mathbf{r},\tau)
|
||||||
|
\]
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The new "potential" is the local energy, which has smaller fluctuations
|
||||||
|
as \(\Psi_T\) tends to the exact wave function. The new "kinetic energy"
|
||||||
|
can be simulated by the drifted diffusion scheme presented in the
|
||||||
|
previous section (VMC).
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="outline-container-org28a37b3" class="outline-3">
|
<div id="outline-container-org9a1adba" class="outline-3">
|
||||||
<h3 id="org28a37b3"><span class="section-number-3">4.1</span> <span class="todo TODO">TODO</span> Hydrogen atom</h3>
|
<h3 id="org9a1adba"><span class="section-number-3">4.1</span> <span class="todo TODO">TODO</span> Hydrogen atom</h3>
|
||||||
<div class="outline-text-3" id="text-4-1">
|
<div class="outline-text-3" id="text-4-1">
|
||||||
</div>
|
</div>
|
||||||
<div id="outline-container-org6cce425" class="outline-4">
|
<div id="outline-container-orgd3bc2ab" class="outline-4">
|
||||||
<h4 id="org6cce425"><span class="section-number-4">4.1.1</span> Exercise</h4>
|
<h4 id="orgd3bc2ab"><span class="section-number-4">4.1.1</span> Exercise</h4>
|
||||||
<div class="outline-text-4" id="text-4-1-1">
|
<div class="outline-text-4" id="text-4-1-1">
|
||||||
<div class="exercise">
|
<div class="exercise">
|
||||||
<p>
|
<p>
|
||||||
@ -2742,11 +2872,12 @@ In the limit \(\tau \rightarrow 0\), you should recover the exact
|
|||||||
energy of H for any value of \(a\).
|
energy of H for any value of \(a\).
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>
|
<ol class="org-ol">
|
||||||
<b>Python</b>
|
<li><a id="org7c90050"></a>Python<br />
|
||||||
</p>
|
<div class="outline-text-5" id="text-4-1-1-1">
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-python"><span style="color: #a020f0;">from</span> hydrogen <span style="color: #a020f0;">import</span> *
|
<pre class="src src-python"><span style="color: #a020f0;">from</span> hydrogen <span style="color: #a020f0;">import</span> *
|
||||||
<span style="color: #a020f0;">from</span> qmc_stats <span style="color: #a020f0;">import</span> *
|
<span style="color: #a020f0;">from</span> qmc_stats <span style="color: #a020f0;">import</span> *
|
||||||
@ -2798,10 +2929,10 @@ energy of H for any value of \(a\).
|
|||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
<ol class="org-ol">
|
<li><a id="org649b06a"></a>Fortran<br />
|
||||||
<li><a id="org481b5c3"></a>Fortran<br />
|
<div class="outline-text-5" id="text-4-1-1-2">
|
||||||
<div class="outline-text-5" id="text-4-1-1-1">
|
|
||||||
<div class="org-src-container">
|
<div class="org-src-container">
|
||||||
<pre class="src src-f90"><span style="color: #a020f0;">subroutine</span> <span style="color: #0000ff;">variational_montecarlo</span>(a,tau,nmax,energy,accep_rate)
|
<pre class="src src-f90"><span style="color: #a020f0;">subroutine</span> <span style="color: #0000ff;">variational_montecarlo</span>(a,tau,nmax,energy,accep_rate)
|
||||||
<span style="color: #a020f0;">implicit</span> <span style="color: #228b22;">none</span>
|
<span style="color: #a020f0;">implicit</span> <span style="color: #228b22;">none</span>
|
||||||
@ -2895,8 +3026,8 @@ A = 0.78861366666666655 +/- 3.5096729498002445E-004
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div id="outline-container-orgc2c13f0" class="outline-3">
|
<div id="outline-container-org2731eaf" class="outline-3">
|
||||||
<h3 id="orgc2c13f0"><span class="section-number-3">4.2</span> <span class="todo TODO">TODO</span> Dihydrogen</h3>
|
<h3 id="org2731eaf"><span class="section-number-3">4.2</span> <span class="todo TODO">TODO</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
|
||||||
@ -2917,8 +3048,8 @@ the nuclei.
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div id="outline-container-org27720ac" class="outline-2">
|
<div id="outline-container-org49c6274" class="outline-2">
|
||||||
<h2 id="org27720ac"><span class="section-number-2">5</span> <span class="todo TODO">TODO</span> <code>[0/1]</code> Last things to do</h2>
|
<h2 id="org49c6274"><span class="section-number-2">5</span> <span class="todo TODO">TODO</span> <code>[0/1]</code> Last things to do</h2>
|
||||||
<div class="outline-text-2" id="text-5">
|
<div class="outline-text-2" id="text-5">
|
||||||
<ul class="org-ul">
|
<ul class="org-ul">
|
||||||
<li class="off"><code>[ ]</code> Prepare 4 questions for the exam: multiple-choice questions
|
<li class="off"><code>[ ]</code> Prepare 4 questions for the exam: multiple-choice questions
|
||||||
@ -2933,7 +3064,7 @@ the H\(_2\) molecule at $R$=1.4010 bohr. Answer: 0.17406 a.u.</li>
|
|||||||
</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-26 Tue 16:09</p>
|
<p class="date">Created: 2021-01-27 Wed 00:06</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>
|
||||||
|
Loading…
Reference in New Issue
Block a user