1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-07-18 08:53:47 +02:00

Added test for MO but deactivated because slow. #32

This commit is contained in:
v1j4y 2021-10-04 09:08:38 +02:00
parent 4df8a5e066
commit 0c0f8e53d0

View File

@ -277,7 +277,6 @@ qmckl_exit_code qmckl_set_mo_basis_coefficient(qmckl_context context, const dou
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
mem_info.size = ctx->ao_basis.ao_num * ctx->mo_basis.mo_num * sizeof(double); mem_info.size = ctx->ao_basis.ao_num * ctx->mo_basis.mo_num * sizeof(double);
double* new_array = (double*) qmckl_malloc(context, mem_info); double* new_array = (double*) qmckl_malloc(context, mem_info);
if (new_array == NULL) { if (new_array == NULL) {
return qmckl_failwith( context, return qmckl_failwith( context,
QMCKL_ALLOCATION_FAILED, QMCKL_ALLOCATION_FAILED,
@ -783,23 +782,44 @@ double mo_vgl[5][walk_num][elec_num][chbrclf_mo_num];
rc = qmckl_get_mo_basis_vgl(context, &(mo_vgl[0][0][0][0])); rc = qmckl_get_mo_basis_vgl(context, &(mo_vgl[0][0][0][0]));
assert (rc == QMCKL_SUCCESS); assert (rc == QMCKL_SUCCESS);
//// Overlap of MOs // Test overlap of MO
//double ovl[mo_num][mo_num]; //double point_x[100];
//for (int i=0; i<mo_num; ++i) { //double point_y[100];
//for (int j=0; j<mo_num; ++j) { //double point_z[100];
// ovl[i][j] = 0.0; //int32_t npoints=100;
//} //// obtain points
//double dr = 20./(npoints-1);
//double dr3 = dr*dr*dr;
//
//for (int i=0;i<npoints;++i) {
// point_x[i] = -10. + dr*i;
// point_y[i] = -10. + dr*i;
// point_z[i] = -10. + dr*i;
//} //}
// //
//for (int iel=0;iel<elec_num;++iel){ //double ovlmo1 = 0.0;
//for (int i=0; i<mo_num; ++i) { //// Calculate overlap
//for (int j=0; j<mo_num; ++j) { //for (int i=0;i<npoints;++i) {
// ovl[i][j] += mo_vgl[0][0][iel][i] * mo_vgl[0][0][iel][j]; // printf(".");
// fflush(stdout);
// for (int j=0;j<npoints;++j) {
// for (int k=0;k<npoints;++k) {
// // Set point
// elec_coord[0] = point_x[i];
// elec_coord[1] = point_y[j];
// elec_coord[2] = point_z[k];
// rc = qmckl_set_electron_coord (context, 'N', elec_coord);
// assert(rc == QMCKL_SUCCESS);
//
// // Calculate value of MO (1st electron)
// double mo_vgl[5][walk_num][elec_num][chbrclf_mo_num];
// rc = qmckl_get_mo_basis_vgl(context, &(mo_vgl[0][0][0][0]));
// assert (rc == QMCKL_SUCCESS);
// ovlmo1 += mo_vgl[0][0][0][0];
// }
// }
//} //}
//} //printf("OVL MO1 = %10.15f\n",ovlmo1);
//}
//for (int i=0;i<mo_num-1;++i)
// printf("%d) %10.14f (%10.14f)\n",ovl[i][i], ovl[i][i+1]);
printf("\n"); printf("\n");