From e425b24303923ff640e654c059a5c5e24e75bf2d Mon Sep 17 00:00:00 2001 From: v1j4y Date: Mon, 4 Oct 2021 15:42:22 +0200 Subject: [PATCH] Added context. #41 --- org/qmckl_mo.org | 7 +-- org/qmckl_slater_determinant.org | 101 +++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 6 deletions(-) diff --git a/org/qmckl_mo.org b/org/qmckl_mo.org index a884ed6..f521b4d 100644 --- a/org/qmckl_mo.org +++ b/org/qmckl_mo.org @@ -80,12 +80,7 @@ int main() { |---------------------+--------------------+--------------------------------------------------------------| | ~type~ | | Gaussian (~'G'~) or Slater (~'S'~) | - | ~nucleus_index~ | ~[nucl_num]~ | Index of the first shell of each nucleus | - | ~nucleus_shell_num~ | ~[nucl_num]~ | Number of shells per nucleus | - | ~ao_num~ | | Number of AOs | - | ~ao_cartesian~ | | If true, use polynomials. Otherwise, use spherical harmonics | - | ~ao_factor~ | ~[ao_num]~ | Normalization factor of the AO | - | ~ao_shell~ | ~[ao_num]~ | For each AO, specify to which shell it belongs | + | ~mo_num~ | | Number of MOs | | ~coefficient~ | ~[mo_num, ao_num]~ | Orbital coefficients | Computed data: diff --git a/org/qmckl_slater_determinant.org b/org/qmckl_slater_determinant.org index 293f088..30aa7d7 100644 --- a/org/qmckl_slater_determinant.org +++ b/org/qmckl_slater_determinant.org @@ -2,5 +2,106 @@ #+SETUPFILE: ../tools/theme.setup #+INCLUDE: ../tools/lib.org +The slater deteminant is required for the calculation of the +wavefunction, gradient, and derivatives. These quantities will be used +to calculate the local Energy (\[E_L\]). + +ψ(x) = det|ϕ₁(x₁)...ϕᵢ(yᵢ)...ϕₙ(xₙ)| + +Concerning the gradient and laplacian, in fact what is actually +calculated is the ratio of the gradient/laplacian and the determinant +of the slater matrix: + +∇ψ(x)/ψ(x) + +and + +∇²ψ(x)/ψ(x) + +This avoids the unnecessary multiplication and division of by the +determinant ψ(x). +* Headers :noexport: + #+begin_src elisp :noexport :results none +(org-babel-lob-ingest "../tools/lib.org") + #+end_src + + + #+begin_src c :tangle (eval h_private_type) +#ifndef QMCKL_MO_HPT +#define QMCKL_MO_HPT + +#include + #+end_src + + #+begin_src c :tangle (eval c_test) :noweb yes +#include "qmckl.h" +#include "assert.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include "chbrclf.h" +#include "qmckl_ao_private_func.h" +#include "qmckl_mo_private_func.h" +#include "qmckl_slater_determinant_private_func.h" + +int main() { + qmckl_context context; + context = qmckl_context_create(); + + qmckl_exit_code rc; + #+end_src + + #+begin_src c :tangle (eval c) +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef HAVE_STDINT_H +#include +#elif HAVE_INTTYPES_H +#include +#endif + +#include +#include +#include +#include + +#include "qmckl.h" +#include "qmckl_context_private_type.h" +#include "qmckl_memory_private_type.h" +#include "qmckl_memory_private_func.h" +#include "qmckl_ao_private_type.h" +#include "qmckl_ao_private_func.h" +#include "qmckl_mo_private_type.h" +#include "qmckl_mo_private_func.h" +#include "qmckl_slater_determinant_private_type.h" +#include "qmckl_slater_determinant_private_func.h" + #+end_src + +* Context + + The following arrays are stored in the context: + + |-----------------+-------------------------------+------------------------------------| + | ~type~ | ~char~ | α (~'A'~) or β (~'B'~) determinant | + | ~walk_num~ | ~uint64_t~ | Number of walkers | + | ~det_num~ | ~uint64_t~ | Number of determinants per walker | + | ~fermi_num~ | ~uint64_t~ | Number of number of fermions | + | ~mo_index_list~ | ~mo_index[walk_num][det_num]~ | Index of MOs for each walker | + + Computed data: + + |-------------------+------------------------------------------+----------------------------------------------------------------------------------------| + | ~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_date~ | ~uint64_t~ | Late modification date of Value, gradients, Laplacian of the MOs at electron positions | + |-------------------+------------------------------------------+----------------------------------------------------------------------------------------| + +