mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-03 18:16:28 +01:00
Fixed bug in get_det_vgl, now compiles. #41
This commit is contained in:
parent
5a280e877f
commit
cf394ce171
@ -113,7 +113,7 @@ int main() {
|
||||
| ~det_adj_matrix_list~ | ~[walk_num][det_num][fermi_num][fermi_num]~ | Adjoint of the slater matrix for each determinant of each walker. |
|
||||
| ~det_adj_matrix_list_date~ | ~int64_t~ | Adjoint of the slater matrix for each determinant of each walker. |
|
||||
|----------------------------+------------------------------------------------+----------------------------------------------------------------------------------------|
|
||||
| ~det_vgl~ | ~[5][walk_num][det_num][fermi_num][fermi_num]~ | Value, gradients, Laplacian of Dᵢⱼ(x) at electron positions |
|
||||
| ~det_vgl~ | ~[5][walk_num][det_num][fermi_num][fermi_num]~ | Value, gradients, Laplacian of Dᵢⱼ(x) at electron positions |
|
||||
| ~det_vgl_date~ | ~int64_t~ | Late modification date of Value, gradients, Laplacian of the MOs at electron positions |
|
||||
| ~det_inv_matrix_list~ | ~[walk_num][det_num][fermi_num][fermi_num]~ | Inverse of the slater matrix for each determinant of each walker. |
|
||||
| ~det_inv_matrix_list_date~ | ~int64_t~ | Inverse of the slater matrix for each determinant of each walker. |
|
||||
@ -418,22 +418,22 @@ qmckl_exit_code qmckl_finalize_determinant(qmckl_context context) {
|
||||
* Computation
|
||||
** Determinant matrix
|
||||
:PROPERTIES:
|
||||
:Name: qmckl_compute_determinant_det_inv_list
|
||||
:Name: qmckl_compute_det_vgl
|
||||
:CRetType: qmckl_exit_code
|
||||
:FRetType: qmckl_exit_code
|
||||
:END:
|
||||
|
||||
*** Get
|
||||
#+NAME: qmckl_get_determinant_det_inv_list
|
||||
| ~qmckl_context~ | ~context~ | in | Global state |
|
||||
| ~double~ | ~det_inv_list[5][walk_num][det_num]~ | out | Value, gradients and Laplacian of the MOs |
|
||||
#+NAME: qmckl_get_det_vgl_args
|
||||
| ~qmckl_context~ | ~context~ | in | Global state |
|
||||
| ~double~ | ~det_vgl[5][walk_num][det_num][fermi_num][fermi_num]~ | out | Value, gradients and Laplacian of the MOs |
|
||||
|
||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||
qmckl_exit_code qmckl_get_determinant_det_inv_list(qmckl_context context, double* const det_inv_list);
|
||||
qmckl_exit_code qmckl_get_det_vgl(qmckl_context context, double* const det_vgl);
|
||||
#+end_src
|
||||
|
||||
#+begin_src c :comments org :tangle (eval c) :noweb yes :exports none
|
||||
qmckl_exit_code qmckl_get_determinant_det_inv_list(qmckl_context context, double * const det_inv_list) {
|
||||
qmckl_exit_code qmckl_get_det_vgl(qmckl_context context, double * const det_vgl) {
|
||||
|
||||
if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
|
||||
return QMCKL_NULL_CONTEXT;
|
||||
@ -450,27 +450,16 @@ 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_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->det.fermi_num;
|
||||
memcpy(det_inv_list, ctx->det.det_vgl, sze * sizeof(double));
|
||||
memcpy(det_vgl, ctx->det.det_vgl, sze * sizeof(double));
|
||||
|
||||
return QMCKL_SUCCESS;
|
||||
}
|
||||
#+end_src
|
||||
|
||||
#+CALL: generate_c_header(table=qmckl_get_determinant_det_vgl_args,rettyp=get_value("CRetType"),fname="qmckl_compute_get_determinant_det_vgl"))
|
||||
|
||||
#+RESULTS:
|
||||
#+begin_src c :tangle (eval h_func) :comments org
|
||||
qmckl_exit_code qmckl_compute_get_determinant_vgl (
|
||||
const qmckl_context context,
|
||||
double* const det_vgl );
|
||||
#+end_src
|
||||
|
||||
*** Provide
|
||||
|
||||
@ -574,7 +563,7 @@ qmckl_exit_code qmckl_provide_det_vgl(qmckl_context context) {
|
||||
:FRetType: qmckl_exit_code
|
||||
:END:
|
||||
|
||||
#+NAME: qmckl_det_vgl_args
|
||||
#+NAME: qmckl_compute_det_vgl_args
|
||||
| ~qmckl_context~ | ~context~ | in | Global state |
|
||||
| ~int64_t~ | ~walk_num~ | in | Number of walkers |
|
||||
| ~int64_t~ | ~fermi_num~ | in | Number of electrons |
|
||||
@ -640,7 +629,7 @@ integer function qmckl_compute_det_vgl_f(context, &
|
||||
end function qmckl_compute_det_vgl_f
|
||||
#+end_src
|
||||
|
||||
#+CALL: generate_c_header(table=qmckl_det_vgl_args,rettyp=get_value("CRetType"),fname="qmckl_compute_det_vgl"))
|
||||
#+CALL: generate_c_header(table=qmckl_compute_det_vgl_args,rettyp=get_value("CRetType"),fname="qmckl_compute_det_vgl"))
|
||||
|
||||
#+RESULTS:
|
||||
#+begin_src c :tangle (eval h_func) :comments org
|
||||
@ -654,7 +643,7 @@ end function qmckl_compute_det_vgl_f
|
||||
double* const det_vgl );
|
||||
#+end_src
|
||||
|
||||
#+CALL: generate_c_interface(table=qmckl_det_vgl_args,rettyp=get_value("CRetType"),fname="qmckl_compute_det_vgl"))
|
||||
#+CALL: generate_c_interface(table=qmckl_compute_det_vgl_args,rettyp=get_value("CRetType"),fname="qmckl_compute_det_vgl"))
|
||||
|
||||
#+RESULTS:
|
||||
#+begin_src f90 :tangle (eval f) :comments org :exports none
|
||||
@ -680,6 +669,7 @@ end function qmckl_compute_det_vgl_f
|
||||
end function qmckl_compute_det_vgl
|
||||
#+end_src
|
||||
|
||||
|
||||
*** Test
|
||||
|
||||
** Inverse of Determinant matrix
|
||||
|
Loading…
Reference in New Issue
Block a user