mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-03 18:16:28 +01:00
Working on calculation of inverse. #41
This commit is contained in:
parent
bb21cbed69
commit
d416c5dd77
@ -287,7 +287,7 @@ ctx->det.uninitialized &= ~mask;
|
||||
ctx->det.provided = (ctx->det.uninitialized == 0);
|
||||
if (ctx->det.provided) {
|
||||
//qmckl_exit_code rc_ = qmckl_finalize_determinant(context);
|
||||
if (rc_ != QMCKL_SUCCESS) return rc_;
|
||||
//if (rc_ != QMCKL_SUCCESS) return rc_;
|
||||
}
|
||||
|
||||
return QMCKL_SUCCESS;
|
||||
@ -441,13 +441,13 @@ qmckl_exit_code qmckl_get_determinant_det_inv_list(qmckl_context context, double
|
||||
rc = qmckl_provide_det_vgl(context);
|
||||
if (rc != QMCKL_SUCCESS) return rc;
|
||||
|
||||
rc = qmckl_provide_det_inv_list(context);
|
||||
rc = qmckl_provide_det_inv_matrix(context);
|
||||
if (rc != QMCKL_SUCCESS) return rc;
|
||||
|
||||
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
|
||||
assert (ctx != NULL);
|
||||
|
||||
size_t sze = ctx->det.det_num * ctx->det.walk_num * ctx->det.fermi_num * ctx->fermi_num;
|
||||
size_t sze = ctx->det.det_num * ctx->det.walk_num * ctx->det.fermi_num * ctx->det.fermi_num;
|
||||
memcpy(det_inv_list, ctx->det.det_vgl, sze * sizeof(double));
|
||||
|
||||
return QMCKL_SUCCESS;
|
||||
@ -466,11 +466,11 @@ qmckl_exit_code qmckl_get_determinant_det_inv_list(qmckl_context context, double
|
||||
*** Provide
|
||||
|
||||
#+begin_src c :comments org :tangle (eval h_private_func) :noweb yes :exports none
|
||||
qmckl_exit_code qmckl_provide_det(qmckl_context context);
|
||||
qmckl_exit_code qmckl_provide_det_vgl(qmckl_context context);
|
||||
#+end_src
|
||||
|
||||
#+begin_src c :comments org :tangle (eval c) :noweb yes :exports none
|
||||
qmckl_exit_code qmckl_provide_det(qmckl_context context) {
|
||||
qmckl_exit_code qmckl_provide_det_vgl(qmckl_context context) {
|
||||
|
||||
if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
|
||||
return QMCKL_NULL_CONTEXT;
|
||||
@ -515,7 +515,7 @@ qmckl_exit_code qmckl_provide_det(qmckl_context context) {
|
||||
}
|
||||
|
||||
/* Compute if necessary */
|
||||
if (ctx->electron.coord_new_date > ctx->det.det_date) {
|
||||
if (ctx->electron.coord_new_date > ctx->det.det_vgl_date) {
|
||||
|
||||
/* Allocate array */
|
||||
if (ctx->det.det_vgl == NULL) {
|
||||
@ -714,7 +714,7 @@ qmckl_exit_code qmckl_get_det_inv_matrix(qmckl_context context, double * const d
|
||||
assert (ctx != NULL);
|
||||
|
||||
size_t sze = ctx->det.det_num * ctx->det.walk_num * ctx->det.fermi_num * ctx->det.fermi_num;
|
||||
memcpy(det_inv_matrix, ctx->det.det_inv_matrix, sze * sizeof(double));
|
||||
memcpy(det_inv_matrix, ctx->det.det_inv_matrix_list, sze * sizeof(double));
|
||||
|
||||
return QMCKL_SUCCESS;
|
||||
}
|
||||
@ -726,7 +726,7 @@ qmckl_exit_code qmckl_get_det_inv_matrix(qmckl_context context, double * const d
|
||||
#+begin_src c :tangle (eval h_func) :comments org
|
||||
qmckl_exit_code qmckl_compute_get_det_inv_matrix (
|
||||
const qmckl_context context,
|
||||
double* const det_vgl );
|
||||
double* const det_inv_matrix_list );
|
||||
#+end_src
|
||||
|
||||
*** Provide
|
||||
@ -789,12 +789,12 @@ qmckl_exit_code qmckl_provide_det_inv_matrix(qmckl_context context) {
|
||||
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
|
||||
mem_info.size = ctx->det.walk_num * ctx->det.det_num *
|
||||
ctx->det.fermi_num * ctx->det.fermi_num * sizeof(double);
|
||||
double* det_vgl = (double*) qmckl_malloc(context, mem_info);
|
||||
double* det_inv_matrix_list = (double*) qmckl_malloc(context, mem_info);
|
||||
|
||||
if (det_vgl == NULL) {
|
||||
if (det_inv_matrix_list == NULL) {
|
||||
return qmckl_failwith( context,
|
||||
QMCKL_ALLOCATION_FAILED,
|
||||
"qmckl_det_vgl",
|
||||
"qmckl_det_inv_matrix_list",
|
||||
NULL);
|
||||
}
|
||||
ctx->det.det_inv_matrix_list = det_inv_matrix_list;
|
||||
@ -812,7 +812,7 @@ qmckl_exit_code qmckl_provide_det_inv_matrix(qmckl_context context) {
|
||||
} else {
|
||||
return qmckl_failwith( context,
|
||||
QMCKL_FAILURE,
|
||||
"compute_det_vgl",
|
||||
"compute_det_inv_matrix_list",
|
||||
"Not yet implemented");
|
||||
}
|
||||
if (rc != QMCKL_SUCCESS) {
|
||||
@ -878,7 +878,7 @@ integer function qmckl_compute_det_inv_matrix_f(context, &
|
||||
do imo = 1, fermi_num
|
||||
mo_id = mo_index_list(imo)
|
||||
! Value
|
||||
det_vgl(imo, ielec, iwalk, 1) = mo_vgl(mo_id, ielec, iwalk, 1)
|
||||
det_inv_matrix_list(imo, ielec, iwalk, 1) = mo_vgl(mo_id, ielec, iwalk, 1)
|
||||
end do
|
||||
end do
|
||||
end do
|
||||
|
Loading…
Reference in New Issue
Block a user