mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-04-30 04:15:00 +02:00
Merge with origin
This commit is contained in:
parent
4eb06e1a2e
commit
063de427be
@ -339,7 +339,7 @@ qmckl_exit_code qmckl_finite_difference_deriv_n(
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
double* nucleus_coord = (double*) malloc(3 * nucl_num * sizeof(double));
|
||||
if (nucleus_coord == NULL) {
|
||||
return QMCKL_ALLOCATION_FAILED;
|
||||
@ -352,7 +352,7 @@ qmckl_exit_code qmckl_finite_difference_deriv_n(
|
||||
free(nucleus_coord);
|
||||
return QMCKL_ALLOCATION_FAILED;
|
||||
}
|
||||
|
||||
|
||||
double* function_values = (double*) malloc(walk_num*size * sizeof(double));
|
||||
if (function_values == NULL) {
|
||||
free(nucleus_coord);
|
||||
@ -370,17 +370,17 @@ qmckl_exit_code qmckl_finite_difference_deriv_n(
|
||||
for (int64_t a = 0; a < nucl_num; a++) {
|
||||
for (int64_t k = 0; k < 3; k++) {
|
||||
for (int64_t m = -4; m <= 4; m++) {
|
||||
|
||||
|
||||
// Apply finite difference displacement
|
||||
temp_coord[k+a*3] = nucleus_coord[k+3*a] + (double) m * delta_x;
|
||||
|
||||
// Update coordinates in the context
|
||||
rc = qmckl_set_nucleus_coord(context, 'N', temp_coord, 3*nucl_num);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
rc = qmckl_context_touch(context);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
// Call the provided function
|
||||
rc = get_function(context, function_values, size);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
@ -400,10 +400,10 @@ qmckl_exit_code qmckl_finite_difference_deriv_n(
|
||||
// Reset coordinates in the context
|
||||
rc = qmckl_set_nucleus_coord(context, 'N', temp_coord, 3*nucl_num);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
rc = qmckl_context_touch(context);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
// Normalize by the step size
|
||||
for (int64_t i = 0; i < size*3*nucl_num*walk_num ; i++) {
|
||||
derivative_output[i] /= delta_x;
|
||||
@ -414,7 +414,7 @@ qmckl_exit_code qmckl_finite_difference_deriv_n(
|
||||
free(function_values);
|
||||
return QMCKL_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
#+end_src
|
||||
|
||||
* Force of en jastrow value
|
||||
@ -1039,7 +1039,7 @@ function qmckl_compute_forces_jastrow_en_g_doc( &
|
||||
invdenom = 1.0d0 / denom
|
||||
invdenom2 = invdenom*invdenom
|
||||
f = a_vector(1, type_nucl_vector(a)+1) * invdenom2
|
||||
|
||||
|
||||
do m = 1, 3
|
||||
dx(m) = en_distance_rescaled_gl(m,i,a,nw)
|
||||
end do
|
||||
@ -1455,7 +1455,7 @@ function qmckl_compute_forces_jastrow_en_l_doc( &
|
||||
invdenom = 1.0d0 / denom
|
||||
invdenom2 = invdenom*invdenom
|
||||
f = a_vector(1, type_nucl_vector(a)+1) * invdenom2
|
||||
|
||||
|
||||
do m = 1, 4
|
||||
dx(m) = en_distance_rescaled_gl(m,i,a,nw)
|
||||
end do
|
||||
@ -1611,7 +1611,7 @@ for (int nw = 0; nw < walk_num; nw++){
|
||||
for (int k = 0; k < 3; k++){
|
||||
//printf("finite_difference_force_en_l_sum[%i][%i][%i] %+3.10f \n", nw,a,k,finite_difference_force_en_l_sum[nw][a][k]);
|
||||
//printf("forces_jastrow_en_l [%i][%i][%i] %+3.10f\n", nw,a,k,forces_jastrow_en_l[nw][a][k]);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1721,7 +1721,7 @@ qmckl_exit_code qmckl_provide_forces_tmp_c(qmckl_context context)
|
||||
if (ctx->forces.forces_tmp_c == NULL) {
|
||||
|
||||
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
|
||||
mem_info.size = 4 * ctx->electron.num * ctx->jastrow_champ.cord_num *
|
||||
mem_info.size = 4 * ctx->electron.num * ctx->jastrow_champ.cord_num *
|
||||
(ctx->jastrow_champ.cord_num+1) * ctx->nucleus.num * ctx->electron.walker.num * sizeof(double);
|
||||
double* forces_tmp_c = (double*) qmckl_malloc(context, mem_info);
|
||||
|
||||
@ -1734,7 +1734,7 @@ qmckl_exit_code qmckl_provide_forces_tmp_c(qmckl_context context)
|
||||
ctx->forces.forces_tmp_c = forces_tmp_c;
|
||||
}
|
||||
|
||||
|
||||
|
||||
rc = qmckl_compute_forces_tmp_c(context,
|
||||
ctx->electron.walker.num,
|
||||
ctx->electron.num,
|
||||
@ -1872,19 +1872,21 @@ for (int i = 0; i < 3 * nucl_num; i++) {
|
||||
for (int64_t a = 0; a < nucl_num; a++) {
|
||||
for (int64_t k = 0; k < 3; k++) {
|
||||
for (int64_t m = -4; m <= 4; m++) {
|
||||
|
||||
|
||||
// Apply finite difference displacement
|
||||
temp_coord[k+a*3] = nucleus_coord[k+3*a] + (double) m * delta_x;
|
||||
|
||||
// Update coordinates in the context
|
||||
rc = qmckl_set_nucleus_coord(context, 'N', temp_coord, 3*nucl_num);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
rc = qmckl_context_touch(context);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
// Call the provided function
|
||||
rc = qmckl_get_jastrow_champ_tmp_c(context,&output[0][0][0][0][0]);
|
||||
rc = qmckl_get_jastrow_champ_tmp_c(context,
|
||||
&output[0][0][0][0][0],
|
||||
4*nucl_num*walk_num*elec_num*(cord_num+1)*cord_num);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
// Accumulate derivative using finite-difference coefficients
|
||||
@ -1912,7 +1914,7 @@ assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
rc = qmckl_context_touch(context);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
free(nucleus_coord);
|
||||
free(temp_coord);
|
||||
|
||||
@ -1926,7 +1928,7 @@ for (int nw = 0; nw < walk_num; nw++){
|
||||
//printf("nw=%i l=%i m=%i a=%i k=%i i=%i\n",nw,l,m,a,k,i);
|
||||
//printf("%.10f\t", finite_difference_force_tmp_c[nw][l][m][a][k][i]);
|
||||
//printf("%.10f\n", forces_tmp_c[nw][l][m][a][k][i]);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2047,7 +2049,7 @@ qmckl_exit_code qmckl_provide_forces_dtmp_c(qmckl_context context)
|
||||
if (ctx->forces.forces_dtmp_c == NULL) {
|
||||
|
||||
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
|
||||
mem_info.size = 4* 4 * ctx->electron.num * ctx->jastrow_champ.cord_num *
|
||||
mem_info.size = 4* 4 * ctx->electron.num * ctx->jastrow_champ.cord_num *
|
||||
(ctx->jastrow_champ.cord_num+1) * ctx->nucleus.num * ctx->electron.walker.num * sizeof(double);
|
||||
double* forces_dtmp_c = (double*) qmckl_malloc(context, mem_info);
|
||||
|
||||
@ -2060,7 +2062,7 @@ qmckl_exit_code qmckl_provide_forces_dtmp_c(qmckl_context context)
|
||||
ctx->forces.forces_dtmp_c = forces_dtmp_c;
|
||||
}
|
||||
|
||||
|
||||
|
||||
rc = qmckl_compute_forces_dtmp_c(context,
|
||||
ctx->electron.walker.num,
|
||||
ctx->electron.num,
|
||||
@ -2139,7 +2141,7 @@ integer(qmckl_exit_code) function qmckl_compute_forces_dtmp_c( &
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
|
||||
|
||||
if (.true.) then
|
||||
do nw = 1, walk_num
|
||||
do l = 0, cord_num-1
|
||||
@ -2220,19 +2222,21 @@ for (int i = 0; i < 3 * nucl_num; i++) {
|
||||
for (int64_t a = 0; a < nucl_num; a++) {
|
||||
for (int64_t k = 0; k < 3; k++) {
|
||||
for (int64_t m = -4; m <= 4; m++) {
|
||||
|
||||
|
||||
// Apply finite difference displacement
|
||||
temp_coord[k+a*3] = nucleus_coord[k+3*a] + (double) m * delta_x;
|
||||
|
||||
// Update coordinates in the context
|
||||
rc = qmckl_set_nucleus_coord(context, 'N', temp_coord, 3*nucl_num);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
rc = qmckl_context_touch(context);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
// Call the provided function
|
||||
rc = qmckl_get_jastrow_champ_dtmp_c(context,&doutput[0][0][0][0][0][0]);
|
||||
rc = qmckl_get_jastrow_champ_dtmp_c(context,
|
||||
&doutput[0][0][0][0][0][0],
|
||||
4*4*nucl_num*walk_num*elec_num*(cord_num+1)*cord_num);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
// Accumulate derivative using finite-difference coefficients
|
||||
@ -2262,7 +2266,7 @@ assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
rc = qmckl_context_touch(context);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
free(nucleus_coord);
|
||||
free(temp_coord);
|
||||
|
||||
@ -2279,7 +2283,7 @@ for (int nw = 0; nw < walk_num; nw++){
|
||||
//printf("%.10f\n", forces_dtmp_c[nw][l][m][k][a][kk][i]);
|
||||
//assert(fabs(finite_difference_force_dtmp_c[nw][l][m][k][a][kk][i] - forces_dtmp_c[nw][l][m][k][a][kk][i]) < 1.e-8);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2444,7 +2448,7 @@ qmckl_exit_code qmckl_provide_forces_jastrow_een(qmckl_context context)
|
||||
ctx->forces.forces_jastrow_een = forces_jastrow_een;
|
||||
}
|
||||
|
||||
|
||||
|
||||
rc = qmckl_compute_forces_jastrow_een(context,
|
||||
ctx->electron.walker.num,
|
||||
ctx->electron.num,
|
||||
@ -2458,7 +2462,7 @@ qmckl_exit_code qmckl_provide_forces_jastrow_een(qmckl_context context)
|
||||
ctx->jastrow_champ.tmp_c,
|
||||
ctx->forces.forces_tmp_c,
|
||||
ctx->forces.forces_jastrow_een);
|
||||
|
||||
|
||||
if (rc != QMCKL_SUCCESS) {
|
||||
return rc;
|
||||
}
|
||||
@ -2537,7 +2541,7 @@ integer(qmckl_exit_code) function qmckl_compute_forces_jastrow_een( &
|
||||
if(cn == 0.d0) cycle
|
||||
do j = 1, elec_num
|
||||
do ii = 1, 3
|
||||
accu = een_rescaled_n(j,a,m,nw) * forces_tmp_c(j,ii,a,m+l,k,nw)
|
||||
accu = een_rescaled_n(j,a,m,nw) * forces_tmp_c(j,ii,a,m+l,k,nw)
|
||||
accu = accu - een_rescaled_n_gl(j,ii,a,m,nw) * tmp_c(j,a,m+l,k,nw)
|
||||
|
||||
forces_jastrow_een(ii, a, nw) = forces_jastrow_een(ii, a, nw) + accu * cn
|
||||
@ -2769,7 +2773,7 @@ integer(qmckl_exit_code) function qmckl_compute_forces_een_rescaled_n_gl( &
|
||||
real (c_double ) , intent(in) :: rescale_factor_en(type_nucl_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_gl(elec_num,4,nucl_num,0:cord_num,walk_num)
|
||||
real (c_double ) , intent(in) :: een_rescaled_n_gl(elec_num,4,nucl_num,0:cord_num,walk_num)
|
||||
real (c_double ) , intent(out) :: forces_een_n(elec_num,4,nucl_num,3,0:cord_num,walk_num)
|
||||
|
||||
double precision :: x, ria_inv, kappa_l
|
||||
@ -2905,17 +2909,17 @@ for (int i = 0; i < 3 * nucl_num; i++) {
|
||||
for (int64_t a = 0; a < nucl_num; a++) {
|
||||
for (int64_t k = 0; k < 3; k++) {
|
||||
for (int64_t m = -4; m <= 4; m++) {
|
||||
|
||||
|
||||
// Apply finite difference displacement
|
||||
temp_coord[k+a*3] = nucleus_coord[k+3*a] + (double) m * delta_x;
|
||||
|
||||
// Update coordinates in the context
|
||||
rc = qmckl_set_nucleus_coord(context, 'N', temp_coord, 3*nucl_num);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
rc = qmckl_context_touch(context);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
// Call the provided function
|
||||
rc = qmckl_get_jastrow_champ_een_rescaled_n_gl(context,&ddoutput[0][0][0][0][0], 4*elec_num*nucl_num*(cord_num+1)*walk_num);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
@ -2931,7 +2935,7 @@ for (int64_t a = 0; a < nucl_num; a++) {
|
||||
finite_difference_force_een_n[nw][l][k][a][j][i] += coef[m + 4] * ddoutput[nw][l][a][j][i]/delta_x;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2946,7 +2950,7 @@ assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
rc = qmckl_context_touch(context);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
free(nucleus_coord);
|
||||
free(temp_coord);
|
||||
|
||||
@ -2962,7 +2966,7 @@ for (int nw = 0; nw < walk_num; nw++){
|
||||
//printf("%.10f\n", forces_een_n[nw][l][k][a][kk][i]);
|
||||
//assert(fabs(finite_difference_force_een_n[nw][l][k][a][kk][i] - forces_een_n[nw][l][k][a][kk][i]) < 1.e-6);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3957,7 +3961,7 @@ printf("OK\n");
|
||||
|
||||
* Force of AO value
|
||||
|
||||
Here we compute the forces of the AO value.
|
||||
Here we compute the forces of the AO value.
|
||||
|
||||
|
||||
** Get
|
||||
@ -4005,7 +4009,7 @@ qmckl_get_forces_ao_value(qmckl_context context,
|
||||
#+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none
|
||||
qmckl_exit_code qmckl_provide_forces_ao_value(qmckl_context context);
|
||||
#+end_src
|
||||
|
||||
|
||||
#+begin_src c :comments org :tangle (eval c) :noweb yes :exports none
|
||||
qmckl_exit_code qmckl_provide_forces_ao_value(qmckl_context context)
|
||||
{
|
||||
@ -4238,17 +4242,17 @@ for (int i = 0; i < 3 * nucl_num; i++) {
|
||||
for (int64_t a = 0; a < nucl_num; a++) {
|
||||
for (int64_t k = 0; k < 3; k++) {
|
||||
for (int64_t m = -4; m <= 4; m++) {
|
||||
|
||||
|
||||
// Apply finite difference displacement
|
||||
temp_coord[k+a*3] = nucleus_coord[k+3*a] + (double) m * delta_x;
|
||||
|
||||
// Update coordinates in the context
|
||||
rc = qmckl_set_nucleus_coord(context, 'N', temp_coord, 3*nucl_num);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
rc = qmckl_context_touch(context);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
// Call the provided function
|
||||
rc = qmckl_get_ao_basis_ao_value(context,&ao_output[0][0], point_num*ao_num);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
@ -4273,7 +4277,7 @@ assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
rc = qmckl_context_touch(context);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
free(nucleus_coord);
|
||||
free(temp_coord);
|
||||
|
||||
@ -4523,7 +4527,7 @@ rc = qmckl_get_forces_mo_value(context, &forces_mo_value[0][0][0][0], 3*nucl_num
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
double finite_difference_force_mo_value[3][nucl_num][point_num][mo_num];
|
||||
printf("Mo num %i %i\n", mo_num, ao_num);
|
||||
printf("Mo num %ld %ld\n", mo_num, ao_num);
|
||||
|
||||
nucleus_coord = (double*) malloc(3 * nucl_num * sizeof(double));
|
||||
if (nucleus_coord == NULL) {
|
||||
@ -4549,17 +4553,17 @@ for (int i = 0; i < 3 * nucl_num; i++) {
|
||||
for (int64_t a = 0; a < nucl_num; a++) {
|
||||
for (int64_t k = 0; k < 3; k++) {
|
||||
for (int64_t m = -4; m <= 4; m++) {
|
||||
|
||||
|
||||
// Apply finite difference displacement
|
||||
temp_coord[k+a*3] = nucleus_coord[k+3*a] + (double) m * delta_x;
|
||||
|
||||
// Update coordinates in the context
|
||||
rc = qmckl_set_nucleus_coord(context, 'N', temp_coord, 3*nucl_num);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
rc = qmckl_context_touch(context);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
// Call the provided function
|
||||
rc = qmckl_get_mo_basis_mo_value(context,&mo_output[0][0], point_num*mo_num);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
@ -4584,7 +4588,7 @@ assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
rc = qmckl_context_touch(context);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
free(nucleus_coord);
|
||||
free(temp_coord);
|
||||
|
||||
@ -4606,7 +4610,7 @@ for (int j = 0; j < mo_num; j++){
|
||||
printf("OK\n");
|
||||
|
||||
#+end_src
|
||||
|
||||
|
||||
|
||||
* End of files :noexport:
|
||||
|
||||
|
@ -6729,14 +6729,14 @@ assert(qmckl_jastrow_champ_provided(context));
|
||||
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
qmckl_exit_code
|
||||
qmckl_get_jastrow_champ_een_distance_rescaled_e(qmckl_context context,
|
||||
qmckl_get_jastrow_champ_een_rescaled_e(qmckl_context context,
|
||||
double* const een_rescaled_e,
|
||||
const int64_t size_max);
|
||||
#+end_src
|
||||
|
||||
#+begin_src c :comments org :tangle (eval c) :noweb yes :exports none
|
||||
qmckl_exit_code
|
||||
qmckl_get_jastrow_champ_een_distance_rescaled_e(qmckl_context context,
|
||||
qmckl_get_jastrow_champ_een_rescaled_e(qmckl_context context,
|
||||
double* const een_rescaled_e,
|
||||
const int64_t size_max)
|
||||
{
|
||||
@ -6755,7 +6755,7 @@ qmckl_get_jastrow_champ_een_distance_rescaled_e(qmckl_context context,
|
||||
if (een_rescaled_e == NULL) {
|
||||
return qmckl_failwith( context,
|
||||
QMCKL_INVALID_ARG_2,
|
||||
"qmckl_get_jastrow_champ_een_distance_rescaled_e",
|
||||
"qmckl_get_jastrow_champ_een_rescaled_e",
|
||||
"Null pointer");
|
||||
}
|
||||
|
||||
@ -6764,7 +6764,7 @@ qmckl_get_jastrow_champ_een_distance_rescaled_e(qmckl_context context,
|
||||
if (size_max < sze) {
|
||||
return qmckl_failwith( context,
|
||||
QMCKL_INVALID_ARG_3,
|
||||
"qmckl_get_jastrow_champ_een_distance_rescaled_e",
|
||||
"qmckl_get_jastrow_champ_een_rescaled_e",
|
||||
"Array too small. Expected elec_num*elec_num*walk_num*(cord_num + 1)");
|
||||
}
|
||||
|
||||
@ -7216,7 +7216,7 @@ assert(qmckl_electron_provided(context));
|
||||
{
|
||||
|
||||
double een_rescaled_e[walk_num][(cord_num + 1)][elec_num][elec_num];
|
||||
rc = qmckl_get_jastrow_champ_een_distance_rescaled_e(context, &(een_rescaled_e[0][0][0][0]),elec_num*elec_num*(cord_num+1)*walk_num);
|
||||
rc = qmckl_get_jastrow_champ_een_rescaled_e(context, &(een_rescaled_e[0][0][0][0]),elec_num*elec_num*(cord_num+1)*walk_num);
|
||||
|
||||
// value of (0,2,1)
|
||||
assert(fabs(een_rescaled_e[0][1][0][2]- 0.2211015082992776 ) < 1.e-12);
|
||||
@ -7276,16 +7276,16 @@ assert(fabs(een_rescaled_e[0][2][1][5]- 0.5257156022077619 ) < 1.e-12);
|
||||
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
qmckl_exit_code
|
||||
qmckl_get_jastrow_champ_een_distance_rescaled_e_gl(qmckl_context context,
|
||||
double* const een_rescaled_e_gl,
|
||||
const int64_t size_max);
|
||||
qmckl_get_jastrow_champ_een_rescaled_e_gl(qmckl_context context,
|
||||
double* const een_rescaled_e_gl,
|
||||
const int64_t size_max);
|
||||
#+end_src
|
||||
|
||||
#+begin_src c :comments org :tangle (eval c) :noweb yes :exports none
|
||||
qmckl_exit_code
|
||||
qmckl_get_jastrow_champ_een_distance_rescaled_e_gl(qmckl_context context,
|
||||
double* const een_rescaled_e_gl,
|
||||
const int64_t size_max)
|
||||
qmckl_get_jastrow_champ_een_rescaled_e_gl(qmckl_context context,
|
||||
double* const een_rescaled_e_gl,
|
||||
const int64_t size_max)
|
||||
{
|
||||
if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
|
||||
return QMCKL_NULL_CONTEXT;
|
||||
@ -7302,7 +7302,7 @@ qmckl_get_jastrow_champ_een_distance_rescaled_e_gl(qmckl_context context,
|
||||
if (een_rescaled_e_gl == NULL) {
|
||||
return qmckl_failwith( context,
|
||||
QMCKL_INVALID_ARG_2,
|
||||
"qmckl_get_jastrow_champ_een_distance_rescaled_e_gl",
|
||||
"qmckl_get_jastrow_champ_een_rescaled_e_gl",
|
||||
"Null pointer");
|
||||
}
|
||||
|
||||
@ -7312,7 +7312,7 @@ qmckl_get_jastrow_champ_een_distance_rescaled_e_gl(qmckl_context context,
|
||||
if (size_max < sze) {
|
||||
return qmckl_failwith( context,
|
||||
QMCKL_INVALID_ARG_3,
|
||||
"qmckl_get_jastrow_champ_een_distance_rescaled_e_gl",
|
||||
"qmckl_get_jastrow_champ_een_rescaled_e_gl",
|
||||
"Array too small. Expected elec_num*4*elec_num*walk_num*(cord_num + 1)");
|
||||
}
|
||||
|
||||
@ -7808,7 +7808,7 @@ assert(qmckl_electron_provided(context));
|
||||
{
|
||||
double een_rescaled_e_gl[walk_num][(cord_num + 1)][elec_num][4][elec_num];
|
||||
size_max=walk_num*(cord_num + 1)*elec_num*4*elec_num;
|
||||
rc = qmckl_get_jastrow_champ_een_distance_rescaled_e_gl(context,
|
||||
rc = qmckl_get_jastrow_champ_een_rescaled_e_gl(context,
|
||||
&(een_rescaled_e_gl[0][0][0][0][0]),size_max);
|
||||
|
||||
assert(fabs(een_rescaled_e_gl[0][1][0][0][2] + 0.09831391870751387 ) < 1.e-8);
|
||||
@ -7901,9 +7901,9 @@ assert(qmckl_electron_provided(context));
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
// Call the provided function
|
||||
rc = qmckl_get_jastrow_champ_een_distance_rescaled_e(context,
|
||||
&(function_values[0][0][0][0]),
|
||||
walk_num*(cord_num+1)*elec_num*elec_num);
|
||||
rc = qmckl_get_jastrow_champ_een_rescaled_e(context,
|
||||
&(function_values[0][0][0][0]),
|
||||
walk_num*(cord_num+1)*elec_num*elec_num);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
// Accumulate derivative using finite-difference coefficients
|
||||
@ -7948,7 +7948,7 @@ assert(qmckl_electron_provided(context));
|
||||
|
||||
double een_distance_rescaled_e_gl[walk_num][cord_num+1][elec_num][4][elec_num];
|
||||
rc = qmckl_check(context,
|
||||
qmckl_get_jastrow_champ_een_distance_rescaled_e_gl(context,
|
||||
qmckl_get_jastrow_champ_een_rescaled_e_gl(context,
|
||||
&(een_distance_rescaled_e_gl[0][0][0][0][0]),
|
||||
walk_num*(cord_num+1)*elec_num*4*elec_num)
|
||||
);
|
||||
|
@ -653,7 +653,7 @@ assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
double ee_distance[walk_num][elec_num][elec_num];
|
||||
rc = qmckl_check(context,
|
||||
qmckl_get_electron_ee_distance(context, &ee_distance[0][0][0])
|
||||
qmckl_get_electron_ee_distance(context, &ee_distance[0][0][0], walk_num*elec_num*elec_num)
|
||||
);
|
||||
|
||||
rc = qmckl_check(context,
|
||||
@ -682,7 +682,7 @@ rc = qmckl_check(context,
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
rc = qmckl_check(context,
|
||||
qmckl_get_electron_ee_distance(context, &ee_distance[0][0][0])
|
||||
qmckl_get_electron_ee_distance(context, &ee_distance[0][0][0], walk_num*elec_num*elec_num)
|
||||
);
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
@ -1786,7 +1786,9 @@ rc = qmckl_set_electron_coord(context, 'N', walk_num, elec_coord, walk_num*elec_
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
double p_old[walk_num][cord_num][cord_num+1][nucl_num][elec_num];
|
||||
rc = qmckl_get_jastrow_champ_tmp_c(context, &p_old[0][0][0][0][0]);
|
||||
rc = qmckl_get_jastrow_champ_tmp_c(context,
|
||||
&p_old[0][0][0][0][0],
|
||||
walk_num*cord_num*(cord_num+1)*nucl_num*elec_num);
|
||||
|
||||
rc = qmckl_get_electron_coord(context, 'N', &coords[0][0][0], walk_num*elec_num*3);
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
@ -1807,7 +1809,9 @@ rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
double p_new[walk_num][cord_num][cord_num+1][nucl_num][elec_num];
|
||||
rc = qmckl_get_jastrow_champ_tmp_c(context, &p_new[0][0][0][0][0]);
|
||||
rc = qmckl_get_jastrow_champ_tmp_c(context,
|
||||
&p_new[0][0][0][0][0],
|
||||
walk_num*cord_num*(cord_num+1)*nucl_num*elec_num);
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
for (int nw = 0; nw < walk_num; nw++){
|
||||
@ -2412,7 +2416,8 @@ rc = qmckl_set_electron_coord(context, 'N', walk_num, elec_coord, walk_num*elec_
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
double ee_rescaled[walk_num][elec_num][elec_num];
|
||||
rc = qmckl_get_jastrow_champ_ee_distance_rescaled(context, &ee_rescaled[0][0][0]);
|
||||
rc = qmckl_get_jastrow_champ_ee_distance_rescaled(context,
|
||||
&ee_rescaled[0][0][0], walk_num*elec_num*elec_num);
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
rc = qmckl_get_electron_coord(context, 'N', &coords[0][0][0], walk_num*elec_num*3);
|
||||
@ -2432,7 +2437,8 @@ coords[0][2][2] = new_coords[2];
|
||||
rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
rc = qmckl_get_jastrow_champ_ee_distance_rescaled(context, &ee_rescaled[0][0][0]);
|
||||
rc = qmckl_get_jastrow_champ_ee_distance_rescaled(context,
|
||||
&ee_rescaled[0][0][0], walk_num*elec_num*elec_num);
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
@ -2686,7 +2692,8 @@ rc = qmckl_set_electron_coord(context, 'N', walk_num, elec_coord, walk_num*elec_
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
double en_rescaled[walk_num][nucl_num][elec_num];
|
||||
rc = qmckl_get_electron_en_distance_rescaled(context, &en_rescaled[0][0][0]);
|
||||
rc = qmckl_get_jastrow_champ_ee_distance_rescaled(context,
|
||||
&en_rescaled[0][0][0], walk_num*nucl_num*elec_num);
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
rc = qmckl_get_electron_coord(context, 'N', &coords[0][0][0], walk_num*elec_num*3);
|
||||
@ -2706,7 +2713,8 @@ coords[0][2][2] = new_coords[2];
|
||||
rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
rc = qmckl_get_electron_en_distance_rescaled(context, &en_rescaled[0][0][0]);
|
||||
rc = qmckl_get_jastrow_champ_ee_distance_rescaled(context,
|
||||
&en_rescaled[0][0][0], walk_num*nucl_num*elec_num);
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
@ -4030,7 +4038,9 @@ qmckl_set_electron_coord(context, 'N', walk_num, elec_coord, walk_num*elec_num*3
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
double een_rescaled_ee_gl[walk_num][cord_num+1][elec_num][4][elec_num];
|
||||
rc = qmckl_get_jastrow_champ_een_rescaled_e_gl(context, &een_rescaled_ee_gl[0][0][0][0][0], walk_num*(cord_num+1)*elec_num*elec_num*4);
|
||||
rc = qmckl_get_jastrow_champ_een_rescaled_e_gl(context,
|
||||
&een_rescaled_ee_gl[0][0][0][0][0],
|
||||
walk_num*(cord_num+1)*elec_num*elec_num*4);
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
rc = qmckl_get_electron_coord(context, 'N', &coords[0][0][0], walk_num*elec_num*3);
|
||||
@ -4408,7 +4418,9 @@ rc = qmckl_set_electron_coord(context, 'N', walk_num, elec_coord, walk_num*elec_
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
double p_gl_old[walk_num][cord_num][cord_num+1][nucl_num][4][elec_num];
|
||||
rc = qmckl_get_jastrow_champ_dtmp_c(context, &p_gl_old[0][0][0][0][0][0]);
|
||||
rc = qmckl_get_jastrow_champ_dtmp_c(context,
|
||||
&p_gl_old[0][0][0][0][0][0],
|
||||
4*walk_num*cord_num*(cord_num+1)*nucl_num*elec_num);
|
||||
|
||||
rc = qmckl_get_electron_coord(context, 'N', &coords[0][0][0], walk_num*elec_num*3);
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
@ -4429,7 +4441,9 @@ rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
double p_gl_new[walk_num][cord_num][cord_num+1][nucl_num][4][elec_num];
|
||||
rc = qmckl_get_jastrow_champ_dtmp_c(context, &p_gl_new[0][0][0][0][0][0]);
|
||||
rc = qmckl_get_jastrow_champ_dtmp_c(context,
|
||||
&p_gl_new[0][0][0][0][0][0],
|
||||
walk_num*cord_num*(cord_num+1)*nucl_num*elec_num*4);
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
for (int nw = 0; nw < walk_num; nw++){
|
||||
@ -5120,7 +5134,8 @@ assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
double ee_rescaled_gl[walk_num][elec_num][elec_num][4];
|
||||
rc = qmckl_get_jastrow_champ_ee_distance_rescaled_gl(context, &ee_rescaled_gl[0][0][0][0]);
|
||||
rc = qmckl_get_jastrow_champ_ee_distance_rescaled_gl(context,
|
||||
&ee_rescaled_gl[0][0][0][0], walk_num*elec_num*elec_num*4);
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
rc = qmckl_get_electron_coord(context, 'N', &coords[0][0][0], walk_num*elec_num*3);
|
||||
@ -5140,7 +5155,8 @@ coords[0][2][2] = new_coords[2];
|
||||
rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
rc = qmckl_get_jastrow_champ_ee_distance_rescaled_gl(context, &ee_rescaled_gl[0][0][0][0]);
|
||||
rc = qmckl_get_jastrow_champ_ee_distance_rescaled_gl(context,
|
||||
&ee_rescaled_gl[0][0][0][0], walk_num*elec_num*elec_num*4);
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
for (int nw = 0; nw < walk_num; nw++) {
|
||||
@ -5467,7 +5483,8 @@ assert(rc == QMCKL_SUCCESS);
|
||||
|
||||
|
||||
double en_rescaled_gl[walk_num][nucl_num][elec_num][4];
|
||||
rc = qmckl_get_electron_en_distance_rescaled_gl(context, &en_rescaled_gl[0][0][0][0]);
|
||||
rc = qmckl_get_jastrow_champ_ee_distance_rescaled_gl(context,
|
||||
&en_rescaled_gl[0][0][0][0], walk_num*nucl_num*elec_num*4);
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
rc = qmckl_get_electron_coord(context, 'N', &coords[0][0][0], walk_num*elec_num*3);
|
||||
@ -5487,7 +5504,8 @@ coords[0][2][2] = new_coords[2];
|
||||
rc = qmckl_set_electron_coord(context, 'N', walk_num, &coords[0][0][0], walk_num*elec_num*3);
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
rc = qmckl_get_electron_en_distance_rescaled_gl(context, &en_rescaled_gl[0][0][0][0]);
|
||||
rc = qmckl_get_jastrow_champ_ee_distance_rescaled_gl(context,
|
||||
&en_rescaled_gl[0][0][0][0], walk_num*nucl_num*elec_num*4);
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
for (int nw = 0; nw < walk_num; nw++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user