diff --git a/README.html b/README.html index 1dfbbde..b9f7219 100644 --- a/README.html +++ b/README.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + QMCkl source code documentation @@ -319,6 +319,7 @@ for the JavaScript code in this tag.
  • Nucleus
  • Electrons
  • Atomic Orbitals
  • +
  • Jastrow Factor
  • Inter-particle distances
  • Utility functions
  • Data for Tests
  • @@ -352,7 +353,7 @@ and bug reports should be submitted at

    Author: TREX CoE

    -

    Created: 2021-07-07 Wed 23:26

    +

    Created: 2021-07-08 Thu 06:58

    Validate

    diff --git a/qmckl.html b/qmckl.html index 0ca0d0f..4de874b 100644 --- a/qmckl.html +++ b/qmckl.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Introduction @@ -333,30 +333,30 @@ for the JavaScript code in this tag.

    Table of Contents

    -
    -

    1 Using QMCkl

    +
    +

    1 Using QMCkl

    The qmckl.h header file installed in the ${prefix}/include directory @@ -385,12 +385,12 @@ Both files are located in the include/ directory.

    -
    -

    2 Developing in QMCkl

    +
    +

    2 Developing in QMCkl

    -
    -

    2.1 Literate programming

    +
    +

    2.1 Literate programming

    In a traditional source code, most of the lines of source files of a program @@ -435,8 +435,8 @@ interactively, in the same spirit as Jupyter notebooks.

    -
    -

    2.2 Source code editing

    +
    +

    2.2 Source code editing

    For a tutorial on literate programming with org-mode, follow this link. @@ -467,8 +467,8 @@ org-mode.

    -
    -

    2.3 Choice of the programming language

    +
    +

    2.3 Choice of the programming language

    Most of the codes of the TREX CoE are written in Fortran with some scripts in @@ -516,8 +516,8 @@ For more guidelines on using Fortran to generate a C interface, see

    -
    -

    2.4 Coding rules

    +
    +

    2.4 Coding rules

    The authors should follow the recommendations of the C99 @@ -535,8 +535,8 @@ Compliance can be checked with cppcheck as:

    -
    -

    2.5 Design of the library

    +
    +

    2.5 Design of the library

    The proposed API should allow the library to: deal with memory transfers @@ -547,8 +547,8 @@ functions (see below).

    -
    -

    2.6 Naming conventions

    +
    +

    2.6 Naming conventions

    To avoid namespace collisions, we use qmckl_ as a prefix for all exported @@ -573,8 +573,8 @@ form is allowed.

    -
    -

    2.7 Application programming interface

    +
    +

    2.7 Application programming interface

    In the C language, the number of bits used by the integer types can change @@ -606,15 +606,15 @@ bindings in other languages in other repositories.

    -
    -

    2.8 Global state

    +
    +

    2.8 Global state

    Global variables should be avoided in the library, because it is possible that one single program needs to use multiple instances of the library. To solve this problem we propose to use a pointer to a context variable, built by the library with the -qmckl_context_create function. The =context= contains the global +qmckl_context_create function. The =context= contains the global state of the library, and is used as the first argument of many QMCkl functions.

    @@ -628,8 +628,8 @@ the state is done by setters and getters, prefixed by
    -
    -

    2.9 Headers

    +
    +

    2.9 Headers

    A single qmckl.h header to be distributed by the library @@ -717,8 +717,8 @@ and the types definitions should be written in the *fh_type.f90 fil

    -
    -

    2.10 Low-level functions

    +
    +

    2.10 Low-level functions

    Low-level functions are very simple functions which are leaves of @@ -727,14 +727,14 @@ the function call tree (they don't call any other QMCkl function).

    These functions are pure, and unaware of the QMCkl -context. They are not allowed to allocate/deallocate memory, and +context. They are not allowed to allocate/deallocate memory, and if they need temporary memory it should be provided in input.

    -
    -

    2.11 High-level functions

    +
    +

    2.11 High-level functions

    High-level functions are at the top of the function call tree. @@ -747,27 +747,27 @@ temporary storage, to simplify the use of accelerators.

    The high-level functions should be pure, unless the introduction of non-purity is justified. All the side effects should be made in -the context variable. +the context variable.

    -
    -

    2.12 Numerical precision

    +
    +

    2.12 Numerical precision

    The number of bits of precision required for a function should be given as an input of low-level computational functions. This input will be used to define the values of the different thresholds that might be used to avoid computing unnecessary noise. High-level -functions will use the precision specified in the context +functions will use the precision specified in the context variable.

    -
    -

    2.13 Algorithms

    +
    +

    2.13 Algorithms

    Reducing the scaling of an algorithm usually implies also reducing @@ -783,7 +783,7 @@ implemented adapted to different problem sizes.

    Author: TREX CoE

    -

    Created: 2021-07-07 Wed 23:26

    +

    Created: 2021-07-08 Thu 06:58

    Validate

    diff --git a/qmckl_ao.html b/qmckl_ao.html index 6d95fbb..cc9990f 100644 --- a/qmckl_ao.html +++ b/qmckl_ao.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Atomic Orbitals @@ -333,69 +333,69 @@ for the JavaScript code in this tag.

    Table of Contents

    -
    -

    1 Context

    +
    +

    1 Context

    The following arrays are stored in the context: @@ -617,8 +617,8 @@ prim_factor = [ 1.0006253235944540e+01, 2.4169531573445120e+00, 7.96109248497664

    -
    -

    1.1 Data structure

    +
    +

    1.1 Data structure

    typedef struct qmckl_ao_basis_struct {
    @@ -684,8 +684,8 @@ this mechanism.
     
    -
    -

    1.2 Access functions

    +
    +

    1.2 Access functions

    When all the data for the AOs have been provided, the following @@ -699,8 +699,8 @@ function returns true.

    -
    -

    1.3 Initialization functions

    +
    +

    1.3 Initialization functions

    To set the basis set, all the following functions need to be @@ -735,17 +735,17 @@ the context.

    -
    -

    1.4 Fortran interfaces

    +
    +

    1.4 Fortran interfaces

    -
    -

    2 Radial part

    +
    +

    2 Radial part

    -
    -

    2.1 General functions for Gaussian basis functions

    +
    +

    2.1 General functions for Gaussian basis functions

    qmckl_ao_gaussian_vgl computes the values, gradients and @@ -977,18 +977,18 @@ Requirements

    -
    -

    2.2 TODO General functions for Slater basis functions

    +
    +

    2.2 TODO General functions for Slater basis functions

    -
    -

    2.3 TODO General functions for Radial functions on a grid

    +
    +

    2.3 TODO General functions for Radial functions on a grid

    -
    -

    2.4 DONE Computation of primitives

    +
    +

    2.4 DONE Computation of primitives

    -
    -

    2.4.1 Get

    +
    +

    2.4.1 Get

    qmckl_exit_code qmckl_get_ao_basis_primitive_vgl(qmckl_context context, double* const primitive_vgl);
    @@ -997,14 +997,14 @@ Requirements
     
    -
    -

    2.4.2 Provide

    +
    +

    2.4.2 Provide

    -
    -

    2.4.3 Compute

    +
    +

    2.4.3 Compute

    - +
    @@ -1148,12 +1148,12 @@ Requirements -
    -

    2.4.4 Test

    +
    +

    2.4.4 Test

    -
    -

    2.4.5 Ideas for improvement

    +
    +

    2.4.5 Ideas for improvement

    // m : walkers
    @@ -1190,12 +1190,12 @@ k=0;
     
    -
    -

    2.5 Computation of shells

    +
    +

    2.5 Computation of shells

    -
    -

    2.5.1 Get

    +
    +

    2.5.1 Get

    qmckl_exit_code qmckl_get_ao_basis_shell_vgl(qmckl_context context, double* const shell_vgl);
    @@ -1204,14 +1204,14 @@ k=0;
     
    -
    -

    2.5.2 Provide

    +
    +

    2.5.2 Provide

    -
    -

    2.5.3 Compute

    +
    +

    2.5.3 Compute

    -
    +
    @@ -1419,18 +1419,18 @@ k=0; -
    -

    2.5.4 Test

    +
    +

    2.5.4 Test

    -
    -

    3 Polynomial part

    +
    +

    3 Polynomial part

    -
    -

    3.1 General functions for Powers of \(x-X_i\)

    +
    +

    3.1 General functions for Powers of \(x-X_i\)

    The qmckl_ao_power function computes all the powers of the n @@ -1442,7 +1442,7 @@ the \(n\) points: \[ P_{ik} = X_i^k \]

    -
    +
    @@ -1500,8 +1500,8 @@ the \(n\) points:
    -
    -

    3.1.1 Requirements

    +
    +

    3.1.1 Requirements

    • context is not QMCKL_NULL_CONTEXT
    • @@ -1514,12 +1514,12 @@ the \(n\) points:
    -
    -

    3.1.2 C Header

    +
    +

    3.1.2 C Header

    qmckl_exit_code qmckl_ao_power (
    -              const qmckl_context context,
    +      const qmckl_context context,
           const int64_t n,
           const double* X,
           const int32_t* LMAX,
    @@ -1530,8 +1530,8 @@ the \(n\) points:
     
    -
    -

    3.1.3 Source

    +
    +

    3.1.3 Source

    integer function qmckl_ao_power_f(context, n, X, LMAX, P, ldp) result(info)
    @@ -1582,15 +1582,15 @@ the \(n\) points:
     
    -
    -

    3.1.4 C interface

    +
    +

    3.1.4 C interface

    -
    -

    3.1.5 Fortran interface

    +
    +

    3.1.5 Fortran interface

    -
    -

    3.1.6 Test

    +
    +

    3.1.6 Test

    integer(c_int32_t) function test_qmckl_ao_power(context) bind(C)
    @@ -1641,8 +1641,8 @@ the \(n\) points:
     
    -
    -

    3.2 General functions for Value, Gradient and Laplacian of a polynomial

    +
    +

    3.2 General functions for Value, Gradient and Laplacian of a polynomial

    A polynomial is centered on a nucleus \(\mathbf{R}_i\) @@ -1687,7 +1687,7 @@ Laplacians at a given point in space, of all polynomials with an angular momentum up to lmax.

    - +
    @@ -1766,8 +1766,8 @@ angular momentum up to lmax.
    -
    -

    3.2.1 Requirements

    +
    +

    3.2.1 Requirements

    • context is not QMCKL_NULL_CONTEXT
    • @@ -1792,12 +1792,12 @@ For example, with a=0, b=2 and c=1 the string is "yyz"
    -
    -

    3.2.2 C Header

    +
    +

    3.2.2 C Header

    qmckl_exit_code qmckl_ao_polynomial_vgl (
    -              const qmckl_context context,
    +      const qmckl_context context,
           const double* X,
           const double* R,
           const int32_t lmax,
    @@ -1811,8 +1811,8 @@ For example, with a=0, b=2 and c=1 the string is "yyz"
     
    -
    -

    3.2.3 Source

    +
    +

    3.2.3 Source

    integer function qmckl_ao_polynomial_vgl_f(context, X, R, lmax, n, L, ldl, VGL, ldv) result(info)
    @@ -1947,16 +1947,16 @@ For example, with a=0, b=2 and c=1 the string is "yyz"
     
    -
    -

    3.2.4 C interface

    +
    +

    3.2.4 C interface

    -
    -

    3.2.5 Fortran interface

    +
    +

    3.2.5 Fortran interface

    -
    -

    3.2.6 Test

    +
    +

    3.2.6 Test

    integer(c_int32_t) function test_qmckl_ao_polynomial_vgl(context) bind(C)
    @@ -2061,13 +2061,13 @@ assert(0 == test_qmckl_ao_polynomial_vgl(context));
     
    -
    -

    4 Combining radial and polynomial parts

    +
    +

    4 Combining radial and polynomial parts

    Author: TREX CoE

    -

    Created: 2021-07-07 Wed 23:26

    +

    Created: 2021-07-08 Thu 06:58

    Validate

    diff --git a/qmckl_context.html b/qmckl_context.html index 0bfb5d0..9445dd3 100644 --- a/qmckl_context.html +++ b/qmckl_context.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Context @@ -311,21 +311,21 @@ for the JavaScript code in this tag.

    Table of Contents

    -
    -

    1 Context handling

    +
    +

    1 Context handling

    The context variable is a handle for the state of the library, @@ -338,7 +338,7 @@ A value of QMCKL_NULL_CONTEXT for the context is equivalent to a

    -
    typedef int64_t qmckl_context ;
    +
    typedef int64_t qmckl_context ;
     #define QMCKL_NULL_CONTEXT (qmckl_context) 0
     
    @@ -356,8 +356,8 @@ and ctx is a qmckl_context_struct* pointer.

    -
    -

    1.1 Data structure

    +
    +

    1.1 Data structure

    The context keeps a ``date'' that allows to check which data needs @@ -367,7 +367,7 @@ coordinates are updated.

    When a new element is added to the context, the functions -qmcklcontextcreate, qmcklcontextdestroy and qmcklcontextcopy +qmcklcontextcreate, qmcklcontextdestroy and qmcklcontextcopy should be updated inorder to make deep copies.

    @@ -416,8 +416,8 @@ if the context is valid, QMCKL_NULL_CONTEXT otherwise.
    -
    -

    1.2 Creation

    +
    +

    1.2 Creation

    To create a new context, qmckl_context_create() should be used. @@ -502,8 +502,8 @@ To create a new context, qmckl_context_create() should be used.

    -
    -

    1.3 Locking

    +
    +

    1.3 Locking

    For thread safety, the context may be locked/unlocked. The lock is @@ -548,8 +548,8 @@ number of times the thread has locked it is saved in the

    -
    -

    1.4 TODO Copy

    +
    +

    1.4 TODO Copy

    qmckl_context_copy makes a deep copy of a context. It returns @@ -597,8 +597,8 @@ number of times the thread has locked it is saved in the

    -
    -

    1.5 Destroy

    +
    +

    1.5 Destroy

    The context is destroyed with qmckl_context_destroy, leaving the ancestors untouched. @@ -652,7 +652,7 @@ It frees the context, and returns the previous context.

    Author: TREX CoE

    -

    Created: 2021-07-07 Wed 23:26

    +

    Created: 2021-07-08 Thu 06:58

    Validate

    diff --git a/qmckl_distance.html b/qmckl_distance.html index 1b13f7b..a391c1d 100644 --- a/qmckl_distance.html +++ b/qmckl_distance.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Inter-particle distances @@ -333,50 +333,50 @@ for the JavaScript code in this tag.

    Table of Contents

    -
    -

    1 Squared distance

    +
    +

    1 Squared distance

    -
    -

    1.1 qmckl_distance_sq

    +
    +

    1.1 qmckl_distance_sq

    qmckl_distance_sq computes the matrix of the squared distances @@ -403,7 +403,7 @@ between all pairs of points in two sets, one point within each set: \]

    - +
    @@ -496,8 +496,8 @@ between all pairs of points in two sets, one point within each set:
    -
    -

    1.1.1 Requirements

    +
    +

    1.1.1 Requirements

    • context is not QMCKL_NULL_CONTEXT
    • @@ -515,12 +515,12 @@ between all pairs of points in two sets, one point within each set:
    -
    -

    1.1.2 C header

    +
    +

    1.1.2 C header

    qmckl_exit_code qmckl_distance_rescaled_deriv_e (
    -              const qmckl_context context,
    +      const qmckl_context context,
           const char transa,
           const char transb,
           const int64_t m,
    @@ -536,8 +536,8 @@ between all pairs of points in two sets, one point within each set:
     
    -
    -

    1.1.3 Source

    +
    +

    1.1.3 Source

    integer function qmckl_distance_sq_f(context, transa, transb, m, n, &
    @@ -672,8 +672,8 @@ between all pairs of points in two sets, one point within each set:
     
    -
    -

    1.1.4 Performance

    +
    +

    1.1.4 Performance

    This function is more efficient when A and B are @@ -683,12 +683,12 @@ transposed.

    -
    -

    2 Distance

    +
    +

    2 Distance

    -
    -

    2.1 qmckl_distance

    +
    +

    2.1 qmckl_distance

    qmckl_distance computes the matrix of the distances between all @@ -706,7 +706,7 @@ If the input array is normal ('N'), the xyz coordinates are in the leading dimension: [n][3] in C and (3,n) in Fortran.

    - +
    @@ -799,8 +799,8 @@ the leading dimension: [n][3] in C and (3,n) in Fortra
    -
    -

    2.1.1 Requirements

    +
    +

    2.1.1 Requirements

    • context is not QMCKL_NULL_CONTEXT
    • @@ -818,12 +818,12 @@ the leading dimension: [n][3] in C and (3,n) in Fortra
    -
    -

    2.1.2 C header

    +
    +

    2.1.2 C header

    qmckl_exit_code qmckl_distance_rescaled_deriv_e (
    -              const qmckl_context context,
    +      const qmckl_context context,
           const char transa,
           const char transb,
           const int64_t m,
    @@ -839,8 +839,8 @@ the leading dimension: [n][3] in C and (3,n) in Fortra
     
    -
    -

    2.1.3 Source

    +
    +

    2.1.3 Source

    integer function qmckl_distance_f(context, transa, transb, m, n, &
    @@ -1007,8 +1007,8 @@ the leading dimension: [n][3] in C and (3,n) in Fortra
     
    -
    -

    2.1.4 Performance

    +
    +

    2.1.4 Performance

    This function is more efficient when A and B are transposed. @@ -1018,12 +1018,12 @@ This function is more efficient when A and B are trans

    -
    -

    3 Rescaled Distance

    +
    +

    3 Rescaled Distance

    -
    -

    3.1 qmckl_distance_rescaled

    +
    +

    3.1 qmckl_distance_rescaled

    qmckl_distance_rescaled computes the matrix of the rescaled distances between all @@ -1041,7 +1041,7 @@ If the input array is normal ('N'), the xyz coordinates are in the leading dimension: [n][3] in C and (3,n) in Fortran.

    - +
    @@ -1141,8 +1141,8 @@ the leading dimension: [n][3] in C and (3,n) in Fortra
    -
    -

    3.1.1 Requirements

    +
    +

    3.1.1 Requirements

    • context is not QMCKL_NULL_CONTEXT
    • @@ -1160,12 +1160,12 @@ the leading dimension: [n][3] in C and (3,n) in Fortra
    -
    -

    3.1.2 C header

    +
    +

    3.1.2 C header

    qmckl_exit_code qmckl_distance_rescaled_deriv_e (
    -              const qmckl_context context,
    +      const qmckl_context context,
           const char transa,
           const char transb,
           const int64_t m,
    @@ -1182,8 +1182,8 @@ the leading dimension: [n][3] in C and (3,n) in Fortra
     
    -
    -

    3.1.3 Source

    +
    +

    3.1.3 Source

    integer function qmckl_distance_rescaled_f(context, transa, transb, m, n, &
    @@ -1235,7 +1235,7 @@ the leading dimension: [n][3] in C and (3,n) in Fortra
     
       if (transb == 'N' .or. transb == 'n') then
          continue
    -  else if (transa == 'T' .or. transa == 't') then
    +  else if (transb == 'T' .or. transb == 't') then
          transab = transab + 2
       else
          transab = -100
    @@ -1353,8 +1353,8 @@ the leading dimension: [n][3] in C and (3,n) in Fortra
     
    -
    -

    3.1.4 Performance

    +
    +

    3.1.4 Performance

    This function is more efficient when A and B are transposed. @@ -1363,12 +1363,12 @@ This function is more efficient when A and B are trans

    -
    -

    4 Rescaled Distance Derivatives

    +
    +

    4 Rescaled Distance Derivatives

    -
    -

    4.1 qmckl_distance_rescaled_deriv_e

    +
    +

    4.1 qmckl_distance_rescaled_deriv_e

    qmckl_distance_rescaled_deriv_e computes the matrix of the gradient and laplacian of the @@ -1435,7 +1435,7 @@ If the input array is normal ('N'), the xyz coordinates are in the leading dimension: [n][3] in C and (3,n) in Fortran.

    - +
    @@ -1535,8 +1535,8 @@ the leading dimension: [n][3] in C and (3,n) in Fortra
    -
    -

    4.1.1 Requirements

    +
    +

    4.1.1 Requirements

    • context is not QMCKL_NULL_CONTEXT
    • @@ -1554,12 +1554,12 @@ the leading dimension: [n][3] in C and (3,n) in Fortra
    -
    -

    4.1.2 C header

    +
    +

    4.1.2 C header

    qmckl_exit_code qmckl_distance_rescaled_deriv_e (
    -              const qmckl_context context,
    +      const qmckl_context context,
           const char transa,
           const char transb,
           const int64_t m,
    @@ -1576,8 +1576,8 @@ the leading dimension: [n][3] in C and (3,n) in Fortra
     
    -
    -

    4.1.3 Source

    +
    +

    4.1.3 Source

    integer function qmckl_distance_rescaled_deriv_e_f(context, transa, transb, m, n, &
    @@ -1768,8 +1768,8 @@ the leading dimension: [n][3] in C and (3,n) in Fortra
     
    -
    -

    4.1.4 Performance

    +
    +

    4.1.4 Performance

    This function is more efficient when A and B are transposed. @@ -1781,7 +1781,7 @@ This function is more efficient when A and B are trans

    Author: TREX CoE

    -

    Created: 2021-07-07 Wed 23:26

    +

    Created: 2021-07-08 Thu 06:58

    Validate

    diff --git a/qmckl_electron.html b/qmckl_electron.html index 5534958..4f0ba4b 100644 --- a/qmckl_electron.html +++ b/qmckl_electron.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Electrons @@ -333,63 +333,63 @@ for the JavaScript code in this tag.

    Table of Contents

    -
    -

    1 Context

    +
    +

    1 Context

    The following data stored in the context: @@ -544,7 +544,7 @@ The following data stored in the context: en_distance_rescaled_deriv_e -double[walk_num][4][num][num] +double[walk_num][4][nucl_num][num] Electron-electron rescaled distances derivatives @@ -557,9 +557,8 @@ The following data stored in the context:

    - -
    -

    1.1 Data structure

    +
    +

    1.1 Data structure

    typedef struct qmckl_electron_struct {
    @@ -634,8 +633,8 @@ this mechanism.
     
    -
    -

    1.2 Access functions

    +
    +

    1.2 Access functions

    Access functions return QMCKL_SUCCESS when the data has been @@ -647,12 +646,12 @@ contains the requested data. Otherwise, this variable is untouched.

    -
    -

    1.2.1 Number of electrons

    +
    +

    1.2.1 Number of electrons

    -
    -

    1.2.2 Number of walkers

    +
    +

    1.2.2 Number of walkers

    A walker is a set of electron coordinates that are arguments of @@ -661,12 +660,12 @@ the wave function. walk_num is the number of walkers.

    -
    -

    1.2.3 Scaling factors Kappa

    +
    +

    1.2.3 Scaling factors Kappa

    -
    -

    1.2.4 Electron coordinates

    +
    +

    1.2.4 Electron coordinates

    Returns the current electron coordinates. The pointer is assumed @@ -710,8 +709,8 @@ The order of the indices is:

    -
    -

    1.3 Initialization functions

    +
    +

    1.3 Initialization functions

    To set the data relative to the electrons in the context, the @@ -798,8 +797,8 @@ in the context.

    -
    -

    1.4 Test

    +
    +

    1.4 Test

    /* Reference input data */
    @@ -905,8 +904,8 @@ rc = qmckl_get_electron_coord (context, 'N'
     
    -
    -

    2 Computation

    +
    +

    2 Computation

    The computed data is stored in the context so that it can be reused @@ -919,12 +918,12 @@ current date is stored.

    -
    -

    2.1 Electron-electron distances

    +
    +

    2.1 Electron-electron distances

    -
    -

    2.1.1 Get

    +
    +

    2.1.1 Get

    qmckl_exit_code qmckl_get_electron_ee_distance(qmckl_context context, double* const distance);
    @@ -933,10 +932,10 @@ current date is stored.
     
    -
    -

    2.1.2 Compute

    +
    +

    2.1.2 Compute

    - +
    @@ -1032,8 +1031,8 @@ current date is stored. -
    -

    2.1.3 Test

    +
    +

    2.1.3 Test

    assert(qmckl_electron_provided(context));
    @@ -1067,8 +1066,8 @@ rc = qmckl_get_electron_ee_distance(context, ee_distance);
     
    -
    -

    2.2 Electron-electron rescaled distances

    +
    +

    2.2 Electron-electron rescaled distances

    ee_distance_rescaled stores the matrix of the rescaled distances between all @@ -1086,8 +1085,8 @@ where \(C_{ij}\) is the matrix of electron-electron distances.

    -
    -

    2.2.1 Get

    +
    +

    2.2.1 Get

    qmckl_exit_code qmckl_get_electron_ee_distance_rescaled(qmckl_context context, double* const distance_rescaled);
    @@ -1096,10 +1095,10 @@ where \(C_{ij}\) is the matrix of electron-electron distances.
     
    -
    -

    2.2.2 Compute

    +
    +

    2.2.2 Compute

    -
    +
    @@ -1204,8 +1203,8 @@ where \(C_{ij}\) is the matrix of electron-electron distances. -
    -

    2.2.3 Test

    +
    +

    2.2.3 Test

    assert(qmckl_electron_provided(context));
    @@ -1239,8 +1238,8 @@ rc = qmckl_get_electron_ee_distance_rescaled(context, ee_distance_rescaled);
     
    -
    -

    2.3 Electron-electron rescaled distance gradients and laplacian with respect to electron coords

    +
    +

    2.3 Electron-electron rescaled distance gradients and laplacian with respect to electron coords

    The rescaled distances which is given as \(R = (1 - \exp{-\kappa r})/\kappa\) @@ -1252,8 +1251,8 @@ gives the Laplacian \(\partial x^2 + \partial y^2 + \partial z^2\).

    -
    -

    2.3.1 Get

    +
    +

    2.3.1 Get

    qmckl_exit_code qmckl_get_electron_ee_distance_rescaled_deriv_e(qmckl_context context, double* const distance_rescaled_deriv_e);
    @@ -1262,10 +1261,10 @@ gives the Laplacian \(\partial x^2 + \partial y^2 + \partial z^2\).
     
    -
    -

    2.3.2 Compute

    +
    +

    2.3.2 Compute

    -
    +
    @@ -1370,8 +1369,8 @@ gives the Laplacian \(\partial x^2 + \partial y^2 + \partial z^2\). -
    -

    2.3.3 Test

    +
    +

    2.3.3 Test

    assert(qmckl_electron_provided(context));
    @@ -1406,13 +1405,12 @@ rc = qmckl_get_electron_ee_distance_rescaled_deriv_e(context, ee_distance_rescal
     
    - -
    -

    2.4 Electron-nucleus distances

    +
    +

    2.4 Electron-nucleus distances

    -
    -

    2.4.1 Get

    +
    +

    2.4.1 Get

    qmckl_exit_code qmckl_get_electron_en_distance(qmckl_context context, double* distance);
    @@ -1421,10 +1419,10 @@ rc = qmckl_get_electron_ee_distance_rescaled_deriv_e(context, ee_distance_rescal
     
    -
    -

    2.4.2 Compute

    +
    +

    2.4.2 Compute

    -
    +
    @@ -1541,8 +1539,8 @@ rc = qmckl_get_electron_ee_distance_rescaled_deriv_e(context, ee_distance_rescal -
    -

    2.4.3 Test

    +
    +

    2.4.3 Test

    @@ -1590,8 +1588,8 @@ rc = qmckl_get_electron_en_distance(context, &(en_distance[0][0][0]));
     
    -
    -

    2.5 Electron-nucleus rescaled distances

    +
    +

    2.5 Electron-nucleus rescaled distances

    en_distance_rescaled stores the matrix of the rescaled distances between @@ -1609,8 +1607,8 @@ where \(C_{ij}\) is the matrix of electron-nucleus distances.

    -
    -

    2.5.1 Get

    +
    +

    2.5.1 Get

    qmckl_exit_code qmckl_get_electron_en_distance_rescaled(qmckl_context context, double* distance_rescaled);
    @@ -1619,10 +1617,10 @@ where \(C_{ij}\) is the matrix of electron-nucleus distances.
     
    -
    -

    2.5.2 Compute

    +
    +

    2.5.2 Compute

    -
    +
    @@ -1754,8 +1752,8 @@ where \(C_{ij}\) is the matrix of electron-nucleus distances. -
    -

    2.5.3 Test

    +
    +

    2.5.3 Test

    @@ -1803,21 +1801,21 @@ rc = qmckl_get_electron_en_distance_rescaled(context, &(en_distance_rescaled
     
    -
    -

    2.6 Electron-nucleus rescaled distance gradients and laplacian with respect to electron coords

    +
    +

    2.6 Electron-nucleus rescaled distance gradients and laplacian with respect to electron coords

    The rescaled distances which is given as \(R = (1 - \exp{-\kappa r})/\kappa\) needs to be perturbed with respect to the nuclear coordinates. This data is stored in the en_distance_rescaled_deriv_e tensor. The -The first three elements of this three index tensor [4][num][num] gives the +The first three elements of this three index tensor [4][nucl_num][elec_num] gives the derivatives in the x, y, and z directions \(dx, dy, dz\) and the last index gives the Laplacian \(\partial x^2 + \partial y^2 + \partial z^2\).

    -
    -

    2.6.1 Get

    +
    +

    2.6.1 Get

    qmckl_exit_code qmckl_get_electron_en_distance_rescaled_deriv_e(qmckl_context context, double* distance_rescaled_deriv_e);
    @@ -1826,10 +1824,10 @@ gives the Laplacian \(\partial x^2 + \partial y^2 + \partial z^2\).
     
    -
    -

    2.6.2 Compute

    +
    +

    2.6.2 Compute

    -
    +
    @@ -1962,8 +1960,8 @@ gives the Laplacian \(\partial x^2 + \partial y^2 + \partial z^2\). -
    -

    2.6.3 Test

    +
    +

    2.6.3 Test

    @@ -2018,7 +2016,7 @@ rc = qmckl_get_electron_en_distance_rescaled_deriv_e(context, &(en_distance_
     

    Author: TREX CoE

    -

    Created: 2021-07-07 Wed 23:26

    +

    Created: 2021-07-08 Thu 06:58

    Validate

    diff --git a/qmckl_error.html b/qmckl_error.html index da63366..84fc436 100644 --- a/qmckl_error.html +++ b/qmckl_error.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Error handling @@ -311,17 +311,17 @@ for the JavaScript code in this tag.

    Table of Contents

    -
    -

    1 Decoding errors

    +
    +

    1 Decoding errors

    To decode the error messages, qmckl_string_of_error converts an @@ -451,8 +451,8 @@ The text strings are extracted from the previous table.

    -
    -

    2 Data structure in context

    +
    +

    2 Data structure in context

    The strings are declared with a maximum fixed size to avoid @@ -475,8 +475,8 @@ dynamic memory allocation.

    -
    -

    3 Updating errors in the context

    +
    +

    3 Updating errors in the context

    The error is updated in the context using qmckl_set_error. @@ -522,8 +522,8 @@ explaining the error. The exit code can't be QMCKL_SUCCESS.

    -
    -

    4 Get the error

    +
    +

    4 Get the error

    Upon error, the error type and message can be obtained from the @@ -564,8 +564,8 @@ function name and message is mandatory.

    -
    -

    5 Failing

    +
    +

    5 Failing

    To make a function fail, the qmckl_failwith function should be @@ -628,7 +628,7 @@ For example, this function can be used as

    Author: TREX CoE

    -

    Created: 2021-07-07 Wed 23:26

    +

    Created: 2021-07-08 Thu 06:58

    Validate

    diff --git a/qmckl_jastrow.html b/qmckl_jastrow.html new file mode 100644 index 0000000..64bb7d0 --- /dev/null +++ b/qmckl_jastrow.html @@ -0,0 +1,4126 @@ + + + + + + + +Jastrow Factor + + + + + + + + + + + + + +
    + UP + | + HOME +
    +

    Jastrow Factor

    + + +
    +

    1 Context

    +
    +

    +The following data stored in the context: +

    + +
    + + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int32_tuninitializedinKeeps bit set for uninitialized data
    int64_taord_numinThe number of a coeffecients
    int64_tbord_numinThe number of b coeffecients
    int64_tcord_numinThe number of c coeffecients
    int64_ttype_nucl_numinNumber of Nucleii types
    int64_ttype_nucl_vector[nucl_num]inIDs of types of Nucleii
    doubleaord_vector[aord_num + 1][type_nucl_num]inOrder of a polynomial coefficients
    doublebord_vector[bord_num + 1]inOrder of b polynomial coefficients
    doublecord_vector[cord_num][type_nucl_num]inOrder of c polynomial coefficients
    doublefactor_ee[walk_num]outJastrow factor: electron-electron part
    uint64_tfactor_ee_dateoutJastrow factor: electron-electron part
    doublefactor_en[walk_num]outJastrow factor: electron-nucleus part
    uint64_tfactor_en_dateoutJastrow factor: electron-nucleus part
    doublefactor_een[walk_num]outJastrow factor: electron-electron-nucleus part
    uint64_tfactor_een_dateoutJastrow factor: electron-electron-nucleus part
    doublefactor_ee_deriv_e[4][nelec][walk_num]outDerivative of the Jastrow factor: electron-electron-nucleus part
    uint64_tfactor_ee_deriv_e_dateoutKeep track of the date for the derivative
    doublefactor_en_deriv_e[4][nelec][walk_num]outDerivative of the Jastrow factor: electron-electron-nucleus part
    uint64_tfactor_en_deriv_e_dateoutKeep track of the date for the en derivative
    doublefactor_een_deriv_e[4][nelec][walk_num]outDerivative of the Jastrow factor: electron-electron-nucleus part
    uint64_tfactor_een_deriv_e_dateoutKeep track of the date for the een derivative
    + +

    +computed data: +

    + + + + +++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    int64_tdim_cord_vectNumber of unique C coefficients
    uint64_tdim_cord_vect_dateNumber of unique C coefficients
    doubleasymp_jasb[2]Asymptotic component
    uint64_tasymp_jasb_dateAsymptotic component
    doublecord_vect_full[dim_cord_vect][nucl_num]vector of non-zero coefficients
    uint64_tcord_vect_full_dateKeep track of changes here
    int64_tlkpm_combined_index[4][dim_cord_vect]Transform l,k,p, and m into consecutive indices
    uint64_tlkpm_combined_index_dateTransform l,k,p, and m into consecutive indices
    doubletmp_c[elec_num][nucl_num][ncord + 1][ncord][walk_num]vector of non-zero coefficients
    doubledtmp_c[elec_num][4][nucl_num][ncord + 1][ncord][walk_num]vector of non-zero coefficients
    doubleeen_rescaled_e[walk_num][elec_num][elec_num][0:cord_num]The electron-electron rescaled distances raised to the powers defined by cord
    uint64_teen_rescaled_e_dateKeep track of the date of creation
    doubleeen_rescaled_n[walk_num][elec_num][nucl_num][0:cord_num]The electron-electron rescaled distances raised to the powers defined by cord
    uint64_teen_rescaled_n_dateKeep track of the date of creation
    doubleeen_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
    uint64_teen_rescaled_e_deriv_e_dateKeep track of the date of creation
    doubleeen_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
    uint64_teen_rescaled_n_deriv_e_dateKeep track of the date of creation
    + +

    +For H2O we have the following data: +

    + +
    +
    import numpy as np
    +
    +elec_num     = 10
    +nucl_num     = 2
    +up_num       = 5
    +down_num     = 5
    +nucl_coord = np.array([ [0.000000,  0.000000 ],
    +   [0.000000,  0.000000 ],
    +   [0.000000,  2.059801 ] ])
    +
    +elec_coord =    [[[-0.250655104764153      ,  0.503070975550133      ,  -0.166554344502303],
    +     [-0.587812193472177      , -0.128751981129274      ,   0.187773606533075], 
    +     [ 1.61335569047166       , -0.615556732874863      ,  -1.43165470979934 ],
    +     [-4.901239896295210E-003 , -1.120440036458986E-002 ,   1.99761909330422 ],
    +     [ 0.766647499681200      , -0.293515395797937      ,   3.66454589201239 ],
    +     [-0.127732483187947      , -0.138975497694196      ,  -8.669850480215846E-002],
    +     [-0.232271834949124      , -1.059321673434182E-002 ,  -0.504862241464867],
    +     [ 1.09360863531826       , -2.036103063808752E-003 ,  -2.702796910818986E-002],
    +     [-0.108090166832043      ,  0.189161729653261      ,   2.15398313919894],
    +     [ 0.397978144318712      , -0.254277292595981      ,   2.54553335476344]]];
    +
    +ee_distance_rescaled = [
    +[ 0.000000000000000E+000 ,0.000000000000000E+000 ,0.000000000000000E+000,
    +  0.000000000000000E+000 ,0.000000000000000E+000 ,0.000000000000000E+000,
    +  0.000000000000000E+000 ,0.000000000000000E+000 ,0.000000000000000E+000,
    +  0.000000000000000E+000],
    +[ 0.550227800352402      ,0.000000000000000E+000 ,0.000000000000000E+000,
    +  0.000000000000000E+000 ,0.000000000000000E+000 ,0.000000000000000E+000,
    +  0.000000000000000E+000 ,0.000000000000000E+000 ,0.000000000000000E+000,
    +  0.000000000000000E+000],
    +[ 0.919155060185168      ,0.937695909123175      ,0.000000000000000E+000,
    +  0.000000000000000E+000 ,0.000000000000000E+000 ,0.000000000000000E+000,
    +  0.000000000000000E+000 ,0.000000000000000E+000 ,0.000000000000000E+000,
    +  0.000000000000000E+000],
    +[ 0.893325429242815      ,0.851181978173561      ,0.978501685226877     ,
    +  0.000000000000000E+000 ,0.000000000000000E+000 ,0.000000000000000E+000,
    +  0.000000000000000E+000 ,0.000000000000000E+000 ,0.000000000000000E+000,
    +  0.000000000000000E+000],
    +[ 0.982457268305353      ,0.976125002619471      ,0.994349933143149     ,
    +  0.844077311588328      ,0.000000000000000E+000 ,0.000000000000000E+000,
    +  0.000000000000000E+000 ,0.000000000000000E+000 ,0.000000000000000E+000,
    +  0.000000000000000E+000],
    +[ 0.482407528408731      ,0.414816073699124      ,0.894716035479343     ,
    +  0.876540187084407      ,0.978921170036895      ,0.000000000000000E+000,
    +  0.000000000000000E+000 ,0.000000000000000E+000 ,0.000000000000000E+000,
    +  0.000000000000000E+000],
    +[ 0.459541909660400      ,0.545007215761510      ,0.883752955884551     ,
    +  0.918958134888791      ,0.986386936267237      ,0.362209822236419     ,
    +  0.000000000000000E+000 ,0.000000000000000E+000 ,0.000000000000000E+000,
    +  0.000000000000000E+000],
    +[ 0.763732576854455      ,0.817282762358449      ,0.801802919535959     ,
    +  0.900089095449775      ,0.975704636491453      ,0.707836537586060     ,
    +  0.755705808346586      ,0.000000000000000E+000 ,0.000000000000000E+000,
    +  0.000000000000000E+000],
    +[ 0.904249454052971      ,0.871097965261373      ,0.982717262706270     ,
    +  0.239901207363622      ,0.836519456769083      ,0.896135326270534     ,
    +  0.930694340243023      ,0.917708540815567      ,0.000000000000000E+000,
    +  0.000000000000000E+000],
    +[ 0.944400908070716      ,0.922589018494961      ,0.984615718580670     ,
    +  0.514328661540623      ,0.692362267147064      ,0.931894098453677     ,
    +  0.956034127544344      ,0.931221472309472      ,0.540903688625053     ,
    +  0.000000000000000E+000]]
    +
    +en_distance_rescaled = np.transpose(np.array([
    +[ 0.443570948411811  ,    0.467602196999105    ,  0.893870160799932 ,   
    +  0.864347190364447  ,    0.976608182392358    ,  0.187563183468210 ,   
    +  0.426404699872689  ,    0.665107090128166    ,  0.885246991424583 ,   
    +  0.924902909715270     ],
    +[ 0.899360150637444     , 0.860035135365386   ,   0.979659405613798 ,   
    +  6.140678415933776E-002, 0.835118398056681   ,   0.884071658981068 ,   
    +  0.923860000907362     , 0.905203414522289   ,   0.211286300932359 ,   
    +  0.492104840907350 ]]))
    +
    +# symmetrize it
    +for i in range(elec_num):
    +  for j in range(elec_num):
    +    ee_distance_rescaled[i][j] = ee_distance_rescaled[j][i]
    +
    +type_nucl_num = 1
    +aord_num     = 5
    +bord_num     = 5
    +cord_num     = 23
    +dim_cord_vect= 23
    +type_nucl_vector = [ 1, 1]
    +aord_vector = [ 
    +[0.000000000000000E+000],
    +[0.000000000000000E+000],
    +[-0.380512000000000E+000],
    +[-0.157996000000000E+000],
    +[-3.155800000000000E-002],
    +[2.151200000000000E-002]]
    +
    +bord_vector = [ 0.500000000000000E-000,  0.153660000000000E-000,  6.722620000000000E-002,
    +  2.157000000000000E-002,  7.309600000000000E-003,  2.866000000000000E-003]
    +cord_vector = [ 0.571702000000000E-000, -0.514253000000000E-000, -0.513043000000000E-000, 
    +  9.486000000000000E-003, -4.205000000000000E-003,  0.426325800000000E-000,
    +  8.288150000000000E-002,  5.118600000000000E-003, -2.997800000000000E-003,
    + -5.270400000000000E-003, -7.499999999999999E-005, -8.301649999999999E-002,
    +  1.454340000000000E-002,  5.143510000000000E-002,  9.250000000000000E-004,
    + -4.099100000000000E-003,  4.327600000000000E-003, -1.654470000000000E-003,
    +  2.614000000000000E-003, -1.477000000000000E-003, -1.137000000000000E-003,
    + -4.010475000000000E-002,  6.106710000000000E-003 ]
    +cord_vector_full = [
    +[ 0.571702000000000E-000, -0.514253000000000E-000, -0.513043000000000E-000, 
    +  9.486000000000000E-003, -4.205000000000000E-003,  0.426325800000000E-000,
    +  8.288150000000000E-002,  5.118600000000000E-003, -2.997800000000000E-003,
    + -5.270400000000000E-003, -7.499999999999999E-005, -8.301649999999999E-002,
    +  1.454340000000000E-002,  5.143510000000000E-002,  9.250000000000000E-004,
    + -4.099100000000000E-003,  4.327600000000000E-003, -1.654470000000000E-003,
    +  2.614000000000000E-003, -1.477000000000000E-003, -1.137000000000000E-003,
    + -4.010475000000000E-002,  6.106710000000000E-003 ],
    +[ 0.571702000000000E-000, -0.514253000000000E-000, -0.513043000000000E-000, 
    +  9.486000000000000E-003, -4.205000000000000E-003,  0.426325800000000E-000,
    +  8.288150000000000E-002,  5.118600000000000E-003, -2.997800000000000E-003,
    + -5.270400000000000E-003, -7.499999999999999E-005, -8.301649999999999E-002,
    +  1.454340000000000E-002,  5.143510000000000E-002,  9.250000000000000E-004,
    + -4.099100000000000E-003,  4.327600000000000E-003, -1.654470000000000E-003,
    +  2.614000000000000E-003, -1.477000000000000E-003, -1.137000000000000E-003,
    + -4.010475000000000E-002,  6.106710000000000E-003 ],
    +]
    +lkpm_combined_index = [[1 , 1 , 2 , 0], 
    +          [0 , 0 , 2 , 1],
    +          [1 , 2 , 3 , 0],
    +          [2 , 1 , 3 , 0],
    +          [0 , 1 , 3 , 1],
    +          [1 , 0 , 3 , 1],
    +          [1 , 3 , 4 , 0],
    +          [2 , 2 , 4 , 0],
    +          [0 , 2 , 4 , 1],
    +          [3 , 1 , 4 , 0],
    +          [1 , 1 , 4 , 1],
    +          [2 , 0 , 4 , 1],
    +          [0 , 0 , 4 , 2],
    +          [1 , 4 , 5 , 0],
    +          [2 , 3 , 5 , 0],
    +          [0 , 3 , 5 , 1],
    +          [3 , 2 , 5 , 0],
    +          [1 , 2 , 5 , 1],
    +          [4 , 1 , 5 , 0],
    +          [2 , 1 , 5 , 1],
    +          [0 , 1 , 5 , 2],
    +          [3 , 0 , 5 , 1],
    +          [1 , 0 , 5 , 2]]
    +
    +kappa     = 1.0
    +kappa_inv = 1.0/kappa
    +
    +
    +
    + +
    +

    1.1 Data structure

    +
    +
    +
    typedef struct qmckl_jastrow_struct{
    +  int32_t  uninitialized;
    +  int64_t  aord_num;
    +  int64_t  bord_num;
    +  int64_t  cord_num;
    +  int64_t  type_nucl_num;
    +  uint64_t  asymp_jasb_date;
    +  uint64_t  tmp_c_date;
    +  uint64_t  dtmp_c_date;
    +  uint64_t  factor_ee_date;
    +  uint64_t  factor_en_date;
    +  uint64_t  factor_een_date;
    +  uint64_t  factor_ee_deriv_e_date;
    +  uint64_t  factor_en_deriv_e_date;
    +  uint64_t  factor_een_deriv_e_date;
    +  int64_t* type_nucl_vector;
    +  double * aord_vector;
    +  double * bord_vector;
    +  double * cord_vector;
    +  double * asymp_jasb;
    +  double * factor_ee;
    +  double * factor_en;
    +  double * factor_een;
    +  double * factor_ee_deriv_e;
    +  double * factor_en_deriv_e;
    +  double * factor_een_deriv_e;
    +  int64_t  dim_cord_vect;
    +  uint64_t  dim_cord_vect_date;
    +  double * cord_vect_full;
    +  uint64_t  cord_vect_full_date;
    +  int64_t* lkpm_combined_index;
    +  uint64_t  lkpm_combined_index_date;
    +  double * tmp_c;
    +  double * dtmp_c;
    +  double * een_rescaled_e;
    +  double * een_rescaled_n;
    +  uint64_t  een_rescaled_e_date;
    +  uint64_t  een_rescaled_n_date;
    +  double * een_rescaled_e_deriv_e;
    +  double * een_rescaled_n_deriv_e;
    +  uint64_t  een_rescaled_e_deriv_e_date;
    +  uint64_t  een_rescaled_n_deriv_e_date;
    +  bool     provided;
    +  char *   type;
    +} qmckl_jastrow_struct;
    +
    +
    + + +

    +The uninitialized integer contains one bit set to one for each +initialization function which has not been called. It becomes equal +to zero after all initialization functions have been called. The +struct is then initialized and provided == true. +Some values are initialized by default, and are not concerned by +this mechanism. +

    + +
    +
    qmckl_exit_code qmckl_init_jastrow(qmckl_context context);
    +
    +
    + +
    +
    qmckl_exit_code qmckl_init_jastrow(qmckl_context context) {
    +
    +  if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
    +    return false;
    +  }
    +
    +  qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
    +  assert (ctx != NULL);
    +
    +  ctx->jastrow.uninitialized = (1 << 6) - 1;
    +
    +  /* Default values */
    +
    +  return QMCKL_SUCCESS;
    +}
    +
    +
    +
    +
    + +
    +

    1.2 Access functions

    +
    +

    +Along with these core functions, calculation of the jastrow factor +requires the following additional information to be set: +

    + + +

    +When all the data for the AOs have been provided, the following +function returns true. +

    + +
    +
    bool      qmckl_jastrow_provided           (const qmckl_context context);
    +
    +
    +
    +
    + +
    +

    1.3 Initialization functions

    +
    +

    +To prepare for the Jastrow and its derivative, all the following functions need to be +called. +

    + +
    +
    qmckl_exit_code  qmckl_set_jastrow_ord_num           (qmckl_context context, const int64_t aord_num, const int64_t bord_num, const int64_t cord_num);
    +qmckl_exit_code  qmckl_set_jastrow_type_nucl_num     (qmckl_context context, const int64_t type_nucl_num);
    +qmckl_exit_code  qmckl_set_jastrow_type_nucl_vector  (qmckl_context context, const int64_t* type_nucl_vector, const int64_t nucl_num);
    +qmckl_exit_code  qmckl_set_jastrow_aord_vector       (qmckl_context context, const double * aord_vector);
    +qmckl_exit_code  qmckl_set_jastrow_bord_vector       (qmckl_context context, const double * bord_vector);
    +qmckl_exit_code  qmckl_set_jastrow_cord_vector       (qmckl_context context, const double * cord_vector);
    +qmckl_exit_code  qmckl_set_jastrow_dependencies      (qmckl_context context);
    +
    +
    + +

    +When the required information is completely entered, other data structures are +computed to accelerate the calculations. The intermediates factors +are precontracted using BLAS LEVEL 3 operations for an optimal FLOP count. +

    +
    +
    + +
    +

    1.4 Test

    +
    +
    +
    /* Reference input data */
    +int64_t walk_num      = n2_walk_num;
    +int64_t elec_num      = n2_elec_num;
    +int64_t elec_up_num   = n2_elec_up_num;
    +int64_t elec_dn_num   = n2_elec_dn_num;
    +double  rescale_factor_kappa_ee   = 1.0;
    +double  rescale_factor_kappa_en   = 1.0;
    +double  nucl_rescale_factor_kappa = 1.0;
    +double* elec_coord    = &(n2_elec_coord[0][0][0]);
    +
    +const double*   nucl_charge   = n2_charge;
    +int64_t  nucl_num      = n2_nucl_num;
    +double*  charge        = n2_charge;
    +double*  nucl_coord    = &(n2_nucl_coord[0][0]);
    +
    +/* Provide Electron data */
    +
    +qmckl_exit_code rc;
    +
    +assert(!qmckl_electron_provided(context));
    +
    +int64_t n;
    +rc = qmckl_get_electron_num (context, &n);
    +assert(rc == QMCKL_NOT_PROVIDED);
    +
    +rc = qmckl_get_electron_up_num (context, &n);
    +assert(rc == QMCKL_NOT_PROVIDED);
    +
    +rc = qmckl_get_electron_down_num (context, &n);
    +assert(rc == QMCKL_NOT_PROVIDED);
    +
    +
    +rc = qmckl_set_electron_num (context, elec_up_num, elec_dn_num);
    +assert(rc == QMCKL_SUCCESS);
    +assert(!qmckl_electron_provided(context));
    +
    +rc = qmckl_get_electron_up_num (context, &n);
    +assert(rc == QMCKL_SUCCESS);
    +assert(n == elec_up_num);
    +
    +rc = qmckl_get_electron_down_num (context, &n);
    +assert(rc == QMCKL_SUCCESS);
    +assert(n == elec_dn_num);
    +
    +rc = qmckl_get_electron_num (context, &n);
    +assert(rc == QMCKL_SUCCESS);
    +assert(n == elec_num);
    +
    +double k_ee = 0.;
    +double k_en = 0.;
    +rc = qmckl_get_electron_rescale_factor_ee (context, &k_ee);
    +assert(rc == QMCKL_SUCCESS);
    +assert(k_ee == 1.0);
    +
    +rc = qmckl_get_electron_rescale_factor_en (context, &k_en);
    +assert(rc == QMCKL_SUCCESS);
    +assert(k_en == 1.0);
    +
    +rc = qmckl_set_electron_rescale_factor_en(context, rescale_factor_kappa_en);
    +assert(rc == QMCKL_SUCCESS);
    +
    +rc = qmckl_set_electron_rescale_factor_ee(context, rescale_factor_kappa_ee);
    +assert(rc == QMCKL_SUCCESS);
    +
    +rc = qmckl_get_electron_rescale_factor_ee (context, &k_ee);
    +assert(rc == QMCKL_SUCCESS);
    +assert(k_ee == rescale_factor_kappa_ee);
    +
    +rc = qmckl_get_electron_rescale_factor_en (context, &k_en);
    +assert(rc == QMCKL_SUCCESS);
    +assert(k_en == rescale_factor_kappa_en);
    +
    +
    +int64_t w;
    +rc = qmckl_get_electron_walk_num (context, &w);
    +assert(rc == QMCKL_NOT_PROVIDED);
    +
    +
    +rc = qmckl_set_electron_walk_num (context, walk_num);
    +assert(rc == QMCKL_SUCCESS);
    +
    +rc = qmckl_get_electron_walk_num (context, &w);
    +assert(rc == QMCKL_SUCCESS);
    +assert(w == walk_num);
    +
    +assert(qmckl_electron_provided(context));
    +
    +rc = qmckl_set_electron_coord (context, 'N', elec_coord);
    +assert(rc == QMCKL_SUCCESS);
    +
    +double elec_coord2[walk_num*3*elec_num];
    +
    +rc = qmckl_get_electron_coord (context, 'N', elec_coord2);
    +assert(rc == QMCKL_SUCCESS);
    +for (int64_t i=0 ; i<3*elec_num ; ++i) {
    +  assert( elec_coord[i] == elec_coord2[i] );
    + }
    +
    +
    +/* Provide Nucleus data */
    +
    +assert(!qmckl_nucleus_provided(context));
    +
    +rc = qmckl_get_nucleus_num (context, &n);
    +assert(rc == QMCKL_NOT_PROVIDED);
    +
    +
    +rc = qmckl_set_nucleus_num (context, nucl_num);
    +assert(rc == QMCKL_SUCCESS);
    +assert(!qmckl_nucleus_provided(context));
    +
    +rc = qmckl_get_nucleus_num (context, &n);
    +assert(rc == QMCKL_SUCCESS);
    +assert(n == nucl_num);
    +
    +double k;
    +rc = qmckl_get_nucleus_rescale_factor (context, &k);
    +assert(rc == QMCKL_SUCCESS);
    +assert(k == 1.0);
    +
    +
    +rc = qmckl_set_nucleus_rescale_factor (context, nucl_rescale_factor_kappa);
    +assert(rc == QMCKL_SUCCESS);
    +
    +rc = qmckl_get_nucleus_rescale_factor (context, &k);
    +assert(rc == QMCKL_SUCCESS);
    +assert(k == nucl_rescale_factor_kappa);
    +
    +double nucl_coord2[3*nucl_num];
    +
    +rc = qmckl_get_nucleus_coord (context, 'T', nucl_coord2);
    +assert(rc == QMCKL_NOT_PROVIDED);
    +
    +rc = qmckl_set_nucleus_coord (context, 'T', &(nucl_coord[0]));
    +assert(rc == QMCKL_SUCCESS);
    +
    +assert(!qmckl_nucleus_provided(context));
    +
    +rc = qmckl_get_nucleus_coord (context, 'N', nucl_coord2);
    +assert(rc == QMCKL_SUCCESS);
    +for (int64_t k=0 ; k<3 ; ++k) {
    +  for (int64_t i=0 ; i<nucl_num ; ++i) {
    +    assert( nucl_coord[nucl_num*k+i] == nucl_coord2[3*i+k] );
    +  }
    +}
    +
    +rc = qmckl_get_nucleus_coord (context, 'T', nucl_coord2);
    +assert(rc == QMCKL_SUCCESS);
    +for (int64_t i=0 ; i<3*nucl_num ; ++i) {
    +  assert( nucl_coord[i] == nucl_coord2[i] );
    +}
    +
    +double nucl_charge2[nucl_num];
    +
    +rc = qmckl_get_nucleus_charge(context, nucl_charge2);
    +assert(rc == QMCKL_NOT_PROVIDED);
    +
    +rc = qmckl_set_nucleus_charge(context, nucl_charge);
    +assert(rc == QMCKL_SUCCESS);
    +
    +rc = qmckl_get_nucleus_charge(context, nucl_charge2);
    +assert(rc == QMCKL_SUCCESS);
    +for (int64_t i=0 ; i<nucl_num ; ++i) {
    +  assert( nucl_charge[i] == nucl_charge2[i] );
    + }
    +assert(qmckl_nucleus_provided(context));
    +
    +
    +
    +
    +
    +
    + +
    +

    2 Computation

    +
    +

    +The computed data is stored in the context so that it can be reused +by different kernels. To ensure that the data is valid, for each +computed data the date of the context is stored when it is computed. +To know if some data needs to be recomputed, we check if the date of +the dependencies are more recent than the date of the data to +compute. If it is the case, then the data is recomputed and the +current date is stored. +

    +
    + +
    +

    2.1 Asymptotic component for \(f_{ee}\)

    +
    +

    +Calculate the asymptotic component asymp_jasb to be substracted from the final +electron-electron jastrow factor \(f_{ee}\). The asymptotic componenet is calculated +via the bord_vector and the electron-electron rescale factor rescale_factor_kappa. +

    + +

    +\[ + J_{asymp} = \frac{b_1 \kappa^-1}{1 + b_2 \kappa^-1} + \] +

    +
    + +
    +

    2.1.1 Get

    +
    +
    +
    qmckl_exit_code qmckl_get_jastrow_asymp_jasb(qmckl_context context, double* const asymp_jasb);
    +
    +
    +
    +
    + +
    +

    2.1.2 Compute

    +
    + + + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    qmcklcontextcontextinGlobal state
    int64tbordnuminNumber of electrons
    doublebordvector[bordnum + 1]inNumber of walkers
    doublerescalefactorkappaeeinElectron coordinates
    doubleasympjasb[2]outElectron-electron distances
    + +
    +
    integer function qmckl_compute_asymp_jasb_f(context, bord_num, bord_vector, rescale_factor_kappa_ee, asymp_jasb) &
    +     result(info)
    +  use qmckl
    +  implicit none
    +  integer(qmckl_context), intent(in)  :: context
    +  integer*8             , intent(in)  :: bord_num
    +  double precision      , intent(in)  :: bord_vector(bord_num + 1)
    +  double precision      , intent(in)  :: rescale_factor_kappa_ee
    +  double precision      , intent(out) :: asymp_jasb(2)
    +
    +  integer*8 :: i, p
    +  double precision   :: kappa_inv, x, asym_one
    +  kappa_inv = 1.0d0 / rescale_factor_kappa_ee
    +
    +  info = QMCKL_SUCCESS
    +
    +  if (context == QMCKL_NULL_CONTEXT) then
    +     info = QMCKL_INVALID_CONTEXT
    +     return
    +  endif
    +
    +  if (bord_num <= 0) then
    +     info = QMCKL_INVALID_ARG_2
    +     return
    +  endif
    +
    +  asym_one = bord_vector(1) * kappa_inv / (1.0d0 + bord_vector(2) * kappa_inv)
    +  asymp_jasb(:) = (/asym_one, 0.5d0 * asym_one/)
    +
    +  do i = 1, 2
    +     x = kappa_inv
    +     do p = 2, bord_num
    +        x = x * kappa_inv
    +        asymp_jasb(i) = asymp_jasb(i) + bord_vector(p + 1) * x 
    +     end do
    +  end do
    +
    +end function qmckl_compute_asymp_jasb_f
    +
    +
    + +
    +
    qmckl_exit_code qmckl_compute_factor_een_deriv_e (
    +      const qmckl_context context,
    +      const int64_t bord_num,
    +      const double* bord_vector,
    +      const double rescale_factor_kappa_ee,
    +      double* const asymp_jasb ); 
    +
    +
    +
    +
    + + +
    +

    2.1.3 Test

    +
    +
    +asym_one         :  0.43340325572525706
    +asymp_jasb[0]    :  0.5323750557252571
    +asymp_jasb[1]    :  0.31567342786262853
    +
    +
    + +
    +
    assert(qmckl_electron_provided(context));
    +
    +int64_t type_nucl_num = n2_type_nucl_num;
    +int64_t* type_nucl_vector = &(n2_type_nucl_vector[0]);
    +int64_t aord_num = n2_aord_num;
    +int64_t bord_num = n2_bord_num;
    +int64_t cord_num = n2_cord_num;
    +double* aord_vector = &(n2_aord_vector[0][0]);
    +double* bord_vector = &(n2_bord_vector[0]);
    +double* cord_vector = &(n2_cord_vector[0][0]);
    +
    +/* Initialize the Jastrow data */
    +rc = qmckl_init_jastrow(context);
    +assert(!qmckl_jastrow_provided(context));
    +
    +/* Set the data */
    +rc = qmckl_set_jastrow_ord_num(context, aord_num, bord_num, cord_num);
    +assert(rc == QMCKL_SUCCESS);
    +rc = qmckl_set_jastrow_type_nucl_num(context, type_nucl_num);
    +assert(rc == QMCKL_SUCCESS);
    +rc = qmckl_set_jastrow_type_nucl_vector(context, type_nucl_vector, nucl_num);
    +assert(rc == QMCKL_SUCCESS);
    +rc = qmckl_set_jastrow_aord_vector(context, aord_vector);
    +assert(rc == QMCKL_SUCCESS);
    +rc = qmckl_set_jastrow_bord_vector(context, bord_vector);
    +assert(rc == QMCKL_SUCCESS);
    +rc = qmckl_set_jastrow_cord_vector(context, cord_vector);
    +assert(rc == QMCKL_SUCCESS);
    +rc = qmckl_set_jastrow_dependencies(context);
    +assert(rc == QMCKL_SUCCESS);
    +
    +/* Check if Jastrow is properly initialized */
    +assert(qmckl_jastrow_provided(context));
    +
    +double asymp_jasb[2];
    +rc = qmckl_get_jastrow_asymp_jasb(context, asymp_jasb);
    +
    +// calculate asymp_jasb
    +assert(fabs(asymp_jasb[0]-0.5323750557252571) < 1.e-12);
    +assert(fabs(asymp_jasb[1]-0.31567342786262853) < 1.e-12);
    +
    +
    +
    +
    +
    +
    + +
    +

    2.2 Electron-electron component \(f_{ee}\)

    +
    +

    +Calculate the electron-electron jastrow component factor_ee using the asymp_jasb +componenet and the electron-electron rescaled distances ee_distance_rescaled. +

    + +

    +\[ +f_{ee} = \sum_{i,j +

    + + +
    +

    2.2.1 Get

    +
    +
    +
    qmckl_exit_code qmckl_get_jastrow_factor_ee(qmckl_context context, double* const factor_ee);
    +
    +
    +
    +
    + +
    +

    2.2.2 Compute

    +
    + + + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    qmcklcontextcontextinGlobal state
    int64twalknuminNumber of walkers
    int64telecnuminNumber of electrons
    int64tupnuminNumber of alpha electrons
    int64tbordnuminNumber of coefficients
    doublebordvector[bordnum + 1]inList of coefficients
    doubleeedistancerescaled[walknum][elecnum][elecnum]inElectron-electron distances
    doubleasympjasb[2]inElectron-electron distances
    doublefactoree[walknum]outElectron-electron distances
    + +
    +
    integer function qmckl_compute_factor_ee_f(context, walk_num, elec_num, up_num, bord_num,            &
    +                                           bord_vector, ee_distance_rescaled, asymp_jasb, factor_ee) &
    +     result(info)
    +  use qmckl
    +  implicit none
    +  integer(qmckl_context), intent(in)  :: context
    +  integer*8             , intent(in)  :: walk_num, elec_num, bord_num, up_num
    +  double precision      , intent(in)  :: bord_vector(bord_num + 1)
    +  double precision      , intent(in)  :: ee_distance_rescaled(walk_num, elec_num, elec_num)
    +  double precision      , intent(in)  :: asymp_jasb(2)
    +  double precision      , intent(out) :: factor_ee(walk_num)
    +
    +  integer*8 :: i, j, p, ipar, nw
    +  double precision   :: pow_ser, x, spin_fact, power_ser
    +
    +  info = QMCKL_SUCCESS
    +
    +  if (context == QMCKL_NULL_CONTEXT) then
    +     info = QMCKL_INVALID_CONTEXT
    +     return
    +  endif
    +
    +  if (walk_num <= 0) then
    +     info = QMCKL_INVALID_ARG_2
    +     return
    +  endif
    +
    +  if (elec_num <= 0) then
    +     info = QMCKL_INVALID_ARG_3
    +     return
    +  endif
    +
    +  if (bord_num <= 0) then
    +     info = QMCKL_INVALID_ARG_4
    +     return
    +  endif
    +
    +  factor_ee = 0.0d0
    +
    +  do nw =1, walk_num
    +  do j = 1, elec_num
    +     do i = 1, j - 1
    +        x = ee_distance_rescaled(nw,i,j)
    +        power_ser = 0.0d0
    +        spin_fact = 1.0d0
    +        ipar = 1
    +
    +        do p = 2, bord_num
    +          x = x * ee_distance_rescaled(nw,i,j)
    +          power_ser = power_ser + bord_vector(p + 1) * x
    +        end do
    +
    +        if(j .LE. up_num .OR. i .GT. up_num) then
    +          spin_fact = 0.5d0
    +          ipar = 2
    +        endif
    +
    +        factor_ee(nw) = factor_ee(nw) + spin_fact * bord_vector(1)  * &
    +                                ee_distance_rescaled(nw,i,j) / &
    +                                (1.0d0 + bord_vector(2) *   &
    +                                ee_distance_rescaled(nw,i,j))  &
    +                               -asymp_jasb(ipar) + power_ser
    +
    +     end do
    +  end do
    +  end do
    +
    +end function qmckl_compute_factor_ee_f
    +
    +
    + +
    +
    qmckl_exit_code qmckl_compute_factor_een_deriv_e (
    +      const qmckl_context context,
    +      const int64_t walk_num,
    +      const int64_t elec_num,
    +      const int64_t up_num,
    +      const int64_t bord_num,
    +      const double* bord_vector,
    +      const double* ee_distance_rescaled,
    +      const double* asymp_jasb,
    +      double* const factor_ee ); 
    +
    +
    +
    +
    + + +
    +

    2.2.3 Test

    +
    +
    +
    /* Check if Jastrow is properly initialized */
    +assert(qmckl_jastrow_provided(context));
    +
    +double factor_ee[walk_num];
    +rc = qmckl_get_jastrow_factor_ee(context, factor_ee);
    +
    +// calculate factor_ee
    +assert(fabs(factor_ee[0]+4.282760865958113) < 1.e-12);
    +
    +
    +
    +
    +
    +
    + +
    +

    2.3 Electron-electron component derivative \(f'_{ee}\)

    +
    +

    +Calculate the derivative of the factor_ee using the ee_distance_rescaled and +the electron-electron rescaled distances derivatives ee_distance_rescaled_deriv_e. +There are four components, the gradient which has 3 components in the \(x, y, z\) +directions and the laplacian as the last component. +

    + +

    +TODO: Add equation +

    +
    + + +
    +

    2.3.1 Get

    +
    +
    +
    qmckl_exit_code qmckl_get_jastrow_factor_ee_deriv_e(qmckl_context context, double* const factor_ee_deriv_e);
    +
    +
    +
    +
    + +
    +

    2.3.2 Compute

    +
    + + + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    qmcklcontextcontextinGlobal state
    int64twalknuminNumber of walkers
    int64telecnuminNumber of electrons
    int64tupnuminNumber of alpha electrons
    int64tbordnuminNumber of coefficients
    doublebordvector[bordnum + 1]inList of coefficients
    doubleeedistancerescaled[walknum][elecnum][elecnum]inElectron-electron distances
    doubleeedistancerescaledderive[walknum][4][elecnum][elecnum]inElectron-electron distances
    doubleasympjasb[2]inElectron-electron distances
    doublefactoreederive[walknum][4][elecnum]outElectron-electron distances
    + +
    +
    integer function qmckl_compute_factor_ee_deriv_e_f(context, walk_num, elec_num, up_num, bord_num,            &
    +                                           bord_vector, ee_distance_rescaled, ee_distance_rescaled_deriv_e,  &
    +                                           asymp_jasb, factor_ee_deriv_e) &
    +     result(info)
    +  use qmckl
    +  implicit none
    +  integer(qmckl_context), intent(in)  :: context
    +  integer*8             , intent(in)  :: walk_num, elec_num, bord_num, up_num
    +  double precision      , intent(in)  :: bord_vector(bord_num + 1)
    +  double precision      , intent(in)  :: ee_distance_rescaled(walk_num, elec_num, elec_num)
    +  double precision      , intent(in)  :: ee_distance_rescaled_deriv_e(walk_num, 4, elec_num, elec_num)
    +  double precision      , intent(in)  :: asymp_jasb(2)
    +  double precision      , intent(out) :: factor_ee_deriv_e(elec_num,4,walk_num)
    +
    +  integer*8 :: i, j, p, ipar, nw, ii
    +  double precision   :: x, spin_fact, y
    +  double precision   :: den, invden, invden2, invden3, xinv
    +  double precision   :: lap1, lap2, lap3, third
    +  double precision, dimension(3) :: pow_ser_g
    +  double precision, dimension(4) :: dx
    +
    +  info = QMCKL_SUCCESS
    +
    +  if (context == QMCKL_NULL_CONTEXT) then
    +     info = QMCKL_INVALID_CONTEXT
    +     return
    +  endif
    +
    +  if (walk_num <= 0) then
    +     info = QMCKL_INVALID_ARG_2
    +     return
    +  endif
    +
    +  if (elec_num <= 0) then
    +     info = QMCKL_INVALID_ARG_3
    +     return
    +  endif
    +
    +  if (bord_num <= 0) then
    +     info = QMCKL_INVALID_ARG_4
    +     return
    +  endif
    +
    +  factor_ee_deriv_e = 0.0d0
    +  third = 1.0d0 / 3.0d0
    +
    +  do nw =1, walk_num
    +  do j = 1, elec_num
    +     do i = 1, elec_num
    +        x = ee_distance_rescaled(nw, i, j)
    +        if(abs(x) < 1.0d-18) cycle
    +        pow_ser_g   = 0.0d0
    +        spin_fact   = 1.0d0
    +        den         = 1.0d0 + bord_vector(2) * x
    +        invden      = 1.0d0 / den
    +        invden2     = invden * invden
    +        invden3     = invden2 * invden
    +        xinv        = 1.0d0 / (x + 1.0d-18)
    +        ipar        = 1
    +
    +        do ii = 1, 4
    +          dx(ii) = ee_distance_rescaled_deriv_e(nw, ii, i, j)
    +        end do
    +
    +        if((i .LE. up_num .AND. j .LE. up_num ) .OR.  &
    +           (i .GT. up_num .AND. j .GT. up_num)) then
    +          spin_fact = 0.5d0
    +        endif
    +
    +        lap1 = 0.0d0
    +        lap2 = 0.0d0
    +        lap3 = 0.0d0
    +        do ii = 1, 3
    +          x = ee_distance_rescaled(nw, i, j)
    +          if(abs(x) < 1.0d-18) cycle
    +          do p = 2, bord_num
    +            y = p * bord_vector(p + 1) * x
    +            pow_ser_g(ii) = pow_ser_g(ii) + y * dx(ii)
    +            lap1 = lap1 + (p - 1) * y * xinv * dx(ii) * dx(ii)
    +            lap2 = lap2 + y
    +            x = x * ee_distance_rescaled(nw, i, j)
    +          end do
    +
    +          lap3 = lap3 - 2.0d0 * bord_vector(2) * dx(ii) * dx(ii)
    +
    +          factor_ee_deriv_e( j, ii, nw) = factor_ee_deriv_e( j, ii, nw) + spin_fact * bord_vector(1)  * &
    +                                dx(ii) * invden2 + pow_ser_g(ii)
    +        end do
    +
    +        ii = 4
    +        lap2 = lap2 * dx(ii) * third
    +        lap3 = lap3 + den * dx(ii)
    +        lap3 = lap3 * (spin_fact * bord_vector(1) * invden3)
    +        factor_ee_deriv_e( j, ii, nw) = factor_ee_deriv_e( j, ii, nw) + lap1 + lap2 + lap3
    +
    +     end do
    +  end do
    +  end do
    +
    +end function qmckl_compute_factor_ee_deriv_e_f
    +
    +
    + +
    +
    qmckl_exit_code qmckl_compute_factor_een_deriv_e (
    +      const qmckl_context context,
    +      const int64_t walk_num,
    +      const int64_t elec_num,
    +      const int64_t up_num,
    +      const int64_t bord_num,
    +      const double* bord_vector,
    +      const double* ee_distance_rescaled,
    +      const double* ee_distance_rescaled_deriv_e,
    +      const double* asymp_jasb,
    +      double* const factor_ee_deriv_e ); 
    +
    +
    +
    +
    + + +
    +

    2.3.3 Test

    +
    +
    +
    /* Check if Jastrow is properly initialized */
    +assert(qmckl_jastrow_provided(context));
    +
    +// calculate factor_ee_deriv_e
    +double factor_ee_deriv_e[walk_num][4][elec_num];
    +rc = qmckl_get_jastrow_factor_ee_deriv_e(context, &(factor_ee_deriv_e[0][0][0]));
    +
    +// check factor_ee_deriv_e
    +assert(fabs(factor_ee_deriv_e[0][0][0]-0.16364894652107934) < 1.e-12);
    +assert(fabs(factor_ee_deriv_e[0][1][0]+0.6927548119830084 ) < 1.e-12);
    +assert(fabs(factor_ee_deriv_e[0][2][0]-0.073267755223968  ) < 1.e-12);
    +assert(fabs(factor_ee_deriv_e[0][3][0]-1.5111672803213185 ) < 1.e-12);
    +
    +
    +
    +
    +
    +
    + +
    +

    2.4 Electron-nucleus component \(f_{en}\)

    +
    +

    +Calculate the electron-electron jastrow component factor_en using the aord_vector +coeffecients and the electron-nucleus rescaled distances en_distance_rescaled. +

    + +

    +\[ +f_{en} = \sum_{i,j +

    + + +
    +

    2.4.1 Get

    +
    +
    +
    qmckl_exit_code qmckl_get_jastrow_factor_en(qmckl_context context, double* const factor_en);
    +
    +
    +
    +
    + +
    +

    2.4.2 Compute

    +
    + + + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    qmcklcontextcontextinGlobal state
    int64twalknuminNumber of walkers
    int64telecnuminNumber of electrons
    int64tnuclnuminNumber of nucleii
    int64ttypenuclnuminNumber of unique nuclei
    int64ttypenuclvector[nuclnum]inIDs of unique nucleii
    int64taordnuminNumber of coefficients
    doubleaordvector[aordnum + 1][typenuclnum]inList of coefficients
    doubleendistancerescaled[walknum][nuclnum][elecnum]inElectron-nucleus distances
    doublefactoren[walknum]outElectron-nucleus jastrow
    + +
    +
    integer function qmckl_compute_factor_en_f(context, walk_num, elec_num, nucl_num, type_nucl_num,            &
    +                                           type_nucl_vector, aord_num, aord_vector,                         &
    +                                           en_distance_rescaled, factor_en) &
    +     result(info)
    +  use qmckl
    +  implicit none
    +  integer(qmckl_context), intent(in)  :: context
    +  integer*8             , intent(in)  :: walk_num, elec_num, aord_num, nucl_num, type_nucl_num
    +  integer*8             , intent(in)  :: type_nucl_vector(nucl_num)
    +  double precision      , intent(in)  :: aord_vector(aord_num + 1, type_nucl_num)
    +  double precision      , intent(in)  :: en_distance_rescaled(walk_num, nucl_num, elec_num)
    +  double precision      , intent(out) :: factor_en(walk_num)
    +
    +  integer*8 :: i, a, p, ipar, nw
    +  double precision   :: x, spin_fact, power_ser
    +
    +  info = QMCKL_SUCCESS
    +
    +  if (context == QMCKL_NULL_CONTEXT) then
    +     info = QMCKL_INVALID_CONTEXT
    +     return
    +  endif
    +
    +  if (walk_num <= 0) then
    +     info = QMCKL_INVALID_ARG_2
    +     return
    +  endif
    +
    +  if (elec_num <= 0) then
    +     info = QMCKL_INVALID_ARG_3
    +     return
    +  endif
    +
    +  if (nucl_num <= 0) then
    +     info = QMCKL_INVALID_ARG_4
    +     return
    +  endif
    +
    +  if (aord_num <= 0) then
    +     info = QMCKL_INVALID_ARG_7
    +     return
    +  endif
    +
    +  factor_en = 0.0d0
    +
    +  do nw =1, walk_num
    +  do a = 1, nucl_num
    +     do i = 1, elec_num
    +        x = en_distance_rescaled(nw, a, i)
    +        power_ser = 0.0d0
    +
    +        do p = 2, aord_num
    +          x = x * en_distance_rescaled(nw, a, i)
    +          power_ser = power_ser + aord_vector(p + 1, type_nucl_vector(a)) * x
    +        end do
    +
    +        factor_en(nw) = factor_en(nw) + aord_vector(1, type_nucl_vector(a)) *  &
    +                                en_distance_rescaled(nw, a, i) /               &
    +                                (1.0d0 + aord_vector(2, type_nucl_vector(a)) * &
    +                                en_distance_rescaled(nw, a, i))                &
    +                                + power_ser
    +
    +     end do
    +  end do
    +  end do
    +
    +end function qmckl_compute_factor_en_f
    +
    +
    + +
    +
    qmckl_exit_code qmckl_compute_factor_een_deriv_e (
    +      const qmckl_context context,
    +      const int64_t walk_num,
    +      const int64_t elec_num,
    +      const int64_t nucl_num,
    +      const int64_t type_nucl_num,
    +      const int64_t* type_nucl_vector,
    +      const int64_t aord_num,
    +      const double* aord_vector,
    +      const double* en_distance_rescaled,
    +      double* const factor_en ); 
    +
    +
    +
    +
    + + +
    +

    2.4.3 Test

    +
    +
    +
    /* Check if Jastrow is properly initialized */
    +assert(qmckl_jastrow_provided(context));
    +
    +double factor_en[walk_num];
    +rc = qmckl_get_jastrow_factor_en(context, factor_en);
    +
    +// calculate factor_en
    +assert(fabs(factor_en[0]+5.865822569188727) < 1.e-12);
    +
    +
    +
    +
    +
    +
    + +
    +

    2.5 Electron-nucleus component derivative \(f'_{en}\)

    +
    +

    +Calculate the electron-electron jastrow component factor_en_deriv_e derivative +with respect to the electron coordinates using the en_distance_rescaled and +en_distance_rescaled_deriv_e which are already calculated previously. +

    + +

    +TODO: write equations. +

    +
    + +
    +

    2.5.1 Get

    +
    +
    +
    qmckl_exit_code qmckl_get_jastrow_factor_en_deriv_e(qmckl_context context, double* const factor_en_deriv_e);
    +
    +
    +
    +
    + +
    +

    2.5.2 Compute

    +
    + + + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    qmcklcontextcontextinGlobal state
    int64twalknuminNumber of walkers
    int64telecnuminNumber of electrons
    int64tnuclnuminNumber of nucleii
    int64ttypenuclnuminNumber of unique nuclei
    int64ttypenuclvector[nuclnum]inIDs of unique nucleii
    int64taordnuminNumber of coefficients
    doubleaordvector[aordnum + 1][typenuclnum]inList of coefficients
    doubleendistancerescaled[walknum][nuclnum][elecnum]inElectron-nucleus distances
    doubleendistancerescaledderive[walknum][4][nuclnum][elecnum]inElectron-nucleus distance derivatives
    doublefactorenderive[walknum][4][elecnum]outElectron-nucleus jastrow
    + +
    +
    integer function qmckl_compute_factor_en_deriv_e_f(context, walk_num, elec_num, nucl_num, type_nucl_num,            &
    +                                           type_nucl_vector, aord_num, aord_vector,                         &
    +                                           en_distance_rescaled, en_distance_rescaled_deriv_e, factor_en_deriv_e) &
    +     result(info)
    +  use qmckl
    +  implicit none
    +  integer(qmckl_context), intent(in)  :: context
    +  integer*8             , intent(in)  :: walk_num, elec_num, aord_num, nucl_num, type_nucl_num
    +  integer*8             , intent(in)  :: type_nucl_vector(nucl_num)
    +  double precision      , intent(in)  :: aord_vector(aord_num + 1, type_nucl_num)
    +  double precision      , intent(in)  :: en_distance_rescaled(walk_num, elec_num, nucl_num)
    +  double precision      , intent(in)  :: en_distance_rescaled_deriv_e(walk_num, 4, elec_num, nucl_num)
    +  double precision      , intent(out) :: factor_en_deriv_e(elec_num,4,walk_num)
    +
    +  integer*8 :: i, a, p, ipar, nw, ii
    +  double precision   :: x, spin_fact, den, invden, invden2, invden3, xinv
    +  double precision   :: y, lap1, lap2, lap3, third
    +  double precision, dimension(3) :: power_ser_g
    +  double precision, dimension(4) :: dx
    +
    +  info = QMCKL_SUCCESS
    +
    +  if (context == QMCKL_NULL_CONTEXT) then
    +     info = QMCKL_INVALID_CONTEXT
    +     return
    +  endif
    +
    +  if (walk_num <= 0) then
    +     info = QMCKL_INVALID_ARG_2
    +     return
    +  endif
    +
    +  if (elec_num <= 0) then
    +     info = QMCKL_INVALID_ARG_3
    +     return
    +  endif
    +
    +  if (nucl_num <= 0) then
    +     info = QMCKL_INVALID_ARG_4
    +     return
    +  endif
    +
    +  if (aord_num <= 0) then
    +     info = QMCKL_INVALID_ARG_7
    +     return
    +  endif
    +
    +  factor_en_deriv_e = 0.0d0
    +  third = 1.0d0 / 3.0d0
    +
    +  do nw =1, walk_num
    +  do a = 1, nucl_num
    +     do i = 1, elec_num
    +        x = en_distance_rescaled(nw, i, a)
    +        if(abs(x) < 1.0d-18) continue
    +        power_ser_g = 0.0d0
    +        den = 1.0d0 + aord_vector(2, type_nucl_vector(a)) * x
    +        invden = 1.0d0 / den
    +        invden2 = invden * invden
    +        invden3 = invden2 * invden
    +        xinv = 1.0d0 / x
    +
    +        do ii = 1, 4
    +          dx(ii) = en_distance_rescaled_deriv_e(nw, ii, i, a)
    +        end do
    +
    +        lap1 = 0.0d0
    +        lap2 = 0.0d0
    +        lap3 = 0.0d0
    +        do ii = 1, 3
    +          x = en_distance_rescaled(nw, i, a)
    +          do p = 2, aord_num
    +            y = p * aord_vector(p + 1, type_nucl_vector(a)) * x
    +            power_ser_g(ii) = power_ser_g(ii) + y * dx(ii)
    +            lap1 = lap1 + (p - 1) * y * xinv * dx(ii) * dx(ii)
    +            lap2 = lap2 + y
    +            x = x * en_distance_rescaled(nw, i, a)
    +          end do
    +
    +          lap3 = lap3 - 2.0d0 * aord_vector(2, type_nucl_vector(a)) * dx(ii) * dx(ii)
    +
    +          factor_en_deriv_e(i, ii, nw) = factor_en_deriv_e(i, ii, nw) + aord_vector(1, type_nucl_vector(a)) &
    +                                  * dx(ii) * invden2                                                        &
    +                                  + power_ser_g(ii)
    +
    +        end do
    +
    +        ii = 4
    +        lap2 = lap2 * dx(ii) * third
    +        lap3 = lap3 + den * dx(ii)
    +        lap3 = lap3 * aord_vector(1, type_nucl_vector(a)) * invden3
    +        factor_en_deriv_e(i, ii, nw) = factor_en_deriv_e(i, ii, nw) + lap1 + lap2 + lap3
    +
    +     end do
    +  end do
    +  end do
    +
    +end function qmckl_compute_factor_en_deriv_e_f
    +
    +
    + +
    +
    qmckl_exit_code qmckl_compute_factor_een_deriv_e (
    +      const qmckl_context context,
    +      const int64_t walk_num,
    +      const int64_t elec_num,
    +      const int64_t nucl_num,
    +      const int64_t type_nucl_num,
    +      const int64_t* type_nucl_vector,
    +      const int64_t aord_num,
    +      const double* aord_vector,
    +      const double* en_distance_rescaled,
    +      const double* en_distance_rescaled_deriv_e,
    +      double* const factor_en_deriv_e ); 
    +
    +
    +
    +
    + + +
    +

    2.5.3 Test

    +
    +
    +
    /* Check if Jastrow is properly initialized */
    +assert(qmckl_jastrow_provided(context));
    +
    +// calculate factor_en_deriv_e
    +double factor_en_deriv_e[walk_num][4][elec_num];
    +rc = qmckl_get_jastrow_factor_en_deriv_e(context, &(factor_en_deriv_e[0][0][0]));
    +
    +// check factor_en_deriv_e
    +assert(fabs(factor_en_deriv_e[0][0][0]-0.11609919541763383) < 1.e-12);
    +assert(fabs(factor_en_deriv_e[0][1][0]+0.23301394780804574) < 1.e-12);
    +assert(fabs(factor_en_deriv_e[0][2][0]-0.17548337641865783) < 1.e-12);
    +assert(fabs(factor_en_deriv_e[0][3][0]+0.9667363412285741 ) < 1.e-12);
    +
    +
    +
    +
    +
    +
    + +
    +

    2.6 Electron-electron rescaled distances for each order

    +
    +

    +een_rescaled_e stores the table of the rescaled distances between all +pairs of electrons and raised to the power \(p\) defined by cord_num: +

    + +

    +\[ + C_{ij,p} = \left( 1 - \exp{-\kappa C_{ij}} \right)^p + \] +

    + +

    +where \(C_{ij}\) is the matrix of electron-electron distances. +

    +
    + +
    +

    2.6.1 Get

    +
    +
    +
    qmckl_exit_code qmckl_get_jastrow_een_rescaled_e(qmckl_context context, double* const distance_rescaled);
    +
    +
    +
    +
    + +
    +

    2.6.2 Compute

    +
    + + + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    qmcklcontextcontextinGlobal state
    int64twalknuminNumber of walkers
    int64telecnuminNumber of electrons
    int64tcordnuminOrder of polynomials
    doublerescalefactorkappaeeinFactor to rescale ee distances
    doubleeedistance[walknum][elecnum][elecnum]inElectron-electron distances
    doubleeenrescalede[walknum][elecnum][elecnum][0:cordnum]outElectron-electron rescaled distances
    + +
    +
    integer function qmckl_compute_een_rescaled_e_f(context, walk_num, elec_num, cord_num, rescale_factor_kappa_ee,  &
    +     ee_distance, een_rescaled_e) &
    +     result(info)
    +  use qmckl
    +  implicit none
    +  integer(qmckl_context), intent(in)  :: context
    +  integer*8             , intent(in)  :: walk_num
    +  integer*8             , intent(in)  :: elec_num
    +  integer*8             , intent(in)  :: cord_num
    +  double precision      , intent(in)  :: rescale_factor_kappa_ee
    +  double precision      , intent(in)  :: ee_distance(elec_num,elec_num,walk_num)
    +  double precision      , intent(out) :: een_rescaled_e(0:cord_num,elec_num,elec_num,walk_num)
    +  double precision,dimension(:,:),allocatable :: een_rescaled_e_ij
    +  double precision                    :: x
    +  integer*8                           :: i, j, k, l, nw
    +
    +  allocate(een_rescaled_e_ij(elec_num * (elec_num - 1) / 2, cord_num + 1))
    +
    +
    +  info = QMCKL_SUCCESS
    +
    +  if (context == QMCKL_NULL_CONTEXT) then
    +     info = QMCKL_INVALID_CONTEXT
    +     return
    +  endif
    +
    +  if (walk_num <= 0) then
    +     info = QMCKL_INVALID_ARG_2
    +     return
    +  endif
    +
    +  if (elec_num <= 0) then
    +     info = QMCKL_INVALID_ARG_3
    +     return
    +  endif
    +
    +  if (cord_num <= 0) then
    +     info = QMCKL_INVALID_ARG_4
    +     return
    +  endif
    +
    +  ! Prepare table of exponentiated distances raised to appropriate power
    +  een_rescaled_e             = 0.0d0
    +  do nw = 1, walk_num
    +  een_rescaled_e_ij       = 0.0d0
    +  een_rescaled_e_ij(:, 1) = 1.0d0
    +
    +  k = 0
    +  do j = 1, elec_num
    +    do i = 1, j - 1
    +      k = k + 1
    +      een_rescaled_e_ij(k, 2) = dexp(-rescale_factor_kappa_ee * ee_distance(i, j, nw))
    +    end do
    +  end do
    +
    +  do l = 2, cord_num
    +    do k = 1, elec_num * (elec_num - 1)/2
    +      een_rescaled_e_ij(k, l + 1) = een_rescaled_e_ij(k, l + 1 - 1) * een_rescaled_e_ij(k, 2)
    +    end do
    +  end do
    +
    +  ! prepare the actual een table
    +  een_rescaled_e(0, :, :, nw) = 1.0d0
    +  do l = 1, cord_num
    +    k = 0
    +    do j = 1, elec_num
    +      do i = 1, j - 1
    +        k = k + 1
    +        x = een_rescaled_e_ij(k, l + 1)
    +        een_rescaled_e(l, i, j, nw) = x
    +        een_rescaled_e(l, j, i, nw) = x
    +      end do
    +    end do
    +  end do
    +  end do
    +
    +end function qmckl_compute_een_rescaled_e_f
    +
    +
    + +
    +
    qmckl_exit_code qmckl_compute_factor_een_deriv_e (
    +      const qmckl_context context,
    +      const int64_t walk_num,
    +      const int64_t elec_num,
    +      const int64_t cord_num,
    +      const double rescale_factor_kappa_ee,
    +      const double* ee_distance,
    +      double* const een_rescaled_e ); 
    +
    +
    +
    +
    + +
    +

    2.6.3 Test

    +
    +
    +
    assert(qmckl_electron_provided(context));
    +
    +
    +double een_rescaled_e[walk_num][elec_num][elec_num][(cord_num + 1)];
    +rc = qmckl_get_jastrow_een_rescaled_e(context, &(een_rescaled_e[0][0][0][0]));
    +
    +// value of (0,2,1)
    +assert(fabs(een_rescaled_e[0][0][2][1]-0.08084493981483197)   < 1.e-12);
    +assert(fabs(een_rescaled_e[0][0][3][1]-0.1066745707571846)    < 1.e-12);
    +assert(fabs(een_rescaled_e[0][0][4][1]-0.01754273169464735)   < 1.e-12);
    +assert(fabs(een_rescaled_e[0][1][3][2]-0.02214680362033448)   < 1.e-12);
    +assert(fabs(een_rescaled_e[0][1][4][2]-0.0005700154999202759) < 1.e-12);
    +assert(fabs(een_rescaled_e[0][1][5][2]-0.3424402276009091)    < 1.e-12);
    +
    +
    +
    +
    +
    +
    + +
    +

    2.7 Electron-electron rescaled distances for each order and derivatives

    +
    +

    +een_rescaled_e stores the table of the rescaled distances between all +pairs of electrons and raised to the power \(p\) defined by cord_num. +Here we take its derivatives required for the een jastrow. +

    + +

    +TODO: write formulae +

    +
    + + +
    +

    2.7.1 Get

    +
    +
    +
    qmckl_exit_code qmckl_get_jastrow_een_rescaled_e_deriv_e(qmckl_context context, double* const distance_rescaled);
    +
    +
    +
    +
    + +
    +

    2.7.2 Compute

    +
    + + + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    qmcklcontextcontextinGlobal state
    int64twalknuminNumber of walkers
    int64telecnuminNumber of electrons
    int64tcordnuminOrder of polynomials
    doublerescalefactorkappaeeinFactor to rescale ee distances
    doublecoordnew[walknum][3][elecnum]inElectron coordinates
    doubleeedistance[walknum][elecnum][elecnum]inElectron-electron distances
    doubleeenrescalede[walknum][elecnum][elecnum][0:cordnum]inElectron-electron distances
    doubleeenrescaledederive[walknum][elecnum][4][elecnum][0:cordnum]outElectron-electron rescaled distances
    + +
    +
    integer function qmckl_compute_factor_een_rescaled_e_deriv_e_f(context, walk_num, elec_num, cord_num, rescale_factor_kappa_ee,  &
    +     coord_new, ee_distance, een_rescaled_e, een_rescaled_e_deriv_e) &
    +     result(info)
    +  use qmckl
    +  implicit none
    +  integer(qmckl_context), intent(in)  :: context
    +  integer*8             , intent(in)  :: walk_num
    +  integer*8             , intent(in)  :: elec_num
    +  integer*8             , intent(in)  :: cord_num
    +  double precision      , intent(in)  :: rescale_factor_kappa_ee
    +  double precision      , intent(in)  :: coord_new(elec_num,3,walk_num)
    +  double precision      , intent(in)  :: ee_distance(elec_num,elec_num,walk_num)
    +  double precision      , intent(in)  :: een_rescaled_e(0:cord_num,elec_num,elec_num,walk_num)
    +  double precision      , intent(out) :: een_rescaled_e_deriv_e(0:cord_num,elec_num,4,elec_num,walk_num)
    +  double precision,dimension(:,:,:),allocatable  :: elec_dist_deriv_e
    +  double precision                    :: x, rij_inv, kappa_l
    +  integer*8                           :: i, j, k, l, nw, ii
    +
    +  allocate(elec_dist_deriv_e(4,elec_num,elec_num))
    +
    +  info = QMCKL_SUCCESS
    +
    +  if (context == QMCKL_NULL_CONTEXT) then
    +     info = QMCKL_INVALID_CONTEXT
    +     return
    +  endif
    +
    +  if (walk_num <= 0) then
    +     info = QMCKL_INVALID_ARG_2
    +     return
    +  endif
    +
    +  if (elec_num <= 0) then
    +     info = QMCKL_INVALID_ARG_3
    +     return
    +  endif
    +
    +  if (cord_num <= 0) then
    +     info = QMCKL_INVALID_ARG_4
    +     return
    +  endif
    +
    +  ! Prepare table of exponentiated distances raised to appropriate power
    +  een_rescaled_e_deriv_e     = 0.0d0
    +  do nw = 1, walk_num
    +    do j = 1, elec_num
    +      do i = 1, elec_num
    +        rij_inv = 1.0d0 / ee_distance(i, j, nw)
    +        do ii = 1, 3
    +          elec_dist_deriv_e(ii, i, j) = (coord_new(i, ii, nw) - coord_new(j, ii, nw)) * rij_inv
    +        end do
    +        elec_dist_deriv_e(4, i, j) = 2.0d0 * rij_inv
    +      end do
    +      elec_dist_deriv_e(:, j, j) = 0.0d0
    +    end do
    +
    +    ! prepare the actual een table
    +    do l = 1, cord_num
    +      kappa_l = - dble(l) * rescale_factor_kappa_ee
    +      do j = 1, elec_num
    +        do i = 1, elec_num
    +          do ii = 1, 4
    +            een_rescaled_e_deriv_e(l, i, ii, j, nw) = kappa_l * elec_dist_deriv_e(ii, i, j)
    +          end do
    +
    +          een_rescaled_e_deriv_e(l, i, 4, j, nw) = een_rescaled_e_deriv_e(l, i, 4, j, nw)              &
    +                    + een_rescaled_e_deriv_e(l, i, 1, j, nw) * een_rescaled_e_deriv_e(l, i, 1, j, nw)  &
    +                    + een_rescaled_e_deriv_e(l, i, 2, j, nw) * een_rescaled_e_deriv_e(l, i, 2, j, nw)  &
    +                    + een_rescaled_e_deriv_e(l, i, 3, j, nw) * een_rescaled_e_deriv_e(l, i, 3, j, nw)
    +
    +          do ii = 1, 4
    +            een_rescaled_e_deriv_e(l, i, ii, j, nw) = een_rescaled_e_deriv_e(l, i, ii, j, nw) *   &
    +                                                      een_rescaled_e(l, i, j, nw)
    +          end do
    +        end do
    +      end do
    +    end do
    +  end do
    +
    +end function qmckl_compute_factor_een_rescaled_e_deriv_e_f
    +
    +
    + +
    +
    qmckl_exit_code qmckl_compute_factor_een_deriv_e (
    +      const qmckl_context context,
    +      const int64_t walk_num,
    +      const int64_t elec_num,
    +      const int64_t cord_num,
    +      const double rescale_factor_kappa_ee,
    +      const double* coord_new,
    +      const double* ee_distance,
    +      const double* een_rescaled_e,
    +      double* const een_rescaled_e_deriv_e ); 
    +
    +
    +
    +
    + + +
    +

    2.7.3 Test

    +
    +
    +
    //assert(qmckl_electron_provided(context));
    +
    +
    +
    +
    +
    +
    + +
    +

    2.8 Electron-nucleus rescaled distances for each order

    +
    +

    +een_rescaled_n stores the table of the rescaled distances between +electrons and nucleii raised to the power \(p\) defined by cord_num: +

    + +

    +\[ + C_{ia,p} = \left( 1 - \exp{-\kappa C_{ia}} \right)^p + \] +

    + +

    +where \(C_{ia}\) is the matrix of electron-nucleus distances. +

    +
    + +
    +

    2.8.1 Get

    +
    +
    +
    qmckl_exit_code qmckl_get_jastrow_een_rescaled_n(qmckl_context context, double* const distance_rescaled);
    +
    +
    +
    +
    + +
    +

    2.8.2 Compute

    +
    + + + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    qmcklcontextcontextinGlobal state
    int64twalknuminNumber of walkers
    int64telecnuminNumber of electrons
    int64tnuclnuminNumber of atoms
    int64tcordnuminOrder of polynomials
    doublerescalefactorkappaeninFactor to rescale ee distances
    doubleendistance[walknum][elecnum][nuclnum]inElectron-nucleus distances
    doubleeenrescaledn[walknum][elecnum][nuclnum][0:cordnum]outElectron-nucleus rescaled distances
    + +
    +
    integer function qmckl_compute_een_rescaled_n_f(context, walk_num, elec_num, nucl_num, cord_num, rescale_factor_kappa_en,  &
    +     en_distance, een_rescaled_n) &
    +     result(info)
    +  use qmckl
    +  implicit none
    +  integer(qmckl_context), intent(in)  :: context
    +  integer*8             , intent(in)  :: walk_num
    +  integer*8             , intent(in)  :: elec_num
    +  integer*8             , intent(in)  :: nucl_num
    +  integer*8             , intent(in)  :: cord_num
    +  double precision      , intent(in)  :: rescale_factor_kappa_en
    +  double precision      , intent(in)  :: en_distance(elec_num,nucl_num,walk_num)
    +  double precision      , intent(out) :: een_rescaled_n(0:cord_num,nucl_num,elec_num,walk_num)
    +  double precision                    :: x
    +  integer*8                           :: i, a, k, l, nw
    +
    +  info = QMCKL_SUCCESS
    +
    +  if (context == QMCKL_NULL_CONTEXT) then
    +     info = QMCKL_INVALID_CONTEXT
    +     return
    +  endif
    +
    +  if (walk_num <= 0) then
    +     info = QMCKL_INVALID_ARG_2
    +     return
    +  endif
    +
    +  if (elec_num <= 0) then
    +     info = QMCKL_INVALID_ARG_3
    +     return
    +  endif
    +
    +  if (nucl_num <= 0) then
    +     info = QMCKL_INVALID_ARG_4
    +     return
    +  endif
    +
    +  if (cord_num <= 0) then
    +     info = QMCKL_INVALID_ARG_5
    +     return
    +  endif
    +
    +  ! Prepare table of exponentiated distances raised to appropriate power
    +  een_rescaled_n             = 0.0d0
    +  do nw = 1, walk_num
    +
    +  ! prepare the actual een table
    +  een_rescaled_n(0, :, :, nw) = 1.0d0
    +
    +  do a = 1, nucl_num
    +    do i = 1, elec_num
    +      een_rescaled_n(1, a, i, nw) = dexp(-rescale_factor_kappa_en * en_distance(i, a, nw))
    +    end do
    +  end do
    +
    +  do l = 2, cord_num
    +    do a = 1, nucl_num
    +      do i = 1, elec_num
    +        een_rescaled_n(l, a, i, nw) = een_rescaled_n(l - 1, a, i, nw) * een_rescaled_n(1, a, i, nw)
    +      end do
    +    end do
    +  end do
    +  end do
    +
    +end function qmckl_compute_een_rescaled_n_f
    +
    +
    + +
    +
    qmckl_exit_code qmckl_compute_factor_een_deriv_e (
    +      const qmckl_context context,
    +      const int64_t walk_num,
    +      const int64_t elec_num,
    +      const int64_t nucl_num,
    +      const int64_t cord_num,
    +      const double rescale_factor_kappa_en,
    +      const double* en_distance,
    +      double* const een_rescaled_n ); 
    +
    +
    +
    +
    + +
    +

    2.8.3 Test

    +
    +
    +
    assert(qmckl_electron_provided(context));
    +
    +double een_rescaled_n[walk_num][elec_num][nucl_num][(cord_num + 1)];
    +rc = qmckl_get_jastrow_een_rescaled_n(context, &(een_rescaled_n[0][0][0][0]));
    +
    +// value of (0,2,1)
    +assert(fabs(een_rescaled_n[0][2][0][1]-0.10612983920006765)  < 1.e-12);
    +assert(fabs(een_rescaled_n[0][3][0][1]-0.135652809635553)    < 1.e-12);
    +assert(fabs(een_rescaled_n[0][4][0][1]-0.023391817607642338) < 1.e-12);
    +assert(fabs(een_rescaled_n[0][3][1][2]-0.880957224822116)    < 1.e-12);
    +assert(fabs(een_rescaled_n[0][4][1][2]-0.027185942659395074) < 1.e-12);
    +assert(fabs(een_rescaled_n[0][5][1][2]-0.01343938025140174)  < 1.e-12);
    +
    +
    +
    +
    +
    +
    + +
    +

    2.9 Electron-nucleus rescaled distances for each order and derivatives

    +
    +

    +een_rescaled_n_deriv_e stores the table of the rescaled distances between +electrons and nucleii raised to the power \(p\) defined by cord_num: +

    +
    + + +
    +

    2.9.1 Get

    +
    +
    +
    qmckl_exit_code qmckl_get_jastrow_een_rescaled_n_deriv_e(qmckl_context context, double* const distance_rescaled);
    +
    +
    +
    +
    + +
    +

    2.9.2 Compute

    +
    + + + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    qmcklcontextcontextinGlobal state
    int64twalknuminNumber of walkers
    int64telecnuminNumber of electrons
    int64tnuclnuminNumber of atoms
    int64tcordnuminOrder of polynomials
    doublerescalefactorkappaeninFactor to rescale ee distances
    doublecoordnew[walknum][3][elecnum]inElectron coordinates
    doublecoord[3][nuclnum]inNuclear coordinates
    doubleendistance[walknum][elecnum][nuclnum]inElectron-nucleus distances
    doubleeenrescaledn[walknum][elecnum][nuclnum][0:cordnum]inElectron-nucleus distances
    doubleeenrescalednderive[walknum][elecnum][4][nuclnum][0:cordnum]outElectron-nucleus rescaled distances
    + +
    +
    integer function qmckl_compute_factor_een_rescaled_n_deriv_e_f(context, walk_num, elec_num, nucl_num, &
    +     cord_num, rescale_factor_kappa_en,                                                               &
    +     coord_new, coord, en_distance, een_rescaled_n, een_rescaled_n_deriv_e)                           &
    +     result(info)
    +  use qmckl
    +  implicit none
    +  integer(qmckl_context), intent(in)  :: context
    +  integer*8             , intent(in)  :: walk_num
    +  integer*8             , intent(in)  :: elec_num
    +  integer*8             , intent(in)  :: nucl_num
    +  integer*8             , intent(in)  :: cord_num
    +  double precision      , intent(in)  :: rescale_factor_kappa_en
    +  double precision      , intent(in)  :: coord_new(elec_num,3,walk_num)
    +  double precision      , intent(in)  :: coord(nucl_num,3)
    +  double precision      , intent(in)  :: en_distance(elec_num,nucl_num,walk_num)
    +  double precision      , intent(in)  :: een_rescaled_n(0:cord_num,nucl_num,elec_num,walk_num)
    +  double precision      , intent(out) :: een_rescaled_n_deriv_e(0:cord_num,nucl_num,4,elec_num,walk_num)
    +  double precision,dimension(:,:,:),allocatable :: elnuc_dist_deriv_e
    +  double precision                    :: x, ria_inv, kappa_l
    +  integer*8                           :: i, a, k, l, nw, ii
    +
    +  allocate(elnuc_dist_deriv_e(4, elec_num, nucl_num))
    +
    +  info = QMCKL_SUCCESS
    +
    +  if (context == QMCKL_NULL_CONTEXT) then
    +     info = QMCKL_INVALID_CONTEXT
    +     return
    +  endif
    +
    +  if (walk_num <= 0) then
    +     info = QMCKL_INVALID_ARG_2
    +     return
    +  endif
    +
    +  if (elec_num <= 0) then
    +     info = QMCKL_INVALID_ARG_3
    +     return
    +  endif
    +
    +  if (nucl_num <= 0) then
    +     info = QMCKL_INVALID_ARG_4
    +     return
    +  endif
    +
    +  if (cord_num <= 0) then
    +     info = QMCKL_INVALID_ARG_5
    +     return
    +  endif
    +
    +  ! Prepare table of exponentiated distances raised to appropriate power
    +  een_rescaled_n_deriv_e             = 0.0d0
    +  do nw = 1, walk_num
    +
    +  ! prepare the actual een table
    +  do a = 1, nucl_num
    +    do i = 1, elec_num
    +      ria_inv = 1.0d0 / en_distance(i, a, nw)
    +      do ii = 1, 3
    +        elnuc_dist_deriv_e(ii, i, a) = (coord_new(i, ii, nw) - coord(a, ii)) * ria_inv
    +      end do
    +      elnuc_dist_deriv_e(4, i, a) = 2.0d0 * ria_inv
    +    end do
    +  end do
    +
    +  do l = 0, cord_num
    +    kappa_l = - dble(l) * rescale_factor_kappa_en
    +    do a = 1, nucl_num
    +      do i = 1, elec_num
    +        do ii = 1, 4
    +          een_rescaled_n_deriv_e(l, a, ii, i, nw) = kappa_l * elnuc_dist_deriv_e(ii, i, a)
    +        end do
    +
    +        een_rescaled_n_deriv_e(l, a, 4, i, nw) = een_rescaled_n_deriv_e(l, a, 4, i, nw)           &
    +                + een_rescaled_n_deriv_e(l, a, 1, i, nw) * een_rescaled_n_deriv_e(l, a, 1, i, nw) &
    +                + een_rescaled_n_deriv_e(l, a, 2, i, nw) * een_rescaled_n_deriv_e(l, a, 2, i, nw) &
    +                + een_rescaled_n_deriv_e(l, a, 3, i, nw) * een_rescaled_n_deriv_e(l, a, 3, i, nw)
    +
    +        do ii = 1, 4
    +          een_rescaled_n_deriv_e(l, a, ii, i, nw) = een_rescaled_n_deriv_e(l, a, ii, i, nw) * &
    +                                                    een_rescaled_n(l, a, i, nw)
    +        end do
    +      end do
    +    end do
    +  end do
    +  end do
    +
    +end function qmckl_compute_factor_een_rescaled_n_deriv_e_f
    +
    +
    + +
    +
    qmckl_exit_code qmckl_compute_factor_een_deriv_e (
    +      const qmckl_context context,
    +      const int64_t walk_num,
    +      const int64_t elec_num,
    +      const int64_t nucl_num,
    +      const int64_t cord_num,
    +      const double rescale_factor_kappa_en,
    +      const double* coord_new,
    +      const double* coord,
    +      const double* en_distance,
    +      const double* een_rescaled_n,
    +      double* const een_rescaled_n_deriv_e ); 
    +
    +
    +
    +
    + +
    +

    2.9.3 Test

    +
    +
    +
    //assert(qmckl_electron_provided(context));
    +
    +
    +
    +
    +
    +
    + +
    +

    2.10 Prepare for electron-electron-nucleus Jastrow \(f_{een}\)

    +
    +

    +Prepare cord_vect_full and lkpm_combined_index tables required for the +calculation of the three-body jastrow factor_een and its derivative +factor_een_deriv_e. +

    +
    + +
    +

    2.10.1 Get

    +
    +
    +
    qmckl_exit_code qmckl_get_jastrow_dim_cord_vect(qmckl_context context, int64_t* const dim_cord_vect);
    +qmckl_exit_code qmckl_get_jastrow_cord_vect_full(qmckl_context context, double* const cord_vect_full);
    +qmckl_exit_code qmckl_get_jastrow_lkpm_combined_index(qmckl_context context, int64_t* const lkpm_combined_index);
    +
    +
    +
    +
    + +
    +

    2.10.2 Compute dimcordvect

    +
    + + + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + +
    qmcklcontextcontextinGlobal state
    int64tcordnuminOrder of polynomials
    int64tdimcordvectoutdimension of cordvectfull table
    + +
    +
    integer function qmckl_compute_dim_cord_vect_f(context, cord_num, dim_cord_vect) &
    +     result(info)
    +  use qmckl
    +  implicit none
    +  integer(qmckl_context), intent(in)  :: context
    +  integer*8             , intent(in)  :: cord_num
    +  integer*8             , intent(out) :: dim_cord_vect
    +  double precision                    :: x
    +  integer*8                           :: i, a, k, l, p, lmax
    +
    +  info = QMCKL_SUCCESS
    +
    +  if (context == QMCKL_NULL_CONTEXT) then
    +     info = QMCKL_INVALID_CONTEXT
    +     return
    +  endif
    +
    +  if (cord_num <= 0) then
    +     info = QMCKL_INVALID_ARG_2
    +     return
    +  endif
    +
    +  dim_cord_vect = 0
    +
    +  do p = 2, cord_num
    +    do k = p - 1, 0, -1
    +      if (k .ne. 0) then
    +        lmax = p - k
    +      else
    +        lmax = p - k - 2
    +      endif
    +      do l = lmax, 0, -1
    +        if (iand(p - k - l, 1_8) == 1) cycle
    +        dim_cord_vect = dim_cord_vect + 1
    +      end do
    +    end do
    +  end do
    +
    +end function qmckl_compute_dim_cord_vect_f
    +
    +
    + +
    +
    qmckl_exit_code qmckl_compute_factor_een_deriv_e (
    +      const qmckl_context context,
    +      const int64_t cord_num,
    +      int64_t* const dim_cord_vect ); 
    +
    +
    +
    +
    + + +
    +

    2.10.3 Compute cordvectfull

    +
    + + + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    qmcklcontextcontextinGlobal state
    int64tnuclnuminNumber of atoms
    int64tcordnuminOrder of polynomials
    int64tdimcordvectindimension of cord full table
    int64ttypenuclnumindimension of cord full table
    int64ttypenuclvector[nuclnum]indimension of cord full table
    doublecordvector[cordnum][typenuclnum]indimension of cord full table
    doublecordvectfull[dimcordvect][nuclnum]outFull list of coefficients
    + +
    +
    integer function qmckl_compute_cord_vect_full_f(context, nucl_num, cord_num, dim_cord_vect, type_nucl_num,  &
    +     type_nucl_vector, cord_vector, cord_vect_full) &
    +     result(info)
    +  use qmckl
    +  implicit none
    +  integer(qmckl_context), intent(in)  :: context
    +  integer*8             , intent(in)  :: nucl_num
    +  integer*8             , intent(in)  :: cord_num
    +  integer*8             , intent(in)  :: dim_cord_vect
    +  integer*8             , intent(in)  :: type_nucl_num
    +  integer*8             , intent(in)  :: type_nucl_vector(nucl_num)
    +  double precision      , intent(in)  :: cord_vector(cord_num, type_nucl_num)
    +  double precision      , intent(out) :: cord_vect_full(nucl_num,dim_cord_vect)
    +  double precision                    :: x
    +  integer*8                           :: i, a, k, l, nw
    +
    +  info = QMCKL_SUCCESS
    +
    +  if (context == QMCKL_NULL_CONTEXT) then
    +     info = QMCKL_INVALID_CONTEXT
    +     return
    +  endif
    +
    +  if (nucl_num <= 0) then
    +     info = QMCKL_INVALID_ARG_2
    +     return
    +  endif
    +
    +  if (cord_num <= 0) then
    +     info = QMCKL_INVALID_ARG_3
    +     return
    +  endif
    +
    +  if (type_nucl_num <= 0) then
    +     info = QMCKL_INVALID_ARG_4
    +     return
    +  endif
    +
    +  if (dim_cord_vect <= 0) then
    +     info = QMCKL_INVALID_ARG_5
    +     return
    +  endif
    +
    +
    +  do a = 1, nucl_num
    +    cord_vect_full(1:dim_cord_vect,a) = cord_vector(1:dim_cord_vect,type_nucl_vector(a))
    +  end do
    +
    +end function qmckl_compute_cord_vect_full_f
    +
    +
    + +
    +
    qmckl_exit_code qmckl_compute_factor_een_deriv_e (
    +      const qmckl_context context,
    +      const int64_t nucl_num,
    +      const int64_t cord_num,
    +      const int64_t dim_cord_vect,
    +      const int64_t type_nucl_num,
    +      const int64_t* type_nucl_vector,
    +      const double* cord_vector,
    +      double* const cord_vect_full ); 
    +
    +
    +
    +
    + + +
    +

    2.10.4 Compute lkpmcombinedindex

    +
    + + + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    qmcklcontextcontextinGlobal state
    int64tcordnuminOrder of polynomials
    int64tdimcordvectindimension of cord full table
    int64tlpkmcombinedindex[4][dimcordvect]outFull list of combined indices
    + +
    +
    integer function qmckl_compute_lkpm_combined_index_f(context, cord_num, dim_cord_vect,  &
    +     lkpm_combined_index) &
    +     result(info)
    +  use qmckl
    +  implicit none
    +  integer(qmckl_context), intent(in)  :: context
    +  integer*8             , intent(in)  :: cord_num
    +  integer*8             , intent(in)  :: dim_cord_vect
    +  integer*8             , intent(out) :: lkpm_combined_index(dim_cord_vect, 4)
    +  double precision                    :: x
    +  integer*8                           :: i, a, k, l, kk, p, lmax, m
    +
    +  info = QMCKL_SUCCESS
    +
    +  if (context == QMCKL_NULL_CONTEXT) then
    +     info = QMCKL_INVALID_CONTEXT
    +     return
    +  endif
    +
    +  if (cord_num <= 0) then
    +     info = QMCKL_INVALID_ARG_2
    +     return
    +  endif
    +
    +  if (dim_cord_vect <= 0) then
    +     info = QMCKL_INVALID_ARG_3
    +     return
    +  endif
    +
    +
    +  kk = 0
    +  do p = 2, cord_num
    +    do k = p - 1, 0, -1
    +      if (k .ne. 0) then
    +        lmax = p - k
    +      else
    +        lmax = p - k - 2
    +      end if
    +      do l = lmax, 0, -1
    +        if (iand(p - k - l, 1_8) .eq. 1) cycle
    +        m = (p - k - l)/2
    +        kk = kk + 1
    +        lkpm_combined_index(kk, 1) = l
    +        lkpm_combined_index(kk, 2) = k
    +        lkpm_combined_index(kk, 3) = p
    +        lkpm_combined_index(kk, 4) = m
    +      end do
    +    end do
    +  end do
    +
    +end function qmckl_compute_lkpm_combined_index_f
    +
    +
    + +
    +
    qmckl_exit_code qmckl_compute_factor_een_deriv_e (
    +      const qmckl_context context,
    +      const int64_t cord_num,
    +      const int64_t dim_cord_vect,
    +      int64_t* const lpkm_combined_index ); 
    +
    +
    +
    +
    + + +
    +

    2.10.5 Test

    +
    +
    +
    //assert(qmckl_electron_provided(context));
    +//
    +
    +
    +
    +
    +
    +
    + +
    +

    2.11 Electron-electron-nucleus Jastrow \(f_{een}\)

    +
    +

    +Calculate the electron-electron-nuclear three-body jastrow component factor_een +using the above prepared tables. +

    + +

    +TODO: write equations. +

    +
    + +
    +

    2.11.1 Get

    +
    +
    +
    qmckl_exit_code qmckl_get_jastrow_factor_een(qmckl_context context, double* const factor_een);
    +
    +
    +
    +
    + +
    +

    2.11.2 Compute

    +
    + + + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    qmcklcontextcontextinGlobal state
    int64twalknuminNumber of walkers
    int64telecnuminNumber of electrons
    int64tnuclnuminNumber of nucleii
    int64tcordnuminorder of polynomials
    int64tdimcordvectindimension of full coefficient vector
    doublecordvectfull[dimcordvect][nuclnum]infull coefficient vector
    int64tlkpmcombinedindex[4][dimcordvect]incombined indices
    doubleeenrescalede[walknum][elecnum][elecnum][0:cordnum]inElectron-nucleus rescaled
    doubleeenrescaledn[walknum][elecnum][nuclnum][0:cordnum]inElectron-nucleus rescaled factor
    doublefactoreen[walknum]outElectron-nucleus jastrow
    + +
    +
    integer function qmckl_compute_factor_een_f(context, walk_num, elec_num, nucl_num, cord_num, dim_cord_vect,            &
    +                                           cord_vect_full, lkpm_combined_index,                                       &
    +                                           een_rescaled_e, een_rescaled_n, factor_een) &
    +     result(info)
    +  use qmckl
    +  implicit none
    +  integer(qmckl_context), intent(in)  :: context
    +  integer*8             , intent(in)  :: walk_num, elec_num, cord_num, nucl_num, dim_cord_vect
    +  integer*8             , intent(in)  :: lkpm_combined_index(4,dim_cord_vect)
    +  double precision      , intent(in)  :: cord_vect_full(dim_cord_vect, nucl_num)
    +  double precision      , intent(in)  :: een_rescaled_e(walk_num, elec_num, elec_num, 0:cord_num)
    +  double precision      , intent(in)  :: een_rescaled_n(walk_num, elec_num, nucl_num, 0:cord_num)
    +  double precision      , intent(out) :: factor_een(walk_num)
    +
    +  integer*8 :: i, a, j, l, k, p, m, n, nw
    +  double precision :: accu, accu2, cn
    +
    +  info = QMCKL_SUCCESS
    +
    +  if (context == QMCKL_NULL_CONTEXT) then
    +     info = QMCKL_INVALID_CONTEXT
    +     return
    +  endif
    +
    +  if (walk_num <= 0) then
    +     info = QMCKL_INVALID_ARG_2
    +     return
    +  endif
    +
    +  if (elec_num <= 0) then
    +     info = QMCKL_INVALID_ARG_3
    +     return
    +  endif
    +
    +  if (nucl_num <= 0) then
    +     info = QMCKL_INVALID_ARG_4
    +     return
    +  endif
    +
    +  if (cord_num <= 0) then
    +     info = QMCKL_INVALID_ARG_5
    +     return
    +  endif
    +
    +  factor_een = 0.0d0
    +
    +  do nw =1, walk_num
    +  do n = 1, dim_cord_vect
    +    l = lkpm_combined_index(1, n)  
    +    k = lkpm_combined_index(2, n)  
    +    p = lkpm_combined_index(3, n)  
    +    m = lkpm_combined_index(4, n)  
    +
    +    do a = 1, nucl_num
    +      accu2 = 0.0d0
    +      cn = cord_vect_full(n, a)
    +      do j = 1, elec_num
    +        accu = 0.0d0
    +        do i = 1, elec_num
    +          accu = accu + een_rescaled_e(nw, i, j, k) *       &
    +                        een_rescaled_n(nw, i, a, m)
    +        end do
    +        accu2 = accu2 + accu * een_rescaled_n(nw, j, a, m + l)
    +      end do
    +      factor_een(nw) = factor_een(nw) + accu2 + cn
    +    end do
    +  end do
    +  end do
    +
    +end function qmckl_compute_factor_een_f
    +
    +
    + +
    +
    qmckl_exit_code qmckl_compute_factor_een_deriv_e (
    +      const qmckl_context context,
    +      const int64_t walk_num,
    +      const int64_t elec_num,
    +      const int64_t nucl_num,
    +      const int64_t cord_num,
    +      const int64_t dim_cord_vect,
    +      const double* cord_vect_full,
    +      const int64_t* lkpm_combined_index,
    +      const double* een_rescaled_e,
    +      const double* een_rescaled_n,
    +      double* const factor_een ); 
    +
    +
    +
    +
    + + +
    +

    2.11.3 Test

    +
    +
    +
    /* Check if Jastrow is properly initialized */
    +//assert(qmckl_jastrow_provided(context));
    +//
    +
    +
    +
    +
    +
    +
    + +
    +

    2.12 Electron-electron-nucleus Jastrow \(f_{een}\) derivative

    +
    +

    +Calculate the electron-electron-nuclear three-body jastrow component factor_een_deriv_e +using the above prepared tables. +

    + +

    +TODO: write equations. +

    +
    + +
    +

    2.12.1 Get

    +
    +
    +
    qmckl_exit_code qmckl_get_jastrow_factor_een_deriv_e(qmckl_context context, double* const factor_een_deriv_e);
    +
    +
    +
    +
    + +
    +

    2.12.2 Compute

    +
    + + + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    qmcklcontextcontextinGlobal state
    int64twalknuminNumber of walkers
    int64telecnuminNumber of electrons
    int64tnuclnuminNumber of nucleii
    int64tcordnuminorder of polynomials
    int64tdimcordvectindimension of full coefficient vector
    doublecordvectfull[dimcordvect][nuclnum]infull coefficient vector
    int64tlkpmcombinedindex[4][dimcordvect]incombined indices
    doubleeenrescalede[walknum][elecnum][elecnum][0:cordnum]inElectron-nucleus rescaled
    doubleeenrescaledn[walknum][elecnum][nuclnum][0:cordnum]inElectron-nucleus rescaled factor
    doubleeenrescaledederive[walknum][elecnum][4][elecnum][0:cordnum]inElectron-nucleus rescaled
    doubleeenrescalednderive[walknum][elecnum][4][nuclnum][0:cordnum]inElectron-nucleus rescaled factor
    doublefactoreenderive[walknum][4][elecnum]outElectron-nucleus jastrow
    + +
    +
    integer function qmckl_compute_factor_een_deriv_e_f(context, walk_num, elec_num, nucl_num, cord_num, dim_cord_vect,            &
    +                                           cord_vect_full, lkpm_combined_index,                                                &
    +                                           een_rescaled_e, een_rescaled_n,                                                     &
    +                                           een_rescaled_e_deriv_e, een_rescaled_n_deriv_e, factor_een_deriv_e)                 &
    +     result(info)
    +  use qmckl
    +  implicit none
    +  integer(qmckl_context), intent(in)  :: context
    +  integer*8             , intent(in)  :: walk_num, elec_num, cord_num, nucl_num, dim_cord_vect
    +  integer*8             , intent(in)  :: lkpm_combined_index(4,dim_cord_vect)
    +  double precision      , intent(in)  :: cord_vect_full(dim_cord_vect, nucl_num)
    +  double precision      , intent(in)  :: een_rescaled_e(walk_num, elec_num, elec_num, 0:cord_num)
    +  double precision      , intent(in)  :: een_rescaled_n(walk_num, elec_num, nucl_num, 0:cord_num)
    +  double precision      , intent(in)  :: een_rescaled_e_deriv_e(walk_num, elec_num, 4, elec_num, 0:cord_num)
    +  double precision      , intent(in)  :: een_rescaled_n_deriv_e(walk_num, elec_num, 4, nucl_num, 0:cord_num)
    +  double precision      , intent(out) :: factor_een_deriv_e(elec_num, 4, walk_num)
    +
    +  integer*8 :: i, a, j, l, k, p, m, n, nw
    +  double precision :: accu, accu2, cn
    +  double precision :: daccu(1:4), daccu2(1:4)
    +
    +  info = QMCKL_SUCCESS
    +
    +  if (context == QMCKL_NULL_CONTEXT) then
    +     info = QMCKL_INVALID_CONTEXT
    +     return
    +  endif
    +
    +  if (walk_num <= 0) then
    +     info = QMCKL_INVALID_ARG_2
    +     return
    +  endif
    +
    +  if (elec_num <= 0) then
    +     info = QMCKL_INVALID_ARG_3
    +     return
    +  endif
    +
    +  if (nucl_num <= 0) then
    +     info = QMCKL_INVALID_ARG_4
    +     return
    +  endif
    +
    +  if (cord_num <= 0) then
    +     info = QMCKL_INVALID_ARG_5
    +     return
    +  endif
    +
    +  factor_een_deriv_e = 0.0d0
    +
    +  do nw =1, walk_num
    +  do n = 1, dim_cord_vect
    +    l = lkpm_combined_index(1, n)  
    +    k = lkpm_combined_index(2, n)  
    +    p = lkpm_combined_index(3, n)  
    +    m = lkpm_combined_index(4, n)  
    +
    +    do a = 1, nucl_num
    +      cn = cord_vect_full(n, a)
    +      do j = 1, elec_num
    +        accu = 0.0d0
    +        accu2 = 0.0d0
    +        daccu = 0.0d0
    +        daccu2 = 0.0d0
    +        do i = 1, elec_num
    +          accu = accu + een_rescaled_e(nw, i, j, k) *         &
    +                        een_rescaled_n(nw, i, a, m)
    +          accu2 = accu2 + een_rescaled_e(nw, i, j, k) *       &
    +                          een_rescaled_n(nw, i, a, m + l)
    +          daccu(1:4) = daccu(1:4) + een_rescaled_e_deriv_e(nw, j, 1:4, i, k) *         &
    +                                    een_rescaled_n(nw, i, a, m)
    +          daccu2(1:4) = daccu2(1:4) + een_rescaled_e_deriv_e(nw, j, 1:4, i, k) *       &
    +                                      een_rescaled_n(nw, i, a, m + l)
    +        end do
    +        factor_een_deriv_e(j, 1:4, nw) = factor_een_deriv_e(j, 1:4, nw) +              &
    +               (accu * een_rescaled_n_deriv_e(nw, j, 1:4, a, m + l)                    &
    +                + daccu(1:4) * een_rescaled_n(nw, j, a, m + l)                         &
    +                + daccu2(1:4) * een_rescaled_n(nw, j, a, m)                            &
    +                + accu2 * een_rescaled_n_deriv_e(nw, j, 1:4, a, m)) * cn
    +
    +        factor_een_deriv_e(j, 4, nw) = factor_een_deriv_e(j, 4, nw) + 2.0d0 * (        &
    +            daccu (1) * een_rescaled_n_deriv_e(nw, j, 1, a, m + l) +                    &
    +            daccu (2) * een_rescaled_n_deriv_e(nw, j, 2, a, m + l) +                    &
    +            daccu (3) * een_rescaled_n_deriv_e(nw, j, 3, a, m + l) +                    &
    +            daccu2(1) * een_rescaled_n_deriv_e(nw, j, 1, a, m    ) +                    &
    +            daccu2(2) * een_rescaled_n_deriv_e(nw, j, 2, a, m    ) +                    &
    +            daccu2(3) * een_rescaled_n_deriv_e(nw, j, 3, a, m    ) ) * cn
    +
    +      end do
    +    end do
    +  end do
    +  end do
    +
    +end function qmckl_compute_factor_een_deriv_e_f
    +
    +
    + +
    +
    qmckl_exit_code qmckl_compute_factor_een_deriv_e (
    +      const qmckl_context context,
    +      const int64_t walk_num,
    +      const int64_t elec_num,
    +      const int64_t nucl_num,
    +      const int64_t cord_num,
    +      const int64_t dim_cord_vect,
    +      const double* cord_vect_full,
    +      const int64_t* lkpm_combined_index,
    +      const double* een_rescaled_e,
    +      const double* een_rescaled_n,
    +      const double* een_rescaled_e_deriv_e,
    +      const double* een_rescaled_n_deriv_e,
    +      double* const factor_een_deriv_e ); 
    +
    +
    +
    +
    + + +
    +

    2.12.3 Test

    +
    +
    +
    ///* Check if Jastrow is properly initialized */
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Author: TREX CoE

    +

    Created: 2021-07-08 Thu 06:58

    +

    Validate

    +
    + + diff --git a/qmckl_memory.html b/qmckl_memory.html index 6a10cd5..7299655 100644 --- a/qmckl_memory.html +++ b/qmckl_memory.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Memory management @@ -311,15 +311,15 @@ for the JavaScript code in this tag.

    Table of Contents

    -
    -

    1 Memory data structure for the context

    +
    +

    1 Memory data structure for the context

    Every time a new block of memory is allocated, the information @@ -361,8 +361,8 @@ array, and the number of allocated blocks.

    -
    -

    2 Passing info to allocation routines

    +
    +

    2 Passing info to allocation routines

    Passing information to the allocation routine should be done by @@ -371,8 +371,8 @@ passing an instance of a qmckl_memory_info_struct.

    -
    -

    3 Allocation/deallocation functions

    +
    +

    3 Allocation/deallocation functions

    Memory allocation inside the library should be done with @@ -535,7 +535,7 @@ allocation and needs to be updated.

    Author: TREX CoE

    -

    Created: 2021-07-07 Wed 23:26

    +

    Created: 2021-07-08 Thu 06:58

    Validate

    diff --git a/qmckl_nucleus.html b/qmckl_nucleus.html index d024dec..ef20700 100644 --- a/qmckl_nucleus.html +++ b/qmckl_nucleus.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Nucleus @@ -333,35 +333,35 @@ for the JavaScript code in this tag.

    Table of Contents

    -
    -

    1 Context

    +
    +

    1 Context

    The following data stored in the context: @@ -463,8 +463,8 @@ The following data stored in the context:

    -
    -

    1.1 Data structure

    +
    +

    1.1 Data structure

    typedef struct qmckl_nucleus_struct {
    @@ -523,8 +523,8 @@ this mechanism.
     
     
     
    -
    -

    1.2 Access functions

    +
    +

    1.2 Access functions

    When all the data relative to nuclei have been set, the following @@ -538,8 +538,8 @@ function returns true.

    -
    -

    1.3 Initialization functions

    +
    +

    1.3 Initialization functions

    To set the data relative to the nuclei in the context, the @@ -574,8 +574,8 @@ atoms. The coordinates should be given in atomic units.

    -
    -

    1.4 Test

    +
    +

    1.4 Test

    const int64_t   nucl_num      = chbrclf_nucl_num;
    @@ -659,8 +659,8 @@ rc = qmckl_get_nucleus_charge(context, nucl_charge2);
     
    -
    -

    2 Computation

    +
    +

    2 Computation

    The computed data is stored in the context so that it can be reused @@ -673,12 +673,12 @@ current date is stored.

    -
    -

    2.1 Nucleus-nucleus distances

    +
    +

    2.1 Nucleus-nucleus distances

    -
    -

    2.1.1 Get

    +
    +

    2.1.1 Get

    qmckl_exit_code qmckl_get_nucleus_nn_distance(qmckl_context context, double* distance);
    @@ -687,10 +687,10 @@ current date is stored.
     
    -
    -

    2.1.2 Compute

    +
    +

    2.1.2 Compute

    - +
    @@ -768,8 +768,8 @@ current date is stored. -
    -

    2.1.3 Test

    +
    +

    2.1.3 Test

    /* Reference input data */
    @@ -789,12 +789,12 @@ rc = qmckl_get_nucleus_nn_distance(context, distance);
     
    -
    -

    2.2 Nucleus-nucleus rescaled distances

    +
    +

    2.2 Nucleus-nucleus rescaled distances

    -
    -

    2.2.1 Get

    +
    +

    2.2.1 Get

    qmckl_exit_code qmckl_get_nucleus_nn_distance_rescaled(qmckl_context context, double* distance_rescaled);
    @@ -803,10 +803,10 @@ rc = qmckl_get_nucleus_nn_distance(context, distance);
     
    -
    -

    2.2.2 Compute

    +
    +

    2.2.2 Compute

    -
    +
    @@ -885,8 +885,8 @@ rc = qmckl_get_nucleus_nn_distance(context, distance); -
    -

    2.2.3 Test

    +
    +

    2.2.3 Test

    /* Reference input data */
    @@ -906,8 +906,8 @@ rc = qmckl_get_nucleus_nn_distance(context, distance);
     
    -
    -

    2.3 Nuclear repulsion energy

    +
    +

    2.3 Nuclear repulsion energy

    \[ @@ -916,8 +916,8 @@ rc = qmckl_get_nucleus_nn_distance(context, distance);

    -
    -

    2.3.1 Get

    +
    +

    2.3.1 Get

    qmckl_exit_code qmckl_get_nucleus_repulsion(qmckl_context context, double* energy);
    @@ -926,10 +926,10 @@ rc = qmckl_get_nucleus_nn_distance(context, distance);
     
    -
    -

    2.3.2 Compute

    +
    +

    2.3.2 Compute

    -
    +
    @@ -1017,8 +1017,8 @@ rc = qmckl_get_nucleus_nn_distance(context, distance); -
    -

    2.3.3 Test

    +
    +

    2.3.3 Test

    /* Reference input data */
    @@ -1038,7 +1038,7 @@ rc = qmckl_get_nucleus_repulsion(context, &rep);
     

    Author: TREX CoE

    -

    Created: 2021-07-07 Wed 23:26

    +

    Created: 2021-07-08 Thu 06:58

    Validate

    diff --git a/qmckl_numprec.html b/qmckl_numprec.html index beb65e6..dffe04b 100644 --- a/qmckl_numprec.html +++ b/qmckl_numprec.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Numerical precision @@ -333,16 +333,16 @@ for the JavaScript code in this tag.

    Table of Contents

    -
    -

    1 Control of the numerical precision

    +
    +

    1 Control of the numerical precision

    Controlling numerical precision enables optimizations. Here, the @@ -353,7 +353,7 @@ Arithmetic (IEEE 754), refers to the number of exponent bits.

    -
    +
    @@ -397,8 +397,8 @@ integer. The update functions return QMCKL_SUCCESS or -
    -

    2 Precision

    +
    +

    2 Precision

    qmckl_context_set_numprec_precision modifies the parameter for the @@ -485,8 +485,8 @@ numerical precision in the context.

    -
    -

    3 Range

    +
    +

    3 Range

    qmckl_set_numprec_range modifies the parameter for the numerical @@ -561,8 +561,8 @@ range in a given context.

    -
    -

    4 Helper functions

    +
    +

    4 Helper functions

    qmckl_get_numprec_epsilon returns \(\epsilon = 2^{1-n}\) where n is the precision. @@ -581,7 +581,7 @@ We need to remove the sign bit from the precision.

    Author: TREX CoE

    -

    Created: 2021-07-07 Wed 23:26

    +

    Created: 2021-07-08 Thu 06:58

    Validate

    diff --git a/qmckl_tests.html b/qmckl_tests.html index fab793b..c76e390 100644 --- a/qmckl_tests.html +++ b/qmckl_tests.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Data for Tests @@ -233,20 +233,27 @@ for the JavaScript code in this tag.

    Table of Contents

    -
    -

    1 CHBrClF

    +
    +

    1 CHBrClF

    This test is the all-electron Hartree-Fock wave function of CHClBr, @@ -330,8 +337,8 @@ and with a high maximum angular momentum.

    -
    -

    1.1 XYZ coordinates

    +
    +

    1.1 XYZ coordinates

       5
    @@ -361,8 +368,8 @@ Nuclear coordinates are stored in atomic units in transposed format.
     
    -
    -

    1.2 Atomic basis set

    +
    +

    1.2 Atomic basis set

     HYDROGEN
    @@ -1175,11 +1182,11 @@ F   1
     
    -
    -

    1.3 TODO Molecular orbitals

    +
    +

    1.3 TODO Molecular orbitals

    -
    -

    1.4 Electron coordinates

    +
    +

    1.4 Electron coordinates

    Electron coordinates are stored in atomic units in normal format. @@ -1332,6 +1339,206 @@ Electron coordinates are stored in atomic units in normal format. }; + +

    +
    +
    +
    + + +
    +

    2 N2

    +
    +

    +This test is mainly for the Jastrow factor and was supplied by +Ramon Panades Baruetta. The coordinates and Jastrow coefficients +have been taken from his fork of IRPJast. The core electrons are +treated by pseudopotentials thus excluded from the actual calculation. +

    + +
    + + +++ ++ + + + + + + + + + + + + + + + + + + + + + +
    Number of atoms2
    Number of alpha electrons5
    Number of beta electrons5
    Number of core electrons4
    +
    + +
    +

    2.1 XYZ coordinates

    +
    +
    +  2
    +N2
    + N         0.000000    0.000000    0.000000
    + N         0.000000    0.000000    2.059801
    +
    + +

    +Nuclear coordinates are stored in atomic units in transposed format. +

    + +
    +
    #define n2_nucl_num ((int64_t) 2)
    +
    +double n2_charge[n2_nucl_num] = { 5., 5.};
    +
    +double n2_nucl_coord[3][n2_nucl_num] =
    +{ {0.000000,  0.000000 },
    +  {0.000000,  0.000000 },
    +  {0.000000,  2.059801 } };
    +
    +
    +
    +
    + +
    +

    2.2 Electron coordinates

    +
    +

    +Electron coordinates are stored in atomic units in normal format. +

    + +
    +
    #define n2_elec_up_num  ((int64_t) 5)
    +#define n2_elec_dn_num  ((int64_t) 5)
    +#define n2_elec_num     ((int64_t) 10)
    +#define n2_walk_num     ((int64_t) 1)
    +
    +double n2_elec_coord[n2_walk_num][n2_elec_num][3] = { {
    +    {-0.250655104764153      ,  0.503070975550133      ,  -0.166554344502303},      
    +    {-0.587812193472177      , -0.128751981129274      ,   0.187773606533075},    
    +    { 1.61335569047166       , -0.615556732874863      ,  -1.43165470979934 },   
    +    {-4.901239896295210E-003 , -1.120440036458986E-002 ,   1.99761909330422 },   
    +    { 0.766647499681200      , -0.293515395797937      ,   3.66454589201239 },   
    +    {-0.127732483187947      , -0.138975497694196      ,  -8.669850480215846E-002},
    +    {-0.232271834949124      , -1.059321673434182E-002 ,  -0.504862241464867},
    +    { 1.09360863531826       , -2.036103063808752E-003 ,  -2.702796910818986E-002},
    +    {-0.108090166832043      ,  0.189161729653261      ,   2.15398313919894},
    +    { 0.397978144318712      , -0.254277292595981      ,   2.54553335476344}}};
    +
    +
    +
    +
    +
    + +
    +

    2.3 Jastrow related data

    +
    +

    +This test is mainly for the Jastrow factor and was supplied by +Ramon Panades Baruetta. +

    + +
    +
    /* Jastrow related */
    +
    +#define n2_type_nucl_num    ((int64_t) 1) 
    +#define n2_aord_num         ((int64_t) 5) 
    +#define n2_bord_num         ((int64_t) 5) 
    +#define n2_cord_num         ((int64_t) 23) 
    +#define n2_dim_cord_vec     ((int64_t) 23)
    +
    +int64_t n2_type_nucl_vector[n2_nucl_num] = {
    +  1,
    +  1};
    +
    +double n2_aord_vector[n2_aord_num + 1][n2_type_nucl_num] = {  
    +  { 0.      }, 
    +  { 0.      },
    +  {-0.380512},
    +  {-0.157996},
    +  {-0.031558},
    +  { 0.021512}};
    +
    +double n2_bord_vector[n2_bord_num + 1] = {
    +   0.5       ,
    +   0.15366   ,
    +   0.0672262 ,
    +   0.02157   ,
    +   0.0073096 , 
    +   0.002866  };
    +
    +double n2_cord_vector[n2_cord_num][n2_type_nucl_num] = {  
    +  { 5.717020e-01}, 
    +  {-5.142530e-01},
    +  {-5.130430e-01},
    +  { 9.486000e-03},
    +  {-4.205000e-03},
    +  { 4.263258e-01},
    +  { 8.288150e-02},
    +  { 5.118600e-03},
    +  {-2.997800e-03},
    +  {-5.270400e-03},
    +  {-7.500000e-05},
    +  {-8.301650e-02},
    +  { 1.454340e-02},
    +  { 5.143510e-02},
    +  { 9.250000e-04},
    +  {-4.099100e-03},
    +  { 4.327600e-03},
    +  {-1.654470e-03},
    +  { 2.614000e-03},
    +  {-1.477000e-03},
    +  {-1.137000e-03},
    +  {-4.010475e-02},
    +  { 6.106710e-03}};
    +
    +double n2_cord_vector_full[n2_dim_cord_vec][n2_nucl_num] = {
    +   { 5.717020e-01,  5.717020e-01},
    +   {-5.142530e-01, -5.142530e-01},
    +   {-5.130430e-01, -5.130430e-01},
    +   { 9.486000e-03,  9.486000e-03},
    +   {-4.205000e-03, -4.205000e-03},
    +   { 4.263258e-01,  4.263258e-01},
    +   { 8.288150e-02,  8.288150e-02},
    +   { 5.118600e-03,  5.118600e-03},
    +   {-2.997800e-03, -2.997800e-03},
    +   {-5.270400e-03, -5.270400e-03},
    +   {-7.500000e-05, -7.500000e-05},
    +   {-8.301650e-02, -8.301650e-02},
    +   { 1.454340e-02,  1.454340e-02},
    +   { 5.143510e-02,  5.143510e-02},
    +   { 9.250000e-04,  9.250000e-04},
    +   {-4.099100e-03, -4.099100e-03},
    +   { 4.327600e-03,  4.327600e-03},
    +   {-1.654470e-03, -1.654470e-03},
    +   { 2.614000e-03,  2.614000e-03},
    +   {-1.477000e-03, -1.477000e-03},
    +   {-1.137000e-03, -1.137000e-03},
    +   {-4.010475e-02, -4.010475e-02}, 
    +   { 6.106710e-03,  6.106710e-03}};
    +
    +double n2_lkpm_of_cindex[4][n2_dim_cord_vec] = {
    +  {1, 1, 2, 0, 0, 0, 2, 1, 1, 2, 3, 0, 2, 1, 3, 0, 0, 1, 3, 1, 1, 0, 3}, 
    +  {1, 1, 3, 4, 0, 2, 2, 4, 0, 0, 2, 4, 1, 3, 1, 4, 0, 1, 1, 4, 1, 2, 0},
    +  {4, 1, 0, 0, 4, 2, 1, 4, 5, 0, 2, 3, 5, 0, 0, 3, 5, 1, 3, 2, 5, 0, 1},
    +  {2, 5, 1, 4, 1, 5, 0, 2, 1, 5, 1, 0, 1, 5, 2, 3, 0, 5, 1, 1, 0, 5, 2}};
    +
     
    @@ -1339,7 +1546,7 @@ Electron coordinates are stored in atomic units in normal format.
    -

    Created: 2021-07-07 Wed 23:26

    +

    Created: 2021-07-08 Thu 06:58

    Validate

    diff --git a/qmckl_utils.html b/qmckl_utils.html index 46ae002..5b60fa2 100644 --- a/qmckl_utils.html +++ b/qmckl_utils.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Utility functions @@ -333,13 +333,13 @@ for the JavaScript code in this tag.

    Table of Contents

    -
    -

    1 Matrix operations

    +
    +

    1 Matrix operations

    -
    -

    1.1 qmckl_transpose

    +
    +

    1.1 qmckl_transpose

    Transposes a matrix: \(B_{ji} = A_{ij}\)

    - +
    @@ -424,8 +424,8 @@ Transposes a matrix: \(B_{ji} = A_{ij}\)
    -
    -

    1.1.1 Requirements

    +
    +

    1.1.1 Requirements

    • context is not QMCKL_NULL_CONTEXT
    • @@ -439,12 +439,12 @@ Transposes a matrix: \(B_{ji} = A_{ij}\)
    -
    -

    1.1.2 C header

    +
    +

    1.1.2 C header

    qmckl_exit_code qmckl_transpose (
    -              const qmckl_context context,
    +      const qmckl_context context,
           const int64_t m,
           const int64_t n,
           const double* A,
    @@ -456,8 +456,8 @@ Transposes a matrix: \(B_{ji} = A_{ij}\)
     
    -
    -

    1.1.3 Source

    +
    +

    1.1.3 Source

    integer function qmckl_transpose_f(context, m, n, A, LDA, B, LDB) &
    @@ -516,7 +516,7 @@ Transposes a matrix: \(B_{ji} = A_{ij}\)
     

    Author: TREX CoE

    -

    Created: 2021-07-07 Wed 23:26

    +

    Created: 2021-07-08 Thu 06:58

    Validate