1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2025-04-30 12:24:49 +02:00
This commit is contained in:
Emiel Slootman 2024-12-12 10:08:38 +01:00
commit 563a9e1c12
11 changed files with 1704 additions and 1824 deletions

1
.gitignore vendored
View File

@ -32,3 +32,4 @@ tools/libtool
tools/ltmain.sh
tools/missing
tools/test-driver
*/*.exported

View File

@ -49,8 +49,6 @@ qmckl_f = include/qmckl_f.F90
qmckl_fo = include/qmckl_f.o
include_HEADERS = $(qmckl_h) $(qmckl_f)
header_tests = tests/chbrclf.h tests/n2.h
QMCKL_TEST_DIR = $(abs_srcdir)/share/qmckl/test_data/
AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_builddir)/include
@ -137,9 +135,9 @@ endif
EXTRA_DIST += $(ORG_FILES) $(TANGLED_FILES) $(EXPORTED_FILES)
BUILT_SOURCES = $(C_FILES) $(F_FILES) $(FH_FUNC_FILES) $(FH_TYPE_FILES) $(H_FUNC_FILES) $(H_TYPE_FILES) $(H_PRIVATE_FUNC_FILES) $(H_PRIVATE_TYPE_FILES) $(qmckl_f) $(qmckl_h) $(header_tests) $(htmlize_el)
BUILT_SOURCES = $(C_FILES) $(F_FILES) $(FH_FUNC_FILES) $(FH_TYPE_FILES) $(H_FUNC_FILES) $(H_TYPE_FILES) $(H_PRIVATE_FUNC_FILES) $(H_PRIVATE_TYPE_FILES) $(qmckl_f) $(qmckl_h) $(htmlize_el)
CLEANFILES += $(BUILT_SOURCES) $(C_TEST_FILES) $(F_TEST_FILES) $(TANGLED_FILES) $(C_TEST_FILES) $(F_TEST_FILES) $(qmckl_f) $(qmckl_h) $(HTML_FILES) $(TEXT_FILES) $(EXPORTED_FILES) $(header_tests) $(htmlize_el)
CLEANFILES += $(BUILT_SOURCES) $(C_TEST_FILES) $(F_TEST_FILES) $(TANGLED_FILES) $(C_TEST_FILES) $(F_TEST_FILES) $(qmckl_f) $(qmckl_h) $(HTML_FILES) $(TEXT_FILES) $(EXPORTED_FILES) $(htmlize_el)
EXTRA_DIST += \
tools/build_doc.sh \
@ -189,7 +187,7 @@ $(htmlize_el):
tests/chbrclf.h: $(qmckl_h)
tests/n2.h: $(qmckl_h)
include/n2.h: $(qmckl_h)
cppcheck: cppcheck.out

BIN
QMCkl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -66,7 +66,7 @@ AC_ARG_WITH([icx],
AS_IF([test "x$with_icx" = "xyes"], [
CC=icx
CFLAGS="-march=native -Ofast -ftz -finline -g -qmkl=sequential" ])
CFLAGS="-march=native -Ofast -finline -g -qmkl=sequential" ])
AS_IF([test "x$with_icx.$with_ifort" = "xyes.yes"], [
ax_blas_ok="yes"

109
include/n2.h Normal file
View File

@ -0,0 +1,109 @@
#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 } };
#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}}};
/* 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) 5)
#define n2_dim_c_vec ((int64_t) 23)
int64_t n2_type_nucl_vector[n2_nucl_num] = {
0,
0};
double n2_a_vector[n2_aord_num + 1][n2_type_nucl_num] = {
{ 0. },
{ 0. },
{-0.380512},
{-0.157996},
{-0.031558},
{ 0.021512}};
double n2_b_vector[n2_bord_num + 1] = {
0.5 ,
0.15366 ,
0.0672262 ,
0.02157 ,
0.0073096 ,
0.002866 };
double n2_c_vector[n2_dim_c_vec][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_c_vector_full[n2_dim_c_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_c_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}};

View File

@ -472,18 +472,15 @@ qmckl_get_error(qmckl_context context,
qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
assert (ctx != NULL); /* Impossible because the context is valid. */
/* Turn off annoying GCC warning */
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-truncation"
#endif
size_t sizeCp;
strncpy(function_name, ctx->error.function, QMCKL_MAX_FUN_LEN-1);
strncpy(message , ctx->error.message , QMCKL_MAX_MSG_LEN-1);
sizeCp = strlen(ctx->error.function);
sizeCp = sizeCp > QMCKL_MAX_FUN_LEN ? QMCKL_MAX_FUN_LEN : sizeCp;
memcpy(function_name, ctx->error.function, sizeCp);
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
sizeCp = strlen(ctx->error.message);
sizeCp = sizeCp > QMCKL_MAX_MSG_LEN ? QMCKL_MAX_MSG_LEN : sizeCp;
memcpy(message, ctx->error.message, sizeCp);
(*exit_code) = ctx->error.exit_code;
}

