1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-07-18 17:03:43 +02:00

Merge pull request #23 from v1j4y/jastrow_vj

Jastrow Factor
This commit is contained in:
Anthony Scemama 2021-07-08 08:57:48 +02:00 committed by GitHub
commit e39a27db08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 5725 additions and 52 deletions

View File

@ -52,7 +52,7 @@ test_qmckl_f = tests/qmckl_f.f90
test_qmckl_fo = tests/qmckl_f.o
src_qmckl_f = src/qmckl_f.f90
src_qmckl_fo = src/qmckl_f.o
header_tests = tests/chbrclf.h
header_tests = tests/chbrclf.h tests/n2.h
fortrandir = $(datadir)/$(PACKAGE_NAME)/fortran/
dist_fortran_DATA = $(qmckl_f)
@ -157,6 +157,7 @@ $(htmlize_el):
tests/chbrclf.h: $(qmckl_h)
tests/n2.h: $(qmckl_h)
generated.mk: $(ORG_FILES)
$(PYTHON) $(srcdir)/tools/build_makefile.py

View File

@ -98,7 +98,6 @@ AC_CHECK_LIB([pthread], [pthread_create])
# CFLAGS="${CFLAGS} ${OPENMP_CFLAGS}"
#fi
## BLAS
#AX_BLAS([], [AC_MSG_ERROR([BLAS was not found.])])
@ -221,13 +220,13 @@ ${PACKAGE_NAME} Version ${PACKAGE_VERSION} ${QMCKL_DEVEL}
Prefix: '${prefix}'.
CC..........: ${CC}
CPPFLAGS....: ${CPPFLAGS}
CFLAGS......: ${CFLAGS}
FC..........: ${FC}
FCLAGS......: ${FCFLAGS}
LDFLAGS:....: ${LDFLAGS}
LIBS........: ${LIBS}
CC..............: ${CC}
CPPFLAGS........: ${CPPFLAGS}
CFLAGS..........: ${CFLAGS}
FC..............: ${FC}
FCLAGS..........: ${FCFLAGS}
LDFLAGS:........: ${LDFLAGS}
LIBS............: ${LIBS}
Package features:
${ARGS}

View File

