mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2024-08-17 19:01:43 +02:00
Removed n2 header from jastrow tests. #22
This commit is contained in:
parent
0151c441bc
commit
5d17992339
@ -28,7 +28,7 @@ these factors along with their derivatives.
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "n2.h"
|
//#include "n2.h"
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
qmckl_context context;
|
qmckl_context context;
|
||||||
@ -969,172 +969,172 @@ qmckl_exit_code qmckl_finalize_jastrow(qmckl_context context) {
|
|||||||
|
|
||||||
** Test
|
** Test
|
||||||
#+begin_src c :tangle (eval c_test)
|
#+begin_src c :tangle (eval c_test)
|
||||||
/* Reference input data */
|
///* Reference input data */
|
||||||
int64_t walk_num = n2_walk_num;
|
//int64_t walk_num = n2_walk_num;
|
||||||
int64_t elec_num = n2_elec_num;
|
//int64_t elec_num = n2_elec_num;
|
||||||
int64_t elec_up_num = n2_elec_up_num;
|
//int64_t elec_up_num = n2_elec_up_num;
|
||||||
int64_t elec_dn_num = n2_elec_dn_num;
|
//int64_t elec_dn_num = n2_elec_dn_num;
|
||||||
double rescale_factor_kappa_ee = 1.0;
|
//double rescale_factor_kappa_ee = 1.0;
|
||||||
double rescale_factor_kappa_en = 1.0;
|
//double rescale_factor_kappa_en = 1.0;
|
||||||
double nucl_rescale_factor_kappa = 1.0;
|
//double nucl_rescale_factor_kappa = 1.0;
|
||||||
double* elec_coord = &(n2_elec_coord[0][0][0]);
|
//double* elec_coord = &(n2_elec_coord[0][0][0]);
|
||||||
|
//
|
||||||
const double* nucl_charge = n2_charge;
|
//const double* nucl_charge = n2_charge;
|
||||||
int64_t nucl_num = n2_nucl_num;
|
//int64_t nucl_num = n2_nucl_num;
|
||||||
double* charge = n2_charge;
|
//double* charge = n2_charge;
|
||||||
double* nucl_coord = &(n2_nucl_coord[0][0]);
|
//double* nucl_coord = &(n2_nucl_coord[0][0]);
|
||||||
|
//
|
||||||
/* Provide Electron data */
|
///* Provide Electron data */
|
||||||
|
|
||||||
qmckl_exit_code rc;
|
qmckl_exit_code rc;
|
||||||
|
|
||||||
assert(!qmckl_electron_provided(context));
|
//assert(!qmckl_electron_provided(context));
|
||||||
|
//
|
||||||
int64_t n;
|
//int64_t n;
|
||||||
rc = qmckl_get_electron_num (context, &n);
|
//rc = qmckl_get_electron_num (context, &n);
|
||||||
assert(rc == QMCKL_NOT_PROVIDED);
|
//assert(rc == QMCKL_NOT_PROVIDED);
|
||||||
|
//
|
||||||
rc = qmckl_get_electron_up_num (context, &n);
|
//rc = qmckl_get_electron_up_num (context, &n);
|
||||||
assert(rc == QMCKL_NOT_PROVIDED);
|
//assert(rc == QMCKL_NOT_PROVIDED);
|
||||||
|
//
|
||||||
rc = qmckl_get_electron_down_num (context, &n);
|
//rc = qmckl_get_electron_down_num (context, &n);
|
||||||
assert(rc == QMCKL_NOT_PROVIDED);
|
//assert(rc == QMCKL_NOT_PROVIDED);
|
||||||
|
//
|
||||||
|
//
|
||||||
rc = qmckl_set_electron_num (context, elec_up_num, elec_dn_num);
|
//rc = qmckl_set_electron_num (context, elec_up_num, elec_dn_num);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
assert(!qmckl_electron_provided(context));
|
//assert(!qmckl_electron_provided(context));
|
||||||
|
//
|
||||||
rc = qmckl_get_electron_up_num (context, &n);
|
//rc = qmckl_get_electron_up_num (context, &n);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
assert(n == elec_up_num);
|
//assert(n == elec_up_num);
|
||||||
|
//
|
||||||
rc = qmckl_get_electron_down_num (context, &n);
|
//rc = qmckl_get_electron_down_num (context, &n);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
assert(n == elec_dn_num);
|
//assert(n == elec_dn_num);
|
||||||
|
//
|
||||||
rc = qmckl_get_electron_num (context, &n);
|
//rc = qmckl_get_electron_num (context, &n);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
assert(n == elec_num);
|
//assert(n == elec_num);
|
||||||
|
//
|
||||||
double k_ee = 0.;
|
//double k_ee = 0.;
|
||||||
double k_en = 0.;
|
//double k_en = 0.;
|
||||||
rc = qmckl_get_electron_rescale_factor_ee (context, &k_ee);
|
//rc = qmckl_get_electron_rescale_factor_ee (context, &k_ee);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
assert(k_ee == 1.0);
|
//assert(k_ee == 1.0);
|
||||||
|
//
|
||||||
rc = qmckl_get_electron_rescale_factor_en (context, &k_en);
|
//rc = qmckl_get_electron_rescale_factor_en (context, &k_en);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
assert(k_en == 1.0);
|
//assert(k_en == 1.0);
|
||||||
|
//
|
||||||
rc = qmckl_set_electron_rescale_factor_en(context, rescale_factor_kappa_en);
|
//rc = qmckl_set_electron_rescale_factor_en(context, rescale_factor_kappa_en);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
|
//
|
||||||
rc = qmckl_set_electron_rescale_factor_ee(context, rescale_factor_kappa_ee);
|
//rc = qmckl_set_electron_rescale_factor_ee(context, rescale_factor_kappa_ee);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
|
//
|
||||||
rc = qmckl_get_electron_rescale_factor_ee (context, &k_ee);
|
//rc = qmckl_get_electron_rescale_factor_ee (context, &k_ee);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
assert(k_ee == rescale_factor_kappa_ee);
|
//assert(k_ee == rescale_factor_kappa_ee);
|
||||||
|
//
|
||||||
rc = qmckl_get_electron_rescale_factor_en (context, &k_en);
|
//rc = qmckl_get_electron_rescale_factor_en (context, &k_en);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
assert(k_en == rescale_factor_kappa_en);
|
//assert(k_en == rescale_factor_kappa_en);
|
||||||
|
//
|
||||||
|
//
|
||||||
int64_t w;
|
//int64_t w;
|
||||||
rc = qmckl_get_electron_walk_num (context, &w);
|
//rc = qmckl_get_electron_walk_num (context, &w);
|
||||||
assert(rc == QMCKL_NOT_PROVIDED);
|
//assert(rc == QMCKL_NOT_PROVIDED);
|
||||||
|
//
|
||||||
|
//
|
||||||
rc = qmckl_set_electron_walk_num (context, walk_num);
|
//rc = qmckl_set_electron_walk_num (context, walk_num);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
|
//
|
||||||
rc = qmckl_get_electron_walk_num (context, &w);
|
//rc = qmckl_get_electron_walk_num (context, &w);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
assert(w == walk_num);
|
//assert(w == walk_num);
|
||||||
|
//
|
||||||
assert(qmckl_electron_provided(context));
|
//assert(qmckl_electron_provided(context));
|
||||||
|
//
|
||||||
rc = qmckl_set_electron_coord (context, 'N', elec_coord);
|
//rc = qmckl_set_electron_coord (context, 'N', elec_coord);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
|
//
|
||||||
double elec_coord2[walk_num*3*elec_num];
|
//double elec_coord2[walk_num*3*elec_num];
|
||||||
|
//
|
||||||
rc = qmckl_get_electron_coord (context, 'N', elec_coord2);
|
//rc = qmckl_get_electron_coord (context, 'N', elec_coord2);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
for (int64_t i=0 ; i<3*elec_num ; ++i) {
|
//for (int64_t i=0 ; i<3*elec_num ; ++i) {
|
||||||
assert( elec_coord[i] == elec_coord2[i] );
|
// assert( elec_coord[i] == elec_coord2[i] );
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
/* Provide Nucleus data */
|
///* Provide Nucleus data */
|
||||||
|
//
|
||||||
assert(!qmckl_nucleus_provided(context));
|
//assert(!qmckl_nucleus_provided(context));
|
||||||
|
//
|
||||||
rc = qmckl_get_nucleus_num (context, &n);
|
//rc = qmckl_get_nucleus_num (context, &n);
|
||||||
assert(rc == QMCKL_NOT_PROVIDED);
|
//assert(rc == QMCKL_NOT_PROVIDED);
|
||||||
|
//
|
||||||
|
//
|
||||||
rc = qmckl_set_nucleus_num (context, nucl_num);
|
//rc = qmckl_set_nucleus_num (context, nucl_num);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
assert(!qmckl_nucleus_provided(context));
|
//assert(!qmckl_nucleus_provided(context));
|
||||||
|
//
|
||||||
rc = qmckl_get_nucleus_num (context, &n);
|
//rc = qmckl_get_nucleus_num (context, &n);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
assert(n == nucl_num);
|
//assert(n == nucl_num);
|
||||||
|
//
|
||||||
double k;
|
//double k;
|
||||||
rc = qmckl_get_nucleus_rescale_factor (context, &k);
|
//rc = qmckl_get_nucleus_rescale_factor (context, &k);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
assert(k == 1.0);
|
//assert(k == 1.0);
|
||||||
|
//
|
||||||
|
//
|
||||||
rc = qmckl_set_nucleus_rescale_factor (context, nucl_rescale_factor_kappa);
|
//rc = qmckl_set_nucleus_rescale_factor (context, nucl_rescale_factor_kappa);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
|
//
|
||||||
rc = qmckl_get_nucleus_rescale_factor (context, &k);
|
//rc = qmckl_get_nucleus_rescale_factor (context, &k);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
assert(k == nucl_rescale_factor_kappa);
|
//assert(k == nucl_rescale_factor_kappa);
|
||||||
|
//
|
||||||
double nucl_coord2[3*nucl_num];
|
//double nucl_coord2[3*nucl_num];
|
||||||
|
//
|
||||||
rc = qmckl_get_nucleus_coord (context, 'T', nucl_coord2);
|
//rc = qmckl_get_nucleus_coord (context, 'T', nucl_coord2);
|
||||||
assert(rc == QMCKL_NOT_PROVIDED);
|
//assert(rc == QMCKL_NOT_PROVIDED);
|
||||||
|
//
|
||||||
rc = qmckl_set_nucleus_coord (context, 'T', &(nucl_coord[0]));
|
//rc = qmckl_set_nucleus_coord (context, 'T', &(nucl_coord[0]));
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
|
//
|
||||||
assert(!qmckl_nucleus_provided(context));
|
//assert(!qmckl_nucleus_provided(context));
|
||||||
|
//
|
||||||
rc = qmckl_get_nucleus_coord (context, 'N', nucl_coord2);
|
//rc = qmckl_get_nucleus_coord (context, 'N', nucl_coord2);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
for (size_t k=0 ; k<3 ; ++k) {
|
//for (size_t k=0 ; k<3 ; ++k) {
|
||||||
for (size_t i=0 ; i<nucl_num ; ++i) {
|
// for (size_t i=0 ; i<nucl_num ; ++i) {
|
||||||
assert( nucl_coord[nucl_num*k+i] == nucl_coord2[3*i+k] );
|
// assert( nucl_coord[nucl_num*k+i] == nucl_coord2[3*i+k] );
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
rc = qmckl_get_nucleus_coord (context, 'T', nucl_coord2);
|
//rc = qmckl_get_nucleus_coord (context, 'T', nucl_coord2);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
for (size_t i=0 ; i<3*nucl_num ; ++i) {
|
//for (size_t i=0 ; i<3*nucl_num ; ++i) {
|
||||||
assert( nucl_coord[i] == nucl_coord2[i] );
|
// assert( nucl_coord[i] == nucl_coord2[i] );
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
double nucl_charge2[nucl_num];
|
//double nucl_charge2[nucl_num];
|
||||||
|
//
|
||||||
rc = qmckl_get_nucleus_charge(context, nucl_charge2);
|
//rc = qmckl_get_nucleus_charge(context, nucl_charge2);
|
||||||
assert(rc == QMCKL_NOT_PROVIDED);
|
//assert(rc == QMCKL_NOT_PROVIDED);
|
||||||
|
//
|
||||||
rc = qmckl_set_nucleus_charge(context, nucl_charge);
|
//rc = qmckl_set_nucleus_charge(context, nucl_charge);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
|
//
|
||||||
rc = qmckl_get_nucleus_charge(context, nucl_charge2);
|
//rc = qmckl_get_nucleus_charge(context, nucl_charge2);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
//assert(rc == QMCKL_SUCCESS);
|
||||||
for (size_t i=0 ; i<nucl_num ; ++i) {
|
//for (size_t i=0 ; i<nucl_num ; ++i) {
|
||||||
assert( nucl_charge[i] == nucl_charge2[i] );
|
// assert( nucl_charge[i] == nucl_charge2[i] );
|
||||||
}
|
// }
|
||||||
assert(qmckl_nucleus_provided(context));
|
//assert(qmckl_nucleus_provided(context));
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -1368,46 +1368,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
|
||||||
|
|
||||||
@ -1699,14 +1699,14 @@ print("factor_ee :",factor_ee)
|
|||||||
|
|
||||||
|
|
||||||
#+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));
|
||||||
|
//
|
||||||
double factor_ee[walk_num];
|
//double factor_ee[walk_num];
|
||||||
rc = qmckl_get_jastrow_factor_ee(context, factor_ee);
|
//rc = qmckl_get_jastrow_factor_ee(context, factor_ee);
|
||||||
|
//
|
||||||
// calculate factor_ee
|
//// calculate factor_ee
|
||||||
assert(fabs(factor_ee[0]+4.282760865958113) < 1.e-12);
|
//assert(fabs(factor_ee[0]+4.282760865958113) < 1.e-12);
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -2118,18 +2118,18 @@ print(factor_ee_deriv_e)
|
|||||||
|
|
||||||
|
|
||||||
#+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_ee_deriv_e
|
//// calculate factor_ee_deriv_e
|
||||||
double factor_ee_deriv_e[walk_num][4][elec_num];
|
//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]));
|
//rc = qmckl_get_jastrow_factor_ee_deriv_e(context, &(factor_ee_deriv_e[0][0][0]));
|
||||||
|
//
|
||||||
// check factor_ee_deriv_e
|
//// check factor_ee_deriv_e
|
||||||
assert(fabs(factor_ee_deriv_e[0][0][0]-0.16364894652107934) < 1.e-12);
|
//assert(fabs(factor_ee_deriv_e[0][0][0]-0.16364894652107934) < 1.e-12);
|
||||||
assert(fabs(factor_ee_deriv_e[0][1][0]+0.6927548119830084 ) < 1.e-12);
|
//assert(fabs(factor_ee_deriv_e[0][1][0]+0.6927548119830084 ) < 1.e-12);
|
||||||
assert(fabs(factor_ee_deriv_e[0][2][0]-0.073267755223968 ) < 1.e-12);
|
//assert(fabs(factor_ee_deriv_e[0][2][0]-0.073267755223968 ) < 1.e-12);
|
||||||
assert(fabs(factor_ee_deriv_e[0][3][0]-1.5111672803213185 ) < 1.e-12);
|
//assert(fabs(factor_ee_deriv_e[0][3][0]-1.5111672803213185 ) < 1.e-12);
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -2414,14 +2414,14 @@ print("factor_en :",factor_en)
|
|||||||
|
|
||||||
|
|
||||||
#+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));
|
||||||
|
//
|
||||||
double factor_en[walk_num];
|
//double factor_en[walk_num];
|
||||||
rc = qmckl_get_jastrow_factor_en(context, factor_en);
|
//rc = qmckl_get_jastrow_factor_en(context, factor_en);
|
||||||
|
//
|
||||||
// calculate factor_en
|
//// calculate factor_en
|
||||||
assert(fabs(factor_en[0]+5.865822569188727) < 1.e-12);
|
//assert(fabs(factor_en[0]+5.865822569188727) < 1.e-12);
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -2813,18 +2813,18 @@ 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_en_deriv_e[walk_num][4][elec_num];
|
//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]));
|
//rc = qmckl_get_jastrow_factor_en_deriv_e(context, &(factor_en_deriv_e[0][0][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);
|
||||||
assert(fabs(factor_en_deriv_e[0][1][0]+0.23301394780804574) < 1.e-12);
|
//assert(fabs(factor_en_deriv_e[0][1][0]+0.23301394780804574) < 1.e-12);
|
||||||
assert(fabs(factor_en_deriv_e[0][2][0]-0.17548337641865783) < 1.e-12);
|
//assert(fabs(factor_en_deriv_e[0][2][0]-0.17548337641865783) < 1.e-12);
|
||||||
assert(fabs(factor_en_deriv_e[0][3][0]+0.9667363412285741 ) < 1.e-12);
|
//assert(fabs(factor_en_deriv_e[0][3][0]+0.9667363412285741 ) < 1.e-12);
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user