mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-03 10:06:09 +01:00
Merge branch 'master' of https://github.com/TREX-CoE/qmckl into TREX-CoE-master
This commit is contained in:
commit
68dc374422
5
.github/workflows/test-build.yml
vendored
5
.github/workflows/test-build.yml
vendored
@ -23,6 +23,11 @@ jobs:
|
||||
make -j 8
|
||||
make -j check
|
||||
make distcheck
|
||||
- name: Archive test log file
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: test-suite.log
|
||||
path: test-suite.log
|
||||
|
||||
# x86_macos:
|
||||
#
|
||||
|
@ -57,7 +57,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)
|
||||
@ -177,6 +177,7 @@ $(htmlize_el):
|
||||
|
||||
tests/chbrclf.h: $(qmckl_h)
|
||||
|
||||
tests/n2.h: $(qmckl_h)
|
||||
|
||||
generated.mk: $(ORG_FILES)
|
||||
$(PYTHON) $(srcdir)/tools/build_makefile.py
|
||||
|
15
configure.ac
15
configure.ac
@ -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.])])
|
||||
|
||||
@ -244,13 +243,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}
|
||||
|
1134
org/qmckl_ao.org
1134
org/qmckl_ao.org
File diff suppressed because it is too large
Load Diff
@ -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;
|
||||
|
@ -1004,7 +1004,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
|
||||
|
@ -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)
|
||||
@ -860,6 +859,20 @@ for (int64_t i=0 ; i<3*elec_num ; ++i) {
|
||||
qmckl_exit_code qmckl_get_electron_ee_distance(qmckl_context context, double* const distance);
|
||||
#+end_src
|
||||
|
||||
#+begin_src f90 :tangle (eval fh_func) :comments org :exports none
|
||||
interface
|
||||
integer(c_int32_t) function qmckl_get_electron_ee_distance(context, distance) &
|
||||
bind(C)
|
||||
use, intrinsic :: iso_c_binding
|
||||
import
|
||||
implicit none
|
||||
integer (c_int64_t) , intent(in) , value :: context
|
||||
real (c_double ) , intent(out) :: distance(*)
|
||||
end function
|
||||
end interface
|
||||
#+end_src
|
||||
|
||||
|
||||
#+begin_src c :comments org :tangle (eval c) :noweb yes :exports none
|
||||
qmckl_exit_code qmckl_get_electron_ee_distance(qmckl_context context, double* const distance)
|
||||
{
|
||||
@ -1552,7 +1565,6 @@ rc = qmckl_get_electron_ee_distance_rescaled_deriv_e(context, ee_distance_rescal
|
||||
|
||||
#+end_src
|
||||
|
||||
|
||||
** Electron-nucleus distances
|
||||
|
||||
*** Get
|
||||
@ -1561,6 +1573,19 @@ rc = qmckl_get_electron_ee_distance_rescaled_deriv_e(context, ee_distance_rescal
|
||||
qmckl_exit_code qmckl_get_electron_en_distance(qmckl_context context, double* distance);
|
||||
#+end_src
|
||||
|
||||
#+begin_src f90 :tangle (eval fh_func) :comments org :exports none
|
||||
interface
|
||||
integer(c_int32_t) function qmckl_get_electron_en_distance(context, distance) &
|
||||
bind(C)
|
||||
use, intrinsic :: iso_c_binding
|
||||
import
|
||||
implicit none
|
||||
integer (c_int64_t) , intent(in) , value :: context
|
||||
real (c_double ) , intent(out) :: distance(*)
|
||||
end function
|
||||
end interface
|
||||
#+end_src
|
||||
|
||||
#+begin_src c :comments org :tangle (eval c) :noweb yes :exports none
|
||||
qmckl_exit_code qmckl_get_electron_en_distance(qmckl_context context, double* distance)
|
||||
{
|
||||
@ -2113,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$.
|
||||
|
||||
|
5508
org/qmckl_jastrow.org
Normal file
5508
org/qmckl_jastrow.org
Normal file
File diff suppressed because it is too large
Load Diff
@ -526,8 +526,9 @@ F 1
|
||||
#+begin_src c :tangle ../tests/chbrclf.h
|
||||
#define chbrclf_shell_num 72
|
||||
#define chbrclf_prim_num 297
|
||||
#define chbrclf_ao_num 263
|
||||
|
||||
int64_t chbrclf_basis_nucleus_index[chbrclf_nucl_num] = {0, 14, 23, 27, 53};
|
||||
int64_t chbrclf_basis_nucleus_index[chbrclf_nucl_num] = {0, 14, 23, 37, 53};
|
||||
|
||||
int64_t chbrclf_basis_nucleus_shell_num[chbrclf_nucl_num] = {14, 9, 14, 16, 19};
|
||||
|
||||
@ -555,6 +556,37 @@ double chbrclf_basis_shell_factor[chbrclf_shell_num] =
|
||||
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
|
||||
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.};
|
||||
|
||||
double chbrclf_basis_ao_factor[chbrclf_ao_num] =
|
||||
{1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
|
||||
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
|
||||
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
|
||||
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
|
||||
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
|
||||
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
|
||||
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
|
||||
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
|
||||
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
|
||||
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
|
||||
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
|
||||
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
|
||||
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
|
||||
1., 1., 1.};
|
||||
|
||||
int64_t chbrclf_basis_ao_shell[chbrclf_ao_num] =
|
||||
{0, 1, 2, 3, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10,
|
||||
10, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13,
|
||||
13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 15, 16, 17, 18, 18, 18, 19, 19, 19, 20,
|
||||
20, 20, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 23, 24, 25, 26, 27, 28,
|
||||
28, 28, 29, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 32, 32, 32, 33, 33, 33,
|
||||
33, 33, 33, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 36,
|
||||
36, 36, 36, 36, 36, 36, 36, 36, 36, 37, 38, 39, 40, 41, 42, 43, 43, 43, 44, 44,
|
||||
44, 45, 45, 45, 46, 46, 46, 47, 47, 47, 48, 48, 48, 48, 48, 48, 49, 49, 49, 49,
|
||||
49, 49, 50, 50, 50, 50, 50, 50, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 52, 52,
|
||||
52, 52, 52, 52, 52, 52, 52, 52, 53, 54, 55, 56, 57, 58, 59, 60, 60, 60, 61, 61,
|
||||
61, 62, 62, 62, 63, 63, 63, 64, 64, 64, 65, 65, 65, 66, 66, 66, 66, 66, 66, 67,
|
||||
67, 67, 67, 67, 67, 68, 68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, 70, 70, 70,
|
||||
70, 70, 70, 70, 70, 70, 70, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71};
|
||||
|
||||
double chbrclf_basis_exponent[chbrclf_prim_num] =
|
||||
{8.2360000000000000e+03, 1.2350000000000000e+03, 2.8080000000000001e+02,
|
||||
7.9269999999999996e+01, 2.5590000000000000e+01, 8.9969999999999999e+00,
|
||||
@ -1013,3 +1045,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
|
||||
|
@ -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
|
||||
|
@ -85,6 +85,10 @@ cat << EOF > ${OUTPUT}
|
||||
#ifndef __QMCKL_H__
|
||||
#define __QMCKL_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
@ -100,6 +104,9 @@ do
|
||||
done
|
||||
|
||||
cat << EOF >> ${OUTPUT}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
|
||||
|
@ -96,7 +96,6 @@ def parse_table(table):
|
||||
return result
|
||||
#+END_SRC
|
||||
|
||||
|
||||
*** Generates a C header
|
||||
|
||||
#+NAME: generate_c_header
|
||||
@ -124,13 +123,11 @@ 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
|
||||
|
||||
|
||||
*** Generates a C interface to the Fortran function
|
||||
|
||||
#+NAME: generate_c_interface
|
||||
@ -259,3 +256,4 @@ return results
|
||||
#+begin_src f90 :tangle (eval fh_func) :comments org :exports none
|
||||
#+end_src
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user