mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-04-30 04:15:00 +02:00
finished documentation of single jastrow
This commit is contained in:
parent
fcacc6823a
commit
5ec7d358b8
@ -35,7 +35,6 @@ int main() {
|
||||
#include "qmckl_mo_private_type.h"
|
||||
#include "qmckl_jastrow_champ_private_type.h"
|
||||
#include "qmckl_jastrow_champ_single_private_type.h"
|
||||
// #include "qmckl_jastrow_champ_quad_private_type.h"
|
||||
#include "qmckl_forces_private_type.h"
|
||||
#include "qmckl_determinant_private_type.h"
|
||||
#include "qmckl_local_energy_private_type.h"
|
||||
@ -46,7 +45,6 @@ int main() {
|
||||
#include "qmckl_mo_private_func.h"
|
||||
#include "qmckl_jastrow_champ_private_func.h"
|
||||
#include "qmckl_jastrow_champ_single_private_func.h"
|
||||
// #include "qmckl_jastrow_champ_quad_private_func.h"
|
||||
#include "qmckl_forces_private_func.h"
|
||||
#include "qmckl_determinant_private_func.h"
|
||||
#include "qmckl_local_energy_private_func.h"
|
||||
@ -136,7 +134,6 @@ typedef struct qmckl_context_struct {
|
||||
/* Points */
|
||||
qmckl_point_struct point;
|
||||
qmckl_jastrow_champ_single_struct single_point;
|
||||
// qmckl_jastrow_champ_quad_struct quad_point;
|
||||
|
||||
/* -- Molecular system -- */
|
||||
qmckl_nucleus_struct nucleus;
|
||||
|
@ -4478,7 +4478,6 @@ integer(qmckl_exit_code) function qmckl_compute_forces_jastrow_delta_p_doc( &
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
stop
|
||||
|
||||
end function qmckl_compute_forces_jastrow_delta_p_doc
|
||||
#+end_src
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1062,13 +1062,13 @@ Here we calculate the single electron contributions to the electron-electron-nuc
|
||||
To start, we need to calculate the rescaled distances for the single electron electron-nucleus and electron-electron distances.
|
||||
These rescaled distances are calculates by
|
||||
\[
|
||||
\widetilde{R}_{\alpha} = e^{-\kappa l R_{\alpha}} \quad \text{and} \quad \widetilde{r}_{i} = e^{-\kappa l r_{i}}.
|
||||
\widetilde{R}_{i\alpha} = e^{-\kappa l R_{i\alpha}} \quad \text{and} \quad \widetilde{r}_{ij} = e^{-\kappa l r_{ij}}.
|
||||
\]
|
||||
Here, $\kappa$ is the rescaling factor and $l$ the power. The neccessery powers are stored in the same array.
|
||||
From these, we can calculate the $\delta \widetilde{R}$ and $\delta \widetilde{r}$ using
|
||||
\begin{eqnarray*}
|
||||
\delta \widetilde{R}_{\alpha} &=& \widetilde{R}_{\alpha}^\text{new} - \widetilde{R}_{\alpha}^\text{old} \quad \text{and}\\
|
||||
\delta \widetilde{r}_{i} &=& \widetilde{r}_{i}^\text{new} - \widetilde{r}_{i}^\text{old}.
|
||||
\delta \widetilde{R}_{i\alpha} &=& \widetilde{R}_{i\alpha}^\text{new} - \widetilde{R}_{i\alpha}^\text{old} \quad \text{and}\\
|
||||
\delta \widetilde{r}_{ij} &=& \widetilde{r}_{ij}^\text{new} - \widetilde{r}_{ij}^\text{old}.
|
||||
\end{eqnarray*}
|
||||
|
||||
|
||||
@ -1078,14 +1078,14 @@ With these, we can now calculate the single electron contribution to the $\delta
|
||||
&=& \sum_{j=1}^{N_\text{elec}} \left(\widetilde{r}_{i,j,k} \delta \widetilde{R}_{j,\alpha,l}\delta_{j,\text{num}} +
|
||||
\delta \widetilde{r}_{i,j,k} \widetilde{R}_{j,\alpha,l} (\delta_{j,\text{num}}
|
||||
+ \delta_{i,\text{num}}) + \delta \widetilde{r}_{i,j,k} \delta \widetilde{R}_{j,\alpha,l} \delta_{j,\text{num}}\right)\\
|
||||
&=& \sum_{j=1}^{N_\text{elec}} \left( \delta \widetilde{r}_{\text{num},j,k} \widetilde{R}_{j,\alpha,l} \right)
|
||||
&=& \sum_{j=1}^{N_\text{elec}} \left( \delta \widetilde{r}_{i,j,k} \widetilde{R}_{j,\alpha,l} \delta_{i,\text{num}} \right)
|
||||
+ \widetilde{r}_{i,\text{num},k} \delta \widetilde{R}_{\text{num},\alpha,l} + \delta \widetilde{r}_{i,\text{num},k} \left( \widetilde{R}_{\text{num},\alpha,l}
|
||||
+ \delta \widetilde{R}_{\text{num},\alpha,l} \right).
|
||||
\end{eqnarray*}
|
||||
|
||||
Then, the electron-electron-nucleus Jastrow value can be calculated by
|
||||
\begin{eqnarray*}
|
||||
J_{een} &=& J_{een}^{\text{new}} - J_{een}^{\text{old}}\\
|
||||
\delta J_{een} &=& J_{een}^{\text{new}} - J_{een}^{\text{old}}\\
|
||||
&=&\sum_{p=2}^{N_\text{nord}} \sum_{k=0}^{p-1} \sum_{l=0}^{p-k-2\delta_{k,0}}\sum_{\alpha=1}^{N_\text{nucl}} c_{l,k,p,\alpha}
|
||||
\sum_{i=1}^{N_\text{elec}} \left( \delta \widetilde{R}_{i,\alpha,(p-k-l)/2} P_{i,\alpha,k,(p-k+l)/2} \delta_{i,\text{num}}
|
||||
+ \widetilde{R}_{i,\alpha,(p-k-l)/2} \delta P_{i,\alpha,k,(p-k+l)/2}
|
||||
@ -1099,15 +1099,15 @@ J_{een} &=& J_{een}^{\text{new}} - J_{een}^{\text{old}}\\
|
||||
To calculate the gradients and Laplacian of the electron-electron-nucleus Jastrow,
|
||||
we first have to calculate the gradients and Laplacian of the rescaled distances,
|
||||
\[
|
||||
\partial_{i,m} \widetilde{R}_{\alpha} = -\kappa l e^{-\kappa l R_{\alpha}} \frac{x_m - X_{m,\alpha}}{R_\alpha} \quad \text{and} \quad
|
||||
\partial_{i,4} \widetilde{R}_{\alpha} = -\kappa l \left(\frac{2}{R_\alpha}- \kappa l \right) e^{-\kappa l R_{\alpha}},
|
||||
\partial_{i,m} \widetilde{R}_{i\alpha} = -\kappa l e^{-\kappa l R_{i\alpha}} \frac{r_{i,m} - R_{\alpha,m}}{R_{i\alpha}} \quad \text{and} \quad
|
||||
\partial_{i,4} \widetilde{R}_{i\alpha} = -\kappa l \left(\frac{2}{R_{i\alpha}}- \kappa l \right) e^{-\kappa l R_{i\alpha}},
|
||||
\]
|
||||
where $i$ is the electron of which we are taking the derivative and $m=1:3$ are the gradients and $m=4$ is the Laplacian.
|
||||
The derivatives of the single electron rescaled electron-nucleus distances are only nonzero when $i=\text{num}$.
|
||||
Similarly for $r$ we get
|
||||
\[
|
||||
\partial_{i,m} \widetilde{r}_{i} = -\kappa l e^{-\kappa l r_{i}} \frac{x_m - X_{m,i}}{r_i} \quad \text{and} \quad
|
||||
\partial_{i,4} \widetilde{r}_{i} = -\kappa l \left(\frac{2}{r_i}- \kappa l \right) e^{-\kappa l r_{i}}.
|
||||
\partial_{i,m} \widetilde{r}_{ij} = -\kappa l e^{-\kappa l r_{ij}} \frac{r_{i,m} - r_{j,m}}{r_{ij}} \quad \text{and} \quad
|
||||
\partial_{i,4} \widetilde{r}_{ij} = -\kappa l \left(\frac{2}{r_{ij}}- \kappa l \right) e^{-\kappa l r_{ij}}.
|
||||
\]
|
||||
|
||||
With these, we can now calculate the gradient and Laplacian of the $\delta P$ matrix, using the equation
|
||||
@ -1121,7 +1121,7 @@ where $g_m = \{-1,-1,-1,1\}$.
|
||||
|
||||
Then, the gradient and Laplacian of the electron-electron-nucleus Jastrow value can be calculated by
|
||||
\begin{eqnarray*}
|
||||
\partial_{i,m} J_{een} &=& \partial_{i,m} J_{een}^{\text{new}} - \partial_{i,m} J_{een}^{\text{old}}\\
|
||||
\delta \partial_{i,m} J_{een} &=& \partial_{i,m} J_{een}^{\text{new}} - \partial_{i,m} J_{een}^{\text{old}}\\
|
||||
&=&\sum_{p=2}^{N_\text{nord}} \sum_{k=0}^{p-1} \sum_{l=0}^{p-k-2\delta_{k,0}}\sum_{\alpha=1}^{N_\text{nucl}} c_{l,k,p,\alpha}
|
||||
\left( \widetilde{R}_{i,\alpha,(p-k-l)/2} \partial_{i,m} \delta P_{i,\alpha,k,(p-k+l)/2}
|
||||
+ \widetilde{R}_{i,\alpha,(p-k+l)/2} \partial_{i,m} \delta P_{i,\alpha,k,(p-k-l)/2} \right. \\
|
||||
@ -1136,8 +1136,11 @@ Then, the gradient and Laplacian of the electron-electron-nucleus Jastrow value
|
||||
& &\ \left. + \delta_{m,4}\delta_{i,\text{num}} \sum_{d=1}^3\left( \partial_{i,d}\delta \widetilde{R}_{i,\alpha,(p-k-l)/2} \left( \partial_{i,d} P_{i,\alpha,k,(p-k+l)/2} + \partial_{i,d}\delta P_{i,\alpha,k,(p-k+l)/2} \right)
|
||||
+ \partial_{i,d}\delta \widetilde{R}_{i,\alpha,(p-k+l)/2} \left( \partial_{i,d} P_{i,\alpha,k,(p-k-l)/2} + \partial_{i,d} \delta P_{i,\alpha,k,(p-k-l)/2} \right) \right) \right)
|
||||
\end{eqnarray*}
|
||||
|
||||
** Electron-electron rescaled distances
|
||||
|
||||
Here, we calculate the new components of the $\widetilde{r}_{ij}$ matrix.
|
||||
|
||||
*** Get
|
||||
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
@ -1354,7 +1357,6 @@ integer function qmckl_compute_een_rescaled_single_e_doc( &
|
||||
end do
|
||||
end do
|
||||
|
||||
!een_rescaled_single_e(:,:,:) = een_rescaled_single_e(:,:,:) - een_rescaled_e(num,:,:,:)
|
||||
een_rescaled_single_e(num, :, :) = 0.0d0
|
||||
|
||||
end do
|
||||
@ -1375,7 +1377,7 @@ end function qmckl_compute_een_rescaled_single_e_doc
|
||||
double* const een_rescaled_single_e );
|
||||
#+end_src
|
||||
|
||||
#+begin_src c :tangle (eval h_private_func) :comments org
|
||||
#+begin_src c :tangle (eval h_private_func) :comments org :exports none
|
||||
qmckl_exit_code qmckl_compute_een_rescaled_single_e_doc (
|
||||
const qmckl_context context,
|
||||
const int64_t num,
|
||||
@ -1388,7 +1390,7 @@ end function qmckl_compute_een_rescaled_single_e_doc
|
||||
double* const een_rescaled_single_e );
|
||||
#+end_src
|
||||
|
||||
#+begin_src c :comments org :tangle (eval c) :noweb yes
|
||||
#+begin_src c :comments org :tangle (eval c) :noweb yes :exports none
|
||||
qmckl_exit_code
|
||||
qmckl_compute_een_rescaled_single_e (const qmckl_context context,
|
||||
const int64_t num,
|
||||
@ -1471,6 +1473,8 @@ printf("OK\n");
|
||||
|
||||
** Electron-nucleus rescaled distances
|
||||
|
||||
Here, we calculate the new components of the $\widetilde{R}_{i\alpha}$ matrix.
|
||||
|
||||
*** Get
|
||||
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
@ -1682,8 +1686,6 @@ integer function qmckl_compute_een_rescaled_single_n( &
|
||||
end do
|
||||
end do
|
||||
|
||||
!een_rescaled_single_n(:,:,:) = een_rescaled_single_n(:,:,:) - een_rescaled_n(num,:,:,:)
|
||||
|
||||
end do
|
||||
|
||||
end function qmckl_compute_een_rescaled_single_n
|
||||
@ -1761,6 +1763,13 @@ printf("OK\n");
|
||||
|
||||
** $\delta P$ matrix
|
||||
|
||||
Now we can calculate the $\delta P$ matrix.
|
||||
\begin{eqnarray*}
|
||||
\delta P_{i,\alpha,k,l} = \sum_{j=1}^{N_\text{elec}} \left( \delta \widetilde{r}_{i,j,k} \widetilde{R}_{j,\alpha,l} \delta_{i,\text{num}} \right)
|
||||
+ \widetilde{r}_{i,\text{num},k} \delta \widetilde{R}_{\text{num},\alpha,l} + \delta \widetilde{r}_{i,\text{num},k} \left( \widetilde{R}_{\text{num},\alpha,l}
|
||||
+ \delta \widetilde{R}_{\text{num},\alpha,l} \right).
|
||||
\end{eqnarray*}
|
||||
|
||||
*** Get
|
||||
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
@ -1950,7 +1959,6 @@ integer function qmckl_compute_jastrow_champ_delta_p_doc( &
|
||||
do c=0,cord_num
|
||||
do a=1,nucl_num
|
||||
dn = een_rescaled_single_n(a,c,nw) - een_rescaled_n(num,a,c,nw)
|
||||
!dn2 = dn + een_rescaled_n(num,a,c,nw)
|
||||
dn2 = een_rescaled_single_n(a,c,nw)
|
||||
do j=1,elec_num
|
||||
delta_p(j,a,c,i,nw) = een_rescaled_e(j,num,i,nw)*dn + een_rescaled_delta_e(j) * dn2
|
||||
@ -2001,7 +2009,7 @@ qmckl_compute_jastrow_champ_delta_p (const qmckl_context context,
|
||||
double* const delta_p );
|
||||
#+end_src
|
||||
|
||||
#+begin_src c :comments org :tangle (eval c) :noweb yes :exports none
|
||||
#+begin_src c :comments org :tangle (eval c) :noweb yes :exports none
|
||||
qmckl_exit_code
|
||||
qmckl_compute_jastrow_champ_delta_p (const qmckl_context context,
|
||||
const int64_t num,
|
||||
@ -2088,6 +2096,14 @@ printf("OK\n");
|
||||
|
||||
** Electron-electron-nucleus Jastrow value
|
||||
|
||||
Finally, we combine $\delta \widetilde{R_{i\alpha}}$ and $\delta P$ to get the $\delta J_{een}$ value.
|
||||
|
||||
\begin{eqnarray*}
|
||||
J_{een} = \sum_{p=2}^{N_\text{nord}} \sum_{k=0}^{p-1} \sum_{l=0}^{p-k-2\delta_{k,0}}\sum_{\alpha=1}^{N_\text{nucl}} c_{l,k,p,\alpha} \left(
|
||||
\sum_{i=1}^{N_\text{elec}} \left( \widetilde{R}_{i,\alpha,(p-k-l)/2} \delta P_{i,\alpha,k,(p-k+l)/2} \right)
|
||||
+ \delta \widetilde{R}_{\text{num},\alpha,(p-k-l)/2} \left(P_{\text{num},\alpha,k,(p-k+l)/2} + \delta P_{\text{num},\alpha,k,(p-k+l)/2} \right)\right)
|
||||
\end{eqnarray*}
|
||||
|
||||
*** Get
|
||||
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
@ -2228,11 +2244,6 @@ qmckl_exit_code qmckl_provide_jastrow_champ_single_een(qmckl_context context)
|
||||
ctx->single_point.delta_een_date = ctx->single_point.date;
|
||||
}
|
||||
|
||||
//printf("ctx date %u\n", ctx->date);
|
||||
//printf("single point date %u\n", ctx->single_point.date);
|
||||
//printf("jastrow champ tmp_c date %u\n", ctx->jastrow_champ.tmp_c_date);
|
||||
//printf("delta p date %u\n", ctx->single_point.delta_p_date);
|
||||
|
||||
return QMCKL_SUCCESS;
|
||||
}
|
||||
#+end_src
|
||||
@ -2463,6 +2474,13 @@ printf("OK\n");
|
||||
|
||||
** Electron-nucleus rescaled distance derivative
|
||||
|
||||
Now we start calculating the required term to obtain the derivative of $J_{een}$.
|
||||
Therefore, first we calculated the updated terms of $\partial_{i,m} \widetilde{R}_{i,\alpha}$.
|
||||
\[
|
||||
\partial_{i,m} \widetilde{R}_{i\alpha} = -\kappa l e^{-\kappa l R_{i\alpha}} \frac{r_{i,m} - R_{\alpha,m}}{R_{i\alpha}} \quad \text{and} \quad
|
||||
\partial_{i,4} \widetilde{R}_{i\alpha} = -\kappa l \left(\frac{2}{R_{i\alpha}}- \kappa l \right) e^{-\kappa l R_{i\alpha}},
|
||||
\]
|
||||
|
||||
*** Get
|
||||
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
@ -2773,6 +2791,13 @@ printf("OK\n");
|
||||
|
||||
** Electron-electron rescaled distances derivative
|
||||
|
||||
Now, we calculate the updated terms of $\partial_{i,m} \widetilde{r}_{ij}$.
|
||||
\[
|
||||
\partial_{i,m} \widetilde{r}_{ij} = -\kappa l e^{-\kappa l r_{ij}} \frac{r_{i,m} - r_{j,m}}{r_{ij}} \quad \text{and} \quad
|
||||
\partial_{i,4} \widetilde{r}_{ij} = -\kappa l \left(\frac{2}{r_{ij}}- \kappa l \right) e^{-\kappa l r_{ij}}.
|
||||
\]
|
||||
|
||||
|
||||
*** Get
|
||||
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
@ -3039,7 +3064,7 @@ end function qmckl_compute_een_rescaled_single_e_gl_doc
|
||||
#+end_src
|
||||
|
||||
|
||||
#+begin_src c :comments org :tangle (eval c) :noweb yes
|
||||
#+begin_src c :comments org :tangle (eval c) :noweb yes :exports none
|
||||
qmckl_exit_code qmckl_compute_een_rescaled_single_e_gl (
|
||||
const qmckl_context context,
|
||||
const int64_t num,
|
||||
@ -3099,13 +3124,6 @@ for (int elec = 0; elec < elec_num; elec++){
|
||||
coords[1][elec][1] = new_coords[4];
|
||||
coords[1][elec][2] = new_coords[5];
|
||||
|
||||
//coords[0][0][elec] = new_coords[0];
|
||||
//coords[1][0][elec] = new_coords[1];
|
||||
//coords[2][0][elec] = new_coords[2];
|
||||
//coords[0][1][elec] = new_coords[3];
|
||||
//coords[1][1][elec] = new_coords[4];
|
||||
//coords[2][1][elec] = new_coords[5];
|
||||
|
||||
rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
@ -3134,6 +3152,14 @@ printf("OK\n");
|
||||
|
||||
** $\delta P$ matrix gradients and Laplacian
|
||||
|
||||
Similarly to $\delta P$, we now have the requirements to calculate $\partial_{i,m} \delta P$.
|
||||
\begin{eqnarray*}
|
||||
\partial_{i,m} \delta P_{i,\alpha,k,l} = \partial_{i,m}\delta \widetilde{r}_{\text{num},i,k} \left(\partial_{i,m}\delta \widetilde{R}_{\text{num},\alpha,l} + \partial_{i,m}\widetilde{R}_{\text{num},\alpha,l} \right) g_m
|
||||
+ \partial_{i,m}\widetilde{r}_{\text{num},i,k} \delta \widetilde{R}_{\text{num},\alpha,l}
|
||||
+ \delta_{i,\text{num}} \sum_{j=1}^{N_\text{elec}} \left( \partial_{j,m} \delta \widetilde{r}_{\text{num},j,k} \widetilde{R}_{j,\alpha,l} \right),
|
||||
\end{eqnarray*}
|
||||
where $g_m = \{-1,-1,-1,1\}$.
|
||||
|
||||
*** Get
|
||||
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
@ -3539,6 +3565,24 @@ printf("OK\n");
|
||||
|
||||
** Electron-electron-nucleus Jastrow gradients and Laplacian
|
||||
|
||||
Finally, we can calculate the gradients and Laplacian of $\delta J_{een}$.
|
||||
\begin{eqnarray*}
|
||||
\partial_{i,m} J_{een} &=& \sum_{p=2}^{N_\text{nord}} \sum_{k=0}^{p-1} \sum_{l=0}^{p-k-2\delta_{k,0}}\sum_{\alpha=1}^{N_\text{nucl}} c_{l,k,p,\alpha}
|
||||
\left( \widetilde{R}_{i,\alpha,(p-k-l)/2} \partial_{i,m} \delta P_{i,\alpha,k,(p-k+l)/2}
|
||||
+ \widetilde{R}_{i,\alpha,(p-k+l)/2} \partial_{i,m} \delta P_{i,\alpha,k,(p-k-l)/2} \right. \\
|
||||
& &\ + \partial_{i,m}\widetilde{R}_{i,\alpha,(p-k-l)/2} \delta P_{i,\alpha,k,(p-k+l)/2}
|
||||
+ \partial_{i,m}\widetilde{R}_{i,\alpha,(p-k+l)/2} \delta P_{i,\alpha,k,(p-k-l)/2} \\
|
||||
& &\ + \delta_{i,\text{num}} \left( \delta \widetilde{R}_{i,\alpha,(p-k-l)/2} \left ( \partial_{i,m} P_{i,\alpha,k,(p-k+l)/2} + \partial_{i,m} \delta P_{i,\alpha,k,(p-k+l)/2} \right)
|
||||
+ \delta \widetilde{R}_{i,\alpha,(p-k+l)/2} \left ( \partial_{i,m} P_{i,\alpha,k,(p-k-l)/2} + \partial_{i,m} \delta P_{i,\alpha,k,(p-k-l)/2} \right) \right. \\
|
||||
& &\ \left. + \partial_{i,m} \delta \widetilde{R}_{i,\alpha,(p-k-l)/2} \left ( P_{i,\alpha,k,(p-k+l)/2} + \delta P_{i,\alpha,k,(p-k+l)/2} \right)
|
||||
+ \partial_{i,m} \delta \widetilde{R}_{i,\alpha,(p-k+l)/2} \left ( P_{i,\alpha,k,(p-k-l)/2} + \delta P_{i,\alpha,k,(p-k-l)/2} \right) \right)\\
|
||||
& &\ + \delta_{m,4} \sum_{d=1}^3 \left( \partial_{i,d} \widetilde{R}_{i,\alpha,(p-k-l)/2} \partial_{i,d} \delta P_{i,\alpha,k,(p-k+l)/2}
|
||||
+ \partial_{i,d} \widetilde{R}_{i,\alpha,(p-k+l)/2} \partial_{i,d} \delta P_{i,\alpha,k,(p-k-l)/2} \right)\\
|
||||
& &\ \left. + \delta_{m,4}\delta_{i,\text{num}} \sum_{d=1}^3\left( \partial_{i,d}\delta \widetilde{R}_{i,\alpha,(p-k-l)/2} \left( \partial_{i,d} P_{i,\alpha,k,(p-k+l)/2} + \partial_{i,d}\delta P_{i,\alpha,k,(p-k+l)/2} \right)
|
||||
+ \partial_{i,d}\delta \widetilde{R}_{i,\alpha,(p-k+l)/2} \left( \partial_{i,d} P_{i,\alpha,k,(p-k-l)/2} + \partial_{i,d} \delta P_{i,\alpha,k,(p-k-l)/2} \right) \right) \right)
|
||||
\end{eqnarray*}
|
||||
|
||||
|
||||
*** Get
|
||||
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
@ -4140,7 +4184,10 @@ for (int elec = 0; elec < elec_num; elec++){
|
||||
printf("OK\n");
|
||||
#+end_src
|
||||
|
||||
** $\delta P$ matrix gradients and Laplacian
|
||||
** $\delta P$ matrix gradient only
|
||||
|
||||
Finally, to allow for more efficient treatment of nonlocal pseudopotentials, we also include a routine for only calculating the gradient (and not the Laplacian) of $\delta J_{een}$.
|
||||
For this, we calcualte the gradient of $\delta P$.
|
||||
|
||||
*** Get
|
||||
|
||||
@ -4309,7 +4356,7 @@ qmckl_exit_code qmckl_provide_jastrow_champ_delta_p_g(qmckl_context context)
|
||||
| ~een_rescaled_e_gl~ | ~double[walk_num][0:cord_num][elec_num][4][elec_num]~ | in | Electron-electron rescaled distances derivatives |
|
||||
| ~een_rescaled_single_n_gl~ | ~double[walk_num][0:cord_num][nucl_num][4]~ | in | Electron-nucleus single rescaled distances derivatives |
|
||||
| ~een_rescaled_single_e_gl~ | ~double[walk_num][0:cord_num][elec_num][4]~ | in | Electron-electron single rescaled distances derivatives |
|
||||
| ~delta_p_g~ | ~double[walk_num][0:cord_num-1][0:cord_num][4][nucl_num][elec_num]~ | out | Delta P matrix gradient and Laplacian |
|
||||
| ~delta_p_g~ | ~double[walk_num][0:cord_num-1][0:cord_num][4][nucl_num][elec_num]~ | out | Delta P matrix gradient |
|
||||
|----------------------------+---------------------------------------------------------------------+--------+---------------------------------------------------------|
|
||||
|
||||
#+begin_src f90 :comments org :tangle (eval f) :noweb yes
|
||||
@ -4689,6 +4736,8 @@ printf("OK\n");
|
||||
|
||||
** Electron-electron-nucleus Jastrow gradients
|
||||
|
||||
Finally, the gradient of the $\delta J_{een}$.
|
||||
|
||||
*** Get
|
||||
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
@ -5109,8 +5158,40 @@ printf("OK\n");
|
||||
|
||||
* Electron-electron Jastrow
|
||||
|
||||
Here we calculate the single-electron move contribution to the $J_{ee}$ Jastrow factor.
|
||||
Similar to the 3-body case above, we need to compute the single-electron contributions to the rescaled distances.
|
||||
The rescaled electron-electron distance for the 2-body term is defined as
|
||||
\[
|
||||
\widetilde{r}_{ij} = \frac{1-e^{-\kappa r_{ij}}}{\kappa}.
|
||||
\]
|
||||
For the electron-electro Jastrow, no intermediate terms have to be calculated, as we can immidiatly calculate
|
||||
\[
|
||||
\delta J_{ee} = \sum_i \sum_{j\lt i} \delta_{j,\text{num}} \left(\frac{b_1 \widetilde{r}_{ij}^{\text{new}}}{1+b_2 \widetilde{r}_{ij}^{\text{new}}} - \frac{b_1 \widetilde{r}_{ij}^{\text{old}}}{1+b_2 \widetilde{r}_{ij}^{\text{old}}} + \sum_{k=2}^{N_{\text{bord}}} b_k ({\widetilde{r}_{ij}^{\text{new}}}^k - {\widetilde{r}_{ij}^{\text{old}}}^k )\right),
|
||||
\]
|
||||
where num is the electron that is being moved.
|
||||
The gradient and Laplacian of the rescaled distances are given by
|
||||
\[
|
||||
\partial_{i,m} \widetilde{r}_{ij} = \frac{r_{i,m} - r_{j,m}}{r_{ij}} e^{-\kappa r_{ij}} \quad \text{and} \quad \partial_{i,4} \widetilde{r}_{ij} = \left(\frac{2}{r_{ij}} - \kappa \right)e^{-\kappa r_{ij}}
|
||||
\]
|
||||
Then,
|
||||
\begin{eqnarray*}
|
||||
\partial_{i,m}\delta J_{ee} = & \sum_j \delta_{j,\text{num}} \left( \frac{b_1 \partial_{i,m}\widetilde{r}^{\text{new}}_{ij}}{(1+b_2 \widetilde{r}^{\text{new}}_{ij})^2} - \frac{b_1 \partial_{i,m}\widetilde{r}^{\text{old}}_{ij}}{(1+b_2 \widetilde{r}^{\text{old}}_{ij})^2} + \sum_{k=2}^{N_{\text{bord}}} b_k k \left({\widetilde{r}_{ij}^{\text{new}}}^{k-1} \partial_{i,m}\widetilde{r}^{\text{new}}_{ij} - {\widetilde{r}_{ij}^{\text{old}}}^{k-1} \partial_{i,m}\widetilde{r}^{\text{old}}_{ij} \right) \right)\\
|
||||
\partial_{i,4}\delta J_{ee} = & \sum_j \delta_{j,\text{num}} \left( \frac{b_1}{(1+b_2 \widetilde{r}^{\text{new}}_{ij})^2} \left(\partial_{i,4}\widetilde{r}^{\text{new}}_{ij} - 2 b_2 \frac{\nabla\widetilde{r}^{\text{new}}_{ij} \cdot \nabla \widetilde{r}^{\text{new}}_{ij}}{1+b_2 \widetilde{r}^{\text{new}}_{ij}} \right) - \frac{b_1}{(1+b_2 \widetilde{r}^{\text{old}}_{ij})^2} \left(\partial_{i,4}\widetilde{r}^{\text{old}}_{ij} - 2 b_2 \frac{\nabla\widetilde{r}^{\text{old}}_{ij} \cdot \nabla \widetilde{r}^{\text{old}}_{ij}}{1+b_2 \widetilde{r}^{\text{old}}_{ij}} \right) \right.\\
|
||||
& \left.+ \sum_{k=2}^{N_{\text{bord}}} b_k k \left({\widetilde{r}_{ij}^{\text{new}}}^{k-1}\partial_{i,4}\widetilde{r}_{ij}^{\text{new}} + (k-1)(\nabla\widetilde{r}_{ij}^{\text{new}} \cdot \nabla \widetilde{r}_{ij}^{\text{new}}) {\widetilde{r}_{ij}^{\text{new}}}^{k-2} - {\widetilde{r}_{ij}^{\text{old}}}^{k-1}\partial_{i,4}\widetilde{r}_{ij}^{\text{old}} - (k-1)(\nabla\widetilde{r}_{ij}^{\text{old}} \cdot \nabla \widetilde{r}_{ij}^{\text{old}}) {\widetilde{r}_{ij}^{\text{old}}}^{k-2} \right) \right)
|
||||
\end{eqnarray*}
|
||||
In the special case that $i = \text{num}$, the gradient and Laplacian change to
|
||||
\begin{eqnarray*}
|
||||
\partial_{\text{num},m}\delta J_{ee} = & -\sum_i \sum_j \delta_{j,\text{num}} \left(\frac{b_1 \partial_{i,m}\widetilde{r}^{\text{new}}_{ij}}{(1+b_2 \widetilde{r}^{\text{new}}_{ij})^2} - \frac{b_1 \partial_{i,m}\widetilde{r}^{\text{old}}_{ij}}{(1+b_2 \widetilde{r}^{\text{old}}_{ij})^2} + \sum_{k=2}^{N_{\text{bord}}} b_k k \left({\widetilde{r}_{ij}^{\text{new}}}^{k-1} \partial_{i,m}\widetilde{r}^{\text{new}}_{ij} - {\widetilde{r}_{ij}^{\text{old}}}^{k-1} \partial_{i,m}\widetilde{r}^{\text{old}}_{ij} \right) \right) \\
|
||||
\partial_{\text{num},4}\delta J_{ee} = & -\sum_i \sum_j \delta_{j,\text{num}} \left( \frac{b_1}{(1+b_2 \widetilde{r}^{\text{new}}_{ij})^2} \left(\partial_{i,4}\widetilde{r}^{\text{new}}_{ij} - 2 b_2 \frac{\nabla\widetilde{r}^{\text{new}}_{ij} \cdot \nabla \widetilde{r}^{\text{new}}_{ij}}{1+b_2 \widetilde{r}^{\text{new}}_{ij}} \right) - \frac{b_1}{(1+b_2 \widetilde{r}^{\text{old}}_{ij})^2} \left(\partial_{i,4}\widetilde{r}^{\text{old}}_{ij} - 2 b_2 \frac{\nabla\widetilde{r}^{\text{old}}_{ij} \cdot \nabla \widetilde{r}^{\text{old}}_{ij}}{1+b_2 \widetilde{r}^{\text{old}}_{ij}} \right)\right. \\
|
||||
& \left. + \sum_{k=2}^{N_{\text{bord}}} b_k k \left({\widetilde{r}_{ij}^{\text{new}}}^{k-1}\partial_{i,4}\widetilde{r}_{ij}^{\text{new}} + (k-1)(\nabla\widetilde{r}_{ij}^{\text{new}} \cdot \nabla \widetilde{r}_{ij}^{\text{new}}) {\widetilde{r}_{ij}^{\text{new}}}^{k-2} - {\widetilde{r}_{ij}^{\text{old}}}^{k-1}\partial_{i,4}\widetilde{r}_{ij}^{\text{old}} - (k-1)(\nabla\widetilde{r}_{ij}^{\text{old}} \cdot \nabla \widetilde{r}_{ij}^{\text{old}}) {\widetilde{r}_{ij}^{\text{old}}}^{k-2} \right) \right)
|
||||
\end{eqnarray*}
|
||||
** Electron-electron rescaled distance
|
||||
|
||||
First, we calculate the rescaled distances
|
||||
\[
|
||||
\widetilde{r}_{ij} = \frac{1-e^{-\kappa r_{ij}}}{\kappa}.
|
||||
\]
|
||||
|
||||
*** Get
|
||||
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
@ -5388,6 +5469,11 @@ printf("OK\n");
|
||||
|
||||
** Electron-electron Jastrow value
|
||||
|
||||
Here, we calculate the single-electron move contribution to the $J_{ee}$ Jastrow factor.
|
||||
\[
|
||||
\delta J_{ee} = \sum_i \sum_{j\lt i} \delta_{j,\text{num}} \left(\frac{b_1 \widetilde{r}_{ij}^{\text{new}}}{1+b_2 \widetilde{r}_{ij}^{\text{new}}} - \frac{b_1 \widetilde{r}_{ij}^{\text{old}}}{1+b_2 \widetilde{r}_{ij}^{\text{old}}} + \sum_{k=2}^{N_{\text{bord}}} b_k ({\widetilde{r}_{ij}^{\text{new}}}^k - {\widetilde{r}_{ij}^{\text{old}}}^k )\right),
|
||||
\]
|
||||
|
||||
*** Get
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
qmckl_exit_code
|
||||
@ -5672,7 +5758,7 @@ qmckl_compute_jastrow_champ_single_ee (const qmckl_context context,
|
||||
double* const delta_ee );
|
||||
#+end_src
|
||||
|
||||
#+begin_src c :comments org :tangle (eval c) :noweb yes
|
||||
#+begin_src c :comments org :tangle (eval c) :noweb yes :exports none
|
||||
qmckl_exit_code
|
||||
qmckl_compute_jastrow_champ_single_ee (const qmckl_context context,
|
||||
const int64_t num,
|
||||
@ -5751,6 +5837,11 @@ printf("OK\n");
|
||||
|
||||
** Electron-electron rescaled distances derivatives
|
||||
|
||||
Here, we calculate the derivative of the electron-electron rescaled distances.
|
||||
\[
|
||||
\partial_{i,m} \widetilde{r}_{ij} = \frac{r_{i,m} - r_{j,m}}{r_{ij}} e^{-\kappa r_{ij}} \quad \text{and} \quad \partial_{i,4} \widetilde{r}_{ij} = \left(\frac{2}{r_{ij}} - \kappa \right)e^{-\kappa r_{ij}}
|
||||
\]
|
||||
|
||||
*** Get
|
||||
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
@ -6083,6 +6174,19 @@ printf("OK\n");
|
||||
|
||||
** Electron-electron Jastrow gradients and Laplacian
|
||||
|
||||
Finally, we calculate the gradient and Laplacian of the electron-electron Jastrow factor.
|
||||
\begin{eqnarray*}
|
||||
\partial_{i,m}\delta J_{ee} = & \sum_j \delta_{j,\text{num}} \left( \frac{b_1 \partial_{i,m}\widetilde{r}^{\text{new}}_{ij}}{(1+b_2 \widetilde{r}^{\text{new}}_{ij})^2} - \frac{b_1 \partial_{i,m}\widetilde{r}^{\text{old}}_{ij}}{(1+b_2 \widetilde{r}^{\text{old}}_{ij})^2} + \sum_{k=2}^{N_{\text{bord}}} b_k k \left({\widetilde{r}_{ij}^{\text{new}}}^{k-1} \partial_{i,m}\widetilde{r}^{\text{new}}_{ij} - {\widetilde{r}_{ij}^{\text{old}}}^{k-1} \partial_{i,m}\widetilde{r}^{\text{old}}_{ij} \right) \right)\\
|
||||
\partial_{i,4}\delta J_{ee} = & \sum_j \delta_{j,\text{num}} \left( \frac{b_1}{(1+b_2 \widetilde{r}^{\text{new}}_{ij})^2} \left(\partial_{i,4}\widetilde{r}^{\text{new}}_{ij} - 2 b_2 \frac{\nabla\widetilde{r}^{\text{new}}_{ij} \cdot \nabla \widetilde{r}^{\text{new}}_{ij}}{1+b_2 \widetilde{r}^{\text{new}}_{ij}} \right) - \frac{b_1}{(1+b_2 \widetilde{r}^{\text{old}}_{ij})^2} \left(\partial_{i,4}\widetilde{r}^{\text{old}}_{ij} - 2 b_2 \frac{\nabla\widetilde{r}^{\text{old}}_{ij} \cdot \nabla \widetilde{r}^{\text{old}}_{ij}}{1+b_2 \widetilde{r}^{\text{old}}_{ij}} \right) \right.\\
|
||||
& \left.+ \sum_{k=2}^{N_{\text{bord}}} b_k k \left({\widetilde{r}_{ij}^{\text{new}}}^{k-1}\partial_{i,4}\widetilde{r}_{ij}^{\text{new}} + (k-1)(\nabla\widetilde{r}_{ij}^{\text{new}} \cdot \nabla \widetilde{r}_{ij}^{\text{new}}) {\widetilde{r}_{ij}^{\text{new}}}^{k-2} - {\widetilde{r}_{ij}^{\text{old}}}^{k-1}\partial_{i,4}\widetilde{r}_{ij}^{\text{old}} - (k-1)(\nabla\widetilde{r}_{ij}^{\text{old}} \cdot \nabla \widetilde{r}_{ij}^{\text{old}}) {\widetilde{r}_{ij}^{\text{old}}}^{k-2} \right) \right)
|
||||
\end{eqnarray*}
|
||||
In the special case that $i = \text{num}$, the gradient and Laplacian change to
|
||||
\begin{eqnarray*}
|
||||
\partial_{\text{num},m}\delta J_{ee} = & -\sum_i \sum_j \delta_{j,\text{num}} \left(\frac{b_1 \partial_{i,m}\widetilde{r}^{\text{new}}_{ij}}{(1+b_2 \widetilde{r}^{\text{new}}_{ij})^2} - \frac{b_1 \partial_{i,m}\widetilde{r}^{\text{old}}_{ij}}{(1+b_2 \widetilde{r}^{\text{old}}_{ij})^2} + \sum_{k=2}^{N_{\text{bord}}} b_k k \left({\widetilde{r}_{ij}^{\text{new}}}^{k-1} \partial_{i,m}\widetilde{r}^{\text{new}}_{ij} - {\widetilde{r}_{ij}^{\text{old}}}^{k-1} \partial_{i,m}\widetilde{r}^{\text{old}}_{ij} \right) \right) \\
|
||||
\partial_{\text{num},4}\delta J_{ee} = & -\sum_i \sum_j \delta_{j,\text{num}} \left( \frac{b_1}{(1+b_2 \widetilde{r}^{\text{new}}_{ij})^2} \left(\partial_{i,4}\widetilde{r}^{\text{new}}_{ij} - 2 b_2 \frac{\nabla\widetilde{r}^{\text{new}}_{ij} \cdot \nabla \widetilde{r}^{\text{new}}_{ij}}{1+b_2 \widetilde{r}^{\text{new}}_{ij}} \right) - \frac{b_1}{(1+b_2 \widetilde{r}^{\text{old}}_{ij})^2} \left(\partial_{i,4}\widetilde{r}^{\text{old}}_{ij} - 2 b_2 \frac{\nabla\widetilde{r}^{\text{old}}_{ij} \cdot \nabla \widetilde{r}^{\text{old}}_{ij}}{1+b_2 \widetilde{r}^{\text{old}}_{ij}} \right)\right. \\
|
||||
& \left. + \sum_{k=2}^{N_{\text{bord}}} b_k k \left({\widetilde{r}_{ij}^{\text{new}}}^{k-1}\partial_{i,4}\widetilde{r}_{ij}^{\text{new}} + (k-1)(\nabla\widetilde{r}_{ij}^{\text{new}} \cdot \nabla \widetilde{r}_{ij}^{\text{new}}) {\widetilde{r}_{ij}^{\text{new}}}^{k-2} - {\widetilde{r}_{ij}^{\text{old}}}^{k-1}\partial_{i,4}\widetilde{r}_{ij}^{\text{old}} - (k-1)(\nabla\widetilde{r}_{ij}^{\text{old}} \cdot \nabla \widetilde{r}_{ij}^{\text{old}}) {\widetilde{r}_{ij}^{\text{old}}}^{k-2} \right) \right)
|
||||
\end{eqnarray*}
|
||||
|
||||
*** Get
|
||||
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
@ -6434,7 +6538,7 @@ qmckl_compute_jastrow_champ_single_ee_gl (const qmckl_context context,
|
||||
|
||||
|
||||
|
||||
#+begin_src c :tangle (eval h_private_func) :comments org
|
||||
#+begin_src c :tangle (eval h_private_func) :comments org :exports none
|
||||
qmckl_exit_code
|
||||
qmckl_compute_jastrow_champ_single_ee_gl_doc (const qmckl_context context,
|
||||
const int64_t num,
|
||||
@ -6452,7 +6556,7 @@ qmckl_compute_jastrow_champ_single_ee_gl_doc (const qmckl_context context,
|
||||
#+end_src
|
||||
|
||||
|
||||
#+begin_src c :comments org :tangle (eval c) :noweb yes
|
||||
#+begin_src c :comments org :tangle (eval c) :noweb yes :exports none
|
||||
qmckl_exit_code
|
||||
qmckl_compute_jastrow_champ_single_ee_gl (const qmckl_context context,
|
||||
const int64_t num,
|
||||
@ -6538,8 +6642,36 @@ printf("OK\n");
|
||||
|
||||
* Electron-nucleus Jastrow
|
||||
|
||||
Here we calculate the single-electron move contribution to the $J_{en}$ Jastrow factor.
|
||||
First, we need to compute the single-electron contributions to the rescaled distances.
|
||||
The rescaled electron-electron distance for the 2-body term is defined as
|
||||
\[
|
||||
\widetilde{R}_{i\alpha} = \frac{1-e^{-\kappa R_{i\alpha}}}{\kappa}.
|
||||
\]
|
||||
For the electron-nucleus Jastrow, no intermediate terms have to be calculated, as we can immidiatly calculate
|
||||
\[
|
||||
\delta J_{en} = \sum_i \delta_{i,\text{num}} \left( \frac{a_1 \widetilde{R}_{i\alpha}^{\text{new}}}{1+a_2 \widetilde{R}_{i\alpha}^{\text{new}}} - \frac{a_1 \widetilde{R}_{i\alpha}^{\text{old}}}{1+a_2 \widetilde{R}_{i\alpha}^{\text{old}}} + \sum_{k=2}^{N_\text{aord}} a_k\left({\widetilde{R}_{i\alpha}^{\text{new}}}^k - {\widetilde{R}_{i\alpha}^{\text{old}}}^k \right)\right)
|
||||
\]
|
||||
where num is the electron that is being moved.
|
||||
The gradient and Laplacian of the rescaled distances are given by
|
||||
\[
|
||||
\partial_{i,m} \widetilde{R}_{i\alpha} = \frac{r_{i,m} - R_{\alpha,m}}{R_{i\alpha}} e^{-\kappa R_{i\alpha}} \quad \text{and} \quad \partial_{i,4} \widetilde{R}_{i\alpha} = \left(\frac{2}{R_{i\alpha}} - \kappa \right)e^{-\kappa R_{i\alpha}}
|
||||
\]
|
||||
Then,
|
||||
\begin{eqnarray*}
|
||||
\partial_{i,m}\delta J_{en} = & \sum_\alpha \delta_{i,\text{num}} \left( \frac{a_1 \partial_{i,m}\widetilde{R}^{\text{new}}_{i\alpha}}{(1+a_2 \widetilde{R}^{\text{new}}_{i\alpha})^2} - \frac{a_1 \partial_{i,m}\widetilde{R}^{\text{old}}_{i\alpha}}{(1+a_2 \widetilde{R}^{\text{old}}_{i\alpha})^2} + \sum_{k=2}^{N_{\text{aord}}} a_k k \left({\widetilde{R}_{i\alpha}^{\text{new}}}^{k-1} \partial_{i,m}\widetilde{R}^{\text{new}}_{i\alpha} - {\widetilde{R}_{i\alpha}^{\text{old}}}^{k-1} \partial_{i,m}\widetilde{R}^{\text{old}}_{i\alpha} \right) \right)\\
|
||||
\partial_{i,4}\delta J_{en} = & \sum_\alpha \delta_{i,\text{num}} \left( \frac{a_1}{(1+a_2 \widetilde{R}^{\text{new}}_{i\alpha})^2} \left(\partial_{i,4}\widetilde{R}^{\text{new}}_{i\alpha} - 2 a_2 \frac{\nabla\widetilde{R}^{\text{new}}_{i\alpha} \cdot \nabla \widetilde{R}^{\text{new}}_{i\alpha}}{1+a_2 \widetilde{R}^{\text{new}}_{i\alpha}} \right) - \frac{a_1}{(1+a_2 \widetilde{R}^{\text{old}}_{i\alpha})^2} \left(\partial_{i,4}\widetilde{R}^{\text{old}}_{i\alpha} - 2 a_2 \frac{\nabla\widetilde{R}^{\text{old}}_{i\alpha} \cdot \nabla \widetilde{R}^{\text{old}}_{i\alpha}}{1+b_2 \widetilde{R}^{\text{old}}_{i\alpha}} \right) \right.\\
|
||||
& \left.+ \sum_{k=2}^{N_{\text{aord}}} a_k k \left({\widetilde{R}_{i\alpha}^{\text{new}}}^{k-1}\partial_{i,4}\widetilde{R}_{i\alpha}^{\text{new}} + (k-1)(\nabla\widetilde{R}_{i\alpha}^{\text{new}} \cdot \nabla \widetilde{R}_{i\alpha}^{\text{new}}) {\widetilde{R}_{i\alpha}^{\text{new}}}^{k-2} - {\widetilde{R}_{i\alpha}^{\text{old}}}^{k-1}\partial_{i,4}\widetilde{R}_{i\alpha}^{\text{old}} - (k-1)(\nabla\widetilde{R}_{i\alpha}^{\text{old}} \cdot \nabla \widetilde{R}_{i\alpha}^{\text{old}}) {\widetilde{R}_{i\alpha}^{\text{old}}}^{k-2} \right) \right)
|
||||
\end{eqnarray*}
|
||||
|
||||
|
||||
** Electron-nucleus rescaled distance
|
||||
|
||||
Here, we calculate the single-electron distances
|
||||
\[
|
||||
\widetilde{R}_{i\alpha} = \frac{1-e^{-\kappa R_{i\alpha}}}{\kappa}.
|
||||
\]
|
||||
|
||||
*** Get
|
||||
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
@ -6654,8 +6786,6 @@ qmckl_exit_code qmckl_provide_en_rescaled_single(qmckl_context context)
|
||||
|
||||
ctx->single_point.en_rescaled_single_date = ctx->single_point.date;
|
||||
|
||||
//printf("en rescaled single date %u\n", ctx->single_point.en_rescaled_single_date);
|
||||
//printf("date %u\n", ctx->date);
|
||||
}
|
||||
|
||||
return QMCKL_SUCCESS;
|
||||
@ -6833,6 +6963,11 @@ printf("OK\n");
|
||||
|
||||
** Single electron-nucleus Jastrow value
|
||||
|
||||
Here, we calculate $\delta J_{en}$
|
||||
\[
|
||||
\delta J_{en} = \sum_i \delta_{i,\text{num}} \left( \frac{a_1 \widetilde{R}_{i\alpha}^{\text{new}}}{1+a_2 \widetilde{R}_{i\alpha}^{\text{new}}} - \frac{a_1 \widetilde{R}_{i\alpha}^{\text{old}}}{1+a_2 \widetilde{R}_{i\alpha}^{\text{old}}} + \sum_{k=2}^{N_\text{aord}} a_k\left({\widetilde{R}_{i\alpha}^{\text{new}}}^k - {\widetilde{R}_{i\alpha}^{\text{old}}}^k \right)\right)
|
||||
\]
|
||||
|
||||
*** Get
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
qmckl_exit_code
|
||||
@ -6974,7 +7109,6 @@ qmckl_exit_code qmckl_provide_jastrow_champ_single_en(qmckl_context context)
|
||||
}
|
||||
|
||||
ctx->single_point.delta_en_date = ctx->single_point.date;
|
||||
//printf("D//elta en date %d\n", ctx->single_point.delta_en_date);
|
||||
}
|
||||
|
||||
return QMCKL_SUCCESS;
|
||||
@ -7088,10 +7222,7 @@ function qmckl_compute_jastrow_champ_single_en_doc( &
|
||||
end function qmckl_compute_jastrow_champ_single_en_doc
|
||||
#+end_src
|
||||
|
||||
#+CALL: generate_c_header(table=qmckl_single_en_args,rettyp=get_value("CRetType"),fname=get_value("Name"))
|
||||
|
||||
#+RESULTS:
|
||||
#+begin_src c :tangle (eval h_func) :comments org
|
||||
#+begin_src c :tangle (eval h_func) :comments org :exports none
|
||||
qmckl_exit_code qmckl_compute_jastrow_champ_single_en (
|
||||
const qmckl_context context,
|
||||
const int64_t num,
|
||||
@ -7121,7 +7252,7 @@ qmckl_exit_code qmckl_compute_jastrow_champ_single_en_doc (
|
||||
double* const delta_en );
|
||||
#+end_src
|
||||
|
||||
#+begin_src c :tangle (eval c) :comments org
|
||||
#+begin_src c :tangle (eval c) :comments org :exports none
|
||||
qmckl_exit_code qmckl_compute_jastrow_champ_single_en (
|
||||
const qmckl_context context,
|
||||
const int64_t num,
|
||||
@ -7206,6 +7337,11 @@ printf("OK\n");
|
||||
|
||||
** Electron-nucleus rescaled distances derivatives
|
||||
|
||||
Here we calculate the gradients and Laplacians of the electron-nucleus rescaled distances
|
||||
\[
|
||||
\partial_{i,m} \widetilde{R}_{i\alpha} = \frac{r_{i,m} - R_{\alpha,m}}{R_{i\alpha}} e^{-\kappa R_{i\alpha}} \quad \text{and} \quad \partial_{i,4} \widetilde{R}_{i\alpha} = \left(\frac{2}{R_{i\alpha}} - \kappa \right)e^{-\kappa R_{i\alpha}}
|
||||
\]
|
||||
|
||||
*** Get
|
||||
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
@ -7566,6 +7702,13 @@ printf("OK\n");
|
||||
|
||||
** Electron-nucleus Jastrow gradients and Laplacian
|
||||
|
||||
Finally, we can calculate the gradients and Laplacian of the electron-nucleus Jastrow
|
||||
\begin{eqnarray*}
|
||||
\partial_{i,m}\delta J_{en} = & \sum_\alpha \delta_{i,\text{num}} \left( \frac{a_1 \partial_{i,m}\widetilde{R}^{\text{new}}_{i\alpha}}{(1+a_2 \widetilde{R}^{\text{new}}_{i\alpha})^2} - \frac{a_1 \partial_{i,m}\widetilde{R}^{\text{old}}_{i\alpha}}{(1+a_2 \widetilde{R}^{\text{old}}_{i\alpha})^2} + \sum_{k=2}^{N_{\text{aord}}} a_k k \left({\widetilde{R}_{i\alpha}^{\text{new}}}^{k-1} \partial_{i,m}\widetilde{R}^{\text{new}}_{i\alpha} - {\widetilde{R}_{i\alpha}^{\text{old}}}^{k-1} \partial_{i,m}\widetilde{R}^{\text{old}}_{i\alpha} \right) \right)\\
|
||||
\partial_{i,4}\delta J_{en} = & \sum_\alpha \delta_{i,\text{num}} \left( \frac{a_1}{(1+a_2 \widetilde{R}^{\text{new}}_{i\alpha})^2} \left(\partial_{i,4}\widetilde{R}^{\text{new}}_{i\alpha} - 2 a_2 \frac{\nabla\widetilde{R}^{\text{new}}_{i\alpha} \cdot \nabla \widetilde{R}^{\text{new}}_{i\alpha}}{1+a_2 \widetilde{R}^{\text{new}}_{i\alpha}} \right) - \frac{a_1}{(1+a_2 \widetilde{R}^{\text{old}}_{i\alpha})^2} \left(\partial_{i,4}\widetilde{R}^{\text{old}}_{i\alpha} - 2 a_2 \frac{\nabla\widetilde{R}^{\text{old}}_{i\alpha} \cdot \nabla \widetilde{R}^{\text{old}}_{i\alpha}}{1+b_2 \widetilde{R}^{\text{old}}_{i\alpha}} \right) \right.\\
|
||||
& \left.+ \sum_{k=2}^{N_{\text{aord}}} a_k k \left({\widetilde{R}_{i\alpha}^{\text{new}}}^{k-1}\partial_{i,4}\widetilde{R}_{i\alpha}^{\text{new}} + (k-1)(\nabla\widetilde{R}_{i\alpha}^{\text{new}} \cdot \nabla \widetilde{R}_{i\alpha}^{\text{new}}) {\widetilde{R}_{i\alpha}^{\text{new}}}^{k-2} - {\widetilde{R}_{i\alpha}^{\text{old}}}^{k-1}\partial_{i,4}\widetilde{R}_{i\alpha}^{\text{old}} - (k-1)(\nabla\widetilde{R}_{i\alpha}^{\text{old}} \cdot \nabla \widetilde{R}_{i\alpha}^{\text{old}}) {\widetilde{R}_{i\alpha}^{\text{old}}}^{k-2} \right) \right)
|
||||
\end{eqnarray*}
|
||||
|
||||
*** Get
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
qmckl_exit_code
|
||||
@ -7995,6 +8138,20 @@ printf("OK\n");
|
||||
|
||||
* Accept single electron move
|
||||
|
||||
This function 'accepts' a proposed single-electron move. It overrides (or adds to) the required arrays and matrices to bring the positions of the electron and the full Jastrow factor up to date.
|
||||
For instances,
|
||||
\begin{eqnarray}
|
||||
J_{en} = & J_{en} + \delta J_{en}\\
|
||||
J_{ee} = & J_{ee} + \delta J_{ee}\\
|
||||
J_{een} = & J_{een} + \delta J_{een}\\
|
||||
|
||||
\partial_{i,m} J_{en} = & \partial_{i,m} J_{en} + \partial_{i,m} \delta J_{en}\\
|
||||
\partial_{i,m} J_{ee} = & \partial_{i,m} J_{ee} + \partial_{i,m} \delta J_{ee}\\
|
||||
\partial_{i,m} J_{een} = & \partial_{i,m} J_{een} + \partial_{i,m} \delta J_{een}\\
|
||||
|
||||
\end{eqnarray}
|
||||
The function has similar functionaly for the intermediate products, such as $P$, $\widetilde{r}$, $\widetilde{R}$, and the derivative of these.
|
||||
Furthermore, it also updates the dates, such that immidiatly calling a Jastrow function after an accepted single-electorn move will not trigger a re-calculation of the Jastrow factors.
|
||||
** Code
|
||||
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
@ -8002,7 +8159,7 @@ qmckl_exit_code
|
||||
qmckl_get_jastrow_champ_single_accept(qmckl_context context);
|
||||
#+end_src
|
||||
|
||||
#+begin_src c :comments org :tangle (eval c) :noweb yes
|
||||
#+begin_src c :comments org :tangle (eval c) :noweb yes :exports none
|
||||
qmckl_exit_code
|
||||
qmckl_get_jastrow_champ_single_accept_alt(qmckl_context context)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user