Dice Fortran Backend Documentation
|
Contains local energy and transition probability solvers for available problems. More...
Functions/Subroutines | |
real(real64) function | qho_prob (alpha, x_current, x_next) |
Calculates transition probability for quantum harmonic oscillator problem. More... | |
real(real64) function | qho_energy (alpha, x) |
Calculates local energy for quantum harmonic oscillator problem. More... | |
real(real64) function | h1s_wfn (r_elec, R_nuc) |
Calculates value of the wavefunction of a hydrogen 1s orbital. More... | |
real(real64) function | h2s_wfn (r_elec, R_nuc) |
[DEPRECATED] Calculates value of the wavefunction of a hydrogen 2s orbital. More... | |
real(real64) function | h_2_plus_wfn (c, r, R_a, R_b) |
Calculates trial wavefunction for the \( H_{2}^{+} \) problem. More... | |
real(real64) function | h_2_plus_prob (c, r_current, r_next, R_a, R_b) |
Calculates transition probability for the \( H_{2}^{+} \) problem. More... | |
subroutine | h_2_plus_energy (c, r, R_a, R_b, E_loc, gradient) |
Calculates local energy for the \( H_{2}^{+} \) problem. More... | |
subroutine | h_2_plus_update_c (c_old, gradient, c_new) |
Updates the \( c \) parameter in the \( H_{2}^{+} \) problem by dampened steepest descent. More... | |
real(real64) function | h_2_cusp (s) |
Calculates a value for a given the bond length s by Newton-Raphson iteration. More... | |
real(real64) function | h_2_wfn (a, beta, r_1, r_2, R_a, R_b) |
Calculates trial wavefunction for the \( H_{2} \) problem. More... | |
real(real64) function | h_2_prob (a, beta, r_1_current, r_2_current, r_1_next, r_2_next, R_a, R_b) |
Calculates transition probability for the \( H_{2} \) problem. More... | |
subroutine | h_2_energy (a, beta, r_1, r_2, R_a, R_b, E_loc, DphiDbeta) |
{UPDATE ME} Calculates local energy for the \( H_{2} \) problem. More... | |
subroutine | h_2_update_beta (beta_old, gradient, beta_new) |
Updates the \( \beta \) parameter in the \( H_{2}^{+} \) problem by dampened steepest descent. More... | |
Contains local energy and transition probability solvers for available problems.
Module containing quantum mechanical solvers for local energy and Metropolis algorithm probability. Contains solvers for quantum harmonic oscillator (QHO), hydrogen ion (H_2_plus) and hydrogen molecule (H_2), as well as dampened steepest descent optimisers for the parameters in the latter two problems.
real(real64) function solvers::qho_prob | ( | real(real64), intent(in) | alpha, |
real(real64), intent(in) | x_current, | ||
real(real64), intent(in) | x_next | ||
) |
Calculates transition probability for quantum harmonic oscillator problem.
Computes
\[ \frac{P(x_{i+1})}{P(x)} = \frac{\psi^{\alpha}_{T}(x_{i+1})}{\psi^{\alpha}_{T}(x)} = e^{-2\alpha(x^{2}_{i+1}-x^{2}_{i})} \]
[in] | alpha | Parameter |
[in] | x_current | Current position of walker |
[in] | x_next | Proposed position of walker |
Prob | Transition probability |
Definition at line 47 of file quantum_solvers.f90.
real(real64) function solvers::qho_energy | ( | real(real64), intent(in) | alpha, |
real(real64), intent(in) | x | ||
) |
Calculates local energy for quantum harmonic oscillator problem.
Computes
\[ E^{\alpha}_{L}(x) = \frac{\hat{H}\psi^{\alpha}_{T}(x)}{\psi^{\alpha}_{T}(x)} = \alpha+x^{2}\left ( \frac{1}{2}-2\alpha^{2} \right ) \]
[in] | alpha | Parameter |
[in] | x | Position of walker |
E_loc | Local energy |
Definition at line 76 of file quantum_solvers.f90.
real(real64) function solvers::h1s_wfn | ( | real(real64), dimension(3), intent(in) | r_elec, |
real(real64), dimension(3), intent(in) | R_nuc | ||
) |
Calculates value of the wavefunction of a hydrogen 1s orbital.
Function to calculate the wavefunction of an electron at position \( \mathbf{r} \) in a hydrogenic 1s atomic orbital, centred on nuclear position \( \mathbf{R}_{nuc}. \) Computes
\[ \phi_{1s}^{A}(\mathbf{r}) = \frac{1}{\sqrt{\pi}}e^{-\left |\mathbf{r-\mathbf{R}_{nuc}} \right |} \]
[in] | r_elec | Electron position |
[in] | R_nuc | Nuclear position |
H1s_wfn | Value of wavefunction |
Definition at line 111 of file quantum_solvers.f90.
real(real64) function solvers::h2s_wfn | ( | real(real64), dimension(3), intent(in) | r_elec, |
real(real64), dimension(3), intent(in) | R_nuc | ||
) |
[DEPRECATED] Calculates value of the wavefunction of a hydrogen 2s orbital.
Function to calculate the wavefunction of an electron at position \( \mathbf{r} \) in a hydrogenic 2s atomic orbital, centred on nuclear position \( \mathbf{R}_{nuc}. \)
Computes
\[ \psi^{A}_{2s} = \frac{1}{4\sqrt{2\pi}}\left [ 2 - \left |\mathbf{r-\mathbf{R}_{nuc}} \right | \right ] e^{-\frac{\left |\mathbf{r-\mathbf{R}_{nuc}} \right |}{2}} \]
[in] | r_elec | Electron position |
[in] | R_nuc | Nuclear position |
H2s_wfn | Value of wavefunction |
Definition at line 149 of file quantum_solvers.f90.
real(real64) function solvers::h_2_plus_wfn | ( | real(real64), intent(in) | c, |
real(real64), dimension(3), intent(in) | r, | ||
real(real64), dimension(3), intent(in) | R_a, | ||
real(real64), dimension(3), intent(in) | R_b | ||
) |
Calculates trial wavefunction for the \( H_{2}^{+} \) problem.
Function to calculate the wavefunction of an electron at position \( \mathbf{r} \) in the hydrogen molecular ion \( H_{2}^{+} \). Computes
\[ \psi^{c}_{T}(\mathbf{r}) = c\phi_{1s}^{A}(\mathbf{r}) + \sqrt{1-c^{2}}\phi_{1s}^{B}(\mathbf{r}) \]
for a given value of the parameter \( c \).
[in] | c | Parameter of trial wavefunction |
[in] | r | Electron position |
[in] | R_a | Position of hydrogen atom A |
[in] | R_b | Position of hydrogen atom B |
wfn | Value of trial wavefunction |
Definition at line 190 of file quantum_solvers.f90.
real(real64) function solvers::h_2_plus_prob | ( | real(real64), intent(in) | c, |
real(real64), dimension(3), intent(in) | r_current, | ||
real(real64), dimension(3), intent(in) | r_next, | ||
real(real64), dimension(3), intent(in) | R_a, | ||
real(real64), dimension(3), intent(in) | R_b | ||
) |
Calculates transition probability for the \( H_{2}^{+} \) problem.
Function to calculate transition probability for walkers in the \( H_{2}^{+} \) problem. Computes
\[ \frac{P(x_{i+1})}{P(x)} = \left (\frac{\psi^{c}_{T}(\mathbf{r}_{i+1})} {\psi^{c}_{T}(\mathbf{r})} \right ) ^{2} \]
[in] | c | Parameter of trial wavefunction |
[in] | r_current | Current position of walker |
[in] | r_next | Proposed position of walker |
[in] | R_a | Position of hydrogen atom A |
[in] | R_b | Position of hydrogen atom B |
Prob | Transition probability |
Definition at line 225 of file quantum_solvers.f90.
subroutine solvers::h_2_plus_energy | ( | real(real64), intent(in) | c, |
real(real64), dimension(3), intent(in) | r, | ||
real(real64), dimension(3), intent(in) | R_a, | ||
real(real64), dimension(3), intent(in) | R_b, | ||
real(real64), intent(out) | E_loc, | ||
real(real64), intent(out) | gradient | ||
) |
Calculates local energy for the \( H_{2}^{+} \) problem.
Function to calculate the local energy of a walker in the \( H_{2}^{+} \) problem.
Computes
\[ E^{c}_{L}(\mathbf{r}) = \frac{\hat{H}\psi^{c}_{T}(\mathbf{r})}{\psi^{c}_{T}(\mathbf{r})} \]
where
\[ \hat{H} = -\frac{1}{2}\nabla^{2} - \frac{1}{\left | \mathbf{r}-\mathbf{R}_{A} \right |} - \frac{1}{\left | \mathbf{r}-\mathbf{R}_{B} \right |} \]
by means of a second order central difference calculation.
Also calculates the gradient with respect to the parameter value c by means of a first order central difference calculation, provided auto_params for this problem is set to TRUE.
Finite difference step sizes for the calculation of both E_loc and gradient can be controlled by setting H2plus%ham_fdstep and H2plus%c_fdstep respectively, by giving them a value in the params.txt input file.
[in] | c | Parameter of trial wavefunction |
[in] | r | Position of walker |
[in] | R_a | Position of hydrogen atom A |
[in] | R_b | Position of hydrogen atom B |
[out] | E_loc | Local energy |
[out] | gradient | Gradient wrt parameter c |
Definition at line 277 of file quantum_solvers.f90.
subroutine solvers::h_2_plus_update_c | ( | real(real64), intent(in) | c_old, |
real(real64), intent(in) | gradient, | ||
real(real64), intent(out) | c_new | ||
) |
Updates the \( c \) parameter in the \( H_{2}^{+} \) problem by dampened steepest descent.
Uses the gradient calculated by h_2_plus_energy to propose a new value for the parameter c, based on its current value. Step size can be adjusted by modifying the damping variable.
[in] | c_old | Parameter to be updated |
[in] | gradient | Gradient at current parameter |
[out] | c_new | New updated parameter |
Definition at line 354 of file quantum_solvers.f90.
real(real64) function solvers::h_2_cusp | ( | real(real64), intent(in) | s | ) |
Calculates a value for a given the bond length s by Newton-Raphson iteration.
Solves the Coulomb cusp condition of electron-proton approach for the \( H_{2} \) wavefunction, which is defined by the equation
\[ a \left ( 1 + e^{-\frac{s}{a}} \right ) = 1 \]
where s is the H-H bond length and a is a parameter of the wavefunction.
The value of this parameter is found by Newton-Raphson iteration over the resulting product log equation
\[ \frac{1}{1 + e^{-\frac{s}{a}}} - a = 0 \]
[in] | s | Bond length |
a | Optimised wavefunction parameter |
Definition at line 394 of file quantum_solvers.f90.
real(real64) function solvers::h_2_wfn | ( | real(real64), intent(in) | a, |
real(real64), intent(in) | beta, | ||
real(real64), dimension(3), intent(in) | r_1, | ||
real(real64), dimension(3), intent(in) | r_2, | ||
real(real64), dimension(3), intent(in) | R_a, | ||
real(real64), dimension(3), intent(in) | R_b | ||
) |
Calculates trial wavefunction for the \( H_{2} \) problem.
Function to calculate the wavefunction of two electrons at positions \( \mathbf{r}_{1} \) and \( \mathbf{r}_{2} \) in the hydrogen molecule \( H_{2} \).
Takes the functional form
\[ \Psi_{T}(\mathbf{r}_1, \mathbf{r}_{2}) = \phi(\mathbf{r}_{1}) \phi(\mathbf{r}_{2}) \psi(\mathbf{r}_1, \mathbf{r}_{2}) \]
where
\[ \phi(\mathbf{r}_{1}) = e^{-\frac{\left | \mathbf{r}_{1A} \right |}{a}} + e^{-\frac{\left | \mathbf{r}_{1B} \right |}{a}} = \phi_{1A} + \phi_{1B} \]
\[ \phi(\mathbf{r}_{2}) = e^{-\frac{\left | \mathbf{r}_{2A} \right |}{a}} + e^{-\frac{\left | \mathbf{r}_{2B} \right |}{a}} = \phi_{2A} + \phi_{2B} \]
and \( \psi(\mathbf{r}_1, \mathbf{r}_{2}) \) is the Jastrow function with the form
\[ \psi(\mathbf{r}_1, \mathbf{r}_{2}) = e^{\frac{\left | \mathbf{r}_{12} \right |} {\alpha \left ( 1 + \beta \left | \mathbf{r}_{12} \right | \right )}} \]
Here, \( \alpha \) is taken to have a value of 2.0, as defined by the electron-electron approach Coulomb cusp condition.
[in] | a | Parameter \( a \) of trial wavefunction |
[in] | beta | Parameter \( \beta \) of trial wavefunction |
[in] | r_1 | Position of electron 1 |
[in] | r_2 | Position of electron 2 |
[in] | R_a | Position of hydrogen atom A |
[in] | R_b | Position of hydrogen atom B |
wfn | Value of trial wavefunction |
Definition at line 488 of file quantum_solvers.f90.
real(real64) function solvers::h_2_prob | ( | real(real64), intent(in) | a, |
real(real64), intent(in) | beta, | ||
real(real64), dimension(3), intent(in) | r_1_current, | ||
real(real64), dimension(3), intent(in) | r_2_current, | ||
real(real64), dimension(3), intent(in) | r_1_next, | ||
real(real64), dimension(3), intent(in) | r_2_next, | ||
real(real64), dimension(3), intent(in) | R_a, | ||
real(real64), dimension(3), intent(in) | R_b | ||
) |
Calculates transition probability for the \( H_{2} \) problem.
Function to calculate transition probability for walkers in the \( H_{2} \) problem. Computes
\[\frac{P(x_{i+1})}{P(x)} = \left (\frac{\psi^{c}_{T}(\mathbf{r}_{1}^{i+1}, \mathbf{r}_{2}^{i+1})} {\psi^{c}_{T}(\mathbf{r}_{1}^{i}, \mathbf{r}_{2}^{i})} \right )^{2} \]
[in] | a | Parameter \( a \) of trial wavefunction |
[in] | beta | Parameter \( \beta \) of trial wavefunction |
[in] | r_1_current | Current position of walker 1 |
[in] | r_2_current | Current position of walker 2 |
[in] | r_1_next | Proposed position of walker 1 |
[in] | r_2_next | Proposed position of walker 2 |
[in] | R_a | Position of hydrogen atom A |
[in] | R_b | Position of hydrogen atom B |
Prob | Transition probability |
Definition at line 539 of file quantum_solvers.f90.
subroutine solvers::h_2_energy | ( | real(real64), intent(in) | a, |
real(real64), intent(in) | beta, | ||
real(real64), dimension(3), intent(in) | r_1, | ||
real(real64), dimension(3), intent(in) | r_2, | ||
real(real64), dimension(3), intent(in) | R_a, | ||
real(real64), dimension(3), intent(in) | R_b, | ||
real(real64), intent(out) | E_loc, | ||
real(real64), intent(out) | DphiDbeta | ||
) |
{UPDATE ME} Calculates local energy for the \( H_{2} \) problem.
Function to calculate the local energy of two walkers in the \( H_{2} \) problem. Computes
\[ E_{L} = -\frac{1}{a^{2}} + \frac{1}{a\phi_{1}}\left ( \frac{\phi_{1A}}{r_{1A}} + \frac{\phi_{1B}}{r_{1B}} \right ) + \frac{1}{a\phi_{2}}\left ( \frac{\phi_{2A}}{r_{2A}} + \frac{\phi_{2B}}{r_{2B}} \right ) - \left ( \frac{1}{r_{1A}} + \frac{1}{r_{1B}} + \frac{1}{r_{2A}} + \frac{1}{r_{2B}} \right ) + \frac{1}{r_{12}} + \left ( \frac{\phi_{1A}\hat{r}_{1A} + \phi_{1B}\hat{r}_{1B}}{\phi_{1}} - \frac{\phi_{2A}\hat{r}_{2A} + \phi_{2B}\hat{r}_{2B}}{\phi_{2}} \right )\cdot \frac{\hat{r}_{12}}{2a\left ( 1+\beta r_{12} \right )^{2}} - \frac{\left ( 4\beta+1 \right )r_{12} + 4}{4\left ( 1+\beta r_{12} \right )^{4} r_{12}} + \frac{1}{r_{AB}} \]
Also calculates the gradient with respect to the parameter \( \beta \), provided auto_params for this problem is set to TRUE.
[in] | a | Parameter \( a \) of trial wavefunction |
[in] | beta | Parameter \( \beta \) of trial wavefunction |
[in] | r_1 | Position of walker 1 |
[in] | r_2 | Position of walker 2 |
[in] | R_a | Position of hydrogen atom A |
[in] | R_b | Position of hydrogen atom B |
[out] | E_loc | Local energy |
[out] | DphiDbeta | Wavefunction gradient with respect to \( \beta \) |
Definition at line 591 of file quantum_solvers.f90.
subroutine solvers::h_2_update_beta | ( | real(real64), intent(in) | beta_old, |
real(real64), intent(in) | gradient, | ||
real(real64), intent(out) | beta_new | ||
) |
Updates the \( \beta \) parameter in the \( H_{2}^{+} \) problem by dampened steepest descent.
Uses the gradient calculated by H_2_energy to propose a new value for the parameter \( \beta \), based on its current value. Step size can be adjusted by modifying the damping variable.
[in] | c_old | Parameter to be updated |
[in] | gradient | Gradient at current parameter |
[out] | c_new | New updated parameter |
Definition at line 664 of file quantum_solvers.f90.