diff --git a/org/qmckl_jastrow.org b/org/qmckl_jastrow.org index dd0eea3..bc48594 100644 --- a/org/qmckl_jastrow.org +++ b/org/qmckl_jastrow.org @@ -103,26 +103,26 @@ int main() { computed data: - | Variable | Type | In/Out | Description | - |-------------------------------+-------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------| - | ~dim_cord_vect~ | ~int64_t~ | Number of unique C coefficients | | - | ~dim_cord_vect_date~ | ~uint64_t~ | Number of unique C coefficients | | - | ~asymp_jasb~ | ~double[2]~ | Asymptotic component | | - | ~asymp_jasb_date~ | ~uint64_t~ | Asymptotic component | | - | ~cord_vect_full~ | ~double[dim_cord_vect][nucl_num]~ | vector of non-zero coefficients | | - | ~cord_vect_full_date~ | ~uint64_t~ | Keep track of changes here | | - | ~lkpm_combined_index~ | ~int64_t[4][dim_cord_vect]~ | Transform l,k,p, and m into consecutive indices | | - | ~lkpm_combined_index_date~ | ~uint64_t~ | Transform l,k,p, and m into consecutive indices | | - | ~tmp_c~ | ~double[elec_num][nucl_num][ncord + 1][ncord][walk_num]~ | vector of non-zero coefficients | | - | ~dtmp_c~ | ~double[elec_num][4][nucl_num][ncord + 1][ncord][walk_num]~ | vector of non-zero coefficients | | - | ~een_rescaled_e~ | ~double[walk_num][elec_num][elec_num][0:cord_num]~ | The electron-electron rescaled distances raised to the powers defined by cord | | - | ~een_rescaled_e_date~ | ~uint64_t~ | Keep track of the date of creation | | - | ~een_rescaled_n~ | ~double[walk_num][elec_num][nucl_num][0:cord_num]~ | The electron-electron rescaled distances raised to the powers defined by cord | | - | ~een_rescaled_n_date~ | ~uint64_t~ | Keep track of the date of creation | | - | ~een_rescaled_e_deriv_e~ | ~double[walk_num][elec_num][4][elec_num][0:cord_num]~ | The electron-electron rescaled distances raised to the powers defined by cord derivatives wrt electrons | | - | ~een_rescaled_e_deriv_e_date~ | ~uint64_t~ | Keep track of the date of creation | | - | ~een_rescaled_n_deriv_e~ | ~double[walk_num][elec_num][4][nucl_num][0:cord_num]~ | The electron-electron rescaled distances raised to the powers defined by cord derivatives wrt electrons | | - | ~een_rescaled_n_deriv_e_date~ | ~uint64_t~ | Keep track of the date of creation | | + | Variable | Type | In/Out | Description | + |-------------------------------+---------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+---------------------------------| + | ~dim_cord_vect~ | ~int64_t~ | Number of unique C coefficients | | + | ~dim_cord_vect_date~ | ~uint64_t~ | Number of unique C coefficients | | + | ~asymp_jasb~ | ~double[2]~ | Asymptotic component | | + | ~asymp_jasb_date~ | ~uint64_t~ | Asymptotic component | | + | ~cord_vect_full~ | ~double[dim_cord_vect][nucl_num]~ | vector of non-zero coefficients | | + | ~cord_vect_full_date~ | ~uint64_t~ | Keep track of changes here | | + | ~lkpm_combined_index~ | ~int64_t[4][dim_cord_vect]~ | Transform l,k,p, and m into consecutive indices | | + | ~lkpm_combined_index_date~ | ~uint64_t~ | Transform l,k,p, and m into consecutive indices | | + | ~tmp_c~ | ~double[walk_num][0:cord_num-1][0:cord_num][nucl_num][elec_num]~ | out | vector of non-zero coefficients | + | ~dtmp_c~ | ~double[walk_num][elec_num][4][nucl_num][0:cord_num][0:cord_num-1]~ | vector of non-zero coefficients | | + | ~een_rescaled_e~ | ~double[walk_num][walk_num][elec_num][elec_num][0:cord_num]~ | The electron-electron rescaled distances raised to the powers defined by cord | | + | ~een_rescaled_e_date~ | ~uint64_t~ | Keep track of the date of creation | | + | ~een_rescaled_n~ | ~double[walk_num][elec_num][nucl_num][0:cord_num]~ | The electron-electron rescaled distances raised to the powers defined by cord | | + | ~een_rescaled_n_date~ | ~uint64_t~ | Keep track of the date of creation | | + | ~een_rescaled_e_deriv_e~ | ~double[walk_num][elec_num][4][elec_num][0:cord_num]~ | The electron-electron rescaled distances raised to the powers defined by cord derivatives wrt electrons | | + | ~een_rescaled_e_deriv_e_date~ | ~uint64_t~ | Keep track of the date of creation | | + | ~een_rescaled_n_deriv_e~ | ~double[walk_num][elec_num][4][nucl_num][0:cord_num]~ | The electron-electron rescaled distances raised to the powers defined by cord derivatives wrt electrons | | + | ~een_rescaled_n_deriv_e_date~ | ~uint64_t~ | Keep track of the date of creation | | For H2O we have the following data: @@ -4216,6 +4216,8 @@ assert(fabs(een_rescaled_n_deriv_e[0][5][0][1][2]-0.001593334817691633 ) < 1.e qmckl_exit_code qmckl_get_jastrow_dim_cord_vect(qmckl_context context, int64_t* const dim_cord_vect); qmckl_exit_code qmckl_get_jastrow_cord_vect_full(qmckl_context context, double* const cord_vect_full); qmckl_exit_code qmckl_get_jastrow_lkpm_combined_index(qmckl_context context, int64_t* const lkpm_combined_index); +qmckl_exit_code qmckl_get_jastrow_tmp_c(qmckl_context context, double* const tmp_c); +qmckl_exit_code qmckl_get_jastrow_dtmp_c(qmckl_context context, double* const dtmp_c); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none @@ -4281,6 +4283,60 @@ qmckl_exit_code qmckl_get_jastrow_lkpm_combined_index(qmckl_context context, int size_t sze = ctx->jastrow.dim_cord_vect * 4; memcpy(lkpm_combined_index, ctx->jastrow.lkpm_combined_index, sze * sizeof(double)); + return QMCKL_SUCCESS; +} + +qmckl_exit_code qmckl_get_jastrow_tmp_c(qmckl_context context, double* const tmp_c) +{ + if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { + return QMCKL_NULL_CONTEXT; + } + + qmckl_exit_code rc; + + rc = qmckl_provide_dim_cord_vect(context); + if (rc != QMCKL_SUCCESS) return rc; + + rc = qmckl_provide_cord_vect_full(context); + if (rc != QMCKL_SUCCESS) return rc; + + rc = qmckl_provide_tmp_c(context); + if (rc != QMCKL_SUCCESS) return rc; + + qmckl_context_struct* const ctx = (qmckl_context_struct* const) context; + assert (ctx != NULL); + + size_t sze = (ctx->jastrow.cord_num) * (ctx->jastrow.cord_num + 1) + * ctx->electron.num * ctx->nucleus.num * ctx->electron.walk_num; + memcpy(tmp_c, ctx->jastrow.tmp_c, sze * sizeof(double)); + + return QMCKL_SUCCESS; +} + +qmckl_exit_code qmckl_get_jastrow_dtmp_c(qmckl_context context, double* const dtmp_c) +{ + if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { + return QMCKL_NULL_CONTEXT; + } + + qmckl_exit_code rc; + + rc = qmckl_provide_dim_cord_vect(context); + if (rc != QMCKL_SUCCESS) return rc; + + rc = qmckl_provide_cord_vect_full(context); + if (rc != QMCKL_SUCCESS) return rc; + + rc = qmckl_provide_dtmp_c(context); + if (rc != QMCKL_SUCCESS) return rc; + + qmckl_context_struct* const ctx = (qmckl_context_struct* const) context; + assert (ctx != NULL); + + size_t sze = (ctx->jastrow.cord_num) * (ctx->jastrow.cord_num + 1) + *4* ctx->electron.num * ctx->nucleus.num * ctx->electron.walk_num; + memcpy(dtmp_c, ctx->jastrow.dtmp_c, sze * sizeof(double)); + return QMCKL_SUCCESS; } #+end_src @@ -4291,6 +4347,8 @@ qmckl_exit_code qmckl_get_jastrow_lkpm_combined_index(qmckl_context context, int qmckl_exit_code qmckl_provide_dim_cord_vect(qmckl_context context); qmckl_exit_code qmckl_provide_cord_vect_full(qmckl_context context); qmckl_exit_code qmckl_provide_lkpm_combined_index(qmckl_context context); +qmckl_exit_code qmckl_provide_tmp_c(qmckl_context context); +qmckl_exit_code qmckl_provide_dtmp_c(qmckl_context context); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none @@ -4417,6 +4475,112 @@ qmckl_exit_code qmckl_provide_lkpm_combined_index(qmckl_context context) ctx->jastrow.lkpm_combined_index_date = ctx->date; } + return QMCKL_SUCCESS; +} + +qmckl_exit_code qmckl_provide_tmp_c(qmckl_context context) +{ + + if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { + return QMCKL_NULL_CONTEXT; + } + + qmckl_context_struct* const ctx = (qmckl_context_struct* const) context; + assert (ctx != NULL); + + /* Check if dim_cord_vect is provided */ + qmckl_exit_code rc = qmckl_provide_dim_cord_vect(context); + if(rc != QMCKL_SUCCESS) return rc; + + /* Compute if necessary */ + if (ctx->date > ctx->jastrow.tmp_c_date) { + + /* Allocate array */ + if (ctx->jastrow.tmp_c == NULL) { + + qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; + mem_info.size = (ctx->jastrow.cord_num) * (ctx->jastrow.cord_num + 1) + ,* ctx->electron.num * ctx->nucleus.num * ctx->electron.walk_num * sizeof(double); + double* tmp_c = (double*) qmckl_malloc(context, mem_info); + + if (tmp_c == NULL) { + return qmckl_failwith( context, + QMCKL_ALLOCATION_FAILED, + "qmckl_provide_tmp_c", + NULL); + } + ctx->jastrow.tmp_c = tmp_c; + } + + qmckl_exit_code rc = + qmckl_compute_tmp_c(context, + ctx->jastrow.cord_num, + ctx->electron.num, + ctx->nucleus.num, + ctx->electron.walk_num, + ctx->jastrow.een_rescaled_e, + ctx->jastrow.een_rescaled_n, + ctx->jastrow.tmp_c); + if (rc != QMCKL_SUCCESS) { + return rc; + } + + ctx->jastrow.tmp_c_date = ctx->date; + } + + return QMCKL_SUCCESS; +} + +qmckl_exit_code qmckl_provide_dtmp_c(qmckl_context context) +{ + + if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { + return QMCKL_NULL_CONTEXT; + } + + qmckl_context_struct* const ctx = (qmckl_context_struct* const) context; + assert (ctx != NULL); + + /* Check if dim_cord_vect is provided */ + qmckl_exit_code rc = qmckl_provide_dim_cord_vect(context); + if(rc != QMCKL_SUCCESS) return rc; + + /* Compute if necessary */ + if (ctx->date > ctx->jastrow.dtmp_c_date) { + + /* Allocate array */ + if (ctx->jastrow.dtmp_c == NULL) { + + qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; + mem_info.size = (ctx->jastrow.cord_num) * (ctx->jastrow.cord_num + 1) + * 4 * ctx->electron.num * ctx->nucleus.num * ctx->electron.walk_num * sizeof(double); + double* dtmp_c = (double*) qmckl_malloc(context, mem_info); + + if (dtmp_c == NULL) { + return qmckl_failwith( context, + QMCKL_ALLOCATION_FAILED, + "qmckl_provide_dtmp_c", + NULL); + } + ctx->jastrow.dtmp_c = dtmp_c; + } + + qmckl_exit_code rc = + qmckl_compute_dtmp_c(context, + ctx->jastrow.cord_num, + ctx->electron.num, + ctx->nucleus.num, + ctx->electron.walk_num, + ctx->jastrow.een_rescaled_e_deriv_e, + ctx->jastrow.een_rescaled_n, + ctx->jastrow.dtmp_c); + if (rc != QMCKL_SUCCESS) { + return rc; + } + + ctx->jastrow.dtmp_c_date = ctx->date; + } + return QMCKL_SUCCESS; } #+end_src @@ -4719,6 +4883,321 @@ end function qmckl_compute_lkpm_combined_index_f end function qmckl_compute_lkpm_combined_index #+end_src +*** Compute tmp_c + :PROPERTIES: + :Name: qmckl_compute_tmp_c + :CRetType: qmckl_exit_code + :FRetType: qmckl_exit_code + :END: + + #+NAME: qmckl_factor_tmp_c_args + | Variable | Type | In/Out | Description | + |------------------+------------------------------------------------------------------+--------+-----------------------------------| + | ~context~ | ~qmckl_context~ | in | Global state | + | ~cord_num~ | ~int64_t~ | in | Order of polynomials | + | ~elec_num~ | ~int64_t~ | in | Number of electrons | + | ~nucl_num~ | ~int64_t~ | in | Number of nucleii | + | ~walk_num~ | ~int64_t~ | in | Number of walkers | + | ~een_rescaled_e~ | ~double[walk_num][elec_num][elec_num][0:cord_num]~ | in | Electron-electron rescaled factor | + | ~een_rescaled_n~ | ~double[walk_num][elec_num][nucl_num][0:cord_num]~ | in | Electron-nucleus rescaled factor | + | ~tmp_c~ | ~double[walk_num][0:cord_num-1][0:cord_num][nucl_num][elec_num]~ | out | vector of non-zero coefficients | + + #+begin_src f90 :comments org :tangle (eval f) :noweb yes +integer function qmckl_compute_tmp_c_f(context, cord_num, elec_num, nucl_num, & + walk_num, een_rescaled_e, een_rescaled_n, tmp_c) & + result(info) + use qmckl + implicit none + integer(qmckl_context), intent(in) :: context + integer*8 , intent(in) :: cord_num + integer*8 , intent(in) :: elec_num + integer*8 , intent(in) :: nucl_num + integer*8 , intent(in) :: walk_num + double precision , intent(in) :: een_rescaled_e(0:cord_num, elec_num, elec_num, walk_num) + double precision , intent(in) :: een_rescaled_n(0:cord_num, nucl_num, elec_num, walk_num) + double precision , intent(out) :: tmp_c(elec_num, nucl_num,0:cord_num, 0:cord_num-1, walk_num) + double precision :: x + double precision,dimension(:,:,:,:),allocatable :: een_rescaled_e_T + double precision,dimension(:,:,:,:),allocatable :: een_rescaled_n_T + integer*8 :: i, j, a, l, kk, p, lmax, nw + character :: TransA, TransB + double precision :: alpha, beta + integer*8 :: M, N, K, LDA, LDB, LDC + + TransA = 'N' + TransB = 'N' + alpha = 1.0d0 + beta = 0.0d0 + + allocate(een_rescaled_e_T(elec_num,elec_num,0:cord_num,walk_num)) + allocate(een_rescaled_n_T(elec_num,nucl_num,0:cord_num,walk_num)) + do nw = 1,walk_num + do i = 1, elec_num + do j = 1, elec_num + do l = 0,cord_num + een_rescaled_e_T(i,j,l,nw) = een_rescaled_e(l,j,i,nw) + end do + end do + end do + end do + do nw = 1,walk_num + do i = 1, elec_num + do j = 1, nucl_num + do l = 0,cord_num + een_rescaled_n_T(i,j,l,nw) = een_rescaled_n(l,j,i,nw) + end do + end do + end do + end do + + info = QMCKL_SUCCESS + + if (context == QMCKL_NULL_CONTEXT) then + info = QMCKL_INVALID_CONTEXT + return + endif + + if (cord_num <= 0) then + info = QMCKL_INVALID_ARG_2 + return + endif + + if (elec_num <= 0) then + info = QMCKL_INVALID_ARG_3 + return + endif + + if (nucl_num <= 0) then + info = QMCKL_INVALID_ARG_4 + return + endif + + M = elec_num + N = nucl_num*(cord_num + 1) + K = elec_num + LDA = size(een_rescaled_e_T,1) + LDB = size(een_rescaled_n_T,1) + LDC = size(tmp_c,1) + + do nw=1, walk_num + do i=0, cord_num-1 + info = qmckl_dgemm(context,TransA, TransB, M, N, K, alpha, & + een_rescaled_e_T(1,1,i,nw),LDA*1_8, & + een_rescaled_n_T(1,1,0,nw),LDB*1_8, & + beta, & + tmp_c(1,1,0,i,nw),LDC) + end do + end do + !do kk=0, cord_num-1 + !do i=1,nucl_num + ! do j=1,elec_num + ! print *,tmp_c(j,i,:,kk,1) + ! end do + !end do + !end do + + deallocate(een_rescaled_e_T) + deallocate(een_rescaled_n_T) +end function qmckl_compute_tmp_c_f + #+end_src + + #+CALL: generate_c_header(table=qmckl_factor_tmp_c_args,rettyp=get_value("CRetType"),fname=get_value("Name")) + + #+RESULTS: + #+begin_src c :tangle (eval h_func) :comments org + qmckl_exit_code qmckl_compute_tmp_c ( + const qmckl_context context, + const int64_t cord_num, + const int64_t elec_num, + const int64_t nucl_num, + const int64_t walk_num, + const double* een_rescaled_e, + const double* een_rescaled_n, + double* const tmp_c ); + #+end_src + + + #+CALL: generate_c_interface(table=qmckl_factor_tmp_c_args,rettyp=get_value("CRetType"),fname=get_value("Name")) + + #+RESULTS: + #+begin_src f90 :tangle (eval f) :comments org :exports none + integer(c_int32_t) function qmckl_compute_tmp_c & + (context, cord_num, elec_num, nucl_num, walk_num, een_rescaled_e, een_rescaled_n, tmp_c) & + bind(C) result(info) + + use, intrinsic :: iso_c_binding + implicit none + + integer (c_int64_t) , intent(in) , value :: context + integer (c_int64_t) , intent(in) , value :: cord_num + integer (c_int64_t) , intent(in) , value :: elec_num + integer (c_int64_t) , intent(in) , value :: nucl_num + integer (c_int64_t) , intent(in) , value :: walk_num + real (c_double ) , intent(in) :: een_rescaled_e(0:cord_num,elec_num,elec_num,walk_num) + real (c_double ) , intent(in) :: een_rescaled_n(0:cord_num,nucl_num,elec_num,walk_num) + real (c_double ) , intent(out) :: tmp_c(elec_num,nucl_num,0:cord_num,0:cord_num-1,walk_num) + + integer(c_int32_t), external :: qmckl_compute_tmp_c_f + info = qmckl_compute_tmp_c_f & + (context, cord_num, elec_num, nucl_num, walk_num, een_rescaled_e, een_rescaled_n, tmp_c) + + end function qmckl_compute_tmp_c + #+end_src + +*** Compute dtmp_c + :PROPERTIES: + :Name: qmckl_compute_dtmp_c + :CRetType: qmckl_exit_code + :FRetType: qmckl_exit_code + :END: + + #+NAME: qmckl_factor_dtmp_c_args + | Variable | Type | In/Out | Description | + |--------------------------+------------------------------------------------------------------+--------+-----------------------------------------------| + | ~context~ | ~qmckl_context~ | in | Global state | + | ~cord_num~ | ~int64_t~ | in | Order of polynomials | + | ~elec_num~ | ~int64_t~ | in | Number of electrons | + | ~nucl_num~ | ~int64_t~ | in | Number of nucleii | + | ~walk_num~ | ~int64_t~ | in | Number of walkers | + | ~een_rescaled_e_deriv_e~ | ~double[walk_num][elec_num][4][elec_num][0:cord_num]~ | in | Electron-electron rescaled factor derivatives | + | ~een_rescaled_n~ | ~double[walk_num][elec_num][nucl_num][0:cord_num]~ | in | Electron-nucleus rescaled factor | + | ~dtmp_c~ | ~double[walk_num][0:cord_num-1][0:cord_num][nucl_num][elec_num]~ | out | vector of non-zero coefficients | + + #+begin_src f90 :comments org :tangle (eval f) :noweb yes +integer function qmckl_compute_dtmp_c_f(context, cord_num, elec_num, nucl_num, & + walk_num, een_rescaled_e_deriv_e, een_rescaled_n, dtmp_c) & + result(info) + use qmckl + implicit none + integer(qmckl_context), intent(in) :: context + integer*8 , intent(in) :: cord_num + integer*8 , intent(in) :: elec_num + integer*8 , intent(in) :: nucl_num + integer*8 , intent(in) :: walk_num + double precision , intent(in) :: een_rescaled_e_deriv_e(0:cord_num, elec_num, 4, elec_num, walk_num) + double precision , intent(in) :: een_rescaled_n(0:cord_num, nucl_num, elec_num, walk_num) + double precision , intent(out) :: dtmp_c(elec_num, 4, nucl_num,0:cord_num, 0:cord_num-1, walk_num) + double precision :: x + integer*8 :: i, j, a, l, kk, p, lmax, nw, ii + character :: TransA, TransB + double precision :: alpha, beta + integer*8 :: M, N, K, LDA, LDB, LDC + double precision,dimension(:,:,:,:,:),allocatable :: een_rescaled_e_deriv_e_T + double precision,dimension(:,:,:,:),allocatable :: een_rescaled_n_T + + TransA = 'N' + TransB = 'N' + alpha = 1.0d0 + beta = 0.0d0 + + info = QMCKL_SUCCESS + + allocate(een_rescaled_e_deriv_e_T(elec_num,4,elec_num,0:cord_num,walk_num)) + allocate(een_rescaled_n_T(elec_num,nucl_num,0:cord_num,walk_num)) + do nw = 1,walk_num + do i = 1, elec_num + do ii = 1, 4 + do j = 1, elec_num + do l = 0,cord_num + een_rescaled_e_deriv_e_T(i,ii,j,l,nw) = een_rescaled_e_deriv_e(l,j,ii,i,nw) + end do + end do + end do + end do + do i = 1, elec_num + do j = 1, nucl_num + do l = 0,cord_num + een_rescaled_n_T(i,j,l,nw) = een_rescaled_n(l,j,i,nw) + end do + end do + end do + end do + + if (context == QMCKL_NULL_CONTEXT) then + info = QMCKL_INVALID_CONTEXT + return + endif + + if (cord_num <= 0) then + info = QMCKL_INVALID_ARG_2 + return + endif + + if (elec_num <= 0) then + info = QMCKL_INVALID_ARG_3 + return + endif + + if (nucl_num <= 0) then + info = QMCKL_INVALID_ARG_4 + return + endif + + M = 4*elec_num + N = nucl_num*(cord_num + 1) + K = elec_num + LDA = 4*size(een_rescaled_e_deriv_e_T,1) + LDB = size(een_rescaled_n_T,1) + LDC = 4*size(dtmp_c,1) + + do nw=1, walk_num + do i=0, cord_num-1 + info = qmckl_dgemm(context,TransA, TransB, M, N, K, alpha, & + een_rescaled_e_deriv_e_T(1,1,1,i,nw),LDA*1_8, & + een_rescaled_n_T(1,1,0,nw),LDB*1_8, & + beta, & + dtmp_c(1,1,1,0,i,nw),LDC) + end do + end do + + deallocate(een_rescaled_e_deriv_e_T) + deallocate(een_rescaled_n_T) +end function qmckl_compute_dtmp_c_f + #+end_src + + #+CALL: generate_c_header(table=qmckl_factor_dtmp_c_args,rettyp=get_value("CRetType"),fname=get_value("Name")) + + #+RESULTS: + #+begin_src c :tangle (eval h_func) :comments org + qmckl_exit_code qmckl_compute_dtmp_c ( + const qmckl_context context, + const int64_t cord_num, + const int64_t elec_num, + const int64_t nucl_num, + const int64_t walk_num, + const double* een_rescaled_e_deriv_e, + const double* een_rescaled_n, + double* const dtmp_c ); + #+end_src + + + #+CALL: generate_c_interface(table=qmckl_factor_dtmp_c_args,rettyp=get_value("CRetType"),fname=get_value("Name")) + + #+RESULTS: + #+begin_src f90 :tangle (eval f) :comments org :exports none + integer(c_int32_t) function qmckl_compute_dtmp_c & + (context, cord_num, elec_num, nucl_num, walk_num, een_rescaled_e_deriv_e, een_rescaled_n, dtmp_c) & + bind(C) result(info) + + use, intrinsic :: iso_c_binding + implicit none + + integer (c_int64_t) , intent(in) , value :: context + integer (c_int64_t) , intent(in) , value :: cord_num + integer (c_int64_t) , intent(in) , value :: elec_num + integer (c_int64_t) , intent(in) , value :: nucl_num + integer (c_int64_t) , intent(in) , value :: walk_num + real (c_double ) , intent(in) :: een_rescaled_e_deriv_e(0:cord_num,elec_num,4,elec_num,walk_num) + real (c_double ) , intent(in) :: een_rescaled_n(0:cord_num,nucl_num,elec_num,walk_num) + real (c_double ) , intent(out) :: dtmp_c(elec_num,nucl_num,0:cord_num,0:cord_num-1,walk_num) + + integer(c_int32_t), external :: qmckl_compute_dtmp_c_f + info = qmckl_compute_dtmp_c_f & + (context, cord_num, elec_num, nucl_num, walk_num, een_rescaled_e_deriv_e, een_rescaled_n, dtmp_c) + + end function qmckl_compute_dtmp_c + #+end_src + *** Test #+name: helper_funcs @@ -4790,9 +5269,17 @@ lkpm_of_cindex = np.array(lkpm_combined_index).T #+RESULTS: helper_funcs #+begin_src c :tangle (eval c_test) -//assert(qmckl_electron_provided(context)); -// +assert(qmckl_electron_provided(context)); +double tmp_c[walk_num][cord_num][cord_num+1][nucl_num][elec_num]; +rc = qmckl_get_jastrow_tmp_c(context, &(tmp_c[0][0][0][0][0])); + +double dtmp_c[walk_num][cord_num][cord_num+1][nucl_num][4][elec_num]; +rc = qmckl_get_jastrow_dtmp_c(context, &(dtmp_c[0][0][0][0][0][0])); + +assert(fabs(tmp_c[0][0][1][0][0] - 2.7083473948352403) < 1e-12); + +assert(fabs(dtmp_c[0][1][0][0][0][0] + 0.237440520852232) < 1e-12); #+end_src ** Electron-electron-nucleus Jastrow \(f_{een}\) @@ -4863,6 +5350,10 @@ qmckl_exit_code qmckl_provide_factor_een(qmckl_context context) rc = qmckl_provide_lkpm_combined_index(context); if(rc != QMCKL_SUCCESS) return rc; + /* Check if tmp_c is provided */ + rc = qmckl_provide_tmp_c(context); + if(rc != QMCKL_SUCCESS) return rc; + /* Compute if necessary */ if (ctx->date > ctx->jastrow.factor_een_date) { @@ -4891,7 +5382,7 @@ qmckl_exit_code qmckl_provide_factor_een(qmckl_context context) ctx->jastrow.dim_cord_vect, ctx->jastrow.cord_vect_full, ctx->jastrow.lkpm_combined_index, - ctx->jastrow.een_rescaled_e, + ctx->jastrow.tmp_c, ctx->jastrow.een_rescaled_n, ctx->jastrow.factor_een); if (rc != QMCKL_SUCCESS) { @@ -4905,14 +5396,14 @@ qmckl_exit_code qmckl_provide_factor_een(qmckl_context context) } #+end_src -*** Compute +*** Compute naive :PROPERTIES: - :Name: qmckl_compute_factor_een + :Name: qmckl_compute_factor_een_naive :CRetType: qmckl_exit_code :FRetType: qmckl_exit_code :END: - #+NAME: qmckl_factor_een_args + #+NAME: qmckl_factor_een_naive_args | Variable | Type | In/Out | Description | |-----------------------+----------------------------------------------------+--------+--------------------------------------| | ~context~ | ~qmckl_context~ | in | Global state | @@ -4926,10 +5417,10 @@ qmckl_exit_code qmckl_provide_factor_een(qmckl_context context) | ~een_rescaled_e~ | ~double[walk_num][elec_num][elec_num][0:cord_num]~ | in | Electron-nucleus rescaled | | ~een_rescaled_n~ | ~double[walk_num][elec_num][nucl_num][0:cord_num]~ | in | Electron-nucleus rescaled factor | | ~factor_een~ | ~double[walk_num]~ | out | Electron-nucleus jastrow | - + #+begin_src f90 :comments org :tangle (eval f) :noweb yes -integer function qmckl_compute_factor_een_f(context, walk_num, elec_num, nucl_num, cord_num, dim_cord_vect, & - cord_vect_full, lkpm_combined_index, & +integer function qmckl_compute_factor_een_naive_f(context, walk_num, elec_num, nucl_num, cord_num,& + dim_cord_vect, cord_vect_full, lkpm_combined_index, & een_rescaled_e, een_rescaled_n, factor_een) & result(info) use qmckl @@ -4973,13 +5464,13 @@ integer function qmckl_compute_factor_een_f(context, walk_num, elec_num, nucl_nu endif factor_een = 0.0d0 - + do nw =1, walk_num do n = 1, dim_cord_vect - l = lkpm_combined_index(n, 1) + l = lkpm_combined_index(n, 1) k = lkpm_combined_index(n, 2) - p = lkpm_combined_index(n, 3) - m = lkpm_combined_index(n, 4) + p = lkpm_combined_index(n, 3) + m = lkpm_combined_index(n, 4) do a = 1, nucl_num accu2 = 0.0d0 @@ -5001,6 +5492,166 @@ integer function qmckl_compute_factor_een_f(context, walk_num, elec_num, nucl_nu end do end do +end function qmckl_compute_factor_een_naive_f + #+end_src + + #+CALL: generate_c_header(table=qmckl_factor_een_naive_args,rettyp=get_value("CRetType"),fname=get_value("Name")) + + #+RESULTS: + #+begin_src c :tangle (eval h_func) :comments org + qmckl_exit_code qmckl_compute_factor_een_naive ( + const qmckl_context context, + const int64_t walk_num, + const int64_t elec_num, + const int64_t nucl_num, + const int64_t cord_num, + const int64_t dim_cord_vect, + const double* cord_vect_full, + const int64_t* lkpm_combined_index, + const double* een_rescaled_e, + const double* een_rescaled_n, + double* const factor_een ); + #+end_src + + #+CALL: generate_c_interface(table=qmckl_factor_een_naive_args,rettyp=get_value("CRetType"),fname=get_value("Name")) + + #+RESULTS: + #+begin_src f90 :tangle (eval f) :comments org :exports none + integer(c_int32_t) function qmckl_compute_factor_een_naive & + (context, & + walk_num, & + elec_num, & + nucl_num, & + cord_num, & + dim_cord_vect, & + cord_vect_full, & + lkpm_combined_index, & + een_rescaled_e, & + een_rescaled_n, & + factor_een) & + bind(C) result(info) + + use, intrinsic :: iso_c_binding + implicit none + + integer (c_int64_t) , intent(in) , value :: context + integer (c_int64_t) , intent(in) , value :: walk_num + integer (c_int64_t) , intent(in) , value :: elec_num + integer (c_int64_t) , intent(in) , value :: nucl_num + integer (c_int64_t) , intent(in) , value :: cord_num + integer (c_int64_t) , intent(in) , value :: dim_cord_vect + real (c_double ) , intent(in) :: cord_vect_full(nucl_num,dim_cord_vect) + integer (c_int64_t) , intent(in) :: lkpm_combined_index(dim_cord_vect,4) + real (c_double ) , intent(in) :: een_rescaled_e(0:cord_num,elec_num,elec_num,walk_num) + real (c_double ) , intent(in) :: een_rescaled_n(0:cord_num,nucl_num,elec_num,walk_num) + real (c_double ) , intent(out) :: factor_een(walk_num) + + integer(c_int32_t), external :: qmckl_compute_factor_een_naive_f + info = qmckl_compute_factor_een_naive_f & + (context, & + walk_num, & + elec_num, & + nucl_num, & + cord_num, & + dim_cord_vect, & + cord_vect_full, & + lkpm_combined_index, & + een_rescaled_e, & + een_rescaled_n, & + factor_een) + + end function qmckl_compute_factor_een_naive + #+end_src + +*** Compute + :PROPERTIES: + :Name: qmckl_compute_factor_een + :CRetType: qmckl_exit_code + :FRetType: qmckl_exit_code + :END: + + #+NAME: qmckl_factor_een_args + | Variable | Type | In/Out | Description | + |-----------------------+------------------------------------------------------------------+---------------------------------+--------------------------------------| + | ~context~ | ~qmckl_context~ | in | Global state | + | ~walk_num~ | ~int64_t~ | in | Number of walkers | + | ~elec_num~ | ~int64_t~ | in | Number of electrons | + | ~nucl_num~ | ~int64_t~ | in | Number of nucleii | + | ~cord_num~ | ~int64_t~ | in | order of polynomials | + | ~dim_cord_vect~ | ~int64_t~ | in | dimension of full coefficient vector | + | ~cord_vect_full~ | ~double[dim_cord_vect][nucl_num]~ | in | full coefficient vector | + | ~lkpm_combined_index~ | ~int64_t[4][dim_cord_vect]~ | in | combined indices | + | ~tmp_c~ | ~double[walk_num][0:cord_num-1][0:cord_num][nucl_num][elec_num]~ | vector of non-zero coefficients | | + | ~een_rescaled_n~ | ~double[walk_num][elec_num][nucl_num][0:cord_num]~ | in | Electron-nucleus rescaled factor | + | ~factor_een~ | ~double[walk_num]~ | out | Electron-nucleus jastrow | + + #+begin_src f90 :comments org :tangle (eval f) :noweb yes +integer function qmckl_compute_factor_een_f(context, walk_num, elec_num, nucl_num, cord_num, & + dim_cord_vect, cord_vect_full, lkpm_combined_index, & + tmp_c, een_rescaled_n, factor_een) & + result(info) + use qmckl + implicit none + integer(qmckl_context), intent(in) :: context + integer*8 , intent(in) :: walk_num, elec_num, cord_num, nucl_num, dim_cord_vect + integer*8 , intent(in) :: lkpm_combined_index(dim_cord_vect,4) + double precision , intent(in) :: cord_vect_full(nucl_num, dim_cord_vect) + double precision , intent(in) :: tmp_c(elec_num, nucl_num,0:cord_num, 0:cord_num-1, walk_num) + double precision , intent(in) :: een_rescaled_n(0:cord_num, nucl_num, elec_num, walk_num) + double precision , intent(out) :: factor_een(walk_num) + + integer*8 :: i, a, j, l, k, p, m, n, nw + double precision :: accu, accu2, cn + + info = QMCKL_SUCCESS + + if (context == QMCKL_NULL_CONTEXT) then + info = QMCKL_INVALID_CONTEXT + return + endif + + if (walk_num <= 0) then + info = QMCKL_INVALID_ARG_2 + return + endif + + if (elec_num <= 0) then + info = QMCKL_INVALID_ARG_3 + return + endif + + if (nucl_num <= 0) then + info = QMCKL_INVALID_ARG_4 + return + endif + + if (cord_num <= 0) then + info = QMCKL_INVALID_ARG_5 + return + endif + + factor_een = 0.0d0 + + do nw =1, walk_num + do n = 1, dim_cord_vect + l = lkpm_combined_index(n, 1) + k = lkpm_combined_index(n, 2) + p = lkpm_combined_index(n, 3) + m = lkpm_combined_index(n, 4) + + do a = 1, nucl_num + cn = cord_vect_full(a, n) + if(cn == 0.d0) cycle + + accu = 0.0d0 + do j = 1, elec_num + accu = accu + een_rescaled_n(m,a,j,nw) * tmp_c(j,a,m+l,k,nw) + end do + factor_een(nw) = factor_een(nw) + accu * cn + end do + end do + end do + end function qmckl_compute_factor_een_f #+end_src @@ -5194,6 +5845,14 @@ qmckl_exit_code qmckl_provide_factor_een_deriv_e(qmckl_context context) rc = qmckl_provide_lkpm_combined_index(context); if(rc != QMCKL_SUCCESS) return rc; + /* Check if tmp_c is provided */ + rc = qmckl_provide_tmp_c(context); + if(rc != QMCKL_SUCCESS) return rc; + + /* Check if dtmp_c is provided */ + rc = qmckl_provide_dtmp_c(context); + if(rc != QMCKL_SUCCESS) return rc; + /* Compute if necessary */ if (ctx->date > ctx->jastrow.factor_een_deriv_e_date) { @@ -5222,9 +5881,9 @@ qmckl_exit_code qmckl_provide_factor_een_deriv_e(qmckl_context context) ctx->jastrow.dim_cord_vect, ctx->jastrow.cord_vect_full, ctx->jastrow.lkpm_combined_index, - ctx->jastrow.een_rescaled_e, + ctx->jastrow.tmp_c, + ctx->jastrow.dtmp_c, ctx->jastrow.een_rescaled_n, - ctx->jastrow.een_rescaled_e_deriv_e, ctx->jastrow.een_rescaled_n_deriv_e, ctx->jastrow.factor_een_deriv_e); if (rc != QMCKL_SUCCESS) { @@ -5238,14 +5897,14 @@ qmckl_exit_code qmckl_provide_factor_een_deriv_e(qmckl_context context) } #+end_src -*** Compute +*** Compute Naive :PROPERTIES: - :Name: qmckl_compute_factor_een_deriv_e + :Name: qmckl_compute_factor_een_deriv_e_naive :CRetType: qmckl_exit_code :FRetType: qmckl_exit_code :END: - #+NAME: qmckl_factor_een_deriv_e_args + #+NAME: qmckl_factor_een_deriv_e_naive_args | Variable | Type | In/Out | Description | |--------------------------+-------------------------------------------------------+--------+--------------------------------------| | ~context~ | ~qmckl_context~ | in | Global state | @@ -5263,10 +5922,10 @@ qmckl_exit_code qmckl_provide_factor_een_deriv_e(qmckl_context context) | ~factor_een_deriv_e~ | ~double[walk_num][4][elec_num]~ | out | Electron-nucleus jastrow | #+begin_src f90 :comments org :tangle (eval f) :noweb yes -integer function qmckl_compute_factor_een_deriv_e_f(context, walk_num, elec_num, nucl_num, cord_num, dim_cord_vect, & - cord_vect_full, lkpm_combined_index, & - een_rescaled_e, een_rescaled_n, & - een_rescaled_e_deriv_e, een_rescaled_n_deriv_e, factor_een_deriv_e) & +integer function qmckl_compute_factor_een_deriv_e_naive_f(context, walk_num, elec_num, nucl_num, cord_num, & + dim_cord_vect, cord_vect_full, lkpm_combined_index, & + een_rescaled_e, een_rescaled_n, & + een_rescaled_e_deriv_e, een_rescaled_n_deriv_e, factor_een_deriv_e)& result(info) use qmckl implicit none @@ -5356,14 +6015,14 @@ integer function qmckl_compute_factor_een_deriv_e_f(context, walk_num, elec_num, end do end do -end function qmckl_compute_factor_een_deriv_e_f +end function qmckl_compute_factor_een_deriv_e_naive_f #+end_src - #+CALL: generate_c_header(table=qmckl_factor_een_deriv_e_args,rettyp=get_value("CRetType"),fname=get_value("Name")) + #+CALL: generate_c_header(table=qmckl_factor_een_deriv_e_naive_args,rettyp=get_value("CRetType"),fname=get_value("Name")) #+RESULTS: #+begin_src c :tangle (eval h_func) :comments org - qmckl_exit_code qmckl_compute_factor_een_deriv_e ( + qmckl_exit_code qmckl_compute_factor_een_deriv_e_naive ( const qmckl_context context, const int64_t walk_num, const int64_t elec_num, @@ -5380,11 +6039,11 @@ end function qmckl_compute_factor_een_deriv_e_f #+end_src - #+CALL: generate_c_interface(table=qmckl_factor_een_deriv_e_args,rettyp=get_value("CRetType"),fname=get_value("Name")) + #+CALL: generate_c_interface(table=qmckl_factor_een_deriv_e_naive_args,rettyp=get_value("CRetType"),fname=get_value("Name")) #+RESULTS: #+begin_src f90 :tangle (eval f) :comments org :exports none - integer(c_int32_t) function qmckl_compute_factor_een_deriv_e & + integer(c_int32_t) function qmckl_compute_factor_een_deriv_e_naive & (context, & walk_num, & elec_num, & @@ -5417,8 +6076,8 @@ end function qmckl_compute_factor_een_deriv_e_f real (c_double ) , intent(in) :: een_rescaled_n_deriv_e(0:cord_num,nucl_num,4,elec_num,walk_num) real (c_double ) , intent(out) :: factor_een_deriv_e(elec_num,4,walk_num) - integer(c_int32_t), external :: qmckl_compute_factor_een_deriv_e_f - info = qmckl_compute_factor_een_deriv_e_f & + integer(c_int32_t), external :: qmckl_compute_factor_een_deriv_e_naive_f + info = qmckl_compute_factor_een_deriv_e_naive_f & (context, & walk_num, & elec_num, & @@ -5433,6 +6092,197 @@ end function qmckl_compute_factor_een_deriv_e_f een_rescaled_n_deriv_e, & factor_een_deriv_e) + end function qmckl_compute_factor_een_deriv_e_naive + #+end_src + +*** Compute + :PROPERTIES: + :Name: qmckl_compute_factor_een_deriv_e + :CRetType: qmckl_exit_code + :FRetType: qmckl_exit_code + :END: + + #+NAME: qmckl_factor_een_deriv_e_args + | Variable | Type | In/Out | Description | + |--------------------------+---------------------------------------------------------------------+--------+------------------------------------------------| + | ~context~ | ~qmckl_context~ | in | Global state | + | ~walk_num~ | ~int64_t~ | in | Number of walkers | + | ~elec_num~ | ~int64_t~ | in | Number of electrons | + | ~nucl_num~ | ~int64_t~ | in | Number of nucleii | + | ~cord_num~ | ~int64_t~ | in | order of polynomials | + | ~dim_cord_vect~ | ~int64_t~ | in | dimension of full coefficient vector | + | ~cord_vect_full~ | ~double[dim_cord_vect][nucl_num]~ | in | full coefficient vector | + | ~lkpm_combined_index~ | ~int64_t[4][dim_cord_vect]~ | in | combined indices | + | ~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 | + | ~een_rescaled_n~ | ~double[walk_num][elec_num][nucl_num][0:cord_num]~ | in | Electron-nucleus rescaled factor | + | ~een_rescaled_n_deriv_e~ | ~double[walk_num][elec_num][4][nucl_num][0:cord_num]~ | in | Derivative of Electron-nucleus rescaled factor | + | ~factor_een_deriv_e~ | ~double[walk_num][4][elec_num]~ | out | Derivative of Electron-nucleus jastrow | + + + #+begin_src f90 :comments org :tangle (eval f) :noweb yes +integer function qmckl_compute_factor_een_deriv_e_f(context, walk_num, elec_num, nucl_num, cord_num, dim_cord_vect, & + cord_vect_full, lkpm_combined_index, & + tmp_c, dtmp_c, een_rescaled_n, een_rescaled_n_deriv_e, factor_een_deriv_e) & + result(info) + use qmckl + implicit none + integer(qmckl_context), intent(in) :: context + integer*8 , intent(in) :: walk_num, elec_num, cord_num, nucl_num, dim_cord_vect + integer*8 , intent(in) :: lkpm_combined_index(dim_cord_vect,4) + double precision , intent(in) :: cord_vect_full(nucl_num, dim_cord_vect) + double precision , intent(in) :: tmp_c(elec_num, nucl_num,0:cord_num, 0:cord_num-1, walk_num) + double precision , intent(in) :: dtmp_c(elec_num, 4, nucl_num,0:cord_num, 0:cord_num-1, 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_deriv_e(0:cord_num, nucl_num, 4, elec_num, walk_num) + double precision , intent(out) :: factor_een_deriv_e(elec_num,4,walk_num) + + integer*8 :: i, a, j, l, k, p, m, n, nw, ii + double precision :: accu, accu2, cn + + info = QMCKL_SUCCESS + + if (context == QMCKL_NULL_CONTEXT) then + info = QMCKL_INVALID_CONTEXT + return + endif + + if (walk_num <= 0) then + info = QMCKL_INVALID_ARG_2 + return + endif + + if (elec_num <= 0) then + info = QMCKL_INVALID_ARG_3 + return + endif + + if (nucl_num <= 0) then + info = QMCKL_INVALID_ARG_4 + return + endif + + if (cord_num <= 0) then + info = QMCKL_INVALID_ARG_5 + return + endif + + factor_een_deriv_e = 0.0d0 + + do nw =1, walk_num + do n = 1, dim_cord_vect + l = lkpm_combined_index(n, 1) + k = lkpm_combined_index(n, 2) + p = lkpm_combined_index(n, 3) + m = lkpm_combined_index(n, 4) + + do a = 1, nucl_num + cn = cord_vect_full(a, n) + if(cn == 0.d0) cycle + + do ii = 1, 4 + do j = 1, elec_num + factor_een_deriv_e(j,ii,nw) = factor_een_deriv_e(j,ii,nw) + (& + tmp_c(j,a,m,k,nw) * een_rescaled_n_deriv_e(m+l,a,ii,j,nw) + & + (-1.0d0*dtmp_c(j,ii,a,m,k,nw)) * een_rescaled_n(m+l,a,j,nw) + & + (-1.0d0*dtmp_c(j,ii,a,m+l,k,nw)) * een_rescaled_n(m,a,j,nw) + & + tmp_c(j,a,m+l,k,nw) * een_rescaled_n_deriv_e(m,a,ii,j,nw) & + ) * cn + end do + end do + + cn = cn + cn + do j = 1, elec_num + factor_een_deriv_e(j,4,nw) = factor_een_deriv_e(j,4,nw) + (& + (-1.0d0*dtmp_c(j,1,a,m ,k,nw)) * een_rescaled_n_deriv_e(m+l,a,1,j,nw) + & + (-1.0d0*dtmp_c(j,2,a,m ,k,nw)) * een_rescaled_n_deriv_e(m+l,a,2,j,nw) + & + (-1.0d0*dtmp_c(j,3,a,m ,k,nw)) * een_rescaled_n_deriv_e(m+l,a,3,j,nw) + & + (-1.0d0*dtmp_c(j,1,a,m+l,k,nw)) * een_rescaled_n_deriv_e(m ,a,1,j,nw) + & + (-1.0d0*dtmp_c(j,2,a,m+l,k,nw)) * een_rescaled_n_deriv_e(m ,a,2,j,nw) + & + (-1.0d0*dtmp_c(j,3,a,m+l,k,nw)) * een_rescaled_n_deriv_e(m ,a,3,j,nw) & + ) * cn + end do + end do + end do + end do + +end function qmckl_compute_factor_een_deriv_e_f + #+end_src + + #+CALL: generate_c_header(table=qmckl_factor_een_deriv_e_args,rettyp=get_value("CRetType"),fname=get_value("Name")) + + #+RESULTS: + #+begin_src c :tangle (eval h_func) :comments org + qmckl_exit_code qmckl_compute_factor_een_deriv_e ( + const qmckl_context context, + const int64_t walk_num, + const int64_t elec_num, + const int64_t nucl_num, + const int64_t cord_num, + const int64_t dim_cord_vect, + const double* cord_vect_full, + const int64_t* lkpm_combined_index, + const double* tmp_c, + const double* dtmp_c, + const double* een_rescaled_n, + const double* een_rescaled_n_deriv_e, + double* const factor_een_deriv_e ); + #+end_src + + + #+CALL: generate_c_interface(table=qmckl_factor_een_deriv_e_args,rettyp=get_value("CRetType"),fname=get_value("Name")) + + #+RESULTS: + #+begin_src f90 :tangle (eval f) :comments org :exports none + integer(c_int32_t) function qmckl_compute_factor_een_deriv_e & + (context, & + walk_num, & + elec_num, & + nucl_num, & + cord_num, & + dim_cord_vect, & + cord_vect_full, & + lkpm_combined_index, & + tmp_c, & + dtmp_c, & + een_rescaled_n, & + een_rescaled_n_deriv_e, & + factor_een_deriv_e) & + bind(C) result(info) + + use, intrinsic :: iso_c_binding + implicit none + + integer (c_int64_t) , intent(in) , value :: context + integer (c_int64_t) , intent(in) , value :: walk_num + integer (c_int64_t) , intent(in) , value :: elec_num + integer (c_int64_t) , intent(in) , value :: nucl_num + integer (c_int64_t) , intent(in) , value :: cord_num + integer (c_int64_t) , intent(in) , value :: dim_cord_vect + real (c_double ) , intent(in) :: cord_vect_full(nucl_num,dim_cord_vect) + integer (c_int64_t) , intent(in) :: lkpm_combined_index(dim_cord_vect,4) + real (c_double ) , intent(in) :: tmp_c(elec_num,nucl_num,0:cord_num,0:cord_num-1,walk_num) + real (c_double ) , intent(in) :: dtmp_c(elec_num,4,nucl_num,0:cord_num,0:cord_num-1,walk_num) + real (c_double ) , intent(in) :: een_rescaled_n(0:cord_num,nucl_num,elec_num,walk_num) + real (c_double ) , intent(in) :: een_rescaled_n_deriv_e(0:cord_num,nucl_num,4,elec_num,walk_num) + real (c_double ) , intent(out) :: factor_een_deriv_e(elec_num,4,walk_num) + + integer(c_int32_t), external :: qmckl_compute_factor_een_deriv_e_f + info = qmckl_compute_factor_een_deriv_e_f & + (context, & + walk_num, & + elec_num, & + nucl_num, & + cord_num, & + dim_cord_vect, & + cord_vect_full, & + lkpm_combined_index, & + tmp_c, & + dtmp_c, & + een_rescaled_n, & + een_rescaled_n_deriv_e, & + factor_een_deriv_e) + end function qmckl_compute_factor_een_deriv_e #+end_src