@ -1922,6 +1922,13 @@ qmckl_exit_code qmckl_provide_ao_basis_shell_vgl(qmckl_context context)
NULL);
}
if(!(ctx->electron.provided)) {
return qmckl_failwith( context,
QMCKL_NOT_PROVIDED,
"qmckl_electron",
NULL);
}
/* Compute if necessary */
if (ctx->electron.coord_new_date > ctx->ao_basis.shell_vgl_date) {

View File

@ -31,6 +31,7 @@ int main() {
#include "qmckl_nucleus_private_type.h"
#include "qmckl_electron_private_type.h"
#include "qmckl_ao_private_type.h"
#include "qmckl_jastrow_private_type.h"
#include "qmckl_nucleus_private_func.h"
#include "qmckl_electron_private_func.h"
#include "qmckl_ao_private_func.h"
@ -118,6 +119,7 @@ typedef struct qmckl_context_struct {
qmckl_nucleus_struct nucleus;
qmckl_electron_struct electron;
qmckl_ao_basis_struct ao_basis;
qmckl_jastrow_struct jastrow;
/* To be implemented:
qmckl_mo_struct mo;

View File

@ -923,7 +923,7 @@ integer function qmckl_distance_rescaled_f(context, transa, transb, m, n, &
if (transb == 'N' .or. transb == 'n') then
continue
else if (transa == 'T' .or. transa == 't') then
else if (transb == 'T' .or. transb == 't') then
transab = transab + 2
else
transab = -100

View File

@ -84,10 +84,9 @@ int main() {
| ~ee_distance_rescaled_deriv_e_date~ | ~uint64_t~ | Last modification date of the electron-electron distance derivatives |
| ~en_distance_rescaled~ | ~double[walk_num][nucl_num][num]~ | Electron-nucleus distances |
| ~en_distance_rescaled_date~ | ~uint64_t~ | Last modification date of the electron-electron distances |
| ~en_distance_rescaled_deriv_e~ | ~double[walk_num][4][num][num]~ | Electron-electron rescaled distances derivatives |
| ~en_distance_rescaled_deriv_e~ | ~double[walk_num][4][nucl_num][num]~ | Electron-electron rescaled distances derivatives |
| ~en_distance_rescaled_deriv_e_date~ | ~uint64_t~ | Last modification date of the electron-electron distance derivatives |
** Data structure
#+begin_src c :comments org :tangle (eval h_private_type)
@ -1566,7 +1565,6 @@ rc = qmckl_get_electron_ee_distance_rescaled_deriv_e(context, ee_distance_rescal
#+end_src
** Electron-nucleus distances
*** Get
@ -2140,7 +2138,7 @@ assert(fabs(en_distance_rescaled[1][0][1] - 0.9584331688679852) < 1.e-12);
The rescaled distances which is given as $R = (1 - \exp{-\kappa r})/\kappa$
needs to be perturbed with respect to the nuclear coordinates.
This data is stored in the ~en_distance_rescaled_deriv_e~ tensor. The
The first three elements of this three index tensor ~[4][num][num]~ gives the
The first three elements of this three index tensor ~[4][nucl_num][elec_num]~ gives the
derivatives in the x, y, and z directions $dx, dy, dz$ and the last index
gives the Laplacian $\partial x^2 + \partial y^2 + \partial z^2$.

5509
org/qmckl_jastrow.org Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1013,3 +1013,159 @@ double chbrclf_elec_coord[chbrclf_walk_num][chbrclf_elec_num][3] = { {
#+END_src
* N2
This test is mainly for the Jastrow factor and was supplied by
Ramon Panades Baruetta. The coordinates and Jastrow coefficients
have been taken from his fork of IRPJast. The core electrons are
treated by pseudopotentials thus excluded from the actual calculation.
| Number of atoms | 2 |
| Number of alpha electrons | 5 |
| Number of beta electrons | 5 |
| Number of core electrons | 4 |
** XYZ coordinates
#+BEGIN_example
2
N2
N 0.000000 0.000000 0.000000
N 0.000000 0.000000 2.059801
#+END_example
Nuclear coordinates are stored in atomic units in transposed format.
#+begin_src c :tangle ../tests/n2.h
#define n2_nucl_num ((int64_t) 2)
double n2_charge[n2_nucl_num] = { 5., 5.};
double n2_nucl_coord[3][n2_nucl_num] =
{ {0.000000, 0.000000 },
{0.000000, 0.000000 },
{0.000000, 2.059801 } };
#+end_src
** Electron coordinates
Electron coordinates are stored in atomic units in normal format.
#+begin_src c :tangle ../tests/n2.h
#define n2_elec_up_num ((int64_t) 5)
#define n2_elec_dn_num ((int64_t) 5)
#define n2_elec_num ((int64_t) 10)
#define n2_walk_num ((int64_t) 1)
double n2_elec_coord[n2_walk_num][n2_elec_num][3] = { {
{-0.250655104764153 , 0.503070975550133 , -0.166554344502303},
{-0.587812193472177 , -0.128751981129274 , 0.187773606533075},
{ 1.61335569047166 , -0.615556732874863 , -1.43165470979934 },
{-4.901239896295210E-003 , -1.120440036458986E-002 , 1.99761909330422 },
{ 0.766647499681200 , -0.293515395797937 , 3.66454589201239 },
{-0.127732483187947 , -0.138975497694196 , -8.669850480215846E-002},
{-0.232271834949124 , -1.059321673434182E-002 , -0.504862241464867},
{ 1.09360863531826 , -2.036103063808752E-003 , -2.702796910818986E-002},
{-0.108090166832043 , 0.189161729653261 , 2.15398313919894},
{ 0.397978144318712 , -0.254277292595981 , 2.54553335476344}}};
#+end_src
** Jastrow related data
This test is mainly for the Jastrow factor and was supplied by
Ramon Panades Baruetta.
#+begin_src c :tangle ../tests/n2.h
/* Jastrow related */
#define n2_type_nucl_num ((int64_t) 1)
#define n2_aord_num ((int64_t) 5)
#define n2_bord_num ((int64_t) 5)
#define n2_cord_num ((int64_t) 23)
#define n2_dim_cord_vec ((int64_t) 23)
int64_t n2_type_nucl_vector[n2_nucl_num] = {
1,
1};
double n2_aord_vector[n2_aord_num + 1][n2_type_nucl_num] = {
{ 0. },
{ 0. },
{-0.380512},
{-0.157996},
{-0.031558},
{ 0.021512}};
double n2_bord_vector[n2_bord_num + 1] = {
0.5 ,
0.15366 ,
0.0672262 ,
0.02157 ,
0.0073096 ,
0.002866 };
double n2_cord_vector[n2_cord_num][n2_type_nucl_num] = {
{ 5.717020e-01},
{-5.142530e-01},
{-5.130430e-01},
{ 9.486000e-03},
{-4.205000e-03},
{ 4.263258e-01},
{ 8.288150e-02},
{ 5.118600e-03},
{-2.997800e-03},
{-5.270400e-03},
{-7.500000e-05},
{-8.301650e-02},
{ 1.454340e-02},
{ 5.143510e-02},
{ 9.250000e-04},
{-4.099100e-03},
{ 4.327600e-03},
{-1.654470e-03},
{ 2.614000e-03},
{-1.477000e-03},
{-1.137000e-03},
{-4.010475e-02},
{ 6.106710e-03}};
double n2_cord_vector_full[n2_dim_cord_vec][n2_nucl_num] = {
{ 5.717020e-01, 5.717020e-01},
{-5.142530e-01, -5.142530e-01},
{-5.130430e-01, -5.130430e-01},
{ 9.486000e-03, 9.486000e-03},
{-4.205000e-03, -4.205000e-03},
{ 4.263258e-01, 4.263258e-01},
{ 8.288150e-02, 8.288150e-02},
{ 5.118600e-03, 5.118600e-03},
{-2.997800e-03, -2.997800e-03},
{-5.270400e-03, -5.270400e-03},
{-7.500000e-05, -7.500000e-05},
{-8.301650e-02, -8.301650e-02},
{ 1.454340e-02, 1.454340e-02},
{ 5.143510e-02, 5.143510e-02},
{ 9.250000e-04, 9.250000e-04},
{-4.099100e-03, -4.099100e-03},
{ 4.327600e-03, 4.327600e-03},
{-1.654470e-03, -1.654470e-03},
{ 2.614000e-03, 2.614000e-03},
{-1.477000e-03, -1.477000e-03},
{-1.137000e-03, -1.137000e-03},
{-4.010475e-02, -4.010475e-02},
{ 6.106710e-03, 6.106710e-03}};
double n2_lkpm_of_cindex[4][n2_dim_cord_vec] = {
{1, 1, 2, 0, 0, 0, 2, 1, 1, 2, 3, 0, 2, 1, 3, 0, 0, 1, 3, 1, 1, 0, 3},
{1, 1, 3, 4, 0, 2, 2, 4, 0, 0, 2, 4, 1, 3, 1, 4, 0, 1, 1, 4, 1, 2, 0},
{4, 1, 0, 0, 4, 2, 1, 4, 5, 0, 2, 3, 5, 0, 0, 3, 5, 1, 3, 2, 5, 0, 1},
{2, 5, 1, 4, 1, 5, 0, 2, 1, 5, 1, 0, 1, 5, 2, 3, 0, 5, 1, 1, 0, 5, 2}};
#+end_src
# -*- mode: org -*-
# vim: syntax=c

View File

@ -6,6 +6,7 @@ qmckl_numprec.org
qmckl_nucleus.org
qmckl_electron.org
qmckl_ao.org
qmckl_jastrow.org
qmckl_distance.org
qmckl_utils.org
qmckl_tests.org

View File

@ -124,8 +124,7 @@ for d in parse_table(table):
results += [ f" {const}{c_type} {name}" ]
results=',\n'.join(results)
template = f"""{rettyp} {fname} (
{results} ); """
template = f"""{rettyp} {fname} (\n{results} ); """
return template
#+END_SRC
@ -259,3 +258,4 @@ return results
#+begin_src f90 :tangle (eval fh_func) :comments org :exports none
#+end_src