mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-03 10:06:09 +01:00
Fixed bug in Jastrow gradient and Laplacian
This commit is contained in:
parent
4133a6ba0e
commit
5303bf88b3
@ -6067,7 +6067,7 @@ integer function qmckl_compute_jastrow_champ_factor_een_rescaled_e_gl_f( &
|
|||||||
double precision :: x, rij_inv, kappa_l
|
double precision :: x, rij_inv, kappa_l
|
||||||
integer*8 :: i, j, k, l, nw, ii
|
integer*8 :: i, j, k, l, nw, ii
|
||||||
|
|
||||||
allocate(elec_dist_gl(4,elec_num,elec_num))
|
allocate(elec_dist_gl(elec_num, 4, elec_num))
|
||||||
|
|
||||||
info = QMCKL_SUCCESS
|
info = QMCKL_SUCCESS
|
||||||
|
|
||||||
@ -6098,19 +6098,19 @@ integer function qmckl_compute_jastrow_champ_factor_een_rescaled_e_gl_f( &
|
|||||||
do i = 1, j-1
|
do i = 1, j-1
|
||||||
rij_inv = 1.0d0 / ee_distance(i, j, nw)
|
rij_inv = 1.0d0 / ee_distance(i, j, nw)
|
||||||
do ii = 1, 3
|
do ii = 1, 3
|
||||||
elec_dist_gl(ii, i, j) = (coord_ee(i, ii, nw) - coord_ee(j, ii, nw)) * rij_inv
|
elec_dist_gl(i, ii, j) = (coord_ee(i, ii, nw) - coord_ee(j, ii, nw)) * rij_inv
|
||||||
end do
|
end do
|
||||||
elec_dist_gl(4, i, j) = 2.0d0 * rij_inv
|
elec_dist_gl(i, 4, j) = 2.0d0 * rij_inv
|
||||||
end do
|
end do
|
||||||
|
|
||||||
elec_dist_gl(:, j, j) = 0.0d0
|
elec_dist_gl(j, :, j) = 0.0d0
|
||||||
|
|
||||||
do i = j+1, elec_num
|
do i = j+1, elec_num
|
||||||
rij_inv = 1.0d0 / ee_distance(i, j, nw)
|
rij_inv = 1.0d0 / ee_distance(i, j, nw)
|
||||||
do ii = 1, 3
|
do ii = 1, 3
|
||||||
elec_dist_gl(ii, i, j) = (coord_ee(i, ii, nw) - coord_ee(j, ii, nw)) * rij_inv
|
elec_dist_gl(i, ii, j) = (coord_ee(i, ii, nw) - coord_ee(j, ii, nw)) * rij_inv
|
||||||
end do
|
end do
|
||||||
elec_dist_gl(4, i, j) = 2.0d0 * rij_inv
|
elec_dist_gl(i, 4, j) = 2.0d0 * rij_inv
|
||||||
end do
|
end do
|
||||||
end do
|
end do
|
||||||
|
|
||||||
@ -6119,24 +6119,20 @@ integer function qmckl_compute_jastrow_champ_factor_een_rescaled_e_gl_f( &
|
|||||||
kappa_l = - dble(l) * rescale_factor_ee
|
kappa_l = - dble(l) * rescale_factor_ee
|
||||||
do j = 1, elec_num
|
do j = 1, elec_num
|
||||||
do i = 1, elec_num
|
do i = 1, elec_num
|
||||||
een_rescaled_e_gl(i, 1, j, l, nw) = kappa_l * elec_dist_gl(1, i, j)
|
een_rescaled_e_gl(i, 1, j, l, nw) = kappa_l * elec_dist_gl(i, 1, j)
|
||||||
een_rescaled_e_gl(i, 2, j, l, nw) = kappa_l * elec_dist_gl(2, i, j)
|
een_rescaled_e_gl(i, 2, j, l, nw) = kappa_l * elec_dist_gl(i, 2, j)
|
||||||
een_rescaled_e_gl(i, 3, j, l, nw) = kappa_l * elec_dist_gl(3, i, j)
|
een_rescaled_e_gl(i, 3, j, l, nw) = kappa_l * elec_dist_gl(i, 3, j)
|
||||||
een_rescaled_e_gl(i, 4, j, l, nw) = kappa_l * elec_dist_gl(4, i, j)
|
een_rescaled_e_gl(i, 4, j, l, nw) = kappa_l * elec_dist_gl(i, 4, j)
|
||||||
|
|
||||||
een_rescaled_e_gl(i, 4, j, l, nw) = een_rescaled_e_gl(i, 4, j, l, nw) &
|
een_rescaled_e_gl(i, 4, j, l, nw) = een_rescaled_e_gl(i, 4, j, l, nw) &
|
||||||
+ een_rescaled_e_gl(i, 1, j, l, nw) * een_rescaled_e_gl(i, 1, j, l, nw) &
|
+ een_rescaled_e_gl(i, 1, j, l, nw) * een_rescaled_e_gl(i, 1, j, l, nw) &
|
||||||
+ een_rescaled_e_gl(i, 2, j, l, nw) * een_rescaled_e_gl(i, 2, j, l, nw) &
|
+ een_rescaled_e_gl(i, 2, j, l, nw) * een_rescaled_e_gl(i, 2, j, l, nw) &
|
||||||
+ een_rescaled_e_gl(i, 3, j, l, nw) * een_rescaled_e_gl(i, 3, j, l, nw)
|
+ een_rescaled_e_gl(i, 3, j, l, nw) * een_rescaled_e_gl(i, 3, j, l, nw)
|
||||||
|
|
||||||
een_rescaled_e_gl(i, 1, j, l, nw) = een_rescaled_e_gl(i, 1, j, l, nw) * &
|
een_rescaled_e_gl(i,1,j,l,nw) = een_rescaled_e_gl(i,1,j,l,nw) * een_rescaled_e(i,j,l,nw)
|
||||||
een_rescaled_e(i, j, l, nw)
|
een_rescaled_e_gl(i,2,j,l,nw) = een_rescaled_e_gl(i,2,j,l,nw) * een_rescaled_e(i,j,l,nw)
|
||||||
een_rescaled_e_gl(i, 3, j, l, nw) = een_rescaled_e_gl(i, 2, j, l, nw) * &
|
een_rescaled_e_gl(i,3,j,l,nw) = een_rescaled_e_gl(i,3,j,l,nw) * een_rescaled_e(i,j,l,nw)
|
||||||
een_rescaled_e(i, j, l, nw)
|
een_rescaled_e_gl(i,4,j,l,nw) = een_rescaled_e_gl(i,4,j,l,nw) * een_rescaled_e(i,j,l,nw)
|
||||||
een_rescaled_e_gl(i, 3, j, l, nw) = een_rescaled_e_gl(i, 3, j, l, nw) * &
|
|
||||||
een_rescaled_e(i, j, l, nw)
|
|
||||||
een_rescaled_e_gl(i, 4, j, l, nw) = een_rescaled_e_gl(i, 4, j, l, nw) * &
|
|
||||||
een_rescaled_e(i, j, l, nw)
|
|
||||||
end do
|
end do
|
||||||
end do
|
end do
|
||||||
end do
|
end do
|
||||||
@ -6847,27 +6843,27 @@ qmckl_exit_code qmckl_provide_een_rescaled_n_gl(qmckl_context context)
|
|||||||
:END:
|
:END:
|
||||||
|
|
||||||
#+NAME: qmckl_compute_jastrow_champ_factor_een_rescaled_n_gl_args
|
#+NAME: qmckl_compute_jastrow_champ_factor_een_rescaled_n_gl_args
|
||||||
| Variable | Type | In/Out | Description |
|
| Variable | Type | In/Out | Description |
|
||||||
|--------------------------+-------------------------------------------------------+--------+-------------------------------------|
|
|---------------------+-------------------------------------------------------+--------+-------------------------------------|
|
||||||
| ~context~ | ~qmckl_context~ | in | Global state |
|
| ~context~ | ~qmckl_context~ | in | Global state |
|
||||||
| ~walk_num~ | ~int64_t~ | in | Number of walkers |
|
| ~walk_num~ | ~int64_t~ | in | Number of walkers |
|
||||||
| ~elec_num~ | ~int64_t~ | in | Number of electrons |
|
| ~elec_num~ | ~int64_t~ | in | Number of electrons |
|
||||||
| ~nucl_num~ | ~int64_t~ | in | Number of atoms |
|
| ~nucl_num~ | ~int64_t~ | in | Number of atoms |
|
||||||
| ~type_nucl_num~ | ~int64_t~ | in | Number of atom types |
|
| ~type_nucl_num~ | ~int64_t~ | in | Number of atom types |
|
||||||
| ~type_nucl_vector~ | ~int64_t[nucl_num]~ | in | Types of atoms |
|
| ~type_nucl_vector~ | ~int64_t[nucl_num]~ | in | Types of atoms |
|
||||||
| ~cord_num~ | ~int64_t~ | in | Order of polynomials |
|
| ~cord_num~ | ~int64_t~ | in | Order of polynomials |
|
||||||
| ~rescale_factor_en~ | ~double[nucl_num]~ | in | Factor to rescale ee distances |
|
| ~rescale_factor_en~ | ~double[nucl_num]~ | in | Factor to rescale ee distances |
|
||||||
| ~coord_ee~ | ~double[walk_num][3][elec_num]~ | in | Electron coordinates |
|
| ~coord_ee~ | ~double[walk_num][3][elec_num]~ | in | Electron coordinates |
|
||||||
| ~coord_en~ | ~double[3][nucl_num]~ | in | Nuclear coordinates |
|
| ~coord_n~ | ~double[3][nucl_num]~ | in | Nuclear coordinates |
|
||||||
| ~en_distance~ | ~double[walk_num][elec_num][nucl_num]~ | in | Electron-nucleus distances |
|
| ~en_distance~ | ~double[walk_num][elec_num][nucl_num]~ | in | Electron-nucleus distances |
|
||||||
| ~een_rescaled_n~ | ~double[walk_num][0:cord_num][nucl_num][elec_num]~ | in | Electron-nucleus distances |
|
| ~een_rescaled_n~ | ~double[walk_num][0:cord_num][nucl_num][elec_num]~ | in | Electron-nucleus distances |
|
||||||
| ~een_rescaled_n_gl~ | ~double[walk_num][0:cord_num][nucl_num][4][elec_num]~ | out | Electron-nucleus rescaled distances |
|
| ~een_rescaled_n_gl~ | ~double[walk_num][0:cord_num][nucl_num][4][elec_num]~ | out | Electron-nucleus rescaled distances |
|
||||||
|
|
||||||
#+begin_src f90 :comments org :tangle (eval f) :noweb yes
|
#+begin_src f90 :comments org :tangle (eval f) :noweb yes
|
||||||
integer function qmckl_compute_jastrow_champ_factor_een_rescaled_n_gl_f( &
|
integer function qmckl_compute_jastrow_champ_factor_een_rescaled_n_gl_f( &
|
||||||
context, walk_num, elec_num, nucl_num, type_nucl_num, type_nucl_vector, &
|
context, walk_num, elec_num, nucl_num, type_nucl_num, type_nucl_vector, &
|
||||||
cord_num, rescale_factor_en, &
|
cord_num, rescale_factor_en, &
|
||||||
coord_ee, coord_en, en_distance, een_rescaled_n, een_rescaled_n_gl) &
|
coord_ee, coord_n, en_distance, een_rescaled_n, een_rescaled_n_gl) &
|
||||||
result(info)
|
result(info)
|
||||||
use qmckl
|
use qmckl
|
||||||
implicit none
|
implicit none
|
||||||
@ -6880,7 +6876,7 @@ integer function qmckl_compute_jastrow_champ_factor_een_rescaled_n_gl_f( &
|
|||||||
integer*8 , intent(in) :: cord_num
|
integer*8 , intent(in) :: cord_num
|
||||||
double precision , intent(in) :: rescale_factor_en(type_nucl_num)
|
double precision , intent(in) :: rescale_factor_en(type_nucl_num)
|
||||||
double precision , intent(in) :: coord_ee(elec_num,3,walk_num)
|
double precision , intent(in) :: coord_ee(elec_num,3,walk_num)
|
||||||
double precision , intent(in) :: coord_en(nucl_num,3)
|
double precision , intent(in) :: coord_n(nucl_num,3)
|
||||||
double precision , intent(in) :: en_distance(nucl_num,elec_num,walk_num)
|
double precision , intent(in) :: en_distance(nucl_num,elec_num,walk_num)
|
||||||
double precision , intent(in) :: een_rescaled_n(elec_num,nucl_num,0:cord_num,walk_num)
|
double precision , intent(in) :: een_rescaled_n(elec_num,nucl_num,0:cord_num,walk_num)
|
||||||
double precision , intent(out) :: een_rescaled_n_gl(elec_num,4,nucl_num,0:cord_num,walk_num)
|
double precision , intent(out) :: een_rescaled_n_gl(elec_num,4,nucl_num,0:cord_num,walk_num)
|
||||||
@ -6888,7 +6884,7 @@ integer function qmckl_compute_jastrow_champ_factor_een_rescaled_n_gl_f( &
|
|||||||
double precision :: x, ria_inv, kappa_l
|
double precision :: x, ria_inv, kappa_l
|
||||||
integer*8 :: i, a, k, l, nw, ii
|
integer*8 :: i, a, k, l, nw, ii
|
||||||
|
|
||||||
allocate(elnuc_dist_gl(4, elec_num, nucl_num))
|
allocate(elnuc_dist_gl(elec_num, 4, nucl_num))
|
||||||
|
|
||||||
info = QMCKL_SUCCESS
|
info = QMCKL_SUCCESS
|
||||||
|
|
||||||
@ -6921,42 +6917,42 @@ integer function qmckl_compute_jastrow_champ_factor_een_rescaled_n_gl_f( &
|
|||||||
een_rescaled_n_gl = 0.0d0
|
een_rescaled_n_gl = 0.0d0
|
||||||
do nw = 1, walk_num
|
do nw = 1, walk_num
|
||||||
|
|
||||||
! prepare the actual een table
|
! prepare the actual een table
|
||||||
do a = 1, nucl_num
|
do a = 1, nucl_num
|
||||||
do i = 1, elec_num
|
do i = 1, elec_num
|
||||||
ria_inv = 1.0d0 / en_distance(a, i, nw)
|
ria_inv = 1.0d0 / en_distance(a, i, nw)
|
||||||
do ii = 1, 3
|
do ii = 1, 3
|
||||||
elnuc_dist_gl(ii, i, a) = (coord_ee(i, ii, nw) - coord_en(a, ii)) * ria_inv
|
elnuc_dist_gl(i, ii, a) = (coord_ee(i, ii, nw) - coord_n(a, ii)) * ria_inv
|
||||||
end do
|
end do
|
||||||
elnuc_dist_gl(4, i, a) = 2.0d0 * ria_inv
|
elnuc_dist_gl(i, 4, a) = 2.0d0 * ria_inv
|
||||||
end do
|
end do
|
||||||
end do
|
end do
|
||||||
|
|
||||||
do l = 0, cord_num
|
do l = 0, cord_num
|
||||||
do a = 1, nucl_num
|
do a = 1, nucl_num
|
||||||
kappa_l = - dble(l) * rescale_factor_en(type_nucl_vector(a)+1)
|
kappa_l = - dble(l) * rescale_factor_en(type_nucl_vector(a)+1)
|
||||||
do i = 1, elec_num
|
do i = 1, elec_num
|
||||||
een_rescaled_n_gl(i, 1, a, l, nw) = kappa_l * elnuc_dist_gl(1, i, a)
|
een_rescaled_n_gl(i, 1, a, l, nw) = kappa_l * elnuc_dist_gl(i, 1, a)
|
||||||
een_rescaled_n_gl(i, 2, a, l, nw) = kappa_l * elnuc_dist_gl(2, i, a)
|
een_rescaled_n_gl(i, 2, a, l, nw) = kappa_l * elnuc_dist_gl(i, 2, a)
|
||||||
een_rescaled_n_gl(i, 3, a, l, nw) = kappa_l * elnuc_dist_gl(3, i, a)
|
een_rescaled_n_gl(i, 3, a, l, nw) = kappa_l * elnuc_dist_gl(i, 3, a)
|
||||||
een_rescaled_n_gl(i, 4, a, l, nw) = kappa_l * elnuc_dist_gl(4, i, a)
|
een_rescaled_n_gl(i, 4, a, l, nw) = kappa_l * elnuc_dist_gl(i, 4, a)
|
||||||
|
|
||||||
een_rescaled_n_gl(i, 4, a, l, nw) = een_rescaled_n_gl(i, 4, a, l, nw) &
|
een_rescaled_n_gl(i, 4, a, l, nw) = een_rescaled_n_gl(i, 4, a, l, nw) &
|
||||||
+ een_rescaled_n_gl(i, 1, a, l, nw) * een_rescaled_n_gl(i, 1, a, l, nw) &
|
+ een_rescaled_n_gl(i, 1, a, l, nw) * een_rescaled_n_gl(i, 1, a, l, nw) &
|
||||||
+ een_rescaled_n_gl(i, 2, a, l, nw) * een_rescaled_n_gl(i, 2, a, l, nw) &
|
+ een_rescaled_n_gl(i, 2, a, l, nw) * een_rescaled_n_gl(i, 2, a, l, nw) &
|
||||||
+ een_rescaled_n_gl(i, 3, a, l, nw) * een_rescaled_n_gl(i, 3, a, l, nw)
|
+ een_rescaled_n_gl(i, 3, a, l, nw) * een_rescaled_n_gl(i, 3, a, l, nw)
|
||||||
|
|
||||||
een_rescaled_n_gl(i, 1, a, l, nw) = een_rescaled_n_gl(i, 1, a, l, nw) * &
|
een_rescaled_n_gl(i, 1, a, l, nw) = een_rescaled_n_gl(i, 1, a, l, nw) * &
|
||||||
een_rescaled_n(i, a, l, nw)
|
een_rescaled_n(i, a, l, nw)
|
||||||
een_rescaled_n_gl(i, 2, a, l, nw) = een_rescaled_n_gl(i, 2, a, l, nw) * &
|
een_rescaled_n_gl(i, 2, a, l, nw) = een_rescaled_n_gl(i, 2, a, l, nw) * &
|
||||||
een_rescaled_n(i, a, l, nw)
|
een_rescaled_n(i, a, l, nw)
|
||||||
een_rescaled_n_gl(i, 3, a, l, nw) = een_rescaled_n_gl(i, 3, a, l, nw) * &
|
een_rescaled_n_gl(i, 3, a, l, nw) = een_rescaled_n_gl(i, 3, a, l, nw) * &
|
||||||
een_rescaled_n(i, a, l, nw)
|
een_rescaled_n(i, a, l, nw)
|
||||||
een_rescaled_n_gl(i, 4, a, l, nw) = een_rescaled_n_gl(i, 4, a, l, nw) * &
|
een_rescaled_n_gl(i, 4, a, l, nw) = een_rescaled_n_gl(i, 4, a, l, nw) * &
|
||||||
een_rescaled_n(i, a, l, nw)
|
een_rescaled_n(i, a, l, nw)
|
||||||
end do
|
end do
|
||||||
end do
|
end do
|
||||||
end do
|
end do
|
||||||
end do
|
end do
|
||||||
|
|
||||||
end function qmckl_compute_jastrow_champ_factor_een_rescaled_n_gl_f
|
end function qmckl_compute_jastrow_champ_factor_een_rescaled_n_gl_f
|
||||||
@ -6975,7 +6971,7 @@ end function qmckl_compute_jastrow_champ_factor_een_rescaled_n_gl_f
|
|||||||
const int64_t cord_num,
|
const int64_t cord_num,
|
||||||
const double* rescale_factor_en,
|
const double* rescale_factor_en,
|
||||||
const double* coord_ee,
|
const double* coord_ee,
|
||||||
const double* coord_en,
|
const double* coord_n,
|
||||||
const double* en_distance,
|
const double* en_distance,
|
||||||
const double* een_rescaled_n,
|
const double* een_rescaled_n,
|
||||||
double* const een_rescaled_n_gl );
|
double* const een_rescaled_n_gl );
|
||||||
@ -6995,7 +6991,7 @@ end function qmckl_compute_jastrow_champ_factor_een_rescaled_n_gl_f
|
|||||||
cord_num, &
|
cord_num, &
|
||||||
rescale_factor_en, &
|
rescale_factor_en, &
|
||||||
coord_ee, &
|
coord_ee, &
|
||||||
coord_en, &
|
coord_n, &
|
||||||
en_distance, &
|
en_distance, &
|
||||||
een_rescaled_n, &
|
een_rescaled_n, &
|
||||||
een_rescaled_n_gl) &
|
een_rescaled_n_gl) &
|
||||||
@ -7013,7 +7009,7 @@ end function qmckl_compute_jastrow_champ_factor_een_rescaled_n_gl_f
|
|||||||
integer (c_int64_t) , intent(in) , value :: cord_num
|
integer (c_int64_t) , intent(in) , value :: cord_num
|
||||||
real (c_double ) , intent(in) :: rescale_factor_en(nucl_num)
|
real (c_double ) , intent(in) :: rescale_factor_en(nucl_num)
|
||||||
real (c_double ) , intent(in) :: coord_ee(elec_num,3,walk_num)
|
real (c_double ) , intent(in) :: coord_ee(elec_num,3,walk_num)
|
||||||
real (c_double ) , intent(in) :: coord_en(nucl_num,3)
|
real (c_double ) , intent(in) :: coord_n(nucl_num,3)
|
||||||
real (c_double ) , intent(in) :: en_distance(nucl_num,elec_num,walk_num)
|
real (c_double ) , intent(in) :: en_distance(nucl_num,elec_num,walk_num)
|
||||||
real (c_double ) , intent(in) :: een_rescaled_n(elec_num,nucl_num,0:cord_num,walk_num)
|
real (c_double ) , intent(in) :: een_rescaled_n(elec_num,nucl_num,0:cord_num,walk_num)
|
||||||
real (c_double ) , intent(out) :: een_rescaled_n_gl(elec_num,4,nucl_num,0:cord_num,walk_num)
|
real (c_double ) , intent(out) :: een_rescaled_n_gl(elec_num,4,nucl_num,0:cord_num,walk_num)
|
||||||
@ -7029,7 +7025,7 @@ end function qmckl_compute_jastrow_champ_factor_een_rescaled_n_gl_f
|
|||||||
cord_num, &
|
cord_num, &
|
||||||
rescale_factor_en, &
|
rescale_factor_en, &
|
||||||
coord_ee, &
|
coord_ee, &
|
||||||
coord_en, &
|
coord_n, &
|
||||||
en_distance, &
|
en_distance, &
|
||||||
een_rescaled_n, &
|
een_rescaled_n, &
|
||||||
een_rescaled_n_gl)
|
een_rescaled_n_gl)
|
||||||
@ -9188,6 +9184,22 @@ qmckl_exit_code qmckl_provide_jastrow_champ_factor_een_gl(qmckl_context context)
|
|||||||
ctx->jastrow_champ.factor_een_gl = factor_een_gl;
|
ctx->jastrow_champ.factor_een_gl = factor_een_gl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
rc = qmckl_compute_jastrow_champ_factor_een_gl_naive (context,
|
||||||
|
ctx->electron.walker.num,
|
||||||
|
ctx->electron.num,
|
||||||
|
ctx->nucleus.num,
|
||||||
|
ctx->jastrow_champ.cord_num,
|
||||||
|
ctx->jastrow_champ.dim_c_vector,
|
||||||
|
ctx->jastrow_champ.c_vector_full,
|
||||||
|
ctx->jastrow_champ.lkpm_combined_index,
|
||||||
|
ctx->jastrow_champ.een_rescaled_e,
|
||||||
|
ctx->jastrow_champ.een_rescaled_n,
|
||||||
|
ctx->jastrow_champ.een_rescaled_e_gl,
|
||||||
|
ctx->jastrow_champ.een_rescaled_n_gl,
|
||||||
|
ctx->jastrow_champ.factor_een_gl);
|
||||||
|
,*/
|
||||||
|
|
||||||
rc = qmckl_compute_jastrow_champ_factor_een_gl(context,
|
rc = qmckl_compute_jastrow_champ_factor_een_gl(context,
|
||||||
ctx->electron.walker.num,
|
ctx->electron.walker.num,
|
||||||
ctx->electron.num,
|
ctx->electron.num,
|
||||||
@ -9201,6 +9213,7 @@ qmckl_exit_code qmckl_provide_jastrow_champ_factor_een_gl(qmckl_context context)
|
|||||||
ctx->jastrow_champ.een_rescaled_n,
|
ctx->jastrow_champ.een_rescaled_n,
|
||||||
ctx->jastrow_champ.een_rescaled_n_gl,
|
ctx->jastrow_champ.een_rescaled_n_gl,
|
||||||
ctx->jastrow_champ.factor_een_gl);
|
ctx->jastrow_champ.factor_een_gl);
|
||||||
|
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -9220,21 +9233,21 @@ qmckl_exit_code qmckl_provide_jastrow_champ_factor_een_gl(qmckl_context context)
|
|||||||
:END:
|
:END:
|
||||||
|
|
||||||
#+NAME: qmckl_factor_een_gl_naive_args
|
#+NAME: qmckl_factor_een_gl_naive_args
|
||||||
| Variable | Type | In/Out | Description |
|
| Variable | Type | In/Out | Description |
|
||||||
|--------------------------+-------------------------------------------------------+--------+--------------------------------------|
|
|-----------------------+-------------------------------------------------------+--------+--------------------------------------|
|
||||||
| ~context~ | ~qmckl_context~ | in | Global state |
|
| ~context~ | ~qmckl_context~ | in | Global state |
|
||||||
| ~walk_num~ | ~int64_t~ | in | Number of walkers |
|
| ~walk_num~ | ~int64_t~ | in | Number of walkers |
|
||||||
| ~elec_num~ | ~int64_t~ | in | Number of electrons |
|
| ~elec_num~ | ~int64_t~ | in | Number of electrons |
|
||||||
| ~nucl_num~ | ~int64_t~ | in | Number of nuclei |
|
| ~nucl_num~ | ~int64_t~ | in | Number of nuclei |
|
||||||
| ~cord_num~ | ~int64_t~ | in | order of polynomials |
|
| ~cord_num~ | ~int64_t~ | in | order of polynomials |
|
||||||
| ~dim_c_vector~ | ~int64_t~ | in | dimension of full coefficient vector |
|
| ~dim_c_vector~ | ~int64_t~ | in | dimension of full coefficient vector |
|
||||||
| ~c_vector_full~ | ~double[dim_c_vector][nucl_num]~ | in | full coefficient vector |
|
| ~c_vector_full~ | ~double[dim_c_vector][nucl_num]~ | in | full coefficient vector |
|
||||||
| ~lkpm_combined_index~ | ~int64_t[4][dim_c_vector]~ | in | combined indices |
|
| ~lkpm_combined_index~ | ~int64_t[4][dim_c_vector]~ | in | combined indices |
|
||||||
| ~een_rescaled_e~ | ~double[walk_num][elec_num][elec_num][0:cord_num]~ | in | Electron-nucleus rescaled |
|
| ~een_rescaled_e~ | ~double[walk_num][0:cord_num][elec_num][elec_num]~ | in | Electron-nucleus rescaled |
|
||||||
| ~een_rescaled_n~ | ~double[walk_num][elec_num][nucl_num][0:cord_num]~ | in | Electron-nucleus rescaled factor |
|
| ~een_rescaled_n~ | ~double[walk_num][0:cord_num][nucl_num][elec_num]~ | in | Electron-nucleus rescaled factor |
|
||||||
| ~een_rescaled_e_gl~ | ~double[walk_num][elec_num][4][elec_num][0:cord_num]~ | in | Electron-nucleus rescaled |
|
| ~een_rescaled_e_gl~ | ~double[walk_num][0:cord_num][elec_num][4][elec_num]~ | in | Electron-nucleus rescaled |
|
||||||
| ~een_rescaled_n_gl~ | ~double[walk_num][elec_num][4][nucl_num][0:cord_num]~ | in | Electron-nucleus rescaled factor |
|
| ~een_rescaled_n_gl~ | ~double[walk_num][0:cord_num][nucl_num][4][elec_num]~ | in | Electron-nucleus rescaled factor |
|
||||||
| ~factor_een_gl~ | ~double[walk_num][4][elec_num]~ | out | Electron-nucleus jastrow |
|
| ~factor_een_gl~ | ~double[walk_num][4][elec_num]~ | out | Electron-nucleus jastrow |
|
||||||
|
|
||||||
#+begin_src f90 :comments org :tangle (eval f) :noweb yes
|
#+begin_src f90 :comments org :tangle (eval f) :noweb yes
|
||||||
integer function qmckl_compute_jastrow_champ_factor_een_gl_naive_f( &
|
integer function qmckl_compute_jastrow_champ_factor_een_gl_naive_f( &
|
||||||
@ -9248,10 +9261,10 @@ integer function qmckl_compute_jastrow_champ_factor_een_gl_naive_f( &
|
|||||||
integer*8 , intent(in) :: walk_num, elec_num, cord_num, nucl_num, dim_c_vector
|
integer*8 , intent(in) :: walk_num, elec_num, cord_num, nucl_num, dim_c_vector
|
||||||
integer*8 , intent(in) :: lkpm_combined_index(dim_c_vector, 4)
|
integer*8 , intent(in) :: lkpm_combined_index(dim_c_vector, 4)
|
||||||
double precision , intent(in) :: c_vector_full(nucl_num, dim_c_vector)
|
double precision , intent(in) :: c_vector_full(nucl_num, dim_c_vector)
|
||||||
double precision , intent(in) :: een_rescaled_e(0:cord_num, elec_num, elec_num, walk_num)
|
double precision , intent(in) :: een_rescaled_e(elec_num, elec_num, 0:cord_num, walk_num)
|
||||||
double precision , intent(in) :: een_rescaled_n(0:cord_num, nucl_num, elec_num, walk_num)
|
double precision , intent(in) :: een_rescaled_n(elec_num, nucl_num, 0:cord_num, walk_num)
|
||||||
double precision , intent(in) :: een_rescaled_e_gl(0:cord_num, elec_num, 4, elec_num, walk_num)
|
double precision , intent(in) :: een_rescaled_e_gl(elec_num, 4, elec_num, 0:cord_num, walk_num)
|
||||||
double precision , intent(in) :: een_rescaled_n_gl(0:cord_num, nucl_num, 4, elec_num, walk_num)
|
double precision , intent(in) :: een_rescaled_n_gl(elec_num, 4, nucl_num, 0:cord_num, walk_num)
|
||||||
double precision , intent(out) :: factor_een_gl(elec_num, 4, walk_num)
|
double precision , intent(out) :: factor_een_gl(elec_num, 4, walk_num)
|
||||||
|
|
||||||
integer*8 :: i, a, j, l, k, p, m, n, nw
|
integer*8 :: i, a, j, l, k, p, m, n, nw
|
||||||
@ -9266,48 +9279,48 @@ integer function qmckl_compute_jastrow_champ_factor_een_gl_naive_f( &
|
|||||||
if (nucl_num <= 0) info = QMCKL_INVALID_ARG_4
|
if (nucl_num <= 0) info = QMCKL_INVALID_ARG_4
|
||||||
if (cord_num < 0) info = QMCKL_INVALID_ARG_5
|
if (cord_num < 0) info = QMCKL_INVALID_ARG_5
|
||||||
if (info /= QMCKL_SUCCESS) return
|
if (info /= QMCKL_SUCCESS) return
|
||||||
|
|
||||||
factor_een_gl = 0.0d0
|
factor_een_gl = 0.0d0
|
||||||
|
|
||||||
do nw =1, walk_num
|
do nw =1, walk_num
|
||||||
do n = 1, dim_c_vector
|
do n = 1, dim_c_vector
|
||||||
l = lkpm_combined_index(n, 1)
|
l = lkpm_combined_index(n, 1)
|
||||||
k = lkpm_combined_index(n, 2)
|
k = lkpm_combined_index(n, 2)
|
||||||
p = lkpm_combined_index(n, 3)
|
p = lkpm_combined_index(n, 3)
|
||||||
m = lkpm_combined_index(n, 4)
|
m = lkpm_combined_index(n, 4)
|
||||||
|
|
||||||
do a = 1, nucl_num
|
do a = 1, nucl_num
|
||||||
cn = c_vector_full(a, n)
|
cn = c_vector_full(a, n)
|
||||||
do j = 1, elec_num
|
do j = 1, elec_num
|
||||||
accu = 0.0d0
|
accu = 0.0d0
|
||||||
accu2 = 0.0d0
|
accu2 = 0.0d0
|
||||||
daccu = 0.0d0
|
daccu = 0.0d0
|
||||||
daccu2 = 0.0d0
|
daccu2 = 0.0d0
|
||||||
do i = 1, elec_num
|
do i = 1, elec_num
|
||||||
accu = accu + een_rescaled_e(k, i, j, nw) * een_rescaled_n(m, a, i, nw)
|
accu = accu + een_rescaled_e(i, j, k, nw) * een_rescaled_n(i, a, m, nw)
|
||||||
accu2 = accu2 + een_rescaled_e(k, i, j, nw) * een_rescaled_n(m + l, a, i, nw)
|
accu2 = accu2 + een_rescaled_e(i, j, k, nw) * een_rescaled_n(i, a, m + l, nw)
|
||||||
daccu(1:4) = daccu(1:4) + een_rescaled_e_gl(k, j, 1:4, i, nw) * &
|
daccu(1:4) = daccu(1:4) + een_rescaled_e_gl(j, 1:4, i, k, nw) * &
|
||||||
een_rescaled_n(m, a, i, nw)
|
een_rescaled_n(i, a, m, nw)
|
||||||
daccu2(1:4) = daccu2(1:4) + een_rescaled_e_gl(k, j, 1:4, i, nw) * &
|
daccu2(1:4) = daccu2(1:4) + een_rescaled_e_gl(j, 1:4, i, k, nw) * &
|
||||||
een_rescaled_n(m + l, a, i, nw)
|
een_rescaled_n(i, a, m + l, nw)
|
||||||
|
end do
|
||||||
|
factor_een_gl(j, 1:4, nw) = factor_een_gl(j, 1:4, nw) + &
|
||||||
|
(accu * een_rescaled_n_gl(j, 1:4, a, m + l, nw) &
|
||||||
|
+ daccu(1:4) * een_rescaled_n(j, a, m + l, nw) &
|
||||||
|
+ daccu2(1:4) * een_rescaled_n(j, a, m, nw) &
|
||||||
|
+ accu2 * een_rescaled_n_gl(j, 1:4, a, m, nw)) * cn
|
||||||
|
|
||||||
|
factor_een_gl(j, 4, nw) = factor_een_gl(j, 4, nw) + 2.0d0 * ( &
|
||||||
|
daccu (1) * een_rescaled_n_gl(j, 1, a, m + l, nw) + &
|
||||||
|
daccu (2) * een_rescaled_n_gl(j, 2, a, m + l, nw) + &
|
||||||
|
daccu (3) * een_rescaled_n_gl(j, 3, a, m + l, nw) + &
|
||||||
|
daccu2(1) * een_rescaled_n_gl(j, 1, a, m, nw ) + &
|
||||||
|
daccu2(2) * een_rescaled_n_gl(j, 2, a, m, nw ) + &
|
||||||
|
daccu2(3) * een_rescaled_n_gl(j, 3, a, m, nw ) ) * cn
|
||||||
|
|
||||||
|
end do
|
||||||
end do
|
end do
|
||||||
factor_een_gl(j, 1:4, nw) = factor_een_gl(j, 1:4, nw) + &
|
end do
|
||||||
(accu * een_rescaled_n_gl(m + l, a, 1:4, j, nw) &
|
|
||||||
+ daccu(1:4) * een_rescaled_n(m + l, a, j, nw) &
|
|
||||||
+ daccu2(1:4) * een_rescaled_n(m, a, j, nw) &
|
|
||||||
+ accu2 * een_rescaled_n_gl(m, a, 1:4, j, nw)) * cn
|
|
||||||
|
|
||||||
factor_een_gl(j, 4, nw) = factor_een_gl(j, 4, nw) + 2.0d0 * ( &
|
|
||||||
daccu (1) * een_rescaled_n_gl(m + l, a, 1, j, nw) + &
|
|
||||||
daccu (2) * een_rescaled_n_gl(m + l, a, 2, j, nw) + &
|
|
||||||
daccu (3) * een_rescaled_n_gl(m + l, a, 3, j, nw) + &
|
|
||||||
daccu2(1) * een_rescaled_n_gl(m, a, 1, j, nw ) + &
|
|
||||||
daccu2(2) * een_rescaled_n_gl(m, a, 2, j, nw ) + &
|
|
||||||
daccu2(3) * een_rescaled_n_gl(m, a, 3, j, nw ) ) * cn
|
|
||||||
|
|
||||||
end do
|
|
||||||
end do
|
|
||||||
end do
|
|
||||||
end do
|
end do
|
||||||
|
|
||||||
end function qmckl_compute_jastrow_champ_factor_een_gl_naive_f
|
end function qmckl_compute_jastrow_champ_factor_een_gl_naive_f
|
||||||
@ -9397,21 +9410,21 @@ end function qmckl_compute_jastrow_champ_factor_een_gl_naive_f
|
|||||||
:END:
|
:END:
|
||||||
|
|
||||||
#+NAME: qmckl_factor_een_gl_args
|
#+NAME: qmckl_factor_een_gl_args
|
||||||
| Variable | Type | In/Out | Description |
|
| Variable | Type | In/Out | Description |
|
||||||
|--------------------------+---------------------------------------------------------------------+--------+------------------------------------------------|
|
|-----------------------+---------------------------------------------------------------------+--------+------------------------------------------------|
|
||||||
| ~context~ | ~qmckl_context~ | in | Global state |
|
| ~context~ | ~qmckl_context~ | in | Global state |
|
||||||
| ~walk_num~ | ~int64_t~ | in | Number of walkers |
|
| ~walk_num~ | ~int64_t~ | in | Number of walkers |
|
||||||
| ~elec_num~ | ~int64_t~ | in | Number of electrons |
|
| ~elec_num~ | ~int64_t~ | in | Number of electrons |
|
||||||
| ~nucl_num~ | ~int64_t~ | in | Number of nuclei |
|
| ~nucl_num~ | ~int64_t~ | in | Number of nuclei |
|
||||||
| ~cord_num~ | ~int64_t~ | in | order of polynomials |
|
| ~cord_num~ | ~int64_t~ | in | order of polynomials |
|
||||||
| ~dim_c_vector~ | ~int64_t~ | in | dimension of full coefficient vector |
|
| ~dim_c_vector~ | ~int64_t~ | in | dimension of full coefficient vector |
|
||||||
| ~c_vector_full~ | ~double[dim_c_vector][nucl_num]~ | in | full coefficient vector |
|
| ~c_vector_full~ | ~double[dim_c_vector][nucl_num]~ | in | full coefficient vector |
|
||||||
| ~lkpm_combined_index~ | ~int64_t[4][dim_c_vector]~ | in | combined indices |
|
| ~lkpm_combined_index~ | ~int64_t[4][dim_c_vector]~ | in | combined indices |
|
||||||
| ~tmp_c~ | ~double[walk_num][0:cord_num-1][0:cord_num][nucl_num][elec_num]~ | in | Temporary intermediate tensor |
|
| ~tmp_c~ | ~double[walk_num][0:cord_num-1][0:cord_num][nucl_num][elec_num]~ | in | Temporary intermediate tensor |
|
||||||
| ~dtmp_c~ | ~double[walk_num][0:cord_num-1][0:cord_num][nucl_num][4][elec_num]~ | in | vector of non-zero coefficients |
|
| ~dtmp_c~ | ~double[walk_num][0:cord_num-1][0:cord_num][nucl_num][4][elec_num]~ | in | vector of non-zero coefficients |
|
||||||
| ~een_rescaled_n~ | ~double[walk_num][0:cord_num][nucl_num][elec_num]~ | in | Electron-nucleus rescaled factor |
|
| ~een_rescaled_n~ | ~double[walk_num][0:cord_num][nucl_num][elec_num]~ | in | Electron-nucleus rescaled factor |
|
||||||
| ~een_rescaled_n_gl~ | ~double[walk_num][0:cord_num][nucl_num][4][elec_num]~ | in | Derivative of Electron-nucleus rescaled factor |
|
| ~een_rescaled_n_gl~ | ~double[walk_num][0:cord_num][nucl_num][4][elec_num]~ | in | Derivative of Electron-nucleus rescaled factor |
|
||||||
| ~factor_een_gl~ | ~double[walk_num][4][elec_num]~ | out | Derivative of Electron-nucleus jastrow |
|
| ~factor_een_gl~ | ~double[walk_num][4][elec_num]~ | out | Derivative of Electron-nucleus jastrow |
|
||||||
|
|
||||||
|
|
||||||
#+begin_src f90 :comments org :tangle (eval f) :noweb yes
|
#+begin_src f90 :comments org :tangle (eval f) :noweb yes
|
||||||
@ -9839,13 +9852,13 @@ printf("%20.15e\n", factor_een_gl[0][0][0]);
|
|||||||
assert(fabs(8.967809309100624e-02 - factor_een_gl[0][0][0]) < 1e-12);
|
assert(fabs(8.967809309100624e-02 - factor_een_gl[0][0][0]) < 1e-12);
|
||||||
|
|
||||||
printf("%20.15e\n", factor_een_gl[1][0][1]);
|
printf("%20.15e\n", factor_een_gl[1][0][1]);
|
||||||
assert(fabs(-3.401545636077585e-02 - factor_een_gl[1][0][1]) < 1e-12);
|
assert(fabs(3.543090132452453e-02 - factor_een_gl[1][0][1]) < 1e-12);
|
||||||
|
|
||||||
printf("%20.15e\n", factor_een_gl[2][0][2]);
|
printf("%20.15e\n", factor_een_gl[2][0][2]);
|
||||||
assert(fabs(-2.631321052321952e-01 - factor_een_gl[2][0][2]) < 1e-12);
|
assert(fabs(8.996044894431991e-04 - factor_een_gl[2][0][2]) < 1e-12);
|
||||||
|
|
||||||
printf("%20.15e\n", factor_een_gl[3][0][3]);
|
printf("%20.15e\n", factor_een_gl[3][0][3]);
|
||||||
assert(fabs(-1.016785559040419e+00 - factor_een_gl[3][0][3]) < 1e-12);
|
assert(fabs(-1.175028308456619e+00 - factor_een_gl[3][0][3]) < 1e-12);
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Total Jastrow
|
** Total Jastrow
|
||||||
|
Loading…
Reference in New Issue
Block a user