From daddb572006ca230cf7096ecaf4ed546c52016a9 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Fri, 31 Mar 2023 13:37:35 +0200 Subject: [PATCH] Total jastrow value --- org/qmckl_jastrow_champ.org | 804 +++++++++++++++++++----------------- 1 file changed, 434 insertions(+), 370 deletions(-) diff --git a/org/qmckl_jastrow_champ.org b/org/qmckl_jastrow_champ.org index 9c0a9f5..970cfdd 100644 --- a/org/qmckl_jastrow_champ.org +++ b/org/qmckl_jastrow_champ.org @@ -2226,7 +2226,7 @@ qmckl_exit_code qmckl_provide_jastrow_champ_factor_ee(qmckl_context context) ctx->jastrow_champ.factor_ee = factor_ee; } - rc = qmckl_compute_factor_ee(context, + rc = qmckl_compute_jastrow_champ_factor_ee(context, ctx->electron.walker.num, ctx->electron.num, ctx->electron.up_num, @@ -2248,7 +2248,7 @@ qmckl_exit_code qmckl_provide_jastrow_champ_factor_ee(qmckl_context context) **** Compute :PROPERTIES: - :Name: qmckl_compute_factor_ee + :Name: qmckl_compute_jastrow_champ_factor_ee :CRetType: qmckl_exit_code :FRetType: qmckl_exit_code :END: @@ -2269,7 +2269,7 @@ qmckl_exit_code qmckl_provide_jastrow_champ_factor_ee(qmckl_context context) # #+CALL: generate_c_interface(table=qmckl_factor_ee_args,rettyp=get_value("CRetType"),fname=get_value("Name")) #+begin_src f90 :comments org :tangle (eval f) :noweb yes -integer function qmckl_compute_factor_ee_doc_f(context, walk_num, elec_num, up_num, bord_num, & +integer function qmckl_compute_jastrow_champ_factor_ee_doc_f(context, walk_num, elec_num, up_num, bord_num, & b_vector, ee_distance_rescaled, asymp_jasb, factor_ee) & result(info) use qmckl @@ -2336,11 +2336,11 @@ integer function qmckl_compute_factor_ee_doc_f(context, walk_num, elec_num, up_n end do end do -end function qmckl_compute_factor_ee_doc_f +end function qmckl_compute_jastrow_champ_factor_ee_doc_f #+end_src #+begin_src f90 :tangle (eval f) :comments org :exports none - integer(c_int32_t) function qmckl_compute_factor_ee_doc & + integer(c_int32_t) function qmckl_compute_jastrow_champ_factor_ee_doc & (context, walk_num, elec_num, up_num, bord_num, b_vector, ee_distance_rescaled, asymp_jasb, factor_ee) & bind(C) result(info) @@ -2357,15 +2357,15 @@ end function qmckl_compute_factor_ee_doc_f real (c_double ) , intent(in) :: asymp_jasb(2) real (c_double ) , intent(out) :: factor_ee(walk_num) - integer(c_int32_t), external :: qmckl_compute_factor_ee_doc_f - info = qmckl_compute_factor_ee_doc_f & + integer(c_int32_t), external :: qmckl_compute_jastrow_champ_factor_ee_doc_f + info = qmckl_compute_jastrow_champ_factor_ee_doc_f & (context, walk_num, elec_num, up_num, bord_num, b_vector, ee_distance_rescaled, asymp_jasb, factor_ee) - end function qmckl_compute_factor_ee_doc + end function qmckl_compute_jastrow_champ_factor_ee_doc #+end_src #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none -qmckl_exit_code qmckl_compute_factor_ee_doc ( +qmckl_exit_code qmckl_compute_jastrow_champ_factor_ee_doc ( const qmckl_context context, const int64_t walk_num, const int64_t elec_num, @@ -2378,7 +2378,7 @@ qmckl_exit_code qmckl_compute_factor_ee_doc ( #+end_src #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none -qmckl_exit_code qmckl_compute_factor_ee_hpc ( +qmckl_exit_code qmckl_compute_jastrow_champ_factor_ee_hpc ( const qmckl_context context, const int64_t walk_num, const int64_t elec_num, @@ -2391,7 +2391,7 @@ qmckl_exit_code qmckl_compute_factor_ee_hpc ( #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes -qmckl_exit_code qmckl_compute_factor_ee_hpc ( +qmckl_exit_code qmckl_compute_jastrow_champ_factor_ee_hpc ( const qmckl_context context, const int64_t walk_num, const int64_t elec_num, @@ -2457,7 +2457,7 @@ qmckl_exit_code qmckl_compute_factor_ee_hpc ( # #+CALL: generate_c_header(table=qmckl_factor_ee_args,rettyp=get_value("CRetType"),fname=get_value("Name")) #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none -qmckl_exit_code qmckl_compute_factor_ee ( +qmckl_exit_code qmckl_compute_jastrow_champ_factor_ee ( const qmckl_context context, const int64_t walk_num, const int64_t elec_num, @@ -2471,7 +2471,7 @@ qmckl_exit_code qmckl_compute_factor_ee ( #+begin_src c :comments org :tangle (eval c) :noweb yes qmckl_exit_code -qmckl_compute_factor_ee (const qmckl_context context, +qmckl_compute_jastrow_champ_factor_ee (const qmckl_context context, const int64_t walk_num, const int64_t elec_num, const int64_t up_num, @@ -2483,11 +2483,11 @@ qmckl_compute_factor_ee (const qmckl_context context, { #ifdef HAVE_HPC - return qmckl_compute_factor_ee_hpc(context, walk_num, elec_num, + return qmckl_compute_jastrow_champ_factor_ee_hpc(context, walk_num, elec_num, up_num, bord_num, b_vector, ee_distance_rescaled, asymp_jasb, factor_ee); #else - return qmckl_compute_factor_ee_doc(context, walk_num, elec_num, + return qmckl_compute_jastrow_champ_factor_ee_doc(context, walk_num, elec_num, up_num, bord_num, b_vector, ee_distance_rescaled, asymp_jasb, factor_ee); #endif @@ -2666,7 +2666,7 @@ qmckl_exit_code qmckl_provide_jastrow_champ_factor_ee_deriv_e(qmckl_context cont ctx->jastrow_champ.factor_ee_deriv_e = factor_ee_deriv_e; } - rc = qmckl_compute_factor_ee_deriv_e(context, + rc = qmckl_compute_jastrow_champ_factor_ee_deriv_e(context, ctx->electron.walker.num, ctx->electron.num, ctx->electron.up_num, @@ -2688,7 +2688,7 @@ qmckl_exit_code qmckl_provide_jastrow_champ_factor_ee_deriv_e(qmckl_context cont **** Compute :PROPERTIES: - :Name: qmckl_compute_factor_ee_deriv_e + :Name: qmckl_compute_jastrow_champ_factor_ee_deriv_e :CRetType: qmckl_exit_code :FRetType: qmckl_exit_code :END: @@ -2707,7 +2707,7 @@ qmckl_exit_code qmckl_provide_jastrow_champ_factor_ee_deriv_e(qmckl_context cont | ~factor_ee_deriv_e~ | ~double[walk_num][4][elec_num]~ | out | Electron-electron distances | #+begin_src f90 :comments org :tangle (eval f) :noweb yes -integer function qmckl_compute_factor_ee_deriv_e_doc_f( & +integer function qmckl_compute_jastrow_champ_factor_ee_deriv_e_doc_f( & context, walk_num, elec_num, up_num, bord_num, & b_vector, ee_distance_rescaled, ee_distance_rescaled_deriv_e, & factor_ee_deriv_e) & @@ -2806,11 +2806,11 @@ integer function qmckl_compute_factor_ee_deriv_e_doc_f( & end do end do -end function qmckl_compute_factor_ee_deriv_e_doc_f +end function qmckl_compute_jastrow_champ_factor_ee_deriv_e_doc_f #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes -qmckl_exit_code qmckl_compute_factor_ee_deriv_e_hpc( +qmckl_exit_code qmckl_compute_jastrow_champ_factor_ee_deriv_e_hpc( const qmckl_context context, const int64_t walk_num, const int64_t elec_num, @@ -2925,7 +2925,7 @@ qmckl_exit_code qmckl_compute_factor_ee_deriv_e_hpc( #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none - qmckl_exit_code qmckl_compute_factor_ee_deriv_e ( + qmckl_exit_code qmckl_compute_jastrow_champ_factor_ee_deriv_e ( const qmckl_context context, const int64_t walk_num, const int64_t elec_num, @@ -2938,11 +2938,11 @@ qmckl_exit_code qmckl_compute_factor_ee_deriv_e_hpc( #+end_src - #+CALL: generate_c_interface(table=qmckl_factor_ee_deriv_e_args,rettyp=get_value("CRetType"),fname="qmckl_compute_factor_ee_deriv_e_doc") + #+CALL: generate_c_interface(table=qmckl_factor_ee_deriv_e_args,rettyp=get_value("CRetType"),fname="qmckl_compute_jastrow_champ_factor_ee_deriv_e_doc") #+RESULTS: #+begin_src f90 :tangle (eval f) :comments org :exports none -integer(c_int32_t) function qmckl_compute_factor_ee_deriv_e_doc & +integer(c_int32_t) function qmckl_compute_jastrow_champ_factor_ee_deriv_e_doc & (context, & walk_num, & elec_num, & @@ -2967,8 +2967,8 @@ integer(c_int32_t) function qmckl_compute_factor_ee_deriv_e_doc & real (c_double ) , intent(in) :: ee_distance_rescaled_deriv_e(elec_num,elec_num,4,walk_num) real (c_double ) , intent(out) :: factor_ee_deriv_e(elec_num,4,walk_num) - integer(c_int32_t), external :: qmckl_compute_factor_ee_deriv_e_doc_f - info = qmckl_compute_factor_ee_deriv_e_doc_f & + integer(c_int32_t), external :: qmckl_compute_jastrow_champ_factor_ee_deriv_e_doc_f + info = qmckl_compute_jastrow_champ_factor_ee_deriv_e_doc_f & (context, & walk_num, & elec_num, & @@ -2979,11 +2979,11 @@ integer(c_int32_t) function qmckl_compute_factor_ee_deriv_e_doc & ee_distance_rescaled_deriv_e, & factor_ee_deriv_e) - end function qmckl_compute_factor_ee_deriv_e_doc + end function qmckl_compute_jastrow_champ_factor_ee_deriv_e_doc #+end_src #+begin_src c :tangle (eval h_private_func) :comments org - qmckl_exit_code qmckl_compute_factor_ee_deriv_e_hpc ( + qmckl_exit_code qmckl_compute_jastrow_champ_factor_ee_deriv_e_hpc ( const qmckl_context context, const int64_t walk_num, const int64_t elec_num, @@ -2997,7 +2997,7 @@ integer(c_int32_t) function qmckl_compute_factor_ee_deriv_e_doc & #+end_src #+begin_src c :tangle (eval h_private_func) :comments org - qmckl_exit_code qmckl_compute_factor_ee_deriv_e_doc ( + qmckl_exit_code qmckl_compute_jastrow_champ_factor_ee_deriv_e_doc ( const qmckl_context context, const int64_t walk_num, const int64_t elec_num, @@ -3011,7 +3011,7 @@ integer(c_int32_t) function qmckl_compute_factor_ee_deriv_e_doc & #+begin_src c :comments org :tangle (eval c) :noweb yes - qmckl_exit_code qmckl_compute_factor_ee_deriv_e ( + qmckl_exit_code qmckl_compute_jastrow_champ_factor_ee_deriv_e ( const qmckl_context context, const int64_t walk_num, const int64_t elec_num, @@ -3023,9 +3023,9 @@ integer(c_int32_t) function qmckl_compute_factor_ee_deriv_e_doc & double* const factor_ee_deriv_e ) { #ifdef HAVE_HPC - return qmckl_compute_factor_ee_deriv_e_hpc(context, walk_num, elec_num, up_num, bord_num, b_vector, ee_distance_rescaled, ee_distance_rescaled_deriv_e, factor_ee_deriv_e ); + return qmckl_compute_jastrow_champ_factor_ee_deriv_e_hpc(context, walk_num, elec_num, up_num, bord_num, b_vector, ee_distance_rescaled, ee_distance_rescaled_deriv_e, factor_ee_deriv_e ); #else - return qmckl_compute_factor_ee_deriv_e_doc(context, walk_num, elec_num, up_num, bord_num, b_vector, ee_distance_rescaled, ee_distance_rescaled_deriv_e, factor_ee_deriv_e ); + return qmckl_compute_jastrow_champ_factor_ee_deriv_e_doc(context, walk_num, elec_num, up_num, bord_num, b_vector, ee_distance_rescaled, ee_distance_rescaled_deriv_e, factor_ee_deriv_e ); #endif } #+end_src @@ -4087,7 +4087,7 @@ qmckl_exit_code qmckl_provide_jastrow_champ_factor_en(qmckl_context context) ctx->jastrow_champ.factor_en = factor_en; } - rc = qmckl_compute_factor_en(context, + rc = qmckl_compute_jastrow_champ_factor_en(context, ctx->electron.walker.num, ctx->electron.num, ctx->nucleus.num, @@ -4111,7 +4111,7 @@ qmckl_exit_code qmckl_provide_jastrow_champ_factor_en(qmckl_context context) **** Compute :PROPERTIES: - :Name: qmckl_compute_factor_en_doc + :Name: qmckl_compute_jastrow_champ_factor_en_doc :CRetType: qmckl_exit_code :FRetType: qmckl_exit_code :END: @@ -4132,7 +4132,7 @@ qmckl_exit_code qmckl_provide_jastrow_champ_factor_en(qmckl_context context) | ~factor_en~ | ~double[walk_num]~ | out | Electron-nucleus jastrow | #+begin_src f90 :comments org :tangle (eval f) :noweb yes -integer function qmckl_compute_factor_en_doc_f( & +integer function qmckl_compute_jastrow_champ_factor_en_doc_f( & context, walk_num, elec_num, nucl_num, type_nucl_num, & type_nucl_vector, aord_num, a_vector, & en_distance_rescaled, asymp_jasa, factor_en) & @@ -4196,14 +4196,14 @@ integer function qmckl_compute_factor_en_doc_f( & end do end do -end function qmckl_compute_factor_en_doc_f +end function qmckl_compute_jastrow_champ_factor_en_doc_f #+end_src #+CALL: generate_c_interface(table=qmckl_factor_en_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_en_doc & + integer(c_int32_t) function qmckl_compute_jastrow_champ_factor_en_doc & (context, & walk_num, & elec_num, & @@ -4232,8 +4232,8 @@ end function qmckl_compute_factor_en_doc_f real (c_double ) , intent(in) :: asymp_jasa(type_nucl_num) real (c_double ) , intent(out) :: factor_en(walk_num) - integer(c_int32_t), external :: qmckl_compute_factor_en_doc_f - info = qmckl_compute_factor_en_doc_f & + integer(c_int32_t), external :: qmckl_compute_jastrow_champ_factor_en_doc_f + info = qmckl_compute_jastrow_champ_factor_en_doc_f & (context, & walk_num, & elec_num, & @@ -4246,12 +4246,12 @@ end function qmckl_compute_factor_en_doc_f asymp_jasa, & factor_en) - end function qmckl_compute_factor_en_doc + end function qmckl_compute_jastrow_champ_factor_en_doc #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes /* -qmckl_exit_code qmckl_compute_factor_en ( +qmckl_exit_code qmckl_compute_jastrow_champ_factor_en ( const qmckl_context context, const int64_t walk_num, const int64_t elec_num, @@ -4341,7 +4341,7 @@ qmckl_exit_code qmckl_compute_factor_en ( #+RESULTS: #+begin_src c :tangle (eval h_func) :comments org -qmckl_exit_code qmckl_compute_factor_en ( +qmckl_exit_code qmckl_compute_jastrow_champ_factor_en ( const qmckl_context context, const int64_t walk_num, const int64_t elec_num, @@ -4354,7 +4354,7 @@ qmckl_exit_code qmckl_compute_factor_en ( const double* asymp_jasa, double* const factor_en ); -qmckl_exit_code qmckl_compute_factor_en_doc ( +qmckl_exit_code qmckl_compute_jastrow_champ_factor_en_doc ( const qmckl_context context, const int64_t walk_num, const int64_t elec_num, @@ -4369,7 +4369,7 @@ qmckl_exit_code qmckl_compute_factor_en_doc ( #+end_src #+begin_src c :tangle (eval c) :comments org -qmckl_exit_code qmckl_compute_factor_en ( +qmckl_exit_code qmckl_compute_jastrow_champ_factor_en ( const qmckl_context context, const int64_t walk_num, const int64_t elec_num, @@ -4383,11 +4383,11 @@ qmckl_exit_code qmckl_compute_factor_en ( double* const factor_en ) { #ifdef HAVE_HPC - return qmckl_compute_factor_en_doc (context, walk_num, elec_num, nucl_num, type_nucl_num, + return qmckl_compute_jastrow_champ_factor_en_doc (context, walk_num, elec_num, nucl_num, type_nucl_num, type_nucl_vector, aord_num, a_vector, en_distance_rescaled, asymp_jasa, factor_en ); #else - return qmckl_compute_factor_en_doc (context, walk_num, elec_num, nucl_num, type_nucl_num, + return qmckl_compute_jastrow_champ_factor_en_doc (context, walk_num, elec_num, nucl_num, type_nucl_num, type_nucl_vector, aord_num, a_vector, en_distance_rescaled, asymp_jasa, factor_en ); #endif @@ -4548,7 +4548,7 @@ qmckl_exit_code qmckl_provide_jastrow_champ_factor_en_deriv_e(qmckl_context cont ctx->jastrow_champ.factor_en_deriv_e = factor_en_deriv_e; } - rc = qmckl_compute_factor_en_deriv_e(context, + rc = qmckl_compute_jastrow_champ_factor_en_deriv_e(context, ctx->electron.walker.num, ctx->electron.num, ctx->nucleus.num, @@ -4572,7 +4572,7 @@ qmckl_exit_code qmckl_provide_jastrow_champ_factor_en_deriv_e(qmckl_context cont **** Compute :PROPERTIES: - :Name: qmckl_compute_factor_en_deriv_e + :Name: qmckl_compute_jastrow_champ_factor_en_deriv_e :CRetType: qmckl_exit_code :FRetType: qmckl_exit_code :END: @@ -4593,7 +4593,7 @@ qmckl_exit_code qmckl_provide_jastrow_champ_factor_en_deriv_e(qmckl_context cont | ~factor_en_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_en_deriv_e_f( & +integer function qmckl_compute_jastrow_champ_factor_en_deriv_e_f( & context, walk_num, elec_num, nucl_num, type_nucl_num, & type_nucl_vector, aord_num, a_vector, & en_distance_rescaled, en_distance_rescaled_deriv_e, factor_en_deriv_e) & @@ -4691,13 +4691,13 @@ integer function qmckl_compute_factor_en_deriv_e_f( & end do end do -end function qmckl_compute_factor_en_deriv_e_f +end function qmckl_compute_jastrow_champ_factor_en_deriv_e_f #+end_src # #+CALL: generate_c_header(table=qmckl_factor_en_deriv_e_args,rettyp=get_value("CRetType"),fname=get_value("Name")) #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none - qmckl_exit_code qmckl_compute_factor_en_deriv_e ( + qmckl_exit_code qmckl_compute_jastrow_champ_factor_en_deriv_e ( const qmckl_context context, const int64_t walk_num, const int64_t elec_num, @@ -4716,7 +4716,7 @@ end function qmckl_compute_factor_en_deriv_e_f #+RESULTS: #+begin_src f90 :tangle (eval f) :comments org :exports none - integer(c_int32_t) function qmckl_compute_factor_en_deriv_e & + integer(c_int32_t) function qmckl_compute_jastrow_champ_factor_en_deriv_e & (context, & walk_num, & elec_num, & @@ -4745,8 +4745,8 @@ end function qmckl_compute_factor_en_deriv_e_f real (c_double ) , intent(in) :: en_distance_rescaled_deriv_e(elec_num,nucl_num,4,walk_num) real (c_double ) , intent(out) :: factor_en_deriv_e(elec_num,4,walk_num) - integer(c_int32_t), external :: qmckl_compute_factor_en_deriv_e_f - info = qmckl_compute_factor_en_deriv_e_f & + integer(c_int32_t), external :: qmckl_compute_jastrow_champ_factor_en_deriv_e_f + info = qmckl_compute_jastrow_champ_factor_en_deriv_e_f & (context, & walk_num, & elec_num, & @@ -4759,7 +4759,7 @@ end function qmckl_compute_factor_en_deriv_e_f en_distance_rescaled_deriv_e, & factor_en_deriv_e) - end function qmckl_compute_factor_en_deriv_e + end function qmckl_compute_jastrow_champ_factor_en_deriv_e #+end_src **** Test @@ -6117,7 +6117,7 @@ qmckl_exit_code qmckl_provide_een_rescaled_e_deriv_e(qmckl_context context) ctx->jastrow_champ.een_rescaled_e_deriv_e = een_rescaled_e_deriv_e; } - rc = qmckl_compute_factor_een_rescaled_e_deriv_e(context, + rc = qmckl_compute_jastrow_champ_factor_een_rescaled_e_deriv_e(context, ctx->electron.walker.num, ctx->electron.num, ctx->jastrow_champ.cord_num, @@ -6139,7 +6139,7 @@ qmckl_exit_code qmckl_provide_een_rescaled_e_deriv_e(qmckl_context context) **** Compute :PROPERTIES: - :Name: qmckl_compute_factor_een_rescaled_e_deriv_e + :Name: qmckl_compute_jastrow_champ_factor_een_rescaled_e_deriv_e :CRetType: qmckl_exit_code :FRetType: qmckl_exit_code :END: @@ -6158,7 +6158,7 @@ qmckl_exit_code qmckl_provide_een_rescaled_e_deriv_e(qmckl_context context) | ~een_rescaled_e_deriv_e~ | ~double[walk_num][0:cord_num][elec_num][4][elec_num]~ | out | Electron-electron rescaled distances | #+begin_src f90 :comments org :tangle (eval f) :noweb yes -integer function qmckl_compute_factor_een_rescaled_e_deriv_e_f( & +integer function qmckl_compute_jastrow_champ_factor_een_rescaled_e_deriv_e_f( & context, walk_num, elec_num, cord_num, rescale_factor_ee, & coord_ee, ee_distance, een_rescaled_e, een_rescaled_e_deriv_e) & result(info) @@ -6243,13 +6243,13 @@ integer function qmckl_compute_factor_een_rescaled_e_deriv_e_f( & end do end do -end function qmckl_compute_factor_een_rescaled_e_deriv_e_f +end function qmckl_compute_jastrow_champ_factor_een_rescaled_e_deriv_e_f #+end_src # #+CALL: generate_c_header(table=qmckl_factor_een_rescaled_e_deriv_e_args,rettyp=get_value("CRetType"),fname=get_value("Name")) #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none - qmckl_exit_code qmckl_compute_factor_een_rescaled_e_deriv_e ( + qmckl_exit_code qmckl_compute_jastrow_champ_factor_een_rescaled_e_deriv_e ( const qmckl_context context, const int64_t walk_num, const int64_t elec_num, @@ -6266,7 +6266,7 @@ end function qmckl_compute_factor_een_rescaled_e_deriv_e_f #+RESULTS: #+begin_src f90 :tangle (eval f) :comments org :exports none - integer(c_int32_t) function qmckl_compute_factor_een_rescaled_e_deriv_e & + integer(c_int32_t) function qmckl_compute_jastrow_champ_factor_een_rescaled_e_deriv_e & (context, & walk_num, & elec_num, & @@ -6291,8 +6291,8 @@ end function qmckl_compute_factor_een_rescaled_e_deriv_e_f real (c_double ) , intent(in) :: een_rescaled_e(elec_num,elec_num,0:cord_num,walk_num) real (c_double ) , intent(out) :: een_rescaled_e_deriv_e(elec_num,4,elec_num,0:cord_num,walk_num) - integer(c_int32_t), external :: qmckl_compute_factor_een_rescaled_e_deriv_e_f - info = qmckl_compute_factor_een_rescaled_e_deriv_e_f & + integer(c_int32_t), external :: qmckl_compute_jastrow_champ_factor_een_rescaled_e_deriv_e_f + info = qmckl_compute_jastrow_champ_factor_een_rescaled_e_deriv_e_f & (context, & walk_num, & elec_num, & @@ -6303,7 +6303,7 @@ end function qmckl_compute_factor_een_rescaled_e_deriv_e_f een_rescaled_e, & een_rescaled_e_deriv_e) - end function qmckl_compute_factor_een_rescaled_e_deriv_e + end function qmckl_compute_jastrow_champ_factor_een_rescaled_e_deriv_e #+end_src **** Test @@ -6924,7 +6924,7 @@ qmckl_exit_code qmckl_provide_een_rescaled_n_deriv_e(qmckl_context context) ctx->jastrow_champ.een_rescaled_n_deriv_e = een_rescaled_n_deriv_e; } - rc = qmckl_compute_factor_een_rescaled_n_deriv_e(context, + rc = qmckl_compute_jastrow_champ_factor_een_rescaled_n_deriv_e(context, ctx->electron.walker.num, ctx->electron.num, ctx->nucleus.num, @@ -6950,12 +6950,12 @@ qmckl_exit_code qmckl_provide_een_rescaled_n_deriv_e(qmckl_context context) **** Compute :PROPERTIES: - :Name: qmckl_compute_factor_een_rescaled_n_deriv_e + :Name: qmckl_compute_jastrow_champ_factor_een_rescaled_n_deriv_e :CRetType: qmckl_exit_code :FRetType: qmckl_exit_code :END: - #+NAME: qmckl_compute_factor_een_rescaled_n_deriv_e_args + #+NAME: qmckl_compute_jastrow_champ_factor_een_rescaled_n_deriv_e_args | Variable | Type | In/Out | Description | |--------------------------+-------------------------------------------------------+--------+-------------------------------------| | ~context~ | ~qmckl_context~ | in | Global state | @@ -6973,7 +6973,7 @@ qmckl_exit_code qmckl_provide_een_rescaled_n_deriv_e(qmckl_context context) | ~een_rescaled_n_deriv_e~ | ~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 -integer function qmckl_compute_factor_een_rescaled_n_deriv_e_f( & +integer function qmckl_compute_jastrow_champ_factor_een_rescaled_n_deriv_e_f( & context, walk_num, elec_num, nucl_num, type_nucl_num, type_nucl_vector, & cord_num, rescale_factor_en, & coord_ee, coord_en, en_distance, een_rescaled_n, een_rescaled_n_deriv_e) & @@ -7068,13 +7068,13 @@ integer function qmckl_compute_factor_een_rescaled_n_deriv_e_f( & end do end do -end function qmckl_compute_factor_een_rescaled_n_deriv_e_f +end function qmckl_compute_jastrow_champ_factor_een_rescaled_n_deriv_e_f #+end_src - # #+CALL: generate_c_header(table=qmckl_compute_factor_een_rescaled_n_deriv_e_args,rettyp=get_value("CRetType"),fname=get_value("Name")) + # #+CALL: generate_c_header(table=qmckl_compute_jastrow_champ_factor_een_rescaled_n_deriv_e_args,rettyp=get_value("CRetType"),fname=get_value("Name")) #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none - qmckl_exit_code qmckl_compute_factor_een_rescaled_n_deriv_e ( + qmckl_exit_code qmckl_compute_jastrow_champ_factor_een_rescaled_n_deriv_e ( const qmckl_context context, const int64_t walk_num, const int64_t elec_num, @@ -7090,11 +7090,11 @@ end function qmckl_compute_factor_een_rescaled_n_deriv_e_f double* const een_rescaled_n_deriv_e ); #+end_src - #+CALL: generate_c_interface(table=qmckl_compute_factor_een_rescaled_n_deriv_e_args,rettyp=get_value("CRetType"),fname=get_value("Name")) + #+CALL: generate_c_interface(table=qmckl_compute_jastrow_champ_factor_een_rescaled_n_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_rescaled_n_deriv_e & + integer(c_int32_t) function qmckl_compute_jastrow_champ_factor_een_rescaled_n_deriv_e & (context, & walk_num, & elec_num, & @@ -7127,8 +7127,8 @@ end function qmckl_compute_factor_een_rescaled_n_deriv_e_f 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_deriv_e(elec_num,4,nucl_num,0:cord_num,walk_num) - integer(c_int32_t), external :: qmckl_compute_factor_een_rescaled_n_deriv_e_f - info = qmckl_compute_factor_een_rescaled_n_deriv_e_f & + integer(c_int32_t), external :: qmckl_compute_jastrow_champ_factor_een_rescaled_n_deriv_e_f + info = qmckl_compute_jastrow_champ_factor_een_rescaled_n_deriv_e_f & (context, & walk_num, & elec_num, & @@ -7143,7 +7143,7 @@ end function qmckl_compute_factor_een_rescaled_n_deriv_e_f een_rescaled_n, & een_rescaled_n_deriv_e) - end function qmckl_compute_factor_een_rescaled_n_deriv_e + end function qmckl_compute_jastrow_champ_factor_een_rescaled_n_deriv_e #+end_src **** Test @@ -8553,7 +8553,7 @@ qmckl_get_jastrow_champ_factor_een(qmckl_context context, qmckl_exit_code rc; - rc = qmckl_provide_factor_een(context); + rc = qmckl_provide_jastrow_champ_factor_een(context); if (rc != QMCKL_SUCCESS) return rc; qmckl_context_struct* const ctx = (qmckl_context_struct*) context; @@ -8590,11 +8590,11 @@ end interface **** Provide :noexport: #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none -qmckl_exit_code qmckl_provide_factor_een(qmckl_context context); +qmckl_exit_code qmckl_provide_jastrow_champ_factor_een(qmckl_context context); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none -qmckl_exit_code qmckl_provide_factor_een(qmckl_context context) +qmckl_exit_code qmckl_provide_jastrow_champ_factor_een(qmckl_context context) { qmckl_exit_code rc; @@ -8634,7 +8634,7 @@ qmckl_exit_code qmckl_provide_factor_een(qmckl_context context) rc = qmckl_free(context, ctx->jastrow_champ.factor_een); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, - "qmckl_provide_factor_een", + "qmckl_provide_jastrow_champ_factor_een", "Unable to free ctx->jastrow_champ.factor_een"); } ctx->jastrow_champ.factor_een = NULL; @@ -8651,13 +8651,13 @@ qmckl_exit_code qmckl_provide_factor_een(qmckl_context context) if (factor_een == NULL) { return qmckl_failwith( context, QMCKL_ALLOCATION_FAILED, - "qmckl_provide_factor_een", + "qmckl_provide_jastrow_champ_factor_een", NULL); } ctx->jastrow_champ.factor_een = factor_een; } - rc = qmckl_compute_factor_een(context, + rc = qmckl_compute_jastrow_champ_factor_een(context, ctx->electron.walker.num, ctx->electron.num, ctx->nucleus.num, @@ -8681,7 +8681,7 @@ qmckl_exit_code qmckl_provide_factor_een(qmckl_context context) **** Compute naive :PROPERTIES: - :Name: qmckl_compute_factor_een_naive + :Name: qmckl_compute_jastrow_champ_factor_een_naive :CRetType: qmckl_exit_code :FRetType: qmckl_exit_code :END: @@ -8702,7 +8702,7 @@ qmckl_exit_code qmckl_provide_factor_een(qmckl_context context) | ~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_naive_f( & +integer function qmckl_compute_jastrow_champ_factor_een_naive_f( & context, walk_num, elec_num, nucl_num, cord_num,& dim_c_vector, c_vector_full, lkpm_combined_index, & een_rescaled_e, een_rescaled_n, factor_een) & @@ -8776,13 +8776,13 @@ integer function qmckl_compute_factor_een_naive_f( & end do end do -end function qmckl_compute_factor_een_naive_f +end function qmckl_compute_jastrow_champ_factor_een_naive_f #+end_src # #+CALL: generate_c_header(table=qmckl_factor_een_naive_args,rettyp=get_value("CRetType"),fname=get_value("Name")) #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none - qmckl_exit_code qmckl_compute_factor_een_naive ( + qmckl_exit_code qmckl_compute_jastrow_champ_factor_een_naive ( const qmckl_context context, const int64_t walk_num, const int64_t elec_num, @@ -8800,7 +8800,7 @@ end function qmckl_compute_factor_een_naive_f #+RESULTS: #+begin_src f90 :tangle (eval f) :comments org :exports none - integer(c_int32_t) function qmckl_compute_factor_een_naive & + integer(c_int32_t) function qmckl_compute_jastrow_champ_factor_een_naive & (context, & walk_num, & elec_num, & @@ -8829,8 +8829,8 @@ end function qmckl_compute_factor_een_naive_f 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 & + integer(c_int32_t), external :: qmckl_compute_jastrow_champ_factor_een_naive_f + info = qmckl_compute_jastrow_champ_factor_een_naive_f & (context, & walk_num, & elec_num, & @@ -8843,12 +8843,12 @@ end function qmckl_compute_factor_een_naive_f een_rescaled_n, & factor_een) - end function qmckl_compute_factor_een_naive + end function qmckl_compute_jastrow_champ_factor_een_naive #+end_src **** Compute :PROPERTIES: - :Name: qmckl_compute_factor_een_doc + :Name: qmckl_compute_jastrow_champ_factor_een_doc :CRetType: qmckl_exit_code :FRetType: qmckl_exit_code :END: @@ -8869,7 +8869,7 @@ end function qmckl_compute_factor_een_naive_f | ~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_doc_f( & +integer function qmckl_compute_jastrow_champ_factor_een_doc_f( & context, walk_num, elec_num, nucl_num, cord_num, & dim_c_vector, c_vector_full, lkpm_combined_index, & tmp_c, een_rescaled_n, factor_een) & @@ -8936,14 +8936,14 @@ integer function qmckl_compute_factor_een_doc_f( & end do end do -end function qmckl_compute_factor_een_doc_f +end function qmckl_compute_jastrow_champ_factor_een_doc_f #+end_src # #+CALL: generate_c_header(table=qmckl_factor_een_args,rettyp=qmckl_exit_code),fname=get_value("Name")) #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none qmckl_exit_code -qmckl_compute_factor_een_doc (const qmckl_context context, +qmckl_compute_jastrow_champ_factor_een_doc (const qmckl_context context, const int64_t walk_num, const int64_t elec_num, const int64_t nucl_num, @@ -8956,7 +8956,7 @@ qmckl_compute_factor_een_doc (const qmckl_context context, double* const factor_een ); qmckl_exit_code -qmckl_compute_factor_een (const qmckl_context context, +qmckl_compute_jastrow_champ_factor_een (const qmckl_context context, const int64_t walk_num, const int64_t elec_num, const int64_t nucl_num, @@ -8971,7 +8971,7 @@ qmckl_compute_factor_een (const qmckl_context context, #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none qmckl_exit_code -qmckl_compute_factor_een (const qmckl_context context, +qmckl_compute_jastrow_champ_factor_een (const qmckl_context context, const int64_t walk_num, const int64_t elec_num, const int64_t nucl_num, @@ -8984,21 +8984,21 @@ qmckl_compute_factor_een (const qmckl_context context, double* const factor_een ) { #ifdef HAVE_HPC - return qmckl_compute_factor_een_doc (context, walk_num, elec_num, nucl_num, cord_num, dim_c_vector, + return qmckl_compute_jastrow_champ_factor_een_doc (context, walk_num, elec_num, nucl_num, cord_num, dim_c_vector, c_vector_full, lkpm_combined_index, een_rescaled_e, een_rescaled_n, factor_een ); #else - return qmckl_compute_factor_een_doc (context, walk_num, elec_num, nucl_num, cord_num, dim_c_vector, + return qmckl_compute_jastrow_champ_factor_een_doc (context, walk_num, elec_num, nucl_num, cord_num, dim_c_vector, c_vector_full, lkpm_combined_index, een_rescaled_e, een_rescaled_n, factor_een ); #endif } #+end_src - #+CALL: generate_c_interface(table=qmckl_factor_een_args,rettyp=get_value("CRetType"),fname="qmckl_compute_factor_een_doc")) + #+CALL: generate_c_interface(table=qmckl_factor_een_args,rettyp=get_value("CRetType"),fname="qmckl_compute_jastrow_champ_factor_een_doc")) #+RESULTS: #+begin_src f90 :tangle (eval f) :comments org :exports none - integer(c_int32_t) function qmckl_compute_factor_een_doc & + integer(c_int32_t) function qmckl_compute_jastrow_champ_factor_een_doc & (context, & walk_num, & elec_num, & @@ -9027,8 +9027,8 @@ qmckl_compute_factor_een (const qmckl_context context, real (c_double ) , intent(in) :: een_rescaled_n(elec_num,nucl_num,0:cord_num,walk_num) real (c_double ) , intent(out) :: factor_een(walk_num) - integer(c_int32_t), external :: qmckl_compute_factor_een_doc_f - info = qmckl_compute_factor_een_doc_f & + integer(c_int32_t), external :: qmckl_compute_jastrow_champ_factor_een_doc_f + info = qmckl_compute_jastrow_champ_factor_een_doc_f & (context, & walk_num, & elec_num, & @@ -9041,7 +9041,7 @@ qmckl_compute_factor_een (const qmckl_context context, een_rescaled_n, & factor_een) - end function qmckl_compute_factor_een_doc + end function qmckl_compute_jastrow_champ_factor_een_doc #+end_src @@ -9118,7 +9118,7 @@ qmckl_get_jastrow_champ_factor_een_deriv_e(qmckl_context context, qmckl_exit_code rc; - rc = qmckl_provide_factor_een_deriv_e(context); + rc = qmckl_provide_jastrow_champ_factor_een_deriv_e(context); if (rc != QMCKL_SUCCESS) return rc; qmckl_context_struct* const ctx = (qmckl_context_struct*) context; @@ -9139,11 +9139,11 @@ qmckl_get_jastrow_champ_factor_een_deriv_e(qmckl_context context, **** Provide :noexport: #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none -qmckl_exit_code qmckl_provide_factor_een_deriv_e(qmckl_context context); +qmckl_exit_code qmckl_provide_jastrow_champ_factor_een_deriv_e(qmckl_context context); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none -qmckl_exit_code qmckl_provide_factor_een_deriv_e(qmckl_context context) +qmckl_exit_code qmckl_provide_jastrow_champ_factor_een_deriv_e(qmckl_context context) { qmckl_exit_code rc; @@ -9195,7 +9195,7 @@ qmckl_exit_code qmckl_provide_factor_een_deriv_e(qmckl_context context) rc = qmckl_free(context, ctx->jastrow_champ.factor_een_deriv_e); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, - "qmckl_provide_factor_een_deriv_e", + "qmckl_provide_jastrow_champ_factor_een_deriv_e", "Unable to free ctx->jastrow_champ.factor_een_deriv_e"); } ctx->jastrow_champ.factor_een_deriv_e = NULL; @@ -9212,13 +9212,13 @@ qmckl_exit_code qmckl_provide_factor_een_deriv_e(qmckl_context context) if (factor_een_deriv_e == NULL) { return qmckl_failwith( context, QMCKL_ALLOCATION_FAILED, - "qmckl_provide_factor_een_deriv_e", + "qmckl_provide_jastrow_champ_factor_een_deriv_e", NULL); } ctx->jastrow_champ.factor_een_deriv_e = factor_een_deriv_e; } - rc = qmckl_compute_factor_een_deriv_e(context, + rc = qmckl_compute_jastrow_champ_factor_een_deriv_e(context, ctx->electron.walker.num, ctx->electron.num, ctx->nucleus.num, @@ -9244,7 +9244,7 @@ qmckl_exit_code qmckl_provide_factor_een_deriv_e(qmckl_context context) **** Compute Naive :PROPERTIES: - :Name: qmckl_compute_factor_een_deriv_e_naive + :Name: qmckl_compute_jastrow_champ_factor_een_deriv_e_naive :CRetType: qmckl_exit_code :FRetType: qmckl_exit_code :END: @@ -9267,7 +9267,7 @@ 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_naive_f( & +integer function qmckl_compute_jastrow_champ_factor_een_deriv_e_naive_f( & context, walk_num, elec_num, nucl_num, cord_num, dim_c_vector, & c_vector_full, lkpm_combined_index, een_rescaled_e, een_rescaled_n, & een_rescaled_e_deriv_e, een_rescaled_n_deriv_e, factor_een_deriv_e)& @@ -9360,13 +9360,13 @@ integer function qmckl_compute_factor_een_deriv_e_naive_f( & end do end do -end function qmckl_compute_factor_een_deriv_e_naive_f +end function qmckl_compute_jastrow_champ_factor_een_deriv_e_naive_f #+end_src # #+CALL: generate_c_header(table=qmckl_factor_een_deriv_e_naive_args,rettyp=get_value("CRetType"),fname=get_value("Name")) #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none - qmckl_exit_code qmckl_compute_factor_een_deriv_e_naive ( + qmckl_exit_code qmckl_compute_jastrow_champ_factor_een_deriv_e_naive ( const qmckl_context context, const int64_t walk_num, const int64_t elec_num, @@ -9387,7 +9387,7 @@ end function qmckl_compute_factor_een_deriv_e_naive_f #+RESULTS: #+begin_src f90 :tangle (eval f) :comments org :exports none - integer(c_int32_t) function qmckl_compute_factor_een_deriv_e_naive & + integer(c_int32_t) function qmckl_compute_jastrow_champ_factor_een_deriv_e_naive & (context, & walk_num, & elec_num, & @@ -9420,8 +9420,8 @@ end function qmckl_compute_factor_een_deriv_e_naive_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_naive_f - info = qmckl_compute_factor_een_deriv_e_naive_f & + integer(c_int32_t), external :: qmckl_compute_jastrow_champ_factor_een_deriv_e_naive_f + info = qmckl_compute_jastrow_champ_factor_een_deriv_e_naive_f & (context, & walk_num, & elec_num, & @@ -9436,12 +9436,12 @@ end function qmckl_compute_factor_een_deriv_e_naive_f een_rescaled_n_deriv_e, & factor_een_deriv_e) - end function qmckl_compute_factor_een_deriv_e_naive + end function qmckl_compute_jastrow_champ_factor_een_deriv_e_naive #+end_src **** Compute :PROPERTIES: - :Name: qmckl_compute_factor_een_deriv_e + :Name: qmckl_compute_jastrow_champ_factor_een_deriv_e :CRetType: qmckl_exit_code :FRetType: qmckl_exit_code :END: @@ -9465,7 +9465,7 @@ end function qmckl_compute_factor_een_deriv_e_naive_f #+begin_src f90 :comments org :tangle (eval f) :noweb yes -integer function qmckl_compute_factor_een_deriv_e_f( & +integer function qmckl_compute_jastrow_champ_factor_een_deriv_e_f( & context, walk_num, elec_num, nucl_num, & cord_num, dim_c_vector, c_vector_full, lkpm_combined_index, & tmp_c, dtmp_c, een_rescaled_n, een_rescaled_n_deriv_e, factor_een_deriv_e)& @@ -9551,13 +9551,13 @@ integer function qmckl_compute_factor_een_deriv_e_f( & end do end do -end function qmckl_compute_factor_een_deriv_e_f +end function qmckl_compute_jastrow_champ_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")) #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none - qmckl_exit_code qmckl_compute_factor_een_deriv_e ( + qmckl_exit_code qmckl_compute_jastrow_champ_factor_een_deriv_e ( const qmckl_context context, const int64_t walk_num, const int64_t elec_num, @@ -9578,7 +9578,7 @@ end function qmckl_compute_factor_een_deriv_e_f #+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_jastrow_champ_factor_een_deriv_e & (context, & walk_num, & elec_num, & @@ -9611,8 +9611,8 @@ end function qmckl_compute_factor_een_deriv_e_f real (c_double ) , intent(in) :: een_rescaled_n_deriv_e(elec_num,4,nucl_num,0:cord_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_jastrow_champ_factor_een_deriv_e_f + info = qmckl_compute_jastrow_champ_factor_een_deriv_e_f & (context, & walk_num, & elec_num, & @@ -9627,7 +9627,7 @@ 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 + end function qmckl_compute_jastrow_champ_factor_een_deriv_e #+end_src **** Test @@ -9692,280 +9692,344 @@ rc = qmckl_get_jastrow_champ_factor_een_deriv_e(context, &(factor_een_deriv_e[0] assert(fabs(factor_een_deriv_e[0][0][0] + 0.0005481671107226865) < 1e-12); #+end_src -** Total Jastrow value - :PROPERTIES: - :Name: qmckl_compute_jastrow_champ_value_doc - :CRetType: qmckl_exit_code - :FRetType: qmckl_exit_code - :END: +** Total Jastrow + +*** Value - Value of the total Jastrow factor. + Value of the total Jastrow factor: $\exp(J)$ -*** Reference version +**** Get - #+NAME: qmckl_jastrow_champ_value_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 | - | ~up_num~ | ~int64_t~ | in | Number of $\alpha$ electrons | - | ~nucl_num~ | ~int64_t~ | in | Number of nuclei | - | ~type_nucl_num~ | ~int64_t~ | in | Number of unique nuclei | - | ~type_nucl_vector~ | ~int64_t[nucl_num]~ | in | IDs of unique nuclei | - | ~dim_c_vector~ | ~int64_t~ | in | Dimension of full coefficient vector | - | ~aord_num~ | ~int64_t~ | in | Number of $a$ coefficients | - | ~bord_num~ | ~int64_t~ | in | Number of $b$ coefficients | - | ~cord_num~ | ~int64_t~ | in | Order of polynomials | - | ~a_vector~ | ~double[aord_num+1][type_nucl_num]~ | in | List of coefficients for $a$ parameters | - | ~b_vector~ | ~double[bord_num+1]~ | in | List of coefficients for $b$ parameters | - | ~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 | - | ~tmp_c~ | ~double[walk_num][0:cord_num-1][0:cord_num][nucl_num][elec_num]~ | in | Vector of non-zero coefficients | - | ~ee_distance_rescaled~ | ~double[walk_num][elec_num][elec_num]~ | in | Electron-electron distances | - | ~en_distance_rescaled~ | ~double[walk_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 rescaled distances | - | ~asymp_jasa~ | ~double[type_nucl_num]~ | in | Type of nuclei | - | ~asymp_jasb~ | ~double[2]~ | in | Asymptotic value of the Jastrow | - | ~factor_ee~ | ~double[walk_num]~ | out | $f_{ee}$ | + #+begin_src c :comments org :tangle (eval h_func) :noweb yes +qmckl_exit_code +qmckl_get_jastrow_champ_value(qmckl_context context, + double* const value, + const int64_t size_max); + #+end_src - #+begin_src f90 :comments org :tangle (eval f) :noweb yes -integer function qmckl_compute_jastrow_champ_value_doc_f(context, & - walk_num, elec_num, up_num, nucl_num, type_nucl_num, type_nucl_vector, & - dim_c_vector, aord_num, bord_num, cord_num, a_vector, b_vector, & - c_vector_full, lkpm_combined_index, tmp_c, ee_distance_rescaled, & - en_distance_rescaled, een_rescaled_n, asymp_jasa, asymp_jasb, & - val) & - result(info) - use qmckl - implicit none - - integer(qmckl_context), intent(in) :: context - integer*8 , intent(in) :: walk_num, elec_num, up_num, nucl_num - integer*8 , intent(in) :: type_nucl_num, dim_c_vector - integer*8 , intent(in) :: type_nucl_vector(nucl_num) - integer*8 , intent(in) :: aord_num, bord_num, cord_num - double precision , intent(in) :: a_vector(type_nucl_num, aord_num + 1) - double precision , intent(in) :: b_vector(bord_num + 1) - double precision , intent(in) :: c_vector_full(nucl_num, dim_c_vector) - integer*8 , intent(in) :: lkpm_combined_index(dim_c_vector,4) - double precision , intent(in) :: tmp_c(elec_num, nucl_num,0:cord_num, 0:cord_num-1, walk_num) - double precision , intent(in) :: ee_distance_rescaled(elec_num, elec_num, walk_num) - double precision , intent(in) :: en_distance_rescaled(elec_num, nucl_num, walk_num) - double precision , intent(in) :: een_rescaled_n(elec_num, nucl_num, 0:cord_num, walk_num) - double precision , intent(in) :: asymp_jasa(type_nucl_num), asymp_jasb(2) - double precision , intent(out) :: val(walk_num) + #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none +qmckl_exit_code +qmckl_get_jastrow_champ_value(qmckl_context context, + double* const value, + const int64_t size_max) +{ + qmckl_exit_code rc; - integer :: iwalk - double precision, allocatable :: v(:), gl(:,:,:) + if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { + return qmckl_failwith( context, + QMCKL_INVALID_CONTEXT, + "qmckl_get_jastrow_champ_value", + NULL); + } - integer, external :: qmckl_compute_factor_ee_doc_f - integer, external :: qmckl_compute_factor_en_doc_f - integer, external :: qmckl_compute_factor_een_doc_f - - allocate(v(walk_num)) + qmckl_context_struct* const ctx = (qmckl_context_struct*) context; + assert (ctx != NULL); - info = qmckl_compute_factor_ee_doc_f(context, walk_num, elec_num, up_num, bord_num, & - b_vector, ee_distance_rescaled, asymp_jasb, val) - if (info /= QMCKL_SUCCESS) return + rc = qmckl_provide_jastrow_champ_value(context); + if (rc != QMCKL_SUCCESS) return rc; - info = qmckl_compute_factor_en_doc_f(context, walk_num, elec_num, nucl_num, type_nucl_num, & - type_nucl_vector, aord_num, a_vector, en_distance_rescaled, asymp_jasa, v) - if (info /= QMCKL_SUCCESS) return + int64_t sze=ctx->electron.walker.num; + if (size_max < sze) { + return qmckl_failwith( context, + QMCKL_INVALID_ARG_3, + "qmckl_get_jastrow_champ_value", + "Array too small. Expected walker.num"); + } + memcpy(value, ctx->jastrow_champ.value, sze*sizeof(double)); - val(1:walk_num) = val(1:walk_num) + v(1:walk_num) + return QMCKL_SUCCESS; +} + #+end_src - info = qmckl_compute_factor_een_doc_f(context, walk_num, elec_num, nucl_num, cord_num, & - dim_c_vector, c_vector_full, lkpm_combined_index, tmp_c, een_rescaled_n, v) - if (info /= QMCKL_SUCCESS) return +***** Fortran interface - val(1:walk_num) = val(1:walk_num) + v(1:walk_num) - - deallocate(v,gl) -end function qmckl_compute_jastrow_champ_value_doc_f - #+end_src - - #+CALL: generate_private_c_header(table=qmckl_jastrow_champ_value_args,rettyp="qmckl_exit_code",fname="qmckl_compute_jastrow_champ_value_doc") - - #+RESULTS: - #+begin_src c :tangle (eval h_private_func) :comments org - qmckl_exit_code qmckl_compute_jastrow_champ_value_doc ( - const qmckl_context context, - const int64_t walk_num, - const int64_t elec_num, - const int64_t up_num, - const int64_t nucl_num, - const int64_t type_nucl_num, - const int64_t* type_nucl_vector, - const int64_t dim_c_vector, - const int64_t aord_num, - const int64_t bord_num, - const int64_t cord_num, - const double* a_vector, - const double* b_vector, - const double* c_vector_full, - const int64_t* lkpm_combined_index, - const double* tmp_c, - const double* ee_distance_rescaled, - const double* en_distance_rescaled, - const double* een_rescaled_n, - const double* asymp_jasa, - const double* asymp_jasb, - double* const factor_ee ); + #+begin_src f90 :tangle (eval fh_func) :comments org +interface + integer(qmckl_exit_code) function qmckl_get_jastrow_champ_value (context, & + value, size_max) bind(C) + use, intrinsic :: iso_c_binding + import + implicit none + integer (qmckl_context) , intent(in), value :: context + integer(c_int64_t), intent(in), value :: size_max + double precision, intent(out) :: value(size_max) + end function qmckl_get_jastrow_champ_value +end interface #+end_src - #+CALL: generate_private_c_header(table=qmckl_jastrow_champ_value_args,rettyp="qmckl_exit_code",fname="qmckl_compute_jastrow_champ_value") +**** Provide :noexport: + #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none +qmckl_exit_code qmckl_provide_jastrow_champ_value(qmckl_context context); + #+end_src - #+RESULTS: - #+begin_src c :tangle (eval h_private_func) :comments org - qmckl_exit_code qmckl_compute_jastrow_champ_value ( - const qmckl_context context, - const int64_t walk_num, - const int64_t elec_num, - const int64_t up_num, - const int64_t nucl_num, - const int64_t type_nucl_num, - const int64_t* type_nucl_vector, - const int64_t dim_c_vector, - const int64_t aord_num, - const int64_t bord_num, - const int64_t cord_num, - const double* a_vector, - const double* b_vector, - const double* c_vector_full, - const int64_t* lkpm_combined_index, - const double* tmp_c, - const double* ee_distance_rescaled, - const double* en_distance_rescaled, - const double* een_rescaled_n, - const double* asymp_jasa, - const double* asymp_jasb, - double* const factor_ee ); - #+end_src + #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none +qmckl_exit_code qmckl_provide_jastrow_champ_value(qmckl_context context) +{ + + qmckl_exit_code rc; + + if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { + return qmckl_failwith( context, + QMCKL_INVALID_CONTEXT, + "qmckl_provide_jastrow_champ_value", + NULL); + } + + qmckl_context_struct* const ctx = (qmckl_context_struct*) context; + assert (ctx != NULL); + + if (!ctx->jastrow_champ.provided) { + return qmckl_failwith( context, + QMCKL_NOT_PROVIDED, + "qmckl_provide_jastrow_champ_value", + NULL); + } + + + rc = qmckl_provide_jastrow_champ_factor_ee(context); + if (rc != QMCKL_SUCCESS) return rc; + + rc = qmckl_provide_jastrow_champ_factor_en(context); + if (rc != QMCKL_SUCCESS) return rc; + + rc = qmckl_provide_jastrow_champ_factor_een(context); + if (rc != QMCKL_SUCCESS) return rc; + + /* Compute if necessary */ + if (ctx->date > ctx->jastrow_champ.value_date) { + + if (ctx->electron.walker.num > ctx->electron.walker_old.num) { + if (ctx->jastrow_champ.value != NULL) { + rc = qmckl_free(context, ctx->jastrow_champ.value); + if (rc != QMCKL_SUCCESS) { + return qmckl_failwith( context, rc, + "qmckl_provide_jastrow_champ_value", + "Unable to free ctx->jastrow_champ.value"); + } + ctx->jastrow_champ.value = NULL; + } + } + + /* Allocate array */ + if (ctx->jastrow_champ.value == NULL) { + + qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; + mem_info.size = ctx->electron.walker.num * sizeof(double); + double* value = (double*) qmckl_malloc(context, mem_info); + + if (value == NULL) { + return qmckl_failwith( context, + QMCKL_ALLOCATION_FAILED, + "qmckl_provide_jastrow_champ_value", + NULL); + } + ctx->jastrow_champ.value = value; + } + + rc = qmckl_compute_jastrow_champ_value_doc(context, + ctx->electron.walker.num, + ctx->jastrow_champ.factor_ee, + ctx->jastrow_champ.factor_en, + ctx->jastrow_champ.factor_een, + ctx->jastrow_champ.value); + + ctx->jastrow_champ.factor_ee_date = ctx->date; + } + + return QMCKL_SUCCESS; +} + #+end_src + +**** Compute + :PROPERTIES: + :Name: qmckl_compute_jastrow_champ_value_doc + :CRetType: qmckl_exit_code + :FRetType: qmckl_exit_code + :END: + + #+NAME: qmckl_jastrow_champ_value_args + | Variable | Type | In/Out | Description | + |------------+--------------------+--------+----------------------| + | ~context~ | ~qmckl_context~ | in | Global state | + | ~walk_num~ | ~int64_t~ | in | Number of walkers | + | ~f_ee~ | ~double[walk_num]~ | in | ee component | + | ~f_en~ | ~double[walk_num]~ | in | eN component | + | ~f_een~ | ~double[walk_num]~ | in | eeN component | + | ~value~ | ~double[walk_num]~ | out | Total Jastrow factor | #+CALL: generate_c_interface(table=qmckl_jastrow_champ_value_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_jastrow_champ_value_doc & - (context, & - walk_num, & - elec_num, & - up_num, & - nucl_num, & - type_nucl_num, & - type_nucl_vector, & - dim_c_vector, & - aord_num, & - bord_num, & - cord_num, & - a_vector, & - b_vector, & - c_vector_full, & - lkpm_combined_index, & - tmp_c, & - ee_distance_rescaled, & - en_distance_rescaled, & - een_rescaled_n, & - asymp_jasa, & - asymp_jasb, & - factor_ee) & - bind(C) result(info) + #+RESULTS: + #+begin_src f90 :tangle (eval f) :comments org :exports none + integer(c_int32_t) function qmckl_compute_jastrow_champ_value_doc & + (context, walk_num, f_ee, f_en, f_een, value) & + bind(C) result(info) - use, intrinsic :: iso_c_binding - implicit none + 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 :: up_num - integer (c_int64_t) , intent(in) , value :: nucl_num - integer (c_int64_t) , intent(in) , value :: type_nucl_num - integer (c_int64_t) , intent(in) :: type_nucl_vector(nucl_num) - integer (c_int64_t) , intent(in) , value :: dim_c_vector - integer (c_int64_t) , intent(in) , value :: aord_num - integer (c_int64_t) , intent(in) , value :: bord_num - integer (c_int64_t) , intent(in) , value :: cord_num - real (c_double ) , intent(in) :: a_vector(type_nucl_num,aord_num+1) - real (c_double ) , intent(in) :: b_vector(bord_num+1) - real (c_double ) , intent(in) :: c_vector_full(nucl_num,dim_c_vector) - integer (c_int64_t) , intent(in) :: lkpm_combined_index(dim_c_vector,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) :: ee_distance_rescaled(elec_num,elec_num,walk_num) - real (c_double ) , intent(in) :: en_distance_rescaled(elec_num,nucl_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) :: asymp_jasa(type_nucl_num) - real (c_double ) , intent(in) :: asymp_jasb(2) - real (c_double ) , intent(out) :: factor_ee(walk_num) + integer (c_int64_t) , intent(in) , value :: context + integer (c_int64_t) , intent(in) , value :: walk_num + real (c_double ) , intent(in) :: f_ee(walk_num) + real (c_double ) , intent(in) :: f_en(walk_num) + real (c_double ) , intent(in) :: f_een(walk_num) + real (c_double ) , intent(out) :: value(walk_num) - integer(c_int32_t), external :: qmckl_compute_jastrow_champ_value_doc_f - info = qmckl_compute_jastrow_champ_value_doc_f & - (context, & - walk_num, & - elec_num, & - up_num, & - nucl_num, & - type_nucl_num, & - type_nucl_vector, & - dim_c_vector, & - aord_num, & - bord_num, & - cord_num, & - a_vector, & - b_vector, & - c_vector_full, & - lkpm_combined_index, & - tmp_c, & - ee_distance_rescaled, & - en_distance_rescaled, & - een_rescaled_n, & - asymp_jasa, & - asymp_jasb, & - factor_ee) + integer(c_int32_t), external :: qmckl_compute_jastrow_champ_value_doc_f + info = qmckl_compute_jastrow_champ_value_doc_f & + (context, walk_num, f_ee, f_en, f_een, value) - end function qmckl_compute_jastrow_champ_value_doc - #+end_src + end function qmckl_compute_jastrow_champ_value_doc + #+end_src - #+begin_src c :tangle (eval c) :comments org + #+begin_src f90 :comments org :tangle (eval f) :noweb yes +integer function qmckl_compute_jastrow_champ_value_doc_f(context, & + walk_num, f_ee, f_en, f_een, value) & + result(info) + use qmckl + implicit none + integer(qmckl_context), intent(in) :: context + integer*8 , intent(in) :: walk_num + double precision , intent(in) :: f_ee(walk_num), f_en(walk_num), f_een(walk_num) + double precision , intent(out) :: value(walk_num) + + integer :: i + + 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 + + do i = 1, walk_num + value(i) = f_ee(i) + f_en(i) + f_een(i) + end do + + do i = 1, walk_num + value(i) = dexp(value(i)) + end do + +end function qmckl_compute_jastrow_champ_value_doc_f + #+end_src + + #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none qmckl_exit_code qmckl_compute_jastrow_champ_value ( - const qmckl_context context, - const int64_t walk_num, - const int64_t elec_num, - const int64_t up_num, - const int64_t nucl_num, - const int64_t type_nucl_num, - const int64_t* type_nucl_vector, - const int64_t dim_c_vector, - const int64_t aord_num, - const int64_t bord_num, - const int64_t cord_num, - const double* a_vector, - const double* b_vector, - const double* c_vector_full, - const int64_t* lkpm_combined_index, - const double* tmp_c, - const double* ee_distance_rescaled, - const double* en_distance_rescaled, - const double* een_rescaled_n, - const double* asymp_jasa, - const double* asymp_jasb, - double* const val) + const qmckl_context context, + const int64_t walk_num, + const double* factor_ee, + const double* factor_en, + const double* factor_een, + double* const value); + #+end_src + + #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none +qmckl_exit_code qmckl_compute_jastrow_champ_value_doc ( + const qmckl_context context, + const int64_t walk_num, + const double* factor_ee, + const double* factor_en, + const double* factor_een, + double* const value); + #+end_src + + #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none +qmckl_exit_code qmckl_compute_jastrow_champ_value_hpc ( + const qmckl_context context, + const int64_t walk_num, + const double* factor_ee, + const double* factor_en, + const double* factor_een, + double* const value); + #+end_src + + #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none +inline qmckl_exit_code +qmckl_compute_jastrow_champ_value_hpc ( + const qmckl_context context, + const int64_t walk_num, + const double* factor_ee, + const double* factor_en, + const double* factor_een, + double* const value) +{ + + if (context == QMCKL_NULL_CONTEXT) return QMCKL_INVALID_CONTEXT; + if (walk_num <= 0 ) return QMCKL_INVALID_ARG_2; + if (factor_ee == NULL ) return QMCKL_INVALID_ARG_3; + if (factor_en == NULL ) return QMCKL_INVALID_ARG_4; + if (factor_een == NULL ) return QMCKL_INVALID_ARG_5; + if (value == NULL ) return QMCKL_INVALID_ARG_6; + + for (int64_t i = 0; i < walk_num; ++i) { + value[i] = exp(factor_ee[i] + factor_en[i] + factor_een[i]); + } + + return QMCKL_SUCCESS; +} + #+end_src + + #+begin_src c :comments org :tangle (eval c) :noweb yes +qmckl_exit_code qmckl_compute_jastrow_champ_value ( + const qmckl_context context, + const int64_t walk_num, + const double* factor_ee, + const double* factor_en, + const double* factor_een, + double* const value) { -#ifdef HAVE_HPC - return qmckl_compute_jastrow_champ_value_doc (context, walk_num, elec_num, up_num, nucl_num, - type_nucl_num, type_nucl_vector, dim_c_vector, aord_num, bord_num, - cord_num, a_vector, b_vector, c_vector_full, lkpm_combined_index, - tmp_c, ee_distance_rescaled, en_distance_rescaled, een_rescaled_n, - asymp_jasa, asymp_jasb, val); + +#ifdef HAVE_HPC + return qmckl_compute_jastrow_champ_value_hpc ( + context, walk_num, factor_ee, factor_en, factor_een, value); #else - return qmckl_compute_jastrow_champ_value_doc (context, walk_num, elec_num, up_num, nucl_num, - type_nucl_num, type_nucl_vector, dim_c_vector, aord_num, bord_num, - cord_num, a_vector, b_vector, c_vector_full, lkpm_combined_index, - tmp_c, ee_distance_rescaled, en_distance_rescaled, een_rescaled_n, - asymp_jasa, asymp_jasb, val); + return qmckl_compute_jastrow_champ_value_doc ( + context, walk_num, factor_ee, factor_en, factor_een, value); #endif } #+end_src + +**** Test + + + #+begin_src c :tangle (eval c_test) +/* Check if Jastrow is properly initialized */ +assert(qmckl_jastrow_champ_provided(context)); + +rc = qmckl_check(context, + qmckl_get_jastrow_champ_factor_ee(context, &(factor_ee[0]), walk_num) + ); +assert(rc == QMCKL_SUCCESS); + +rc = qmckl_check(context, + qmckl_get_jastrow_champ_factor_en(context, &(factor_en[0]), walk_num) + ); +assert(rc == QMCKL_SUCCESS); + +rc = qmckl_check(context, + qmckl_get_jastrow_champ_factor_een(context, &(factor_een[0]), walk_num) + ); +assert(rc == QMCKL_SUCCESS); + +double total_j[walk_num]; +rc = qmckl_check(context, + qmckl_get_jastrow_champ_value(context, &(total_j), walk_num) + ); +assert(rc == QMCKL_SUCCESS); + + +for (int64_t i=0 ; i< walk_num ; ++i) { + assert (total_j[i] - exp(factor_ee[i] + factor_en[i] + factor_een[i]) < 1.e-12); +} + + + #+end_src + * End of files :noexport: #+begin_src c :tangle (eval h_private_type)