mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-03 18:16:28 +01:00
Fixed bug in size of mo_index list. #41
This commit is contained in:
parent
2cf5366108
commit
b53b4afeab
@ -424,7 +424,7 @@ qmckl_exit_code qmckl_set_determinant_mo_index_alpha(qmckl_context context, con
|
||||
}
|
||||
|
||||
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
|
||||
mem_info.size = ctx->det.walk_num * ctx->det.det_num_alpha * sizeof(int64_t);
|
||||
mem_info.size = ctx->det.walk_num * ctx->det.det_num_alpha * ctx->electron.up_num * sizeof(int64_t);
|
||||
int64_t* new_array = (int64_t*) qmckl_malloc(context, mem_info);
|
||||
if (new_array == NULL) {
|
||||
return qmckl_failwith( context,
|
||||
@ -455,7 +455,7 @@ qmckl_exit_code qmckl_set_determinant_mo_index_beta(qmckl_context context, cons
|
||||
}
|
||||
|
||||
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
|
||||
mem_info.size = ctx->det.walk_num * ctx->det.det_num_beta * sizeof(int64_t);
|
||||
mem_info.size = ctx->det.walk_num * ctx->det.det_num_beta * ctx->electron.down_num * sizeof(int64_t);
|
||||
int64_t* new_array = (int64_t*) qmckl_malloc(context, mem_info);
|
||||
if (new_array == NULL) {
|
||||
return qmckl_failwith( context,
|
||||
@ -1175,11 +1175,16 @@ assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
const int64_t det_num_alpha = 1;
|
||||
const int64_t det_num_beta = 1;
|
||||
int64_t mo_index_alpha[1];
|
||||
int64_t mo_index_beta[1];
|
||||
int64_t mo_index_alpha[1][walk_num][elec_up_num];
|
||||
int64_t mo_index_beta[1][walk_num][elec_dn_num];
|
||||
|
||||
mo_index_alpha[0] = 1;
|
||||
mo_index_beta[0] = 2;
|
||||
int i, j;
|
||||
for(i = 0; i < walk_num; ++i)
|
||||
for(j = 0; j < elec_up_num; ++j)
|
||||
mo_index_alpha[0][i][j] = 1;
|
||||
for(i = 0; i < walk_num; ++i)
|
||||
for(j = 0; j < elec_up_num; ++j)
|
||||
mo_index_beta[0][i][j] = 1;
|
||||
|
||||
rc = qmckl_set_determinant_type (context, typ);
|
||||
assert(rc == QMCKL_SUCCESS);
|
||||
@ -1193,12 +1198,18 @@ assert (rc == QMCKL_SUCCESS);
|
||||
rc = qmckl_set_determinant_det_num_beta (context, det_num_beta);
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
rc = qmckl_set_determinant_mo_index_alpha (context, &(mo_index_alpha[0]));
|
||||
rc = qmckl_set_determinant_mo_index_alpha (context, &(mo_index_alpha[0][0][0]));
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
rc = qmckl_set_determinant_mo_index_beta (context, &(mo_index_beta[0]));
|
||||
rc = qmckl_set_determinant_mo_index_beta (context, &(mo_index_beta[0][0][0]));
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
// Get alpha determinant
|
||||
|
||||
double det_vgl_alpha[1][walk_num][5][elec_up_num][elec_up_num];
|
||||
|
||||
rc = qmckl_get_det_vgl_alpha(context, &(det_vgl_alpha[0][0][0][0][0]));
|
||||
assert (rc == QMCKL_SUCCESS);
|
||||
|
||||
}
|
||||
|
||||
@ -1473,7 +1484,7 @@ qmckl_exit_code qmckl_provide_det_inv_matrix_beta(qmckl_context context) {
|
||||
return QMCKL_SUCCESS;
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
||||
*** Compute alpha
|
||||
:PROPERTIES:
|
||||
:Name: qmckl_compute_det_inv_matrix_alpha
|
||||
|
Loading…
Reference in New Issue
Block a user