From 0c136ab9503a53662bd444d6cee8b289850c015b Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 30 Mar 2023 17:07:11 +0200 Subject: [PATCH] Renamed Jastrow into Jastrow_champ --- org/README.org | 42 +- org/qmckl_context.org | 19 +- ...kl_jastrow.org => qmckl_jastrow_champ.org} | 1495 +++++++++-------- org/table_of_contents | 2 +- 4 files changed, 783 insertions(+), 775 deletions(-) rename org/{qmckl_jastrow.org => qmckl_jastrow_champ.org} (86%) diff --git a/org/README.org b/org/README.org index d1b84b0..3842b79 100644 --- a/org/README.org +++ b/org/README.org @@ -17,24 +17,25 @@ grep TITLE $(cat table_of_contents) | tr ':' ' ' #+RESULTS: toc | qmckl.org | #+TITLE | Introduction | | | - | qmckl_ao.org | #+TITLE | Atomic | Orbitals | | - | qmckl_blas.org | #+TITLE | BLAS | functions | | | qmckl_context.org | #+TITLE | Context | | | - | qmckl_determinant.org | #+TITLE | Slater | Determinant | | - | qmckl_distance.org | #+TITLE | Inter-particle | distances | | - | qmckl_electron.org | #+TITLE | Electrons | | | | qmckl_error.org | #+TITLE | Error | handling | | - | qmckl_jastrow.org | #+TITLE | Jastrow | Factor | | - | qmckl_local_energy.org | #+TITLE | Local | Energy | | + | qmckl_blas.org | #+TITLE | BLAS | functions | | | qmckl_memory.org | #+TITLE | Memory | management | | - | qmckl_mo.org | #+TITLE | Molecular | Orbitals | | | qmckl_numprec.org | #+TITLE | Numerical | precision | | + | qmckl_point.org | #+TITLE | Point | | | | qmckl_nucleus.org | #+TITLE | Nucleus | | | + | qmckl_electron.org | #+TITLE | Electrons | | | + | qmckl_distance.org | #+TITLE | Inter-particle | distances | | + | qmckl_ao.org | #+TITLE | Atomic | Orbitals | | + | qmckl_mo.org | #+TITLE | Molecular | Orbitals | | + | qmckl_determinant.org | #+TITLE | Slater | Determinant | | | qmckl_sherman_morrison_woodbury.org | #+TITLE | Sherman-Morrison-Woodbury | | | - | qmckl_utils.org | #+TITLE | Utility | functions | | + | qmckl_jastrow_champ.org | #+TITLE | CHAMP | Jastrow | Factor | + | qmckl_local_energy.org | #+TITLE | Local | Energy | | | qmckl_trexio.org | #+TITLE | TREXIO | I/O | library | - | qmckl_verificarlo.org | #+TITLE | Verificarlo | CI | | | qmckl_tests.org | #+TITLE | Data | for | Tests | + | qmckl_verificarlo.org | #+TITLE | Verificarlo | CI | | + | qmckl_examples.org | #+TITLE | Code | examples | | #+begin_src python :var data=toc :exports results :results raw result = [] @@ -47,24 +48,25 @@ return '\n'.join(result) #+RESULTS: - [[./qmckl.html][Introduction]] - - [[./qmckl_ao.html][Atomic Orbitals]] - - [[./qmckl_blas.html][BLAS functions]] - [[./qmckl_context.html][Context]] - - [[./qmckl_determinant.html][Slater Determinant]] - - [[./qmckl_distance.html][Inter-particle distances]] - - [[./qmckl_electron.html][Electrons]] - [[./qmckl_error.html][Error handling]] - - [[./qmckl_jastrow.html][Jastrow Factor]] - - [[./qmckl_local_energy.html][Local Energy]] + - [[./qmckl_blas.html][BLAS functions]] - [[./qmckl_memory.html][Memory management]] - - [[./qmckl_mo.html][Molecular Orbitals]] - [[./qmckl_numprec.html][Numerical precision]] + - [[./qmckl_point.html][Point]] - [[./qmckl_nucleus.html][Nucleus]] + - [[./qmckl_electron.html][Electrons]] + - [[./qmckl_distance.html][Inter-particle distances]] + - [[./qmckl_ao.html][Atomic Orbitals]] + - [[./qmckl_mo.html][Molecular Orbitals]] + - [[./qmckl_determinant.html][Slater Determinant]] - [[./qmckl_sherman_morrison_woodbury.html][Sherman-Morrison-Woodbury]] - - [[./qmckl_utils.html][Utility functions]] + - [[./qmckl_jastrow_champ.html][CHAMP Jastrow Factor]] + - [[./qmckl_local_energy.html][Local Energy]] - [[./qmckl_trexio.html][TREXIO I/O library]] - - [[./qmckl_verificarlo.html][Verificarlo CI]] - [[./qmckl_tests.html][Data for Tests]] + - [[./qmckl_verificarlo.html][Verificarlo CI]] + - [[./qmckl_examples.html][Code examples]] -------------------------------- diff --git a/org/qmckl_context.org b/org/qmckl_context.org index 3d39b8c..ca99a5b 100644 --- a/org/qmckl_context.org +++ b/org/qmckl_context.org @@ -33,7 +33,7 @@ int main() { #include "qmckl_electron_private_type.h" #include "qmckl_ao_private_type.h" #include "qmckl_mo_private_type.h" -#include "qmckl_jastrow_private_type.h" +#include "qmckl_jastrow_champ_private_type.h" #include "qmckl_determinant_private_type.h" #include "qmckl_local_energy_private_type.h" #include "qmckl_point_private_func.h" @@ -41,6 +41,7 @@ int main() { #include "qmckl_electron_private_func.h" #include "qmckl_ao_private_func.h" #include "qmckl_mo_private_func.h" +#include "qmckl_jastrow_champ_private_func.h" #include "qmckl_determinant_private_func.h" #include "qmckl_local_energy_private_func.h" #+end_src @@ -130,13 +131,13 @@ typedef struct qmckl_context_struct { qmckl_point_struct point; /* -- Molecular system -- */ - qmckl_nucleus_struct nucleus; - qmckl_electron_struct electron; - qmckl_ao_basis_struct ao_basis; - qmckl_mo_basis_struct mo_basis; - qmckl_jastrow_struct jastrow; - qmckl_determinant_struct det; - qmckl_local_energy_struct local_energy; + qmckl_nucleus_struct nucleus; + qmckl_electron_struct electron; + qmckl_ao_basis_struct ao_basis; + qmckl_mo_basis_struct mo_basis; + qmckl_jastrow_champ_struct jastrow_champ; + qmckl_determinant_struct det; + qmckl_local_energy_struct local_energy; /* To be implemented: ,*/ @@ -303,7 +304,7 @@ qmckl_context qmckl_context_create() { rc = qmckl_init_determinant(context); assert (rc == QMCKL_SUCCESS); - rc = qmckl_init_jastrow(context); + rc = qmckl_init_jastrow_champ(context); assert (rc == QMCKL_SUCCESS); } diff --git a/org/qmckl_jastrow.org b/org/qmckl_jastrow_champ.org similarity index 86% rename from org/qmckl_jastrow.org rename to org/qmckl_jastrow_champ.org index 0276438..4d2d335 100644 --- a/org/qmckl_jastrow.org +++ b/org/qmckl_jastrow_champ.org @@ -1,4 +1,4 @@ -#+TITLE: Jastrow Factor +#+TITLE: CHAMP Jastrow Factor #+SETUPFILE: ../tools/theme.setup #+INCLUDE: ../tools/lib.org @@ -65,13 +65,13 @@ #+end_src #+begin_src c :tangle (eval h_private_func) -#ifndef QMCKL_JASTROW_HPF -#define QMCKL_JASTROW_HPF +#ifndef QMCKL_JASTROW_CHAMP_HPF +#define QMCKL_JASTROW_CHAMP_HPF #+end_src #+begin_src c :tangle (eval h_private_type) -#ifndef QMCKL_JASTROW_HPT -#define QMCKL_JASTROW_HPT +#ifndef QMCKL_JASTROW_CHAMP_HPT +#define QMCKL_JASTROW_CHAMP_HPT #include #+end_src @@ -85,7 +85,7 @@ #include #include "n2.h" -#include "qmckl_jastrow_private_func.h" +#include "qmckl_jastrow_champ_private_func.h" int main() { qmckl_context context; @@ -116,14 +116,14 @@ int main() { #include "qmckl_context_private_type.h" #include "qmckl_memory_private_type.h" #include "qmckl_memory_private_func.h" -#include "qmckl_jastrow_private_func.h" -#include "qmckl_jastrow_private_type.h" +#include "qmckl_jastrow_champ_private_type.h" +#include "qmckl_jastrow_champ_private_func.h" #+end_src * Context :PROPERTIES: - :Name: qmckl_jastrow + :Name: qmckl_jastrow_champ :CRetType: qmckl_exit_code :FRetType: qmckl_exit_code :END: @@ -139,7 +139,7 @@ int main() { | ~aord_num~ | ~int64_t~ | in | The number of a coeffecients | | ~bord_num~ | ~int64_t~ | in | The number of b coeffecients | | ~cord_num~ | ~int64_t~ | in | The number of c coeffecients | - | ~type_nucl_num~ | ~int64_t~ | in | Number of Nuclei types | + | ~type_nucl_num~ | ~int64_t~ | in | Number of Nuclei types | | ~type_nucl_vector~ | ~int64_t[nucl_num]~ | in | IDs of types of Nuclei | | ~a_vector~ | ~double[aord_num + 1][type_nucl_num]~ | in | a polynomial coefficients | | ~b_vector~ | ~double[bord_num + 1]~ | in | b polynomial coefficients | @@ -156,6 +156,8 @@ int main() { | ~factor_en_deriv_e_date~ | ~uint64_t~ | out | Keep track of the date for the en derivative | | ~factor_een_deriv_e~ | ~double[4][nelec][walker.num]~ | out | Derivative of the Jastrow factor: electron-electron-nucleus part | | ~factor_een_deriv_e_date~ | ~uint64_t~ | out | Keep track of the date for the een derivative | + | ~vgl~ | ~double[walk_num][5]~ | out | Value, gradient and Laplacian of the Jastrow factor | + | ~vgl_date~ | ~uint64_t~ | out | Keep track of the date | computed data: @@ -343,64 +345,65 @@ kappa_inv = 1.0/kappa ** Data structure #+begin_src c :comments org :tangle (eval h_private_type) -typedef struct qmckl_jastrow_struct{ - int32_t uninitialized; +typedef struct qmckl_jastrow_champ_struct{ + int64_t * restrict lkpm_combined_index; + int64_t * restrict type_nucl_vector; + double * restrict asymp_jasa; + double * restrict asymp_jasb; + double * restrict a_vector; + double * restrict b_vector; + double * restrict c_vector; + double * restrict c_vector_full; + double * restrict dtmp_c; + double * restrict ee_distance_rescaled; + double * restrict ee_distance_rescaled_deriv_e; + double * restrict een_rescaled_e; + double * restrict een_rescaled_e_deriv_e; + double * restrict een_rescaled_n; + double * restrict een_rescaled_n_deriv_e; + double * restrict en_distance_rescaled; + double * restrict en_distance_rescaled_deriv_e; + double * restrict factor_ee; + double * restrict factor_ee_deriv_e; + double * restrict factor_een; + double * restrict factor_een_deriv_e; + double * restrict factor_en; + double * restrict factor_en_deriv_e; + double * restrict rescale_factor_en; + double * restrict tmp_c; + double * restrict vgl; int64_t aord_num; int64_t bord_num; int64_t cord_num; + int64_t dim_c_vector; int64_t type_nucl_num; uint64_t asymp_jasa_date; uint64_t asymp_jasb_date; - uint64_t tmp_c_date; - uint64_t dtmp_c_date; - uint64_t factor_ee_date; - uint64_t factor_en_date; - uint64_t factor_een_date; - uint64_t factor_ee_deriv_e_date; - uint64_t factor_en_deriv_e_date; - uint64_t factor_een_deriv_e_date; - double rescale_factor_ee; - double* rescale_factor_en; - int64_t* type_nucl_vector; - double * a_vector; - double * b_vector; - double * c_vector; - double * asymp_jasa; - double * asymp_jasb; - double * factor_ee; - double * factor_en; - double * factor_een; - double * factor_ee_deriv_e; - double * factor_en_deriv_e; - double * factor_een_deriv_e; - int64_t dim_c_vector; - uint64_t dim_c_vector_date; - double * c_vector_full; uint64_t c_vector_full_date; - int64_t* lkpm_combined_index; - uint64_t lkpm_combined_index_date; - double * tmp_c; - double * dtmp_c; + uint64_t dim_c_vector_date; + uint64_t dtmp_c_date; uint64_t ee_distance_rescaled_date; uint64_t ee_distance_rescaled_deriv_e_date; + uint64_t een_rescaled_e_date; + uint64_t een_rescaled_e_deriv_e_date; + uint64_t een_rescaled_n_date; + uint64_t een_rescaled_n_deriv_e_date; uint64_t en_distance_rescaled_date; uint64_t en_distance_rescaled_deriv_e_date; - double* ee_distance_rescaled; - double* ee_distance_rescaled_deriv_e; - double* en_distance_rescaled; - double* en_distance_rescaled_deriv_e; - double * een_rescaled_e; - double * een_rescaled_n; - uint64_t een_rescaled_e_date; - uint64_t een_rescaled_n_date; - double * een_rescaled_e_deriv_e; - double * een_rescaled_n_deriv_e; - uint64_t een_rescaled_e_deriv_e_date; - uint64_t een_rescaled_n_deriv_e_date; + uint64_t factor_ee_date; + uint64_t factor_ee_deriv_e_date; + uint64_t factor_een_date; + uint64_t factor_een_deriv_e_date; + uint64_t factor_en_date; + uint64_t factor_en_deriv_e_date; + uint64_t lkpm_combined_index_date; + uint64_t tmp_c_date; + uint64_t vgl_date; + double rescale_factor_ee; + int32_t uninitialized; bool provided; - char * type; -} qmckl_jastrow_struct; +} qmckl_jastrow_champ_struct; #+end_src The ~uninitialized~ integer contains one bit set to one for each @@ -410,12 +413,12 @@ typedef struct qmckl_jastrow_struct{ Some values are initialized by default, and are not concerned by this mechanism. - #+begin_src c :comments org :tangle (eval h_func) -qmckl_exit_code qmckl_init_jastrow(qmckl_context context); + #+begin_src c :comments org :tangle (eval h_private_func) +qmckl_exit_code qmckl_init_jastrow_champ(qmckl_context context); #+end_src #+begin_src c :comments org :tangle (eval c) -qmckl_exit_code qmckl_init_jastrow(qmckl_context context) { +qmckl_exit_code qmckl_init_jastrow_champ(qmckl_context context) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return false; @@ -424,14 +427,14 @@ qmckl_exit_code qmckl_init_jastrow(qmckl_context context) { qmckl_context_struct* const ctx = (qmckl_context_struct*) context; assert (ctx != NULL); - ctx->jastrow.uninitialized = (1 << 10) - 1; + ctx->jastrow_champ.uninitialized = (1 << 10) - 1; /* Default values */ - ctx->jastrow.aord_num = -1; - ctx->jastrow.bord_num = -1; - ctx->jastrow.cord_num = -1; - ctx->jastrow.type_nucl_num = -1; - ctx->jastrow.dim_c_vector = -1; + ctx->jastrow_champ.aord_num = -1; + ctx->jastrow_champ.bord_num = -1; + ctx->jastrow_champ.cord_num = -1; + ctx->jastrow_champ.type_nucl_num = -1; + ctx->jastrow_champ.dim_c_vector = -1; return QMCKL_SUCCESS; } @@ -443,16 +446,16 @@ qmckl_exit_code qmckl_init_jastrow(qmckl_context context) { called. #+begin_src c :comments org :tangle (eval h_func) -qmckl_exit_code qmckl_set_jastrow_rescale_factor_ee (qmckl_context context, const double kappa_ee); -qmckl_exit_code qmckl_set_jastrow_rescale_factor_en (qmckl_context context, const double* kappa_en, const int64_t size_max); -qmckl_exit_code qmckl_set_jastrow_aord_num (qmckl_context context, const int64_t aord_num); -qmckl_exit_code qmckl_set_jastrow_bord_num (qmckl_context context, const int64_t bord_num); -qmckl_exit_code qmckl_set_jastrow_cord_num (qmckl_context context, const int64_t cord_num); -qmckl_exit_code qmckl_set_jastrow_type_nucl_num (qmckl_context context, const int64_t type_nucl_num); -qmckl_exit_code qmckl_set_jastrow_type_nucl_vector (qmckl_context context, const int64_t* type_nucl_vector, const int64_t nucl_num); -qmckl_exit_code qmckl_set_jastrow_a_vector (qmckl_context context, const double * a_vector, const int64_t size_max); -qmckl_exit_code qmckl_set_jastrow_b_vector (qmckl_context context, const double * b_vector, const int64_t size_max); -qmckl_exit_code qmckl_set_jastrow_c_vector (qmckl_context context, const double * c_vector, const int64_t size_max); +qmckl_exit_code qmckl_set_jastrow_champ_rescale_factor_ee (qmckl_context context, const double kappa_ee); +qmckl_exit_code qmckl_set_jastrow_champ_rescale_factor_en (qmckl_context context, const double* kappa_en, const int64_t size_max); +qmckl_exit_code qmckl_set_jastrow_champ_aord_num (qmckl_context context, const int64_t aord_num); +qmckl_exit_code qmckl_set_jastrow_champ_bord_num (qmckl_context context, const int64_t bord_num); +qmckl_exit_code qmckl_set_jastrow_champ_cord_num (qmckl_context context, const int64_t cord_num); +qmckl_exit_code qmckl_set_jastrow_champ_type_nucl_num (qmckl_context context, const int64_t type_nucl_num); +qmckl_exit_code qmckl_set_jastrow_champ_type_nucl_vector (qmckl_context context, const int64_t* type_nucl_vector, const int64_t nucl_num); +qmckl_exit_code qmckl_set_jastrow_champ_a_vector (qmckl_context context, const double * a_vector, const int64_t size_max); +qmckl_exit_code qmckl_set_jastrow_champ_b_vector (qmckl_context context, const double * b_vector, const int64_t size_max); +qmckl_exit_code qmckl_set_jastrow_champ_c_vector (qmckl_context context, const double * c_vector, const int64_t size_max); #+end_src #+NAME:pre2 @@ -463,21 +466,21 @@ if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { qmckl_context_struct* const ctx = (qmckl_context_struct*) context; -if (mask != 0 && !(ctx->jastrow.uninitialized & mask)) { - printf("%d %d\n", mask, ctx->jastrow.uninitialized ); +if (mask != 0 && !(ctx->jastrow_champ.uninitialized & mask)) { + printf("%d %d\n", mask, ctx->jastrow_champ.uninitialized ); return qmckl_failwith( context, QMCKL_ALREADY_SET, - "qmckl_set_jastrow_*", + "qmckl_set_jastrow_champ_*", NULL); } #+end_src #+NAME:post2 #+begin_src c :exports none -ctx->jastrow.uninitialized &= ~mask; -ctx->jastrow.provided = (ctx->jastrow.uninitialized == 0); -if (ctx->jastrow.provided) { - qmckl_exit_code rc_ = qmckl_finalize_jastrow(context); +ctx->jastrow_champ.uninitialized &= ~mask; +ctx->jastrow_champ.provided = (ctx->jastrow_champ.uninitialized == 0); +if (ctx->jastrow_champ.provided) { + qmckl_exit_code rc_ = qmckl_finalize_jastrow_champ(context); if (rc_ != QMCKL_SUCCESS) return rc_; } @@ -486,7 +489,7 @@ return QMCKL_SUCCESS; #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none qmckl_exit_code -qmckl_set_jastrow_aord_num(qmckl_context context, const int64_t aord_num) +qmckl_set_jastrow_champ_aord_num(qmckl_context context, const int64_t aord_num) { int32_t mask = 1 << 0; @@ -496,17 +499,17 @@ qmckl_set_jastrow_aord_num(qmckl_context context, const int64_t aord_num) if (aord_num < 0) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_set_jastrow_aord_num", + "qmckl_set_jastrow_champ_aord_num", "aord_num < 0"); } - ctx->jastrow.aord_num = aord_num; + ctx->jastrow_champ.aord_num = aord_num; <> } qmckl_exit_code -qmckl_set_jastrow_bord_num(qmckl_context context, const int64_t bord_num) +qmckl_set_jastrow_champ_bord_num(qmckl_context context, const int64_t bord_num) { int32_t mask = 1 << 1; @@ -516,17 +519,17 @@ qmckl_set_jastrow_bord_num(qmckl_context context, const int64_t bord_num) if (bord_num < 0) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_set_jastrow_bord_num", + "qmckl_set_jastrow_champ_bord_num", "bord_num < 0"); } - ctx->jastrow.bord_num = bord_num; + ctx->jastrow_champ.bord_num = bord_num; <> } qmckl_exit_code -qmckl_set_jastrow_cord_num(qmckl_context context, const int64_t cord_num) +qmckl_set_jastrow_champ_cord_num(qmckl_context context, const int64_t cord_num) { int32_t mask = 1 << 2; @@ -536,7 +539,7 @@ qmckl_set_jastrow_cord_num(qmckl_context context, const int64_t cord_num) if (cord_num < 0) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_set_jastrow_cord_num", + "qmckl_set_jastrow_champ_cord_num", "cord_num < 0"); } @@ -544,15 +547,15 @@ qmckl_set_jastrow_cord_num(qmckl_context context, const int64_t cord_num) qmckl_exit_code rc = qmckl_compute_dim_c_vector(context, cord_num, &dim_c_vector); assert (rc == QMCKL_SUCCESS); - ctx->jastrow.cord_num = cord_num; - ctx->jastrow.dim_c_vector = dim_c_vector; + ctx->jastrow_champ.cord_num = cord_num; + ctx->jastrow_champ.dim_c_vector = dim_c_vector; <> } qmckl_exit_code -qmckl_set_jastrow_type_nucl_num(qmckl_context context, const int64_t type_nucl_num) +qmckl_set_jastrow_champ_type_nucl_num(qmckl_context context, const int64_t type_nucl_num) { int32_t mask = 1 << 3; @@ -561,18 +564,18 @@ qmckl_set_jastrow_type_nucl_num(qmckl_context context, const int64_t type_nucl_n if (type_nucl_num <= 0) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_set_jastrow_type_nucl_num", + "qmckl_set_jastrow_champ_type_nucl_num", "type_nucl_num < 0"); } - ctx->jastrow.type_nucl_num = type_nucl_num; + ctx->jastrow_champ.type_nucl_num = type_nucl_num; <> } qmckl_exit_code -qmckl_set_jastrow_type_nucl_vector(qmckl_context context, +qmckl_set_jastrow_champ_type_nucl_vector(qmckl_context context, int64_t const * type_nucl_vector, const int64_t nucl_num) { @@ -581,28 +584,28 @@ qmckl_set_jastrow_type_nucl_vector(qmckl_context context, <> - int64_t type_nucl_num = ctx->jastrow.type_nucl_num; + int64_t type_nucl_num = ctx->jastrow_champ.type_nucl_num; if (type_nucl_num <= 0) { return qmckl_failwith( context, QMCKL_NOT_PROVIDED, - "qmckl_set_jastrow_type_nucl_vector", + "qmckl_set_jastrow_champ_type_nucl_vector", "type_nucl_num not initialized"); } if (type_nucl_vector == NULL) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_set_jastrow_type_nucl_vector", + "qmckl_set_jastrow_champ_type_nucl_vector", "type_nucl_vector = NULL"); } - if (ctx->jastrow.type_nucl_vector != NULL) { - qmckl_exit_code rc = qmckl_free(context, ctx->jastrow.type_nucl_vector); + if (ctx->jastrow_champ.type_nucl_vector != NULL) { + qmckl_exit_code rc = qmckl_free(context, ctx->jastrow_champ.type_nucl_vector); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, "qmckl_set_type_nucl_vector", - "Unable to free ctx->jastrow.type_nucl_vector"); + "Unable to free ctx->jastrow_champ.type_nucl_vector"); } } @@ -613,20 +616,20 @@ qmckl_set_jastrow_type_nucl_vector(qmckl_context context, if(new_array == NULL) { return qmckl_failwith( context, QMCKL_ALLOCATION_FAILED, - "qmckl_set_jastrow_type_nucl_vector", + "qmckl_set_jastrow_champ_type_nucl_vector", NULL); } memcpy(new_array, type_nucl_vector, mem_info.size); - ctx->jastrow.type_nucl_vector = new_array; + ctx->jastrow_champ.type_nucl_vector = new_array; <> } qmckl_exit_code -qmckl_set_jastrow_a_vector(qmckl_context context, +qmckl_set_jastrow_champ_a_vector(qmckl_context context, double const * a_vector, const int64_t size_max) { @@ -634,36 +637,36 @@ qmckl_set_jastrow_a_vector(qmckl_context context, <> - int64_t aord_num = ctx->jastrow.aord_num; + int64_t aord_num = ctx->jastrow_champ.aord_num; if (aord_num < 0) { return qmckl_failwith( context, QMCKL_NOT_PROVIDED, - "qmckl_set_jastrow_a_vector", + "qmckl_set_jastrow_champ_a_vector", "aord_num not initialized"); } - int64_t type_nucl_num = ctx->jastrow.type_nucl_num; + int64_t type_nucl_num = ctx->jastrow_champ.type_nucl_num; if (type_nucl_num <= 0) { return qmckl_failwith( context, QMCKL_NOT_PROVIDED, - "qmckl_set_jastrow_a_vector", + "qmckl_set_jastrow_champ_a_vector", "type_nucl_num not initialized"); } if (a_vector == NULL) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_set_jastrow_a_vector", + "qmckl_set_jastrow_champ_a_vector", "a_vector = NULL"); } - if (ctx->jastrow.a_vector != NULL) { - qmckl_exit_code rc = qmckl_free(context, ctx->jastrow.a_vector); + if (ctx->jastrow_champ.a_vector != NULL) { + qmckl_exit_code rc = qmckl_free(context, ctx->jastrow_champ.a_vector); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, - "qmckl_set_jastrow_a_vector", - "Unable to free ctx->jastrow.a_vector"); + "qmckl_set_jastrow_champ_a_vector", + "Unable to free ctx->jastrow_champ.a_vector"); } } @@ -673,7 +676,7 @@ qmckl_set_jastrow_a_vector(qmckl_context context, if (size_max < (aord_num+1)*type_nucl_num ) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_set_jastrow_a_vector", + "qmckl_set_jastrow_champ_a_vector", "Array too small. Expected (aord_num+1)*type_nucl_num"); } @@ -682,20 +685,20 @@ qmckl_set_jastrow_a_vector(qmckl_context context, if(new_array == NULL) { return qmckl_failwith( context, QMCKL_ALLOCATION_FAILED, - "qmckl_set_jastrow_coefficient", + "qmckl_set_jastrow_champ_coefficient", NULL); } memcpy(new_array, a_vector, mem_info.size); - ctx->jastrow.a_vector = new_array; + ctx->jastrow_champ.a_vector = new_array; <> } qmckl_exit_code -qmckl_set_jastrow_b_vector(qmckl_context context, +qmckl_set_jastrow_champ_b_vector(qmckl_context context, double const * b_vector, const int64_t size_max) { @@ -703,27 +706,27 @@ qmckl_set_jastrow_b_vector(qmckl_context context, <> - int64_t bord_num = ctx->jastrow.bord_num; + int64_t bord_num = ctx->jastrow_champ.bord_num; if (bord_num < 0) { return qmckl_failwith( context, QMCKL_NOT_PROVIDED, - "qmckl_set_jastrow_b_vector", + "qmckl_set_jastrow_champ_b_vector", "bord_num not initialized"); } if (b_vector == NULL) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_set_jastrow_b_vector", + "qmckl_set_jastrow_champ_b_vector", "b_vector = NULL"); } - if (ctx->jastrow.b_vector != NULL) { - qmckl_exit_code rc = qmckl_free(context, ctx->jastrow.b_vector); + if (ctx->jastrow_champ.b_vector != NULL) { + qmckl_exit_code rc = qmckl_free(context, ctx->jastrow_champ.b_vector); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, - "qmckl_set_jastrow_b_vector", - "Unable to free ctx->jastrow.b_vector"); + "qmckl_set_jastrow_champ_b_vector", + "Unable to free ctx->jastrow_champ.b_vector"); } } @@ -733,7 +736,7 @@ qmckl_set_jastrow_b_vector(qmckl_context context, if (size_max < (bord_num+1)) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_set_jastrow_b_vector", + "qmckl_set_jastrow_champ_b_vector", "Array too small. Expected (bord_num+1)"); } @@ -742,20 +745,20 @@ qmckl_set_jastrow_b_vector(qmckl_context context, if(new_array == NULL) { return qmckl_failwith( context, QMCKL_ALLOCATION_FAILED, - "qmckl_set_jastrow_coefficient", + "qmckl_set_jastrow_champ_coefficient", NULL); } memcpy(new_array, b_vector, mem_info.size); - ctx->jastrow.b_vector = new_array; + ctx->jastrow_champ.b_vector = new_array; <> } qmckl_exit_code -qmckl_set_jastrow_c_vector(qmckl_context context, +qmckl_set_jastrow_champ_c_vector(qmckl_context context, double const * c_vector, const int64_t size_max) { @@ -763,35 +766,35 @@ qmckl_set_jastrow_c_vector(qmckl_context context, <> - int64_t type_nucl_num = ctx->jastrow.type_nucl_num; + int64_t type_nucl_num = ctx->jastrow_champ.type_nucl_num; if (type_nucl_num <= 0) { return qmckl_failwith( context, QMCKL_NOT_PROVIDED, - "qmckl_set_jastrow_c_vector", + "qmckl_set_jastrow_champ_c_vector", "type_nucl_num not initialized"); } - int64_t dim_c_vector = ctx->jastrow.dim_c_vector; + int64_t dim_c_vector = ctx->jastrow_champ.dim_c_vector; if (dim_c_vector < 0) { return qmckl_failwith( context, QMCKL_NOT_PROVIDED, - "qmckl_set_jastrow_c_vector", + "qmckl_set_jastrow_champ_c_vector", "cord_num not initialized"); } if (c_vector == NULL) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_set_jastrow_c_vector", + "qmckl_set_jastrow_champ_c_vector", "c_vector = NULL"); } - if (ctx->jastrow.c_vector != NULL) { - qmckl_exit_code rc = qmckl_free(context, ctx->jastrow.c_vector); + if (ctx->jastrow_champ.c_vector != NULL) { + qmckl_exit_code rc = qmckl_free(context, ctx->jastrow_champ.c_vector); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, - "qmckl_set_jastrow_c_vector", - "Unable to free ctx->jastrow.c_vector"); + "qmckl_set_jastrow_champ_c_vector", + "Unable to free ctx->jastrow_champ.c_vector"); } } @@ -801,7 +804,7 @@ qmckl_set_jastrow_c_vector(qmckl_context context, if ((size_t) size_max < mem_info.size/sizeof(double)) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_set_jastrow_c_vector", + "qmckl_set_jastrow_champ_c_vector", "Array too small. Expected dim_c_vector * type_nucl_num"); } @@ -810,19 +813,19 @@ qmckl_set_jastrow_c_vector(qmckl_context context, if(new_array == NULL) { return qmckl_failwith( context, QMCKL_ALLOCATION_FAILED, - "qmckl_set_jastrow_coefficient", + "qmckl_set_jastrow_champ_coefficient", NULL); } memcpy(new_array, c_vector, mem_info.size); - ctx->jastrow.c_vector = new_array; + ctx->jastrow_champ.c_vector = new_array; <> } qmckl_exit_code -qmckl_set_jastrow_rescale_factor_ee(qmckl_context context, +qmckl_set_jastrow_champ_rescale_factor_ee(qmckl_context context, const double rescale_factor_ee) { int32_t mask = 1 << 8; @@ -832,18 +835,18 @@ qmckl_set_jastrow_rescale_factor_ee(qmckl_context context, if (rescale_factor_ee <= 0.0) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_set_jastrow_rescale_factor_ee", + "qmckl_set_jastrow_champ_rescale_factor_ee", "rescale_factor_ee <= 0.0"); } - ctx->jastrow.rescale_factor_ee = rescale_factor_ee; + ctx->jastrow_champ.rescale_factor_ee = rescale_factor_ee; <> } qmckl_exit_code -qmckl_set_jastrow_rescale_factor_en(qmckl_context context, +qmckl_set_jastrow_champ_rescale_factor_en(qmckl_context context, const double* rescale_factor_en, const int64_t size_max) { @@ -851,10 +854,10 @@ qmckl_set_jastrow_rescale_factor_en(qmckl_context context, <> - if (ctx->jastrow.type_nucl_num <= 0) { + if (ctx->jastrow_champ.type_nucl_num <= 0) { return qmckl_failwith( context, QMCKL_NOT_PROVIDED, - "qmckl_set_jastrow_rescale_factor_en", + "qmckl_set_jastrow_champ_rescale_factor_en", "type_nucl_num not set"); } @@ -862,37 +865,37 @@ qmckl_set_jastrow_rescale_factor_en(qmckl_context context, if (rescale_factor_en == NULL) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_set_jastrow_rescale_factor_en", + "qmckl_set_jastrow_champ_rescale_factor_en", "Null pointer"); } - if (size_max < ctx->jastrow.type_nucl_num) { + if (size_max < ctx->jastrow_champ.type_nucl_num) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_set_jastrow_rescale_factor_en", + "qmckl_set_jastrow_champ_rescale_factor_en", "Array too small"); } - if (ctx->jastrow.rescale_factor_en != NULL) { + if (ctx->jastrow_champ.rescale_factor_en != NULL) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_set_jastrow_rescale_factor_en", + "qmckl_set_jastrow_champ_rescale_factor_en", "Already set"); } qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; - mem_info.size = ctx->jastrow.type_nucl_num * sizeof(double); - ctx->jastrow.rescale_factor_en = (double*) qmckl_malloc(context, mem_info); + mem_info.size = ctx->jastrow_champ.type_nucl_num * sizeof(double); + ctx->jastrow_champ.rescale_factor_en = (double*) qmckl_malloc(context, mem_info); - for (int64_t i=0 ; ijastrow.type_nucl_num ; ++i) { + for (int64_t i=0 ; ijastrow_champ.type_nucl_num ; ++i) { if (rescale_factor_en[i] <= 0.0) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_set_jastrow_rescale_factor_en", + "qmckl_set_jastrow_champ_rescale_factor_en", "rescale_factor_en <= 0.0"); } - ctx->jastrow.rescale_factor_en[i] = rescale_factor_en[i]; + ctx->jastrow_champ.rescale_factor_en[i] = rescale_factor_en[i]; } <> @@ -904,11 +907,11 @@ qmckl_set_jastrow_rescale_factor_en(qmckl_context context, are precontracted using BLAS LEVEL 3 operations. #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none -qmckl_exit_code qmckl_finalize_jastrow(qmckl_context context); +qmckl_exit_code qmckl_finalize_jastrow_champ(qmckl_context context); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none -qmckl_exit_code qmckl_finalize_jastrow(qmckl_context context) { +qmckl_exit_code qmckl_finalize_jastrow_champ(qmckl_context context) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return QMCKL_INVALID_CONTEXT; @@ -945,10 +948,10 @@ qmckl_exit_code qmckl_finalize_jastrow(qmckl_context context) { qmckl_exit_code rc; - rc = qmckl_provide_jastrow_asymp_jasa(context); + rc = qmckl_provide_jastrow_champ_asymp_jasa(context); assert(rc == QMCKL_SUCCESS); - rc = qmckl_provide_jastrow_asymp_jasb(context); + rc = qmckl_provide_jastrow_champ_asymp_jasb(context); assert(rc == QMCKL_SUCCESS); rc = qmckl_context_touch(context); @@ -962,16 +965,16 @@ qmckl_exit_code qmckl_finalize_jastrow(qmckl_context context) { #+begin_src f90 :tangle (eval fh_func) :comments org interface - integer(qmckl_exit_code) function qmckl_set_jastrow_rescale_factor_ee (context, & + integer(qmckl_exit_code) function qmckl_set_jastrow_champ_rescale_factor_ee (context, & kappa_ee) bind(C) use, intrinsic :: iso_c_binding import implicit none integer (qmckl_context) , intent(in) , value :: context double precision, intent(in), value :: kappa_ee - end function qmckl_set_jastrow_rescale_factor_ee + end function qmckl_set_jastrow_champ_rescale_factor_ee - integer(qmckl_exit_code) function qmckl_set_jastrow_rescale_factor_en (context, & + integer(qmckl_exit_code) function qmckl_set_jastrow_champ_rescale_factor_en (context, & kappa_en, size_max) bind(C) use, intrinsic :: iso_c_binding import @@ -979,45 +982,45 @@ interface integer (qmckl_context) , intent(in) , value :: context integer(c_int64_t), intent(in), value :: size_max double precision, intent(in) :: kappa_en(size_max) - end function qmckl_set_jastrow_rescale_factor_en + end function qmckl_set_jastrow_champ_rescale_factor_en - integer(qmckl_exit_code) function qmckl_set_jastrow_aord_num (context, & + integer(qmckl_exit_code) function qmckl_set_jastrow_champ_aord_num (context, & aord_num) bind(C) use, intrinsic :: iso_c_binding import implicit none integer (qmckl_context) , intent(in) , value :: context integer(c_int64_t), intent(in), value :: aord_num - end function qmckl_set_jastrow_aord_num + end function qmckl_set_jastrow_champ_aord_num - integer(qmckl_exit_code) function qmckl_set_jastrow_bord_num (context, & + integer(qmckl_exit_code) function qmckl_set_jastrow_champ_bord_num (context, & bord_num) bind(C) use, intrinsic :: iso_c_binding import implicit none integer (qmckl_context) , intent(in) , value :: context integer(c_int64_t), intent(in), value :: bord_num - end function qmckl_set_jastrow_bord_num + end function qmckl_set_jastrow_champ_bord_num - integer(qmckl_exit_code) function qmckl_set_jastrow_cord_num (context, & + integer(qmckl_exit_code) function qmckl_set_jastrow_champ_cord_num (context, & cord_num) bind(C) use, intrinsic :: iso_c_binding import implicit none integer (qmckl_context) , intent(in) , value :: context integer(c_int64_t), intent(in), value :: cord_num - end function qmckl_set_jastrow_cord_num + end function qmckl_set_jastrow_champ_cord_num - integer(qmckl_exit_code) function qmckl_set_jastrow_type_nucl_num (context, & + integer(qmckl_exit_code) function qmckl_set_jastrow_champ_type_nucl_num (context, & type_nucl_num) bind(C) use, intrinsic :: iso_c_binding import implicit none integer (qmckl_context) , intent(in) , value :: context integer(c_int64_t), intent(in), value :: type_nucl_num - end function qmckl_set_jastrow_type_nucl_num + end function qmckl_set_jastrow_champ_type_nucl_num - integer(qmckl_exit_code) function qmckl_set_jastrow_type_nucl_vector (context, & + integer(qmckl_exit_code) function qmckl_set_jastrow_champ_type_nucl_vector (context, & type_nucl_vector, size_max) bind(C) use, intrinsic :: iso_c_binding import @@ -1025,9 +1028,9 @@ interface integer (qmckl_context) , intent(in) , value :: context integer(c_int64_t), intent(in), value :: size_max integer(c_int64_t), intent(in) :: type_nucl_vector(size_max) - end function qmckl_set_jastrow_type_nucl_vector + end function qmckl_set_jastrow_champ_type_nucl_vector - integer(qmckl_exit_code) function qmckl_set_jastrow_a_vector(context, & + integer(qmckl_exit_code) function qmckl_set_jastrow_champ_a_vector(context, & a_vector, size_max) bind(C) use, intrinsic :: iso_c_binding import @@ -1035,9 +1038,9 @@ interface integer (qmckl_context) , intent(in) , value :: context integer(c_int64_t), intent(in), value :: size_max double precision, intent(in) :: a_vector(size_max) - end function qmckl_set_jastrow_a_vector + end function qmckl_set_jastrow_champ_a_vector - integer(qmckl_exit_code) function qmckl_set_jastrow_b_vector(context, & + integer(qmckl_exit_code) function qmckl_set_jastrow_champ_b_vector(context, & b_vector, size_max) bind(C) use, intrinsic :: iso_c_binding import @@ -1045,9 +1048,9 @@ interface integer (qmckl_context) , intent(in) , value :: context integer(c_int64_t), intent(in), value :: size_max double precision, intent(in) :: b_vector(size_max) - end function qmckl_set_jastrow_b_vector + end function qmckl_set_jastrow_champ_b_vector - integer(qmckl_exit_code) function qmckl_set_jastrow_c_vector(context, & + integer(qmckl_exit_code) function qmckl_set_jastrow_champ_c_vector(context, & c_vector, size_max) bind(C) use, intrinsic :: iso_c_binding import @@ -1055,7 +1058,7 @@ interface integer (qmckl_context) , intent(in) , value :: context integer(c_int64_t), intent(in), value :: size_max double precision, intent(in) :: c_vector(size_max) - end function qmckl_set_jastrow_c_vector + end function qmckl_set_jastrow_champ_c_vector end interface #+end_src @@ -1063,17 +1066,17 @@ end interface ** Access functions #+begin_src c :comments org :tangle (eval h_func) :exports none -qmckl_exit_code qmckl_get_jastrow_aord_num (qmckl_context context, int64_t* const aord_num); -qmckl_exit_code qmckl_get_jastrow_bord_num (qmckl_context context, int64_t* const bord_num); -qmckl_exit_code qmckl_get_jastrow_cord_num (qmckl_context context, int64_t* const bord_num); -qmckl_exit_code qmckl_get_jastrow_type_nucl_num (qmckl_context context, int64_t* const type_nucl_num); -qmckl_exit_code qmckl_get_jastrow_type_nucl_vector (qmckl_context context, int64_t* const type_nucl_num, const int64_t size_max); -qmckl_exit_code qmckl_get_jastrow_a_vector (qmckl_context context, double * const a_vector, const int64_t size_max); -qmckl_exit_code qmckl_get_jastrow_b_vector (qmckl_context context, double * const b_vector, const int64_t size_max); -qmckl_exit_code qmckl_get_jastrow_c_vector (qmckl_context context, double * const c_vector, const int64_t size_max); -qmckl_exit_code qmckl_get_jastrow_rescale_factor_ee (const qmckl_context context, double* const rescale_factor_ee); -qmckl_exit_code qmckl_get_jastrow_rescale_factor_en (const qmckl_context context, double* const rescale_factor_en, const int64_t size_max); -qmckl_exit_code qmckl_get_jastrow_dim_c_vector (qmckl_context context, int64_t* const dim_c_vector); +qmckl_exit_code qmckl_get_jastrow_champ_aord_num (qmckl_context context, int64_t* const aord_num); +qmckl_exit_code qmckl_get_jastrow_champ_bord_num (qmckl_context context, int64_t* const bord_num); +qmckl_exit_code qmckl_get_jastrow_champ_cord_num (qmckl_context context, int64_t* const bord_num); +qmckl_exit_code qmckl_get_jastrow_champ_type_nucl_num (qmckl_context context, int64_t* const type_nucl_num); +qmckl_exit_code qmckl_get_jastrow_champ_type_nucl_vector (qmckl_context context, int64_t* const type_nucl_num, const int64_t size_max); +qmckl_exit_code qmckl_get_jastrow_champ_a_vector (qmckl_context context, double * const a_vector, const int64_t size_max); +qmckl_exit_code qmckl_get_jastrow_champ_b_vector (qmckl_context context, double * const b_vector, const int64_t size_max); +qmckl_exit_code qmckl_get_jastrow_champ_c_vector (qmckl_context context, double * const c_vector, const int64_t size_max); +qmckl_exit_code qmckl_get_jastrow_champ_rescale_factor_ee (const qmckl_context context, double* const rescale_factor_ee); +qmckl_exit_code qmckl_get_jastrow_champ_rescale_factor_en (const qmckl_context context, double* const rescale_factor_en, const int64_t size_max); +qmckl_exit_code qmckl_get_jastrow_champ_dim_c_vector (qmckl_context context, int64_t* const dim_c_vector); #+end_src @@ -1085,11 +1088,11 @@ qmckl_exit_code qmckl_get_jastrow_dim_c_vector (qmckl_context context, int function returns ~true~. #+begin_src c :comments org :tangle (eval h_func) -bool qmckl_jastrow_provided (const qmckl_context context); +bool qmckl_jastrow_champ_provided (const qmckl_context context); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none -bool qmckl_jastrow_provided(const qmckl_context context) { +bool qmckl_jastrow_champ_provided(const qmckl_context context) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return false; @@ -1098,12 +1101,12 @@ bool qmckl_jastrow_provided(const qmckl_context context) { qmckl_context_struct* const ctx = (qmckl_context_struct*) context; assert (ctx != NULL); - return ctx->jastrow.provided; + return ctx->jastrow_champ.provided; } #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none -qmckl_exit_code qmckl_get_jastrow_aord_num (const qmckl_context context, int64_t* const aord_num) { +qmckl_exit_code qmckl_get_jastrow_champ_aord_num (const qmckl_context context, int64_t* const aord_num) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return (char) 0; @@ -1112,7 +1115,7 @@ qmckl_exit_code qmckl_get_jastrow_aord_num (const qmckl_context context, int64_t if (aord_num == NULL) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_get_jastrow_aord_num", + "qmckl_get_jastrow_champ_aord_num", "aord_num is a null pointer"); } @@ -1121,16 +1124,16 @@ qmckl_exit_code qmckl_get_jastrow_aord_num (const qmckl_context context, int64_t int32_t mask = 1 << 0; - if ( (ctx->jastrow.uninitialized & mask) != 0) { + if ( (ctx->jastrow_champ.uninitialized & mask) != 0) { return QMCKL_NOT_PROVIDED; } - assert (ctx->jastrow.aord_num > 0); - ,*aord_num = ctx->jastrow.aord_num; + assert (ctx->jastrow_champ.aord_num > 0); + ,*aord_num = ctx->jastrow_champ.aord_num; return QMCKL_SUCCESS; } -qmckl_exit_code qmckl_get_jastrow_bord_num (const qmckl_context context, int64_t* const bord_num) { +qmckl_exit_code qmckl_get_jastrow_champ_bord_num (const qmckl_context context, int64_t* const bord_num) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return (char) 0; @@ -1139,7 +1142,7 @@ qmckl_exit_code qmckl_get_jastrow_bord_num (const qmckl_context context, int64_t if (bord_num == NULL) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_get_jastrow_bord_num", + "qmckl_get_jastrow_champ_bord_num", "aord_num is a null pointer"); } @@ -1148,16 +1151,16 @@ qmckl_exit_code qmckl_get_jastrow_bord_num (const qmckl_context context, int64_t int32_t mask = 1 << 1; - if ( (ctx->jastrow.uninitialized & mask) != 0) { + if ( (ctx->jastrow_champ.uninitialized & mask) != 0) { return QMCKL_NOT_PROVIDED; } - assert (ctx->jastrow.bord_num > 0); - ,*bord_num = ctx->jastrow.bord_num; + assert (ctx->jastrow_champ.bord_num > 0); + ,*bord_num = ctx->jastrow_champ.bord_num; return QMCKL_SUCCESS; } -qmckl_exit_code qmckl_get_jastrow_cord_num (const qmckl_context context, int64_t* const cord_num) { +qmckl_exit_code qmckl_get_jastrow_champ_cord_num (const qmckl_context context, int64_t* const cord_num) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return (char) 0; @@ -1166,7 +1169,7 @@ qmckl_exit_code qmckl_get_jastrow_cord_num (const qmckl_context context, int64_t if (cord_num == NULL) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_get_jastrow_cord_num", + "qmckl_get_jastrow_champ_cord_num", "aord_num is a null pointer"); } @@ -1175,16 +1178,16 @@ qmckl_exit_code qmckl_get_jastrow_cord_num (const qmckl_context context, int64_t int32_t mask = 1 << 2; - if ( (ctx->jastrow.uninitialized & mask) != 0) { + if ( (ctx->jastrow_champ.uninitialized & mask) != 0) { return QMCKL_NOT_PROVIDED; } - assert (ctx->jastrow.cord_num > 0); - ,*cord_num = ctx->jastrow.cord_num; + assert (ctx->jastrow_champ.cord_num > 0); + ,*cord_num = ctx->jastrow_champ.cord_num; return QMCKL_SUCCESS; } -qmckl_exit_code qmckl_get_jastrow_type_nucl_num (const qmckl_context context, int64_t* const type_nucl_num) { +qmckl_exit_code qmckl_get_jastrow_champ_type_nucl_num (const qmckl_context context, int64_t* const type_nucl_num) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return (char) 0; @@ -1193,7 +1196,7 @@ qmckl_exit_code qmckl_get_jastrow_type_nucl_num (const qmckl_context context, in if (type_nucl_num == NULL) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_get_jastrow_type_nucl_num", + "qmckl_get_jastrow_champ_type_nucl_num", "type_nucl_num is a null pointer"); } @@ -1202,17 +1205,17 @@ qmckl_exit_code qmckl_get_jastrow_type_nucl_num (const qmckl_context context, in int32_t mask = 1 << 3; - if ( (ctx->jastrow.uninitialized & mask) != 0) { + if ( (ctx->jastrow_champ.uninitialized & mask) != 0) { return QMCKL_NOT_PROVIDED; } - assert (ctx->jastrow.type_nucl_num > 0); - ,*type_nucl_num = ctx->jastrow.type_nucl_num; + assert (ctx->jastrow_champ.type_nucl_num > 0); + ,*type_nucl_num = ctx->jastrow_champ.type_nucl_num; return QMCKL_SUCCESS; } qmckl_exit_code -qmckl_get_jastrow_type_nucl_vector (const qmckl_context context, +qmckl_get_jastrow_champ_type_nucl_vector (const qmckl_context context, int64_t* const type_nucl_vector, const int64_t size_max) { @@ -1224,7 +1227,7 @@ qmckl_get_jastrow_type_nucl_vector (const qmckl_context context, if (type_nucl_vector == NULL) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_get_jastrow_type_nucl_vector", + "qmckl_get_jastrow_champ_type_nucl_vector", "type_nucl_vector is a null pointer"); } @@ -1233,24 +1236,24 @@ qmckl_get_jastrow_type_nucl_vector (const qmckl_context context, int32_t mask = 1 << 4; - if ( (ctx->jastrow.uninitialized & mask) != 0) { + if ( (ctx->jastrow_champ.uninitialized & mask) != 0) { return QMCKL_NOT_PROVIDED; } - assert (ctx->jastrow.type_nucl_vector != NULL); - if (size_max < ctx->jastrow.type_nucl_num) { + assert (ctx->jastrow_champ.type_nucl_vector != NULL); + if (size_max < ctx->jastrow_champ.type_nucl_num) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_get_jastrow_type_nucl_vector", - "Array too small. Expected jastrow.type_nucl_num"); + "qmckl_get_jastrow_champ_type_nucl_vector", + "Array too small. Expected jastrow_champ.type_nucl_num"); } - memcpy(type_nucl_vector, ctx->jastrow.type_nucl_vector, ctx->jastrow.type_nucl_num*sizeof(int64_t)); + memcpy(type_nucl_vector, ctx->jastrow_champ.type_nucl_vector, ctx->jastrow_champ.type_nucl_num*sizeof(int64_t)); return QMCKL_SUCCESS; } qmckl_exit_code -qmckl_get_jastrow_a_vector (const qmckl_context context, +qmckl_get_jastrow_champ_a_vector (const qmckl_context context, double * const a_vector, const int64_t size_max) { @@ -1261,7 +1264,7 @@ qmckl_get_jastrow_a_vector (const qmckl_context context, if (a_vector == NULL) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_get_jastrow_a_vector", + "qmckl_get_jastrow_champ_a_vector", "a_vector is a null pointer"); } @@ -1270,24 +1273,24 @@ qmckl_get_jastrow_a_vector (const qmckl_context context, int32_t mask = 1 << 5; - if ( (ctx->jastrow.uninitialized & mask) != 0) { + if ( (ctx->jastrow_champ.uninitialized & mask) != 0) { return QMCKL_NOT_PROVIDED; } - assert (ctx->jastrow.a_vector != NULL); - int64_t sze = (ctx->jastrow.aord_num + 1)*ctx->jastrow.type_nucl_num; + assert (ctx->jastrow_champ.a_vector != NULL); + int64_t sze = (ctx->jastrow_champ.aord_num + 1)*ctx->jastrow_champ.type_nucl_num; if (size_max < sze) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_get_jastrow_a_vector", - "Array too small. Expected (ctx->jastrow.aord_num + 1)*ctx->jastrow.type_nucl_num"); + "qmckl_get_jastrow_champ_a_vector", + "Array too small. Expected (ctx->jastrow_champ.aord_num + 1)*ctx->jastrow_champ.type_nucl_num"); } - memcpy(a_vector, ctx->jastrow.a_vector, sze*sizeof(double)); + memcpy(a_vector, ctx->jastrow_champ.a_vector, sze*sizeof(double)); return QMCKL_SUCCESS; } qmckl_exit_code -qmckl_get_jastrow_b_vector (const qmckl_context context, +qmckl_get_jastrow_champ_b_vector (const qmckl_context context, double * const b_vector, const int64_t size_max) { @@ -1298,7 +1301,7 @@ qmckl_get_jastrow_b_vector (const qmckl_context context, if (b_vector == NULL) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_get_jastrow_b_vector", + "qmckl_get_jastrow_champ_b_vector", "b_vector is a null pointer"); } @@ -1307,24 +1310,24 @@ qmckl_get_jastrow_b_vector (const qmckl_context context, int32_t mask = 1 << 6; - if ( (ctx->jastrow.uninitialized & mask) != 0) { + if ( (ctx->jastrow_champ.uninitialized & mask) != 0) { return QMCKL_NOT_PROVIDED; } - assert (ctx->jastrow.b_vector != NULL); - int64_t sze=ctx->jastrow.bord_num +1; + assert (ctx->jastrow_champ.b_vector != NULL); + int64_t sze=ctx->jastrow_champ.bord_num +1; if (size_max < sze) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_get_jastrow_b_vector", - "Array too small. Expected (ctx->jastrow.bord_num + 1)"); + "qmckl_get_jastrow_champ_b_vector", + "Array too small. Expected (ctx->jastrow_champ.bord_num + 1)"); } - memcpy(b_vector, ctx->jastrow.b_vector, sze*sizeof(double)); + memcpy(b_vector, ctx->jastrow_champ.b_vector, sze*sizeof(double)); return QMCKL_SUCCESS; } qmckl_exit_code -qmckl_get_jastrow_c_vector (const qmckl_context context, +qmckl_get_jastrow_champ_c_vector (const qmckl_context context, double * const c_vector, const int64_t size_max) { @@ -1335,7 +1338,7 @@ qmckl_get_jastrow_c_vector (const qmckl_context context, if (c_vector == NULL) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_get_jastrow_c_vector", + "qmckl_get_jastrow_champ_c_vector", "c_vector is a null pointer"); } @@ -1344,29 +1347,29 @@ qmckl_get_jastrow_c_vector (const qmckl_context context, int32_t mask = 1 << 7; - if ( (ctx->jastrow.uninitialized & mask) != 0) { + if ( (ctx->jastrow_champ.uninitialized & mask) != 0) { return QMCKL_NOT_PROVIDED; } - assert (ctx->jastrow.c_vector != NULL); + assert (ctx->jastrow_champ.c_vector != NULL); int64_t dim_c_vector; - qmckl_exit_code rc = qmckl_get_jastrow_dim_c_vector(context, &dim_c_vector); + qmckl_exit_code rc = qmckl_get_jastrow_champ_dim_c_vector(context, &dim_c_vector); if (rc != QMCKL_SUCCESS) return rc; - int64_t sze=dim_c_vector * ctx->jastrow.type_nucl_num; + int64_t sze=dim_c_vector * ctx->jastrow_champ.type_nucl_num; if (size_max < sze) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_get_jastrow_c_vector", - "Array too small. Expected dim_c_vector * jastrow.type_nucl_num"); + "qmckl_get_jastrow_champ_c_vector", + "Array too small. Expected dim_c_vector * jastrow_champ.type_nucl_num"); } - memcpy(c_vector, ctx->jastrow.c_vector, sze*sizeof(double)); + memcpy(c_vector, ctx->jastrow_champ.c_vector, sze*sizeof(double)); return QMCKL_SUCCESS; } qmckl_exit_code -qmckl_get_jastrow_rescale_factor_ee (const qmckl_context context, +qmckl_get_jastrow_champ_rescale_factor_ee (const qmckl_context context, double* const rescale_factor_ee) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { @@ -1376,7 +1379,7 @@ qmckl_get_jastrow_rescale_factor_ee (const qmckl_context context, if (rescale_factor_ee == NULL) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_get_jastrow_rescale_factor_ee", + "qmckl_get_jastrow_champ_rescale_factor_ee", "rescale_factor_ee is a null pointer"); } @@ -1385,18 +1388,18 @@ qmckl_get_jastrow_rescale_factor_ee (const qmckl_context context, int32_t mask = 1 << 8; - if ( (ctx->jastrow.uninitialized & mask) != 0) { + if ( (ctx->jastrow_champ.uninitialized & mask) != 0) { return QMCKL_NOT_PROVIDED; } - assert (ctx->jastrow.rescale_factor_ee > 0.0); + assert (ctx->jastrow_champ.rescale_factor_ee > 0.0); - ,*rescale_factor_ee = ctx->jastrow.rescale_factor_ee; + ,*rescale_factor_ee = ctx->jastrow_champ.rescale_factor_ee; return QMCKL_SUCCESS; } qmckl_exit_code -qmckl_get_jastrow_rescale_factor_en (const qmckl_context context, +qmckl_get_jastrow_champ_rescale_factor_en (const qmckl_context context, double* const rescale_factor_en, const int64_t size_max) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { @@ -1406,7 +1409,7 @@ qmckl_get_jastrow_rescale_factor_en (const qmckl_context context, if (rescale_factor_en == NULL) { return qmckl_failwith( context, QMCKL_INVALID_ARG_2, - "qmckl_get_jastrow_rescale_factor_en", + "qmckl_get_jastrow_champ_rescale_factor_en", "rescale_factor_en is a null pointer"); } @@ -1415,26 +1418,26 @@ qmckl_get_jastrow_rescale_factor_en (const qmckl_context context, int32_t mask = 1 << 9; - if ( (ctx->jastrow.uninitialized & mask) != 0) { + if ( (ctx->jastrow_champ.uninitialized & mask) != 0) { return QMCKL_NOT_PROVIDED; } - if (size_max < ctx->jastrow.type_nucl_num) { + if (size_max < ctx->jastrow_champ.type_nucl_num) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_get_jastrow_rescale_factor_en", + "qmckl_get_jastrow_champ_rescale_factor_en", "Array to small"); } - assert(ctx->jastrow.rescale_factor_en != NULL); - for (int64_t i=0 ; ijastrow.type_nucl_num ; ++i) { - rescale_factor_en[i] = ctx->jastrow.rescale_factor_en[i]; + assert(ctx->jastrow_champ.rescale_factor_en != NULL); + for (int64_t i=0 ; ijastrow_champ.type_nucl_num ; ++i) { + rescale_factor_en[i] = ctx->jastrow_champ.rescale_factor_en[i]; } return QMCKL_SUCCESS; } -qmckl_exit_code qmckl_get_jastrow_dim_c_vector(qmckl_context context, int64_t* const dim_c_vector) +qmckl_exit_code qmckl_get_jastrow_champ_dim_c_vector(qmckl_context context, int64_t* const dim_c_vector) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return QMCKL_NULL_CONTEXT; @@ -1443,7 +1446,7 @@ qmckl_exit_code qmckl_get_jastrow_dim_c_vector(qmckl_context context, int64_t* c qmckl_context_struct* const ctx = (qmckl_context_struct*) context; assert (ctx != NULL); - ,*dim_c_vector = ctx->jastrow.dim_c_vector; + ,*dim_c_vector = ctx->jastrow_champ.dim_c_vector; return QMCKL_SUCCESS; } @@ -1454,16 +1457,16 @@ qmckl_exit_code qmckl_get_jastrow_dim_c_vector(qmckl_context context, int64_t* c #+begin_src f90 :tangle (eval fh_func) :comments org interface - integer(qmckl_exit_code) function qmckl_get_jastrow_rescale_factor_ee (context, & + integer(qmckl_exit_code) function qmckl_get_jastrow_champ_rescale_factor_ee (context, & kappa_ee) bind(C) use, intrinsic :: iso_c_binding import implicit none integer (qmckl_context) , intent(in) , value :: context double precision, intent(out) :: kappa_ee - end function qmckl_get_jastrow_rescale_factor_ee + end function qmckl_get_jastrow_champ_rescale_factor_ee - integer(qmckl_exit_code) function qmckl_get_jastrow_rescale_factor_en (context, & + integer(qmckl_exit_code) function qmckl_get_jastrow_champ_rescale_factor_en (context, & kappa_en, size_max) bind(C) use, intrinsic :: iso_c_binding import @@ -1471,45 +1474,45 @@ interface integer (qmckl_context) , intent(in), value :: context integer(c_int64_t), intent(in), value :: size_max double precision, intent(out) :: kappa_en(size_max) - end function qmckl_get_jastrow_rescale_factor_en + end function qmckl_get_jastrow_champ_rescale_factor_en - integer(qmckl_exit_code) function qmckl_get_jastrow_aord_num (context, & + integer(qmckl_exit_code) function qmckl_get_jastrow_champ_aord_num (context, & aord_num) bind(C) use, intrinsic :: iso_c_binding import implicit none integer (qmckl_context) , intent(in), value :: context integer(c_int64_t), intent(out) :: aord_num - end function qmckl_get_jastrow_aord_num + end function qmckl_get_jastrow_champ_aord_num - integer(qmckl_exit_code) function qmckl_get_jastrow_bord_num (context, & + integer(qmckl_exit_code) function qmckl_get_jastrow_champ_bord_num (context, & bord_num) bind(C) use, intrinsic :: iso_c_binding import implicit none integer (qmckl_context) , intent(in), value :: context integer(c_int64_t), intent(out) :: bord_num - end function qmckl_get_jastrow_bord_num + end function qmckl_get_jastrow_champ_bord_num - integer(qmckl_exit_code) function qmckl_get_jastrow_cord_num (context, & + integer(qmckl_exit_code) function qmckl_get_jastrow_champ_cord_num (context, & cord_num) bind(C) use, intrinsic :: iso_c_binding import implicit none integer (qmckl_context) , intent(in), value :: context integer(c_int64_t), intent(out) :: cord_num - end function qmckl_get_jastrow_cord_num + end function qmckl_get_jastrow_champ_cord_num - integer(qmckl_exit_code) function qmckl_get_jastrow_type_nucl_num (context, & + integer(qmckl_exit_code) function qmckl_get_jastrow_champ_type_nucl_num (context, & type_nucl_num) bind(C) use, intrinsic :: iso_c_binding import implicit none integer (qmckl_context) , intent(in), value :: context integer(c_int64_t), intent(out) :: type_nucl_num - end function qmckl_get_jastrow_type_nucl_num + end function qmckl_get_jastrow_champ_type_nucl_num - integer(qmckl_exit_code) function qmckl_get_jastrow_type_nucl_vector (context, & + integer(qmckl_exit_code) function qmckl_get_jastrow_champ_type_nucl_vector (context, & type_nucl_vector, size_max) bind(C) use, intrinsic :: iso_c_binding import @@ -1517,9 +1520,9 @@ interface integer (qmckl_context), intent(in), value :: context integer(c_int64_t), intent(in), value :: size_max integer(c_int64_t), intent(out) :: type_nucl_vector(size_max) - end function qmckl_get_jastrow_type_nucl_vector + end function qmckl_get_jastrow_champ_type_nucl_vector - integer(qmckl_exit_code) function qmckl_get_jastrow_a_vector(context, & + integer(qmckl_exit_code) function qmckl_get_jastrow_champ_a_vector(context, & a_vector, size_max) bind(C) use, intrinsic :: iso_c_binding import @@ -1527,9 +1530,9 @@ interface integer (qmckl_context) , intent(in), value :: context integer(c_int64_t), intent(in), value :: size_max double precision, intent(out) :: a_vector(size_max) - end function qmckl_get_jastrow_a_vector + end function qmckl_get_jastrow_champ_a_vector - integer(qmckl_exit_code) function qmckl_get_jastrow_b_vector(context, & + integer(qmckl_exit_code) function qmckl_get_jastrow_champ_b_vector(context, & b_vector, size_max) bind(C) use, intrinsic :: iso_c_binding import @@ -1537,9 +1540,9 @@ interface integer (qmckl_context) , intent(in) , value :: context integer(c_int64_t), intent(in), value :: size_max double precision, intent(out) :: b_vector(size_max) - end function qmckl_get_jastrow_b_vector + end function qmckl_get_jastrow_champ_b_vector - integer(qmckl_exit_code) function qmckl_get_jastrow_c_vector(context, & + integer(qmckl_exit_code) function qmckl_get_jastrow_champ_c_vector(context, & c_vector, size_max) bind(C) use, intrinsic :: iso_c_binding import @@ -1547,7 +1550,7 @@ interface integer (qmckl_context) , intent(in) , value :: context integer(c_int64_t), intent(in), value :: size_max double precision, intent(out) :: c_vector(size_max) - end function qmckl_get_jastrow_c_vector + end function qmckl_get_jastrow_champ_c_vector end interface #+end_src @@ -1685,21 +1688,21 @@ assert(qmckl_nucleus_provided(context)); **** Get #+begin_src c :comments org :tangle (eval h_func) :noweb yes qmckl_exit_code -qmckl_get_jastrow_asymp_jasb(qmckl_context context, +qmckl_get_jastrow_champ_asymp_jasb(qmckl_context context, double* const asymp_jasb, const int64_t size_max); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none qmckl_exit_code -qmckl_get_jastrow_asymp_jasb(qmckl_context context, +qmckl_get_jastrow_champ_asymp_jasb(qmckl_context context, double* const asymp_jasb, const int64_t size_max) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return qmckl_failwith( context, QMCKL_INVALID_CONTEXT, - "qmckl_get_jastrow_asymp_jasb", + "qmckl_get_jastrow_champ_asymp_jasb", NULL); } @@ -1707,7 +1710,7 @@ qmckl_get_jastrow_asymp_jasb(qmckl_context context, /* Provided in finalize_jastrow */ /* qmckl_exit_code rc; - rc = qmckl_provide_jastrow_asymp_jasb(context); + rc = qmckl_provide_jastrow_champ_asymp_jasb(context); if(rc != QMCKL_SUCCESS) return rc; */ @@ -1718,10 +1721,10 @@ qmckl_get_jastrow_asymp_jasb(qmckl_context context, if (size_max < sze) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_get_jastrow_asymp_jasb", + "qmckl_get_jastrow_champ_asymp_jasb", "Array too small. Expected 2"); } - memcpy(asymp_jasb, ctx->jastrow.asymp_jasb, sze * sizeof(double)); + memcpy(asymp_jasb, ctx->jastrow_champ.asymp_jasb, sze * sizeof(double)); return QMCKL_SUCCESS; } @@ -1731,7 +1734,7 @@ qmckl_get_jastrow_asymp_jasb(qmckl_context context, #+begin_src f90 :tangle (eval fh_func) :comments org interface - integer(qmckl_exit_code) function qmckl_get_jastrow_asymp_jasb(context, & + integer(qmckl_exit_code) function qmckl_get_jastrow_champ_asymp_jasb(context, & asymp_jasb, size_max) bind(C) use, intrinsic :: iso_c_binding import @@ -1739,17 +1742,17 @@ interface integer (qmckl_context) , intent(in), value :: context integer(c_int64_t), intent(in), value :: size_max double precision, intent(out) :: asymp_jasb(size_max) - end function qmckl_get_jastrow_asymp_jasb + end function qmckl_get_jastrow_champ_asymp_jasb end interface #+end_src **** Provide :noexport: #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none -qmckl_exit_code qmckl_provide_jastrow_asymp_jasb(qmckl_context context); +qmckl_exit_code qmckl_provide_jastrow_champ_asymp_jasb(qmckl_context context); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none -qmckl_exit_code qmckl_provide_jastrow_asymp_jasb(qmckl_context context) +qmckl_exit_code qmckl_provide_jastrow_champ_asymp_jasb(qmckl_context context) { qmckl_exit_code rc; @@ -1757,25 +1760,25 @@ qmckl_exit_code qmckl_provide_jastrow_asymp_jasb(qmckl_context context) if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return qmckl_failwith( context, QMCKL_INVALID_CONTEXT, - "qmckl_provide_jastrow_asymp_jasb", + "qmckl_provide_jastrow_champ_asymp_jasb", NULL); } qmckl_context_struct* const ctx = (qmckl_context_struct*) context; assert (ctx != NULL); - if (!ctx->jastrow.provided) { + if (!ctx->jastrow_champ.provided) { return qmckl_failwith( context, QMCKL_NOT_PROVIDED, - "qmckl_provide_jastrow_asymp_jasb", + "qmckl_provide_jastrow_champ_asymp_jasb", NULL); } /* Compute if necessary */ - if (ctx->date > ctx->jastrow.asymp_jasb_date) { + if (ctx->date > ctx->jastrow_champ.asymp_jasb_date) { /* Allocate array */ - if (ctx->jastrow.asymp_jasb == NULL) { + if (ctx->jastrow_champ.asymp_jasb == NULL) { qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; mem_info.size = 2 * sizeof(double); @@ -1787,19 +1790,19 @@ qmckl_exit_code qmckl_provide_jastrow_asymp_jasb(qmckl_context context) "qmckl_asymp_jasb", NULL); } - ctx->jastrow.asymp_jasb = asymp_jasb; + ctx->jastrow_champ.asymp_jasb = asymp_jasb; } - rc = qmckl_compute_jastrow_asymp_jasb(context, - ctx->jastrow.bord_num, - ctx->jastrow.b_vector, - ctx->jastrow.rescale_factor_ee, - ctx->jastrow.asymp_jasb); + rc = qmckl_compute_jastrow_champ_asymp_jasb(context, + ctx->jastrow_champ.bord_num, + ctx->jastrow_champ.b_vector, + ctx->jastrow_champ.rescale_factor_ee, + ctx->jastrow_champ.asymp_jasb); if (rc != QMCKL_SUCCESS) { return rc; } - ctx->jastrow.asymp_jasb_date = ctx->date; + ctx->jastrow_champ.asymp_jasb_date = ctx->date; } return QMCKL_SUCCESS; @@ -1808,7 +1811,7 @@ qmckl_exit_code qmckl_provide_jastrow_asymp_jasb(qmckl_context context) **** Compute :PROPERTIES: - :Name: qmckl_compute_jastrow_asymp_jasb + :Name: qmckl_compute_jastrow_champ_asymp_jasb :CRetType: qmckl_exit_code :FRetType: qmckl_exit_code :END: @@ -1825,7 +1828,7 @@ qmckl_exit_code qmckl_provide_jastrow_asymp_jasb(qmckl_context context) # #+CALL: generate_c_interface(table=qmckl_asymp_jasb_args,rettyp=get_value("CRetType"),fname=get_value("Name")) #+begin_src f90 :tangle (eval f) :comments org :exports none - integer(c_int32_t) function qmckl_compute_jastrow_asymp_jasb_doc & + integer(c_int32_t) function qmckl_compute_jastrow_champ_asymp_jasb_doc & (context, bord_num, b_vector, rescale_factor_ee, asymp_jasb) & bind(C) result(info) @@ -1838,15 +1841,15 @@ qmckl_exit_code qmckl_provide_jastrow_asymp_jasb(qmckl_context context) real (c_double ) , intent(in) , value :: rescale_factor_ee real (c_double ) , intent(out) :: asymp_jasb(2) - integer(c_int32_t), external :: qmckl_compute_jastrow_asymp_jasb_doc_f - info = qmckl_compute_jastrow_asymp_jasb_doc_f & + integer(c_int32_t), external :: qmckl_compute_jastrow_champ_asymp_jasb_doc_f + info = qmckl_compute_jastrow_champ_asymp_jasb_doc_f & (context, bord_num, b_vector, rescale_factor_ee, asymp_jasb) - end function qmckl_compute_jastrow_asymp_jasb_doc + end function qmckl_compute_jastrow_champ_asymp_jasb_doc #+end_src #+begin_src f90 :comments org :tangle (eval f) :noweb yes -integer function qmckl_compute_jastrow_asymp_jasb_doc_f(context, bord_num, b_vector, rescale_factor_ee, asymp_jasb) & +integer function qmckl_compute_jastrow_champ_asymp_jasb_doc_f(context, bord_num, b_vector, rescale_factor_ee, asymp_jasb) & result(info) use qmckl implicit none @@ -1883,11 +1886,11 @@ integer function qmckl_compute_jastrow_asymp_jasb_doc_f(context, bord_num, b_vec end do end do -end function qmckl_compute_jastrow_asymp_jasb_doc_f +end function qmckl_compute_jastrow_champ_asymp_jasb_doc_f #+end_src #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none -qmckl_exit_code qmckl_compute_jastrow_asymp_jasb_doc (const qmckl_context context, +qmckl_exit_code qmckl_compute_jastrow_champ_asymp_jasb_doc (const qmckl_context context, const int64_t bord_num, const double* b_vector, const double rescale_factor_ee, @@ -1896,7 +1899,7 @@ qmckl_exit_code qmckl_compute_jastrow_asymp_jasb_doc (const qmckl_context contex #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none -qmckl_exit_code qmckl_compute_jastrow_asymp_jasb_hpc (const qmckl_context context, +qmckl_exit_code qmckl_compute_jastrow_champ_asymp_jasb_hpc (const qmckl_context context, const int64_t bord_num, const double* b_vector, const double rescale_factor_ee, @@ -1905,7 +1908,7 @@ qmckl_exit_code qmckl_compute_jastrow_asymp_jasb_hpc (const qmckl_context contex #+begin_src c :comments org :tangle (eval c) :noweb yes qmckl_exit_code -qmckl_compute_jastrow_asymp_jasb_hpc (const qmckl_context context, +qmckl_compute_jastrow_champ_asymp_jasb_hpc (const qmckl_context context, const int64_t bord_num, const double* b_vector, const double rescale_factor_ee, @@ -1939,7 +1942,7 @@ qmckl_compute_jastrow_asymp_jasb_hpc (const qmckl_context context, #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none -qmckl_exit_code qmckl_compute_jastrow_asymp_jasb (const qmckl_context context, +qmckl_exit_code qmckl_compute_jastrow_champ_asymp_jasb (const qmckl_context context, const int64_t bord_num, const double* b_vector, const double rescale_factor_ee, @@ -1947,7 +1950,7 @@ qmckl_exit_code qmckl_compute_jastrow_asymp_jasb (const qmckl_context context, #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes -qmckl_exit_code qmckl_compute_jastrow_asymp_jasb ( +qmckl_exit_code qmckl_compute_jastrow_champ_asymp_jasb ( const qmckl_context context, const int64_t bord_num, const double* b_vector, @@ -1955,10 +1958,10 @@ qmckl_exit_code qmckl_compute_jastrow_asymp_jasb ( double* const asymp_jasb ) { #ifdef HAVE_HPC - return qmckl_compute_jastrow_asymp_jasb_hpc (context, + return qmckl_compute_jastrow_champ_asymp_jasb_hpc (context, bord_num, b_vector, rescale_factor_ee, asymp_jasb); #else - return qmckl_compute_jastrow_asymp_jasb_doc (context, + return qmckl_compute_jastrow_champ_asymp_jasb_doc (context, bord_num, b_vector, rescale_factor_ee, asymp_jasb); #endif } @@ -2002,64 +2005,64 @@ double* b_vector = &(n2_b_vector[0]); double* c_vector = &(n2_c_vector[0][0]); int64_t dim_c_vector=0; -assert(!qmckl_jastrow_provided(context)); +assert(!qmckl_jastrow_champ_provided(context)); /* Set the data */ rc = qmckl_check(context, - qmckl_set_jastrow_aord_num(context, aord_num) + qmckl_set_jastrow_champ_aord_num(context, aord_num) ); rc = qmckl_check(context, - qmckl_set_jastrow_bord_num(context, bord_num) + qmckl_set_jastrow_champ_bord_num(context, bord_num) ); rc = qmckl_check(context, - qmckl_set_jastrow_cord_num(context, cord_num) + qmckl_set_jastrow_champ_cord_num(context, cord_num) ); assert(rc == QMCKL_SUCCESS); rc = qmckl_check(context, - qmckl_set_jastrow_type_nucl_num(context, type_nucl_num) + qmckl_set_jastrow_champ_type_nucl_num(context, type_nucl_num) ); assert(rc == QMCKL_SUCCESS); rc = qmckl_check(context, - qmckl_set_jastrow_type_nucl_vector(context, type_nucl_vector, nucl_num) + qmckl_set_jastrow_champ_type_nucl_vector(context, type_nucl_vector, nucl_num) ); assert(rc == QMCKL_SUCCESS); rc = qmckl_check(context, - qmckl_set_jastrow_a_vector(context, a_vector,(aord_num+1)*type_nucl_num) + qmckl_set_jastrow_champ_a_vector(context, a_vector,(aord_num+1)*type_nucl_num) ); assert(rc == QMCKL_SUCCESS); rc = qmckl_check(context, - qmckl_set_jastrow_b_vector(context, b_vector,(bord_num+1)) + qmckl_set_jastrow_champ_b_vector(context, b_vector,(bord_num+1)) ); assert(rc == QMCKL_SUCCESS); rc = qmckl_check(context, - qmckl_get_jastrow_dim_c_vector(context, &dim_c_vector) + qmckl_get_jastrow_champ_dim_c_vector(context, &dim_c_vector) ); assert(rc == QMCKL_SUCCESS); rc = qmckl_check(context, - qmckl_set_jastrow_c_vector(context, c_vector,dim_c_vector*type_nucl_num) + qmckl_set_jastrow_champ_c_vector(context, c_vector,dim_c_vector*type_nucl_num) ); assert(rc == QMCKL_SUCCESS); double k_ee = 0.; double k_en[2] = { 0., 0. }; rc = qmckl_check(context, - qmckl_set_jastrow_rescale_factor_en(context, rescale_factor_en, type_nucl_num) + qmckl_set_jastrow_champ_rescale_factor_en(context, rescale_factor_en, type_nucl_num) ); assert(rc == QMCKL_SUCCESS); rc = qmckl_check(context, - qmckl_set_jastrow_rescale_factor_ee(context, rescale_factor_ee) + qmckl_set_jastrow_champ_rescale_factor_ee(context, rescale_factor_ee) ); assert(rc == QMCKL_SUCCESS); rc = qmckl_check(context, - qmckl_get_jastrow_rescale_factor_ee (context, &k_ee) + qmckl_get_jastrow_champ_rescale_factor_ee (context, &k_ee) ); assert(rc == QMCKL_SUCCESS); assert(k_ee == rescale_factor_ee); rc = qmckl_check(context, - qmckl_get_jastrow_rescale_factor_en (context, &(k_en[0]), type_nucl_num) + qmckl_get_jastrow_champ_rescale_factor_en (context, &(k_en[0]), type_nucl_num) ); assert(rc == QMCKL_SUCCESS); for (int i=0 ; ielectron.walker.num; if (size_max < sze) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_get_jastrow_factor_ee", + "qmckl_get_jastrow_champ_factor_ee", "Array too small. Expected walker.num"); } - memcpy(factor_ee, ctx->jastrow.factor_ee, sze*sizeof(double)); + memcpy(factor_ee, ctx->jastrow_champ.factor_ee, sze*sizeof(double)); return QMCKL_SUCCESS; } @@ -2139,7 +2142,7 @@ qmckl_get_jastrow_factor_ee(qmckl_context context, #+begin_src f90 :tangle (eval fh_func) :comments org interface - integer(qmckl_exit_code) function qmckl_get_jastrow_factor_ee (context, & + integer(qmckl_exit_code) function qmckl_get_jastrow_champ_factor_ee (context, & factor_ee, size_max) bind(C) use, intrinsic :: iso_c_binding import @@ -2147,17 +2150,17 @@ interface integer (qmckl_context) , intent(in), value :: context integer(c_int64_t), intent(in), value :: size_max double precision, intent(out) :: factor_ee(size_max) - end function qmckl_get_jastrow_factor_ee + end function qmckl_get_jastrow_champ_factor_ee end interface #+end_src **** Provide :noexport: #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none -qmckl_exit_code qmckl_provide_jastrow_factor_ee(qmckl_context context); +qmckl_exit_code qmckl_provide_jastrow_champ_factor_ee(qmckl_context context); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none -qmckl_exit_code qmckl_provide_jastrow_factor_ee(qmckl_context context) +qmckl_exit_code qmckl_provide_jastrow_champ_factor_ee(qmckl_context context) { qmckl_exit_code rc; @@ -2165,17 +2168,17 @@ qmckl_exit_code qmckl_provide_jastrow_factor_ee(qmckl_context context) if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return qmckl_failwith( context, QMCKL_INVALID_CONTEXT, - "qmckl_provide_jastrow_factor_ee", + "qmckl_provide_jastrow_champ_factor_ee", NULL); } qmckl_context_struct* const ctx = (qmckl_context_struct*) context; assert (ctx != NULL); - if (!ctx->jastrow.provided) { + if (!ctx->jastrow_champ.provided) { return qmckl_failwith( context, QMCKL_NOT_PROVIDED, - "qmckl_provide_jastrow_factor_ee", + "qmckl_provide_jastrow_champ_factor_ee", NULL); } @@ -2184,27 +2187,27 @@ qmckl_exit_code qmckl_provide_jastrow_factor_ee(qmckl_context context) /* Provided in finalize_jastrow */ /* - rc = qmckl_provide_jastrow_asymp_jasb(context); + rc = qmckl_provide_jastrow_champ_asymp_jasb(context); if(rc != QMCKL_SUCCESS) return rc; */ /* Compute if necessary */ - if (ctx->date > ctx->jastrow.factor_ee_date) { + if (ctx->date > ctx->jastrow_champ.factor_ee_date) { if (ctx->electron.walker.num > ctx->electron.walker_old.num) { - if (ctx->jastrow.factor_ee != NULL) { - rc = qmckl_free(context, ctx->jastrow.factor_ee); + if (ctx->jastrow_champ.factor_ee != NULL) { + rc = qmckl_free(context, ctx->jastrow_champ.factor_ee); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, - "qmckl_provide_jastrow_factor_ee", - "Unable to free ctx->jastrow.factor_ee"); + "qmckl_provide_jastrow_champ_factor_ee", + "Unable to free ctx->jastrow_champ.factor_ee"); } - ctx->jastrow.factor_ee = NULL; + ctx->jastrow_champ.factor_ee = NULL; } } /* Allocate array */ - if (ctx->jastrow.factor_ee == NULL) { + if (ctx->jastrow_champ.factor_ee == NULL) { qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; mem_info.size = ctx->electron.walker.num * sizeof(double); @@ -2213,26 +2216,26 @@ qmckl_exit_code qmckl_provide_jastrow_factor_ee(qmckl_context context) if (factor_ee == NULL) { return qmckl_failwith( context, QMCKL_ALLOCATION_FAILED, - "qmckl_provide_jastrow_factor_ee", + "qmckl_provide_jastrow_champ_factor_ee", NULL); } - ctx->jastrow.factor_ee = factor_ee; + ctx->jastrow_champ.factor_ee = factor_ee; } rc = qmckl_compute_factor_ee(context, ctx->electron.walker.num, ctx->electron.num, ctx->electron.up_num, - ctx->jastrow.bord_num, - ctx->jastrow.b_vector, - ctx->jastrow.ee_distance_rescaled, - ctx->jastrow.asymp_jasb, - ctx->jastrow.factor_ee); + ctx->jastrow_champ.bord_num, + ctx->jastrow_champ.b_vector, + ctx->jastrow_champ.ee_distance_rescaled, + ctx->jastrow_champ.asymp_jasb, + ctx->jastrow_champ.factor_ee); if (rc != QMCKL_SUCCESS) { return rc; } - ctx->jastrow.factor_ee_date = ctx->date; + ctx->jastrow_champ.factor_ee_date = ctx->date; } return QMCKL_SUCCESS; @@ -2527,11 +2530,11 @@ print("factor_ee :",factor_ee) #+begin_src c :tangle (eval c_test) /* Check if Jastrow is properly initialized */ -assert(qmckl_jastrow_provided(context)); +assert(qmckl_jastrow_champ_provided(context)); double factor_ee[walk_num]; rc = qmckl_check(context, - qmckl_get_jastrow_factor_ee(context, factor_ee, walk_num) + qmckl_get_jastrow_champ_factor_ee(context, factor_ee, walk_num) ); // calculate factor_ee @@ -2556,14 +2559,14 @@ assert(fabs(factor_ee[0]+4.282760865958113) < 1.e-12); **** Get #+begin_src c :comments org :tangle (eval h_func) :noweb yes qmckl_exit_code -qmckl_get_jastrow_factor_ee_deriv_e(qmckl_context context, +qmckl_get_jastrow_champ_factor_ee_deriv_e(qmckl_context context, double* const factor_ee_deriv_e, const int64_t size_max); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none qmckl_exit_code -qmckl_get_jastrow_factor_ee_deriv_e(qmckl_context context, +qmckl_get_jastrow_champ_factor_ee_deriv_e(qmckl_context context, double* const factor_ee_deriv_e, const int64_t size_max) { @@ -2573,7 +2576,7 @@ qmckl_get_jastrow_factor_ee_deriv_e(qmckl_context context, qmckl_exit_code rc; - rc = qmckl_provide_jastrow_factor_ee_deriv_e(context); + rc = qmckl_provide_jastrow_champ_factor_ee_deriv_e(context); if (rc != QMCKL_SUCCESS) return rc; qmckl_context_struct* const ctx = (qmckl_context_struct*) context; @@ -2583,11 +2586,11 @@ qmckl_get_jastrow_factor_ee_deriv_e(qmckl_context context, if (size_max < sze) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_get_jastrow_factor_ee_deriv_e", + "qmckl_get_jastrow_champ_factor_ee_deriv_e", "Array too small. Expected 4*walk_num*elec_num"); } - memcpy(factor_ee_deriv_e, ctx->jastrow.factor_ee_deriv_e, sze * sizeof(double)); + memcpy(factor_ee_deriv_e, ctx->jastrow_champ.factor_ee_deriv_e, sze * sizeof(double)); return QMCKL_SUCCESS; } @@ -2595,11 +2598,11 @@ qmckl_get_jastrow_factor_ee_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_jastrow_factor_ee_deriv_e(qmckl_context context); +qmckl_exit_code qmckl_provide_jastrow_champ_factor_ee_deriv_e(qmckl_context context); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none -qmckl_exit_code qmckl_provide_jastrow_factor_ee_deriv_e(qmckl_context context) +qmckl_exit_code qmckl_provide_jastrow_champ_factor_ee_deriv_e(qmckl_context context) { qmckl_exit_code rc; @@ -2607,17 +2610,17 @@ qmckl_exit_code qmckl_provide_jastrow_factor_ee_deriv_e(qmckl_context context) if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return qmckl_failwith( context, QMCKL_INVALID_CONTEXT, - "qmckl_provide_jastrow_factor_ee_deriv_e", + "qmckl_provide_jastrow_champ_factor_ee_deriv_e", NULL); } qmckl_context_struct* const ctx = (qmckl_context_struct*) context; assert (ctx != NULL); - if (!ctx->jastrow.provided) { + if (!ctx->jastrow_champ.provided) { return qmckl_failwith( context, QMCKL_NOT_PROVIDED, - "qmckl_provide_jastrow_factor_ee_deriv_e", + "qmckl_provide_jastrow_champ_factor_ee_deriv_e", NULL); } @@ -2630,22 +2633,22 @@ qmckl_exit_code qmckl_provide_jastrow_factor_ee_deriv_e(qmckl_context context) if(rc != QMCKL_SUCCESS) return rc; /* Compute if necessary */ - if (ctx->date > ctx->jastrow.factor_ee_deriv_e_date) { + if (ctx->date > ctx->jastrow_champ.factor_ee_deriv_e_date) { if (ctx->electron.walker.num > ctx->electron.walker_old.num) { - if (ctx->jastrow.factor_ee_deriv_e != NULL) { - rc = qmckl_free(context, ctx->jastrow.factor_ee_deriv_e); + if (ctx->jastrow_champ.factor_ee_deriv_e != NULL) { + rc = qmckl_free(context, ctx->jastrow_champ.factor_ee_deriv_e); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, - "qmckl_provide_jastrow_factor_ee_deriv_e", - "Unable to free ctx->jastrow.factor_ee_deriv_e"); + "qmckl_provide_jastrow_champ_factor_ee_deriv_e", + "Unable to free ctx->jastrow_champ.factor_ee_deriv_e"); } - ctx->jastrow.factor_ee_deriv_e = NULL; + ctx->jastrow_champ.factor_ee_deriv_e = NULL; } } /* Allocate array */ - if (ctx->jastrow.factor_ee_deriv_e == NULL) { + if (ctx->jastrow_champ.factor_ee_deriv_e == NULL) { qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; mem_info.size = ctx->electron.walker.num * 4 * ctx->electron.num * sizeof(double); @@ -2654,26 +2657,26 @@ qmckl_exit_code qmckl_provide_jastrow_factor_ee_deriv_e(qmckl_context context) if (factor_ee_deriv_e == NULL) { return qmckl_failwith( context, QMCKL_ALLOCATION_FAILED, - "qmckl_provide_jastrow_factor_ee_deriv_e", + "qmckl_provide_jastrow_champ_factor_ee_deriv_e", NULL); } - ctx->jastrow.factor_ee_deriv_e = factor_ee_deriv_e; + ctx->jastrow_champ.factor_ee_deriv_e = factor_ee_deriv_e; } rc = qmckl_compute_factor_ee_deriv_e(context, ctx->electron.walker.num, ctx->electron.num, ctx->electron.up_num, - ctx->jastrow.bord_num, - ctx->jastrow.b_vector, - ctx->jastrow.ee_distance_rescaled, - ctx->jastrow.ee_distance_rescaled_deriv_e, - ctx->jastrow.factor_ee_deriv_e); + ctx->jastrow_champ.bord_num, + ctx->jastrow_champ.b_vector, + ctx->jastrow_champ.ee_distance_rescaled, + ctx->jastrow_champ.ee_distance_rescaled_deriv_e, + ctx->jastrow_champ.factor_ee_deriv_e); if (rc != QMCKL_SUCCESS) { return rc; } - ctx->jastrow.factor_ee_date = ctx->date; + ctx->jastrow_champ.factor_ee_date = ctx->date; } return QMCKL_SUCCESS; @@ -3133,11 +3136,11 @@ print("factor_ee_deriv_e[3][0]:",factor_ee_deriv_e[3][0]) #+begin_src c :tangle (eval c_test) /* Check if Jastrow is properly initialized */ -assert(qmckl_jastrow_provided(context)); +assert(qmckl_jastrow_champ_provided(context)); // calculate factor_ee_deriv_e double factor_ee_deriv_e[walk_num][4][elec_num]; -rc = qmckl_get_jastrow_factor_ee_deriv_e(context, &(factor_ee_deriv_e[0][0][0]),walk_num*4*elec_num); +rc = qmckl_get_jastrow_champ_factor_ee_deriv_e(context, &(factor_ee_deriv_e[0][0][0]),walk_num*4*elec_num); // check factor_ee_deriv_e assert(fabs(factor_ee_deriv_e[0][0][0]-0.16364894652107934) < 1.e-12); @@ -3160,11 +3163,11 @@ assert(fabs(factor_ee_deriv_e[0][3][0]-1.5111672803213185 ) < 1.e-12); **** Get #+begin_src c :comments org :tangle (eval h_func) :noweb yes -qmckl_exit_code qmckl_get_jastrow_ee_distance_rescaled(qmckl_context context, double* const distance_rescaled); +qmckl_exit_code qmckl_get_jastrow_champ_ee_distance_rescaled(qmckl_context context, double* const distance_rescaled); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none -qmckl_exit_code qmckl_get_jastrow_ee_distance_rescaled(qmckl_context context, double* const distance_rescaled) +qmckl_exit_code qmckl_get_jastrow_champ_ee_distance_rescaled(qmckl_context context, double* const distance_rescaled) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return QMCKL_NULL_CONTEXT; @@ -3179,7 +3182,7 @@ qmckl_exit_code qmckl_get_jastrow_ee_distance_rescaled(qmckl_context context, do assert (ctx != NULL); size_t sze = ctx->electron.num * ctx->electron.num * ctx->electron.walker.num; - memcpy(distance_rescaled, ctx->jastrow.ee_distance_rescaled, sze * sizeof(double)); + memcpy(distance_rescaled, ctx->jastrow_champ.ee_distance_rescaled, sze * sizeof(double)); return QMCKL_SUCCESS; } @@ -3204,22 +3207,22 @@ qmckl_exit_code qmckl_provide_ee_distance_rescaled(qmckl_context context) /* Compute if necessary */ - if (ctx->electron.walker.point.date > ctx->jastrow.ee_distance_rescaled_date) { + if (ctx->electron.walker.point.date > ctx->jastrow_champ.ee_distance_rescaled_date) { if (ctx->electron.walker.num > ctx->electron.walker_old.num) { - if (ctx->jastrow.ee_distance_rescaled != NULL) { - qmckl_exit_code rc = qmckl_free(context, ctx->jastrow.ee_distance_rescaled); + if (ctx->jastrow_champ.ee_distance_rescaled != NULL) { + qmckl_exit_code rc = qmckl_free(context, ctx->jastrow_champ.ee_distance_rescaled); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, "qmckl_provide_ee_distance_rescaled", - "Unable to free ctx->jastrow.ee_distance_rescaled"); + "Unable to free ctx->jastrow_champ.ee_distance_rescaled"); } - ctx->jastrow.ee_distance_rescaled = NULL; + ctx->jastrow_champ.ee_distance_rescaled = NULL; } } /* Allocate array */ - if (ctx->jastrow.ee_distance_rescaled == NULL) { + if (ctx->jastrow_champ.ee_distance_rescaled == NULL) { qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; mem_info.size = ctx->electron.num * ctx->electron.num * @@ -3232,21 +3235,21 @@ qmckl_exit_code qmckl_provide_ee_distance_rescaled(qmckl_context context) "qmckl_provide_ee_distance_rescaled", NULL); } - ctx->jastrow.ee_distance_rescaled = ee_distance_rescaled; + ctx->jastrow_champ.ee_distance_rescaled = ee_distance_rescaled; } qmckl_exit_code rc = qmckl_compute_ee_distance_rescaled(context, ctx->electron.num, - ctx->jastrow.rescale_factor_ee, + ctx->jastrow_champ.rescale_factor_ee, ctx->electron.walker.num, ctx->electron.walker.point.coord.data, - ctx->jastrow.ee_distance_rescaled); + ctx->jastrow_champ.ee_distance_rescaled); if (rc != QMCKL_SUCCESS) { return rc; } - ctx->jastrow.ee_distance_rescaled_date = ctx->date; + ctx->jastrow_champ.ee_distance_rescaled_date = ctx->date; } return QMCKL_SUCCESS; @@ -3383,7 +3386,7 @@ assert(qmckl_electron_provided(context)); double ee_distance_rescaled[walk_num * elec_num * elec_num]; -rc = qmckl_get_jastrow_ee_distance_rescaled(context, ee_distance_rescaled); +rc = qmckl_get_jastrow_champ_ee_distance_rescaled(context, ee_distance_rescaled); // (e1,e2,w) // (0,0,0) == 0. @@ -3418,11 +3421,11 @@ assert(fabs(ee_distance_rescaled[5*elec_num+6]-0.3622098222364193) < 1.e-12); **** Get #+begin_src c :comments org :tangle (eval h_func) :noweb yes -qmckl_exit_code qmckl_get_jastrow_ee_distance_rescaled_deriv_e(qmckl_context context, double* const distance_rescaled_deriv_e); +qmckl_exit_code qmckl_get_jastrow_champ_ee_distance_rescaled_deriv_e(qmckl_context context, double* const distance_rescaled_deriv_e); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none -qmckl_exit_code qmckl_get_jastrow_ee_distance_rescaled_deriv_e(qmckl_context context, double* const distance_rescaled_deriv_e) +qmckl_exit_code qmckl_get_jastrow_champ_ee_distance_rescaled_deriv_e(qmckl_context context, double* const distance_rescaled_deriv_e) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return QMCKL_NULL_CONTEXT; @@ -3437,7 +3440,7 @@ qmckl_exit_code qmckl_get_jastrow_ee_distance_rescaled_deriv_e(qmckl_context con assert (ctx != NULL); size_t sze = 4 * ctx->electron.num * ctx->electron.num * ctx->electron.walker.num; - memcpy(distance_rescaled_deriv_e, ctx->jastrow.ee_distance_rescaled_deriv_e, sze * sizeof(double)); + memcpy(distance_rescaled_deriv_e, ctx->jastrow_champ.ee_distance_rescaled_deriv_e, sze * sizeof(double)); return QMCKL_SUCCESS; } @@ -3462,22 +3465,22 @@ qmckl_exit_code qmckl_provide_ee_distance_rescaled_deriv_e(qmckl_context context /* Compute if necessary */ - if (ctx->electron.walker.point.date > ctx->jastrow.ee_distance_rescaled_deriv_e_date) { + if (ctx->electron.walker.point.date > ctx->jastrow_champ.ee_distance_rescaled_deriv_e_date) { if (ctx->electron.walker.num > ctx->electron.walker_old.num) { - if (ctx->jastrow.ee_distance_rescaled_deriv_e != NULL) { - qmckl_exit_code rc = qmckl_free(context, ctx->jastrow.ee_distance_rescaled_deriv_e); + if (ctx->jastrow_champ.ee_distance_rescaled_deriv_e != NULL) { + qmckl_exit_code rc = qmckl_free(context, ctx->jastrow_champ.ee_distance_rescaled_deriv_e); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, "qmckl_provide_ee_distance_rescaled_deriv_e", - "Unable to free ctx->jastrow.ee_distance_rescaled_deriv_e"); + "Unable to free ctx->jastrow_champ.ee_distance_rescaled_deriv_e"); } - ctx->jastrow.ee_distance_rescaled_deriv_e = NULL; + ctx->jastrow_champ.ee_distance_rescaled_deriv_e = NULL; } } /* Allocate array */ - if (ctx->jastrow.ee_distance_rescaled_deriv_e == NULL) { + if (ctx->jastrow_champ.ee_distance_rescaled_deriv_e == NULL) { qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; mem_info.size = 4 * ctx->electron.num * ctx->electron.num * @@ -3490,21 +3493,21 @@ qmckl_exit_code qmckl_provide_ee_distance_rescaled_deriv_e(qmckl_context context "qmckl_provide_ee_distance_rescaled_deriv_e", NULL); } - ctx->jastrow.ee_distance_rescaled_deriv_e = ee_distance_rescaled_deriv_e; + ctx->jastrow_champ.ee_distance_rescaled_deriv_e = ee_distance_rescaled_deriv_e; } qmckl_exit_code rc = qmckl_compute_ee_distance_rescaled_deriv_e(context, ctx->electron.num, - ctx->jastrow.rescale_factor_ee, + ctx->jastrow_champ.rescale_factor_ee, ctx->electron.walker.num, ctx->electron.walker.point.coord.data, - ctx->jastrow.ee_distance_rescaled_deriv_e); + ctx->jastrow_champ.ee_distance_rescaled_deriv_e); if (rc != QMCKL_SUCCESS) { return rc; } - ctx->jastrow.ee_distance_rescaled_date = ctx->date; + ctx->jastrow_champ.ee_distance_rescaled_date = ctx->date; } return QMCKL_SUCCESS; @@ -3621,7 +3624,7 @@ assert(qmckl_electron_provided(context)); double ee_distance_rescaled_deriv_e[4 * walk_num * elec_num * elec_num]; -rc = qmckl_get_jastrow_ee_distance_rescaled_deriv_e(context, ee_distance_rescaled_deriv_e); +rc = qmckl_get_jastrow_champ_ee_distance_rescaled_deriv_e(context, ee_distance_rescaled_deriv_e); // TODO: Get exact values //// (e1,e2,w) @@ -3659,21 +3662,21 @@ rc = qmckl_get_jastrow_ee_distance_rescaled_deriv_e(context, ee_distance_rescale **** Get #+begin_src c :comments org :tangle (eval h_func) :noweb yes qmckl_exit_code -qmckl_get_jastrow_asymp_jasa(qmckl_context context, +qmckl_get_jastrow_champ_asymp_jasa(qmckl_context context, double* const asymp_jasa, const int64_t size_max); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none qmckl_exit_code -qmckl_get_jastrow_asymp_jasa(qmckl_context context, +qmckl_get_jastrow_champ_asymp_jasa(qmckl_context context, double* const asymp_jasa, const int64_t size_max) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return qmckl_failwith( context, QMCKL_INVALID_CONTEXT, - "qmckl_get_jastrow_asymp_jasa", + "qmckl_get_jastrow_champ_asymp_jasa", NULL); } @@ -3681,21 +3684,21 @@ qmckl_get_jastrow_asymp_jasa(qmckl_context context, /* Provided in finalize_jastrow */ /* qmckl_exit_code rc; - rc = qmckl_provide_jastrow_asymp_jasa(context); + rc = qmckl_provide_jastrow_champ_asymp_jasa(context); if(rc != QMCKL_SUCCESS) return rc; */ qmckl_context_struct* const ctx = (qmckl_context_struct*) context; assert (ctx != NULL); - int64_t sze = ctx->jastrow.type_nucl_num; + int64_t sze = ctx->jastrow_champ.type_nucl_num; if (size_max < sze) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_get_jastrow_asymp_jasa", + "qmckl_get_jastrow_champ_asymp_jasa", "Array too small. Expected nucleus.num"); } - memcpy(asymp_jasa, ctx->jastrow.asymp_jasa, sze * sizeof(double)); + memcpy(asymp_jasa, ctx->jastrow_champ.asymp_jasa, sze * sizeof(double)); return QMCKL_SUCCESS; } @@ -3705,7 +3708,7 @@ qmckl_get_jastrow_asymp_jasa(qmckl_context context, #+begin_src f90 :tangle (eval fh_func) :comments org interface - integer(qmckl_exit_code) function qmckl_get_jastrow_asymp_jasa(context, & + integer(qmckl_exit_code) function qmckl_get_jastrow_champ_asymp_jasa(context, & asymp_jasa, size_max) bind(C) use, intrinsic :: iso_c_binding import @@ -3713,17 +3716,17 @@ interface integer (qmckl_context) , intent(in), value :: context integer(c_int64_t), intent(in), value :: size_max double precision, intent(out) :: asymp_jasa(size_max) - end function qmckl_get_jastrow_asymp_jasa + end function qmckl_get_jastrow_champ_asymp_jasa end interface #+end_src **** Provide :noexport: #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none -qmckl_exit_code qmckl_provide_jastrow_asymp_jasa(qmckl_context context); +qmckl_exit_code qmckl_provide_jastrow_champ_asymp_jasa(qmckl_context context); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none -qmckl_exit_code qmckl_provide_jastrow_asymp_jasa(qmckl_context context) +qmckl_exit_code qmckl_provide_jastrow_champ_asymp_jasa(qmckl_context context) { qmckl_exit_code rc; @@ -3731,28 +3734,28 @@ qmckl_exit_code qmckl_provide_jastrow_asymp_jasa(qmckl_context context) if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return qmckl_failwith( context, QMCKL_INVALID_CONTEXT, - "qmckl_provide_jastrow_asymp_jasa", + "qmckl_provide_jastrow_champ_asymp_jasa", NULL); } qmckl_context_struct* const ctx = (qmckl_context_struct*) context; assert (ctx != NULL); - if (!ctx->jastrow.provided) { + if (!ctx->jastrow_champ.provided) { return qmckl_failwith( context, QMCKL_NOT_PROVIDED, - "qmckl_provide_jastrow_asymp_jasa", + "qmckl_provide_jastrow_champ_asymp_jasa", NULL); } /* Compute if necessary */ - if (ctx->date > ctx->jastrow.asymp_jasa_date) { + if (ctx->date > ctx->jastrow_champ.asymp_jasa_date) { /* Allocate array */ - if (ctx->jastrow.asymp_jasa == NULL) { + if (ctx->jastrow_champ.asymp_jasa == NULL) { qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; - mem_info.size = ctx->jastrow.type_nucl_num * sizeof(double); + mem_info.size = ctx->jastrow_champ.type_nucl_num * sizeof(double); double* asymp_jasa = (double*) qmckl_malloc(context, mem_info); if (asymp_jasa == NULL) { @@ -3761,20 +3764,20 @@ qmckl_exit_code qmckl_provide_jastrow_asymp_jasa(qmckl_context context) "qmckl_asymp_jasa", NULL); } - ctx->jastrow.asymp_jasa = asymp_jasa; + ctx->jastrow_champ.asymp_jasa = asymp_jasa; } - rc = qmckl_compute_jastrow_asymp_jasa(context, - ctx->jastrow.aord_num, - ctx->jastrow.type_nucl_num, - ctx->jastrow.a_vector, - ctx->jastrow.rescale_factor_en, - ctx->jastrow.asymp_jasa); + rc = qmckl_compute_jastrow_champ_asymp_jasa(context, + ctx->jastrow_champ.aord_num, + ctx->jastrow_champ.type_nucl_num, + ctx->jastrow_champ.a_vector, + ctx->jastrow_champ.rescale_factor_en, + ctx->jastrow_champ.asymp_jasa); if (rc != QMCKL_SUCCESS) { return rc; } - ctx->jastrow.asymp_jasa_date = ctx->date; + ctx->jastrow_champ.asymp_jasa_date = ctx->date; } return QMCKL_SUCCESS; @@ -3783,7 +3786,7 @@ qmckl_exit_code qmckl_provide_jastrow_asymp_jasa(qmckl_context context) **** Compute :PROPERTIES: - :Name: qmckl_compute_jastrow_asymp_jasa + :Name: qmckl_compute_jastrow_champ_asymp_jasa :CRetType: qmckl_exit_code :FRetType: qmckl_exit_code :END: @@ -3799,7 +3802,7 @@ qmckl_exit_code qmckl_provide_jastrow_asymp_jasa(qmckl_context context) | ~asymp_jasa~ | ~double[type_nucl_num]~ | out | Asymptotic value | #+begin_src f90 :comments org :tangle (eval f) :noweb yes -integer function qmckl_compute_jastrow_asymp_jasa_f(context, aord_num, type_nucl_num, a_vector, & +integer function qmckl_compute_jastrow_champ_asymp_jasa_f(context, aord_num, type_nucl_num, a_vector, & rescale_factor_en, asymp_jasa) & result(info) use qmckl @@ -3841,14 +3844,14 @@ integer function qmckl_compute_jastrow_asymp_jasa_f(context, aord_num, type_nucl end do -end function qmckl_compute_jastrow_asymp_jasa_f +end function qmckl_compute_jastrow_champ_asymp_jasa_f #+end_src #+CALL: generate_c_interface(table=qmckl_asymp_jasa_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_asymp_jasa & + integer(c_int32_t) function qmckl_compute_jastrow_champ_asymp_jasa & (context, aord_num, type_nucl_num, a_vector, rescale_factor_en, asymp_jasa) & bind(C) result(info) @@ -3862,16 +3865,16 @@ end function qmckl_compute_jastrow_asymp_jasa_f real (c_double ) , intent(in) :: rescale_factor_en(type_nucl_num) real (c_double ) , intent(out) :: asymp_jasa(type_nucl_num) - integer(c_int32_t), external :: qmckl_compute_jastrow_asymp_jasa_f - info = qmckl_compute_jastrow_asymp_jasa_f & + integer(c_int32_t), external :: qmckl_compute_jastrow_champ_asymp_jasa_f + info = qmckl_compute_jastrow_champ_asymp_jasa_f & (context, aord_num, type_nucl_num, a_vector, rescale_factor_en, asymp_jasa) - end function qmckl_compute_jastrow_asymp_jasa + end function qmckl_compute_jastrow_champ_asymp_jasa #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes /* -qmckl_exit_code qmckl_compute_jastrow_asymp_jasa ( +qmckl_exit_code qmckl_compute_jastrow_champ_asymp_jasa ( const qmckl_context context, const int64_t aord_num, const int64_t type_nucl_num, @@ -3907,7 +3910,7 @@ qmckl_exit_code qmckl_compute_jastrow_asymp_jasa ( #+RESULTS: #+begin_src c :tangle (eval h_func) :comments org - qmckl_exit_code qmckl_compute_jastrow_asymp_jasa ( + qmckl_exit_code qmckl_compute_jastrow_champ_asymp_jasa ( const qmckl_context context, const int64_t aord_num, const int64_t type_nucl_num, @@ -3937,7 +3940,7 @@ print("asymp_jasa[i] : ", asymp_jasa) #+begin_src c :tangle (eval c_test) double asymp_jasa[2]; -rc = qmckl_get_jastrow_asymp_jasa(context, asymp_jasa, type_nucl_num); +rc = qmckl_get_jastrow_champ_asymp_jasa(context, asymp_jasa, type_nucl_num); // calculate asymp_jasb printf("%e %e\n", asymp_jasa[0], -0.548554); @@ -3958,21 +3961,21 @@ assert(fabs(-0.548554 - asymp_jasa[0]) < 1.e-12); **** Get #+begin_src c :comments org :tangle (eval h_func) :noweb yes qmckl_exit_code -qmckl_get_jastrow_factor_en(qmckl_context context, +qmckl_get_jastrow_champ_factor_en(qmckl_context context, double* const factor_en, const int64_t size_max); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none qmckl_exit_code -qmckl_get_jastrow_factor_en(qmckl_context context, +qmckl_get_jastrow_champ_factor_en(qmckl_context context, double* const factor_en, const int64_t size_max) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return qmckl_failwith( context, QMCKL_INVALID_CONTEXT, - "qmckl_get_jastrow_factor_en", + "qmckl_get_jastrow_champ_factor_en", NULL); } @@ -3981,17 +3984,17 @@ qmckl_get_jastrow_factor_en(qmckl_context context, qmckl_exit_code rc; - rc = qmckl_provide_jastrow_factor_en(context); + rc = qmckl_provide_jastrow_champ_factor_en(context); if (rc != QMCKL_SUCCESS) return rc; int64_t sze=ctx->electron.walker.num; if (size_max < sze) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_get_jastrow_factor_en", + "qmckl_get_jastrow_champ_factor_en", "Array too small. Expected walker.num"); } - memcpy(factor_en, ctx->jastrow.factor_en, sze*sizeof(double)); + memcpy(factor_en, ctx->jastrow_champ.factor_en, sze*sizeof(double)); return QMCKL_SUCCESS; } @@ -4001,7 +4004,7 @@ qmckl_get_jastrow_factor_en(qmckl_context context, #+begin_src f90 :tangle (eval fh_func) :comments org interface - integer(qmckl_exit_code) function qmckl_get_jastrow_factor_en (context, & + integer(qmckl_exit_code) function qmckl_get_jastrow_champ_factor_en (context, & factor_en, size_max) bind(C) use, intrinsic :: iso_c_binding import @@ -4009,17 +4012,17 @@ interface integer (qmckl_context) , intent(in), value :: context integer(c_int64_t), intent(in), value :: size_max double precision, intent(out) :: factor_en(size_max) - end function qmckl_get_jastrow_factor_en + end function qmckl_get_jastrow_champ_factor_en end interface #+end_src **** Provide :noexport: #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none -qmckl_exit_code qmckl_provide_jastrow_factor_en(qmckl_context context); +qmckl_exit_code qmckl_provide_jastrow_champ_factor_en(qmckl_context context); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none -qmckl_exit_code qmckl_provide_jastrow_factor_en(qmckl_context context) +qmckl_exit_code qmckl_provide_jastrow_champ_factor_en(qmckl_context context) { qmckl_exit_code rc; @@ -4027,17 +4030,17 @@ qmckl_exit_code qmckl_provide_jastrow_factor_en(qmckl_context context) if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return qmckl_failwith( context, QMCKL_INVALID_CONTEXT, - "qmckl_provide_jastrow_factor_en", + "qmckl_provide_jastrow_champ_factor_en", NULL); } qmckl_context_struct* const ctx = (qmckl_context_struct*) context; assert (ctx != NULL); - if (!ctx->jastrow.provided) { + if (!ctx->jastrow_champ.provided) { return qmckl_failwith( context, QMCKL_NOT_PROVIDED, - "qmckl_provide_jastrow_factor_en", + "qmckl_provide_jastrow_champ_factor_en", NULL); } @@ -4047,27 +4050,27 @@ qmckl_exit_code qmckl_provide_jastrow_factor_en(qmckl_context context) /* Provided in finalize_jastrow */ /* - rc = qmckl_provide_jastrow_asymp_jasa(context); + rc = qmckl_provide_jastrow_champ_asymp_jasa(context); if(rc != QMCKL_SUCCESS) return rc; */ /* Compute if necessary */ - if (ctx->date > ctx->jastrow.factor_en_date) { + if (ctx->date > ctx->jastrow_champ.factor_en_date) { if (ctx->electron.walker.num > ctx->electron.walker_old.num) { - if (ctx->jastrow.factor_en != NULL) { - rc = qmckl_free(context, ctx->jastrow.factor_en); + if (ctx->jastrow_champ.factor_en != NULL) { + rc = qmckl_free(context, ctx->jastrow_champ.factor_en); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, - "qmckl_provide_jastrow_factor_en", - "Unable to free ctx->jastrow.factor_en"); + "qmckl_provide_jastrow_champ_factor_en", + "Unable to free ctx->jastrow_champ.factor_en"); } - ctx->jastrow.factor_en = NULL; + ctx->jastrow_champ.factor_en = NULL; } } /* Allocate array */ - if (ctx->jastrow.factor_en == NULL) { + if (ctx->jastrow_champ.factor_en == NULL) { qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; mem_info.size = ctx->electron.walker.num * sizeof(double); @@ -4076,28 +4079,28 @@ qmckl_exit_code qmckl_provide_jastrow_factor_en(qmckl_context context) if (factor_en == NULL) { return qmckl_failwith( context, QMCKL_ALLOCATION_FAILED, - "qmckl_provide_jastrow_factor_en", + "qmckl_provide_jastrow_champ_factor_en", NULL); } - ctx->jastrow.factor_en = factor_en; + ctx->jastrow_champ.factor_en = factor_en; } rc = qmckl_compute_factor_en(context, ctx->electron.walker.num, ctx->electron.num, ctx->nucleus.num, - ctx->jastrow.type_nucl_num, - ctx->jastrow.type_nucl_vector, - ctx->jastrow.aord_num, - ctx->jastrow.a_vector, - ctx->jastrow.en_distance_rescaled, - ctx->jastrow.asymp_jasa, - ctx->jastrow.factor_en); + ctx->jastrow_champ.type_nucl_num, + ctx->jastrow_champ.type_nucl_vector, + ctx->jastrow_champ.aord_num, + ctx->jastrow_champ.a_vector, + ctx->jastrow_champ.en_distance_rescaled, + ctx->jastrow_champ.asymp_jasa, + ctx->jastrow_champ.factor_en); if (rc != QMCKL_SUCCESS) { return rc; } - ctx->jastrow.factor_en_date = ctx->date; + ctx->jastrow_champ.factor_en_date = ctx->date; } return QMCKL_SUCCESS; @@ -4383,10 +4386,10 @@ print("factor_en :",factor_en) #+begin_src c :tangle (eval c_test) /* Check if Jastrow is properly initialized */ -assert(qmckl_jastrow_provided(context)); +assert(qmckl_jastrow_champ_provided(context)); double factor_en[walk_num]; -rc = qmckl_get_jastrow_factor_en(context, factor_en,walk_num); +rc = qmckl_get_jastrow_champ_factor_en(context, factor_en,walk_num); // calculate factor_en assert(fabs(5.1052574308112755 - factor_en[0]) < 1.e-12); @@ -4403,14 +4406,14 @@ assert(fabs(5.1052574308112755 - factor_en[0]) < 1.e-12); **** Get #+begin_src c :comments org :tangle (eval h_func) :noweb yes qmckl_exit_code -qmckl_get_jastrow_factor_en_deriv_e(qmckl_context context, +qmckl_get_jastrow_champ_factor_en_deriv_e(qmckl_context context, double* const factor_en_deriv_e, const int64_t size_max); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none qmckl_exit_code -qmckl_get_jastrow_factor_en_deriv_e(qmckl_context context, +qmckl_get_jastrow_champ_factor_en_deriv_e(qmckl_context context, double* const factor_en_deriv_e, const int64_t size_max) { @@ -4420,7 +4423,7 @@ qmckl_get_jastrow_factor_en_deriv_e(qmckl_context context, qmckl_exit_code rc; - rc = qmckl_provide_jastrow_factor_en_deriv_e(context); + rc = qmckl_provide_jastrow_champ_factor_en_deriv_e(context); if (rc != QMCKL_SUCCESS) return rc; qmckl_context_struct* const ctx = (qmckl_context_struct*) context; @@ -4430,10 +4433,10 @@ qmckl_get_jastrow_factor_en_deriv_e(qmckl_context context, if (size_max < sze) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_get_jastrow_factor_en_deriv_e", + "qmckl_get_jastrow_champ_factor_en_deriv_e", "Array too small. Expected 4*walker.num*elec_num"); } - memcpy(factor_en_deriv_e, ctx->jastrow.factor_en_deriv_e, sze*sizeof(double)); + memcpy(factor_en_deriv_e, ctx->jastrow_champ.factor_en_deriv_e, sze*sizeof(double)); return QMCKL_SUCCESS; } @@ -4441,11 +4444,11 @@ qmckl_get_jastrow_factor_en_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_jastrow_factor_en_deriv_e(qmckl_context context); +qmckl_exit_code qmckl_provide_jastrow_champ_factor_en_deriv_e(qmckl_context context); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none -qmckl_exit_code qmckl_provide_jastrow_factor_en_deriv_e(qmckl_context context) +qmckl_exit_code qmckl_provide_jastrow_champ_factor_en_deriv_e(qmckl_context context) { qmckl_exit_code rc; @@ -4453,17 +4456,17 @@ qmckl_exit_code qmckl_provide_jastrow_factor_en_deriv_e(qmckl_context context) if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return qmckl_failwith( context, QMCKL_INVALID_CONTEXT, - "qmckl_provide_jastrow_factor_en_deriv_e", + "qmckl_provide_jastrow_champ_factor_en_deriv_e", NULL); } qmckl_context_struct* const ctx = (qmckl_context_struct*) context; assert (ctx != NULL); - if (!ctx->jastrow.provided) { + if (!ctx->jastrow_champ.provided) { return qmckl_failwith( context, QMCKL_NOT_PROVIDED, - "qmckl_provide_jastrow_factor_en_deriv_e", + "qmckl_provide_jastrow_champ_factor_en_deriv_e", NULL); } @@ -4476,22 +4479,22 @@ qmckl_exit_code qmckl_provide_jastrow_factor_en_deriv_e(qmckl_context context) if(rc != QMCKL_SUCCESS) return rc; /* Compute if necessary */ - if (ctx->date > ctx->jastrow.factor_en_deriv_e_date) { + if (ctx->date > ctx->jastrow_champ.factor_en_deriv_e_date) { if (ctx->electron.walker.num > ctx->electron.walker_old.num) { - if (ctx->jastrow.factor_en_deriv_e != NULL) { - rc = qmckl_free(context, ctx->jastrow.factor_en_deriv_e); + if (ctx->jastrow_champ.factor_en_deriv_e != NULL) { + rc = qmckl_free(context, ctx->jastrow_champ.factor_en_deriv_e); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, - "qmckl_provide_jastrow_factor_en_deriv_e", - "Unable to free ctx->jastrow.factor_en_deriv_e"); + "qmckl_provide_jastrow_champ_factor_en_deriv_e", + "Unable to free ctx->jastrow_champ.factor_en_deriv_e"); } - ctx->jastrow.factor_en_deriv_e = NULL; + ctx->jastrow_champ.factor_en_deriv_e = NULL; } } /* Allocate array */ - if (ctx->jastrow.factor_en_deriv_e == NULL) { + if (ctx->jastrow_champ.factor_en_deriv_e == NULL) { qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; mem_info.size = ctx->electron.walker.num * 4 * ctx->electron.num * sizeof(double); @@ -4500,28 +4503,28 @@ qmckl_exit_code qmckl_provide_jastrow_factor_en_deriv_e(qmckl_context context) if (factor_en_deriv_e == NULL) { return qmckl_failwith( context, QMCKL_ALLOCATION_FAILED, - "qmckl_provide_jastrow_factor_en_deriv_e", + "qmckl_provide_jastrow_champ_factor_en_deriv_e", NULL); } - ctx->jastrow.factor_en_deriv_e = factor_en_deriv_e; + ctx->jastrow_champ.factor_en_deriv_e = factor_en_deriv_e; } rc = qmckl_compute_factor_en_deriv_e(context, ctx->electron.walker.num, ctx->electron.num, ctx->nucleus.num, - ctx->jastrow.type_nucl_num, - ctx->jastrow.type_nucl_vector, - ctx->jastrow.aord_num, - ctx->jastrow.a_vector, - ctx->jastrow.en_distance_rescaled, - ctx->jastrow.en_distance_rescaled_deriv_e, - ctx->jastrow.factor_en_deriv_e); + ctx->jastrow_champ.type_nucl_num, + ctx->jastrow_champ.type_nucl_vector, + ctx->jastrow_champ.aord_num, + ctx->jastrow_champ.a_vector, + ctx->jastrow_champ.en_distance_rescaled, + ctx->jastrow_champ.en_distance_rescaled_deriv_e, + ctx->jastrow_champ.factor_en_deriv_e); if (rc != QMCKL_SUCCESS) { return rc; } - ctx->jastrow.factor_en_deriv_e_date = ctx->date; + ctx->jastrow_champ.factor_en_deriv_e_date = ctx->date; } return QMCKL_SUCCESS; @@ -4817,11 +4820,11 @@ print("factor_en_deriv_e[3][0]:",factor_en_deriv_e[3][0]) #+begin_src c :tangle (eval c_test) /* Check if Jastrow is properly initialized */ -assert(qmckl_jastrow_provided(context)); +assert(qmckl_jastrow_champ_provided(context)); // calculate factor_en_deriv_e double factor_en_deriv_e[walk_num][4][elec_num]; -rc = qmckl_get_jastrow_factor_en_deriv_e(context, &(factor_en_deriv_e[0][0][0]),walk_num*4*elec_num); +rc = qmckl_get_jastrow_champ_factor_en_deriv_e(context, &(factor_en_deriv_e[0][0][0]),walk_num*4*elec_num); // check factor_en_deriv_e assert(fabs(factor_en_deriv_e[0][0][0]-0.11609919541763383) < 1.e-12); @@ -4866,7 +4869,7 @@ qmckl_exit_code qmckl_get_electron_en_distance_rescaled(qmckl_context context, d assert (ctx != NULL); size_t sze = ctx->electron.num * ctx->nucleus.num * ctx->electron.walker.num; - memcpy(distance_rescaled, ctx->jastrow.en_distance_rescaled, sze * sizeof(double)); + memcpy(distance_rescaled, ctx->jastrow_champ.en_distance_rescaled, sze * sizeof(double)); return QMCKL_SUCCESS; } @@ -4894,22 +4897,22 @@ qmckl_exit_code qmckl_provide_en_distance_rescaled(qmckl_context context) } /* Compute if necessary */ - if (ctx->electron.walker.point.date > ctx->jastrow.en_distance_rescaled_date) { + if (ctx->electron.walker.point.date > ctx->jastrow_champ.en_distance_rescaled_date) { if (ctx->electron.walker.num > ctx->electron.walker_old.num) { - if (ctx->jastrow.en_distance_rescaled != NULL) { - qmckl_exit_code rc = qmckl_free(context, ctx->jastrow.en_distance_rescaled); + if (ctx->jastrow_champ.en_distance_rescaled != NULL) { + qmckl_exit_code rc = qmckl_free(context, ctx->jastrow_champ.en_distance_rescaled); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, "qmckl_provide_en_distance_rescaled", - "Unable to free ctx->jastrow.en_distance_rescaled"); + "Unable to free ctx->jastrow_champ.en_distance_rescaled"); } - ctx->jastrow.en_distance_rescaled = NULL; + ctx->jastrow_champ.en_distance_rescaled = NULL; } } /* Allocate array */ - if (ctx->jastrow.en_distance_rescaled == NULL) { + if (ctx->jastrow_champ.en_distance_rescaled == NULL) { qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; mem_info.size = ctx->electron.num * ctx->nucleus.num * @@ -4922,25 +4925,25 @@ qmckl_exit_code qmckl_provide_en_distance_rescaled(qmckl_context context) "qmckl_provide_en_distance_rescaled", NULL); } - ctx->jastrow.en_distance_rescaled = en_distance_rescaled; + ctx->jastrow_champ.en_distance_rescaled = en_distance_rescaled; } qmckl_exit_code rc = qmckl_compute_en_distance_rescaled(context, ctx->electron.num, ctx->nucleus.num, - ctx->jastrow.type_nucl_num, - ctx->jastrow.type_nucl_vector, - ctx->jastrow.rescale_factor_en, + ctx->jastrow_champ.type_nucl_num, + ctx->jastrow_champ.type_nucl_vector, + ctx->jastrow_champ.rescale_factor_en, ctx->electron.walker.num, ctx->electron.walker.point.coord.data, ctx->nucleus.coord.data, - ctx->jastrow.en_distance_rescaled); + ctx->jastrow_champ.en_distance_rescaled); if (rc != QMCKL_SUCCESS) { return rc; } - ctx->jastrow.en_distance_rescaled_date = ctx->date; + ctx->jastrow_champ.en_distance_rescaled_date = ctx->date; } return QMCKL_SUCCESS; @@ -5183,7 +5186,7 @@ qmckl_exit_code qmckl_get_electron_en_distance_rescaled_deriv_e(qmckl_context co assert (ctx != NULL); size_t sze = 4 * ctx->electron.num * ctx->nucleus.num * ctx->electron.walker.num; - memcpy(distance_rescaled_deriv_e, ctx->jastrow.en_distance_rescaled_deriv_e, sze * sizeof(double)); + memcpy(distance_rescaled_deriv_e, ctx->jastrow_champ.en_distance_rescaled_deriv_e, sze * sizeof(double)); return QMCKL_SUCCESS; } @@ -5211,22 +5214,22 @@ qmckl_exit_code qmckl_provide_en_distance_rescaled_deriv_e(qmckl_context context } /* Compute if necessary */ - if (ctx->electron.walker.point.date > ctx->jastrow.en_distance_rescaled_deriv_e_date) { + if (ctx->electron.walker.point.date > ctx->jastrow_champ.en_distance_rescaled_deriv_e_date) { if (ctx->electron.walker.num > ctx->electron.walker_old.num) { - if (ctx->jastrow.en_distance_rescaled_deriv_e != NULL) { - qmckl_exit_code rc = qmckl_free(context, ctx->jastrow.en_distance_rescaled_deriv_e); + if (ctx->jastrow_champ.en_distance_rescaled_deriv_e != NULL) { + qmckl_exit_code rc = qmckl_free(context, ctx->jastrow_champ.en_distance_rescaled_deriv_e); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, "qmckl_provide_en_distance_rescaled_deriv_e", - "Unable to free ctx->jastrow.en_distance_rescaled_deriv_e"); + "Unable to free ctx->jastrow_champ.en_distance_rescaled_deriv_e"); } - ctx->jastrow.en_distance_rescaled_deriv_e = NULL; + ctx->jastrow_champ.en_distance_rescaled_deriv_e = NULL; } } /* Allocate array */ - if (ctx->jastrow.en_distance_rescaled_deriv_e == NULL) { + if (ctx->jastrow_champ.en_distance_rescaled_deriv_e == NULL) { qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; mem_info.size = 4 * ctx->electron.num * ctx->nucleus.num * @@ -5239,25 +5242,25 @@ qmckl_exit_code qmckl_provide_en_distance_rescaled_deriv_e(qmckl_context context "qmckl_provide_en_distance_rescaled_deriv_e", NULL); } - ctx->jastrow.en_distance_rescaled_deriv_e = en_distance_rescaled_deriv_e; + ctx->jastrow_champ.en_distance_rescaled_deriv_e = en_distance_rescaled_deriv_e; } qmckl_exit_code rc = qmckl_compute_en_distance_rescaled_deriv_e(context, ctx->electron.num, ctx->nucleus.num, - ctx->jastrow.type_nucl_num, - ctx->jastrow.type_nucl_vector, - ctx->jastrow.rescale_factor_en, + ctx->jastrow_champ.type_nucl_num, + ctx->jastrow_champ.type_nucl_vector, + ctx->jastrow_champ.rescale_factor_en, ctx->electron.walker.num, ctx->electron.walker.point.coord.data, ctx->nucleus.coord.data, - ctx->jastrow.en_distance_rescaled_deriv_e); + ctx->jastrow_champ.en_distance_rescaled_deriv_e); if (rc != QMCKL_SUCCESS) { return rc; } - ctx->jastrow.en_distance_rescaled_deriv_e_date = ctx->date; + ctx->jastrow_champ.en_distance_rescaled_deriv_e_date = ctx->date; } return QMCKL_SUCCESS; @@ -5464,14 +5467,14 @@ assert (rc == QMCKL_SUCCESS); #+begin_src c :comments org :tangle (eval h_func) :noweb yes qmckl_exit_code -qmckl_get_jastrow_een_rescaled_e(qmckl_context context, +qmckl_get_jastrow_champ_een_rescaled_e(qmckl_context context, double* const distance_rescaled, const int64_t size_max); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none qmckl_exit_code -qmckl_get_jastrow_een_rescaled_e(qmckl_context context, +qmckl_get_jastrow_champ_een_rescaled_e(qmckl_context context, double* const distance_rescaled, const int64_t size_max) { @@ -5487,14 +5490,14 @@ qmckl_get_jastrow_een_rescaled_e(qmckl_context context, qmckl_context_struct* const ctx = (qmckl_context_struct*) context; assert (ctx != NULL); - int64_t sze = ctx->electron.num * ctx->electron.num * ctx->electron.walker.num * (ctx->jastrow.cord_num + 1); + int64_t sze = ctx->electron.num * ctx->electron.num * ctx->electron.walker.num * (ctx->jastrow_champ.cord_num + 1); if (size_max < sze) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_get_jastrow_factor_een_rescaled_e", - "Array too small. Expected ctx->electron.num * ctx->electron.num * ctx->electron.walker.num * (ctx->jastrow.cord_num + 1)"); + "qmckl_get_jastrow_champ_factor_een_rescaled_e", + "Array too small. Expected ctx->electron.num * ctx->electron.num * ctx->electron.walker.num * (ctx->jastrow_champ.cord_num + 1)"); } - memcpy(distance_rescaled, ctx->jastrow.een_rescaled_e, sze * sizeof(double)); + memcpy(distance_rescaled, ctx->jastrow_champ.een_rescaled_e, sze * sizeof(double)); return QMCKL_SUCCESS; } @@ -5522,26 +5525,26 @@ qmckl_exit_code qmckl_provide_een_rescaled_e(qmckl_context context) if(rc != QMCKL_SUCCESS) return rc; /* Compute if necessary */ - if (ctx->date > ctx->jastrow.een_rescaled_e_date) { + if (ctx->date > ctx->jastrow_champ.een_rescaled_e_date) { if (ctx->electron.walker.num > ctx->electron.walker_old.num) { - if (ctx->jastrow.een_rescaled_e != NULL) { - rc = qmckl_free(context, ctx->jastrow.een_rescaled_e); + if (ctx->jastrow_champ.een_rescaled_e != NULL) { + rc = qmckl_free(context, ctx->jastrow_champ.een_rescaled_e); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, "qmckl_provide_een_rescaled_e", - "Unable to free ctx->jastrow.een_rescaled_e"); + "Unable to free ctx->jastrow_champ.een_rescaled_e"); } - ctx->jastrow.een_rescaled_e = NULL; + ctx->jastrow_champ.een_rescaled_e = NULL; } } /* Allocate array */ - if (ctx->jastrow.een_rescaled_e == NULL) { + if (ctx->jastrow_champ.een_rescaled_e == NULL) { qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; mem_info.size = ctx->electron.num * ctx->electron.num * - ctx->electron.walker.num * (ctx->jastrow.cord_num + 1) * sizeof(double); + ctx->electron.walker.num * (ctx->jastrow_champ.cord_num + 1) * sizeof(double); double* een_rescaled_e = (double*) qmckl_malloc(context, mem_info); if (een_rescaled_e == NULL) { @@ -5550,21 +5553,21 @@ qmckl_exit_code qmckl_provide_een_rescaled_e(qmckl_context context) "qmckl_provide_een_rescaled_e", NULL); } - ctx->jastrow.een_rescaled_e = een_rescaled_e; + ctx->jastrow_champ.een_rescaled_e = een_rescaled_e; } rc = qmckl_compute_een_rescaled_e(context, ctx->electron.walker.num, ctx->electron.num, - ctx->jastrow.cord_num, - ctx->jastrow.rescale_factor_ee, + ctx->jastrow_champ.cord_num, + ctx->jastrow_champ.rescale_factor_ee, ctx->electron.ee_distance, - ctx->jastrow.een_rescaled_e); + ctx->jastrow_champ.een_rescaled_e); if (rc != QMCKL_SUCCESS) { return rc; } - ctx->jastrow.een_rescaled_e_date = ctx->date; + ctx->jastrow_champ.een_rescaled_e_date = ctx->date; } return QMCKL_SUCCESS; @@ -5579,15 +5582,15 @@ qmckl_exit_code qmckl_provide_een_rescaled_e(qmckl_context context) :END: #+NAME: qmckl_factor_een_rescaled_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 | - | ~cord_num~ | ~int64_t~ | in | Order of polynomials | - | ~rescale_factor_ee~ | ~double~ | in | Factor to rescale ee distances | - | ~ee_distance~ | ~double[walk_num][elec_num][elec_num]~ | in | Electron-electron distances | - | ~een_rescaled_e~ | ~double[walk_num][0:cord_num][elec_num][elec_num]~ | out | Electron-electron rescaled distances | + | 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 | + | ~cord_num~ | ~int64_t~ | in | Order of polynomials | + | ~rescale_factor_ee~ | ~double~ | in | Factor to rescale ee distances | + | ~ee_distance~ | ~double[walk_num][elec_num][elec_num]~ | in | Electron-electron distances for each walker | + | ~een_rescaled_e~ | ~double[walk_num][0:cord_num][elec_num][elec_num]~ | out | Electron-electron rescaled distances for each walker | #+begin_src f90 :comments org :tangle (eval f) :noweb yes integer function qmckl_compute_een_rescaled_e_doc_f( & @@ -5960,7 +5963,7 @@ assert(qmckl_electron_provided(context)); double een_rescaled_e[walk_num][(cord_num + 1)][elec_num][elec_num]; -rc = qmckl_get_jastrow_een_rescaled_e(context, &(een_rescaled_e[0][0][0][0]),elec_num*elec_num*(cord_num+1)*walk_num); +rc = qmckl_get_jastrow_champ_een_rescaled_e(context, &(een_rescaled_e[0][0][0][0]),elec_num*elec_num*(cord_num+1)*walk_num); // value of (0,2,1) assert(fabs(een_rescaled_e[0][1][0][2]-0.08084493981483197) < 1.e-12); @@ -5976,7 +5979,7 @@ assert(fabs(een_rescaled_e[0][2][1][5]-0.3424402276009091) < 1.e-12); ~een_rescaled_e_deriv_e~ stores the table of the derivatives of the rescaled distances between all pairs of electrons and raised to the power $p$ defined by ~cord_num~. Here we take its derivatives - required for the een jastrow. + required for the een jastrow_champ. \[ \frac{\partial}{\partial x} \left[ {g_\text{e}(r)}\right]^p = -\frac{x}{r} \kappa_\text{e}\, p\,\left[ {g_\text{e}(r)}\right]^p \] @@ -5986,14 +5989,14 @@ assert(fabs(een_rescaled_e[0][2][1][5]-0.3424402276009091) < 1.e-12); #+begin_src c :comments org :tangle (eval h_func) :noweb yes qmckl_exit_code -qmckl_get_jastrow_een_rescaled_e_deriv_e(qmckl_context context, +qmckl_get_jastrow_champ_een_rescaled_e_deriv_e(qmckl_context context, double* const distance_rescaled, const int64_t size_max); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none qmckl_exit_code -qmckl_get_jastrow_een_rescaled_e_deriv_e(qmckl_context context, +qmckl_get_jastrow_champ_een_rescaled_e_deriv_e(qmckl_context context, double* const distance_rescaled, const int64_t size_max) { @@ -6009,14 +6012,14 @@ qmckl_get_jastrow_een_rescaled_e_deriv_e(qmckl_context context, qmckl_context_struct* const ctx = (qmckl_context_struct*) context; assert (ctx != NULL); - int64_t sze = ctx->electron.num * 4 * ctx->electron.num * ctx->electron.walker.num * (ctx->jastrow.cord_num + 1); + int64_t sze = ctx->electron.num * 4 * ctx->electron.num * ctx->electron.walker.num * (ctx->jastrow_champ.cord_num + 1); if (size_max < sze) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_get_jastrow_factor_een_deriv_e", - "Array too small. Expected ctx->electron.num * 4 * ctx->electron.num * ctx->electron.walker.num * (ctx->jastrow.cord_num + 1)"); + "qmckl_get_jastrow_champ_factor_een_deriv_e", + "Array too small. Expected ctx->electron.num * 4 * ctx->electron.num * ctx->electron.walker.num * (ctx->jastrow_champ.cord_num + 1)"); } - memcpy(distance_rescaled, ctx->jastrow.een_rescaled_e_deriv_e, sze * sizeof(double)); + memcpy(distance_rescaled, ctx->jastrow_champ.een_rescaled_e_deriv_e, sze * sizeof(double)); return QMCKL_SUCCESS; } @@ -6044,26 +6047,26 @@ qmckl_exit_code qmckl_provide_een_rescaled_e_deriv_e(qmckl_context context) if(rc != QMCKL_SUCCESS) return rc; /* Compute if necessary */ - if (ctx->date > ctx->jastrow.een_rescaled_e_deriv_e_date) { + if (ctx->date > ctx->jastrow_champ.een_rescaled_e_deriv_e_date) { if (ctx->electron.walker.num > ctx->electron.walker_old.num) { - if (ctx->jastrow.een_rescaled_e_deriv_e != NULL) { - rc = qmckl_free(context, ctx->jastrow.een_rescaled_e_deriv_e); + if (ctx->jastrow_champ.een_rescaled_e_deriv_e != NULL) { + rc = qmckl_free(context, ctx->jastrow_champ.een_rescaled_e_deriv_e); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, "qmckl_provide_een_rescaled_e_deriv_e", - "Unable to free ctx->jastrow.een_rescaled_e_deriv_e"); + "Unable to free ctx->jastrow_champ.een_rescaled_e_deriv_e"); } - ctx->jastrow.een_rescaled_e_deriv_e = NULL; + ctx->jastrow_champ.een_rescaled_e_deriv_e = NULL; } } /* Allocate array */ - if (ctx->jastrow.een_rescaled_e_deriv_e == NULL) { + if (ctx->jastrow_champ.een_rescaled_e_deriv_e == NULL) { qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; mem_info.size = ctx->electron.num * 4 * ctx->electron.num * - ctx->electron.walker.num * (ctx->jastrow.cord_num + 1) * sizeof(double); + ctx->electron.walker.num * (ctx->jastrow_champ.cord_num + 1) * sizeof(double); double* een_rescaled_e_deriv_e = (double*) qmckl_malloc(context, mem_info); if (een_rescaled_e_deriv_e == NULL) { @@ -6072,23 +6075,23 @@ qmckl_exit_code qmckl_provide_een_rescaled_e_deriv_e(qmckl_context context) "qmckl_provide_een_rescaled_e_deriv_e", NULL); } - ctx->jastrow.een_rescaled_e_deriv_e = een_rescaled_e_deriv_e; + ctx->jastrow_champ.een_rescaled_e_deriv_e = een_rescaled_e_deriv_e; } rc = qmckl_compute_factor_een_rescaled_e_deriv_e(context, ctx->electron.walker.num, ctx->electron.num, - ctx->jastrow.cord_num, - ctx->jastrow.rescale_factor_ee, + ctx->jastrow_champ.cord_num, + ctx->jastrow_champ.rescale_factor_ee, ctx->electron.walker.point.coord.data, ctx->electron.ee_distance, - ctx->jastrow.een_rescaled_e, - ctx->jastrow.een_rescaled_e_deriv_e); + ctx->jastrow_champ.een_rescaled_e, + ctx->jastrow_champ.een_rescaled_e_deriv_e); if (rc != QMCKL_SUCCESS) { return rc; } - ctx->jastrow.een_rescaled_e_deriv_e_date = ctx->date; + ctx->jastrow_champ.een_rescaled_e_deriv_e_date = ctx->date; } return QMCKL_SUCCESS; @@ -6348,7 +6351,7 @@ for l in range(0,cord_num+1): #+begin_src c :tangle (eval c_test) double een_rescaled_e_deriv_e[walk_num][(cord_num + 1)][elec_num][4][elec_num]; size_max=walk_num*(cord_num + 1)*elec_num*4*elec_num; -rc = qmckl_get_jastrow_een_rescaled_e_deriv_e(context, +rc = qmckl_get_jastrow_champ_een_rescaled_e_deriv_e(context, &(een_rescaled_e_deriv_e[0][0][0][0][0]),size_max); // value of (0,0,0,2,1) @@ -6375,14 +6378,14 @@ assert(fabs(een_rescaled_e_deriv_e[0][2][1][0][5] + 0.5880599146214673 ) < 1. #+begin_src c :comments org :tangle (eval h_func) :noweb yes qmckl_exit_code -qmckl_get_jastrow_een_rescaled_n(qmckl_context context, +qmckl_get_jastrow_champ_een_rescaled_n(qmckl_context context, double* const distance_rescaled, const int64_t size_max); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none qmckl_exit_code -qmckl_get_jastrow_een_rescaled_n(qmckl_context context, +qmckl_get_jastrow_champ_een_rescaled_n(qmckl_context context, double* const distance_rescaled, const int64_t size_max) { @@ -6398,14 +6401,14 @@ qmckl_get_jastrow_een_rescaled_n(qmckl_context context, qmckl_context_struct* const ctx = (qmckl_context_struct*) context; assert (ctx != NULL); - int64_t sze = ctx->electron.num * ctx->nucleus.num * ctx->electron.walker.num * (ctx->jastrow.cord_num + 1); + int64_t sze = ctx->electron.num * ctx->nucleus.num * ctx->electron.walker.num * (ctx->jastrow_champ.cord_num + 1); if (size_max < sze) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_get_jastrow_factor_een_deriv_e", - "Array too small. Expected ctx->electron.num * ctx->nucleus.num * ctx->electron.walker.num * (ctx->jastrow.cord_num + 1)"); + "qmckl_get_jastrow_champ_factor_een_deriv_e", + "Array too small. Expected ctx->electron.num * ctx->nucleus.num * ctx->electron.walker.num * (ctx->jastrow_champ.cord_num + 1)"); } - memcpy(distance_rescaled, ctx->jastrow.een_rescaled_n, sze * sizeof(double)); + memcpy(distance_rescaled, ctx->jastrow_champ.een_rescaled_n, sze * sizeof(double)); return QMCKL_SUCCESS; } @@ -6433,26 +6436,26 @@ qmckl_exit_code qmckl_provide_een_rescaled_n(qmckl_context context) if(rc != QMCKL_SUCCESS) return rc; /* Compute if necessary */ - if (ctx->date > ctx->jastrow.een_rescaled_n_date) { + if (ctx->date > ctx->jastrow_champ.een_rescaled_n_date) { if (ctx->electron.walker.num > ctx->electron.walker_old.num) { - if (ctx->jastrow.een_rescaled_n != NULL) { - rc = qmckl_free(context, ctx->jastrow.een_rescaled_n); + if (ctx->jastrow_champ.een_rescaled_n != NULL) { + rc = qmckl_free(context, ctx->jastrow_champ.een_rescaled_n); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, "qmckl_provide_een_rescaled_n", - "Unable to free ctx->jastrow.een_rescaled_n"); + "Unable to free ctx->jastrow_champ.een_rescaled_n"); } - ctx->jastrow.een_rescaled_n = NULL; + ctx->jastrow_champ.een_rescaled_n = NULL; } } /* Allocate array */ - if (ctx->jastrow.een_rescaled_n == NULL) { + if (ctx->jastrow_champ.een_rescaled_n == NULL) { qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; mem_info.size = ctx->electron.num * ctx->nucleus.num * - ctx->electron.walker.num * (ctx->jastrow.cord_num + 1) * sizeof(double); + ctx->electron.walker.num * (ctx->jastrow_champ.cord_num + 1) * sizeof(double); double* een_rescaled_n = (double*) qmckl_malloc(context, mem_info); if (een_rescaled_n == NULL) { @@ -6461,24 +6464,24 @@ qmckl_exit_code qmckl_provide_een_rescaled_n(qmckl_context context) "qmckl_provide_een_rescaled_n", NULL); } - ctx->jastrow.een_rescaled_n = een_rescaled_n; + ctx->jastrow_champ.een_rescaled_n = een_rescaled_n; } rc = qmckl_compute_een_rescaled_n(context, ctx->electron.walker.num, ctx->electron.num, ctx->nucleus.num, - ctx->jastrow.type_nucl_num, - ctx->jastrow.type_nucl_vector, - ctx->jastrow.cord_num, - ctx->jastrow.rescale_factor_en, + ctx->jastrow_champ.type_nucl_num, + ctx->jastrow_champ.type_nucl_vector, + ctx->jastrow_champ.cord_num, + ctx->jastrow_champ.rescale_factor_en, ctx->electron.en_distance, - ctx->jastrow.een_rescaled_n); + ctx->jastrow_champ.een_rescaled_n); if (rc != QMCKL_SUCCESS) { return rc; } - ctx->jastrow.een_rescaled_n_date = ctx->date; + ctx->jastrow_champ.een_rescaled_n_date = ctx->date; } return QMCKL_SUCCESS; @@ -6758,7 +6761,7 @@ assert(qmckl_electron_provided(context)); double een_rescaled_n[walk_num][(cord_num + 1)][nucl_num][elec_num]; size_max=walk_num*(cord_num + 1)*nucl_num*elec_num; -rc = qmckl_get_jastrow_een_rescaled_n(context, &(een_rescaled_n[0][0][0][0]),size_max); +rc = qmckl_get_jastrow_champ_een_rescaled_n(context, &(een_rescaled_n[0][0][0][0]),size_max); // value of (0,2,1) assert(fabs(een_rescaled_n[0][1][0][2]-0.10612983920006765) < 1.e-12); @@ -6774,7 +6777,7 @@ assert(fabs(een_rescaled_n[0][2][1][5]-0.01343938025140174) < 1.e-12); ~een_rescaled_n_deriv_e~ stores the table of the derivatives of the rescaled distances between all electron-nucleus pairs and raised to the power $p$ defined by ~cord_num~. Here we take its derivatives - required for the een jastrow. + required for the een jastrow_champ. \[ \frac{\partial}{\partial x} \left[ {g_\alpha(R_{i\alpha})}\right]^p = -\frac{x}{R_{i\alpha}} \kappa_\alpha\, p\,\left[ {g_\alpha(R_{i\alpha})}\right]^p \] @@ -6789,14 +6792,14 @@ assert(fabs(een_rescaled_n[0][2][1][5]-0.01343938025140174) < 1.e-12); #+begin_src c :comments org :tangle (eval h_func) :noweb yes qmckl_exit_code -qmckl_get_jastrow_een_rescaled_n_deriv_e(qmckl_context context, +qmckl_get_jastrow_champ_een_rescaled_n_deriv_e(qmckl_context context, double* const distance_rescaled, const int64_t size_max); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none qmckl_exit_code -qmckl_get_jastrow_een_rescaled_n_deriv_e(qmckl_context context, +qmckl_get_jastrow_champ_een_rescaled_n_deriv_e(qmckl_context context, double* const distance_rescaled, const int64_t size_max) { @@ -6812,14 +6815,14 @@ qmckl_get_jastrow_een_rescaled_n_deriv_e(qmckl_context context, qmckl_context_struct* const ctx = (qmckl_context_struct*) context; assert (ctx != NULL); - int64_t sze = ctx->electron.num * 4 * ctx->nucleus.num * ctx->electron.walker.num * (ctx->jastrow.cord_num + 1); + int64_t sze = ctx->electron.num * 4 * ctx->nucleus.num * ctx->electron.walker.num * (ctx->jastrow_champ.cord_num + 1); if (size_max < sze) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_get_jastrow_factor_een_deriv_e", - "Array too small. Expected ctx->electron.num * 4 * ctx->nucleus.num * ctx->electron.walker.num * (ctx->jastrow.cord_num + 1)"); + "qmckl_get_jastrow_champ_factor_een_deriv_e", + "Array too small. Expected ctx->electron.num * 4 * ctx->nucleus.num * ctx->electron.walker.num * (ctx->jastrow_champ.cord_num + 1)"); } - memcpy(distance_rescaled, ctx->jastrow.een_rescaled_n_deriv_e, sze * sizeof(double)); + memcpy(distance_rescaled, ctx->jastrow_champ.een_rescaled_n_deriv_e, sze * sizeof(double)); return QMCKL_SUCCESS; } @@ -6851,26 +6854,26 @@ qmckl_exit_code qmckl_provide_een_rescaled_n_deriv_e(qmckl_context context) if(rc != QMCKL_SUCCESS) return rc; /* Compute if necessary */ - if (ctx->date > ctx->jastrow.een_rescaled_n_deriv_e_date) { + if (ctx->date > ctx->jastrow_champ.een_rescaled_n_deriv_e_date) { if (ctx->electron.walker.num > ctx->electron.walker_old.num) { - if (ctx->jastrow.een_rescaled_n_deriv_e != NULL) { - rc = qmckl_free(context, ctx->jastrow.een_rescaled_n_deriv_e); + if (ctx->jastrow_champ.een_rescaled_n_deriv_e != NULL) { + rc = qmckl_free(context, ctx->jastrow_champ.een_rescaled_n_deriv_e); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, "qmckl_provide_een_rescaled_n_deriv_e", - "Unable to free ctx->jastrow.een_rescaled_n_deriv_e"); + "Unable to free ctx->jastrow_champ.een_rescaled_n_deriv_e"); } - ctx->jastrow.een_rescaled_n_deriv_e = NULL; + ctx->jastrow_champ.een_rescaled_n_deriv_e = NULL; } } /* Allocate array */ - if (ctx->jastrow.een_rescaled_n_deriv_e == NULL) { + if (ctx->jastrow_champ.een_rescaled_n_deriv_e == NULL) { qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; mem_info.size = ctx->electron.num * 4 * ctx->nucleus.num * - ctx->electron.walker.num * (ctx->jastrow.cord_num + 1) * sizeof(double); + ctx->electron.walker.num * (ctx->jastrow_champ.cord_num + 1) * sizeof(double); double* een_rescaled_n_deriv_e = (double*) qmckl_malloc(context, mem_info); if (een_rescaled_n_deriv_e == NULL) { @@ -6879,27 +6882,27 @@ qmckl_exit_code qmckl_provide_een_rescaled_n_deriv_e(qmckl_context context) "qmckl_provide_een_rescaled_n_deriv_e", NULL); } - ctx->jastrow.een_rescaled_n_deriv_e = een_rescaled_n_deriv_e; + ctx->jastrow_champ.een_rescaled_n_deriv_e = een_rescaled_n_deriv_e; } rc = qmckl_compute_factor_een_rescaled_n_deriv_e(context, ctx->electron.walker.num, ctx->electron.num, ctx->nucleus.num, - ctx->jastrow.type_nucl_num, - ctx->jastrow.type_nucl_vector, - ctx->jastrow.cord_num, - ctx->jastrow.rescale_factor_en, + ctx->jastrow_champ.type_nucl_num, + ctx->jastrow_champ.type_nucl_vector, + ctx->jastrow_champ.cord_num, + ctx->jastrow_champ.rescale_factor_en, ctx->electron.walker.point.coord.data, ctx->nucleus.coord.data, ctx->electron.en_distance, - ctx->jastrow.een_rescaled_n, - ctx->jastrow.een_rescaled_n_deriv_e); + ctx->jastrow_champ.een_rescaled_n, + ctx->jastrow_champ.een_rescaled_n_deriv_e); if (rc != QMCKL_SUCCESS) { return rc; } - ctx->jastrow.een_rescaled_n_deriv_e_date = ctx->date; + ctx->jastrow_champ.een_rescaled_n_deriv_e_date = ctx->date; } return QMCKL_SUCCESS; @@ -7176,7 +7179,7 @@ assert(qmckl_electron_provided(context)); double een_rescaled_n_deriv_e[walk_num][(cord_num + 1)][nucl_num][4][elec_num]; size_max=walk_num*(cord_num + 1)*nucl_num*4*elec_num; -rc = qmckl_get_jastrow_een_rescaled_n_deriv_e(context, &(een_rescaled_n_deriv_e[0][0][0][0][0]),size_max); +rc = qmckl_get_jastrow_champ_een_rescaled_n_deriv_e(context, &(een_rescaled_n_deriv_e[0][0][0][0][0]),size_max); // value of (0,2,1) assert(fabs(een_rescaled_n_deriv_e[0][1][0][0][2]+0.07633444246999128 ) < 1.e-12); @@ -7189,7 +7192,7 @@ assert(fabs(een_rescaled_n_deriv_e[0][2][1][0][5]-0.001593334817691633 ) < 1.e #+end_src *** Temporary arrays for electron-electron-nucleus Jastrow $f_{een}$ - + Prepare ~c_vector_full~ and ~lkpm_combined_index~ tables required for the calculation of the three-body jastrow ~factor_een~ and its derivative ~factor_een_deriv_e~. @@ -7197,12 +7200,12 @@ assert(fabs(een_rescaled_n_deriv_e[0][2][1][0][5]-0.001593334817691633 ) < 1.e **** Get #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes -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); +qmckl_exit_code qmckl_get_jastrow_champ_tmp_c(qmckl_context context, double* const tmp_c); +qmckl_exit_code qmckl_get_jastrow_champ_dtmp_c(qmckl_context context, double* const dtmp_c); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none -qmckl_exit_code qmckl_get_jastrow_tmp_c(qmckl_context context, double* const tmp_c) +qmckl_exit_code qmckl_get_jastrow_champ_tmp_c(qmckl_context context, double* const tmp_c) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return QMCKL_NULL_CONTEXT; @@ -7210,7 +7213,7 @@ qmckl_exit_code qmckl_get_jastrow_tmp_c(qmckl_context context, double* const tmp qmckl_exit_code rc; - rc = qmckl_provide_jastrow_c_vector_full(context); + rc = qmckl_provide_jastrow_champ_c_vector_full(context); if (rc != QMCKL_SUCCESS) return rc; rc = qmckl_provide_tmp_c(context); @@ -7219,14 +7222,14 @@ qmckl_exit_code qmckl_get_jastrow_tmp_c(qmckl_context context, double* const tmp qmckl_context_struct* const ctx = (qmckl_context_struct*) context; assert (ctx != NULL); - size_t sze = (ctx->jastrow.cord_num) * (ctx->jastrow.cord_num + 1) + size_t sze = (ctx->jastrow_champ.cord_num) * (ctx->jastrow_champ.cord_num + 1) * ctx->electron.num * ctx->nucleus.num * ctx->electron.walker.num; - memcpy(tmp_c, ctx->jastrow.tmp_c, sze * sizeof(double)); + memcpy(tmp_c, ctx->jastrow_champ.tmp_c, sze * sizeof(double)); return QMCKL_SUCCESS; } -qmckl_exit_code qmckl_get_jastrow_dtmp_c(qmckl_context context, double* const dtmp_c) +qmckl_exit_code qmckl_get_jastrow_champ_dtmp_c(qmckl_context context, double* const dtmp_c) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { return QMCKL_NULL_CONTEXT; @@ -7234,7 +7237,7 @@ qmckl_exit_code qmckl_get_jastrow_dtmp_c(qmckl_context context, double* const dt qmckl_exit_code rc; - rc = qmckl_provide_jastrow_c_vector_full(context); + rc = qmckl_provide_jastrow_champ_c_vector_full(context); if (rc != QMCKL_SUCCESS) return rc; rc = qmckl_provide_dtmp_c(context); @@ -7243,9 +7246,9 @@ qmckl_exit_code qmckl_get_jastrow_dtmp_c(qmckl_context context, double* const dt qmckl_context_struct* const ctx = (qmckl_context_struct*) context; assert (ctx != NULL); - size_t sze = (ctx->jastrow.cord_num) * (ctx->jastrow.cord_num + 1) + size_t sze = (ctx->jastrow_champ.cord_num) * (ctx->jastrow_champ.cord_num + 1) *4* ctx->electron.num * ctx->nucleus.num * ctx->electron.walker.num; - memcpy(dtmp_c, ctx->jastrow.dtmp_c, sze * sizeof(double)); + memcpy(dtmp_c, ctx->jastrow_champ.dtmp_c, sze * sizeof(double)); return QMCKL_SUCCESS; } @@ -7254,14 +7257,14 @@ qmckl_exit_code qmckl_get_jastrow_dtmp_c(qmckl_context context, double* const dt **** Provide :noexport: #+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none -qmckl_exit_code qmckl_provide_jastrow_c_vector_full(qmckl_context context); +qmckl_exit_code qmckl_provide_jastrow_champ_c_vector_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 -qmckl_exit_code qmckl_provide_jastrow_c_vector_full(qmckl_context context) +qmckl_exit_code qmckl_provide_jastrow_champ_c_vector_full(qmckl_context context) { if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) { @@ -7272,37 +7275,37 @@ qmckl_exit_code qmckl_provide_jastrow_c_vector_full(qmckl_context context) assert (ctx != NULL); /* Compute if necessary */ - if (ctx->date > ctx->jastrow.c_vector_full_date) { + if (ctx->date > ctx->jastrow_champ.c_vector_full_date) { /* Allocate array */ - if (ctx->jastrow.c_vector_full == NULL) { + if (ctx->jastrow_champ.c_vector_full == NULL) { qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; - mem_info.size = ctx->jastrow.dim_c_vector * ctx->nucleus.num * sizeof(double); + mem_info.size = ctx->jastrow_champ.dim_c_vector * ctx->nucleus.num * sizeof(double); double* c_vector_full = (double*) qmckl_malloc(context, mem_info); if (c_vector_full == NULL) { return qmckl_failwith( context, QMCKL_ALLOCATION_FAILED, - "qmckl_provide_jastrow_c_vector_full", + "qmckl_provide_jastrow_champ_c_vector_full", NULL); } - ctx->jastrow.c_vector_full = c_vector_full; + ctx->jastrow_champ.c_vector_full = c_vector_full; } qmckl_exit_code rc; rc = qmckl_compute_c_vector_full(context, ctx->nucleus.num, - ctx->jastrow.dim_c_vector, - ctx->jastrow.type_nucl_num, - ctx->jastrow.type_nucl_vector, - ctx->jastrow.c_vector, - ctx->jastrow.c_vector_full); + ctx->jastrow_champ.dim_c_vector, + ctx->jastrow_champ.type_nucl_num, + ctx->jastrow_champ.type_nucl_vector, + ctx->jastrow_champ.c_vector, + ctx->jastrow_champ.c_vector_full); if (rc != QMCKL_SUCCESS) { return rc; } - ctx->jastrow.c_vector_full_date = ctx->date; + ctx->jastrow_champ.c_vector_full_date = ctx->date; } return QMCKL_SUCCESS; @@ -7319,13 +7322,13 @@ qmckl_exit_code qmckl_provide_lkpm_combined_index(qmckl_context context) assert (ctx != NULL); /* Compute if necessary */ - if (ctx->date > ctx->jastrow.lkpm_combined_index_date) { + if (ctx->date > ctx->jastrow_champ.lkpm_combined_index_date) { /* Allocate array */ - if (ctx->jastrow.lkpm_combined_index == NULL) { + if (ctx->jastrow_champ.lkpm_combined_index == NULL) { qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; - mem_info.size = 4 * ctx->jastrow.dim_c_vector * sizeof(int64_t); + mem_info.size = 4 * ctx->jastrow_champ.dim_c_vector * sizeof(int64_t); int64_t* lkpm_combined_index = (int64_t*) qmckl_malloc(context, mem_info); if (lkpm_combined_index == NULL) { @@ -7334,19 +7337,19 @@ qmckl_exit_code qmckl_provide_lkpm_combined_index(qmckl_context context) "qmckl_provide_lkpm_combined_index", NULL); } - ctx->jastrow.lkpm_combined_index = lkpm_combined_index; + ctx->jastrow_champ.lkpm_combined_index = lkpm_combined_index; } qmckl_exit_code rc; rc = qmckl_compute_lkpm_combined_index(context, - ctx->jastrow.cord_num, - ctx->jastrow.dim_c_vector, - ctx->jastrow.lkpm_combined_index); + ctx->jastrow_champ.cord_num, + ctx->jastrow_champ.dim_c_vector, + ctx->jastrow_champ.lkpm_combined_index); if (rc != QMCKL_SUCCESS) { return rc; } - ctx->jastrow.lkpm_combined_index_date = ctx->date; + ctx->jastrow_champ.lkpm_combined_index_date = ctx->date; } return QMCKL_SUCCESS; @@ -7364,25 +7367,25 @@ qmckl_exit_code qmckl_provide_tmp_c(qmckl_context context) qmckl_exit_code rc = QMCKL_SUCCESS; /* Compute if necessary */ - if (ctx->date > ctx->jastrow.tmp_c_date) { + if (ctx->date > ctx->jastrow_champ.tmp_c_date) { if (ctx->electron.walker.num > ctx->electron.walker_old.num) { - if (ctx->jastrow.tmp_c != NULL) { - rc = qmckl_free(context, ctx->jastrow.tmp_c); + if (ctx->jastrow_champ.tmp_c != NULL) { + rc = qmckl_free(context, ctx->jastrow_champ.tmp_c); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, "qmckl_provide_tmp_c", - "Unable to free ctx->jastrow.tmp_c"); + "Unable to free ctx->jastrow_champ.tmp_c"); } - ctx->jastrow.tmp_c = NULL; + ctx->jastrow_champ.tmp_c = NULL; } } /* Allocate array */ - if (ctx->jastrow.tmp_c == NULL) { + if (ctx->jastrow_champ.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) + mem_info.size = (ctx->jastrow_champ.cord_num) * (ctx->jastrow_champ.cord_num + 1) ,* ctx->electron.num * ctx->nucleus.num * ctx->electron.walker.num * sizeof(double); double* tmp_c = (double*) qmckl_malloc(context, mem_info); @@ -7392,19 +7395,19 @@ qmckl_exit_code qmckl_provide_tmp_c(qmckl_context context) "qmckl_provide_tmp_c", NULL); } - ctx->jastrow.tmp_c = tmp_c; + ctx->jastrow_champ.tmp_c = tmp_c; } rc = qmckl_compute_tmp_c(context, - ctx->jastrow.cord_num, + ctx->jastrow_champ.cord_num, ctx->electron.num, ctx->nucleus.num, ctx->electron.walker.num, - ctx->jastrow.een_rescaled_e, - ctx->jastrow.een_rescaled_n, - ctx->jastrow.tmp_c); + ctx->jastrow_champ.een_rescaled_e, + ctx->jastrow_champ.een_rescaled_n, + ctx->jastrow_champ.tmp_c); - ctx->jastrow.tmp_c_date = ctx->date; + ctx->jastrow_champ.tmp_c_date = ctx->date; } return rc; @@ -7421,25 +7424,25 @@ qmckl_exit_code qmckl_provide_dtmp_c(qmckl_context context) assert (ctx != NULL); /* Compute if necessary */ - if (ctx->date > ctx->jastrow.dtmp_c_date) { + if (ctx->date > ctx->jastrow_champ.dtmp_c_date) { if (ctx->electron.walker.num > ctx->electron.walker_old.num) { - if (ctx->jastrow.dtmp_c != NULL) { - rc = qmckl_free(context, ctx->jastrow.dtmp_c); + if (ctx->jastrow_champ.dtmp_c != NULL) { + rc = qmckl_free(context, ctx->jastrow_champ.dtmp_c); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, "qmckl_provide_dtmp_c", - "Unable to free ctx->jastrow.dtmp_c"); + "Unable to free ctx->jastrow_champ.dtmp_c"); } - ctx->jastrow.dtmp_c = NULL; + ctx->jastrow_champ.dtmp_c = NULL; } } /* Allocate array */ - if (ctx->jastrow.dtmp_c == NULL) { + if (ctx->jastrow_champ.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) + mem_info.size = (ctx->jastrow_champ.cord_num) * (ctx->jastrow_champ.cord_num + 1) ,* 4 * ctx->electron.num * ctx->nucleus.num * ctx->electron.walker.num * sizeof(double); double* dtmp_c = (double*) qmckl_malloc(context, mem_info); @@ -7449,25 +7452,25 @@ qmckl_exit_code qmckl_provide_dtmp_c(qmckl_context context) "qmckl_provide_dtmp_c", NULL); } - ctx->jastrow.dtmp_c = dtmp_c; + ctx->jastrow_champ.dtmp_c = dtmp_c; } rc = qmckl_compute_dtmp_c(context, - ctx->jastrow.cord_num, + ctx->jastrow_champ.cord_num, ctx->electron.num, ctx->nucleus.num, ctx->electron.walker.num, - ctx->jastrow.een_rescaled_e_deriv_e, - ctx->jastrow.een_rescaled_n, - ctx->jastrow.dtmp_c); + ctx->jastrow_champ.een_rescaled_e_deriv_e, + ctx->jastrow_champ.een_rescaled_n, + ctx->jastrow_champ.dtmp_c); if (rc != QMCKL_SUCCESS) { return rc; } - ctx->jastrow.dtmp_c_date = ctx->date; + ctx->jastrow_champ.dtmp_c_date = ctx->date; } return QMCKL_SUCCESS; @@ -8472,10 +8475,10 @@ lkpm_of_cindex = np.array(lkpm_combined_index).T 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])); +rc = qmckl_get_jastrow_champ_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])); +rc = qmckl_get_jastrow_champ_dtmp_c(context, &(dtmp_c[0][0][0][0][0][0])); printf("%e\n%e\n", tmp_c[0][0][1][0][0], 2.7083473948352403); assert(fabs(tmp_c[0][0][1][0][0] - 2.7083473948352403) < 1e-12); @@ -8494,14 +8497,14 @@ assert(fabs(dtmp_c[0][1][0][0][0][0] - 0.237440520852232) < 1e-12); **** Get #+begin_src c :comments org :tangle (eval h_func) :noweb yes qmckl_exit_code -qmckl_get_jastrow_factor_een(qmckl_context context, +qmckl_get_jastrow_champ_factor_een(qmckl_context context, double* const factor_een, const int64_t size_max); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none qmckl_exit_code -qmckl_get_jastrow_factor_een(qmckl_context context, +qmckl_get_jastrow_champ_factor_een(qmckl_context context, double* const factor_een, const int64_t size_max) { @@ -8521,10 +8524,10 @@ qmckl_get_jastrow_factor_een(qmckl_context context, if (size_max < sze) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_get_jastrow_factor_een", + "qmckl_get_jastrow_champ_factor_een", "Array too small. Expected walk_num"); } - memcpy(factor_een, ctx->jastrow.factor_een, sze*sizeof(double)); + memcpy(factor_een, ctx->jastrow_champ.factor_een, sze*sizeof(double)); return QMCKL_SUCCESS; } @@ -8534,7 +8537,7 @@ qmckl_get_jastrow_factor_een(qmckl_context context, #+begin_src f90 :tangle (eval fh_func) :comments org interface - integer(qmckl_exit_code) function qmckl_get_jastrow_factor_een (context, & + integer(qmckl_exit_code) function qmckl_get_jastrow_champ_factor_een (context, & factor_een, size_max) bind(C) use, intrinsic :: iso_c_binding import @@ -8542,7 +8545,7 @@ interface integer (qmckl_context) , intent(in), value :: context integer(c_int64_t), intent(in), value :: size_max double precision, intent(out) :: factor_een(size_max) - end function qmckl_get_jastrow_factor_een + end function qmckl_get_jastrow_champ_factor_een end interface #+end_src @@ -8573,7 +8576,7 @@ qmckl_exit_code qmckl_provide_factor_een(qmckl_context context) if(rc != QMCKL_SUCCESS) return rc; /* Check if en rescaled distance derivatives is provided */ - rc = qmckl_provide_jastrow_c_vector_full(context); + rc = qmckl_provide_jastrow_champ_c_vector_full(context); if(rc != QMCKL_SUCCESS) return rc; /* Check if en rescaled distance derivatives is provided */ @@ -8585,22 +8588,22 @@ qmckl_exit_code qmckl_provide_factor_een(qmckl_context context) if(rc != QMCKL_SUCCESS) return rc; /* Compute if necessary */ - if (ctx->date > ctx->jastrow.factor_een_date) { + if (ctx->date > ctx->jastrow_champ.factor_een_date) { if (ctx->electron.walker.num > ctx->electron.walker_old.num) { - if (ctx->jastrow.factor_een != NULL) { - rc = qmckl_free(context, ctx->jastrow.factor_een); + if (ctx->jastrow_champ.factor_een != NULL) { + rc = qmckl_free(context, ctx->jastrow_champ.factor_een); if (rc != QMCKL_SUCCESS) { return qmckl_failwith( context, rc, "qmckl_provide_factor_een", - "Unable to free ctx->jastrow.factor_een"); + "Unable to free ctx->jastrow_champ.factor_een"); } - ctx->jastrow.factor_een = NULL; + ctx->jastrow_champ.factor_een = NULL; } } /* Allocate array */ - if (ctx->jastrow.factor_een == NULL) { + if (ctx->jastrow_champ.factor_een == NULL) { qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; mem_info.size = ctx->electron.walker.num * sizeof(double); @@ -8612,25 +8615,25 @@ qmckl_exit_code qmckl_provide_factor_een(qmckl_context context) "qmckl_provide_factor_een", NULL); } - ctx->jastrow.factor_een = factor_een; + ctx->jastrow_champ.factor_een = factor_een; } rc = qmckl_compute_factor_een(context, ctx->electron.walker.num, ctx->electron.num, ctx->nucleus.num, - ctx->jastrow.cord_num, - ctx->jastrow.dim_c_vector, - ctx->jastrow.c_vector_full, - ctx->jastrow.lkpm_combined_index, - ctx->jastrow.tmp_c, - ctx->jastrow.een_rescaled_n, - ctx->jastrow.factor_een); + ctx->jastrow_champ.cord_num, + ctx->jastrow_champ.dim_c_vector, + ctx->jastrow_champ.c_vector_full, + ctx->jastrow_champ.lkpm_combined_index, + ctx->jastrow_champ.tmp_c, + ctx->jastrow_champ.een_rescaled_n, + ctx->jastrow_champ.factor_een); if (rc != QMCKL_SUCCESS) { return rc; } - ctx->jastrow.factor_een_date = ctx->date; + ctx->jastrow_champ.factor_een_date = ctx->date; } return QMCKL_SUCCESS; @@ -9002,10 +9005,10 @@ print("factor_een:",factor_een) #+begin_src c :tangle (eval c_test) /* Check if Jastrow is properly initialized */ -assert(qmckl_jastrow_provided(context)); +assert(qmckl_jastrow_champ_provided(context)); double factor_een[walk_num]; -rc = qmckl_get_jastrow_factor_een(context, &(factor_een[0]),walk_num); +rc = qmckl_get_jastrow_champ_factor_een(context, &(factor_een[0]),walk_num); assert(fabs(factor_een[0] + 0.37407972141304213) < 1e-12); #+end_src @@ -9020,14 +9023,14 @@ assert(fabs(factor_een[0] + 0.37407972141304213) < 1e-12); **** Get #+begin_src c :comments org :tangle (eval h_func) :noweb yes qmckl_exit_code -qmckl_get_jastrow_factor_een_deriv_e(qmckl_context context, +qmckl_get_jastrow_champ_factor_een_deriv_e(qmckl_context context, double* const factor_een_deriv_e, const int64_t size_max); #+end_src #+begin_src c :comments org :tangle (eval c) :noweb yes :exports none qmckl_exit_code -qmckl_get_jastrow_factor_een_deriv_e(qmckl_context context, +qmckl_get_jastrow_champ_factor_een_deriv_e(qmckl_context context, double* const factor_een_deriv_e, const int64_t size_max) { @@ -9047,10 +9050,10 @@ qmckl_get_jastrow_factor_een_deriv_e(qmckl_context context, if (size_max < sze) { return qmckl_failwith( context, QMCKL_INVALID_ARG_3, - "qmckl_get_jastrow_factor_een_deriv_e", + "qmckl_get_jastrow_champ_factor_een_deriv_e", "Array too small. Expected 4*walk_num*elec_num"); } - memcpy(factor_een_deriv_e, ctx->jastrow.factor_een_deriv_e, sze*sizeof(double)); + memcpy(factor_een_deriv_e, ctx->jastrow_champ.factor_een_deriv_e, sze*sizeof(double)); return QMCKL_SUCCESS; } @@ -9091,7 +9094,7 @@ qmckl_exit_code qmckl_provide_factor_een_deriv_e(qmckl_context context) if(rc != QMCKL_SUCCESS) return rc; /* Check if en rescaled distance derivatives is provided */ - rc = qmckl_provide_jastrow_c_vector_full(context); + rc = qmckl_provide_jastrow_champ_c_vector_full(context); if(rc != QMCKL_SUCCESS) return rc; /* Check if en rescaled distance derivatives is provided */ @@ -9107,22 +9110,22 @@ qmckl_exit_code qmckl_provide_factor_een_deriv_e(qmckl_context context) if(rc != QMCKL_SUCCESS) return rc; /* Compute if necessary */ - if (ctx->date > ctx->jastrow.factor_een_deriv_e_date) { + if (ctx->date > ctx->jastrow_champ.factor_een_deriv_e_date) { if (ctx->electron.walker.num > ctx->electron.walker_old.num) { - if (ctx->jastrow.factor_een_deriv_e != NULL) { - rc = qmckl_free(context, ctx->jastrow.factor_een_deriv_e); + if (ctx->jastrow_champ.factor_een_deriv_e != NULL) { + 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", - "Unable to free ctx->jastrow.factor_een_deriv_e"); + "Unable to free ctx->jastrow_champ.factor_een_deriv_e"); } - ctx->jastrow.factor_een_deriv_e = NULL; + ctx->jastrow_champ.factor_een_deriv_e = NULL; } } /* Allocate array */ - if (ctx->jastrow.factor_een_deriv_e == NULL) { + if (ctx->jastrow_champ.factor_een_deriv_e == NULL) { qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; mem_info.size = 4 * ctx->electron.num * ctx->electron.walker.num * sizeof(double); @@ -9134,27 +9137,27 @@ qmckl_exit_code qmckl_provide_factor_een_deriv_e(qmckl_context context) "qmckl_provide_factor_een_deriv_e", NULL); } - ctx->jastrow.factor_een_deriv_e = factor_een_deriv_e; + ctx->jastrow_champ.factor_een_deriv_e = factor_een_deriv_e; } rc = qmckl_compute_factor_een_deriv_e(context, ctx->electron.walker.num, ctx->electron.num, ctx->nucleus.num, - ctx->jastrow.cord_num, - ctx->jastrow.dim_c_vector, - ctx->jastrow.c_vector_full, - ctx->jastrow.lkpm_combined_index, - ctx->jastrow.tmp_c, - ctx->jastrow.dtmp_c, - ctx->jastrow.een_rescaled_n, - ctx->jastrow.een_rescaled_n_deriv_e, - ctx->jastrow.factor_een_deriv_e); + ctx->jastrow_champ.cord_num, + ctx->jastrow_champ.dim_c_vector, + ctx->jastrow_champ.c_vector_full, + ctx->jastrow_champ.lkpm_combined_index, + ctx->jastrow_champ.tmp_c, + ctx->jastrow_champ.dtmp_c, + ctx->jastrow_champ.een_rescaled_n, + ctx->jastrow_champ.een_rescaled_n_deriv_e, + ctx->jastrow_champ.factor_een_deriv_e); if (rc != QMCKL_SUCCESS) { return rc; } - ctx->jastrow.factor_een_deriv_e_date = ctx->date; + ctx->jastrow_champ.factor_een_deriv_e_date = ctx->date; } return QMCKL_SUCCESS; @@ -9603,15 +9606,17 @@ print("factor_een:",factor_een) #+begin_src c :tangle (eval c_test) /* Check if Jastrow is properly initialized */ -assert(qmckl_jastrow_provided(context)); +assert(qmckl_jastrow_champ_provided(context)); double factor_een_deriv_e[4][walk_num][elec_num]; -rc = qmckl_get_jastrow_factor_een_deriv_e(context, &(factor_een_deriv_e[0][0][0]),4*walk_num*elec_num); +rc = qmckl_get_jastrow_champ_factor_een_deriv_e(context, &(factor_een_deriv_e[0][0][0]),4*walk_num*elec_num); assert(fabs(factor_een_deriv_e[0][0][0] + 0.0005481671107226865) < 1e-12); #+end_src -** TODO Jastrow VGL functions +** Jastrow VGL functions + + Values, gradient and Laplacian of the total Jastrow factor. * End of files :noexport: diff --git a/org/table_of_contents b/org/table_of_contents index 6cc895a..91af363 100644 --- a/org/table_of_contents +++ b/org/table_of_contents @@ -12,7 +12,7 @@ qmckl_ao.org qmckl_mo.org qmckl_determinant.org qmckl_sherman_morrison_woodbury.org -qmckl_jastrow.org +qmckl_jastrow_champ.org qmckl_local_energy.org qmckl_utils.org qmckl_trexio.org