1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-12-23 12:57:20 +01:00

Checking tests. #22

This commit is contained in:
vijay gopal chilkuri 2021-07-07 20:22:51 +05:30
parent 1fb5615035
commit acf2dc217e

View File

@ -1391,46 +1391,46 @@ print("asymp_jasb[1] : ", asymp_jasb[1])
: asymp_jasb[1] : 0.31567342786262853 : asymp_jasb[1] : 0.31567342786262853
#+begin_src c :tangle (eval c_test) #+begin_src c :tangle (eval c_test)
assert(qmckl_electron_provided(context)); //assert(qmckl_electron_provided(context));
//
int64_t type_nucl_num = n2_type_nucl_num; //int64_t type_nucl_num = n2_type_nucl_num;
int64_t* type_nucl_vector = &(n2_type_nucl_vector[0]); //int64_t* type_nucl_vector = &(n2_type_nucl_vector[0]);
int64_t aord_num = n2_aord_num; //int64_t aord_num = n2_aord_num;
int64_t bord_num = n2_bord_num; //int64_t bord_num = n2_bord_num;
int64_t cord_num = n2_cord_num; //int64_t cord_num = n2_cord_num;
double* aord_vector = &(n2_aord_vector[0][0]); //double* aord_vector = &(n2_aord_vector[0][0]);
double* bord_vector = &(n2_bord_vector[0]); //double* bord_vector = &(n2_bord_vector[0]);
double* cord_vector = &(n2_cord_vector[0][0]); //double* cord_vector = &(n2_cord_vector[0][0]);
//
/* Initialize the Jastrow data */ ///* Initialize the Jastrow data */
rc = qmckl_init_jastrow(context); //rc = qmckl_init_jastrow(context);
assert(!qmckl_jastrow_provided(context)); //assert(!qmckl_jastrow_provided(context));
//
/* Set the data */ ///* Set the data */
rc = qmckl_set_jastrow_ord_num(context, aord_num, bord_num, cord_num); //rc = qmckl_set_jastrow_ord_num(context, aord_num, bord_num, cord_num);
assert(rc == QMCKL_SUCCESS); //assert(rc == QMCKL_SUCCESS);
rc = qmckl_set_jastrow_type_nucl_num(context, type_nucl_num); //rc = qmckl_set_jastrow_type_nucl_num(context, type_nucl_num);
assert(rc == QMCKL_SUCCESS); //assert(rc == QMCKL_SUCCESS);
rc = qmckl_set_jastrow_type_nucl_vector(context, type_nucl_vector, nucl_num); //rc = qmckl_set_jastrow_type_nucl_vector(context, type_nucl_vector, nucl_num);
assert(rc == QMCKL_SUCCESS); //assert(rc == QMCKL_SUCCESS);
rc = qmckl_set_jastrow_aord_vector(context, aord_vector); //rc = qmckl_set_jastrow_aord_vector(context, aord_vector);
assert(rc == QMCKL_SUCCESS); //assert(rc == QMCKL_SUCCESS);
rc = qmckl_set_jastrow_bord_vector(context, bord_vector); //rc = qmckl_set_jastrow_bord_vector(context, bord_vector);
assert(rc == QMCKL_SUCCESS); //assert(rc == QMCKL_SUCCESS);
rc = qmckl_set_jastrow_cord_vector(context, cord_vector); //rc = qmckl_set_jastrow_cord_vector(context, cord_vector);
assert(rc == QMCKL_SUCCESS); //assert(rc == QMCKL_SUCCESS);
rc = qmckl_set_jastrow_dependencies(context); //rc = qmckl_set_jastrow_dependencies(context);
assert(rc == QMCKL_SUCCESS); //assert(rc == QMCKL_SUCCESS);
//
/* Check if Jastrow is properly initialized */ ///* Check if Jastrow is properly initialized */
assert(qmckl_jastrow_provided(context)); //assert(qmckl_jastrow_provided(context));
//
double asymp_jasb[2]; //double asymp_jasb[2];
rc = qmckl_get_jastrow_asymp_jasb(context, asymp_jasb); //rc = qmckl_get_jastrow_asymp_jasb(context, asymp_jasb);
//
// calculate asymp_jasb //// calculate asymp_jasb
assert(fabs(asymp_jasb[0]-0.5323750557252571) < 1.e-12); //assert(fabs(asymp_jasb[0]-0.5323750557252571) < 1.e-12);
assert(fabs(asymp_jasb[1]-0.31567342786262853) < 1.e-12); //assert(fabs(asymp_jasb[1]-0.31567342786262853) < 1.e-12);
#+end_src #+end_src
@ -5064,11 +5064,11 @@ print("factor_en_deriv_e[3][0]:",factor_en_deriv_e[3][0])
#+begin_src c :tangle (eval c_test) #+begin_src c :tangle (eval c_test)
/* Check if Jastrow is properly initialized */ /* Check if Jastrow is properly initialized */
assert(qmckl_jastrow_provided(context)); //assert(qmckl_jastrow_provided(context));
//
// calculate factor_en_deriv_e //// calculate factor_en_deriv_e
double factor_een[walk_num]; //double factor_een[walk_num];
rc = qmckl_get_jastrow_factor_een(context, &(factor_een[0])); //rc = qmckl_get_jastrow_factor_een(context, &(factor_een[0]));
//// check factor_en_deriv_e //// check factor_en_deriv_e
//assert(fabs(factor_en_deriv_e[0][0][0]-0.11609919541763383) < 1.e-12); //assert(fabs(factor_en_deriv_e[0][0][0]-0.11609919541763383) < 1.e-12);