1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-08-11 15:28:31 +02:00

Changed order of indices in AOs

This commit is contained in:
Anthony Scemama 2021-07-08 19:20:19 +02:00
parent e39a27db08
commit e8a5103c92
2 changed files with 172 additions and 107 deletions

View File

@ -93,34 +93,37 @@ int main() {
The following arrays are stored in the context:
|--------------------+---------------+----------------------------------------------------------------------|
| ~type~ | | Gaussian (~'G'~) or Slater (~'S'~) |
| ~shell_num~ | | Number of shells |
| ~prim_num~ | | Total number of primitives |
| ~nucleus_index~ | ~[nucl_num]~ | Index of the first shell of each nucleus |
| ~shell_ang_mom~ | ~[shell_num]~ | Angular momentum of each shell |
| ~shell_prim_num~ | ~[shell_num]~ | Number of primitives in each shell |
| ~shell_prim_index~ | ~[shell_num]~ | Address of the first primitive of each shell in the ~EXPONENT~ array |
| ~shell_factor~ | ~[shell_num]~ | Normalization factor for each shell |
| ~exponent~ | ~[prim_num]~ | Array of exponents |
| ~coefficient~ | ~[prim_num]~ | Array of coefficients |
| ~prim_factor~ | ~[prim_num]~ | Normalization factors of the primtives |
|---------------------+---------------+----------------------------------------------------------------------|
| ~type~ | | Gaussian (~'G'~) or Slater (~'S'~) |
| ~shell_num~ | | Number of shells |
| ~prim_num~ | | Total number of primitives |
| ~nucleus_index~ | ~[nucl_num]~ | Index of the first shell of each nucleus |
| ~nucleus_shell_num~ | ~[nucl_num]~ | Number of shells per nucleus |
| ~shell_ang_mom~ | ~[shell_num]~ | Angular momentum of each shell |
| ~shell_prim_num~ | ~[shell_num]~ | Number of primitives in each shell |
| ~shell_prim_index~ | ~[shell_num]~ | Address of the first primitive of each shell in the ~EXPONENT~ array |
| ~shell_factor~ | ~[shell_num]~ | Normalization factor for each shell |
| ~exponent~ | ~[prim_num]~ | Array of exponents |
| ~coefficient~ | ~[prim_num]~ | Array of coefficients |
| ~prim_factor~ | ~[prim_num]~ | Normalization factors of the primtives |
Computed data:
|--------------------------+-------------------------------------+-----------------------------------------------------------------------------------------------|
| ~coefficient_normalized~ | ~[prim_num]~ | Normalized primitive coefficients |
| ~nucleus_prim_index~ | ~[nucl_num]~ | Index of the first primitive for each nucleus |
| ~primitive_vgl~ | ~[prim_num][5][walk_num][elec_num]~ | Value, gradients, Laplacian of the primitives at electron positions |
| ~primitive_vgl_date~ | ~uint64_t~ | Late modification date of Value, gradients, Laplacian of the primitives at electron positions |
| ~shell_vgl~ | ~[prim_num][5][walk_num][elec_num]~ | Value, gradients, Laplacian of the primitives at electron positions |
| ~shell_vgl_date~ | ~uint64_t~ | Late modification date of Value, gradients, Laplacian of the shells at electron positions |
|--------------------------+-------------------------------------+-----------------------------------------------------------------------------------------------|
| ~nucl_shell_index~ | ~[nucl_num]~ | Index of the first shell for each nucleus |
| ~exponent_sorted~ | ~[prim_num]~ | Array of exponents for sorted primitives |
| ~coeff_norm_sorted~ | ~[prim_num]~ | Array of normalized coefficients for sorted primitives |
| ~prim_factor_sorted~ | ~[prim_num]~ | Normalization factors of the sorted primtives |
| ~nuclear_radius~ | ~[nucl_num]~ | Distance beyond which all the AOs are zero |
|--------------------------+--------------------------------------+-----------------------------------------------------------------------------------------------|
| ~coefficient_normalized~ | ~[prim_num]~ | Normalized primitive coefficients |
| ~nucleus_prim_index~ | ~[nucl_num]~ | Index of the first primitive for each nucleus |
| ~nucleus_max_ang_mom~ | ~[nucl_num]~ | Maximum angular momentum for each nucleus |
| ~nucleus_range~ | ~[nucl_num]~ | Distance beyond which all the AOs are zero |
|--------------------------+--------------------------------------+-----------------------------------------------------------------------------------------------|
| ~primitive_vgl~ | ~[5][walk_num][elec_num][prim_num]~ | Value, gradients, Laplacian of the primitives at electron positions |
| ~primitive_vgl_date~ | ~uint64_t~ | Late modification date of Value, gradients, Laplacian of the primitives at electron positions |
| ~shell_vgl~ | ~[5][walk_num][elec_num][shell_num]~ | Value, gradients, Laplacian of the primitives at electron positions |
| ~shell_vgl_date~ | ~uint64_t~ | Late modification date of Value, gradients, Laplacian of the shells at electron positions |
|--------------------------+--------------------------------------+-----------------------------------------------------------------------------------------------|
| ~nucl_shell_index~ | ~[nucl_num]~ | Index of the first shell for each nucleus |
| ~exponent_sorted~ | ~[prim_num]~ | Array of exponents for sorted primitives |
| ~coeff_norm_sorted~ | ~[prim_num]~ | Array of normalized coefficients for sorted primitives |
| ~prim_factor_sorted~ | ~[prim_num]~ | Normalization factors of the sorted primtives |
For H_2 with the following basis set,
@ -188,7 +191,9 @@ typedef struct qmckl_ao_basis_struct {
double * prim_factor ;
int64_t * nucleus_prim_index;
double * coefficient_normalized ;
double * coefficient_normalized;
int32_t * nucleus_max_ang_mom;
double * nucleus_range;
double * primitive_vgl;
int64_t primitive_vgl_date;
double * shell_vgl;
@ -1047,12 +1052,6 @@ qmckl_exit_code qmckl_finalize_basis(qmckl_context context) {
NULL);
}
/*
for (int64_t i=0 ; i < ctx->ao_basis.prim_num ; ++i) {
ctx->ao_basis.coefficient_normalized[i] =
ctx->ao_basis.coefficient[i] * ctx->ao_basis.prim_factor[i];
}
*/
for (int64_t ishell=0 ; ishell < ctx->ao_basis.shell_num ; ++ishell) {
for (int64_t iprim=ctx->ao_basis.shell_prim_index[ishell] ;
iprim < ctx->ao_basis.shell_prim_index[ishell]+ctx->ao_basis.shell_prim_num[ishell] ;
@ -1064,7 +1063,67 @@ qmckl_exit_code qmckl_finalize_basis(qmckl_context context) {
}
}
/* TODO : sort the basis set here */
/* Find max angular momentum on each nucleus */
{
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
mem_info.size = ctx->nucleus.num * sizeof(int32_t);
ctx->ao_basis.nucleus_max_ang_mom = (int32_t *) qmckl_malloc(context, mem_info);
if (ctx->ao_basis.nucleus_max_ang_mom == NULL) {
return qmckl_failwith( context,
QMCKL_ALLOCATION_FAILED,
"ao_basis.nucleus_max_ang_mom",
NULL);
}
for (int64_t inucl=0 ; inucl < ctx->nucleus.num ; ++inucl) {
ctx->ao_basis.nucleus_max_ang_mom[inucl] = 0;
for (int64_t ishell=ctx->ao_basis.nucleus_index[inucl] ;
ishell < ctx->ao_basis.nucleus_index[inucl] + ctx->ao_basis.nucleus_shell_num[inucl] ;
++ishell) {
ctx->ao_basis.nucleus_max_ang_mom[inucl] =
ctx->ao_basis.nucleus_max_ang_mom[inucl] > ctx->ao_basis.shell_ang_mom[ishell] ?
ctx->ao_basis.nucleus_max_ang_mom[inucl] : ctx->ao_basis.shell_ang_mom[ishell] ;
}
}
}
/* Find distance beyond which all AOs are zero.
The distance is obtained by sqrt(log(cutoff)*range) */
{
if (ctx->ao_basis.type == 'G') {
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
mem_info.size = ctx->nucleus.num * sizeof(double);
ctx->ao_basis.nucleus_range = (double *) qmckl_malloc(context, mem_info);
if (ctx->ao_basis.nucleus_range == NULL) {
return qmckl_failwith( context,
QMCKL_ALLOCATION_FAILED,
"ao_basis.nucleus_range",
NULL);
}
for (int64_t inucl=0 ; inucl < ctx->nucleus.num ; ++inucl) {
ctx->ao_basis.nucleus_range[inucl] = 0.;
for (int64_t ishell=ctx->ao_basis.nucleus_index[inucl] ;
ishell < ctx->ao_basis.nucleus_index[inucl] + ctx->ao_basis.nucleus_shell_num[inucl] ;
++ishell) {
for (int64_t iprim=ctx->ao_basis.shell_prim_index[ishell] ;
iprim < ctx->ao_basis.shell_prim_index[ishell] + ctx->ao_basis.shell_prim_num[ishell] ;
++iprim) {
double range = 1./ctx->ao_basis.exponent[iprim];
ctx->ao_basis.nucleus_range[inucl] =
ctx->ao_basis.nucleus_range[inucl] > range ?
ctx->ao_basis.nucleus_range[inucl] : range;
}
}
}
}
}
/* TODO : sort the basis set here */
return QMCKL_SUCCESS;
}
#+end_src
@ -1281,6 +1340,8 @@ assert(qmckl_ao_basis_provided(context));
#+end_src
* Radial part
** TODO Helper functions to accelerate calculations
** General functions for Gaussian basis functions
~qmckl_ao_gaussian_vgl~ computes the values, gradients and
@ -1494,7 +1555,7 @@ end function test_qmckl_ao_gaussian_vgl
** TODO General functions for Slater basis functions
** TODO General functions for Radial functions on a grid
** DONE Computation of primitives
** Computation of primitives
*** Get
@ -1614,7 +1675,7 @@ qmckl_exit_code qmckl_provide_ao_basis_primitive_vgl(qmckl_context context)
| double | elec_coord[walk_num][3][elec_num] | in | Electron coordinates |
| double | nucl_coord[3][elec_num] | in | Nuclear coordinates |
| double | expo[prim_num] | in | Exponents of the primitives |
| double | primitive_vgl[prim_num][5][walk_num][elec_num] | out | Value, gradients and Laplacian of the primitives |
| double | primitive_vgl[5][walk_num][elec_num][prim_num] | out | Value, gradients and Laplacian of the primitives |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_ao_basis_primitive_gaussian_vgl_f(context, &
@ -1632,7 +1693,7 @@ integer function qmckl_compute_ao_basis_primitive_gaussian_vgl_f(context, &
double precision , intent(in) :: elec_coord(elec_num,3,walk_num)
double precision , intent(in) :: nucl_coord(nucl_num,3)
double precision , intent(in) :: expo(prim_num)
double precision , intent(out) :: primitive_vgl(elec_num,walk_num,5,prim_num)
double precision , intent(out) :: primitive_vgl(prim_num,elec_num,walk_num,5)
integer*8 :: inucl, iprim, iwalk, ielec
double precision :: x, y, z, two_a, ar2, r2, v, cutoff
@ -1658,11 +1719,11 @@ integer function qmckl_compute_ao_basis_primitive_gaussian_vgl_f(context, &
v = dexp(-ar2)
two_a = -2.d0 * expo(iprim) * v
primitive_vgl(ielec, iwalk, 1, iprim) = v
primitive_vgl(ielec, iwalk, 2, iprim) = two_a * x
primitive_vgl(ielec, iwalk, 3, iprim) = two_a * y
primitive_vgl(ielec, iwalk, 4, iprim) = two_a * z
primitive_vgl(ielec, iwalk, 5, iprim) = two_a * (3.d0 - 2.d0*ar2)
primitive_vgl(iprim, ielec, iwalk, 1) = v
primitive_vgl(iprim, ielec, iwalk, 2) = two_a * x
primitive_vgl(iprim, ielec, iwalk, 3) = two_a * y
primitive_vgl(iprim, ielec, iwalk, 4) = two_a * z
primitive_vgl(iprim, ielec, iwalk, 5) = two_a * (3.d0 - 2.d0*ar2)
end do
end do
@ -1799,22 +1860,22 @@ assert(rc == QMCKL_SUCCESS);
double prim_vgl[prim_num][5][walk_num][elec_num];
double prim_vgl[5][walk_num][elec_num][prim_num];
rc = qmckl_get_ao_basis_primitive_vgl(context, &(prim_vgl[0][0][0][0]));
assert (rc == QMCKL_SUCCESS);
assert( fabs(prim_vgl[7][0][0][26] - ( 1.0501570432064878E-003)) < 1.e-14 );
assert( fabs(prim_vgl[7][1][0][26] - (-7.5014974095310560E-004)) < 1.e-14 );
assert( fabs(prim_vgl[7][2][0][26] - (-3.8250692897610380E-003)) < 1.e-14 );
assert( fabs(prim_vgl[7][3][0][26] - ( 3.4950559194080275E-003)) < 1.e-14 );
assert( fabs(prim_vgl[7][4][0][26] - ( 2.0392163767356572E-002)) < 1.e-14 );
assert( fabs(prim_vgl[0][0][26][7] - ( 1.0501570432064878E-003)) < 1.e-14 );
assert( fabs(prim_vgl[1][0][26][7] - (-7.5014974095310560E-004)) < 1.e-14 );
assert( fabs(prim_vgl[2][0][26][7] - (-3.8250692897610380E-003)) < 1.e-14 );
assert( fabs(prim_vgl[3][0][26][7] - ( 3.4950559194080275E-003)) < 1.e-14 );
assert( fabs(prim_vgl[4][0][26][7] - ( 2.0392163767356572E-002)) < 1.e-14 );
assert( fabs(prim_vgl[39][0][1][15] - ( 1.0825844173157661E-003)) < 1.e-14 );
assert( fabs(prim_vgl[39][1][1][15] - ( 2.3774237611651531E-003)) < 1.e-14 );
assert( fabs(prim_vgl[39][2][1][15] - ( 2.1423191526963063E-003)) < 1.e-14 );
assert( fabs(prim_vgl[39][3][1][15] - ( 4.3312003523048492E-004)) < 1.e-14 );
assert( fabs(prim_vgl[39][4][1][15] - ( 7.5174404780004771E-003)) < 1.e-14 );
assert( fabs(prim_vgl[0][1][15][39] - ( 1.0825844173157661E-003)) < 1.e-14 );
assert( fabs(prim_vgl[1][1][15][39] - ( 2.3774237611651531E-003)) < 1.e-14 );
assert( fabs(prim_vgl[2][1][15][39] - ( 2.1423191526963063E-003)) < 1.e-14 );
assert( fabs(prim_vgl[3][1][15][39] - ( 4.3312003523048492E-004)) < 1.e-14 );
assert( fabs(prim_vgl[4][1][15][39] - ( 7.5174404780004771E-003)) < 1.e-14 );
}
@ -2005,7 +2066,7 @@ qmckl_exit_code qmckl_provide_ao_basis_shell_vgl(qmckl_context context)
| ~double~ | ~nucl_coord[3][elec_num]~ | in | Nuclear coordinates |
| ~double~ | ~expo[prim_num]~ | in | Exponents of the primitives |
| ~double~ | ~coef_normalized[prim_num]~ | in | Coefficients of the primitives |
| ~double~ | ~shell_vgl[shell_num][5][walk_num][elec_num]~ | out | Value, gradients and Laplacian of the shells |
| ~double~ | ~shell_vgl[5][walk_num][elec_num][shell_num]~ | out | Value, gradients and Laplacian of the shells |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_ao_basis_shell_gaussian_vgl_f(context, &
@ -2029,7 +2090,7 @@ integer function qmckl_compute_ao_basis_shell_gaussian_vgl_f(context, &
double precision , intent(in) :: nucl_coord(nucl_num,3)
double precision , intent(in) :: expo(prim_num)
double precision , intent(in) :: coef_normalized(prim_num)
double precision , intent(out) :: shell_vgl(elec_num,walk_num,5,shell_num)
double precision , intent(out) :: shell_vgl(shell_num,elec_num,walk_num,5)
integer*8 :: inucl, iprim, iwalk, ielec, ishell
double precision :: x, y, z, two_a, ar2, r2, v, cutoff
@ -2041,19 +2102,24 @@ integer function qmckl_compute_ao_basis_shell_gaussian_vgl_f(context, &
cutoff = -dlog(1.d-15)
do inucl=1,nucl_num
do ishell=nucleus_index(inucl)+1, nucleus_index(inucl)+nucleus_shell_num(inucl)
! C is zero-based, so shift bounds by one
do iwalk = 1, walk_num
do ielec = 1, elec_num
do iwalk = 1, walk_num
do ielec = 1, elec_num
shell_vgl(ielec, iwalk, 1:5, ishell) = 0.d0
x = elec_coord(ielec,1,iwalk) - nucl_coord(inucl,1)
y = elec_coord(ielec,2,iwalk) - nucl_coord(inucl,2)
z = elec_coord(ielec,3,iwalk) - nucl_coord(inucl,3)
x = elec_coord(ielec,1,iwalk) - nucl_coord(inucl,1)
y = elec_coord(ielec,2,iwalk) - nucl_coord(inucl,2)
z = elec_coord(ielec,3,iwalk) - nucl_coord(inucl,3)
r2 = x*x + y*y + z*z
r2 = x*x + y*y + z*z
do ishell=nucleus_index(inucl)+1, nucleus_index(inucl)+nucleus_shell_num(inucl)
! C is zero-based, so shift bounds by one
shell_vgl(ishell, ielec, iwalk, 1) = 0.d0
shell_vgl(ishell, ielec, iwalk, 2) = 0.d0
shell_vgl(ishell, ielec, iwalk, 3) = 0.d0
shell_vgl(ishell, ielec, iwalk, 4) = 0.d0
shell_vgl(ishell, ielec, iwalk, 5) = 0.d0
do iprim = shell_prim_index(ishell)+1, shell_prim_index(ishell)+shell_prim_num(ishell)
@ -2064,24 +2130,24 @@ integer function qmckl_compute_ao_basis_shell_gaussian_vgl_f(context, &
v = coef_normalized(iprim) * dexp(-ar2)
two_a = -2.d0 * expo(iprim) * v
shell_vgl(ielec, iwalk, 1, ishell) = &
shell_vgl(ielec, iwalk, 1, ishell) + v
shell_vgl(ielec, iwalk, 2, ishell) = &
shell_vgl(ielec, iwalk, 2, ishell) + two_a * x
shell_vgl(ielec, iwalk, 3, ishell) = &
shell_vgl(ielec, iwalk, 3, ishell) + two_a * y
shell_vgl(ielec, iwalk, 4, ishell) = &
shell_vgl(ielec, iwalk, 4, ishell) + two_a * z
shell_vgl(ielec, iwalk, 5, ishell) = &
shell_vgl(ielec, iwalk, 5, ishell) + two_a * (3.d0 - 2.d0*ar2)
shell_vgl(ishell, ielec, iwalk, 1) = &
shell_vgl(ishell, ielec, iwalk, 1) + v
shell_vgl(ishell, ielec, iwalk, 2) = &
shell_vgl(ishell, ielec, iwalk, 2) + two_a * x
shell_vgl(ishell, ielec, iwalk, 3) = &
shell_vgl(ishell, ielec, iwalk, 3) + two_a * y
shell_vgl(ishell, ielec, iwalk, 4) = &
shell_vgl(ishell, ielec, iwalk, 4) + two_a * z
shell_vgl(ishell, ielec, iwalk, 5) = &
shell_vgl(ishell, ielec, iwalk, 5) + two_a * (3.d0 - 2.d0*ar2)
end do
end do
end do
@ -2150,7 +2216,7 @@ qmckl_exit_code qmckl_compute_ao_basis_shell_gaussian_vgl(
real (c_double ) , intent(in) :: nucl_coord(elec_num,3)
real (c_double ) , intent(in) :: expo(prim_num)
real (c_double ) , intent(in) :: coef_normalized(prim_num)
real (c_double ) , intent(out) :: shell_vgl(elec_num,walk_num,5,shell_num)
real (c_double ) , intent(out) :: shell_vgl(shell_num,elec_num,walk_num,5)
integer(c_int32_t), external :: qmckl_compute_ao_basis_shell_gaussian_vgl_f
info = qmckl_compute_ao_basis_shell_gaussian_vgl_f &
@ -2273,34 +2339,34 @@ rc = qmckl_set_electron_coord (context, 'N', elec_coord);
assert(rc == QMCKL_SUCCESS);
double shell_vgl[shell_num][5][walk_num][elec_num];
double shell_vgl[5][walk_num][elec_num][shell_num];
rc = qmckl_get_ao_basis_shell_vgl(context, &(shell_vgl[0][0][0][0]));
assert (rc == QMCKL_SUCCESS);
printf(" shell_vgl[1][0][0][26] %25.15e\n", shell_vgl[1][0][0][26]);
printf(" shell_vgl[1][1][0][26] %25.15e\n", shell_vgl[1][1][0][26]);
printf(" shell_vgl[1][2][0][26] %25.15e\n", shell_vgl[1][2][0][26]);
printf(" shell_vgl[1][3][0][26] %25.15e\n", shell_vgl[1][3][0][26]);
printf(" shell_vgl[1][4][0][26] %25.15e\n", shell_vgl[1][4][0][26]);
printf(" shell_vgl[1][0][0][26] %25.15e\n", shell_vgl[0][0][26][1]);
printf(" shell_vgl[1][1][0][26] %25.15e\n", shell_vgl[1][0][26][1]);
printf(" shell_vgl[1][2][0][26] %25.15e\n", shell_vgl[2][0][26][1]);
printf(" shell_vgl[1][3][0][26] %25.15e\n", shell_vgl[3][0][26][1]);
printf(" shell_vgl[1][4][0][26] %25.15e\n", shell_vgl[4][0][26][1]);
printf(" shell_vgl[14][0][1][15] %25.15e\n", shell_vgl[14][0][1][15]);
printf(" shell_vgl[14][1][1][15] %25.15e\n", shell_vgl[14][1][1][15]);
printf(" shell_vgl[14][2][1][15] %25.15e\n", shell_vgl[14][2][1][15]);
printf(" shell_vgl[14][3][1][15] %25.15e\n", shell_vgl[14][3][1][15]);
printf(" shell_vgl[14][4][1][15] %25.15e\n", shell_vgl[14][4][1][15]);
printf(" shell_vgl[14][0][1][15] %25.15e\n", shell_vgl[0][1][15][14]);
printf(" shell_vgl[14][1][1][15] %25.15e\n", shell_vgl[1][1][15][14]);
printf(" shell_vgl[14][2][1][15] %25.15e\n", shell_vgl[2][1][15][14]);
printf(" shell_vgl[14][3][1][15] %25.15e\n", shell_vgl[3][1][15][14]);
printf(" shell_vgl[14][4][1][15] %25.15e\n", shell_vgl[4][1][15][14]);
assert( fabs(shell_vgl[1][0][0][26] - ( 3.564393437193868e-02)) < 1.e-14 );
assert( fabs(shell_vgl[1][1][0][26] - (-6.030177987072189e-03)) < 1.e-14 );
assert( fabs(shell_vgl[1][2][0][26] - (-3.074832579537582e-02)) < 1.e-14 );
assert( fabs(shell_vgl[1][3][0][26] - ( 2.809546963519935e-02)) < 1.e-14 );
assert( fabs(shell_vgl[1][4][0][26] - ( 1.896046117183968e-02)) < 1.e-14 );
assert( fabs(shell_vgl[0][0][26][1] - ( 3.564393437193868e-02)) < 1.e-14 );
assert( fabs(shell_vgl[1][0][26][1] - (-6.030177987072189e-03)) < 1.e-14 );
assert( fabs(shell_vgl[2][0][26][1] - (-3.074832579537582e-02)) < 1.e-14 );
assert( fabs(shell_vgl[3][0][26][1] - ( 2.809546963519935e-02)) < 1.e-14 );
assert( fabs(shell_vgl[4][0][26][1] - ( 1.896046117183968e-02)) < 1.e-14 );
assert( fabs(shell_vgl[14][0][1][15] - ( 5.928089771361000e-03)) < 1.e-14 );
assert( fabs(shell_vgl[14][1][1][15] - ( 4.355862296021654e-03)) < 1.e-14 );
assert( fabs(shell_vgl[14][2][1][15] - ( 3.925108924923650e-03)) < 1.e-14 );
assert( fabs(shell_vgl[14][3][1][15] - ( 7.935527784022099e-04)) < 1.e-14 );
assert( fabs(shell_vgl[14][4][1][15] - ( 2.708246573703548e-03)) < 1.e-14 );
assert( fabs(shell_vgl[0][1][15][14] - ( 5.928089771361000e-03)) < 1.e-14 );
assert( fabs(shell_vgl[1][1][15][14] - ( 4.355862296021654e-03)) < 1.e-14 );
assert( fabs(shell_vgl[2][1][15][14] - ( 3.925108924923650e-03)) < 1.e-14 );
assert( fabs(shell_vgl[3][1][15][14] - ( 7.935527784022099e-04)) < 1.e-14 );
assert( fabs(shell_vgl[4][1][15][14] - ( 2.708246573703548e-03)) < 1.e-14 );
}
#+end_src

View File

@ -960,7 +960,7 @@ qmckl_exit_code qmckl_finalize_jastrow(qmckl_context context) {
/* Check for the electron data
1. elec_num
2. ee_distances_rescaled
*/
,*/
if (!(ctx->electron.provided)) {
return qmckl_failwith( context,
QMCKL_NOT_PROVIDED,
@ -971,7 +971,7 @@ qmckl_exit_code qmckl_finalize_jastrow(qmckl_context context) {
/* Check for the nucleus data
1. nucl_num
2. en_distances_rescaled
*/
,*/
if (!(ctx->nucleus.provided)) {
return qmckl_failwith( context,
QMCKL_NOT_PROVIDED,
@ -980,7 +980,7 @@ qmckl_exit_code qmckl_finalize_jastrow(qmckl_context context) {
}
qmckl_exit_code rc = QMCKL_FAILURE;
return rc;
/* ----------------------------------- */
/* Start calculation of data */
@ -1004,7 +1004,6 @@ double* elec_coord = &(n2_elec_coord[0][0][0]);
const double* nucl_charge = n2_charge;
int64_t nucl_num = n2_nucl_num;
double* charge = n2_charge;
double* nucl_coord = &(n2_nucl_coord[0][0]);
/* Provide Electron data */
@ -2267,7 +2266,7 @@ qmckl_exit_code qmckl_provide_factor_en(qmckl_context context)
| int64_t | elec_num | in | Number of electrons |
| int64_t | nucl_num | in | Number of nucleii |
| int64_t | type_nucl_num | in | Number of unique nuclei |
| int64_t | type_nucl_vector[nucl_num] | in | IDs of unique nucleii |
| int64_t | type_nucl_vector[nucl_num] | in | IDs of unique nucleii |
| int64_t | aord_num | in | Number of coefficients |
| double | aord_vector[aord_num + 1][type_nucl_num] | in | List of coefficients |
| double | en_distance_rescaled[walk_num][nucl_num][elec_num] | in | Electron-nucleus distances |
@ -3270,7 +3269,7 @@ qmckl_exit_code qmckl_provide_een_rescaled_e_deriv_e(qmckl_context context)
| int64_t | elec_num | in | Number of electrons |
| int64_t | cord_num | in | Order of polynomials |
| double | rescale_factor_kappa_ee | in | Factor to rescale ee distances |
| double | coord_new[walk_num][3][elec_num] | in | Electron coordinates |
| double | coord_new[walk_num][3][elec_num] | in | Electron coordinates |
| double | ee_distance[walk_num][elec_num][elec_num] | in | Electron-electron distances |
| double | een_rescaled_e[walk_num][elec_num][elec_num][0:cord_num] | in | Electron-electron distances |
| double | een_rescaled_e_deriv_e[walk_num][elec_num][4][elec_num][0:cord_num] | out | Electron-electron rescaled distances |