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

Merge branch 'TREX-CoE:master' into master

This commit is contained in:
vijay 2022-01-11 15:13:46 +01:00 committed by GitHub
commit 7ee0b74e6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 123067 additions and 128037 deletions

View File

@ -20,8 +20,9 @@ jobs:
- name: Install trexio - name: Install trexio
run: | run: |
export VERSION=1.1.0 export TAG=v2.1.0
wget https://github.com/TREX-CoE/trexio/releases/download/v${VERSION}/trexio-${VERSION}.tar.gz export VERSION=2.1.0
wget https://github.com/TREX-CoE/trexio/releases/download/${TAG}/trexio-${VERSION}.tar.gz
tar -zxf trexio-${VERSION}.tar.gz tar -zxf trexio-${VERSION}.tar.gz
cd trexio-${VERSION} cd trexio-${VERSION}
./configure --prefix=/usr ./configure --prefix=/usr

View File

@ -29,7 +29,7 @@ jobs:
- name: Install trexio - name: Install trexio
run: | run: |
export VERSION=1.1.0 export VERSION=2.1.0
wget https://github.com/TREX-CoE/trexio/releases/download/v${VERSION}/trexio-${VERSION}.tar.gz wget https://github.com/TREX-CoE/trexio/releases/download/v${VERSION}/trexio-${VERSION}.tar.gz
tar -zxf trexio-${VERSION}.tar.gz tar -zxf trexio-${VERSION}.tar.gz
cd trexio-${VERSION} cd trexio-${VERSION}

View File

@ -64,7 +64,7 @@ AM_CPPFLAGS += -DQMCKL_TEST_DIR=\"$(QMCKL_TEST_DIR)\"
lib_LTLIBRARIES = src/libqmckl.la lib_LTLIBRARIES = src/libqmckl.la
src_libqmckl_la_SOURCES = $(qmckl_h) $(src_qmckl_f) $(C_FILES) $(F_FILES) $(H_PRIVATE_FUNC_FILES) $(H_PRIVATE_TYPE_FILES) $(header_tests) src_libqmckl_la_SOURCES = $(qmckl_h) $(src_qmckl_f) $(C_FILES) $(F_FILES) $(H_PRIVATE_FUNC_FILES) $(H_PRIVATE_TYPE_FILES)
CLEANFILES+=$(test_qmckl_fo) $(src_qmckl_fo) $(test_qmckl_o) $(src_qmckl_o) $(FH_TYPE_FILES) $(FH_FUNC_FILES) CLEANFILES+=$(test_qmckl_fo) $(src_qmckl_fo) $(test_qmckl_o) $(src_qmckl_o) $(FH_TYPE_FILES) $(FH_FUNC_FILES)
@ -76,20 +76,17 @@ ln_s_verbose = $(ln_s_verbose_@AM_V@)
ln_s_verbose_ = $(ln_s_verbose_@AM_DEFAULT_V@) ln_s_verbose_ = $(ln_s_verbose_@AM_DEFAULT_V@)
ln_s_verbose_0 = @echo " LN_S $<"; ln_s_verbose_0 = @echo " LN_S $<";
htmldir = share/doc/qmckl/html htmldir = $(docdir)/html
textdir = share/doc/qmckl/text textdir = $(docdir)/text
htmlize_el=$(htmldir)/htmlize.el htmldir_loc = share/doc/qmckl/html
textdir_loc = share/doc/qmckl/text
htmlize_el = $(htmldir_loc)/htmlize.el
dist_html_DATA = $(HTML_FILES) \ dist_html_DATA = $(HTML_FILES) \
$(htmldir)/index.html \ share/doc/qmckl/html/qmckl.css \
$(htmldir)/qmckl.css share/doc/qmckl/html/index.html
dist_text_DATA = $(TEXT_FILES) dist_text_DATA = $(TEXT_FILES)
$(htmldir)/index.html: $(htmldir)/README.html
$(ln_s_verbose)cd $(htmldir)/ && \
rm -rf index.html && \
$(LN_S) README.html index.html
html-local: $(dist_html_DATA) html-local: $(dist_html_DATA)
text: $(dist_text_DATA) text: $(dist_text_DATA)
@ -99,16 +96,15 @@ doc: html text
if QMCKL_DEVEL if QMCKL_DEVEL
if VFC_CI if VFC_CI
AM_LDFLAGS=-lvfc_probes -lvfc_probes_f AM_LDFLAGS=-lvfc_probes -lvfc_probes_f
endif endif
dist_src_DATA = $(ORG_FILES) $(TANGLED_FILES) $(EXPORTED_FILES) $(test_qmckl_f) EXTRA_DIST += $(ORG_FILES) $(TANGLED_FILES) $(EXPORTED_FILES) $(test_qmckl_f)
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) $(src_qmckl_f) $(test_qmckl_f) $(qmckl_h) $(header_tests) 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) $(src_qmckl_f) $(test_qmckl_f) $(qmckl_h) $(header_tests)
CLEANFILES += $(BUILT_SOURCES) $(C_TEST_FILES) $(F_TEST_FILES) $(TANGLED_FILES) $(C_TEST_FILES) $(F_TEST_FILES) $(src_qmckl_f) $(test_qmckl_f) $(qmckl_h) $(HTML_FILES) $(TEXT_FILES) $(htmldir)/index.html $(EXPORTED_FILES) $(header_tests) CLEANFILES += $(BUILT_SOURCES) $(C_TEST_FILES) $(F_TEST_FILES) $(TANGLED_FILES) $(C_TEST_FILES) $(F_TEST_FILES) $(src_qmckl_f) $(test_qmckl_f) $(qmckl_h) $(HTML_FILES) $(TEXT_FILES) $(EXPORTED_FILES) $(header_tests)
EXTRA_DIST += \ EXTRA_DIST += \
tools/build_doc.sh \ tools/build_doc.sh \
@ -156,8 +152,8 @@ $(src_qmckl_f): $(FH_FUNC_FILES) $(FH_TYPE_FILES)
$(cat_h_verbose)top_builddir=$(abs_top_builddir) srcdir=$(abs_srcdir) src_qmckl_f=$(src_qmckl_f) $(srcdir)/tools/build_qmckl_f.sh $(cat_h_verbose)top_builddir=$(abs_top_builddir) srcdir=$(abs_srcdir) src_qmckl_f=$(src_qmckl_f) $(srcdir)/tools/build_qmckl_f.sh
$(htmlize_el): $(htmlize_el):
$(MKDIR_P) $(htmldir) $(MKDIR_P) $(htmldir_loc)
$(MKDIR_P) $(textdir) $(MKDIR_P) $(textdir_loc)
abs_srcdir=$(abs_srcdir) $(srcdir)/tools/install_htmlize.sh $(htmlize_el) abs_srcdir=$(abs_srcdir) $(srcdir)/tools/install_htmlize.sh $(htmlize_el)
tests/chbrclf.h: $(qmckl_h) tests/chbrclf.h: $(qmckl_h)

View File

@ -75,6 +75,7 @@ AC_PROG_CC
m4_version_prereq([2.70],[], [AC_PROG_CC_C99]) m4_version_prereq([2.70],[], [AC_PROG_CC_C99])
AS_IF([test "$ac_cv_prog_cc_c99" = "no"], [AC_MSG_ERROR([The compiler does not support C99])]) AS_IF([test "$ac_cv_prog_cc_c99" = "no"], [AC_MSG_ERROR([The compiler does not support C99])])
AC_PROG_CC_C_O AC_PROG_CC_C_O
AC_PROG_F77
AC_PROG_FC AC_PROG_FC
AC_PROG_FC_C_O AC_PROG_FC_C_O
AC_FC_SRCEXT([f90]) AC_FC_SRCEXT([f90])

View File

