mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2024-08-24 22:21:46 +02:00
Fixed issue with tests header. Reinstated Jastrow tests. #22
This commit is contained in:
parent
9b55720fa0
commit
a94c6a598a
@ -52,7 +52,7 @@ test_qmckl_f = tests/qmckl_f.f90
|
|||||||
test_qmckl_fo = tests/qmckl_f.o
|
test_qmckl_fo = tests/qmckl_f.o
|
||||||
src_qmckl_f = src/qmckl_f.f90
|
src_qmckl_f = src/qmckl_f.f90
|
||||||
src_qmckl_fo = src/qmckl_f.o
|
src_qmckl_fo = src/qmckl_f.o
|
||||||
header_tests = tests/chbrclf.h
|
header_tests = tests/chbrclf.h tests/n2.h
|
||||||
|
|
||||||
fortrandir = $(datadir)/$(PACKAGE_NAME)/fortran/
|
fortrandir = $(datadir)/$(PACKAGE_NAME)/fortran/
|
||||||
dist_fortran_DATA = $(qmckl_f)
|
dist_fortran_DATA = $(qmckl_f)
|
||||||
@ -157,6 +157,7 @@ $(htmlize_el):
|
|||||||
|
|
||||||
tests/chbrclf.h: $(qmckl_h)
|
tests/chbrclf.h: $(qmckl_h)
|
||||||
|
|
||||||
|
tests/n2.h: $(qmckl_h)
|
||||||
|
|
||||||
generated.mk: $(ORG_FILES)
|
generated.mk: $(ORG_FILES)
|
||||||
$(PYTHON) $(srcdir)/tools/build_makefile.py
|
$(PYTHON) $(srcdir)/tools/build_makefile.py
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -1013,3 +1013,159 @@ double chbrclf_elec_coord[chbrclf_walk_num][chbrclf_elec_num][3] = { {
|
|||||||
|
|
||||||
|
|
||||||
#+END_src
|
#+END_src
|
||||||
|
|
||||||
|
|
||||||
|
* N2
|
||||||
|
|
||||||
|
This test is mainly for the Jastrow factor and was supplied by
|
||||||
|
Ramon Panades Baruetta. The coordinates and Jastrow coefficients
|
||||||
|
have been taken from his fork of IRPJast. The core electrons are
|
||||||
|
treated by pseudopotentials thus excluded from the actual calculation.
|
||||||
|
|
||||||
|
| Number of atoms | 2 |
|
||||||
|
| Number of alpha electrons | 5 |
|
||||||
|
| Number of beta electrons | 5 |
|
||||||
|
| Number of core electrons | 4 |
|
||||||
|
|
||||||
|
** XYZ coordinates
|
||||||
|
|
||||||
|
#+BEGIN_example
|
||||||
|
2
|
||||||
|
N2
|
||||||
|
N 0.000000 0.000000 0.000000
|
||||||
|
N 0.000000 0.000000 2.059801
|
||||||
|
#+END_example
|
||||||
|
|
||||||
|
Nuclear coordinates are stored in atomic units in transposed format.
|
||||||
|
|
||||||
|
#+begin_src c :tangle ../tests/n2.h
|
||||||
|
#define n2_nucl_num ((int64_t) 2)
|
||||||
|
|
||||||
|
double n2_charge[n2_nucl_num] = { 5., 5.};
|
||||||
|
|
||||||
|
double n2_nucl_coord[3][n2_nucl_num] =
|
||||||
|
{ {0.000000, 0.000000 },
|
||||||
|
{0.000000, 0.000000 },
|
||||||
|
{0.000000, 2.059801 } };
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** Electron coordinates
|
||||||
|
|
||||||
|
|
||||||
|
Electron coordinates are stored in atomic units in normal format.
|
||||||
|
|
||||||
|
#+begin_src c :tangle ../tests/n2.h
|
||||||
|
#define n2_elec_up_num ((int64_t) 5)
|
||||||
|
#define n2_elec_dn_num ((int64_t) 5)
|
||||||
|
#define n2_elec_num ((int64_t) 10)
|
||||||
|
#define n2_walk_num ((int64_t) 1)
|
||||||
|
|
||||||
|
double n2_elec_coord[n2_walk_num][n2_elec_num][3] = { {
|
||||||
|
{-0.250655104764153 , 0.503070975550133 , -0.166554344502303},
|
||||||
|
{-0.587812193472177 , -0.128751981129274 , 0.187773606533075},
|
||||||
|
{ 1.61335569047166 , -0.615556732874863 , -1.43165470979934 },
|
||||||
|
{-4.901239896295210E-003 , -1.120440036458986E-002 , 1.99761909330422 },
|
||||||
|
{ 0.766647499681200 , -0.293515395797937 , 3.66454589201239 },
|
||||||
|
{-0.127732483187947 , -0.138975497694196 , -8.669850480215846E-002},
|
||||||
|
{-0.232271834949124 , -1.059321673434182E-002 , -0.504862241464867},
|
||||||
|
{ 1.09360863531826 , -2.036103063808752E-003 , -2.702796910818986E-002},
|
||||||
|
{-0.108090166832043 , 0.189161729653261 , 2.15398313919894},
|
||||||
|
{ 0.397978144318712 , -0.254277292595981 , 2.54553335476344}}};
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
** Jastrow related data
|
||||||
|
|
||||||
|
This test is mainly for the Jastrow factor and was supplied by
|
||||||
|
Ramon Panades Baruetta.
|
||||||
|
|
||||||
|
#+begin_src c :tangle ../tests/n2.h
|
||||||
|
/* Jastrow related */
|
||||||
|
|
||||||
|
#define n2_type_nucl_num ((int64_t) 1)
|
||||||
|
#define n2_aord_num ((int64_t) 5)
|
||||||
|
#define n2_bord_num ((int64_t) 5)
|
||||||
|
#define n2_cord_num ((int64_t) 23)
|
||||||
|
#define n2_dim_cord_vec ((int64_t) 23)
|
||||||
|
|
||||||
|
int64_t n2_type_nucl_vector[n2_nucl_num] = {
|
||||||
|
1,
|
||||||
|
1};
|
||||||
|
|
||||||
|
double n2_aord_vector[n2_aord_num + 1][n2_type_nucl_num] = {
|
||||||
|
{ 0. },
|
||||||
|
{ 0. },
|
||||||
|
{-0.380512},
|
||||||
|
{-0.157996},
|
||||||
|
{-0.031558},
|
||||||
|
{ 0.021512}};
|
||||||
|
|
||||||
|
double n2_bord_vector[n2_bord_num + 1] = {
|
||||||
|
0.5 ,
|
||||||
|
0.15366 ,
|
||||||
|
0.0672262 ,
|
||||||
|
0.02157 ,
|
||||||
|
0.0073096 ,
|
||||||
|
0.002866 };
|
||||||
|
|
||||||
|
double n2_cord_vector[n2_cord_num][n2_type_nucl_num] = {
|
||||||
|
{ 5.717020e-01},
|
||||||
|
{-5.142530e-01},
|
||||||
|
{-5.130430e-01},
|
||||||
|
{ 9.486000e-03},
|
||||||
|
{-4.205000e-03},
|
||||||
|
{ 4.263258e-01},
|
||||||
|
{ 8.288150e-02},
|
||||||
|
{ 5.118600e-03},
|
||||||
|
{-2.997800e-03},
|
||||||
|
{-5.270400e-03},
|
||||||
|
{-7.500000e-05},
|
||||||
|
{-8.301650e-02},
|
||||||
|
{ 1.454340e-02},
|
||||||
|
{ 5.143510e-02},
|
||||||
|
{ 9.250000e-04},
|
||||||
|
{-4.099100e-03},
|
||||||
|
{ 4.327600e-03},
|
||||||
|
{-1.654470e-03},
|
||||||
|
{ 2.614000e-03},
|
||||||
|
{-1.477000e-03},
|
||||||
|
{-1.137000e-03},
|
||||||
|
{-4.010475e-02},
|
||||||
|
{ 6.106710e-03}};
|
||||||
|
|
||||||
|
double n2_cord_vector_full[n2_dim_cord_vec][n2_nucl_num] = {
|
||||||
|
{ 5.717020e-01, 5.717020e-01},
|
||||||
|
{-5.142530e-01, -5.142530e-01},
|
||||||
|
{-5.130430e-01, -5.130430e-01},
|
||||||
|
{ 9.486000e-03, 9.486000e-03},
|
||||||
|
{-4.205000e-03, -4.205000e-03},
|
||||||
|
{ 4.263258e-01, 4.263258e-01},
|
||||||
|
{ 8.288150e-02, 8.288150e-02},
|
||||||
|
{ 5.118600e-03, 5.118600e-03},
|
||||||
|
{-2.997800e-03, -2.997800e-03},
|
||||||
|
{-5.270400e-03, -5.270400e-03},
|
||||||
|
{-7.500000e-05, -7.500000e-05},
|
||||||
|
{-8.301650e-02, -8.301650e-02},
|
||||||
|
{ 1.454340e-02, 1.454340e-02},
|
||||||
|
{ 5.143510e-02, 5.143510e-02},
|
||||||
|
{ 9.250000e-04, 9.250000e-04},
|
||||||
|
{-4.099100e-03, -4.099100e-03},
|
||||||
|
{ 4.327600e-03, 4.327600e-03},
|
||||||
|
{-1.654470e-03, -1.654470e-03},
|
||||||
|
{ 2.614000e-03, 2.614000e-03},
|
||||||
|
{-1.477000e-03, -1.477000e-03},
|
||||||
|
{-1.137000e-03, -1.137000e-03},
|
||||||
|
{-4.010475e-02, -4.010475e-02},
|
||||||
|
{ 6.106710e-03, 6.106710e-03}};
|
||||||
|
|
||||||
|
double n2_lkpm_of_cindex[4][n2_dim_cord_vec] = {
|
||||||
|
{1, 1, 2, 0, 0, 0, 2, 1, 1, 2, 3, 0, 2, 1, 3, 0, 0, 1, 3, 1, 1, 0, 3},
|
||||||
|
{1, 1, 3, 4, 0, 2, 2, 4, 0, 0, 2, 4, 1, 3, 1, 4, 0, 1, 1, 4, 1, 2, 0},
|
||||||
|
{4, 1, 0, 0, 4, 2, 1, 4, 5, 0, 2, 3, 5, 0, 0, 3, 5, 1, 3, 2, 5, 0, 1},
|
||||||
|
{2, 5, 1, 4, 1, 5, 0, 2, 1, 5, 1, 0, 1, 5, 2, 3, 0, 5, 1, 1, 0, 5, 2}};
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
# -*- mode: org -*-
|
||||||
|
# vim: syntax=c
|
||||||
|
@ -107,4 +107,3 @@ double n2_lkpm_of_cindex[4][n2_dim_cord_vec] = {
|
|||||||
{1, 1, 3, 4, 0, 2, 2, 4, 0, 0, 2, 4, 1, 3, 1, 4, 0, 1, 1, 4, 1, 2, 0},
|
{1, 1, 3, 4, 0, 2, 2, 4, 0, 0, 2, 4, 1, 3, 1, 4, 0, 1, 1, 4, 1, 2, 0},
|
||||||
{4, 1, 0, 0, 4, 2, 1, 4, 5, 0, 2, 3, 5, 0, 0, 3, 5, 1, 3, 2, 5, 0, 1},
|
{4, 1, 0, 0, 4, 2, 1, 4, 5, 0, 2, 3, 5, 0, 0, 3, 5, 1, 3, 2, 5, 0, 1},
|
||||||
{2, 5, 1, 4, 1, 5, 0, 2, 1, 5, 1, 0, 1, 5, 2, 3, 0, 5, 1, 1, 0, 5, 2}};
|
{2, 5, 1, 4, 1, 5, 0, 2, 1, 5, 1, 0, 1, 5, 2, 3, 0, 5, 1, 1, 0, 5, 2}};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user