mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-03 10:06:09 +01:00
warnings
This commit is contained in:
parent
511eba5843
commit
731fded4a8
@ -1134,36 +1134,28 @@ end function qmckl_compute_det_vgl_beta_f
|
|||||||
|
|
||||||
#+begin_src c :tangle (eval c_test) :exports none
|
#+begin_src c :tangle (eval c_test) :exports none
|
||||||
|
|
||||||
#define walk_num chbrclf_walk_num
|
|
||||||
#define elec_num chbrclf_elec_num
|
|
||||||
#define shell_num chbrclf_shell_num
|
|
||||||
#define ao_num chbrclf_ao_num
|
|
||||||
|
|
||||||
int64_t elec_up_num = chbrclf_elec_up_num;
|
|
||||||
int64_t elec_dn_num = chbrclf_elec_dn_num;
|
|
||||||
double* elec_coord = &(chbrclf_elec_coord[0][0][0]);
|
double* elec_coord = &(chbrclf_elec_coord[0][0][0]);
|
||||||
const int64_t nucl_num = chbrclf_nucl_num;
|
|
||||||
const double* nucl_charge = chbrclf_charge;
|
const double* nucl_charge = chbrclf_charge;
|
||||||
const double* nucl_coord = &(chbrclf_nucl_coord[0][0]);
|
const double* nucl_coord = &(chbrclf_nucl_coord[0][0]);
|
||||||
|
|
||||||
rc = qmckl_set_electron_num (context, elec_up_num, elec_dn_num);
|
rc = qmckl_set_electron_num (context, chbrclf_elec_up_num, chbrclf_elec_dn_num);
|
||||||
assert (rc == QMCKL_SUCCESS);
|
assert (rc == QMCKL_SUCCESS);
|
||||||
|
|
||||||
rc = qmckl_set_electron_walk_num (context, walk_num);
|
rc = qmckl_set_electron_walk_num (context, chbrclf_walk_num);
|
||||||
assert (rc == QMCKL_SUCCESS);
|
assert (rc == QMCKL_SUCCESS);
|
||||||
|
|
||||||
assert(qmckl_electron_provided(context));
|
assert(qmckl_electron_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_electron_coord (context, 'N', elec_coord, walk_num*elec_num*3);
|
rc = qmckl_set_electron_coord (context, 'N', elec_coord, chbrclf_walk_num*chbrclf_elec_num*3);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
|
|
||||||
rc = qmckl_set_nucleus_num (context, nucl_num);
|
rc = qmckl_set_nucleus_num (context, chbrclf_nucl_num);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
|
|
||||||
rc = qmckl_set_nucleus_coord (context, 'T', &(nucl_coord[0]), nucl_num*3);
|
rc = qmckl_set_nucleus_coord (context, 'T', &(nucl_coord[0]), chbrclf_nucl_num*3);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
|
|
||||||
rc = qmckl_set_nucleus_charge(context, nucl_charge, nucl_num);
|
rc = qmckl_set_nucleus_charge(context, nucl_charge, chbrclf_nucl_num);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
|
|
||||||
assert(qmckl_nucleus_provided(context));
|
assert(qmckl_nucleus_provided(context));
|
||||||
@ -1195,27 +1187,27 @@ rc = qmckl_set_ao_basis_prim_num (context, chbrclf_prim_num);
|
|||||||
assert(rc == QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
assert(!qmckl_ao_basis_provided(context));
|
assert(!qmckl_ao_basis_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_ao_basis_nucleus_index (context, nucleus_index, nucl_num);
|
rc = qmckl_set_ao_basis_nucleus_index (context, nucleus_index, chbrclf_nucl_num);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
assert(!qmckl_ao_basis_provided(context));
|
assert(!qmckl_ao_basis_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_ao_basis_nucleus_shell_num (context, nucleus_shell_num, nucl_num);
|
rc = qmckl_set_ao_basis_nucleus_shell_num (context, nucleus_shell_num, chbrclf_nucl_num);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
assert(!qmckl_ao_basis_provided(context));
|
assert(!qmckl_ao_basis_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_ao_basis_shell_ang_mom (context, shell_ang_mom, shell_num);
|
rc = qmckl_set_ao_basis_shell_ang_mom (context, shell_ang_mom, chbrclf_shell_num);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
assert(!qmckl_ao_basis_provided(context));
|
assert(!qmckl_ao_basis_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_ao_basis_shell_factor (context, shell_factor, shell_num);
|
rc = qmckl_set_ao_basis_shell_factor (context, shell_factor, chbrclf_shell_num);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
assert(!qmckl_ao_basis_provided(context));
|
assert(!qmckl_ao_basis_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_ao_basis_shell_prim_num (context, shell_prim_num, shell_num);
|
rc = qmckl_set_ao_basis_shell_prim_num (context, shell_prim_num, chbrclf_shell_num);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
assert(!qmckl_ao_basis_provided(context));
|
assert(!qmckl_ao_basis_provided(context));
|
||||||
|
|
||||||
rc = qmckl_set_ao_basis_shell_prim_index (context, shell_prim_index, shell_num);
|
rc = qmckl_set_ao_basis_shell_prim_index (context, shell_prim_index, chbrclf_shell_num);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
assert(!qmckl_ao_basis_provided(context));
|
assert(!qmckl_ao_basis_provided(context));
|
||||||
|
|
||||||
@ -1239,14 +1231,13 @@ assert(rc == QMCKL_SUCCESS);
|
|||||||
assert(qmckl_ao_basis_provided(context));
|
assert(qmckl_ao_basis_provided(context));
|
||||||
|
|
||||||
|
|
||||||
double ao_vgl[walk_num*elec_num][5][chbrclf_ao_num];
|
double ao_vgl[chbrclf_walk_num*chbrclf_elec_num][5][chbrclf_ao_num];
|
||||||
|
|
||||||
rc = qmckl_get_ao_basis_ao_vgl(context, &(ao_vgl[0][0][0]), (int64_t) 5*walk_num*elec_num*chbrclf_ao_num);
|
rc = qmckl_get_ao_basis_ao_vgl(context, &(ao_vgl[0][0][0]), (int64_t) 5*chbrclf_walk_num*chbrclf_elec_num*chbrclf_ao_num);
|
||||||
assert (rc == QMCKL_SUCCESS);
|
assert (rc == QMCKL_SUCCESS);
|
||||||
|
|
||||||
/* Set up MO data */
|
/* Set up MO data */
|
||||||
const int64_t mo_num = chbrclf_mo_num;
|
rc = qmckl_set_mo_basis_mo_num(context, chbrclf_mo_num);
|
||||||
rc = qmckl_set_mo_basis_mo_num(context, mo_num);
|
|
||||||
assert (rc == QMCKL_SUCCESS);
|
assert (rc == QMCKL_SUCCESS);
|
||||||
|
|
||||||
const double * mo_coefficient = &(chbrclf_mo_coef[0]);
|
const double * mo_coefficient = &(chbrclf_mo_coef[0]);
|
||||||
@ -1256,31 +1247,31 @@ assert (rc == QMCKL_SUCCESS);
|
|||||||
|
|
||||||
assert(qmckl_mo_basis_provided(context));
|
assert(qmckl_mo_basis_provided(context));
|
||||||
|
|
||||||
double mo_vgl[walk_num*elec_num][5][chbrclf_mo_num];
|
double mo_vgl[chbrclf_walk_num*chbrclf_elec_num][5][chbrclf_mo_num];
|
||||||
rc = qmckl_get_mo_basis_mo_vgl(context, &(mo_vgl[0][0][0]), 5*walk_num*elec_num*chbrclf_mo_num);
|
rc = qmckl_get_mo_basis_mo_vgl(context, &(mo_vgl[0][0][0]), 5*chbrclf_walk_num*chbrclf_elec_num*chbrclf_mo_num);
|
||||||
assert (rc == QMCKL_SUCCESS);
|
assert (rc == QMCKL_SUCCESS);
|
||||||
|
|
||||||
/* Set up determinant data */
|
/* Set up determinant data */
|
||||||
|
|
||||||
const int64_t det_num_alpha = 1;
|
#define det_num_alpha 1
|
||||||
const int64_t det_num_beta = 1;
|
#define det_num_beta 1
|
||||||
int64_t mo_index_alpha[det_num_alpha][walk_num][elec_up_num];
|
int64_t mo_index_alpha[det_num_alpha][chbrclf_walk_num][chbrclf_elec_up_num];
|
||||||
int64_t mo_index_beta[det_num_alpha][walk_num][elec_dn_num];
|
int64_t mo_index_beta[det_num_alpha][chbrclf_walk_num][chbrclf_elec_dn_num];
|
||||||
|
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
for(k = 0; k < det_num_alpha; ++k)
|
for(k = 0; k < det_num_alpha; ++k)
|
||||||
for(i = 0; i < walk_num; ++i)
|
for(i = 0; i < chbrclf_walk_num; ++i)
|
||||||
for(j = 0; j < elec_up_num; ++j)
|
for(j = 0; j < chbrclf_elec_up_num; ++j)
|
||||||
mo_index_alpha[k][i][j] = j + 1;
|
mo_index_alpha[k][i][j] = j + 1;
|
||||||
for(k = 0; k < det_num_beta; ++k)
|
for(k = 0; k < det_num_beta; ++k)
|
||||||
for(i = 0; i < walk_num; ++i)
|
for(i = 0; i < chbrclf_walk_num; ++i)
|
||||||
for(j = 0; j < elec_up_num; ++j)
|
for(j = 0; j < chbrclf_elec_up_num; ++j)
|
||||||
mo_index_beta[k][i][j] = j + 1;
|
mo_index_beta[k][i][j] = j + 1;
|
||||||
|
|
||||||
rc = qmckl_set_determinant_type (context, typ);
|
rc = qmckl_set_determinant_type (context, typ);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
|
|
||||||
rc = qmckl_set_determinant_walk_num (context, walk_num);
|
rc = qmckl_set_determinant_walk_num (context, chbrclf_walk_num);
|
||||||
assert (rc == QMCKL_SUCCESS);
|
assert (rc == QMCKL_SUCCESS);
|
||||||
|
|
||||||
rc = qmckl_set_determinant_det_num_alpha (context, det_num_alpha);
|
rc = qmckl_set_determinant_det_num_alpha (context, det_num_alpha);
|
||||||
@ -1297,8 +1288,8 @@ assert (rc == QMCKL_SUCCESS);
|
|||||||
|
|
||||||
// Get slater-determinant
|
// Get slater-determinant
|
||||||
|
|
||||||
double det_vgl_alpha[det_num_alpha][walk_num][5][elec_up_num][elec_up_num];
|
double det_vgl_alpha[det_num_alpha][chbrclf_walk_num][5][chbrclf_elec_up_num][chbrclf_elec_up_num];
|
||||||
double det_vgl_beta[det_num_beta][walk_num][5][elec_dn_num][elec_dn_num];
|
double det_vgl_beta[det_num_beta][chbrclf_walk_num][5][chbrclf_elec_dn_num][chbrclf_elec_dn_num];
|
||||||
|
|
||||||
rc = qmckl_get_det_vgl_alpha(context, &(det_vgl_alpha[0][0][0][0][0]));
|
rc = qmckl_get_det_vgl_alpha(context, &(det_vgl_alpha[0][0][0][0][0]));
|
||||||
assert (rc == QMCKL_SUCCESS);
|
assert (rc == QMCKL_SUCCESS);
|
||||||
@ -2047,8 +2038,8 @@ end function qmckl_compute_det_inv_matrix_beta_f
|
|||||||
#+begin_src c :tangle (eval c_test) :exports none
|
#+begin_src c :tangle (eval c_test) :exports none
|
||||||
// Get adjoint of the slater-determinant
|
// Get adjoint of the slater-determinant
|
||||||
|
|
||||||
double det_inv_matrix_alpha[det_num_alpha][walk_num][elec_up_num][elec_up_num];
|
double det_inv_matrix_alpha[det_num_alpha][chbrclf_walk_num][chbrclf_elec_up_num][chbrclf_elec_up_num];
|
||||||
double det_inv_matrix_beta[det_num_beta][walk_num][elec_dn_num][elec_dn_num];
|
double det_inv_matrix_beta[det_num_beta][chbrclf_walk_num][chbrclf_elec_dn_num][chbrclf_elec_dn_num];
|
||||||
|
|
||||||
rc = qmckl_get_det_inv_matrix_alpha(context, &(det_inv_matrix_alpha[0][0][0][0]));
|
rc = qmckl_get_det_inv_matrix_alpha(context, &(det_inv_matrix_alpha[0][0][0][0]));
|
||||||
assert (rc == QMCKL_SUCCESS);
|
assert (rc == QMCKL_SUCCESS);
|
||||||
|
@ -672,7 +672,6 @@ end interface
|
|||||||
** Test
|
** Test
|
||||||
|
|
||||||
#+begin_src c :tangle (eval c_test)
|
#+begin_src c :tangle (eval c_test)
|
||||||
const int64_t nucl_num = chbrclf_nucl_num;
|
|
||||||
const double* nucl_charge = chbrclf_charge;
|
const double* nucl_charge = chbrclf_charge;
|
||||||
const double* nucl_coord = &(chbrclf_nucl_coord[0][0]);
|
const double* nucl_coord = &(chbrclf_nucl_coord[0][0]);
|
||||||
const double nucl_rescale_factor_kappa = 2.0;
|
const double nucl_rescale_factor_kappa = 2.0;
|
||||||
@ -688,13 +687,13 @@ 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, chbrclf_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 == chbrclf_nucl_num);
|
||||||
|
|
||||||
double k;
|
double k;
|
||||||
rc = qmckl_get_nucleus_rescale_factor (context, &k);
|
rc = qmckl_get_nucleus_rescale_factor (context, &k);
|
||||||
@ -709,41 +708,41 @@ 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*chbrclf_nucl_num];
|
||||||
|
|
||||||
rc = qmckl_get_nucleus_coord (context, 'T', nucl_coord2, 3*nucl_num);
|
rc = qmckl_get_nucleus_coord (context, 'T', nucl_coord2, 3*chbrclf_nucl_num);
|
||||||
assert(rc == QMCKL_NOT_PROVIDED);
|
assert(rc == QMCKL_NOT_PROVIDED);
|
||||||
|
|
||||||
rc = qmckl_set_nucleus_coord (context, 'T', &(nucl_coord[0]), 3*nucl_num);
|
rc = qmckl_set_nucleus_coord (context, 'T', &(nucl_coord[0]), 3*chbrclf_nucl_num);
|
||||||
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, 3*nucl_num);
|
rc = qmckl_get_nucleus_coord (context, 'N', nucl_coord2, 3*chbrclf_nucl_num);
|
||||||
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 (int64_t i=0 ; i<nucl_num ; ++i) {
|
for (int64_t i=0 ; i<chbrclf_nucl_num ; ++i) {
|
||||||
assert( nucl_coord[nucl_num*k+i] == nucl_coord2[3*i+k] );
|
assert( nucl_coord[chbrclf_nucl_num*k+i] == nucl_coord2[3*i+k] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = qmckl_get_nucleus_coord (context, 'T', nucl_coord2, 3*nucl_num);
|
rc = qmckl_get_nucleus_coord (context, 'T', nucl_coord2, 3*chbrclf_nucl_num);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
for (int64_t i=0 ; i<3*nucl_num ; ++i) {
|
for (int64_t i=0 ; i<3*chbrclf_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[chbrclf_nucl_num];
|
||||||
|
|
||||||
rc = qmckl_get_nucleus_charge(context, nucl_charge2, nucl_num);
|
rc = qmckl_get_nucleus_charge(context, nucl_charge2, chbrclf_nucl_num);
|
||||||
assert(rc == QMCKL_NOT_PROVIDED);
|
assert(rc == QMCKL_NOT_PROVIDED);
|
||||||
|
|
||||||
rc = qmckl_set_nucleus_charge(context, nucl_charge, nucl_num);
|
rc = qmckl_set_nucleus_charge(context, nucl_charge, chbrclf_nucl_num);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
|
|
||||||
rc = qmckl_get_nucleus_charge(context, nucl_charge2, nucl_num);
|
rc = qmckl_get_nucleus_charge(context, nucl_charge2, chbrclf_nucl_num);
|
||||||
assert(rc == QMCKL_SUCCESS);
|
assert(rc == QMCKL_SUCCESS);
|
||||||
for (int64_t i=0 ; i<nucl_num ; ++i) {
|
for (int64_t i=0 ; i<chbrclf_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));
|
||||||
@ -940,10 +939,10 @@ qmckl_exit_code qmckl_compute_nn_distance (
|
|||||||
|
|
||||||
assert(qmckl_nucleus_provided(context));
|
assert(qmckl_nucleus_provided(context));
|
||||||
|
|
||||||
double distance[nucl_num*nucl_num];
|
double distance[chbrclf_nucl_num*chbrclf_nucl_num];
|
||||||
rc = qmckl_get_nucleus_nn_distance(context, distance, nucl_num*nucl_num);
|
rc = qmckl_get_nucleus_nn_distance(context, distance, chbrclf_nucl_num*chbrclf_nucl_num);
|
||||||
assert(distance[0] == 0.);
|
assert(distance[0] == 0.);
|
||||||
assert(distance[1] == distance[nucl_num]);
|
assert(distance[1] == distance[chbrclf_nucl_num]);
|
||||||
assert(fabs(distance[1]-2.070304721365169) < 1.e-12);
|
assert(fabs(distance[1]-2.070304721365169) < 1.e-12);
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
Loading…
Reference in New Issue
Block a user