@ -16,23 +16,25 @@ grep TITLE $(cat table_of_contents) | tr ':' ' '
#+end_src #+end_src
#+RESULTS: toc #+RESULTS: toc
| qmckl.org | #+TITLE | Introduction | | | | qmckl.org | #+TITLE | Introduction | | |
| qmckl_error.org | #+TITLE | Error | handling | | | qmckl_ao.org | #+TITLE | Atomic | Orbitals | |
| qmckl_context.org | #+TITLE | Context | | | | qmckl_blas.org | #+TITLE | BLAS | functions | |
| qmckl_memory.org | #+TITLE | Memory | management | | | qmckl_context.org | #+TITLE | Context | | |
| qmckl_numprec.org | #+TITLE | Numerical | precision | | | qmckl_determinant.org | #+TITLE | Slater | Determinant | |
| qmckl_distance.org | #+TITLE | Inter-particle | distances | | | qmckl_distance.org | #+TITLE | Inter-particle | distances | |
| qmckl_nucleus.org | #+TITLE | Nucleus | | | | qmckl_electron.org | #+TITLE | Electrons | | |
| qmckl_electron.org | #+TITLE | Electrons | | | | qmckl_error.org | #+TITLE | Error | handling | |
| qmckl_ao.org | #+TITLE | Atomic | Orbitals | | | qmckl_jastrow.org | #+TITLE | Jastrow | Factor | |
| qmckl_mo.org | #+TITLE | Molecular | Orbitals | | | qmckl_local_energy.org | #+TITLE | Local | Energy | |
| qmckl_jastrow.org | #+TITLE | Jastrow | Factor | | | qmckl_memory.org | #+TITLE | Memory | management | |
| qmckl_sherman_morrison_woodbury.org | #+TITLE | Sherman-Morrison-Woodbury | | | | qmckl_mo.org | #+TITLE | Molecular | Orbitals | |
| qmckl_utils.org | #+TITLE | Utility | functions | | | qmckl_numprec.org | #+TITLE | Numerical | precision | |
| qmckl_blas.org | #+TITLE | BLAS | functions | | | qmckl_nucleus.org | #+TITLE | Nucleus | | |
| qmckl_trexio.org | #+TITLE | TREXIO | I/O | library | | qmckl_sherman_morrison_woodbury.org | #+TITLE | Sherman-Morrison-Woodbury | | |
| qmckl_verificarlo.org | #+TITLE | Verificarlo | CI | | | qmckl_utils.org | #+TITLE | Utility | functions | |
| qmckl_tests.org | #+TITLE | Data | for | Tests | | qmckl_trexio.org | #+TITLE | TREXIO | I/O | library |
| qmckl_verificarlo.org | #+TITLE | Verificarlo | CI | |
| qmckl_tests.org | #+TITLE | Data | for | Tests |
#+begin_src python :var data=toc :exports results :results raw #+begin_src python :var data=toc :exports results :results raw
result = [] result = []
@ -45,19 +47,21 @@ return '\n'.join(result)
#+RESULTS: #+RESULTS:
- [[./qmckl.html][Introduction]] - [[./qmckl.html][Introduction]]
- [[./qmckl_error.html][Error handling]]
- [[./qmckl_context.html][Context]]
- [[./qmckl_memory.html][Memory management]]
- [[./qmckl_numprec.html][Numerical precision]]
- [[./qmckl_distance.html][Inter-particle distances]]
- [[./qmckl_nucleus.html][Nucleus]]
- [[./qmckl_electron.html][Electrons]]
- [[./qmckl_ao.html][Atomic Orbitals]] - [[./qmckl_ao.html][Atomic Orbitals]]
- [[./qmckl_mo.html][Molecular Orbitals]] - [[./qmckl_blas.html][BLAS functions]]
- [[./qmckl_context.html][Context]]
- [[./qmckl_determinant.html][Slater Determinant]]
- [[./qmckl_distance.html][Inter-particle distances]]
- [[./qmckl_electron.html][Electrons]]
- [[./qmckl_error.html][Error handling]]
- [[./qmckl_jastrow.html][Jastrow Factor]] - [[./qmckl_jastrow.html][Jastrow Factor]]
- [[./qmckl_local_energy.html][Local Energy]]
- [[./qmckl_memory.html][Memory management]]
- [[./qmckl_mo.html][Molecular Orbitals]]
- [[./qmckl_numprec.html][Numerical precision]]
- [[./qmckl_nucleus.html][Nucleus]]
- [[./qmckl_sherman_morrison_woodbury.html][Sherman-Morrison-Woodbury]] - [[./qmckl_sherman_morrison_woodbury.html][Sherman-Morrison-Woodbury]]
- [[./qmckl_utils.html][Utility functions]] - [[./qmckl_utils.html][Utility functions]]
- [[./qmckl_blas.html][BLAS functions]]
- [[./qmckl_trexio.html][TREXIO I/O library]] - [[./qmckl_trexio.html][TREXIO I/O library]]
- [[./qmckl_verificarlo.html][Verificarlo CI]] - [[./qmckl_verificarlo.html][Verificarlo CI]]
- [[./qmckl_tests.html][Data for Tests]] - [[./qmckl_tests.html][Data for Tests]]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -557,6 +557,7 @@ qmckl_exit_code qmckl_finalize_determinant(qmckl_context context) {
"qmckl_finalize_determinant", "qmckl_finalize_determinant",
NULL); NULL);
} }
return rc;
} }
#+end_src #+end_src
@ -841,16 +842,18 @@ qmckl_exit_code qmckl_provide_det_vgl_beta(qmckl_context context) {
:END: :END:
#+NAME: qmckl_compute_det_vgl_alpha_args #+NAME: qmckl_compute_det_vgl_alpha_args
| ~qmckl_context~ | ~context~ | in | Global state | | Variable | Type | In/Out | Description |
| ~int64_t~ | ~det_num_alpha~ | in | Number of determinants | |------------------+------------------------------------------------------------+--------+-------------------------------------------|
| ~int64_t~ | ~walk_num~ | in | Number of walkers | | ~context~ | ~qmckl_context~ | in | Global state |
| ~int64_t~ | ~alpha_num~ | in | Number of electrons | | ~det_num_alpha~ | ~int64_t~ | in | Number of determinants |
| ~int64_t~ | ~beta_num~ | in | Number of electrons | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| ~int64_t~ | ~elec_num~ | in | Number of electrons | | ~alpha_num~ | ~int64_t~ | in | Number of electrons |
| ~int64_t~ | ~mo_index_alpha[det_num_alpha][walk_num][alpha_num]~ | in | MO indices for electrons | | ~beta_num~ | ~int64_t~ | in | Number of electrons |
| ~int64_t~ | ~mo_num~ | in | Number of MOs | | ~elec_num~ | ~int64_t~ | in | Number of electrons |
| ~double~ | ~mo_vgl[5][elec_num][mo_num]~ | in | Value, gradients and Laplacian of the MOs | | ~mo_index_alpha~ | ~int64_t[det_num_alpha][walk_num][alpha_num]~ | in | MO indices for electrons |
| ~double~ | ~det_vgl_alpha[det_num_alpha][walk_num][5][alpha_num][alpha_num]~ | out | Value, gradients and Laplacian of the Det | | ~mo_num~ | ~int64_t~ | in | Number of MOs |
| ~mo_vgl~ | ~double[5][elec_num][mo_num]~ | in | Value, gradients and Laplacian of the MOs |
| ~det_vgl_alpha~ | ~double[det_num_alpha][walk_num][5][alpha_num][alpha_num]~ | out | Value, gradients and Laplacian of the Det |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_det_vgl_alpha_f(context, & integer function qmckl_compute_det_vgl_alpha_f(context, &
@ -920,16 +923,16 @@ end function qmckl_compute_det_vgl_alpha_f
#+RESULTS: #+RESULTS:
#+begin_src c :tangle (eval h_func) :comments org #+begin_src c :tangle (eval h_func) :comments org
qmckl_exit_code qmckl_compute_det_vgl_alpha ( qmckl_exit_code qmckl_compute_det_vgl_alpha (
const qmckl_context context, const qmckl_context context,
const int64_t det_num_alpha, const int64_t det_num_alpha,
const int64_t walk_num, const int64_t walk_num,
const int64_t alpha_num, const int64_t alpha_num,
const int64_t beta_num, const int64_t beta_num,
const int64_t elec_num, const int64_t elec_num,
const int64_t* mo_index_alpha, const int64_t* mo_index_alpha,
const int64_t mo_num, const int64_t mo_num,
const double* mo_vgl, const double* mo_vgl,
double* const det_vgl_alpha ); double* const det_vgl_alpha );
#+end_src #+end_src
#+CALL: generate_c_interface(table=qmckl_compute_det_vgl_alpha_args,rettyp=get_value("CRetType"),fname="qmckl_compute_det_vgl_alpha")) #+CALL: generate_c_interface(table=qmckl_compute_det_vgl_alpha_args,rettyp=get_value("CRetType"),fname="qmckl_compute_det_vgl_alpha"))
@ -937,17 +940,17 @@ end function qmckl_compute_det_vgl_alpha_f
#+RESULTS: #+RESULTS:
#+begin_src f90 :tangle (eval f) :comments org :exports none #+begin_src f90 :tangle (eval f) :comments org :exports none
integer(c_int32_t) function qmckl_compute_det_vgl_alpha & integer(c_int32_t) function qmckl_compute_det_vgl_alpha &
(context, & (context, &
det_num_alpha, & det_num_alpha, &
walk_num, & walk_num, &
alpha_num, & alpha_num, &
beta_num, & beta_num, &
elec_num, & elec_num, &
mo_index_alpha, & mo_index_alpha, &
mo_num, & mo_num, &
mo_vgl, & mo_vgl, &
det_vgl_alpha) & det_vgl_alpha) &
bind(C) result(info) bind(C) result(info)
use, intrinsic :: iso_c_binding use, intrinsic :: iso_c_binding
implicit none implicit none
@ -965,16 +968,16 @@ end function qmckl_compute_det_vgl_alpha_f
integer(c_int32_t), external :: qmckl_compute_det_vgl_alpha_f integer(c_int32_t), external :: qmckl_compute_det_vgl_alpha_f
info = qmckl_compute_det_vgl_alpha_f & info = qmckl_compute_det_vgl_alpha_f &
(context, & (context, &
det_num_alpha, & det_num_alpha, &
walk_num, & walk_num, &
alpha_num, & alpha_num, &
beta_num, & beta_num, &
elec_num, & elec_num, &
mo_index_alpha, & mo_index_alpha, &
mo_num, & mo_num, &
mo_vgl, & mo_vgl, &
det_vgl_alpha) det_vgl_alpha)
end function qmckl_compute_det_vgl_alpha end function qmckl_compute_det_vgl_alpha
#+end_src #+end_src
@ -987,16 +990,18 @@ end function qmckl_compute_det_vgl_alpha_f
:END: :END:
#+NAME: qmckl_compute_det_vgl_beta_args #+NAME: qmckl_compute_det_vgl_beta_args
| ~qmckl_context~ | ~context~ | in | Global state | | Variable | Type | In/Out | Description |
| ~int64_t~ | ~det_num_beta~ | in | Number of determinants | |-----------------+---------------------------------------------------------+--------+-------------------------------------------|
| ~int64_t~ | ~walk_num~ | in | Number of walkers | | ~context~ | ~qmckl_context~ | in | Global state |
| ~int64_t~ | ~alpha_num~ | in | Number of electrons | | ~det_num_beta~ | ~int64_t~ | in | Number of determinants |
| ~int64_t~ | ~beta_num~ | in | Number of electrons | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| ~int64_t~ | ~elec_num~ | in | Number of electrons | | ~alpha_num~ | ~int64_t~ | in | Number of electrons |
| ~int64_t~ | ~mo_index_beta[det_num_beta][walk_num][beta_num]~ | in | Number of electrons | | ~beta_num~ | ~int64_t~ | in | Number of electrons |
| ~int64_t~ | ~mo_num~ | in | Number of MOs | | ~elec_num~ | ~int64_t~ | in | Number of electrons |
| ~double~ | ~mo_vgl[5][elec_num][mo_num]~ | in | Value, gradients and Laplacian of the MOs | | ~mo_index_beta~ | ~int64_t[det_num_beta][walk_num][beta_num]~ | in | Number of electrons |
| ~double~ | ~det_vgl_beta[det_num_beta][walk_num][5][beta_num][beta_num]~ | out | Value, gradients and Laplacian of the Det | | ~mo_num~ | ~int64_t~ | in | Number of MOs |
| ~mo_vgl~ | ~double[5][elec_num][mo_num]~ | in | Value, gradients and Laplacian of the MOs |
| ~det_vgl_beta~ | ~double[det_num_beta][walk_num][5][beta_num][beta_num]~ | out | Value, gradients and Laplacian of the Det |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_det_vgl_beta_f(context, & integer function qmckl_compute_det_vgl_beta_f(context, &
@ -1066,16 +1071,16 @@ end function qmckl_compute_det_vgl_beta_f
#+RESULTS: #+RESULTS:
#+begin_src c :tangle (eval h_func) :comments org #+begin_src c :tangle (eval h_func) :comments org
qmckl_exit_code qmckl_compute_det_vgl_beta ( qmckl_exit_code qmckl_compute_det_vgl_beta (
const qmckl_context context, const qmckl_context context,
const int64_t det_num_beta, const int64_t det_num_beta,
const int64_t walk_num, const int64_t walk_num,
const int64_t alpha_num, const int64_t alpha_num,
const int64_t beta_num, const int64_t beta_num,
const int64_t elec_num, const int64_t elec_num,
const int64_t* mo_index_beta, const int64_t* mo_index_beta,
const int64_t mo_num, const int64_t mo_num,
const double* mo_vgl, const double* mo_vgl,
double* const det_vgl_beta ); double* const det_vgl_beta );
#+end_src #+end_src
#+CALL: generate_c_interface(table=qmckl_compute_det_vgl_beta_args,rettyp=get_value("CRetType"),fname="qmckl_compute_det_vgl_beta")) #+CALL: generate_c_interface(table=qmckl_compute_det_vgl_beta_args,rettyp=get_value("CRetType"),fname="qmckl_compute_det_vgl_beta"))
@ -1083,17 +1088,17 @@ end function qmckl_compute_det_vgl_beta_f
#+RESULTS: #+RESULTS:
#+begin_src f90 :tangle (eval f) :comments org :exports none #+begin_src f90 :tangle (eval f) :comments org :exports none
integer(c_int32_t) function qmckl_compute_det_vgl_beta & integer(c_int32_t) function qmckl_compute_det_vgl_beta &
(context, & (context, &
det_num_beta, & det_num_beta, &
walk_num, & walk_num, &
alpha_num, & alpha_num, &
beta_num, & beta_num, &
elec_num, & elec_num, &
mo_index_beta, & mo_index_beta, &
mo_num, & mo_num, &
mo_vgl, & mo_vgl, &
det_vgl_beta) & det_vgl_beta) &
bind(C) result(info) bind(C) result(info)
use, intrinsic :: iso_c_binding use, intrinsic :: iso_c_binding
implicit none implicit none
@ -1111,16 +1116,16 @@ end function qmckl_compute_det_vgl_beta_f
integer(c_int32_t), external :: qmckl_compute_det_vgl_beta_f integer(c_int32_t), external :: qmckl_compute_det_vgl_beta_f
info = qmckl_compute_det_vgl_beta_f & info = qmckl_compute_det_vgl_beta_f &
(context, & (context, &
det_num_beta, & det_num_beta, &
walk_num, & walk_num, &
alpha_num, & alpha_num, &
beta_num, & beta_num, &
elec_num, & elec_num, &
mo_index_beta, & mo_index_beta, &
mo_num, & mo_num, &
mo_vgl, & mo_vgl, &
det_vgl_beta) det_vgl_beta)
end function qmckl_compute_det_vgl_beta end function qmckl_compute_det_vgl_beta
#+end_src #+end_src
@ -1190,45 +1195,45 @@ rc = qmckl_set_ao_basis_prim_num (context, chbrclf_prim_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_nucleus_index (context, nucleus_index); rc = qmckl_set_ao_basis_nucleus_index (context, nucleus_index, nucl_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_nucleus_shell_num (context, nucleus_shell_num); rc = qmckl_set_ao_basis_nucleus_shell_num (context, nucleus_shell_num, nucl_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_shell_ang_mom (context, shell_ang_mom); rc = qmckl_set_ao_basis_shell_ang_mom (context, shell_ang_mom, shell_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_shell_factor (context, shell_factor); rc = qmckl_set_ao_basis_shell_factor (context, shell_factor, shell_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_shell_prim_num (context, shell_prim_num); rc = qmckl_set_ao_basis_shell_prim_num (context, shell_prim_num, shell_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_shell_prim_index (context, shell_prim_index); rc = qmckl_set_ao_basis_shell_prim_index (context, shell_prim_index, shell_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_exponent (context, exponent); rc = qmckl_set_ao_basis_exponent (context, exponent, chbrclf_prim_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_coefficient (context, coefficient); rc = qmckl_set_ao_basis_coefficient (context, coefficient, chbrclf_prim_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_prim_factor (context, prim_factor); rc = qmckl_set_ao_basis_prim_factor (context, prim_factor, chbrclf_prim_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
rc = qmckl_set_ao_basis_ao_num(context, chbrclf_ao_num); rc = qmckl_set_ao_basis_ao_num(context, chbrclf_ao_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
rc = qmckl_set_ao_basis_ao_factor (context, ao_factor); rc = qmckl_set_ao_basis_ao_factor (context, ao_factor, chbrclf_ao_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(qmckl_ao_basis_provided(context)); assert(qmckl_ao_basis_provided(context));
@ -1236,7 +1241,7 @@ assert(qmckl_ao_basis_provided(context));
double ao_vgl[5][walk_num][elec_num][chbrclf_ao_num]; double ao_vgl[5][walk_num][elec_num][chbrclf_ao_num];
rc = qmckl_get_ao_vgl(context, &(ao_vgl[0][0][0][0])); rc = qmckl_get_ao_basis_ao_vgl(context, &(ao_vgl[0][0][0][0]), (int64_t) 5*walk_num*elec_num*chbrclf_ao_num);
assert (rc == QMCKL_SUCCESS); assert (rc == QMCKL_SUCCESS);
/* Set up MO data */ /* Set up MO data */
@ -1761,14 +1766,16 @@ qmckl_exit_code qmckl_provide_det_inv_matrix_beta(qmckl_context context) {
:END: :END:
#+NAME: qmckl_det_inv_matrix_alpha_args #+NAME: qmckl_det_inv_matrix_alpha_args
| ~qmckl_context~ | ~context~ | in | Global state | | Variable | Type | In/Out | Description |
| ~int64_t~ | ~det_num_alpha~ | in | Number of determinants | |------------------------+------------------------------------------------------------+--------+--------------------------------------------------------------|
| ~int64_t~ | ~walk_num~ | in | Number of walkers | | ~context~ | ~qmckl_context~ | in | Global state |
| ~int64_t~ | ~alpha_num~ | in | Number of electrons | | ~det_num_alpha~ | ~int64_t~ | in | Number of determinants |
| ~double~ | ~det_vgl_alpha[det_num_alpha][walk_num][5][alpha_num][alpha_num]~ | in | determinant matrix Value, gradients and Laplacian of the MOs | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| ~double~ | ~det_value_alpha[det_num_alpha][walk_num]~ | out | value of determinant matrix | | ~alpha_num~ | ~int64_t~ | in | Number of electrons |
| ~double~ | ~det_adj_matrix_alpha[det_num_alpha][walk_num][alpha_num][alpha_num]~ | out | adjoint of determinant matrix | | ~det_vgl_alpha~ | ~double[det_num_alpha][walk_num][5][alpha_num][alpha_num]~ | in | determinant matrix Value, gradients and Laplacian of the MOs |
| ~double~ | ~det_inv_matrix_alpha[det_num_alpha][walk_num][alpha_num][alpha_num]~ | out | inverse of determinant matrix | | ~det_value_alpha~ | ~double[det_num_alpha][walk_num]~ | out | value of determinant matrix |
| ~det_adj_matrix_alpha~ | ~double[det_num_alpha][walk_num][alpha_num][alpha_num]~ | out | adjoint of determinant matrix |
| ~det_inv_matrix_alpha~ | ~double[det_num_alpha][walk_num][alpha_num][alpha_num]~ | out | inverse of determinant matrix |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_det_inv_matrix_alpha_f(context, & integer function qmckl_compute_det_inv_matrix_alpha_f(context, &
@ -1814,14 +1821,23 @@ integer function qmckl_compute_det_inv_matrix_alpha_f(context, &
LDA = alpha_num LDA = alpha_num
do idet = 1, det_num_alpha do idet = 1, det_num_alpha
do iwalk = 1, walk_num do iwalk = 1, walk_num
! Value ! Value
matA(1:alpha_num,1:alpha_num) = det_vgl_alpha(1:alpha_num, 1:alpha_num, 1, iwalk, idet) matA(1:alpha_num,1:alpha_num) = &
res = qmckl_adjugate(context, alpha_num, LDA, matA, det_l) det_vgl_alpha(1:alpha_num, 1:alpha_num, 1, iwalk, idet)
det_adj_matrix_alpha(1:alpha_num, 1:alpha_num, iwalk, idet) = matA
det_inv_matrix_alpha(1:alpha_num, 1:alpha_num, iwalk, idet) = matA/det_l res = qmckl_adjugate(context, &
det_value_alpha(iwalk, idet) = det_l alpha_num, matA, LDA, &
end do det_adj_matrix_alpha(1, 1, iwalk, idet), &
int(size(det_adj_matrix_alpha,1),8), &
det_l)
det_inv_matrix_alpha(1:alpha_num, 1:alpha_num, iwalk, idet) = &
(1.d0/det_l) * &
det_adj_matrix_alpha(1:alpha_num, 1:alpha_num, iwalk, idet)
det_value_alpha(iwalk, idet) = det_l
end do
end do end do
deallocate(matA) deallocate(matA)
@ -1833,14 +1849,14 @@ end function qmckl_compute_det_inv_matrix_alpha_f
#+RESULTS: #+RESULTS:
#+begin_src c :tangle (eval h_func) :comments org #+begin_src c :tangle (eval h_func) :comments org
qmckl_exit_code qmckl_compute_det_inv_matrix_alpha ( qmckl_exit_code qmckl_compute_det_inv_matrix_alpha (
const qmckl_context context, const qmckl_context context,
const int64_t det_num_alpha, const int64_t det_num_alpha,
const int64_t walk_num, const int64_t walk_num,
const int64_t alpha_num, const int64_t alpha_num,
const double* det_vgl_alpha, const double* det_vgl_alpha,
double* const det_value_alpha, double* const det_value_alpha,
double* const det_adj_matrix_alpha, double* const det_adj_matrix_alpha,
double* const det_inv_matrix_alpha ); double* const det_inv_matrix_alpha );
#+end_src #+end_src
#+CALL: generate_c_interface(table=qmckl_det_inv_matrix_alpha_args,rettyp=get_value("CRetType"),fname="qmckl_compute_det_inv_matrix_alpha")) #+CALL: generate_c_interface(table=qmckl_det_inv_matrix_alpha_args,rettyp=get_value("CRetType"),fname="qmckl_compute_det_inv_matrix_alpha"))
@ -1848,15 +1864,15 @@ end function qmckl_compute_det_inv_matrix_alpha_f
#+RESULTS: #+RESULTS:
#+begin_src f90 :tangle (eval f) :comments org :exports none #+begin_src f90 :tangle (eval f) :comments org :exports none
integer(c_int32_t) function qmckl_compute_det_inv_matrix_alpha & integer(c_int32_t) function qmckl_compute_det_inv_matrix_alpha &
(context, & (context, &
det_num_alpha, & det_num_alpha, &
walk_num, & walk_num, &
alpha_num, & alpha_num, &
det_vgl_alpha, & det_vgl_alpha, &
det_value_alpha, & det_value_alpha, &
det_adj_matrix_alpha, & det_adj_matrix_alpha, &
det_inv_matrix_alpha) & det_inv_matrix_alpha) &
bind(C) result(info) bind(C) result(info)
use, intrinsic :: iso_c_binding use, intrinsic :: iso_c_binding
implicit none implicit none
@ -1872,14 +1888,14 @@ end function qmckl_compute_det_inv_matrix_alpha_f
integer(c_int32_t), external :: qmckl_compute_det_inv_matrix_alpha_f integer(c_int32_t), external :: qmckl_compute_det_inv_matrix_alpha_f
info = qmckl_compute_det_inv_matrix_alpha_f & info = qmckl_compute_det_inv_matrix_alpha_f &
(context, & (context, &
det_num_alpha, & det_num_alpha, &
walk_num, & walk_num, &
alpha_num, & alpha_num, &
det_vgl_alpha, & det_vgl_alpha, &
det_value_alpha, & det_value_alpha, &
det_adj_matrix_alpha, & det_adj_matrix_alpha, &
det_inv_matrix_alpha) det_inv_matrix_alpha)
end function qmckl_compute_det_inv_matrix_alpha end function qmckl_compute_det_inv_matrix_alpha
#+end_src #+end_src
@ -1892,14 +1908,16 @@ end function qmckl_compute_det_inv_matrix_alpha_f
:END: :END:
#+NAME: qmckl_det_inv_matrix_beta_args #+NAME: qmckl_det_inv_matrix_beta_args
| ~qmckl_context~ | ~context~ | in | Global state | | Variable | Type | In/Out | Description |
| ~int64_t~ | ~det_num_beta~ | in | Number of determinants | |-----------------------+---------------------------------------------------------+--------+--------------------------------------------------------------|
| ~int64_t~ | ~walk_num~ | in | Number of walkers | | ~context~ | ~qmckl_context~ | in | Global state |
| ~int64_t~ | ~beta_num~ | in | Number of electrons | | ~det_num_beta~ | ~int64_t~ | in | Number of determinants |
| ~double~ | ~det_vgl_beta[det_num_beta][walk_num][5][beta_num][beta_num]~ | in | determinant matrix Value, gradients and Laplacian of the MOs | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| ~double~ | ~det_value_beta[det_num_beta][walk_num]~ | out | value of determinant matrix | | ~beta_num~ | ~int64_t~ | in | Number of electrons |
| ~double~ | ~det_adj_matrix_beta[det_num_beta][walk_num][beta_num][beta_num]~ | out | adjoint of determinant matrix | | ~det_vgl_beta~ | ~double[det_num_beta][walk_num][5][beta_num][beta_num]~ | in | determinant matrix Value, gradients and Laplacian of the MOs |
| ~double~ | ~det_inv_matrix_beta[det_num_beta][walk_num][beta_num][beta_num]~ | out | inverse of determinant matrix | | ~det_value_beta~ | ~double[det_num_beta][walk_num]~ | out | value of determinant matrix |
| ~det_adj_matrix_beta~ | ~double[det_num_beta][walk_num][beta_num][beta_num]~ | out | adjoint of determinant matrix |
| ~det_inv_matrix_beta~ | ~double[det_num_beta][walk_num][beta_num][beta_num]~ | out | inverse of determinant matrix |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_det_inv_matrix_beta_f(context, & integer function qmckl_compute_det_inv_matrix_beta_f(context, &
@ -1945,33 +1963,43 @@ integer function qmckl_compute_det_inv_matrix_beta_f(context, &
LDA = beta_num LDA = beta_num
do idet = 1, det_num_beta do idet = 1, det_num_beta
do iwalk = 1, walk_num do iwalk = 1, walk_num
! Value ! Value
matA(1:beta_num,1:beta_num) = det_vgl_beta(1:beta_num, 1:beta_num, 1, iwalk, idet) matA(1:beta_num,1:beta_num) = &
res = qmckl_adjugate(context, beta_num, LDA, matA, det_l) det_vgl_beta(1:beta_num, 1:beta_num, 1, iwalk, idet)
det_adj_matrix_beta(1:beta_num, 1:beta_num, iwalk, idet) = matA
det_inv_matrix_beta(1:beta_num, 1:beta_num, iwalk, idet) = matA/det_l res = qmckl_adjugate(context, &
det_value_beta(iwalk, idet) = det_l beta_num, matA, LDA, &
end do det_adj_matrix_beta(1, 1, iwalk, idet), &
int(size(det_adj_matrix_beta,1),8), &
det_l)
det_inv_matrix_beta(1:beta_num, 1:beta_num, iwalk, idet) = &
(1.d0/det_l) * &
det_adj_matrix_beta(1:beta_num, 1:beta_num, iwalk, idet)
det_value_beta(iwalk, idet) = det_l
end do
end do end do
deallocate(matA) deallocate(matA)
end function qmckl_compute_det_inv_matrix_beta_f end function qmckl_compute_det_inv_matrix_beta_f
#+end_src #+end_src
#+CALL: generate_c_header(table=qmckl_det_inv_matrix_beta_args,rettyp=get_value("CRetType"),fname="qmckl_compute_det_inv_matrix_beta")) #+CALL: generate_c_header(table=qmckl_det_inv_matrix_beta_args,rettyp=get_value("CRetType"),fname="qmckl_compute_det_inv_matrix_beta"))
#+RESULTS: #+RESULTS:
#+begin_src c :tangle (eval h_func) :comments org #+begin_src c :tangle (eval h_func) :comments org
qmckl_exit_code qmckl_compute_det_inv_matrix_beta ( qmckl_exit_code qmckl_compute_det_inv_matrix_beta (
const qmckl_context context, const qmckl_context context,
const int64_t det_num_beta, const int64_t det_num_beta,
const int64_t walk_num, const int64_t walk_num,
const int64_t beta_num, const int64_t beta_num,
const double* det_vgl_beta, const double* det_vgl_beta,
double* const det_value_beta, double* const det_value_beta,
double* const det_adj_matrix_beta, double* const det_adj_matrix_beta,
double* const det_inv_matrix_beta ); double* const det_inv_matrix_beta );
#+end_src #+end_src
#+CALL: generate_c_interface(table=qmckl_det_inv_matrix_beta_args,rettyp=get_value("CRetType"),fname="qmckl_compute_det_inv_matrix_beta")) #+CALL: generate_c_interface(table=qmckl_det_inv_matrix_beta_args,rettyp=get_value("CRetType"),fname="qmckl_compute_det_inv_matrix_beta"))
@ -1979,15 +2007,15 @@ end function qmckl_compute_det_inv_matrix_beta_f
#+RESULTS: #+RESULTS:
#+begin_src f90 :tangle (eval f) :comments org :exports none #+begin_src f90 :tangle (eval f) :comments org :exports none
integer(c_int32_t) function qmckl_compute_det_inv_matrix_beta & integer(c_int32_t) function qmckl_compute_det_inv_matrix_beta &
(context, & (context, &
det_num_beta, & det_num_beta, &
walk_num, & walk_num, &
beta_num, & beta_num, &
det_vgl_beta, & det_vgl_beta, &
det_value_beta, & det_value_beta, &
det_adj_matrix_beta, & det_adj_matrix_beta, &
det_inv_matrix_beta) & det_inv_matrix_beta) &
bind(C) result(info) bind(C) result(info)
use, intrinsic :: iso_c_binding use, intrinsic :: iso_c_binding
implicit none implicit none
@ -2003,20 +2031,19 @@ end function qmckl_compute_det_inv_matrix_beta_f
integer(c_int32_t), external :: qmckl_compute_det_inv_matrix_beta_f integer(c_int32_t), external :: qmckl_compute_det_inv_matrix_beta_f
info = qmckl_compute_det_inv_matrix_beta_f & info = qmckl_compute_det_inv_matrix_beta_f &
(context, & (context, &
det_num_beta, & det_num_beta, &
walk_num, & walk_num, &
beta_num, & beta_num, &
det_vgl_beta, & det_vgl_beta, &
det_value_beta, & det_value_beta, &
det_adj_matrix_beta, & det_adj_matrix_beta, &
det_inv_matrix_beta) det_inv_matrix_beta)
end function qmckl_compute_det_inv_matrix_beta end function qmckl_compute_det_inv_matrix_beta
#+end_src #+end_src
*** Test :noexport:
*** Test
#+begin_src c :tangle (eval c_test) :exports none #+begin_src c :tangle (eval c_test) :exports none
// Get adjoint of the slater-determinant // Get adjoint of the slater-determinant

View File

@ -40,19 +40,21 @@ int main() {
\] \]
#+NAME: qmckl_distance_sq_args #+NAME: qmckl_distance_sq_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| char | transa | in | Array ~A~ is ~'N'~: Normal, ~'T'~: Transposed | |-----------+------------------+--------+-----------------------------------------------|
| char | transb | in | Array ~B~ is ~'N'~: Normal, ~'T'~: Transposed | | ~context~ | ~qmckl_context~ | in | Global state |
| int64_t | m | in | Number of points in the first set | | ~transa~ | ~char~ | in | Array ~A~ is ~'N'~: Normal, ~'T'~: Transposed |
| int64_t | n | in | Number of points in the second set | | ~transb~ | ~char~ | in | Array ~B~ is ~'N'~: Normal, ~'T'~: Transposed |
| double | A[][lda] | in | Array containing the $m \times 3$ matrix $A$ | | ~m~ | ~int64_t~ | in | Number of points in the first set |
| int64_t | lda | in | Leading dimension of array ~A~ | | ~n~ | ~int64_t~ | in | Number of points in the second set |
| double | B[][ldb] | in | Array containing the $n \times 3$ matrix $B$ | | ~A~ | ~double[][lda]~ | in | Array containing the $m \times 3$ matrix $A$ |
| int64_t | ldb | in | Leading dimension of array ~B~ | | ~lda~ | ~int64_t~ | in | Leading dimension of array ~A~ |
| double | C[n][ldc] | out | Array containing the $m \times n$ matrix $C$ | | ~B~ | ~double[][ldb]~ | in | Array containing the $n \times 3$ matrix $B$ |
| int64_t | ldc | in | Leading dimension of array ~C~ | | ~ldb~ | ~int64_t~ | in | Leading dimension of array ~B~ |
| ~C~ | ~double[n][ldc]~ | out | Array containing the $m \times n$ matrix $C$ |
| ~ldc~ | ~int64_t~ | in | Leading dimension of array ~C~ |
*** Requirements Requirements:
- ~context~ is not ~QMCKL_NULL_CONTEXT~ - ~context~ is not ~QMCKL_NULL_CONTEXT~
- ~m > 0~ - ~m > 0~
@ -66,8 +68,6 @@ int main() {
- ~B~ is allocated with at least $3 \times n \times 8$ bytes - ~B~ is allocated with at least $3 \times n \times 8$ bytes
- ~C~ is allocated with at least $m \times n \times 8$ bytes - ~C~ is allocated with at least $m \times n \times 8$ bytes
*** C header
#+CALL: generate_c_header(table=qmckl_distance_sq_args,rettyp=get_value("CRetType"),fname=get_value("Name")) #+CALL: generate_c_header(table=qmckl_distance_sq_args,rettyp=get_value("CRetType"),fname=get_value("Name"))
#+RESULTS: #+RESULTS:
@ -86,7 +86,6 @@ int main() {
const int64_t ldc ); const int64_t ldc );
#+end_src #+end_src
*** Source
#+begin_src f90 :tangle (eval f) #+begin_src f90 :tangle (eval f)
integer function qmckl_distance_sq_f(context, transa, transb, m, n, & integer function qmckl_distance_sq_f(context, transa, transb, m, n, &
A, LDA, B, LDB, C, LDC) & A, LDA, B, LDB, C, LDC) &
@ -222,8 +221,6 @@ end function qmckl_distance_sq_f
This function is more efficient when ~A~ and ~B~ are This function is more efficient when ~A~ and ~B~ are
transposed. transposed.
** C interface :noexport:
#+CALL: generate_c_interface(table=qmckl_distance_sq_args,rettyp=get_value("FRetType"),fname=get_value("Name")) #+CALL: generate_c_interface(table=qmckl_distance_sq_args,rettyp=get_value("FRetType"),fname=get_value("Name"))
#+RESULTS: #+RESULTS:
@ -284,7 +281,6 @@ end function qmckl_distance_sq_f
*** Test :noexport: *** Test :noexport:
#+begin_src f90 :tangle (eval f_test) #+begin_src f90 :tangle (eval f_test)
integer(qmckl_exit_code) function test_qmckl_distance_sq(context) bind(C) integer(qmckl_exit_code) function test_qmckl_distance_sq(context) bind(C)
use qmckl use qmckl
@ -441,17 +437,19 @@ end function test_qmckl_distance_sq
the leading dimension: ~[n][3]~ in C and ~(3,n)~ in Fortran. the leading dimension: ~[n][3]~ in C and ~(3,n)~ in Fortran.
#+NAME: qmckl_distance_args #+NAME: qmckl_distance_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| char | transa | in | Array ~A~ is ~'N'~: Normal, ~'T'~: Transposed | |-----------+------------------+--------+-----------------------------------------------|
| char | transb | in | Array ~B~ is ~'N'~: Normal, ~'T'~: Transposed | | ~context~ | ~qmckl_context~ | in | Global state |
| int64_t | m | in | Number of points in the first set | | ~transa~ | ~char~ | in | Array ~A~ is ~'N'~: Normal, ~'T'~: Transposed |
| int64_t | n | in | Number of points in the second set | | ~transb~ | ~char~ | in | Array ~B~ is ~'N'~: Normal, ~'T'~: Transposed |
| double | A[][lda] | in | Array containing the $m \times 3$ matrix $A$ | | ~m~ | ~int64_t~ | in | Number of points in the first set |
| int64_t | lda | in | Leading dimension of array ~A~ | | ~n~ | ~int64_t~ | in | Number of points in the second set |
| double | B[][ldb] | in | Array containing the $n \times 3$ matrix $B$ | | ~A~ | ~double[][lda]~ | in | Array containing the $m \times 3$ matrix $A$ |
| int64_t | ldb | in | Leading dimension of array ~B~ | | ~lda~ | ~int64_t~ | in | Leading dimension of array ~A~ |
| double | C[n][ldc] | out | Array containing the $m \times n$ matrix $C$ | | ~B~ | ~double[][ldb]~ | in | Array containing the $n \times 3$ matrix $B$ |
| int64_t | ldc | in | Leading dimension of array ~C~ | | ~ldb~ | ~int64_t~ | in | Leading dimension of array ~B~ |
| ~C~ | ~double[n][ldc]~ | out | Array containing the $m \times n$ matrix $C$ |
| ~ldc~ | ~int64_t~ | in | Leading dimension of array ~C~ |
*** Requirements *** Requirements
@ -881,18 +879,20 @@ end function test_qmckl_dist
the leading dimension: ~[n][3]~ in C and ~(3,n)~ in Fortran. the leading dimension: ~[n][3]~ in C and ~(3,n)~ in Fortran.
#+NAME: qmckl_distance_rescaled_args #+NAME: qmckl_distance_rescaled_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| char | transa | in | Array ~A~ is ~'N'~: Normal, ~'T'~: Transposed | |------------------------+------------------+--------+-----------------------------------------------|
| char | transb | in | Array ~B~ is ~'N'~: Normal, ~'T'~: Transposed | | ~context~ | ~qmckl_context~ | in | Global state |
| int64_t | m | in | Number of points in the first set | | ~transa~ | ~char~ | in | Array ~A~ is ~'N'~: Normal, ~'T'~: Transposed |
| int64_t | n | in | Number of points in the second set | | ~transb~ | ~char~ | in | Array ~B~ is ~'N'~: Normal, ~'T'~: Transposed |
| double | A[][lda] | in | Array containing the $m \times 3$ matrix $A$ | | ~m~ | ~int64_t~ | in | Number of points in the first set |
| int64_t | lda | in | Leading dimension of array ~A~ | | ~n~ | ~int64_t~ | in | Number of points in the second set |
| double | B[][ldb] | in | Array containing the $n \times 3$ matrix $B$ | | ~A~ | ~double[][lda]~ | in | Array containing the $m \times 3$ matrix $A$ |
| int64_t | ldb | in | Leading dimension of array ~B~ | | ~lda~ | ~int64_t~ | in | Leading dimension of array ~A~ |
| double | C[n][ldc] | out | Array containing the $m \times n$ matrix $C$ | | ~B~ | ~double[][ldb]~ | in | Array containing the $n \times 3$ matrix $B$ |
| int64_t | ldc | in | Leading dimension of array ~C~ | | ~ldb~ | ~int64_t~ | in | Leading dimension of array ~B~ |
| double | rescale_factor_kappa | in | Factor for calculating rescaled distances | | ~C~ | ~double[n][ldc]~ | out | Array containing the $m \times n$ matrix $C$ |
| ~ldc~ | ~int64_t~ | in | Leading dimension of array ~C~ |
| ~rescale_factor_kappa~ | ~double~ | in | Factor for calculating rescaled distances |
*** Requirements *** Requirements
@ -926,7 +926,7 @@ end function test_qmckl_dist
const int64_t ldb, const int64_t ldb,
double* const C, double* const C,
const int64_t ldc, const int64_t ldc,
const double rescale_factor_kappa); const double rescale_factor_kappa );
#+end_src #+end_src
*** Source *** Source
@ -1215,20 +1215,22 @@ end function qmckl_distance_rescaled_f
the leading dimension: ~[n][3]~ in C and ~(3,n)~ in Fortran. the leading dimension: ~[n][3]~ in C and ~(3,n)~ in Fortran.
#+NAME: qmckl_distance_rescaled_deriv_e_args #+NAME: qmckl_distance_rescaled_deriv_e_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| char | transa | in | Array ~A~ is ~'N'~: Normal, ~'T'~: Transposed | |------------------------+---------------------+--------+-------------------------------------------------------|
| char | transb | in | Array ~B~ is ~'N'~: Normal, ~'T'~: Transposed | | ~context~ | ~qmckl_context~ | in | Global state |
| int64_t | m | in | Number of points in the first set | | ~transa~ | ~char~ | in | Array ~A~ is ~'N'~: Normal, ~'T'~: Transposed |
| int64_t | n | in | Number of points in the second set | | ~transb~ | ~char~ | in | Array ~B~ is ~'N'~: Normal, ~'T'~: Transposed |
| double | A[][lda] | in | Array containing the $m \times 3$ matrix $A$ | | ~m~ | ~int64_t~ | in | Number of points in the first set |
| int64_t | lda | in | Leading dimension of array ~A~ | | ~n~ | ~int64_t~ | in | Number of points in the second set |
| double | B[][ldb] | in | Array containing the $n \times 3$ matrix $B$ | | ~A~ | ~double[][lda]~ | in | Array containing the $m \times 3$ matrix $A$ |
| int64_t | ldb | in | Leading dimension of array ~B~ | | ~lda~ | ~int64_t~ | in | Leading dimension of array ~A~ |
| double | C[4][n][ldc] | out | Array containing the $4 \times m \times n$ matrix $C$ | | ~B~ | ~double[][ldb]~ | in | Array containing the $n \times 3$ matrix $B$ |
| int64_t | ldc | in | Leading dimension of array ~C~ | | ~ldb~ | ~int64_t~ | in | Leading dimension of array ~B~ |
| double | rescale_factor_kappa | in | Factor for calculating rescaled distances derivatives | | ~C~ | ~double[4][n][ldc]~ | out | Array containing the $4 \times m \times n$ matrix $C$ |
| ~ldc~ | ~int64_t~ | in | Leading dimension of array ~C~ |
| ~rescale_factor_kappa~ | ~double~ | in | Factor for calculating rescaled distances derivatives |
*** Requirements Requirements:
- ~context~ is not ~QMCKL_NULL_CONTEXT~ - ~context~ is not ~QMCKL_NULL_CONTEXT~
- ~m > 0~ - ~m > 0~
@ -1242,8 +1244,6 @@ end function qmckl_distance_rescaled_f
- ~B~ is allocated with at least $3 \times n \times 8$ bytes - ~B~ is allocated with at least $3 \times n \times 8$ bytes
- ~C~ is allocated with at least $4 \times m \times n \times 8$ bytes - ~C~ is allocated with at least $4 \times m \times n \times 8$ bytes
*** C header
#+CALL: generate_c_header(table=qmckl_distance_rescaled_deriv_e_args,rettyp=get_value("CRetType"),fname=get_value("Name")) #+CALL: generate_c_header(table=qmckl_distance_rescaled_deriv_e_args,rettyp=get_value("CRetType"),fname=get_value("Name"))
#+RESULTS: #+RESULTS:
@ -1260,10 +1260,9 @@ end function qmckl_distance_rescaled_f
const int64_t ldb, const int64_t ldb,
double* const C, double* const C,
const int64_t ldc, const int64_t ldc,
const double rescale_factor_kappa); const double rescale_factor_kappa );
#+end_src #+end_src
*** Source
#+begin_src f90 :tangle (eval f) #+begin_src f90 :tangle (eval f)
integer function qmckl_distance_rescaled_deriv_e_f(context, transa, transb, m, n, & integer function qmckl_distance_rescaled_deriv_e_f(context, transa, transb, m, n, &
A, LDA, B, LDB, C, LDC, rescale_factor_kappa) & A, LDA, B, LDB, C, LDC, rescale_factor_kappa) &
@ -1450,13 +1449,9 @@ integer function qmckl_distance_rescaled_deriv_e_f(context, transa, transb, m, n
end function qmckl_distance_rescaled_deriv_e_f end function qmckl_distance_rescaled_deriv_e_f
#+end_src #+end_src
*** Performance
This function is more efficient when ~A~ and ~B~ are transposed. This function is more efficient when ~A~ and ~B~ are transposed.
** C interface :noexport: #+CALL: generate_c_interface(table=qmckl_distance_rescaled_deriv_e_args,fname=get_value("Name"))
#+CALL: generate_c_interface(table=qmckl_distance_rescaled_deriv_e_args,rettyp=get_value("FRetType"),fname=get_value("Name"))
#+RESULTS: #+RESULTS:
#+begin_src f90 :tangle (eval f) :comments org :exports none #+begin_src f90 :tangle (eval f) :comments org :exports none
@ -1476,7 +1471,7 @@ end function qmckl_distance_rescaled_deriv_e_f
integer (c_int64_t) , intent(in) , value :: lda integer (c_int64_t) , intent(in) , value :: lda
real (c_double ) , intent(in) :: B(ldb,*) real (c_double ) , intent(in) :: B(ldb,*)
integer (c_int64_t) , intent(in) , value :: ldb integer (c_int64_t) , intent(in) , value :: ldb
real (c_double ) , intent(out) :: C(4,ldc,n) real (c_double ) , intent(out) :: C(ldc,n,4)
integer (c_int64_t) , intent(in) , value :: ldc integer (c_int64_t) , intent(in) , value :: ldc
real (c_double ) , intent(in) , value :: rescale_factor_kappa real (c_double ) , intent(in) , value :: rescale_factor_kappa
@ -1508,7 +1503,7 @@ end function qmckl_distance_rescaled_deriv_e_f
integer (c_int64_t) , intent(in) , value :: lda integer (c_int64_t) , intent(in) , value :: lda
real (c_double ) , intent(in) :: B(ldb,*) real (c_double ) , intent(in) :: B(ldb,*)
integer (c_int64_t) , intent(in) , value :: ldb integer (c_int64_t) , intent(in) , value :: ldb
real (c_double ) , intent(out) :: C(4,ldc,n) real (c_double ) , intent(out) :: C(ldc,n,4)
integer (c_int64_t) , intent(in) , value :: ldc integer (c_int64_t) , intent(in) , value :: ldc
real (c_double ) , intent(in) , value :: rescale_factor_kappa real (c_double ) , intent(in) , value :: rescale_factor_kappa

View File

@ -68,6 +68,7 @@ int main() {
The following data stored in the context: The following data stored in the context:
| Variable | Type | Description |
|---------------------------+----------------------------+-------------------------------------------| |---------------------------+----------------------------+-------------------------------------------|
| ~uninitialized~ | ~int32_t~ | Keeps bit set for uninitialized data | | ~uninitialized~ | ~int32_t~ | Keeps bit set for uninitialized data |
| ~num~ | ~int64_t~ | Total number of electrons | | ~num~ | ~int64_t~ | Total number of electrons |
@ -83,6 +84,7 @@ int main() {
Computed data: Computed data:
| Variable | Type | Description |
|-------------------------------------+--------------------------------------+----------------------------------------------------------------------| |-------------------------------------+--------------------------------------+----------------------------------------------------------------------|
| ~ee_distance~ | ~double[walk_num][num][num]~ | Electron-electron distances | | ~ee_distance~ | ~double[walk_num][num][num]~ | Electron-electron distances |
| ~ee_distance_date~ | ~uint64_t~ | Last modification date of the electron-electron distances | | ~ee_distance_date~ | ~uint64_t~ | Last modification date of the electron-electron distances |
@ -976,11 +978,13 @@ qmckl_exit_code qmckl_provide_ee_distance(qmckl_context context)
:END: :END:
#+NAME: qmckl_ee_distance_args #+NAME: qmckl_ee_distance_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | elec_num | in | Number of electrons | |---------------+----------------------------------------+--------+-----------------------------|
| int64_t | walk_num | in | Number of walkers | | ~context~ | ~qmckl_context~ | in | Global state |
| double | coord[walk_num][3][elec_num] | in | Electron coordinates | | ~elec_num~ | ~int64_t~ | in | Number of electrons |
| double | ee_distance[walk_num][elec_num][elec_num] | out | Electron-electron distances | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| ~coord~ | ~double[walk_num][3][elec_num]~ | in | Electron coordinates |
| ~ee_distance~ | ~double[walk_num][elec_num][elec_num]~ | out | Electron-electron distances |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_ee_distance_f(context, elec_num, walk_num, coord, ee_distance) & integer function qmckl_compute_ee_distance_f(context, elec_num, walk_num, coord, ee_distance) &
@ -1215,12 +1219,14 @@ qmckl_exit_code qmckl_provide_ee_distance_rescaled(qmckl_context context)
:END: :END:
#+NAME: qmckl_ee_distance_rescaled_args #+NAME: qmckl_ee_distance_rescaled_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | elec_num | in | Number of electrons | |----------------------------------------+---------------------------+--------+--------------------------------------|
| double | rescale_factor_kappa_ee | in | Factor to rescale ee distances | | ~context~ | ~qmckl_context~ | in | Global state |
| int64_t | walk_num | in | Number of walkers | | ~elec_num~ | ~int64_t~ | in | Number of electrons |
| double | coord[walk_num][3][elec_num] | in | Electron coordinates | | ~rescale_factor_kappa_ee~ | ~double~ | in | Factor to rescale ee distances |
| double | ee_distance[walk_num][elec_num][elec_num] | out | Electron-electron rescaled distances | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| ~coord~ | ~double[walk_num][3][elec_num]~ | in | Electron coordinates |
| ~ee_distance~ | ~double[walk_num][elec_num][elec_num]~ | out | Electron-electron rescaled distances |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_ee_distance_rescaled_f(context, elec_num, rescale_factor_kappa_ee, walk_num, & integer function qmckl_compute_ee_distance_rescaled_f(context, elec_num, rescale_factor_kappa_ee, walk_num, &
@ -1459,12 +1465,14 @@ qmckl_exit_code qmckl_provide_ee_distance_rescaled_deriv_e(qmckl_context context
:END: :END:
#+NAME: qmckl_ee_distance_rescaled_deriv_e_args #+NAME: qmckl_ee_distance_rescaled_deriv_e_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | elec_num | in | Number of electrons | |---------------------------+-------------------------------------------+--------+-------------------------------------------------|
| double | rescale_factor_kappa_ee | in | Factor to rescale ee distances | | ~context~ | ~qmckl_context~ | in | Global state |
| int64_t | walk_num | in | Number of walkers | | ~elec_num~ | ~int64_t~ | in | Number of electrons |
| double | coord[walk_num][3][elec_num] | in | Electron coordinates | | ~rescale_factor_kappa_ee~ | ~double~ | in | Factor to rescale ee distances |
| double | ee_distance_deriv_e[walk_num][4][elec_num][elec_num] | out | Electron-electron rescaled distance derivatives | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| ~coord~ | ~double[walk_num][3][elec_num]~ | in | Electron coordinates |
| ~ee_distance_deriv_e~ | ~double[walk_num][4][elec_num][elec_num]~ | out | Electron-electron rescaled distance derivatives |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_ee_distance_rescaled_deriv_e_f(context, elec_num, rescale_factor_kappa_ee, walk_num, & integer function qmckl_compute_ee_distance_rescaled_deriv_e_f(context, elec_num, rescale_factor_kappa_ee, walk_num, &
@ -1688,11 +1696,13 @@ qmckl_exit_code qmckl_provide_ee_potential(qmckl_context context)
:END: :END:
#+NAME: qmckl_ee_potential_args #+NAME: qmckl_ee_potential_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | elec_num | in | Number of electrons | |---------------+----------------------------------------+--------+--------------------------------------|
| int64_t | walk_num | in | Number of walkers | | ~context~ | ~qmckl_context~ | in | Global state |
| double | ee_distance[walk_num][elec_num][elec_num] | in | Electron-electron rescaled distances | | ~elec_num~ | ~int64_t~ | in | Number of electrons |
| double | ee_pot[walk_num] | out | Electron-electron potential | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| ~ee_distance~ | ~double[walk_num][elec_num][elec_num]~ | in | Electron-electron rescaled distances |
| ~ee_pot~ | ~double[walk_num]~ | out | Electron-electron potential |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_ee_potential_f(context, elec_num, walk_num, & integer function qmckl_compute_ee_potential_f(context, elec_num, walk_num, &
@ -1897,13 +1907,15 @@ qmckl_exit_code qmckl_provide_en_distance(qmckl_context context)
:END: :END:
#+NAME: qmckl_en_distance_args #+NAME: qmckl_en_distance_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | elec_num | in | Number of electrons | |---------------+----------------------------------------+--------+----------------------------|
| int64_t | nucl_num | in | Number of nuclei | | ~context~ | ~qmckl_context~ | in | Global state |
| int64_t | walk_num | in | Number of walkers | | ~elec_num~ | ~int64_t~ | in | Number of electrons |
| double | elec_coord[walk_num][3][elec_num] | in | Electron coordinates | | ~nucl_num~ | ~int64_t~ | in | Number of nuclei |
| double | nucl_coord[3][elec_num] | in | Nuclear coordinates | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| double | en_distance[walk_num][nucl_num][elec_num] | out | Electron-nucleus distances | | ~elec_coord~ | ~double[walk_num][3][elec_num]~ | in | Electron coordinates |
| ~nucl_coord~ | ~double[3][elec_num]~ | in | Nuclear coordinates |
| ~en_distance~ | ~double[walk_num][nucl_num][elec_num]~ | out | Electron-nucleus distances |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_en_distance_f(context, elec_num, nucl_num, walk_num, elec_coord, nucl_coord, en_distance) & integer function qmckl_compute_en_distance_f(context, elec_num, nucl_num, walk_num, elec_coord, nucl_coord, en_distance) &
@ -2170,15 +2182,17 @@ qmckl_exit_code qmckl_provide_en_distance_rescaled(qmckl_context context)
:FRetType: qmckl_exit_code :FRetType: qmckl_exit_code
:END: :END:
#+NAME: qmckl_en_distance_rescaled_args #+NAME: qmckl_en_distance_rescaled_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | elec_num | in | Number of electrons | |---------------------------+----------------------------------------+--------+-----------------------------------|
| int64_t | nucl_num | in | Number of nuclei | | ~context~ | ~qmckl_context~ | in | Global state |
| double | rescale_factor_kappa_en | in | The factor for rescaled distances | | ~elec_num~ | ~int64_t~ | in | Number of electrons |
| int64_t | walk_num | in | Number of walkers | | ~nucl_num~ | ~int64_t~ | in | Number of nuclei |
| double | elec_coord[walk_num][3][elec_num] | in | Electron coordinates | | ~rescale_factor_kappa_en~ | ~double~ | in | The factor for rescaled distances |
| double | nucl_coord[3][elec_num] | in | Nuclear coordinates | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| double | en_distance_rescaled_date[walk_num][nucl_num][elec_num] | out | Electron-nucleus distances | | ~elec_coord~ | ~double[walk_num][3][elec_num]~ | in | Electron coordinates |
| ~nucl_coord~ | ~double[3][elec_num]~ | in | Nuclear coordinates |
| ~en_distance_rescaled~ | ~double[walk_num][nucl_num][elec_num]~ | out | Electron-nucleus distances |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_en_distance_rescaled_f(context, elec_num, nucl_num, rescale_factor_kappa_en, walk_num, elec_coord, & integer function qmckl_compute_en_distance_rescaled_f(context, elec_num, nucl_num, rescale_factor_kappa_en, walk_num, elec_coord, &
@ -2457,14 +2471,16 @@ qmckl_exit_code qmckl_provide_en_distance_rescaled_deriv_e(qmckl_context context
:END: :END:
#+NAME: qmckl_en_distance_rescaled_deriv_e_args #+NAME: qmckl_en_distance_rescaled_deriv_e_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | elec_num | in | Number of electrons | |--------------------------------+-------------------------------------------+--------+---------------------------------------|
| int64_t | nucl_num | in | Number of nuclei | | ~context~ | ~qmckl_context~ | in | Global state |
| double | rescale_factor_kappa_en | in | The factor for rescaled distances | | ~elec_num~ | ~int64_t~ | in | Number of electrons |
| int64_t | walk_num | in | Number of walkers | | ~nucl_num~ | ~int64_t~ | in | Number of nuclei |
| double | elec_coord[walk_num][3][elec_num] | in | Electron coordinates | | ~rescale_factor_kappa_en~ | ~double~ | in | The factor for rescaled distances |
| double | nucl_coord[3][elec_num] | in | Nuclear coordinates | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| double | en_distance_rescaled_deriv_e_date[walk_num][4][nucl_num][elec_num] | out | Electron-nucleus distance derivatives | | ~elec_coord~ | ~double[walk_num][3][elec_num]~ | in | Electron coordinates |
| ~nucl_coord~ | ~double[3][elec_num]~ | in | Nuclear coordinates |
| ~en_distance_rescaled_deriv_e~ | ~double[walk_num][4][nucl_num][elec_num]~ | out | Electron-nucleus distance derivatives |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_en_distance_rescaled_deriv_e_f(context, elec_num, nucl_num, & integer function qmckl_compute_en_distance_rescaled_deriv_e_f(context, elec_num, nucl_num, &
@ -2726,13 +2742,15 @@ qmckl_exit_code qmckl_provide_en_potential(qmckl_context context)
:END: :END:
#+NAME: qmckl_en_potential_args #+NAME: qmckl_en_potential_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | elec_num | in | Number of electrons | |---------------+----------------------------------------+--------+--------------------------------------|
| int64_t | nucl_num | in | Number of nucleii | | ~context~ | ~qmckl_context~ | in | Global state |
| int64_t | walk_num | in | Number of walkers | | ~elec_num~ | ~int64_t~ | in | Number of electrons |
| double | charge[nucl_num] | in | charge of nucleus | | ~nucl_num~ | ~int64_t~ | in | Number of nucleii |
| double | en_distance[walk_num][nucl_num][elec_num] | in | Electron-electron rescaled distances | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| double | en_pot[walk_num] | out | Electron-electron potential | | ~charge~ | ~double[nucl_num]~ | in | charge of nucleus |
| ~en_distance~ | ~double[walk_num][nucl_num][elec_num]~ | in | Electron-electron rescaled distances |
| ~en_pot~ | ~double[walk_num]~ | out | Electron-electron potential |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_en_potential_f(context, elec_num, nucl_num, walk_num, & integer function qmckl_compute_en_potential_f(context, elec_num, nucl_num, walk_num, &

View File

@ -76,51 +76,53 @@ int main() {
The following data stored in the context: The following data stored in the context:
#+NAME: qmckl_jastrow_args #+NAME: qmckl_jastrow_args
|------------+--------------------------------------------+-----+-------------------------------------------------------------------| | Variable | Type | In/Out | Description |
| ~int32_t~ | ~uninitialized~ | in | Keeps bit set for uninitialized data | |---------------------------+---------------------------------------+--------+-------------------------------------------------------------------|
| ~int64_t~ | ~aord_num~ | in | The number of a coeffecients | | ~uninitialized~ | ~int32_t~ | in | Keeps bit set for uninitialized data |
| ~int64_t~ | ~bord_num~ | in | The number of b coeffecients | | ~aord_num~ | ~int64_t~ | in | The number of a coeffecients |
| ~int64_t~ | ~cord_num~ | in | The number of c coeffecients | | ~bord_num~ | ~int64_t~ | in | The number of b coeffecients |
| ~int64_t~ | ~type_nucl_num~ | in | Number of Nucleii types | | ~cord_num~ | ~int64_t~ | in | The number of c coeffecients |
| ~int64_t~ | ~type_nucl_vector[nucl_num]~ | in | IDs of types of Nucleii | | ~type_nucl_num~ | ~int64_t~ | in | Number of Nucleii types |
| ~double~ | ~aord_vector[aord_num + 1][type_nucl_num]~ | in | Order of a polynomial coefficients | | ~type_nucl_vector~ | ~int64_t[nucl_num]~ | in | IDs of types of Nucleii |
| ~double~ | ~bord_vector[bord_num + 1]~ | in | Order of b polynomial coefficients | | ~aord_vector~ | ~double[aord_num + 1][type_nucl_num]~ | in | Order of a polynomial coefficients |
| ~double~ | ~cord_vector[cord_num][type_nucl_num]~ | in | Order of c polynomial coefficients | | ~bord_vector~ | ~double[bord_num + 1]~ | in | Order of b polynomial coefficients |
| ~double~ | ~factor_ee[walk_num]~ | out | Jastrow factor: electron-electron part | | ~cord_vector~ | ~double[cord_num][type_nucl_num]~ | in | Order of c polynomial coefficients |
| ~uint64_t~ | ~factor_ee_date~ | out | Jastrow factor: electron-electron part | | ~factor_ee~ | ~double[walk_num]~ | out | Jastrow factor: electron-electron part |
| ~double~ | ~factor_en[walk_num]~ | out | Jastrow factor: electron-nucleus part | | ~factor_ee_date~ | ~uint64_t~ | out | Jastrow factor: electron-electron part |
| ~uint64_t~ | ~factor_en_date~ | out | Jastrow factor: electron-nucleus part | | ~factor_en~ | ~double[walk_num]~ | out | Jastrow factor: electron-nucleus part |
| ~double~ | ~factor_een[walk_num]~ | out | Jastrow factor: electron-electron-nucleus part | | ~factor_en_date~ | ~uint64_t~ | out | Jastrow factor: electron-nucleus part |
| ~uint64_t~ | ~factor_een_date~ | out | Jastrow factor: electron-electron-nucleus part | | ~factor_een~ | ~double[walk_num]~ | out | Jastrow factor: electron-electron-nucleus part |
| ~double~ | ~factor_ee_deriv_e[4][nelec][walk_num]~ | out | Derivative of the Jastrow factor: electron-electron-nucleus part | | ~factor_een_date~ | ~uint64_t~ | out | Jastrow factor: electron-electron-nucleus part |
| ~uint64_t~ | ~factor_ee_deriv_e_date~ | out | Keep track of the date for the derivative | | ~factor_ee_deriv_e~ | ~double[4][nelec][walk_num]~ | out | Derivative of the Jastrow factor: electron-electron-nucleus part |
| ~double~ | ~factor_en_deriv_e[4][nelec][walk_num]~ | out | Derivative of the Jastrow factor: electron-electron-nucleus part | | ~factor_ee_deriv_e_date~ | ~uint64_t~ | out | Keep track of the date for the derivative |
| ~uint64_t~ | ~factor_en_deriv_e_date~ | out | Keep track of the date for the en derivative | | ~factor_en_deriv_e~ | ~double[4][nelec][walk_num]~ | out | Derivative of the Jastrow factor: electron-electron-nucleus part |
| ~double~ | ~factor_een_deriv_e[4][nelec][walk_num]~ | out | Derivative of the Jastrow factor: electron-electron-nucleus part | | ~factor_en_deriv_e_date~ | ~uint64_t~ | out | Keep track of the date for the en derivative |
| ~uint64_t~ | ~factor_een_deriv_e_date~ | out | Keep track of the date for the een derivative | | ~factor_een_deriv_e~ | ~double[4][nelec][walk_num]~ | out | Derivative of the Jastrow factor: electron-electron-nucleus part |
| ~factor_een_deriv_e_date~ | ~uint64_t~ | out | Keep track of the date for the een derivative |
computed data: computed data:
|------------+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------| | Variable | Type | In/Out | Description |
| ~int64_t~ | ~dim_cord_vect~ | Number of unique C coefficients | |------------+-----------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------+-------------|
| ~uint64_t~ | ~dim_cord_vect_date~ | Number of unique C coefficients | | ~dim_cord_vect~ | ~int64_t~ | Number of unique C coefficients | |
| ~double~ | ~asymp_jasb[2]~ | Asymptotic component | | ~dim_cord_vect_date~ | ~uint64_t~ | Number of unique C coefficients | |
| ~uint64_t~ | ~asymp_jasb_date~ | Asymptotic component | | ~asymp_jasb~ | ~double[2]~ | Asymptotic component | |
| ~double~ | ~cord_vect_full[dim_cord_vect][nucl_num]~ | vector of non-zero coefficients | | ~asymp_jasb_date~ | ~uint64_t~ | Asymptotic component | |
| ~uint64_t~ | ~cord_vect_full_date~ | Keep track of changes here | | ~cord_vect_full~ | ~double[dim_cord_vect][nucl_num]~ | vector of non-zero coefficients | |
| ~int64_t~ | ~lkpm_combined_index[4][dim_cord_vect]~ | Transform l,k,p, and m into consecutive indices | | ~cord_vect_full_date~ | ~uint64_t~ | Keep track of changes here | |
| ~uint64_t~ | ~lkpm_combined_index_date~ | Transform l,k,p, and m into consecutive indices | | ~lkpm_combined_index~ | ~int64_t[4][dim_cord_vect]~ | Transform l,k,p, and m into consecutive indices | |
| ~double~ | ~tmp_c[elec_num][nucl_num][ncord + 1][ncord][walk_num]~ | vector of non-zero coefficients | | ~lkpm_combined_index_date~ | ~uint64_t~ | Transform l,k,p, and m into consecutive indices | |
| ~double~ | ~dtmp_c[elec_num][4][nucl_num][ncord + 1][ncord][walk_num]~ | vector of non-zero coefficients | | ~tmp_c~ | ~double[elec_num][nucl_num][ncord + 1][ncord][walk_num]~ | vector of non-zero coefficients | |
| ~double~ | ~een_rescaled_e[walk_num][elec_num][elec_num][0:cord_num]~ | The electron-electron rescaled distances raised to the powers defined by cord | | ~dtmp_c~ | ~double[elec_num][4][nucl_num][ncord + 1][ncord][walk_num]~ | vector of non-zero coefficients | |
| ~uint64_t~ | ~een_rescaled_e_date~ | Keep track of the date of creation | | ~een_rescaled_e~ | ~double[walk_num][elec_num][elec_num][0:cord_num]~ | The electron-electron rescaled distances raised to the powers defined by cord | |
| ~double~ | ~een_rescaled_n[walk_num][elec_num][nucl_num][0:cord_num]~ | The electron-electron rescaled distances raised to the powers defined by cord | | ~een_rescaled_e_date~ | ~uint64_t~ | Keep track of the date of creation | |
| ~uint64_t~ | ~een_rescaled_n_date~ | Keep track of the date of creation | | ~een_rescaled_n~ | ~double[walk_num][elec_num][nucl_num][0:cord_num]~ | The electron-electron rescaled distances raised to the powers defined by cord | |
| ~double~ | ~een_rescaled_e_deriv_e[walk_num][elec_num][4][elec_num][0:cord_num]~ | The electron-electron rescaled distances raised to the powers defined by cord derivatives wrt electrons | | ~een_rescaled_n_date~ | ~uint64_t~ | Keep track of the date of creation | |
| ~uint64_t~ | ~een_rescaled_e_deriv_e_date~ | Keep track of the date of creation | | ~een_rescaled_e_deriv_e~ | ~double[walk_num][elec_num][4][elec_num][0:cord_num]~ | The electron-electron rescaled distances raised to the powers defined by cord derivatives wrt electrons | |
| ~double~ | ~een_rescaled_n_deriv_e[walk_num][elec_num][4][nucl_num][0:cord_num]~ | The electron-electron rescaled distances raised to the powers defined by cord derivatives wrt electrons | | ~een_rescaled_e_deriv_e_date~ | ~uint64_t~ | Keep track of the date of creation | |
| ~uint64_t~ | ~een_rescaled_n_deriv_e_date~ | Keep track of the date of creation | | ~een_rescaled_n_deriv_e~ | ~double[walk_num][elec_num][4][nucl_num][0:cord_num]~ | The electron-electron rescaled distances raised to the powers defined by cord derivatives wrt electrons | |
| ~een_rescaled_n_deriv_e_date~ | ~uint64_t~ | Keep track of the date of creation | |
For H2O we have the following data: For H2O we have the following data:
@ -1282,11 +1284,13 @@ qmckl_exit_code qmckl_provide_asymp_jasb(qmckl_context context)
:END: :END:
#+NAME: qmckl_asymp_jasb_args #+NAME: qmckl_asymp_jasb_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | bord_num | in | Number of electrons | |---------------------------+----------------------+--------+-----------------------------|
| double | bord_vector[bord_num + 1] | in | Number of walkers | | ~context~ | ~qmckl_context~ | in | Global state |
| double | rescale_factor_kappa_ee | in | Electron coordinates | | ~bord_num~ | ~int64_t~ | in | Number of electrons |
| double | asymp_jasb[2] | out | Electron-electron distances | | ~bord_vector~ | ~double[bord_num+1]~ | in | Number of walkers |
| ~rescale_factor_kappa_ee~ | ~double~ | in | Electron coordinates |
| ~asymp_jasb~ | ~double[2]~ | out | Electron-electron distances |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_asymp_jasb_f(context, bord_num, bord_vector, rescale_factor_kappa_ee, asymp_jasb) & integer function qmckl_compute_asymp_jasb_f(context, bord_num, bord_vector, rescale_factor_kappa_ee, asymp_jasb) &
@ -1544,15 +1548,17 @@ qmckl_exit_code qmckl_provide_factor_ee(qmckl_context context)
:END: :END:
#+NAME: qmckl_factor_ee_args #+NAME: qmckl_factor_ee_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | walk_num | in | Number of walkers | |------------------------+----------------------------------------+--------+-----------------------------|
| int64_t | elec_num | in | Number of electrons | | ~context~ | ~qmckl_context~ | in | Global state |
| int64_t | up_num | in | Number of alpha electrons | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| int64_t | bord_num | in | Number of coefficients | | ~elec_num~ | ~int64_t~ | in | Number of electrons |
| double | bord_vector[bord_num + 1] | in | List of coefficients | | ~up_num~ | ~int64_t~ | in | Number of alpha electrons |
| double | ee_distance_rescaled[walk_num][elec_num][elec_num] | in | Electron-electron distances | | ~bord_num~ | ~int64_t~ | in | Number of coefficients |
| double | asymp_jasb[2] | in | Electron-electron distances | | ~bord_vector~ | ~double[bord_num+1]~ | in | List of coefficients |
| double | factor_ee[walk_num] | out | Electron-electron distances | | ~ee_distance_rescaled~ | ~double[walk_num][elec_num][elec_num]~ | in | Electron-electron distances |
| ~asymp_jasb~ | ~double[2]~ | in | Electron-electron distances |
| ~factor_ee~ | ~double[walk_num]~ | out | Electron-electron distances |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_factor_ee_f(context, walk_num, elec_num, up_num, bord_num, & integer function qmckl_compute_factor_ee_f(context, walk_num, elec_num, up_num, bord_num, &
@ -1848,16 +1854,18 @@ qmckl_exit_code qmckl_provide_factor_ee_deriv_e(qmckl_context context)
:END: :END:
#+NAME: qmckl_factor_ee_deriv_e_args #+NAME: qmckl_factor_ee_deriv_e_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | walk_num | in | Number of walkers | |--------------------------------+-------------------------------------------+--------+-----------------------------|
| int64_t | elec_num | in | Number of electrons | | ~context~ | ~qmckl_context~ | in | Global state |
| int64_t | up_num | in | Number of alpha electrons | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| int64_t | bord_num | in | Number of coefficients | | ~elec_num~ | ~int64_t~ | in | Number of electrons |
| double | bord_vector[bord_num + 1] | in | List of coefficients | | ~up_num~ | ~int64_t~ | in | Number of alpha electrons |
| double | ee_distance_rescaled[walk_num][elec_num][elec_num] | in | Electron-electron distances | | ~bord_num~ | ~int64_t~ | in | Number of coefficients |
| double | ee_distance_rescaled_deriv_e[walk_num][4][elec_num][elec_num] | in | Electron-electron distances | | ~bord_vector~ | ~double[bord_num+1]~ | in | List of coefficients |
| double | asymp_jasb[2] | in | Electron-electron distances | | ~ee_distance_rescaled~ | ~double[walk_num][elec_num][elec_num]~ | in | Electron-electron distances |
| double | factor_ee_deriv_e[walk_num][4][elec_num] | out | Electron-electron distances | | ~ee_distance_rescaled_deriv_e~ | ~double[walk_num][4][elec_num][elec_num]~ | in | Electron-electron distances |
| ~asymp_jasb~ | ~double[2]~ | in | Electron-electron distances |
| ~factor_ee_deriv_e~ | ~double[walk_num][4][elec_num]~ | out | Electron-electron distances |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_factor_ee_deriv_e_f(context, walk_num, elec_num, up_num, bord_num, & integer function qmckl_compute_factor_ee_deriv_e_f(context, walk_num, elec_num, up_num, bord_num, &
@ -2254,16 +2262,18 @@ qmckl_exit_code qmckl_provide_factor_en(qmckl_context context)
:END: :END:
#+NAME: qmckl_factor_en_args #+NAME: qmckl_factor_en_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | walk_num | in | Number of walkers | |------------------------+----------------------------------------+--------+----------------------------|
| int64_t | elec_num | in | Number of electrons | | ~context~ | ~qmckl_context~ | in | Global state |
| int64_t | nucl_num | in | Number of nucleii | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| int64_t | type_nucl_num | in | Number of unique nuclei | | ~elec_num~ | ~int64_t~ | in | Number of electrons |
| int64_t | type_nucl_vector[nucl_num] | in | IDs of unique nucleii | | ~nucl_num~ | ~int64_t~ | in | Number of nucleii |
| int64_t | aord_num | in | Number of coefficients | | ~type_nucl_num~ | ~int64_t~ | in | Number of unique nuclei |
| double | aord_vector[aord_num + 1][type_nucl_num] | in | List of coefficients | | ~type_nucl_vector~ | ~int64_t[nucl_num]~ | in | IDs of unique nucleii |
| double | en_distance_rescaled[walk_num][nucl_num][elec_num] | in | Electron-nucleus distances | | ~aord_num~ | ~int64_t~ | in | Number of coefficients |
| double | factor_en[walk_num] | out | Electron-nucleus jastrow | | ~aord_vector~ | ~double[aord_num+1][type_nucl_num]~ | in | List of coefficients |
| ~en_distance_rescaled~ | ~double[walk_num][nucl_num][elec_num]~ | in | Electron-nucleus distances |
| ~factor_en~ | ~double[walk_num]~ | out | Electron-nucleus jastrow |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_factor_en_f(context, walk_num, elec_num, nucl_num, type_nucl_num, & integer function qmckl_compute_factor_en_f(context, walk_num, elec_num, nucl_num, type_nucl_num, &
@ -2549,17 +2559,19 @@ qmckl_exit_code qmckl_provide_factor_en_deriv_e(qmckl_context context)
:END: :END:
#+NAME: qmckl_factor_en_deriv_e_args #+NAME: qmckl_factor_en_deriv_e_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | walk_num | in | Number of walkers | |--------------------------------+-------------------------------------------+--------+---------------------------------------|
| int64_t | elec_num | in | Number of electrons | | ~context~ | ~qmckl_context~ | in | Global state |
| int64_t | nucl_num | in | Number of nucleii | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| int64_t | type_nucl_num | in | Number of unique nuclei | | ~elec_num~ | ~int64_t~ | in | Number of electrons |
| int64_t | type_nucl_vector[nucl_num] | in | IDs of unique nucleii | | ~nucl_num~ | ~int64_t~ | in | Number of nucleii |
| int64_t | aord_num | in | Number of coefficients | | ~type_nucl_num~ | ~int64_t~ | in | Number of unique nuclei |
| double | aord_vector[aord_num + 1][type_nucl_num] | in | List of coefficients | | ~type_nucl_vector~ | ~int64_t[nucl_num]~ | in | IDs of unique nucleii |
| double | en_distance_rescaled[walk_num][nucl_num][elec_num] | in | Electron-nucleus distances | | ~aord_num~ | ~int64_t~ | in | Number of coefficients |
| double | en_distance_rescaled_deriv_e[walk_num][4][nucl_num][elec_num] | in | Electron-nucleus distance derivatives | | ~aord_vector~ | ~double[aord_num+1][type_nucl_num]~ | in | List of coefficients |
| double | factor_en_deriv_e[walk_num][4][elec_num] | out | Electron-nucleus jastrow | | ~en_distance_rescaled~ | ~double[walk_num][nucl_num][elec_num]~ | in | Electron-nucleus distances |
| ~en_distance_rescaled_deriv_e~ | ~double[walk_num][4][nucl_num][elec_num]~ | in | Electron-nucleus distance derivatives |
| ~factor_en_deriv_e~ | ~double[walk_num][4][elec_num]~ | out | Electron-nucleus jastrow |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_factor_en_deriv_e_f(context, walk_num, elec_num, nucl_num, type_nucl_num, & integer function qmckl_compute_factor_en_deriv_e_f(context, walk_num, elec_num, nucl_num, type_nucl_num, &
@ -2949,13 +2961,15 @@ qmckl_exit_code qmckl_provide_een_rescaled_e(qmckl_context context)
:END: :END:
#+NAME: qmckl_factor_een_rescaled_e_args #+NAME: qmckl_factor_een_rescaled_e_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | walk_num | in | Number of walkers | |---------------------------+----------------------------------------------------+--------+--------------------------------------|
| int64_t | elec_num | in | Number of electrons | | ~context~ | ~qmckl_context~ | in | Global state |
| int64_t | cord_num | in | Order of polynomials | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| double | rescale_factor_kappa_ee | in | Factor to rescale ee distances | | ~elec_num~ | ~int64_t~ | in | Number of electrons |
| double | ee_distance[walk_num][elec_num][elec_num] | in | Electron-electron distances | | ~cord_num~ | ~int64_t~ | in | Order of polynomials |
| double | een_rescaled_e[walk_num][elec_num][elec_num][0:cord_num] | out | Electron-electron rescaled distances | | ~rescale_factor_kappa_ee~ | ~double~ | in | Factor to rescale ee distances |
| ~ee_distance~ | ~double[walk_num][elec_num][elec_num]~ | in | Electron-electron distances |
| ~een_rescaled_e~ | ~double[walk_num][elec_num][elec_num][0:cord_num]~ | out | Electron-electron rescaled distances |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_een_rescaled_e_f(context, walk_num, elec_num, cord_num, rescale_factor_kappa_ee, & integer function qmckl_compute_een_rescaled_e_f(context, walk_num, elec_num, cord_num, rescale_factor_kappa_ee, &
@ -3269,15 +3283,17 @@ qmckl_exit_code qmckl_provide_een_rescaled_e_deriv_e(qmckl_context context)
:END: :END:
#+NAME: qmckl_factor_een_rescaled_e_deriv_e_args #+NAME: qmckl_factor_een_rescaled_e_deriv_e_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | walk_num | in | Number of walkers | |---------------------------+-------------------------------------------------------+--------+--------------------------------------|
| int64_t | elec_num | in | Number of electrons | | ~context~ | ~qmckl_context~ | in | Global state |
| int64_t | cord_num | in | Order of polynomials | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| double | rescale_factor_kappa_ee | in | Factor to rescale ee distances | | ~elec_num~ | ~int64_t~ | in | Number of electrons |
| double | coord_new[walk_num][3][elec_num] | in | Electron coordinates | | ~cord_num~ | ~int64_t~ | in | Order of polynomials |
| double | ee_distance[walk_num][elec_num][elec_num] | in | Electron-electron distances | | ~rescale_factor_kappa_ee~ | ~double~ | in | Factor to rescale ee distances |
| double | een_rescaled_e[walk_num][elec_num][elec_num][0:cord_num] | in | Electron-electron distances | | ~coord_new~ | ~double[walk_num][3][elec_num]~ | in | Electron coordinates |
| double | een_rescaled_e_deriv_e[walk_num][elec_num][4][elec_num][0:cord_num] | out | Electron-electron rescaled distances | | ~ee_distance~ | ~double[walk_num][elec_num][elec_num]~ | in | Electron-electron distances |
| ~een_rescaled_e~ | ~double[walk_num][elec_num][elec_num][0:cord_num]~ | in | Electron-electron distances |
| ~een_rescaled_e_deriv_e~ | ~double[walk_num][elec_num][4][elec_num][0:cord_num]~ | out | Electron-electron rescaled distances |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_factor_een_rescaled_e_deriv_e_f(context, walk_num, elec_num, cord_num, rescale_factor_kappa_ee, & integer function qmckl_compute_factor_een_rescaled_e_deriv_e_f(context, walk_num, elec_num, cord_num, rescale_factor_kappa_ee, &
@ -3626,14 +3642,16 @@ qmckl_exit_code qmckl_provide_een_rescaled_n(qmckl_context context)
:END: :END:
#+NAME: qmckl_factor_een_rescaled_n_args #+NAME: qmckl_factor_een_rescaled_n_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | walk_num | in | Number of walkers | |---------------------------+----------------------------------------------------+--------+-------------------------------------|
| int64_t | elec_num | in | Number of electrons | | ~context~ | ~qmckl_context~ | in | Global state |
| int64_t | nucl_num | in | Number of atoms | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| int64_t | cord_num | in | Order of polynomials | | ~elec_num~ | ~int64_t~ | in | Number of electrons |
| double | rescale_factor_kappa_en | in | Factor to rescale ee distances | | ~nucl_num~ | ~int64_t~ | in | Number of atoms |
| double | en_distance[walk_num][elec_num][nucl_num] | in | Electron-nucleus distances | | ~cord_num~ | ~int64_t~ | in | Order of polynomials |
| double | een_rescaled_n[walk_num][elec_num][nucl_num][0:cord_num] | out | Electron-nucleus rescaled distances | | ~rescale_factor_kappa_en~ | ~double~ | in | Factor to rescale ee distances |
| ~en_distance~ | ~double[walk_num][elec_num][nucl_num]~ | in | Electron-nucleus distances |
| ~een_rescaled_n~ | ~double[walk_num][elec_num][nucl_num][0:cord_num]~ | out | Electron-nucleus rescaled distances |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_een_rescaled_n_f(context, walk_num, elec_num, nucl_num, cord_num, rescale_factor_kappa_en, & integer function qmckl_compute_een_rescaled_n_f(context, walk_num, elec_num, nucl_num, cord_num, rescale_factor_kappa_en, &
@ -3930,17 +3948,19 @@ qmckl_exit_code qmckl_provide_een_rescaled_n_deriv_e(qmckl_context context)
:END: :END:
#+NAME: qmckl_compute_factor_een_rescaled_n_deriv_e_args #+NAME: qmckl_compute_factor_een_rescaled_n_deriv_e_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | walk_num | in | Number of walkers | |---------------------------+-------------------------------------------------------+--------+-------------------------------------|
| int64_t | elec_num | in | Number of electrons | | ~context~ | ~qmckl_context~ | in | Global state |
| int64_t | nucl_num | in | Number of atoms | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| int64_t | cord_num | in | Order of polynomials | | ~elec_num~ | ~int64_t~ | in | Number of electrons |
| double | rescale_factor_kappa_en | in | Factor to rescale ee distances | | ~nucl_num~ | ~int64_t~ | in | Number of atoms |
| double | coord_new[walk_num][3][elec_num] | in | Electron coordinates | | ~cord_num~ | ~int64_t~ | in | Order of polynomials |
| double | coord[3][nucl_num] | in | Nuclear coordinates | | ~rescale_factor_kappa_en~ | ~double~ | in | Factor to rescale ee distances |
| double | en_distance[walk_num][elec_num][nucl_num] | in | Electron-nucleus distances | | ~coord_new~ | ~double[walk_num][3][elec_num]~ | in | Electron coordinates |
| double | een_rescaled_n[walk_num][elec_num][nucl_num][0:cord_num] | in | Electron-nucleus distances | | ~coord~ | ~double[3][nucl_num]~ | in | Nuclear coordinates |
| double | een_rescaled_n_deriv_e[walk_num][elec_num][4][nucl_num][0:cord_num] | out | Electron-nucleus rescaled distances | | ~en_distance~ | ~double[walk_num][elec_num][nucl_num]~ | in | Electron-nucleus distances |
| ~een_rescaled_n~ | ~double[walk_num][elec_num][nucl_num][0:cord_num]~ | in | Electron-nucleus distances |
| ~een_rescaled_n_deriv_e~ | ~double[walk_num][elec_num][4][nucl_num][0:cord_num]~ | out | Electron-nucleus rescaled distances |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_factor_een_rescaled_n_deriv_e_f(context, walk_num, elec_num, nucl_num, & integer function qmckl_compute_factor_een_rescaled_n_deriv_e_f(context, walk_num, elec_num, nucl_num, &
@ -4409,9 +4429,11 @@ qmckl_exit_code qmckl_provide_lkpm_combined_index(qmckl_context context)
:END: :END:
#+NAME: qmckl_factor_dim_cord_vect_args #+NAME: qmckl_factor_dim_cord_vect_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | cord_num | in | Order of polynomials | |-----------------+-----------------+--------+-----------------------------------|
| int64_t | dim_cord_vect | out | dimension of cord_vect_full table | | ~context~ | ~qmckl_context~ | in | Global state |
| ~cord_num~ | ~int64_t~ | in | Order of polynomials |
| ~dim_cord_vect~ | ~int64_t~ | out | dimension of cord_vect_full table |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_dim_cord_vect_f(context, cord_num, dim_cord_vect) & integer function qmckl_compute_dim_cord_vect_f(context, cord_num, dim_cord_vect) &
@ -4496,13 +4518,15 @@ end function qmckl_compute_dim_cord_vect_f
:END: :END:
#+NAME: qmckl_factor_cord_vect_full_args #+NAME: qmckl_factor_cord_vect_full_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | nucl_num | in | Number of atoms | |--------------------+----------------------------------------+--------+------------------------------|
| int64_t | dim_cord_vect | in | dimension of cord full table | | ~context~ | ~qmckl_context~ | in | Global state |
| int64_t | type_nucl_num | in | dimension of cord full table | | ~nucl_num~ | ~int64_t~ | in | Number of atoms |
| int64_t | type_nucl_vector[nucl_num] | in | dimension of cord full table | | ~dim_cord_vect~ | ~int64_t~ | in | dimension of cord full table |
| double | cord_vector[dim_cord_vect][type_nucl_num] | in | dimension of cord full table | | ~type_nucl_num~ | ~int64_t~ | in | dimension of cord full table |
| double | cord_vect_full[dim_cord_vect][nucl_num] | out | Full list of coefficients | | ~type_nucl_vector~ | ~int64_t[nucl_num]~ | in | dimension of cord full table |
| ~cord_vector~ | ~double[dim_cord_vect][type_nucl_num]~ | in | dimension of cord full table |
| ~cord_vect_full~ | ~double[dim_cord_vect][nucl_num]~ | out | Full list of coefficients |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_cord_vect_full_f(context, nucl_num, dim_cord_vect, type_nucl_num, & integer function qmckl_compute_cord_vect_full_f(context, nucl_num, dim_cord_vect, type_nucl_num, &
@ -4599,10 +4623,12 @@ end function qmckl_compute_cord_vect_full_f
:END: :END:
#+NAME: qmckl_factor_lkpm_combined_index_args #+NAME: qmckl_factor_lkpm_combined_index_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | cord_num | in | Order of polynomials | |-----------------------+-----------------------------+--------+-------------------------------|
| int64_t | dim_cord_vect | in | dimension of cord full table | | ~context~ | ~qmckl_context~ | in | Global state |
| int64_t | lpkm_combined_index[4][dim_cord_vect] | out | Full list of combined indices | | ~cord_num~ | ~int64_t~ | in | Order of polynomials |
| ~dim_cord_vect~ | ~int64_t~ | in | dimension of cord full table |
| ~lpkm_combined_index~ | ~int64_t[4][dim_cord_vect]~ | out | Full list of combined indices |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_lkpm_combined_index_f(context, cord_num, dim_cord_vect, & integer function qmckl_compute_lkpm_combined_index_f(context, cord_num, dim_cord_vect, &
@ -4887,17 +4913,19 @@ qmckl_exit_code qmckl_provide_factor_een(qmckl_context context)
:END: :END:
#+NAME: qmckl_factor_een_args #+NAME: qmckl_factor_een_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | walk_num | in | Number of walkers | |-----------------------+----------------------------------------------------+--------+--------------------------------------|
| int64_t | elec_num | in | Number of electrons | | ~context~ | ~qmckl_context~ | in | Global state |
| int64_t | nucl_num | in | Number of nucleii | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| int64_t | cord_num | in | order of polynomials | | ~elec_num~ | ~int64_t~ | in | Number of electrons |
| int64_t | dim_cord_vect | in | dimension of full coefficient vector | | ~nucl_num~ | ~int64_t~ | in | Number of nucleii |
| double | cord_vect_full[dim_cord_vect][nucl_num] | in | full coefficient vector | | ~cord_num~ | ~int64_t~ | in | order of polynomials |
| int64_t | lkpm_combined_index[4][dim_cord_vect] | in | combined indices | | ~dim_cord_vect~ | ~int64_t~ | in | dimension of full coefficient vector |
| double | een_rescaled_e[walk_num][elec_num][elec_num][0:cord_num] | in | Electron-nucleus rescaled | | ~cord_vect_full~ | ~double[dim_cord_vect][nucl_num]~ | in | full coefficient vector |
| double | een_rescaled_n[walk_num][elec_num][nucl_num][0:cord_num] | in | Electron-nucleus rescaled factor | | ~lkpm_combined_index~ | ~int64_t[4][dim_cord_vect]~ | in | combined indices |
| double | factor_een[walk_num] | out | Electron-nucleus jastrow | | ~een_rescaled_e~ | ~double[walk_num][elec_num][elec_num][0:cord_num]~ | in | Electron-nucleus rescaled |
| ~een_rescaled_n~ | ~double[walk_num][elec_num][nucl_num][0:cord_num]~ | in | Electron-nucleus rescaled factor |
| ~factor_een~ | ~double[walk_num]~ | out | Electron-nucleus jastrow |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_factor_een_f(context, walk_num, elec_num, nucl_num, cord_num, dim_cord_vect, & integer function qmckl_compute_factor_een_f(context, walk_num, elec_num, nucl_num, cord_num, dim_cord_vect, &
@ -5218,19 +5246,21 @@ qmckl_exit_code qmckl_provide_factor_een_deriv_e(qmckl_context context)
:END: :END:
#+NAME: qmckl_factor_een_deriv_e_args #+NAME: qmckl_factor_een_deriv_e_args
| qmckl_context | context | in | Global state | | Variable | Type | In/Out | Description |
| int64_t | walk_num | in | Number of walkers | |--------------------------+-------------------------------------------------------+--------+--------------------------------------|
| int64_t | elec_num | in | Number of electrons | | ~context~ | ~qmckl_context~ | in | Global state |
| int64_t | nucl_num | in | Number of nucleii | | ~walk_num~ | ~int64_t~ | in | Number of walkers |
| int64_t | cord_num | in | order of polynomials | | ~elec_num~ | ~int64_t~ | in | Number of electrons |
| int64_t | dim_cord_vect | in | dimension of full coefficient vector | | ~nucl_num~ | ~int64_t~ | in | Number of nucleii |
| double | cord_vect_full[dim_cord_vect][nucl_num] | in | full coefficient vector | | ~cord_num~ | ~int64_t~ | in | order of polynomials |
| int64_t | lkpm_combined_index[4][dim_cord_vect] | in | combined indices | | ~dim_cord_vect~ | ~int64_t~ | in | dimension of full coefficient vector |
| double | een_rescaled_e[walk_num][elec_num][elec_num][0:cord_num] | in | Electron-nucleus rescaled | | ~cord_vect_full~ | ~double[dim_cord_vect][nucl_num]~ | in | full coefficient vector |
| double | een_rescaled_n[walk_num][elec_num][nucl_num][0:cord_num] | in | Electron-nucleus rescaled factor | | ~lkpm_combined_index~ | ~int64_t[4][dim_cord_vect]~ | in | combined indices |
| double | een_rescaled_e_deriv_e[walk_num][elec_num][4][elec_num][0:cord_num] | in | Electron-nucleus rescaled | | ~een_rescaled_e~ | ~double[walk_num][elec_num][elec_num][0:cord_num]~ | in | Electron-nucleus rescaled |
| double | een_rescaled_n_deriv_e[walk_num][elec_num][4][nucl_num][0:cord_num] | in | Electron-nucleus rescaled factor | | ~een_rescaled_n~ | ~double[walk_num][elec_num][nucl_num][0:cord_num]~ | in | Electron-nucleus rescaled factor |
| double | factor_een_deriv_e[walk_num][4][elec_num] | out | Electron-nucleus jastrow | | ~een_rescaled_e_deriv_e~ | ~double[walk_num][elec_num][4][elec_num][0:cord_num]~ | in | Electron-nucleus rescaled |
| ~een_rescaled_n_deriv_e~ | ~double[walk_num][elec_num][4][nucl_num][0:cord_num]~ | in | Electron-nucleus rescaled factor |
| ~factor_een_deriv_e~ | ~double[walk_num][4][elec_num]~ | out | Electron-nucleus jastrow |
#+begin_src f90 :comments org :tangle (eval f) :noweb yes #+begin_src f90 :comments org :tangle (eval f) :noweb yes
integer function qmckl_compute_factor_een_deriv_e_f(context, walk_num, elec_num, nucl_num, cord_num, dim_cord_vect, & integer function qmckl_compute_factor_een_deriv_e_f(context, walk_num, elec_num, nucl_num, cord_num, dim_cord_vect, &

View File

@ -625,45 +625,45 @@ rc = qmckl_set_ao_basis_prim_num (context, chbrclf_prim_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_nucleus_index (context, nucleus_index); rc = qmckl_set_ao_basis_nucleus_index (context, nucleus_index, nucl_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_nucleus_shell_num (context, nucleus_shell_num); rc = qmckl_set_ao_basis_nucleus_shell_num (context, nucleus_shell_num, nucl_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_shell_ang_mom (context, shell_ang_mom); rc = qmckl_set_ao_basis_shell_ang_mom (context, shell_ang_mom, chbrclf_shell_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_shell_factor (context, shell_factor); rc = qmckl_set_ao_basis_shell_factor (context, shell_factor, chbrclf_shell_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_shell_prim_num (context, shell_prim_num); rc = qmckl_set_ao_basis_shell_prim_num (context, shell_prim_num, chbrclf_shell_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_shell_prim_index (context, shell_prim_index); rc = qmckl_set_ao_basis_shell_prim_index (context, shell_prim_index, chbrclf_shell_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_exponent (context, exponent); rc = qmckl_set_ao_basis_exponent (context, exponent, chbrclf_prim_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_coefficient (context, coefficient); rc = qmckl_set_ao_basis_coefficient (context, coefficient, chbrclf_prim_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_prim_factor (context, prim_factor); rc = qmckl_set_ao_basis_prim_factor (context, prim_factor, chbrclf_prim_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
rc = qmckl_set_ao_basis_ao_num(context, chbrclf_ao_num); rc = qmckl_set_ao_basis_ao_num(context, chbrclf_ao_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
rc = qmckl_set_ao_basis_ao_factor (context, ao_factor); rc = qmckl_set_ao_basis_ao_factor (context, ao_factor, chbrclf_ao_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(qmckl_ao_basis_provided(context)); assert(qmckl_ao_basis_provided(context));
@ -671,7 +671,8 @@ assert(qmckl_ao_basis_provided(context));
double ao_vgl[5][walk_num][elec_num][chbrclf_ao_num]; double ao_vgl[5][walk_num][elec_num][chbrclf_ao_num];
rc = qmckl_get_ao_vgl(context, &(ao_vgl[0][0][0][0])); rc = qmckl_get_ao_basis_ao_vgl(context, &(ao_vgl[0][0][0][0]),
(int64_t) 5*walk_num*elec_num*chbrclf_ao_num);
assert (rc == QMCKL_SUCCESS); assert (rc == QMCKL_SUCCESS);
/* Set up MO data */ /* Set up MO data */

View File

@ -194,7 +194,7 @@ b[2] = 3; assert(b[2] == 3);
case some important information has been stored related to memory case some important information has been stored related to memory
allocation and needs to be updated. allocation and needs to be updated.
#+begin_src c :tangle (eval h_func) #+begin_src c :tangle (eval h_private_func)
qmckl_exit_code qmckl_free(qmckl_context context, qmckl_exit_code qmckl_free(qmckl_context context,
void * const ptr); void * const ptr);
#+end_src #+end_src

View File

@ -226,7 +226,7 @@ qmckl_get_mo_basis_coefficient (const qmckl_context context,
assert (ctx->mo_basis.coefficient != NULL); assert (ctx->mo_basis.coefficient != NULL);
memcpy(coefficient, ctx->mo_basis.coefficient, memcpy(coefficient, ctx->mo_basis.coefficient,
ctx->ao_basis.ao_num * ctx->mo_basis.mo_num * sizeof(int64_t)); ctx->ao_basis.ao_num * ctx->mo_basis.mo_num * sizeof(double));
return QMCKL_SUCCESS; return QMCKL_SUCCESS;
} }
@ -529,7 +529,7 @@ integer function qmckl_compute_mo_basis_vgl_f(context, &
double precision , intent(in) :: ao_vgl(ao_num,elec_num,5) double precision , intent(in) :: ao_vgl(ao_num,elec_num,5)
double precision , intent(in) :: coef_normalized(ao_num,mo_num) double precision , intent(in) :: coef_normalized(ao_num,mo_num)
double precision , intent(out) :: mo_vgl(mo_num,elec_num,5) double precision , intent(out) :: mo_vgl(mo_num,elec_num,5)
logical*8 :: TransA, TransB character :: TransA, TransB
double precision,dimension(:,:),allocatable :: mo_vgl_big double precision,dimension(:,:),allocatable :: mo_vgl_big
double precision,dimension(:,:),allocatable :: ao_vgl_big double precision,dimension(:,:),allocatable :: ao_vgl_big
!double precision,dimension(:,:),allocatable :: coef_trans !double precision,dimension(:,:),allocatable :: coef_trans
@ -546,8 +546,8 @@ integer function qmckl_compute_mo_basis_vgl_f(context, &
!allocate(coef_all(mo_num*ao_num)) !allocate(coef_all(mo_num*ao_num))
!allocate(coef_trans(mo_num,ao_num)) !allocate(coef_trans(mo_num,ao_num))
TransA = .True. TransA = 'T'
TransB = .False. TransB = 'N'
alpha = 1.0d0 alpha = 1.0d0
beta = 0.0d0 beta = 0.0d0
@ -761,45 +761,45 @@ rc = qmckl_set_ao_basis_prim_num (context, chbrclf_prim_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_nucleus_index (context, nucleus_index); rc = qmckl_set_ao_basis_nucleus_index (context, nucleus_index, nucl_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_nucleus_shell_num (context, nucleus_shell_num); rc = qmckl_set_ao_basis_nucleus_shell_num (context, nucleus_shell_num, nucl_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_shell_ang_mom (context, shell_ang_mom); rc = qmckl_set_ao_basis_shell_ang_mom (context, shell_ang_mom, chbrclf_shell_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_shell_factor (context, shell_factor); rc = qmckl_set_ao_basis_shell_factor (context, shell_factor, chbrclf_shell_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_shell_prim_num (context, shell_prim_num); rc = qmckl_set_ao_basis_shell_prim_num (context, shell_prim_num, chbrclf_shell_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_shell_prim_index (context, shell_prim_index); rc = qmckl_set_ao_basis_shell_prim_index (context, shell_prim_index, chbrclf_shell_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_exponent (context, exponent); rc = qmckl_set_ao_basis_exponent (context, exponent, chbrclf_prim_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_coefficient (context, coefficient); rc = qmckl_set_ao_basis_coefficient (context, coefficient, chbrclf_prim_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(!qmckl_ao_basis_provided(context)); assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_prim_factor (context, prim_factor); rc = qmckl_set_ao_basis_prim_factor (context, prim_factor, chbrclf_prim_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
rc = qmckl_set_ao_basis_ao_num(context, chbrclf_ao_num); rc = qmckl_set_ao_basis_ao_num(context, chbrclf_ao_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
rc = qmckl_set_ao_basis_ao_factor (context, ao_factor); rc = qmckl_set_ao_basis_ao_factor (context, ao_factor, chbrclf_ao_num);
assert(rc == QMCKL_SUCCESS); assert(rc == QMCKL_SUCCESS);
assert(qmckl_ao_basis_provided(context)); assert(qmckl_ao_basis_provided(context));
@ -807,7 +807,8 @@ assert(qmckl_ao_basis_provided(context));
double ao_vgl[5][walk_num][elec_num][chbrclf_ao_num]; double ao_vgl[5][walk_num][elec_num][chbrclf_ao_num];
rc = qmckl_get_ao_vgl(context, &(ao_vgl[0][0][0][0])); rc = qmckl_get_ao_basis_ao_vgl(context, &(ao_vgl[0][0][0][0]),
(int64_t) 5*walk_num*elec_num*chbrclf_ao_num);
assert (rc == QMCKL_SUCCESS); assert (rc == QMCKL_SUCCESS);
/* Set up MO data */ /* Set up MO data */

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
#+SETUPFILE: ../tools/theme.setup #+SETUPFILE: ../tools/theme.setup
#+INCLUDE: ../tools/lib.org #+INCLUDE: ../tools/lib.org
The [[https://github.com/trex-coe/trexio][TREXIO library]] enables easy and efficient input/output of wave The [[https://trex-coe.github.io/trexio/trex.html][TREXIO library]] enables easy and efficient input/output of wave
function parameters. In this section we provide high-level functions function parameters. In this section we provide high-level functions
to prepare the context by reading the required data from a TREXIO file. to prepare the context by reading the required data from a TREXIO file.
@ -200,7 +200,7 @@ qmckl_trexio_read_nucleus_X(qmckl_context context, trexio_t* const file)
assert (nucl_charge != NULL); assert (nucl_charge != NULL);
rcio = trexio_read_nucleus_charge_64(file, nucl_charge); rcio = trexio_read_safe_nucleus_charge_64(file, nucl_charge, nucleus_num);
if (rcio != TREXIO_SUCCESS) { if (rcio != TREXIO_SUCCESS) {
return qmckl_failwith( context, return qmckl_failwith( context,
QMCKL_FAILURE, QMCKL_FAILURE,
@ -208,6 +208,7 @@ qmckl_trexio_read_nucleus_X(qmckl_context context, trexio_t* const file)
trexio_string_of_error(rcio)); trexio_string_of_error(rcio));
} }
//rc = qmckl_set_nucleus_charge(context, nucl_charge, nucleus_num);
rc = qmckl_set_nucleus_charge(context, nucl_charge); rc = qmckl_set_nucleus_charge(context, nucl_charge);
qmckl_free(context, nucl_charge); qmckl_free(context, nucl_charge);
@ -240,7 +241,7 @@ qmckl_trexio_read_nucleus_X(qmckl_context context, trexio_t* const file)
assert (nucl_coord != NULL); assert (nucl_coord != NULL);
rcio = trexio_read_nucleus_coord_64(file, nucl_coord); rcio = trexio_read_safe_nucleus_coord_64(file, nucl_coord, 3*nucleus_num);
if (rcio != TREXIO_SUCCESS) { if (rcio != TREXIO_SUCCESS) {
return qmckl_failwith( context, return qmckl_failwith( context,
QMCKL_FAILURE, QMCKL_FAILURE,
@ -248,6 +249,7 @@ qmckl_trexio_read_nucleus_X(qmckl_context context, trexio_t* const file)
trexio_string_of_error(rcio)); trexio_string_of_error(rcio));
} }
//rc = qmckl_set_nucleus_coord(context, 'N', nucl_coord, 3*nucleus_num);
rc = qmckl_set_nucleus_coord(context, 'N', nucl_coord); rc = qmckl_set_nucleus_coord(context, 'N', nucl_coord);
qmckl_free(context, nucl_coord); qmckl_free(context, nucl_coord);
@ -322,7 +324,7 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
#+begin_src c :tangle (eval c) #+begin_src c :tangle (eval c)
int64_t shell_num = 0L; int64_t shell_num = 0L;
rcio = trexio_read_basis_num_64(file, &shell_num); rcio = trexio_read_basis_shell_num_64(file, &shell_num);
if (rcio != TREXIO_SUCCESS) { if (rcio != TREXIO_SUCCESS) {
return qmckl_failwith( context, return qmckl_failwith( context,
QMCKL_FAILURE, QMCKL_FAILURE,
@ -385,8 +387,9 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
#+begin_src c :tangle (eval c) #+begin_src c :tangle (eval c)
{ {
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
mem_info.size = nucleus_num * sizeof(int64_t);
/* Allocate array for data */
mem_info.size = nucleus_num * sizeof(int64_t);
int64_t* nucleus_index = (int64_t*) qmckl_malloc(context, mem_info); int64_t* nucleus_index = (int64_t*) qmckl_malloc(context, mem_info);
if (nucleus_index == NULL) { if (nucleus_index == NULL) {
@ -398,15 +401,57 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
assert (nucleus_index != NULL); assert (nucleus_index != NULL);
rcio = trexio_read_basis_nucleus_index_64(file, nucleus_index); /* Allocate temporary array */
mem_info.size = shell_num * sizeof(int64_t);
int64_t* tmp_array = (int64_t*) qmckl_malloc(context, mem_info);
if (tmp_array == NULL) {
qmckl_free(context, nucleus_index);
nucleus_index = NULL;
return qmckl_failwith( context,
QMCKL_ALLOCATION_FAILED,
"qmckl_trexio_read_basis_nucleus_index_X",
NULL);
}
assert (tmp_array != NULL);
/* Read in the temporary array */
rcio = trexio_read_safe_basis_nucleus_index_64(file, tmp_array, shell_num);
if (rcio != TREXIO_SUCCESS) { if (rcio != TREXIO_SUCCESS) {
qmckl_free(context, tmp_array);
tmp_array = NULL;
qmckl_free(context, nucleus_index);
nucleus_index = NULL;
return qmckl_failwith( context, return qmckl_failwith( context,
QMCKL_FAILURE, QMCKL_FAILURE,
"trexio_read_basis_nucleus_index", "trexio_read_basis_nucleus_index",
trexio_string_of_error(rcio)); trexio_string_of_error(rcio));
} }
rc = qmckl_set_ao_basis_nucleus_index(context, nucleus_index); /* Reformat data */
rc = qmckl_set_ao_basis_nucleus_index(context, nucleus_index, nucleus_num);
for (int i=shell_num-1 ; i>=0 ; --i) {
const int k = tmp_array[i];
if (k < 0 || k >= nucleus_num) {
qmckl_free(context, tmp_array);
tmp_array = NULL;
qmckl_free(context, nucleus_index);
nucleus_index = NULL;
return qmckl_failwith( context,
QMCKL_FAILURE,
"trexio_read_basis_nucleus_index",
"Irrelevant data in TREXIO file");
}
nucleus_index[k] = i;
}
qmckl_free(context, tmp_array);
tmp_array = NULL;
/* Store data */
rc = qmckl_set_ao_basis_nucleus_index(context, nucleus_index, shell_num);
qmckl_free(context, nucleus_index); qmckl_free(context, nucleus_index);
nucleus_index = NULL; nucleus_index = NULL;
@ -421,8 +466,9 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
#+begin_src c :tangle (eval c) #+begin_src c :tangle (eval c)
{ {
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
mem_info.size = nucleus_num * sizeof(int64_t);
/* Allocate array for data */
mem_info.size = nucleus_num * sizeof(int64_t);
int64_t* nucleus_shell_num = (int64_t*) qmckl_malloc(context, mem_info); int64_t* nucleus_shell_num = (int64_t*) qmckl_malloc(context, mem_info);
if (nucleus_shell_num == NULL) { if (nucleus_shell_num == NULL) {
@ -434,15 +480,60 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
assert (nucleus_shell_num != NULL); assert (nucleus_shell_num != NULL);
rcio = trexio_read_basis_nucleus_shell_num_64(file, nucleus_shell_num); /* Allocate temporary array */
mem_info.size = shell_num * sizeof(int64_t);
int64_t* tmp_array = (int64_t*) qmckl_malloc(context, mem_info);
if (tmp_array == NULL) {
qmckl_free(context, nucleus_shell_num);
nucleus_shell_num = NULL;
return qmckl_failwith( context,
QMCKL_ALLOCATION_FAILED,
"qmckl_trexio_read_basis_nucleus_shell_num_X",
NULL);
}
assert (tmp_array != NULL);
/* Read in the temporary array */
rcio = trexio_read_safe_basis_nucleus_index_64(file, tmp_array, shell_num);
if (rcio != TREXIO_SUCCESS) { if (rcio != TREXIO_SUCCESS) {
qmckl_free(context, tmp_array);
tmp_array = NULL;
qmckl_free(context, nucleus_shell_num);
nucleus_shell_num = NULL;
return qmckl_failwith( context, return qmckl_failwith( context,
QMCKL_FAILURE, QMCKL_FAILURE,
"trexio_read_basis_nucleus_shell_num", "trexio_read_basis_nucleus_shell_num",
trexio_string_of_error(rcio)); trexio_string_of_error(rcio));
} }
rc = qmckl_set_ao_basis_nucleus_shell_num(context, nucleus_shell_num); /* Reformat data */
for (int i=0 ; i<nucleus_num ; ++i) {
nucleus_shell_num[i] = 0;
}
for (int i=0 ; i<shell_num ; ++i) {
const int k = tmp_array[i];
if (k < 0 || k >= nucleus_num) {
qmckl_free(context, tmp_array);
tmp_array = NULL;
qmckl_free(context, nucleus_shell_num);
nucleus_shell_num = NULL;
return qmckl_failwith( context,
QMCKL_FAILURE,
"trexio_read_basis_nucleus_shell_num",
"Irrelevant data in TREXIO file");
}
nucleus_shell_num[k] += 1;
}
qmckl_free(context, tmp_array);
tmp_array = NULL;
/* Store data */
rc = qmckl_set_ao_basis_nucleus_shell_num(context, nucleus_shell_num, shell_num);
qmckl_free(context, nucleus_shell_num); qmckl_free(context, nucleus_shell_num);
nucleus_shell_num = NULL; nucleus_shell_num = NULL;
@ -457,6 +548,8 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
#+begin_src c :tangle (eval c) #+begin_src c :tangle (eval c)
{ {
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
/* Allocate array for data */
mem_info.size = shell_num * sizeof(int32_t); mem_info.size = shell_num * sizeof(int32_t);
int32_t* shell_ang_mom = (int32_t*) qmckl_malloc(context, mem_info); int32_t* shell_ang_mom = (int32_t*) qmckl_malloc(context, mem_info);
@ -470,15 +563,19 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
assert (shell_ang_mom != NULL); assert (shell_ang_mom != NULL);
rcio = trexio_read_basis_shell_ang_mom_32(file, shell_ang_mom); /* Read data */
rcio = trexio_read_safe_basis_shell_ang_mom_32(file, shell_ang_mom, shell_num);
if (rcio != TREXIO_SUCCESS) { if (rcio != TREXIO_SUCCESS) {
qmckl_free(context, shell_ang_mom);
shell_ang_mom = NULL;
return qmckl_failwith( context, return qmckl_failwith( context,
QMCKL_FAILURE, QMCKL_FAILURE,
"trexio_read_basis_shell_ang_mom", "trexio_read_basis_shell_ang_mom",
trexio_string_of_error(rcio)); trexio_string_of_error(rcio));
} }
rc = qmckl_set_ao_basis_shell_ang_mom(context, shell_ang_mom); /* Store data */
rc = qmckl_set_ao_basis_shell_ang_mom(context, shell_ang_mom, shell_num);
qmckl_free(context, shell_ang_mom); qmckl_free(context, shell_ang_mom);
shell_ang_mom = NULL; shell_ang_mom = NULL;
@ -493,6 +590,8 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
#+begin_src c :tangle (eval c) #+begin_src c :tangle (eval c)
{ {
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
/* Allocate array for data */
mem_info.size = shell_num * sizeof(int64_t); mem_info.size = shell_num * sizeof(int64_t);
int64_t* shell_prim_num = (int64_t*) qmckl_malloc(context, mem_info); int64_t* shell_prim_num = (int64_t*) qmckl_malloc(context, mem_info);
@ -506,15 +605,58 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
assert (shell_prim_num != NULL); assert (shell_prim_num != NULL);
rcio = trexio_read_basis_shell_prim_num_64(file, shell_prim_num); /* Allocate temporary array */
mem_info.size = prim_num * sizeof(int64_t);
int64_t* tmp_array = (int64_t*) qmckl_malloc(context, mem_info);
if (tmp_array == NULL) {
qmckl_free(context, shell_prim_num);
shell_prim_num = NULL;
return qmckl_failwith( context,
QMCKL_ALLOCATION_FAILED,
"qmckl_trexio_read_basis_shell_prim_num_X",
NULL);
}
assert (tmp_array != NULL);
/* Read data */
rcio = trexio_read_safe_basis_shell_index_64 (file, tmp_array, prim_num);
if (rcio != TREXIO_SUCCESS) { if (rcio != TREXIO_SUCCESS) {
qmckl_free(context, shell_prim_num);
shell_prim_num = NULL;
qmckl_free(context, tmp_array);
tmp_array = NULL;
return qmckl_failwith( context, return qmckl_failwith( context,
QMCKL_FAILURE, QMCKL_FAILURE,
"trexio_read_basis_shell_prim_num", "trexio_read_basis_shell_prim_num",
trexio_string_of_error(rcio)); trexio_string_of_error(rcio));
} }
rc = qmckl_set_ao_basis_shell_prim_num(context, shell_prim_num); /* Reformat data */
for (int i=0 ; i<shell_num ; ++i) {
shell_prim_num[i] = 0;
}
for (int i=0 ; i<prim_num ; ++i) {
const int k = tmp_array[i];
if (k < 0 || k >= shell_num) {
qmckl_free(context, tmp_array);
qmckl_free(context, shell_prim_num);
return qmckl_failwith( context,
QMCKL_FAILURE,
"trexio_read_basis_shell_prim_num",
"Irrelevant data in TREXIO file");
}
shell_prim_num[k] += 1;
}
qmckl_free(context, tmp_array);
tmp_array = NULL;
/* Store data */
rc = qmckl_set_ao_basis_shell_prim_num(context, shell_prim_num, shell_num);
qmckl_free(context, shell_prim_num); qmckl_free(context, shell_prim_num);
shell_prim_num = NULL; shell_prim_num = NULL;
@ -529,6 +671,8 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
#+begin_src c :tangle (eval c) #+begin_src c :tangle (eval c)
{ {
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
/* Allocate array for data */
mem_info.size = shell_num * sizeof(int64_t); mem_info.size = shell_num * sizeof(int64_t);
int64_t* shell_prim_index = (int64_t*) qmckl_malloc(context, mem_info); int64_t* shell_prim_index = (int64_t*) qmckl_malloc(context, mem_info);
@ -542,15 +686,54 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
assert (shell_prim_index != NULL); assert (shell_prim_index != NULL);
rcio = trexio_read_basis_shell_prim_index_64(file, shell_prim_index); /* Allocate temporary array */
mem_info.size = prim_num * sizeof(int64_t);
int64_t* tmp_array = (int64_t*) qmckl_malloc(context, mem_info);
if (tmp_array == NULL) {
return qmckl_failwith( context,
QMCKL_ALLOCATION_FAILED,
"qmckl_trexio_read_basis_shell_prim_index_X",
NULL);
}
assert (tmp_array != NULL);
/* Read data */
rcio = trexio_read_safe_basis_shell_index_64(file, tmp_array, prim_num);
if (rcio != TREXIO_SUCCESS) { if (rcio != TREXIO_SUCCESS) {
qmckl_free(context, shell_prim_index);
shell_prim_index = NULL;
qmckl_free(context, tmp_array);
tmp_array = NULL;
return qmckl_failwith( context, return qmckl_failwith( context,
QMCKL_FAILURE, QMCKL_FAILURE,
"trexio_read_basis_shell_prim_index", "trexio_read_basis_shell_prim_index",
trexio_string_of_error(rcio)); trexio_string_of_error(rcio));
} }
rc = qmckl_set_ao_basis_shell_prim_index(context, shell_prim_index); /* Reformat data */
for (int i=prim_num-1 ; i>=0 ; --i) {
const int k = tmp_array[i];
if (k < 0 || k >= shell_num) {
qmckl_free(context, tmp_array);
tmp_array = NULL;
qmckl_free(context, shell_prim_index);
shell_prim_index = NULL;
return qmckl_failwith( context,
QMCKL_FAILURE,
"trexio_read_basis_shell_prim_index",
"Irrelevant data in TREXIO file");
}
shell_prim_index[k] = i;
}
qmckl_free(context, tmp_array);
tmp_array = NULL;
/* Store data */
rc = qmckl_set_ao_basis_shell_prim_index(context, shell_prim_index, shell_num);
qmckl_free(context, shell_prim_index); qmckl_free(context, shell_prim_index);
shell_prim_index = NULL; shell_prim_index = NULL;
@ -565,6 +748,8 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
#+begin_src c :tangle (eval c) #+begin_src c :tangle (eval c)
{ {
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
/* Allocate array for data */
mem_info.size = shell_num * sizeof(double); mem_info.size = shell_num * sizeof(double);
double* shell_factor = (double*) qmckl_malloc(context, mem_info); double* shell_factor = (double*) qmckl_malloc(context, mem_info);
@ -578,15 +763,19 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
assert (shell_factor != NULL); assert (shell_factor != NULL);
rcio = trexio_read_basis_shell_factor_64(file, shell_factor); /* Read data */
rcio = trexio_read_safe_basis_shell_factor_64(file, shell_factor, shell_num);
if (rcio != TREXIO_SUCCESS) { if (rcio != TREXIO_SUCCESS) {
qmckl_free(context, shell_factor);
shell_factor = NULL;
return qmckl_failwith( context, return qmckl_failwith( context,
QMCKL_FAILURE, QMCKL_FAILURE,
"trexio_read_basis_shell_factor", "trexio_read_basis_shell_factor",
trexio_string_of_error(rcio)); trexio_string_of_error(rcio));
} }
rc = qmckl_set_ao_basis_shell_factor(context, shell_factor); /* Store data */
rc = qmckl_set_ao_basis_shell_factor(context, shell_factor, shell_num);
qmckl_free(context, shell_factor); qmckl_free(context, shell_factor);
shell_factor = NULL; shell_factor = NULL;
@ -601,6 +790,8 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
#+begin_src c :tangle (eval c) #+begin_src c :tangle (eval c)
{ {
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
/* Allocate array for data */
mem_info.size = prim_num * sizeof(double); mem_info.size = prim_num * sizeof(double);
double* exponent = (double*) qmckl_malloc(context, mem_info); double* exponent = (double*) qmckl_malloc(context, mem_info);
@ -614,15 +805,19 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
assert (exponent != NULL); assert (exponent != NULL);
rcio = trexio_read_basis_exponent_64(file, exponent); /* Read data */
rcio = trexio_read_safe_basis_exponent_64(file, exponent, prim_num);
if (rcio != TREXIO_SUCCESS) { if (rcio != TREXIO_SUCCESS) {
qmckl_free(context, exponent);
exponent = NULL;
return qmckl_failwith( context, return qmckl_failwith( context,
QMCKL_FAILURE, QMCKL_FAILURE,
"trexio_read_basis_exponent", "trexio_read_basis_exponent",
trexio_string_of_error(rcio)); trexio_string_of_error(rcio));
} }
rc = qmckl_set_ao_basis_exponent(context, exponent); /* Store data */
rc = qmckl_set_ao_basis_exponent(context, exponent, prim_num);
qmckl_free(context, exponent); qmckl_free(context, exponent);
exponent = NULL; exponent = NULL;
@ -637,6 +832,8 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
#+begin_src c :tangle (eval c) #+begin_src c :tangle (eval c)
{ {
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
/* Allocate array for data */
mem_info.size = prim_num * sizeof(double); mem_info.size = prim_num * sizeof(double);
double* coefficient = (double*) qmckl_malloc(context, mem_info); double* coefficient = (double*) qmckl_malloc(context, mem_info);
@ -650,15 +847,19 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
assert (coefficient != NULL); assert (coefficient != NULL);
rcio = trexio_read_basis_coefficient_64(file, coefficient); /* Read data */
rcio = trexio_read_safe_basis_coefficient_64(file, coefficient, prim_num);
if (rcio != TREXIO_SUCCESS) { if (rcio != TREXIO_SUCCESS) {
qmckl_free(context, coefficient);
coefficient = NULL;
return qmckl_failwith( context, return qmckl_failwith( context,
QMCKL_FAILURE, QMCKL_FAILURE,
"trexio_read_basis_coefficient", "trexio_read_basis_coefficient",
trexio_string_of_error(rcio)); trexio_string_of_error(rcio));
} }
rc = qmckl_set_ao_basis_coefficient(context, coefficient); /* Store data */
rc = qmckl_set_ao_basis_coefficient(context, coefficient, prim_num);
qmckl_free(context, coefficient); qmckl_free(context, coefficient);
coefficient = NULL; coefficient = NULL;
@ -673,6 +874,8 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
#+begin_src c :tangle (eval c) #+begin_src c :tangle (eval c)
{ {
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
/* Allocate array for data */
mem_info.size = prim_num * sizeof(double); mem_info.size = prim_num * sizeof(double);
double* prim_factor = (double*) qmckl_malloc(context, mem_info); double* prim_factor = (double*) qmckl_malloc(context, mem_info);
@ -686,15 +889,19 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
assert (prim_factor != NULL); assert (prim_factor != NULL);
rcio = trexio_read_basis_prim_factor_64(file, prim_factor); /* Read data */
rcio = trexio_read_safe_basis_prim_factor_64(file, prim_factor, prim_num);
if (rcio != TREXIO_SUCCESS) { if (rcio != TREXIO_SUCCESS) {
qmckl_free(context, prim_factor);
prim_factor = NULL;
return qmckl_failwith( context, return qmckl_failwith( context,
QMCKL_FAILURE, QMCKL_FAILURE,
"trexio_read_basis_prim_factor", "trexio_read_basis_prim_factor",
trexio_string_of_error(rcio)); trexio_string_of_error(rcio));
} }
rc = qmckl_set_ao_basis_prim_factor(context, prim_factor); /* Read data */
rc = qmckl_set_ao_basis_prim_factor(context, prim_factor, prim_num);
qmckl_free(context, prim_factor); qmckl_free(context, prim_factor);
prim_factor = NULL; prim_factor = NULL;
@ -708,6 +915,8 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
#+begin_src c :tangle (eval c) #+begin_src c :tangle (eval c)
{ {
qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero; qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
/* Allocate array for data */
mem_info.size = ao_num * sizeof(double); mem_info.size = ao_num * sizeof(double);
double* ao_normalization = (double*) qmckl_malloc(context, mem_info); double* ao_normalization = (double*) qmckl_malloc(context, mem_info);
@ -721,15 +930,19 @@ qmckl_trexio_read_ao_X(qmckl_context context, trexio_t* const file)
assert (ao_normalization != NULL); assert (ao_normalization != NULL);
rcio = trexio_read_ao_normalization_64(file, ao_normalization); /* Read data */
rcio = trexio_read_safe_ao_normalization_64(file, ao_normalization, ao_num);
if (rcio != TREXIO_SUCCESS) { if (rcio != TREXIO_SUCCESS) {
qmckl_free(context, ao_normalization);
ao_normalization = NULL;
return qmckl_failwith( context, return qmckl_failwith( context,
QMCKL_FAILURE, QMCKL_FAILURE,
"trexio_read_ao_normalization", "trexio_read_ao_normalization",
trexio_string_of_error(rcio)); trexio_string_of_error(rcio));
} }
rc = qmckl_set_ao_basis_ao_factor(context, ao_normalization); /* Store data */
rc = qmckl_set_ao_basis_ao_factor(context, ao_normalization, ao_num);
qmckl_free(context, ao_normalization); qmckl_free(context, ao_normalization);
ao_normalization = NULL; ao_normalization = NULL;
@ -1115,7 +1328,9 @@ double * mo_coef = (double*) malloc (ao_num * mo_num * sizeof(double));
rc = qmckl_get_mo_basis_coefficient(context, mo_coef, mo_num*ao_num); rc = qmckl_get_mo_basis_coefficient(context, mo_coef, mo_num*ao_num);
assert (rc == QMCKL_SUCCESS); assert (rc == QMCKL_SUCCESS);
for (int i=0 ; i<ao_num * mo_num ; i++) { for (int i=0 ; i<ao_num * mo_num ; i++) {
assert (mo_coef[i] == chbrclf_mo_coef[i]); printf("%d %e %e %e\n", i, mo_coef[i], chbrclf_mo_coef[i],
( fabs(mo_coef[i] - chbrclf_mo_coef[i])/fabs(mo_coef[i])) );
assert ( fabs(mo_coef[i] - chbrclf_mo_coef[i])/fabs(mo_coef[i]) < 1.e-12 );
} }
free(mo_coef); free(mo_coef);
charge = NULL; charge = NULL;

View File

@ -11,7 +11,6 @@ qmckl_local_energy.org
qmckl_memory.org qmckl_memory.org
qmckl_mo.org qmckl_mo.org
qmckl_numprec.org qmckl_numprec.org
qmckl_distance.org
qmckl_nucleus.org qmckl_nucleus.org
qmckl_sherman_morrison_woodbury.org qmckl_sherman_morrison_woodbury.org
qmckl_utils.org qmckl_utils.org

View File

@ -0,0 +1 @@
<meta http-equiv="refresh" content="0;URL=README.html">

File diff suppressed because it is too large Load Diff

View File

@ -1,34 +1,37 @@
rank_basis_nucleus_index 1 rank_basis_nucleus_index 1
dims_basis_nucleus_index 0 2 dims_basis_nucleus_index 0 12
rank_basis_nucleus_shell_num 1
dims_basis_nucleus_shell_num 0 2
rank_basis_shell_ang_mom 1 rank_basis_shell_ang_mom 1
dims_basis_shell_ang_mom 0 12 dims_basis_shell_ang_mom 0 12
rank_basis_shell_prim_num 1
dims_basis_shell_prim_num 0 12
rank_basis_shell_factor 1 rank_basis_shell_factor 1
dims_basis_shell_factor 0 12 dims_basis_shell_factor 0 12
rank_basis_shell_prim_index 1 rank_basis_shell_index 1
dims_basis_shell_prim_index 0 12 dims_basis_shell_index 0 50
rank_basis_exponent 1 rank_basis_exponent 1
dims_basis_exponent 0 50 dims_basis_exponent 0 50
rank_basis_coefficient 1 rank_basis_coefficient 1
dims_basis_coefficient 0 50 dims_basis_coefficient 0 50
rank_basis_prim_factor 1 rank_basis_prim_factor 1
dims_basis_prim_factor 0 50 dims_basis_prim_factor 0 50
basis_num_isSet 1
basis_num 12
basis_prim_num_isSet 1 basis_prim_num_isSet 1
basis_prim_num 50 basis_prim_num 50
basis_shell_num_isSet 1
basis_shell_num 12
len_basis_type 9 len_basis_type 9
basis_type basis_type
Gaussian Gaussian
basis_nucleus_index basis_nucleus_index
0 0
6 0
basis_nucleus_shell_num 0
6 0
6 0
0
1
1
1
1
1
1
basis_shell_ang_mom basis_shell_ang_mom
0 0
0 0
@ -42,19 +45,6 @@ basis_shell_ang_mom
1 1
1 1
2 2
basis_shell_prim_num
9
9
1
4
1
1
9
9
1
4
1
1
basis_shell_factor basis_shell_factor
9.9999971897081508e-01 9.9999971897081508e-01
9.9999963111699008e-01 9.9999963111699008e-01
@ -68,19 +58,57 @@ basis_shell_factor
1.0000002163655846e+00 1.0000002163655846e+00
1.0000000000000000e+00 1.0000000000000000e+00
1.0000000000000002e+00 1.0000000000000002e+00
basis_shell_prim_index basis_shell_index
0 0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
2
3
3
3
3
4
5
6
6
6
6
6
6
6
6
6
7
7
7
7
7
7
7
7
7
8
9 9
18 9
19 9
23 9
24 10
25 11
34
43
44
48
49
basis_exponent basis_exponent
2.9400000000000000e+03 2.9400000000000000e+03
4.4119999999999999e+02 4.4119999999999999e+02

View File

@ -4,7 +4,7 @@ metadata_code_num_isSet 0
metadata_author_num_isSet 0 metadata_author_num_isSet 0
len_metadata_package_version 6 len_metadata_package_version 6
metadata_package_version metadata_package_version
1.1.0 2.0.0
len_metadata_description 0 len_metadata_description 0
metadata_description metadata_description
metadata_code metadata_code

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,8 @@ rank_nucleus_label 1
dims_nucleus_label 0 2 dims_nucleus_label 0 2
nucleus_num_isSet 1 nucleus_num_isSet 1
nucleus_num 2 nucleus_num 2
nucleus_repulsion_isSet 1
nucleus_repulsion 3.4507806369169232e+00
len_nucleus_point_group 0 len_nucleus_point_group 0
nucleus_point_group nucleus_point_group
nucleus_charge nucleus_charge

View File

@ -1,40 +1,97 @@
rank_basis_nucleus_index 1 rank_basis_nucleus_index 1
dims_basis_nucleus_index 0 5 dims_basis_nucleus_index 0 72
rank_basis_nucleus_shell_num 1
dims_basis_nucleus_shell_num 0 5
rank_basis_shell_ang_mom 1 rank_basis_shell_ang_mom 1
dims_basis_shell_ang_mom 0 72 dims_basis_shell_ang_mom 0 72
rank_basis_shell_prim_num 1
dims_basis_shell_prim_num 0 72
rank_basis_shell_factor 1 rank_basis_shell_factor 1
dims_basis_shell_factor 0 72 dims_basis_shell_factor 0 72
rank_basis_shell_prim_index 1 rank_basis_shell_index 1
dims_basis_shell_prim_index 0 72 dims_basis_shell_index 0 297
rank_basis_exponent 1 rank_basis_exponent 1
dims_basis_exponent 0 297 dims_basis_exponent 0 297
rank_basis_coefficient 1 rank_basis_coefficient 1
dims_basis_coefficient 0 297 dims_basis_coefficient 0 297
rank_basis_prim_factor 1 rank_basis_prim_factor 1
dims_basis_prim_factor 0 297 dims_basis_prim_factor 0 297
basis_num_isSet 1
basis_num 72
basis_prim_num_isSet 1 basis_prim_num_isSet 1
basis_prim_num 297 basis_prim_num 297
basis_shell_num_isSet 1
basis_shell_num 72
len_basis_type 9 len_basis_type 9
basis_type basis_type
Gaussian Gaussian
basis_nucleus_index basis_nucleus_index
0 0
14 0
23 0
37 0
53 0
basis_nucleus_shell_num 0
14 0
9 0
14 0
16 0
19 0
0
0
0
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
basis_shell_ang_mom basis_shell_ang_mom
0 0
0 0
@ -108,79 +165,6 @@ basis_shell_ang_mom
2 2
3 3
3 3
basis_shell_prim_num
10
10
1
1
1
5
1
1
1
1
1
1
1
1
5
1
1
1
1
1
1
1
1
10
10
1
1
1
5
1
1
1
1
1
1
1
1
15
15
15
1
1
1
9
9
1
1
1
1
1
1
1
1
20
20
20
20
1
1
1
13
13
13
1
1
1
8
1
1
1
1
1
basis_shell_factor basis_shell_factor
9.9999973955019195e-01 9.9999973955019195e-01
9.9999948164842034e-01 9.9999948164842034e-01
@ -254,13 +238,83 @@ basis_shell_factor
1.0000000000000002e+00 1.0000000000000002e+00
1.0000000000000002e+00 1.0000000000000002e+00
1.0000000000000002e+00 1.0000000000000002e+00
basis_shell_prim_index basis_shell_index
0 0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
2
3
4
5
5
5
5
5
6
7
8
9
10 10
11
12
13
14
14
14
14
14
15
16
17
18
19
20 20
21 21
22 22
23 23
23
23
23
23
23
23
23
23
23
24
24
24
24
24
24
24
24
24
24
25
26
27
28
28
28
28
28 28
29 29
30 30
@ -270,63 +324,218 @@ basis_shell_prim_index
34 34
35 35
36 36
37
37
37
37
37
37
37
37
37
37
37
37
37
37
37
38
38
38
38
38
38
38
38
38
38
38
38
38
38
38
39
39
39
39
39
39
39
39
39
39
39
39
39
39
39
40
41 41
42 42
43 43
43
43
43
43
43
43
43
43
44
44
44
44
44
44
44
44
44 44
45 45
46 46
47 47
48 48
49 49
50
51
52
53
53
53
53
53
53
53
53
53
53
53
53
53
53
53
53
53
53
53
53
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
54
55
55
55
55
55
55
55
55
55
55
55
55
55
55
55
55
55
55
55
55
56
56
56
56
56
56
56
56
56
56
56
56
56
56
56
56
56
56
56
56
57
58
59 59
60
60
60
60
60
60
60
60
60
60
60
60
60
61
61
61
61
61
61
61
61
61
61
61
61
61
62
62
62
62
62
62
62
62
62
62
62
62
62
63
64
65
66
66
66
66
66
66
66
66
67
68
69 69
70 70
71 71
72
77
78
79
80
81
82
83
84
85
100
115
130
131
132
133
142
151
152
153
154
155
156
157
158
159
179
199
219
239
240
241
242
255
268
281
282
283
284
292
293
294
295
296
basis_exponent basis_exponent
8.2360000000000000e+03 8.2360000000000000e+03
1.2350000000000000e+03 1.2350000000000000e+03

View File

@ -4,7 +4,7 @@ metadata_code_num_isSet 0
metadata_author_num_isSet 0 metadata_author_num_isSet 0
len_metadata_package_version 6 len_metadata_package_version 6
metadata_package_version metadata_package_version
0.3.0 2.0.0
len_metadata_description 0 len_metadata_description 0
metadata_description metadata_description
metadata_code metadata_code

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,8 @@ rank_nucleus_label 1
dims_nucleus_label 0 5 dims_nucleus_label 0 5
nucleus_num_isSet 1 nucleus_num_isSet 1
nucleus_num 5 nucleus_num 5
nucleus_repulsion_isSet 1
nucleus_repulsion 3.1823098794361579e+02
len_nucleus_point_group 0 len_nucleus_point_group 0
nucleus_point_group nucleus_point_group
nucleus_charge nucleus_charge

View File

@ -236,15 +236,15 @@ def main():
output+= ["", output+= ["",
"## Test files", "## Test files",
"", "",
"$(header_tests): $(TANGLED_FILES)",
"$(test_qmckl_fo): $(test_qmckl_f)"] "$(test_qmckl_fo): $(test_qmckl_f)"]
output += ["", output += ["",
"check_PROGRAMS = $(TESTS)" ] "check_PROGRAMS = $(TESTS)" ]
for f in sorted(TESTS.keys()): for f in sorted(TESTS.keys()):
prefix = "tests_" + f.rsplit("/",1)[-1] prefix = "tests_" + f.rsplit("/",1)[-1]
output += [ prefix + "_SOURCES = " + \ output += [ prefix + "_SOURCES = " + \
" ".join(TESTS[f]), " ".join(TESTS[f]) + " $(header_tests)",
prefix + "_LDADD = src/libqmckl.la", prefix + "_LDADD = src/libqmckl.la",
prefix + "_LDFLAGS = -no-install",
"" ] "" ]
tmp = "EXTRA_DIST += " tmp = "EXTRA_DIST += "

View File

@ -19,17 +19,19 @@
** Table of function arguments ** Table of function arguments
#+NAME: test #+NAME: test
| ~qmckl_context~ | ~context~ | in | Global state | | Variable | Type | In/Out | Description |
| ~char~ | ~transa~ | in | Array ~A~ is ~'N'~: Normal, ~'T'~: Transposed | |-----------+------------------+--------+-----------------------------------------------|
| ~char~ | ~transb~ | in | Array ~B~ is ~'N'~: Normal, ~'T'~: Transposed | | ~context~ | ~qmckl_context~ | in | Global state |
| ~int64_t~ | ~m~ | in | Number of points in the first set | | ~transa~ | ~char~ | in | Array ~A~ is ~'N'~: Normal, ~'T'~: Transposed |
| ~int64_t~ | ~n~ | in | Number of points in the second set | | ~transb~ | ~char~ | in | Array ~B~ is ~'N'~: Normal, ~'T'~: Transposed |
| ~double~ | ~A[][lda]~ | in | Array containing the $m \times 3$ matrix $A$ | | ~m~ | ~int64_t~ | in | Number of points in the first set |
| ~int64_t~ | ~lda~ | in | Leading dimension of array ~A~ | | ~n~ | ~int64_t~ | in | Number of points in the second set |
| ~double~ | ~B[][ldb]~ | in | Array containing the $n \times 3$ matrix $B$ | | ~A~ | ~double[][lda]~ | in | Array containing the $m \times 3$ matrix $A$ |
| ~int64_t~ | ~ldb~ | in | Leading dimension of array ~B~ | | ~lda~ | ~int64_t~ | in | Leading dimension of array ~A~ |
| ~double~ | ~C[n][ldc]~ | out | Array containing the $m \times n$ matrix $C$ | | ~B~ | ~double[][ldb]~ | in | Array containing the $n \times 3$ matrix $B$ |
| ~int64_t~ | ~ldc~ | in | Leading dimension of array ~C~ | | ~ldb~ | ~int64_t~ | in | Leading dimension of array ~B~ |
| ~C~ | ~double[n][ldc]~ | out | Array containing the $m \times n$ matrix $C$ |
| ~ldc~ | ~int64_t~ | in | Leading dimension of array ~C~ |
*** Fortran-C type conversions *** Fortran-C type conversions
@ -57,8 +59,6 @@ ctypeid_d = { '' : ''
, 'qmckl_exit_code' : 'integer(c_int32_t)' , 'qmckl_exit_code' : 'integer(c_int32_t)'
, 'integer' : 'integer(c_int32_t)' , 'integer' : 'integer(c_int32_t)'
, 'integer*8' : 'integer(c_int64_t)' , 'integer*8' : 'integer(c_int64_t)'
, 'integer' : 'integer(c_uint32_t)'
, 'integer*8' : 'integer(c_uint64_t)'
, 'real' : 'real(c_float)' , 'real' : 'real(c_float)'
, 'real*8' : 'real(c_double)' , 'real*8' : 'real(c_double)'
, 'character' : 'character(c_char)' , 'character' : 'character(c_char)'
@ -74,9 +74,9 @@ def parse_table(table):
result = [] result = []
for line in [ [x.replace('~','') for x in y] for y in table]: for line in [ [x.replace('~','') for x in y] for y in table]:
d = { "c_type" : line[0], d = { "name" : line[0],
"c_type" : line[1],
"inout" : line[2].lower(), "inout" : line[2].lower(),
"name" : line[1],
"comment" : line[3] } "comment" : line[3] }
# Handle inout # Handle inout
@ -88,12 +88,12 @@ def parse_table(table):
d["inout"] == "inout" d["inout"] == "inout"
# Find dimensions (replace [] by [*] to get * in Fortran dimensions) # Find dimensions (replace [] by [*] to get * in Fortran dimensions)
dims = d["name"].replace("[]","[*]").split('[') dims = d["c_type"].replace("[]","[*]").split('[')
d["rank"] = len(dims) - 1 d["rank"] = len(dims) - 1
if d["rank"] == 0: if d["rank"] == 0:
d["dims"] = [] d["dims"] = []
else: else:
d["name"] = d["name"].split('[')[0].strip() d["c_type"] = d["c_type"].split('[')[0].strip()
d["dims"] = [ x.replace(']','').strip() for x in dims[1:] ] d["dims"] = [ x.replace(']','').strip() for x in dims[1:] ]
result.append(d) result.append(d)
@ -104,7 +104,7 @@ def parse_table(table):
*** Generates a C header *** Generates a C header
#+NAME: generate_c_header #+NAME: generate_c_header
#+BEGIN_SRC python :var table=test :var rettyp=[] :var fname=[] :results drawer :noweb yes :wrap "src c :tangle (eval h_func) :comments org" #+BEGIN_SRC python :var table=test :var rettyp="qmckl_exit_code" :var fname=[] :results drawer :noweb yes :wrap "src c :tangle (eval h_func) :comments org"
<<parse_table>> <<parse_table>>
results = [] results = []
@ -133,6 +133,23 @@ return template
#+END_SRC #+END_SRC
#+RESULTS: generate_c_header
#+begin_src c :tangle (eval h_func) :comments org
qmckl_exit_code [] (
const qmckl_context context,
const char transa,
const char transb,
const int64_t m,
const int64_t n,
const double* A,
const int64_t lda,
const double* B,
const int64_t ldb,
double* const C,
const int64_t ldc );
#+end_src
*** Generates a C interface to the Fortran function *** Generates a C interface to the Fortran function
#+NAME: generate_c_interface #+NAME: generate_c_interface