mirror of
https://github.com/TREX-CoE/qmc-lttc.git
synced 2024-12-22 04:15:01 +01:00
Update QMC.org
This commit is contained in:
parent
1e0ffff4a6
commit
d0561241cc
66
QMC.org
66
QMC.org
@ -1332,11 +1332,11 @@ gfortran hydrogen.f90 qmc_stats.f90 qmc_uniform.f90 -o qmc_uniform
|
|||||||
|
|
||||||
$$ \mathbf{r}_0 \rightarrow \mathbf{r}_1 \rightarrow \mathbf{r}_2 \ldots \mathbf{r}_{N_{\rm MC}}\,, $$
|
$$ \mathbf{r}_0 \rightarrow \mathbf{r}_1 \rightarrow \mathbf{r}_2 \ldots \mathbf{r}_{N_{\rm MC}}\,, $$
|
||||||
|
|
||||||
according to the following algorithm.
|
following the following algorithm.
|
||||||
|
|
||||||
At every step, we propose a new move according to a transition probability $T(\mathbf{r}_{n+1},\mathbf{r}_n)$ of our choice.
|
At every step, we propose a new move according to a transition probability $T(\mathbf{r}_{n}\rightarrow\mathbf{r}_{n+1})$ of our choice.
|
||||||
|
|
||||||
For simplicity, let us move the electron in a 3-dimensional box of side $2\delta L$ centered at the current position
|
For simplicity, we will move the electron in a 3-dimensional box of side $2\delta L$ centered at the current position
|
||||||
of the electron:
|
of the electron:
|
||||||
|
|
||||||
$$
|
$$
|
||||||
@ -1347,19 +1347,19 @@ gfortran hydrogen.f90 qmc_stats.f90 qmc_uniform.f90 -o qmc_uniform
|
|||||||
$\mathbf{u}$ is a uniform random number in a 3-dimensional box
|
$\mathbf{u}$ is a uniform random number in a 3-dimensional box
|
||||||
$(-1,-1,-1) \le \mathbf{u} \le (1,1,1)$.
|
$(-1,-1,-1) \le \mathbf{u} \le (1,1,1)$.
|
||||||
|
|
||||||
After having moved the electron, add the
|
After having moved the electron, we add the
|
||||||
accept/reject step that guarantees that the distribution of the
|
accept/reject step that guarantees that the distribution of the
|
||||||
$\mathbf{r}_n$ is $\Psi^2$. This amounts to accepting the move with
|
$\mathbf{r}_n$ is $\Psi^2$. This amounts to accepting the move with
|
||||||
probability
|
probability
|
||||||
|
|
||||||
$$
|
$$
|
||||||
A{\mathbf{r}_{n+1},\mathbf{r}_n) = \min\left(1,\frac{T(\mathbf{r}_{n},\mathbf{r}_{n+1}) P(\mathbf{r}_{n+1})}{T(\mathbf{r}_{n+1},\mathbf{r}_n)P(\mathbf{r}_{n})}\right)\,,
|
A{\mathbf{r}_{n}\rightarrow\mathbf{r}_{n+1}) = \min\left(1,\frac{T(\mathbf{r}_{n},\mathbf{r}_{n+1}) P(\mathbf{r}_{n+1})}{T(\mathbf{r}_{n+1},\mathbf{r}_n)P(\mathbf{r}_{n})}\right)\,,
|
||||||
$$
|
$$
|
||||||
|
|
||||||
which, for our choice of transition probability, becomes
|
which, for our choice of transition probability, becomes
|
||||||
|
|
||||||
$$
|
$$
|
||||||
A{\mathbf{r}_{n+1},\mathbf{r}_n) = \min\left(1,\frac{P(\mathbf{r}_{n+1})}{P(\mathbf{r}_{n})}\right)= \min\left(1,\frac{\Psi(\mathbf{r}_{n+1})^2}{\Psi(\mathbf{r}_{n})^2}
|
A{\mathbf{r}_{n}\rightarrow\mathbf{r}_{n+1}) = \min\left(1,\frac{P(\mathbf{r}_{n+1})}{P(\mathbf{r}_{n})}\right)= \min\left(1,\frac{\Psi(\mathbf{r}_{n+1})^2}{\Psi(\mathbf{r}_{n})^2}
|
||||||
$$
|
$$
|
||||||
|
|
||||||
Explain why the transition probability cancels out in the expression of $A$. Also note that we do not need to compute the norm of the wave function!
|
Explain why the transition probability cancels out in the expression of $A$. Also note that we do not need to compute the norm of the wave function!
|
||||||
@ -1394,7 +1394,8 @@ gfortran hydrogen.f90 qmc_stats.f90 qmc_uniform.f90 -o qmc_uniform
|
|||||||
possible, keeping the number of accepted steps not too small. To
|
possible, keeping the number of accepted steps not too small. To
|
||||||
achieve that, we define the acceptance rate as the number of
|
achieve that, we define the acceptance rate as the number of
|
||||||
accepted steps over the total number of steps. Adjusting the time
|
accepted steps over the total number of steps. Adjusting the time
|
||||||
step such that the acceptance rate is close to 0.5 is a good compromise for the current problem.
|
step such that the acceptance rate is close to 0.5 is a good
|
||||||
|
compromise for the current problem.
|
||||||
|
|
||||||
|
|
||||||
*** Exercise
|
*** Exercise
|
||||||
@ -1697,18 +1698,18 @@ end subroutine random_gauss
|
|||||||
probability of transition from $\mathbf{r}_n$ to
|
probability of transition from $\mathbf{r}_n$ to
|
||||||
$\mathbf{r}_{n+1}$.
|
$\mathbf{r}_{n+1}$.
|
||||||
|
|
||||||
In the previous example, we were using uniform random
|
In the previous example, we were using uniform sampling in a box centered
|
||||||
numbers. Hence, the transition probability was
|
at the current position. Hence, the transition probability was symmetric
|
||||||
|
|
||||||
\[
|
\[
|
||||||
T(\mathbf{r}_{n} \rightarrow \mathbf{r}_{n+1}) =
|
T(\mathbf{r}_{n} \rightarrow \mathbf{r}_{n+1}) = T(\mathbf{r}_{n+1} \rightarrow \mathbf{r}_{n})
|
||||||
\text{constant}\,,
|
\text{constant}\,,
|
||||||
\]
|
\]
|
||||||
|
|
||||||
so the expression of $A$ was simplified to the ratios of the squared
|
so the expression of $A$ was simplified to the ratios of the squared
|
||||||
wave functions.
|
wave functions.
|
||||||
|
|
||||||
Now, if instead of drawing uniform random numbers we
|
Now, if instead of drawing uniform random numbers, we
|
||||||
choose to draw Gaussian random numbers with zero mean and variance
|
choose to draw Gaussian random numbers with zero mean and variance
|
||||||
$\delta t$, the transition probability becomes:
|
$\delta t$, the transition probability becomes:
|
||||||
|
|
||||||
@ -1719,9 +1720,9 @@ end subroutine random_gauss
|
|||||||
\]
|
\]
|
||||||
|
|
||||||
|
|
||||||
To sample even better the density, we can "push" the electrons
|
Furthermore, to sample the density even better, we can "push" the electrons
|
||||||
into in the regions of high probability, and "pull" them away from
|
into in the regions of high probability, and "pull" them away from
|
||||||
the low-probability regions. This will mechanically increase the
|
the low-probability regions. This will ncrease the
|
||||||
acceptance ratios and improve the sampling.
|
acceptance ratios and improve the sampling.
|
||||||
|
|
||||||
To do this, we can use the gradient of the probability density
|
To do this, we can use the gradient of the probability density
|
||||||
@ -1730,16 +1731,8 @@ end subroutine random_gauss
|
|||||||
\frac{\nabla [ \Psi^2 ]}{\Psi^2} = 2 \frac{\nabla \Psi}{\Psi}\,,
|
\frac{\nabla [ \Psi^2 ]}{\Psi^2} = 2 \frac{\nabla \Psi}{\Psi}\,,
|
||||||
\]
|
\]
|
||||||
|
|
||||||
and add the so-called drift vector, so that the numerical scheme becomes a drifted diffusion:
|
and add the so-called drift vector, so that the numerical scheme becomes a
|
||||||
|
drifted diffusion with transition probability:
|
||||||
\[
|
|
||||||
\mathbf{r}_{n+1} = \mathbf{r}_{n} + \delta t\, \frac{\nabla
|
|
||||||
\Psi(\mathbf{r})}{\Psi(\mathbf{r})} + \chi \,,
|
|
||||||
\]
|
|
||||||
|
|
||||||
where $\chi$ is a Gaussian random variable with zero mean and
|
|
||||||
variance $\delta t$.
|
|
||||||
The transition probability becomes:
|
|
||||||
|
|
||||||
\[
|
\[
|
||||||
T(\mathbf{r}_{n} \rightarrow \mathbf{r}_{n+1}) =
|
T(\mathbf{r}_{n} \rightarrow \mathbf{r}_{n+1}) =
|
||||||
@ -1748,9 +1741,20 @@ end subroutine random_gauss
|
|||||||
\Psi(\mathbf{r}_n)}{\Psi(\mathbf{r}_n)} \right)^2}{2\,\delta t} \right]\,.
|
\Psi(\mathbf{r}_n)}{\Psi(\mathbf{r}_n)} \right)^2}{2\,\delta t} \right]\,.
|
||||||
\]
|
\]
|
||||||
|
|
||||||
The algorithm of the previous exercise is only slighlty modified summarized:
|
and the corrsponding move is proposed as
|
||||||
|
|
||||||
|
\[
|
||||||
|
\mathbf{r}_{n+1} = \mathbf{r}_{n} + \delta t\, \frac{\nabla
|
||||||
|
\Psi(\mathbf{r})}{\Psi(\mathbf{r})} + \chi \,,
|
||||||
|
\]
|
||||||
|
|
||||||
|
where $\chi$ is a Gaussian random variable with zero mean and
|
||||||
|
variance $\delta t$.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
The algorithm of the previous exercise is only slighlty modified as:
|
||||||
|
|
||||||
0) For the starting position compute $\Psi$ and the drif-vector $\frac{\nabla \Psi(\mathbf{r})}{\Psi(\mathbf{r})}$
|
|
||||||
1) Compute a new position $\mathbf{r'} = \mathbf{r}_n +
|
1) Compute a new position $\mathbf{r'} = \mathbf{r}_n +
|
||||||
\delta t\, \frac{\nabla \Psi(\mathbf{r})}{\Psi(\mathbf{r})} + \chi$
|
\delta t\, \frac{\nabla \Psi(\mathbf{r})}{\Psi(\mathbf{r})} + \chi$
|
||||||
|
|
||||||
@ -1813,8 +1817,8 @@ end subroutine drift
|
|||||||
*** Exercise 2
|
*** Exercise 2
|
||||||
|
|
||||||
#+begin_exercise
|
#+begin_exercise
|
||||||
Modify the previous program to introduce the drifted diffusion scheme.
|
Modify the previous program to introduce the drift-diffusion scheme.
|
||||||
(This is a necessary step for the next section).
|
(This is a necessary step for the next section on diffusion Monte Carlo).
|
||||||
#+end_exercise
|
#+end_exercise
|
||||||
|
|
||||||
*Python*
|
*Python*
|
||||||
@ -2076,10 +2080,10 @@ gfortran hydrogen.f90 qmc_stats.f90 vmc_metropolis.f90 -o vmc_metropolis
|
|||||||
Consider the time-dependent Schrödinger equation:
|
Consider the time-dependent Schrödinger equation:
|
||||||
|
|
||||||
\[
|
\[
|
||||||
i\frac{\partial \Psi(\mathbf{r},t)}{\partial t} = \hat{H} \Psi(\mathbf{r},t)
|
i\frac{\partial \Psi(\mathbf{r},t)}{\partial t} = \hat{H} \Psi(\mathbf{r},t)\,.
|
||||||
\]
|
\]
|
||||||
|
|
||||||
We can expand $\Psi(\mathbf{r},0)$, in the basis of the eigenstates
|
We can expand a given starting wave function, $\Psi(\mathbf{r},0)$, in the basis of the eigenstates
|
||||||
of the time-independent Hamiltonian:
|
of the time-independent Hamiltonian:
|
||||||
|
|
||||||
\[
|
\[
|
||||||
@ -2092,14 +2096,14 @@ gfortran hydrogen.f90 qmc_stats.f90 vmc_metropolis.f90 -o vmc_metropolis
|
|||||||
\Psi(\mathbf{r},t) = \sum_k a_k \exp \left( -i\, E_k\, t \right) \Phi_k(\mathbf{r}).
|
\Psi(\mathbf{r},t) = \sum_k a_k \exp \left( -i\, E_k\, t \right) \Phi_k(\mathbf{r}).
|
||||||
\]
|
\]
|
||||||
|
|
||||||
Now, let's replace the time variable $t$ by an imaginary time variable
|
Now, if we replace the time variable $t$ by an imaginary time variable
|
||||||
$\tau=i\,t$, we obtain
|
$\tau=i\,t$, we obtain
|
||||||
|
|
||||||
\[
|
\[
|
||||||
-\frac{\partial \psi(\mathbf{r}, \tau)}{\partial \tau} = \hat{H} \psi(\mathbf{r}, \tau)
|
-\frac{\partial \psi(\mathbf{r}, \tau)}{\partial \tau} = \hat{H} \psi(\mathbf{r}, \tau)
|
||||||
\]
|
\]
|
||||||
|
|
||||||
where $\psi(\mathbf{r},\tau) = \Psi(\mathbf{r},-i\tau) = \Psi(\mathbf{r},t)$
|
where $\psi(\mathbf{r},\tau) = \Psi(\mathbf{r},-i\,)$
|
||||||
and
|
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}).
|
||||||
|
Loading…
Reference in New Issue
Block a user