View File

@ -993,7 +993,7 @@ function qmckl_compute_forces_jastrow_en_g_doc( &
integer*8 :: i, a, k, nw, ii, m,l
double precision :: x, x1, kf
double precision :: denom, invdenom, invdenom2, f, f2, expk, invdist
double precision :: dx(3)
double precision :: dx(4)
info = QMCKL_SUCCESS
@ -1409,7 +1409,7 @@ function qmckl_compute_forces_jastrow_en_l_doc( &
integer*8 :: i, a, k, nw, ii, m,l
double precision :: x, x1, kf
double precision :: denom, invdenom, invdenom2, f, f2, expk, invdist
double precision :: dx(3)
double precision :: dx(4)
info = QMCKL_SUCCESS

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -7,11 +7,12 @@ optimized libraries to fine-tune the memory allocation.
Example of usage:
#+begin_src c
#include "qmckl_memory.h"
info_struct mem_info = qmckl_memory_info_struct_zero;
mem_info.size = size * sizeof(double);
data = (double*) qmckl_malloc (context, mem_info);
if (data == NULL) {
return QMCKL_ALLOCATION_FAILED;
}
// ...
qmckl_free(data);
#+end_src

View File

@ -2,6 +2,9 @@
# -*- org-image-actual-width: 300 -*-
To modify the data of the tests, don't modify only this file. You will
need to modify the files that are in the =include/= directory.
* CHBrClF
This test is the all-electron Hartree-Fock wave function of CHClBr,
@ -967,6 +970,7 @@ double chbrclf_basis_prim_factor[chbrclf_prim_num] =
#+end_src
** Molecular orbitals
The file is too large to be included in org-mode.
#+begin_src c
@ -975,7 +979,6 @@ double chbrclf_mo_coef[chbrclf_mo_num*chbrclf_ao_num] =
{
... see include/chbrclf.h
}
#+end_src
** Electron coordinates
@ -1153,7 +1156,7 @@ N2
Nuclear coordinates are stored in atomic units in transposed format.
#+begin_src c :tangle (concat include "n2.h")
#+begin_src c
#define n2_nucl_num ((int64_t) 2)
double n2_charge[n2_nucl_num] = { 5., 5.};
@ -1169,7 +1172,7 @@ double n2_nucl_coord[3][n2_nucl_num] =
Electron coordinates are stored in atomic units in normal format.
#+begin_src c :tangle (concat include "n2.h")
#+begin_src c
#define n2_elec_up_num ((int64_t) 5)
#define n2_elec_dn_num ((int64_t) 5)
#define n2_elec_num ((int64_t) 10)
@ -1194,7 +1197,7 @@ double n2_elec_coord[n2_walk_num][n2_elec_num][3] = { {
This test is mainly for the Jastrow factor and was supplied by
Ramon Panades Baruetta.
#+begin_src c :tangle (concat include "n2.h")
#+begin_src c
/* Jastrow related */
#define n2_type_nucl_num ((int64_t) 1)