1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-06-30 00:44:52 +02:00

Added context. #41

This commit is contained in:
v1j4y 2021-10-04 15:42:22 +02:00
parent 90a560138d
commit e425b24303
2 changed files with 102 additions and 6 deletions

View File

@ -80,12 +80,7 @@ int main() {
|---------------------+--------------------+--------------------------------------------------------------| |---------------------+--------------------+--------------------------------------------------------------|
| ~type~ | | Gaussian (~'G'~) or Slater (~'S'~) | | ~type~ | | Gaussian (~'G'~) or Slater (~'S'~) |
| ~nucleus_index~ | ~[nucl_num]~ | Index of the first shell of each nucleus | | ~mo_num~ | | Number of MOs |
| ~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 |
| ~coefficient~ | ~[mo_num, ao_num]~ | Orbital coefficients | | ~coefficient~ | ~[mo_num, ao_num]~ | Orbital coefficients |
Computed data: Computed data:

View File

@ -2,5 +2,106 @@
#+SETUPFILE: ../tools/theme.setup #+SETUPFILE: ../tools/theme.setup
#+INCLUDE: ../tools/lib.org #+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 <stdbool.h>
#+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 <stdio.h>
#include <math.h>
#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 <stdint.h>
#elif HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <assert.h>
#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 |
|-------------------+------------------------------------------+----------------------------------------------------------------------------------------|