mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2024-08-18 03:11:44 +02:00
Updated name change to header files. #41
This commit is contained in:
parent
77a6155bb0
commit
59d4c91edf
@ -33,6 +33,7 @@ int main() {
|
|||||||
#include "qmckl_ao_private_type.h"
|
#include "qmckl_ao_private_type.h"
|
||||||
#include "qmckl_mo_private_type.h"
|
#include "qmckl_mo_private_type.h"
|
||||||
#include "qmckl_jastrow_private_type.h"
|
#include "qmckl_jastrow_private_type.h"
|
||||||
|
#include "qmckl_determinant_private_type.h"
|
||||||
#include "qmckl_nucleus_private_func.h"
|
#include "qmckl_nucleus_private_func.h"
|
||||||
#include "qmckl_electron_private_func.h"
|
#include "qmckl_electron_private_func.h"
|
||||||
#include "qmckl_ao_private_func.h"
|
#include "qmckl_ao_private_func.h"
|
||||||
|
@ -29,8 +29,8 @@ determinant ψ(x).
|
|||||||
|
|
||||||
|
|
||||||
#+begin_src c :tangle (eval h_private_type)
|
#+begin_src c :tangle (eval h_private_type)
|
||||||
#ifndef QMCKL_MO_HPT
|
#ifndef QMCKL_DETERMINANT_HPT
|
||||||
#define QMCKL_MO_HPT
|
#define QMCKL_DETERMINANT_HPT
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#+end_src
|
#+end_src
|
||||||
@ -90,9 +90,9 @@ int main() {
|
|||||||
|
|
||||||
|-----------------+-------------------------------+------------------------------------|
|
|-----------------+-------------------------------+------------------------------------|
|
||||||
| ~type~ | ~char~ | α (~'A'~) or β (~'B'~) determinant |
|
| ~type~ | ~char~ | α (~'A'~) or β (~'B'~) determinant |
|
||||||
| ~walk_num~ | ~int64_t~ | Number of walkers |
|
| ~walk_num~ | ~int64_t~ | Number of walkers |
|
||||||
| ~det_num~ | ~int64_t~ | Number of determinants per walker |
|
| ~det_num~ | ~int64_t~ | Number of determinants per walker |
|
||||||
| ~fermi_num~ | ~int64_t~ | Number of number of fermions |
|
| ~fermi_num~ | ~int64_t~ | Number of number of fermions |
|
||||||
| ~mo_index_list~ | ~mo_index[walk_num][det_num]~ | Index of MOs for each walker |
|
| ~mo_index_list~ | ~mo_index[walk_num][det_num]~ | Index of MOs for each walker |
|
||||||
|
|
||||||
Computed data:
|
Computed data:
|
||||||
@ -101,7 +101,7 @@ int main() {
|
|||||||
| ~det_matrix_list~ | ~[walk_num][det_num][mo_num][fermi_num]~ | The slater matrix for each determinant of each walker. |
|
| ~det_matrix_list~ | ~[walk_num][det_num][mo_num][fermi_num]~ | The slater matrix for each determinant of each walker. |
|
||||||
|-------------------+------------------------------------------+----------------------------------------------------------------------------------------|
|
|-------------------+------------------------------------------+----------------------------------------------------------------------------------------|
|
||||||
| ~det_vgl~ | ~[5][walk_num][det_num]~ | Value, gradients, Laplacian of the MOs at electron positions |
|
| ~det_vgl~ | ~[5][walk_num][det_num]~ | Value, gradients, Laplacian of the MOs at electron positions |
|
||||||
| ~det_vgl_date~ | ~int64_t~ | Late modification date of Value, gradients, Laplacian of the MOs at electron positions |
|
| ~det_vgl_date~ | ~int64_t~ | Late modification date of Value, gradients, Laplacian of the MOs at electron positions |
|
||||||
|-------------------+------------------------------------------+----------------------------------------------------------------------------------------|
|
|-------------------+------------------------------------------+----------------------------------------------------------------------------------------|
|
||||||
|
|
||||||
** Data structure
|
** Data structure
|
||||||
@ -144,12 +144,12 @@ int64_t* qmckl_get_determinant_mo_index_list (const qmckl_context context
|
|||||||
function returns ~true~.
|
function returns ~true~.
|
||||||
|
|
||||||
#+begin_src c :comments org :tangle (eval h_func)
|
#+begin_src c :comments org :tangle (eval h_func)
|
||||||
bool qmckl_mo_basis_provided (const qmckl_context context);
|
bool qmckl_determinant_provided (const qmckl_context context);
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+NAME:post
|
#+NAME:post
|
||||||
#+begin_src c :exports none
|
#+begin_src c :exports none
|
||||||
if ( (ctx->mo_basis.uninitialized & mask) != 0) {
|
if ( (ctx->det.uninitialized & mask) != 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#+end_src
|
#+end_src
|
||||||
@ -167,12 +167,12 @@ char qmckl_get_determinant_type (const qmckl_context context) {
|
|||||||
|
|
||||||
int32_t mask = 1;
|
int32_t mask = 1;
|
||||||
|
|
||||||
if ( (ctx->determinant.uninitialized & mask) != 0) {
|
if ( (ctx->det.uninitialized & mask) != 0) {
|
||||||
return (char) 0;
|
return (char) 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert (ctx->determinant.type != (char) 0);
|
assert (ctx->det.type != (char) 0);
|
||||||
return ctx->determinant.type;
|
return ctx->det.type;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t qmckl_get_determinant_walk_num (const qmckl_context context) {
|
int64_t qmckl_get_determinant_walk_num (const qmckl_context context) {
|
||||||
@ -185,12 +185,12 @@ int64_t qmckl_get_determinant_walk_num (const qmckl_context context) {
|
|||||||
|
|
||||||
int32_t mask = 1 << 1;
|
int32_t mask = 1 << 1;
|
||||||
|
|
||||||
if ( (ctx->determinant.uninitialized & mask) != 0) {
|
if ( (ctx->det.uninitialized & mask) != 0) {
|
||||||
return (int64_t) 0;
|
return (int64_t) 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert (ctx->determinant.walk_num > (int64_t) 0);
|
assert (ctx->det.walk_num > (int64_t) 0);
|
||||||
return ctx->determinant.walk_num;
|
return ctx->det.walk_num;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t qmckl_get_determinant_det_num (const qmckl_context context) {
|
int64_t qmckl_get_determinant_det_num (const qmckl_context context) {
|
||||||
@ -203,12 +203,12 @@ int64_t qmckl_get_determinant_det_num (const qmckl_context context) {
|
|||||||
|
|
||||||
int32_t mask = 1 << 2;
|
int32_t mask = 1 << 2;
|
||||||
|
|
||||||
if ( (ctx->determinant.uninitialized & mask) != 0) {
|
if ( (ctx->det.uninitialized & mask) != 0) {
|
||||||
return (int64_t) 0;
|
return (int64_t) 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert (ctx->determinant.det_num > (int64_t) 0);
|
assert (ctx->det.det_num > (int64_t) 0);
|
||||||
return ctx->determinant.det_num;
|
return ctx->det.det_num;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t qmckl_get_determinant_fermi_num (const qmckl_context context) {
|
int64_t qmckl_get_determinant_fermi_num (const qmckl_context context) {
|
||||||
@ -221,12 +221,12 @@ int64_t qmckl_get_determinant_fermi_num (const qmckl_context context) {
|
|||||||
|
|
||||||
int32_t mask = 1 << 3;
|
int32_t mask = 1 << 3;
|
||||||
|
|
||||||
if ( (ctx->determinant.uninitialized & mask) != 0) {
|
if ( (ctx->det.uninitialized & mask) != 0) {
|
||||||
return (int64_t) 0;
|
return (int64_t) 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert (ctx->determinant.fermi_num > (int64_t) 0);
|
assert (ctx->det.fermi_num > (int64_t) 0);
|
||||||
return ctx->determinant.fermi_num;
|
return ctx->det.fermi_num;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t* qmckl_get_determinant_mo_index_list (const qmckl_context context) {
|
int64_t* qmckl_get_determinant_mo_index_list (const qmckl_context context) {
|
||||||
@ -239,12 +239,12 @@ int64_t* qmckl_get_determinant_mo_index_list (const qmckl_context context) {
|
|||||||
|
|
||||||
int32_t mask = 1 << 4;
|
int32_t mask = 1 << 4;
|
||||||
|
|
||||||
if ( (ctx->determinant.uninitialized & mask) != 0) {
|
if ( (ctx->det.uninitialized & mask) != 0) {
|
||||||
return (int64_t) 0;
|
return (int64_t) 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert (ctx->determinant.mo_index_list != NULL);
|
assert (ctx->det.mo_index_list != NULL);
|
||||||
return ctx->determinant.mo_index_list;
|
return ctx->det.mo_index_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
@ -295,7 +295,7 @@ qmckl_exit_code qmckl_set_determinant_type(qmckl_context context, const char t)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t mask = 1;
|
int32_t mask = 1;
|
||||||
ctx->determinant.type = t;
|
ctx->det.type = t;
|
||||||
|
|
||||||
<<post2>>
|
<<post2>>
|
||||||
}
|
}
|
||||||
@ -311,7 +311,7 @@ qmckl_exit_code qmckl_set_determinant_walk_num(qmckl_context context, const int6
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t mask = 1 << 1;
|
int32_t mask = 1 << 1;
|
||||||
ctx->determinant.walk_num = walk_num;
|
ctx->det.walk_num = walk_num;
|
||||||
|
|
||||||
<<post2>>
|
<<post2>>
|
||||||
}
|
}
|
||||||
@ -327,7 +327,7 @@ qmckl_exit_code qmckl_set_determinant_det_num(qmckl_context context, const int64
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t mask = 1 << 2;
|
int32_t mask = 1 << 2;
|
||||||
ctx->determinant.det_num = det_num;
|
ctx->det.det_num = det_num;
|
||||||
|
|
||||||
<<post2>>
|
<<post2>>
|
||||||
}
|
}
|
||||||
@ -343,7 +343,7 @@ qmckl_exit_code qmckl_set_determinant_fermi_num(qmckl_context context, const int
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t mask = 1 << 3;
|
int32_t mask = 1 << 3;
|
||||||
ctx->determinant.fermi_num = fermi_num;
|
ctx->det.fermi_num = fermi_num;
|
||||||
|
|
||||||
<<post2>>
|
<<post2>>
|
||||||
}
|
}
|
||||||
@ -353,8 +353,8 @@ qmckl_exit_code qmckl_set_determinant_mo_index_list(qmckl_context context, cons
|
|||||||
|
|
||||||
int32_t mask = 1 << 4;
|
int32_t mask = 1 << 4;
|
||||||
|
|
||||||
if (ctx->determinant.mo_index_list != NULL) {
|
if (ctx->det.mo_index_list != NULL) {
|
||||||
qmckl_exit_code rc = qmckl_free(context, ctx->determinant.mo_index_list);
|
qmckl_exit_code rc = qmckl_free(context, ctx->det.mo_index_list);
|
||||||
if (rc != QMCKL_SUCCESS) {
|
if (rc != QMCKL_SUCCESS) {
|
||||||
return qmckl_failwith( context, rc,
|
return qmckl_failwith( context, rc,
|
||||||
"qmckl_set_determinant_mo_index_list",
|
"qmckl_set_determinant_mo_index_list",
|
||||||
@ -363,7 +363,7 @@ qmckl_exit_code qmckl_set_determinant_mo_index_list(qmckl_context context, cons
|
|||||||
}
|
}
|
||||||
|
|
||||||
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->determinant.walk_num * ctx->determinant.det_num * sizeof(int64_t);
|
mem_info.size = ctx->det.walk_num * ctx->det.det_num * sizeof(int64_t);
|
||||||
int64_t* new_array = (int64_t*) qmckl_malloc(context, mem_info);
|
int64_t* new_array = (int64_t*) qmckl_malloc(context, mem_info);
|
||||||
if (new_array == NULL) {
|
if (new_array == NULL) {
|
||||||
return qmckl_failwith( context,
|
return qmckl_failwith( context,
|
||||||
@ -374,7 +374,7 @@ qmckl_exit_code qmckl_set_determinant_mo_index_list(qmckl_context context, cons
|
|||||||
|
|
||||||
memcpy(new_array, mo_index_list, mem_info.size);
|
memcpy(new_array, mo_index_list, mem_info.size);
|
||||||
|
|
||||||
ctx->determinant.mo_index_list = new_array;
|
ctx->det.mo_index_list = new_array;
|
||||||
|
|
||||||
<<post2>>
|
<<post2>>
|
||||||
}
|
}
|
||||||
@ -405,7 +405,7 @@ qmckl_exit_code qmckl_finalize_determinant(qmckl_context context) {
|
|||||||
|
|
||||||
*** Get
|
*** Get
|
||||||
#+NAME: qmckl_get_determinant_det_vgl_args
|
#+NAME: qmckl_get_determinant_det_vgl_args
|
||||||
| ~qmckl_context~ | ~context~ | in | Global state |
|
| ~qmckl_context~ | ~context~ | in | Global state |
|
||||||
| ~double~ | ~det_vgl[5][walk_num][det_num]~ | out | Value, gradients and Laplacian of the MOs |
|
| ~double~ | ~det_vgl[5][walk_num][det_num]~ | out | Value, gradients and Laplacian of the MOs |
|
||||||
|
|
||||||
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
#+begin_src c :comments org :tangle (eval h_func) :noweb yes
|
||||||
@ -413,7 +413,7 @@ qmckl_exit_code qmckl_get_determinant_det_vgl(qmckl_context context, double* con
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src c :comments org :tangle (eval c) :noweb yes :exports none
|
#+begin_src c :comments org :tangle (eval c) :noweb yes :exports none
|
||||||
qmckl_exit_code qmckl_get_determinant_det_vgl(qmckl_context context, double * const det_vgl)
|
qmckl_exit_code qmckl_get_determinant_det_vgl(qmckl_context context, double * const det_vgl) {
|
||||||
|
|
||||||
if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
|
if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
|
||||||
return QMCKL_NULL_CONTEXT;
|
return QMCKL_NULL_CONTEXT;
|
||||||
@ -449,26 +449,6 @@ qmckl_exit_code qmckl_get_determinant_det_vgl(qmckl_context context, double * co
|
|||||||
double* const det_vgl );
|
double* const det_vgl );
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+CALL: generate_c_interface(table=qmckl_get_determinant_det_vgl_args,rettyp=get_value("CRetType"),fname="qmckl_compute_get_determinant_det_vgl"))
|
|
||||||
|
|
||||||
#+RESULTS:
|
|
||||||
#+begin_src f90 :tangle (eval f) :comments org :exports none
|
|
||||||
integer(c_int32_t) function qmckl_compute_get_determinant_det_vgl &
|
|
||||||
(context, det_vgl) &
|
|
||||||
bind(C) result(info)
|
|
||||||
|
|
||||||
use, intrinsic :: iso_c_binding
|
|
||||||
implicit none
|
|
||||||
|
|
||||||
integer (c_int64_t) , intent(in) , value :: context
|
|
||||||
real (c_double ) , intent(out) :: det_vgl(det_num,walk_num,5)
|
|
||||||
|
|
||||||
integer(c_int32_t), external :: qmckl_compute_get_determinant_det_vgl_f
|
|
||||||
info = qmckl_compute_get_determinant_det_vgl_f &
|
|
||||||
(context, det_vgl)
|
|
||||||
|
|
||||||
end function qmckl_compute_get_determinant_det_vgl
|
|
||||||
#+end_src
|
|
||||||
*** Provide
|
*** Provide
|
||||||
*** Compute
|
*** Compute
|
||||||
*** Test
|
*** Test
|
||||||
|
Loading…
Reference in New Issue
Block a user