From 27d14e218e85810d3cb4a6502405ddd37f949d1c Mon Sep 17 00:00:00 2001 From: scemama Date: Fri, 17 Mar 2023 13:57:01 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20TREX-CoE?= =?UTF-8?q?/qmckl@2ecfc55dbce7f60af365683f7debcb3e02d20954=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.html | 4 +- qmckl.html | 118 +-- qmckl_ao.html | 272 +++--- qmckl_blas.html | 205 +++-- qmckl_context.html | 44 +- qmckl_determinant.html | 120 +-- qmckl_distance.html | 114 +-- qmckl_electron.html | 238 +++--- qmckl_error.html | 70 +- qmckl_examples.html | 36 +- qmckl_jastrow.html | 618 +++++++------- qmckl_local_energy.html | 156 ++-- qmckl_memory.html | 28 +- qmckl_mo.html | 1176 +++++++++++++++++++++++--- qmckl_nucleus.html | 92 +- qmckl_numprec.html | 30 +- qmckl_point.html | 50 +- qmckl_sherman_morrison_woodbury.html | 246 +++--- qmckl_tests.html | 58 +- qmckl_trexio.html | 200 ++--- qmckl_verificarlo.html | 46 +- 21 files changed, 2456 insertions(+), 1465 deletions(-) diff --git a/README.html b/README.html index b7da9f9..6ea6d4b 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 @@ -375,7 +375,7 @@ and bug reports should be submitted at

Author: TREX CoE

-

Created: 2023-03-09 Thu 10:02

+

Created: 2023-03-17 Fri 13:56

Validate

diff --git a/qmckl.html b/qmckl.html index abe63c2..593da90 100644 --- a/qmckl.html +++ b/qmckl.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Introduction @@ -346,36 +346,36 @@ for the JavaScript code in this tag.

Table of Contents

-
-

1 Installing QMCkl

+
+

1 Installing QMCkl

The latest version fo QMCkl can be downloaded @@ -384,8 +384,8 @@ The latest version fo QMCkl can be downloaded

-
-

1.1 Installing from the released tarball (for end users)

+
+

1.1 Installing from the released tarball (for end users)

QMCkl is built with GNU Autotools, so the usual @@ -400,8 +400,8 @@ options are defined using CFLAGS and FCFLAGS.

-
-

1.2 Installing from the source repository (for developers)

+
+

1.2 Installing from the source repository (for developers)

To compile from the source repository, additional dependencies are @@ -422,8 +422,8 @@ to be executed first.

-
-

2 Using QMCkl

+
+

2 Using QMCkl

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

-
-

3 Developing in QMCkl

+
+

3 Developing in QMCkl

-
-

3.1 Literate programming

+
+

3.1 Literate programming

In a traditional source code, most of the lines of source files of a program @@ -507,8 +507,8 @@ tarball contains the generated source code.

-
-

3.2 Source code editing

+
+

3.2 Source code editing

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

-
-

3.3 Choice of the programming language

+
+

3.3 Choice of the programming language

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

-
-

3.4 Coding rules

+
+

3.4 Coding rules

The authors should follow the recommendations of the C99 @@ -625,8 +625,8 @@ make cppcheck ; cat cppcheck.out

-
-

3.5 Design of the library

+
+

3.5 Design of the library

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

-
-

3.6 Naming conventions

+
+

3.6 Naming conventions

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

-
-

3.7 Application programming interface

+
+

3.7 Application programming interface

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

-
-

3.8 Global state

+
+

3.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.

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

3.9 Headers

+
+

3.9 Headers

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

-
-

3.10 Low-level functions

+
+

3.10 Low-level functions

Low-level functions are very simple functions which are leaves of @@ -813,14 +813,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.

-
-

3.11 High-level functions

+
+

3.11 High-level functions

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

-
-

3.12 Numerical precision

+
+

3.12 Numerical precision

The minimal number of bits of precision required for a function @@ -841,7 +841,7 @@ 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 variable. +specified in the context variable.

@@ -909,8 +909,8 @@ following points :

-
-

3.13 Algorithms

+
+

3.13 Algorithms

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

Author: TREX CoE

-

Created: 2023-03-09 Thu 10:03

+

Created: 2023-03-17 Fri 13:56

Validate

diff --git a/qmckl_ao.html b/qmckl_ao.html index 35d04c4..d6a6527 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 @@ -346,61 +346,61 @@ for the JavaScript code in this tag.

Table of Contents

-
-

1 Introduction

+
+

1 Introduction

The atomic basis set is defined as a list of shells. Each shell \(s\) is @@ -463,19 +463,19 @@ gradients and Laplacian of the atomic basis functions.

-
-

2 Context

+
+

2 Context

-
-

2.1 Constant data

+
+

2.1 Constant data

The following arrays are stored in the context, and need to be set when initializing the library:

- +
@@ -585,6 +585,66 @@ when initializing the library:
+

+The following data is computed when the basis is finalized: +

+ + + + +++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VariableTypeDescription
nucleus_prim_indexint64_t[nucl_num+1]Index of the first primitive of each nucleus
nucleus_max_ang_momint32_t[nucl_num]Maximum angular momentum of each nucleus
coefficient_normalized~double[prim_num]Normalized array of coefficients
ao_ang_momint32_t[ao_num]Angular momentum of the shell to which the AO belongs
ao_nuclint64_t[ao_num]Nucleus on which the AO is centered
nucleus_rangedouble[nucl_num]Distance beyond which all AOs are zero
+

For H2 with the following basis set,

@@ -649,7 +709,7 @@ calling the functions:

-
qmckl_exit_code qmckl_set_ao_basis_$V$ ( qmckl_context context,
+
qmckl_exit_code qmckl_set_ao_basis_$V$ ( qmckl_context context,
                                          const $type_of_V$ $V$);
 
 qmckl_exit_code qmckl_get_ao_basis_$V$ ( const qmckl_context context,
@@ -686,7 +746,7 @@ For array variables, use the rule:
 

-
qmckl_exit_code qmckl_set_ao_basis_$V$ ( qmckl_context context,
+
qmckl_exit_code qmckl_set_ao_basis_$V$ ( qmckl_context context,
                                          const $type_of_V$ $V$,
                                          const int64_t size_max);
 
@@ -724,17 +784,17 @@ For array variables, use the rule:
 
-
-

2.1.1 Initialization functions

+
+

2.1.1 Initialization functions

size_max is the dimension of the input array, which should be -equal of larger than the value given in the table of section 2. +equal of larger than the value given in the table of section 2.

-
-
2.1.1.1 C interface
+
+
2.1.1.1 C interface

To set the basis set, all the following functions need to be @@ -858,8 +918,8 @@ called.

-
-
2.1.1.2 Fortran interface
+
+
2.1.1.2 Fortran interface
interface
@@ -1042,17 +1102,17 @@ called.
 
-
-

2.1.2 Access functions

+
+

2.1.2 Access functions

size_max is the dimension of the input array, which should be -equal of larger than the value given in the table of section 2. +equal of larger than the value given in the table of section 2.

-
-
2.1.2.1 C interface
+
+
2.1.2.1 C interface
qmckl_exit_code
@@ -1174,8 +1234,8 @@ function returns true.
 
-
-
2.1.2.2 Fortran interface
+
+
2.1.2.2 Fortran interface
interface
@@ -1359,8 +1419,8 @@ function returns true.
 
-
-

2.2 Computed data

+
+

2.2 Computed data

The following data is computed as described in the next sections: @@ -1435,8 +1495,8 @@ The following data is computed as described in the next sections:

-
-

2.2.1 After initialization

+
+

2.2.1 After initialization

When the basis set is completely entered, extra data structures may be @@ -1450,8 +1510,8 @@ the context.

-
-

2.2.2 TODO HPC-specific data structures

+
+

2.2.2 TODO HPC-specific data structures

For faster access, we provide extra arrays for the shell information as: @@ -1481,8 +1541,8 @@ which is a matrix-vector product.

-
-

2.2.3 Access functions

+
+

2.2.3 Access functions

qmckl_exit_code
@@ -1495,7 +1555,7 @@ which is a matrix-vector product.
 

Returns the array of values, gradients an Laplacian of primitive basis functions evaluated at the current coordinates. -See section 3.2. +See section 3.2.

@@ -1508,7 +1568,7 @@ See section 3.2.

Returns the array of values, gradients an Laplacian of contracted shells -evaluated at the current coordinates. See section 3.3. +evaluated at the current coordinates. See section 3.3.

@@ -1522,7 +1582,7 @@ evaluated at the current coordinates. See section 3.3.

Returns the array of values, gradients an Laplacian of the atomic orbitals evaluated at the current coordinates. -See section 5. +See section 5.

@@ -1547,7 +1607,7 @@ Uses the given array to compute the VGL.

Returns the array of values of the atomic orbitals evaluated at -the current coordinates. See section 5. +the current coordinates. See section 5.

@@ -1566,12 +1626,12 @@ Uses the given array to compute the value.

-
-

3 Radial part

+
+

3 Radial part

-
-

3.1 General functions for Gaussian basis functions

+
+

3.1 General functions for Gaussian basis functions

qmckl_ao_gaussian_vgl computes the values, gradients and @@ -1742,10 +1802,10 @@ Requirements:

-
-

3.2 Computation of primitives

+
+

3.2 Computation of primitives

- +
@@ -1904,10 +1964,10 @@ Requirements: -
-

3.3 Computation of shells

+
+

3.3 Computation of shells

-
+
@@ -2159,8 +2219,8 @@ Requirements: -
-

4 Polynomial part

+
+

4 Polynomial part

Going from the atomic basis set to AOs implies a systematic @@ -2180,8 +2240,8 @@ f & : & f_{xxx}, f_{xxy}, f_{xxz}, f_{xyy}, f_{xyz}, f_{xzz}, f_{yyy}, f_{yyz}, \end{eqnarray}

-
-

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

+
+

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

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

-
+
@@ -2331,8 +2391,8 @@ Requirements: -
-

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

+
+

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

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

-
+
@@ -3156,18 +3216,18 @@ For example, with a=0, b=2 and c=1 the string is "yyz" -
-

5 Combining radial and polynomial parts

+
+

5 Combining radial and polynomial parts

-
-

5.1 Values only

+
+

5.1 Values only

-
-

5.1.1 Unoptimized version

+
+

5.1.1 Unoptimized version

-
+
@@ -3403,10 +3463,10 @@ For example, with a=0, b=2 and c=1 the string is "yyz" -
-

5.1.2 HPC version

+
+

5.1.2 HPC version

-
+
@@ -3564,8 +3624,8 @@ For example, with a=0, b=2 and c=1 the string is "yyz" -
-

5.1.3 Interfaces

+
+

5.1.3 Interfaces

qmckl_exit_code qmckl_compute_ao_value_doc (
@@ -3614,14 +3674,14 @@ For example, with a=0, b=2 and c=1 the string is "yyz"
 
-
-

5.2 Value, gradients, Laplacian

+
+

5.2 Value, gradients, Laplacian

-
-

5.2.1 Unoptimized version

+
+

5.2.1 Reference version

-
+
@@ -3886,10 +3946,10 @@ For example, with a=0, b=2 and c=1 the string is "yyz" -
-

5.2.2 HPC version

+
+

5.2.2 HPC version

-
+
@@ -4048,8 +4108,8 @@ For example, with a=0, b=2 and c=1 the string is "yyz" -
-

5.2.3 Interfaces

+
+

5.2.3 Interfaces

qmckl_exit_code qmckl_compute_ao_vgl_doc (
@@ -4101,7 +4161,7 @@ For example, with a=0, b=2 and c=1 the string is "yyz"
 

Author: TREX CoE

-

Created: 2023-03-09 Thu 10:03

+

Created: 2023-03-17 Fri 13:56

Validate

diff --git a/qmckl_blas.html b/qmckl_blas.html index 7af01a3..acac9d7 100644 --- a/qmckl_blas.html +++ b/qmckl_blas.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + BLAS functions @@ -346,54 +346,55 @@ for the JavaScript code in this tag.

Table of Contents

-
-

-

-
+
+

-

+

Basic linear algebra data types and operations are described in this file. The data types are private, so that HPC implementations can use @@ -407,12 +408,12 @@ are not intended to be passed to external codes.

-
-

1 Data types

+
+

1 Data types

-
-

1.1 Vector

+
+

1.1 Vector

@@ -466,8 +467,8 @@ Allocates a new vector. If the allocation failed the size is zero. -
-

1.2 Matrix

+
+

1.2 Matrix

@@ -527,8 +528,8 @@ Allocates a new matrix. If the allocation failed the sizes are zero. -
-

1.3 Tensor

+
+

1.3 Tensor

@@ -550,7 +551,7 @@ Allocates a new matrix. If the allocation failed the sizes are zero. - + @@ -576,7 +577,7 @@ in the first dimension are consecutive in memory.
qmckl_tensor
 qmckl_tensor_alloc( qmckl_context context,
-                    const int64_t order,
+                    const int32_t order,
                     const int64_t* size);
 
@@ -595,16 +596,16 @@ is zero. -
-

1.4 Reshaping

+
+

1.4 Reshaping

Reshaping occurs in-place and the pointer to the data is copied.

-
-

1.4.1 Vector -> Matrix

+
+

1.4.1 Vector -> Matrix

qmckl_matrix
@@ -620,13 +621,13 @@ Reshapes a vector into a matrix.
 
-
-

1.4.2 Vector -> Tensor

+
+

1.4.2 Vector -> Tensor

qmckl_tensor
 qmckl_tensor_of_vector(const qmckl_vector vector,
-                       const int64_t order,
+                       const int32_t order,
                        const int64_t* size);
 
@@ -637,8 +638,8 @@ Reshapes a vector into a tensor.
-
-

1.4.3 Matrix -> Vector

+
+

1.4.3 Matrix -> Vector

qmckl_vector
@@ -652,13 +653,13 @@ Reshapes a matrix into a vector.
 
-
-

1.4.4 Matrix -> Tensor

+
+

1.4.4 Matrix -> Tensor

qmckl_tensor
 qmckl_tensor_of_matrix(const qmckl_matrix matrix,
-                       const int64_t order,
+                       const int32_t order,
                        const int64_t* size);
 
@@ -669,8 +670,8 @@ Reshapes a matrix into a tensor.
-
-

1.4.5 Tensor -> Vector

+
+

1.4.5 Tensor -> Vector

qmckl_vector
@@ -684,8 +685,8 @@ Reshapes a tensor into a vector.
 
-
-

1.4.6 Tensor -> Matrix

+
+

1.4.6 Tensor -> Matrix

qmckl_matrix
@@ -702,8 +703,8 @@ Reshapes a tensor into a vector.
 
-
-

1.5 Access macros

+
+

1.5 Access macros

Macros are provided to ease the access to vectors, matrices and @@ -727,12 +728,12 @@ For example:

-
-

1.6 Set all elements

+
+

1.6 Set all elements

-
-

1.6.1 Vector

+
+

1.6.1 Vector

qmckl_vector
@@ -742,8 +743,8 @@ For example:
 
-
-

1.6.2 Matrix

+
+

1.6.2 Matrix

qmckl_matrix
@@ -753,8 +754,8 @@ For example:
 
-
-

1.6.3 Tensor

+
+

1.6.3 Tensor

qmckl_tensor
@@ -765,8 +766,8 @@ For example:
 
-
-

1.7 Copy to/from to double*

+
+

1.7 Copy to/from to double*

qmckl_exit_code
@@ -847,14 +848,38 @@ Converts a double* to a tensor.
 

+ +
+

1.8 Allocate and copy to double*

+
+
+
double* qmckl_alloc_double_of_vector(const qmckl_context context,
+                                     const qmckl_vector vector);
+
-
-

2 Matrix operations

+
+
double* qmckl_alloc_double_of_matrix(const qmckl_context context,
+                                     const qmckl_matrix matrix);
+
+
+ + +
+
double* qmckl_alloc_double_of_tensor(const qmckl_context context,
+                                     const qmckl_tensor tensor);
+
+
+
+
+
+ +
+

2 Matrix operations

-
-

2.1 qmckl_dgemm

+
+

2.1 qmckl_dgemm

Matrix multiplication with a BLAS interface: @@ -866,7 +891,7 @@ Matrix multiplication with a BLAS interface: \]

-
orderint64_tint32_t Order of the tensor
+
@@ -1025,8 +1050,8 @@ Requirements: -
-

2.2 qmckl_dgemm_safe

+
+

2.2 qmckl_dgemm_safe

"Size-safe" proxy function with the same functionality as qmckl_dgemm @@ -1035,7 +1060,7 @@ are required primarily for the Python API, where compatibility with NumPy arrays implies that sizes of the input and output arrays are provided.

-
+
@@ -1221,8 +1246,8 @@ Requirements: -
-

2.3 qmckl_matmul

+
+

2.3 qmckl_matmul

Matrix multiplication using the qmckl_matrix data type: @@ -1234,7 +1259,7 @@ Matrix multiplication using the qmckl_matrix data type: \]

-
+
@@ -1328,8 +1353,8 @@ Matrix multiplication using the qmckl_matrix data type: -
-

2.4 qmckl_adjugate

+
+

2.4 qmckl_adjugate

Given a matrix \(\mathbf{A}\), the adjugate matrix @@ -1347,7 +1372,7 @@ of \(\mathbf{A}\). See also: https://en.wikipedia.org/wiki/Adjugate_matrix

-
+
@@ -1543,8 +1568,8 @@ determinant with the inverse: -
-

2.5 qmckl_adjugate_safe

+
+

2.5 qmckl_adjugate_safe

"Size-safe" proxy function with the same functionality as qmckl_adjugate @@ -1554,7 +1579,7 @@ NumPy arrays implies that sizes of the input and output arrays are provided.

-
+
@@ -1676,13 +1701,13 @@ LAPACK library.

-
-

2.5.1 C interface

+
+

2.5.1 C interface

-
-

2.6 qmckl_transpose

+
+

2.6 qmckl_transpose

Transposes a matrix: \(A^\dagger_{ji} = A_{ij}\). @@ -1745,7 +1770,7 @@ Transposes a matrix: \(A^\dagger_{ji} = A_{ij}\).

Author: TREX CoE

-

Created: 2023-03-09 Thu 10:03

+

Created: 2023-03-17 Fri 13:56

Validate

diff --git a/qmckl_context.html b/qmckl_context.html index d32a0b9..ab67894 100644 --- a/qmckl_context.html +++ b/qmckl_context.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Context @@ -324,21 +324,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, @@ -351,7 +351,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
 
@@ -369,8 +369,8 @@ and ctx is a qmckl_context_struct* pointer.

-
-

1.1 Data structure

+
+

1.1 Data structure

The qmcklextra pointer lets the other implementation of the library @@ -406,7 +406,7 @@ to be recomputed. The date is incremented when the context is touched.

When a new element is added to the context, the functions -qmckl_context_create qmckl_context_destroy and qmckl_context_copy +qmckl_context_create qmckl_context_destroy and qmckl_context_copy should be updated in order to make deep copies.

@@ -427,8 +427,8 @@ This has the effect to increment the date of the context.
-
-

1.2 Creation

+
+

1.2 Creation

To create a new context, qmckl_context_create() should be used. @@ -445,8 +445,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 @@ -462,8 +462,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 @@ -471,8 +471,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. @@ -490,7 +490,7 @@ It frees the context, and returns the previous context.

Author: TREX CoE

-

Created: 2023-03-09 Thu 10:02

+

Created: 2023-03-17 Fri 13:56

Validate

diff --git a/qmckl_determinant.html b/qmckl_determinant.html index 55ff22b..f13d480 100644 --- a/qmckl_determinant.html +++ b/qmckl_determinant.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Slater Determinant @@ -324,32 +324,32 @@ for the JavaScript code in this tag.

Table of Contents

-
-

1 Context

+
+

1 Context

The following arrays are stored in the context: @@ -535,8 +535,8 @@ Computed data:

-
-

1.1 Data structure

+
+

1.1 Data structure

typedef struct qmckl_determinant_struct {
@@ -604,8 +604,8 @@ this mechanism.
 
-
-

1.2 Access functions

+
+

1.2 Access functions

When all the data for the slater determinants have been provided, the following @@ -619,8 +619,8 @@ function returns true.

-
-

1.3 Initialization functions

+
+

1.3 Initialization functions

To set the basis set, all the following functions need to be @@ -643,24 +643,24 @@ computed to accelerate the calculations.

-
-

1.4 Fortran Interfaces

+
+

1.4 Fortran Interfaces

-
-

1.5 Test

+
+

1.5 Test

-
-

2 Computation

+
+

2 Computation

-
-

2.1 Determinant matrix

+
+

2.1 Determinant matrix

-
-

2.1.1 Get

+
+

2.1.1 Get

qmckl_exit_code qmckl_get_det_vgl_alpha(qmckl_context context, double* const det_vgl_alpha);
@@ -670,14 +670,14 @@ computed to accelerate the calculations.
 
-
-

2.1.2 Provide

+
+

2.1.2 Provide

-
-

2.1.3 Compute alpha

+
+

2.1.3 Compute alpha

- +
@@ -851,10 +851,10 @@ computed to accelerate the calculations. -
-

2.1.4 Compute beta

+
+

2.1.4 Compute beta

-
+
@@ -1028,18 +1028,18 @@ computed to accelerate the calculations. -
-

2.1.5 Test

+
+

2.1.5 Test

-
-

2.2 Inverse of Determinant matrix

+
+

2.2 Inverse of Determinant matrix

-
-

2.2.1 Get

+
+

2.2.1 Get

qmckl_exit_code qmckl_get_det_inv_matrix_alpha(qmckl_context context, double* const det_inv_matrix_alpha);
@@ -1053,14 +1053,14 @@ computed to accelerate the calculations.
 
-
-

2.2.2 Provide

+
+

2.2.2 Provide

-
-

2.2.3 Compute alpha

+
+

2.2.3 Compute alpha

-
+
@@ -1222,10 +1222,10 @@ computed to accelerate the calculations. -
-

2.2.4 Compute beta

+
+

2.2.4 Compute beta

-
+
@@ -1392,7 +1392,7 @@ computed to accelerate the calculations.

Author: TREX CoE

-

Created: 2023-03-09 Thu 10:03

+

Created: 2023-03-17 Fri 13:56

Validate

diff --git a/qmckl_distance.html b/qmckl_distance.html index 423e886..959dc15 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 @@ -346,54 +346,54 @@ 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 @@ -406,7 +406,7 @@ between all pairs of points in two sets, one point within each set: \]

-
+
@@ -672,8 +672,8 @@ Requirements: -
-

1.1.1 Performance

+
+

1.1.1 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.

-
+
@@ -807,8 +807,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
  • @@ -826,8 +826,8 @@ 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 (
@@ -847,8 +847,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, &
@@ -1015,8 +1015,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. @@ -1026,12 +1026,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 @@ -1049,7 +1049,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.

- +
@@ -1157,8 +1157,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
  • @@ -1176,8 +1176,8 @@ 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 (
@@ -1198,8 +1198,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, &
@@ -1369,8 +1369,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. @@ -1379,12 +1379,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 @@ -1451,7 +1451,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.

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

Author: TREX CoE

-

Created: 2023-03-09 Thu 10:03

+

Created: 2023-03-17 Fri 13:56

Validate

diff --git a/qmckl_electron.html b/qmckl_electron.html index d43736f..46ec559 100644 --- a/qmckl_electron.html +++ b/qmckl_electron.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - +Electrons @@ -346,59 +346,59 @@ for the JavaScript code in this tag.

Table of Contents

-
-

1 Context

+
+

1 Context

The following data stored in the context: @@ -502,7 +502,7 @@ Computed data:

- + @@ -539,8 +539,8 @@ Computed data:
en_distancedouble[walker.num][nucl_num][num]double[num][nucl_num] Electron-nucleus distances
-
-

1.1 Data structure

+
+

1.1 Data structure

@@ -609,8 +609,8 @@ this mechanism.
 
-
-

1.2 Initialization functions

+
+

1.2 Initialization functions

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

-
-

1.3 Access functions

+
+

1.3 Access functions

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

-
-

1.3.1 Number of electrons

+
+

1.3.1 Number of electrons

-
-

1.3.2 Number of walkers

+
+

1.3.2 Number of walkers

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

-
-

1.3.3 Electron coordinates

+
+

1.3.3 Electron coordinates

Returns the current electron coordinates. The pointer is assumed @@ -761,8 +761,8 @@ current points.

-
-

1.4 Test

+
+

1.4 Test

/* Reference input data */
@@ -841,8 +841,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 @@ -855,12 +855,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);
@@ -869,10 +869,10 @@ current date is stored.
 
-
-

2.1.2 Compute

+
+

2.1.2 Compute

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

2.1.3 Test

+
+

2.1.3 Test

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

2.2 Electron-electron potential

+
+

2.2 Electron-electron potential

ee_potential is given by @@ -1031,8 +1031,8 @@ distance.

-
-

2.2.1 Get

+
+

2.2.1 Get

qmckl_exit_code qmckl_get_electron_ee_potential(qmckl_context context, double* const ee_potential);
@@ -1041,10 +1041,10 @@ distance.
 
-
-

2.2.2 Compute

+
+

2.2.2 Compute

-
+
@@ -1160,8 +1160,8 @@ distance. -
-

2.2.3 Test

+
+

2.2.3 Test

double ee_potential[walk_num];
@@ -1173,12 +1173,12 @@ rc = qmckl_get_electron_ee_potential(context, &(ee_potential[0]));
 
-
-

2.3 Electron-nucleus distances

+
+

2.3 Electron-nucleus distances

-
-

2.3.1 Get

+
+

2.3.1 Get

qmckl_exit_code qmckl_get_electron_en_distance(qmckl_context context, double* distance);
@@ -1187,10 +1187,10 @@ rc = qmckl_get_electron_ee_potential(context, &(ee_potential[0]));
 
-
-

2.3.2 Compute

+
+

2.3.2 Compute

-
+
@@ -1219,10 +1219,10 @@ rc = qmckl_get_electron_ee_potential(context, &(ee_potential[0])); - + - + @@ -1232,30 +1232,23 @@ rc = qmckl_get_electron_ee_potential(context, &(ee_potential[0])); - - - - - - - - + - + - + @@ -1263,17 +1256,16 @@ rc = qmckl_get_electron_ee_potential(context, &(ee_potential[0]));
elec_numpoint_num int64_t inNumber of electronsNumber of points
Number of nuclei
walk_numint64_tinNumber of walkers
elec_coorddouble[3][walk_num][elec_num]double[3][point_num] in Electron coordinates
nucl_coorddouble[3][elec_num]double[3][nucl_num] in Nuclear coordinates
en_distancedouble[walk_num][nucl_num][elec_num]double[point_num][nucl_num] out Electron-nucleus distances
-
integer function qmckl_compute_en_distance_f(context, elec_num, nucl_num, walk_num, elec_coord, nucl_coord, en_distance) &
+
integer function qmckl_compute_en_distance_f(context, point_num, nucl_num, elec_coord, nucl_coord, en_distance) &
      result(info)
   use qmckl
   implicit none
   integer(qmckl_context), intent(in)  :: context
-  integer*8             , intent(in)  :: elec_num
+  integer*8             , intent(in)  :: point_num
   integer*8             , intent(in)  :: nucl_num
-  integer*8             , intent(in)  :: walk_num
-  double precision      , intent(in)  :: elec_coord(elec_num,walk_num,3)
+  double precision      , intent(in)  :: elec_coord(point_num,3)
   double precision      , intent(in)  :: nucl_coord(nucl_num,3)
-  double precision      , intent(out) :: en_distance(elec_num,nucl_num,walk_num)
+  double precision      , intent(out) :: en_distance(nucl_num,point_num)
 
   integer*8 :: k
 
@@ -1284,7 +1276,7 @@ rc = qmckl_get_electron_ee_potential(context, &(ee_potential[0]));
      return
   endif
 
-  if (elec_num <= 0) then
+  if (point_num <= 0) then
      info = QMCKL_INVALID_ARG_2
      return
   endif
@@ -1294,20 +1286,10 @@ rc = qmckl_get_electron_ee_potential(context, &(ee_potential[0]));
      return
   endif
 
-  if (walk_num <= 0) then
-     info = QMCKL_INVALID_ARG_4
-     return
-  endif
-
-  do k=1,walk_num
-     info = qmckl_distance(context, 'T', 'T', elec_num, nucl_num, &
-          elec_coord(1,k,1), elec_num * walk_num, &
+  info = qmckl_distance(context, 'T', 'T', nucl_num, point_num, &
           nucl_coord, nucl_num, &
-          en_distance(1,1,k), elec_num)
-     if (info /= QMCKL_SUCCESS) then
-        exit
-     endif
-  end do
+          elec_coord, point_num, &
+          en_distance, nucl_num)
 
 end function qmckl_compute_en_distance_f
 
@@ -1315,8 +1297,8 @@ rc = qmckl_get_electron_ee_potential(context, &(ee_potential[0]));
-
-

2.3.3 Test

+
+

2.3.3 Test

@@ -1334,7 +1316,7 @@ rc = qmckl_set_nucleus_coord (context, 'T',
 
 assert(qmckl_nucleus_provided(context));
 
-double en_distance[walk_num][nucl_num][elec_num];
+double en_distance[walk_num][elec_num][nucl_num];
 
 rc = qmckl_get_electron_en_distance(context, &(en_distance[0][0][0]));
 qmckl_check(context, rc);
@@ -1344,19 +1326,19 @@ rc = qmckl_get_electron_en_distance(context, &(en_distance[0][0][0]));
 assert(fabs(en_distance[0][0][0] - 7.546738741619978) < 1.e-12);
 
 // (1,2,1)
-assert(fabs(en_distance[0][1][0] - 8.77102435246984) < 1.e-12);
+assert(fabs(en_distance[0][0][1] - 8.77102435246984) < 1.e-12);
 
 // (2,1,1)
-assert(fabs(en_distance[0][0][1] - 3.698922010513608) < 1.e-12);
+assert(fabs(en_distance[0][1][0] - 3.698922010513608) < 1.e-12);
 
 // (1,1,2)
 assert(fabs(en_distance[1][0][0] - 5.824059436060509) < 1.e-12);
 
 // (1,2,2)
-assert(fabs(en_distance[1][1][0] - 7.080482110317645) < 1.e-12);
+assert(fabs(en_distance[1][0][1] - 7.080482110317645) < 1.e-12);
 
 // (2,1,2)
-assert(fabs(en_distance[1][0][1] - 3.1804527583077356) < 1.e-12);
+assert(fabs(en_distance[1][1][0] - 3.1804527583077356) < 1.e-12);
 
 
@@ -1364,8 +1346,8 @@ rc = qmckl_get_electron_en_distance(context, &(en_distance[0][0][0]));
-
-

2.4 Electron-nucleus potential

+
+

2.4 Electron-nucleus potential

en_potential stores the en potential energy @@ -1383,8 +1365,8 @@ distance and \[Z_A\] is the nuclear charge.

-
-

2.4.1 Get

+
+

2.4.1 Get

qmckl_exit_code qmckl_get_electron_en_potential(qmckl_context context, double* const en_potential);
@@ -1393,10 +1375,10 @@ distance and \[Z_A\] is the nuclear charge.
 
-
-

2.4.2 Compute

+
+

2.4.2 Compute

- +
@@ -1454,9 +1436,9 @@ distance and \[Z_A\] is the nuclear charge. - + - + @@ -1479,7 +1461,7 @@ distance and \[Z_A\] is the nuclear charge. integer*8 , intent(in) :: nucl_numinteger*8 , intent(in) :: walk_numdouble precision , intent(in) :: charge(nucl_num) - double precision , intent(in) :: en_distance(elec_num,nucl_num,walk_num) + double precision , intent(in) :: en_distance(nucl_num,elec_num,walk_num)double precision , intent(out) :: en_potential(walk_num)integer*8 :: nw, i, j @@ -1503,10 +1485,10 @@ distance and \[Z_A\] is the nuclear charge. en_potential = 0.0d0 do nw=1,walk_num - do j=1,nucl_num - do i=1,elec_num - if (dabs(en_distance(i,j,nw)) > 1e-5) then - en_potential(nw) = en_potential(nw) - charge(j)/(en_distance(i,j,nw)) + do i=1,elec_num + do j=1,nucl_num + if (dabs(en_distance(j,i,nw)) > 1.d-6) then + en_potential(nw) = en_potential(nw) - charge(j)/(en_distance(j,i,nw)) endifend doend do @@ -1530,8 +1512,8 @@ distance and \[Z_A\] is the nuclear charge. -
-

2.4.3 Test

+
+

2.4.3 Test

double en_potential[walk_num];
@@ -1544,14 +1526,14 @@ rc = qmckl_get_electron_en_potential(context, &(en_potential[0]));
 
-
-

2.5 Generate initial coordinates

+
+

2.5 Generate initial coordinates

Author: TREX CoE

-

Created: 2023-03-09 Thu 10:02

+

Created: 2023-03-17 Fri 13:56

Validate

diff --git a/qmckl_error.html b/qmckl_error.html index cfcd296..9a7044e 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 @@ -324,29 +324,29 @@ for the JavaScript code in this tag.

Table of Contents

-
-

-

-
+
+

-

+

The library should never make the calling programs abort, nor perform any input/output operations. This decision has to be taken @@ -357,7 +357,7 @@ by the developer of the code calling the library. All the functions return with an exit code, defined as

-
typedef int32_t qmckl_exit_code;
+
typedef int32_t qmckl_exit_code;
 
@@ -374,7 +374,7 @@ error code is returned to the program. Here is the complete list of exit codes.

-
en_distancedouble[walk_num][nucl_num][elec_num]double[walk_num][elec_num][nucl_num] inElectron-electron rescaled distancesElectron-electron distances
+
@@ -582,8 +582,8 @@ string is assumed to be large enough to contain the error message -
-

1 Decoding errors

+
+

1 Decoding errors

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

-
-

2 Data structure in context

+
+

2 Data structure in context

The strings are declared internally with a maximum fixed size to avoid @@ -625,8 +625,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. @@ -645,8 +645,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 @@ -665,8 +665,8 @@ function name and message is mandatory.

-
-

5 Failing

+
+

5 Failing

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

-
-

6 Last error

+
+

6 Last error

Returns a string describing the last error, using qmckl_get_error. @@ -716,13 +716,13 @@ Returns a string describing the last error, using qmckl_get_error.

-
-

6.1 Fortran inteface

+
+

6.1 Fortran inteface

-
-

7 Helper functions for debugging

+
+

7 Helper functions for debugging

The following function prints to stderr an error message is the return code is @@ -748,14 +748,14 @@ It should be used as:

-
-

7.1 Fortran inteface

+
+

7.1 Fortran inteface

Author: TREX CoE

-

Created: 2023-03-09 Thu 10:03

+

Created: 2023-03-17 Fri 13:56

Validate

diff --git a/qmckl_examples.html b/qmckl_examples.html index 8e5ecfd..41f786b 100644 --- a/qmckl_examples.html +++ b/qmckl_examples.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Code examples @@ -346,27 +346,27 @@ for the JavaScript code in this tag.

Table of Contents

-
-

1 Python

+
+

1 Python

-
-

1.1 Check numerically that MOs are orthonormal

+
+

1.1 Check numerically that MOs are orthonormal

In this example, we will compute numerically the overlap @@ -542,12 +542,12 @@ and finally we compute the overlap between all the MOs as

-
-

2 Fortran

+
+

2 Fortran

-
-

2.1 Checking errors

+
+

2.1 Checking errors

All QMCkl functions return an error code. A convenient way to handle @@ -556,7 +556,7 @@ error in text format and exits the program.

-
subroutine qmckl_check_error(rc, message)
+
subroutine qmckl_check_error(rc, message)
   use qmckl
   implicit none
   integer(qmckl_exit_code), intent(in) :: rc
@@ -574,8 +574,8 @@ error in text format and exits the program.
 
-
-

2.2 Computing an atomic orbital on a grid

+
+

2.2 Computing an atomic orbital on a grid

The following program, in Fortran, computes the values of an atomic @@ -794,7 +794,7 @@ We finally print the value and Laplacian of the AO:

Author: TREX CoE

-

Created: 2023-03-09 Thu 10:03

+

Created: 2023-03-17 Fri 13:56

Validate

diff --git a/qmckl_jastrow.html b/qmckl_jastrow.html index bbc2a6c..9d54276 100644 --- a/qmckl_jastrow.html +++ b/qmckl_jastrow.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Jastrow Factor @@ -346,187 +346,187 @@ for the JavaScript code in this tag.

Table of Contents

-
-

1 Introduction

+
+

1 Introduction

The Jastrow factor depends on the electronic (\(\mathbf{r}\)) and @@ -551,7 +551,7 @@ In the following, we use the notations \(r_{ij} = |\mathbf{r}_i - \mathbf{r}_j|\

\[ J_{\text{eN}}(\mathbf{r},\mathbf{R}) = - \sum_{\alpha=1}^{N_\text{nucl}} \sum_{i=1}^{N_\text{elec}} + \sum_{\alpha=1}^{N_\text{nucl}} \sum_{i=1}^{N_\text{elec}} \frac{a_{1\,\alpha}\, f_\alpha(R_{i\,\alpha})}{1+a_{2\,\alpha}\, f_\alpha(R_{i\alpha})} + \sum_{p=2}^{N_\text{ord}^a} a_{p+1\,\alpha}\, [f_\alpha(R_{i\alpha})]^p - J_{eN}^{\infty \alpha} \] @@ -608,14 +608,14 @@ The terms \(J_{\text{ee}}^\infty\) and \(J_{\text{eN}}^\infty\) are shifts to en

-
-

2 Context

+
+

2 Context

The following data stored in the context:

-
+
@@ -980,8 +980,8 @@ computed data:
-
-

2.1 Data structure

+
+

2.1 Data structure

typedef struct qmckl_jastrow_struct{
@@ -1085,8 +1085,8 @@ this mechanism.
 
-
-

2.2 Initialization functions

+
+

2.2 Initialization functions

To prepare for the Jastrow and its derivative, all the following functions need to be @@ -1114,8 +1114,8 @@ are precontracted using BLAS LEVEL 3 operations.

-
-
2.2.0.1 Fortran interface
+
+
2.2.0.1 Fortran interface
interface
@@ -1221,8 +1221,8 @@ are precontracted using BLAS LEVEL 3 operations.
 
-
-

2.3 Access functions

+
+

2.3 Access functions

Along with these core functions, calculation of the jastrow factor @@ -1241,8 +1241,8 @@ function returns true.

-
-
2.3.0.1 Fortran interface
+
+
2.3.0.1 Fortran interface
interface
@@ -1348,8 +1348,8 @@ function returns true.
 
-
-

2.4 Test

+
+

2.4 Test

/* Reference input data */
@@ -1460,8 +1460,8 @@ rc = qmckl_check(context,
 
-
-

3 Computation

+
+

3 Computation

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

-
-

3.1 Asymptotic component for \(J_\text{ee}\)

+
+

3.1 Asymptotic component for \(J_\text{ee}\)

Calculate the asymptotic component asymp_jasb to be substracted from the @@ -1492,8 +1492,8 @@ second one for parallel spin pairs.

-
-

3.1.1 Get

+
+

3.1.1 Get

qmckl_exit_code
@@ -1504,8 +1504,8 @@ second one for parallel spin pairs.
 
-
-
3.1.1.1 Fortran interface
+
+
3.1.1.1 Fortran interface
interface
@@ -1525,10 +1525,10 @@ second one for parallel spin pairs.
 
-
-

3.1.2 Compute

+
+

3.1.2 Compute

- +
@@ -1684,8 +1684,8 @@ second one for parallel spin pairs. -
-

3.1.3 Test

+
+

3.1.3 Test

assert(qmckl_electron_provided(context));
@@ -1780,8 +1780,8 @@ rc = qmckl_get_jastrow_asymp_jasb(context, asymp_jasb,2);
 
-
-

3.2 Electron-electron component \(f_\text{ee}\)

+
+

3.2 Electron-electron component \(f_\text{ee}\)

Calculate the electron-electron jastrow component factor_ee using the asymp_jasb @@ -1792,7 +1792,7 @@ component and the electron-electron rescaled distances ee_distance_rescale \[ f_\text{ee} = \sum_{i,j @@ -1803,8 +1803,8 @@ component and the electron-electron rescaled distances ee_distance_rescale

-
-

3.2.1 Get

+
+

3.2.1 Get

qmckl_exit_code
@@ -1815,8 +1815,8 @@ component and the electron-electron rescaled distances ee_distance_rescale
 
-
-
3.2.1.1 Fortran interface
+
+
3.2.1.1 Fortran interface
interface
@@ -1836,10 +1836,10 @@ component and the electron-electron rescaled distances ee_distance_rescale
 
-
-

3.2.2 Compute

+
+

3.2.2 Compute

-
+
@@ -1987,7 +1987,7 @@ component and the electron-electron rescaled distances ee_distance_rescale ee_distance_rescaled(i,j,nw) / & (1.0d0 + b_vector(2) * & ee_distance_rescaled(i,j,nw)) & - + power_ser - asymp_jasb(ipar) + + power_ser - asymp_jasb(ipar) end do end do @@ -2049,8 +2049,8 @@ component and the electron-electron rescaled distances ee_distance_rescale ipar = 1; } - factor_ee[nw] += spin_fact * b_vector[0] * - x1 / (1.0 + b_vector[1] * x1) + factor_ee[nw] += spin_fact * b_vector[0] * + x1 / (1.0 + b_vector[1] * x1) - asymp_jasb[ipar] + power_ser; } @@ -2089,8 +2089,8 @@ component and the electron-electron rescaled distances ee_distance_rescale -
-

3.2.3 Test

+
+

3.2.3 Test

/* Check if Jastrow is properly initialized */
@@ -2111,8 +2111,8 @@ printf("%e\n%e\n\n",factor_ee[0],-4.2827608
 
-
-

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

+
+

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

The derivative of factor_ee is computed using the ee_distance_rescaled and @@ -2128,8 +2128,8 @@ C_{ij}}{(1 - B_1\, C_{ij})^2} + \sum^{n_\text{ord}}_{k=2} B_k\, k\, C_{ij}^{k-1} \nabla C_{ij} \right] \]

-
-

3.3.1 Get

+
+

3.3.1 Get

qmckl_exit_code
@@ -2141,10 +2141,10 @@ B_k\, k\, C_{ij}^{k-1} \nabla C_{ij} \right] \]
 
-
-

3.3.2 Compute

+
+

3.3.2 Compute

-
+
@@ -2354,11 +2354,11 @@ B_k\, k\, C_{ij}^{k-1} \nabla C_{ij} \right] \] if (context == QMCKL_NULL_CONTEXT) { return QMCKL_INVALID_CONTEXT; - } + } if (walk_num <= 0) { return QMCKL_INVALID_ARG_2; - } + } if (elec_num <= 0) { return QMCKL_INVALID_ARG_3; @@ -2386,7 +2386,7 @@ B_k\, k\, C_{ij}^{k-1} \nabla C_{ij} \right] \] if (fabs(x) < 1.0e-18) continue; for (int ii = 0; ii < 3; ++ii){ pow_ser_g[ii] = 0.0; - } + } spin_fact = 1.0; den = 1.0 + b_vector[1] * x; invden = 1.0 / den; @@ -2491,9 +2491,9 @@ B_k\, k\, C_{ij}^{k-1} \nabla C_{ij} \right] \] double* const factor_ee_deriv_e ) { #ifdef HAVE_HPC - return qmckl_compute_factor_ee_deriv_e_hpc(context, walk_num, elec_num, up_num, bord_num, b_vector, ee_distance_rescaled, ee_distance_rescaled_deriv_e, factor_ee_deriv_e ); + return qmckl_compute_factor_ee_deriv_e_hpc(context, walk_num, elec_num, up_num, bord_num, b_vector, ee_distance_rescaled, ee_distance_rescaled_deriv_e, factor_ee_deriv_e ); #else - return qmckl_compute_factor_ee_deriv_e_doc(context, walk_num, elec_num, up_num, bord_num, b_vector, ee_distance_rescaled, ee_distance_rescaled_deriv_e, factor_ee_deriv_e ); + return qmckl_compute_factor_ee_deriv_e_doc(context, walk_num, elec_num, up_num, bord_num, b_vector, ee_distance_rescaled, ee_distance_rescaled_deriv_e, factor_ee_deriv_e ); #endif } @@ -2504,8 +2504,8 @@ B_k\, k\, C_{ij}^{k-1} \nabla C_{ij} \right] \] -
-

3.3.3 Test

+
+

3.3.3 Test

/* Check if Jastrow is properly initialized */
@@ -2526,8 +2526,8 @@ rc = qmckl_get_jastrow_factor_ee_deriv_e(context, &(factor_ee_deriv_e[0][0][
 
-
-

3.4 Asymptotic component for \(J_{eN}\)

+
+

3.4 Asymptotic component for \(J_{eN}\)

Calculate the asymptotic component asymp_jasa to be substracted from the final @@ -2542,8 +2542,8 @@ via the a_vector and the electron-nucleus rescale factors res

-
-

3.4.1 Get

+
+

3.4.1 Get

qmckl_exit_code
@@ -2554,8 +2554,8 @@ via the a_vector and the electron-nucleus rescale factors res
 
-
-
3.4.1.1 Fortran interface
+
+
3.4.1.1 Fortran interface
interface
@@ -2575,10 +2575,10 @@ via the a_vector and the electron-nucleus rescale factors res
 
-
-

3.4.2 Compute

+
+

3.4.2 Compute

-
+
@@ -2738,8 +2738,8 @@ via the a_vector and the electron-nucleus rescale factors res -
-

3.4.3 Test

+
+

3.4.3 Test

double asymp_jasa[2];
@@ -2755,8 +2755,8 @@ printf("%e %e\n", asymp_jasa[0], -0.548554)
 
-
-

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

+
+

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

Calculate the electron-electron jastrow component factor_en using the a_vector @@ -2771,8 +2771,8 @@ f_{en} = \sum_{i,j -

-

3.5.1 Get

+
+

3.5.1 Get

qmckl_exit_code
@@ -2783,8 +2783,8 @@ f_{en} = \sum_{i,j
 
-
-
3.5.1.1 Fortran interface
+
+
3.5.1.1 Fortran interface
interface
@@ -2804,10 +2804,10 @@ f_{en} = \sum_{i,j
 
-
-

3.5.2 Compute

+
+

3.5.2 Compute

-
+
@@ -3084,8 +3084,8 @@ f_{en} = \sum_{i,j -
-

3.5.3 Test

+
+

3.5.3 Test

/* Check if Jastrow is properly initialized */
@@ -3103,8 +3103,8 @@ rc = qmckl_get_jastrow_factor_en(context, factor_en,walk_num);
 
-
-

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

+
+

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

Calculate the electron-electron jastrow component factor_en_deriv_e derivative @@ -3117,8 +3117,8 @@ TODO: write equations.

-
-

3.6.1 Get

+
+

3.6.1 Get

qmckl_exit_code
@@ -3130,10 +3130,10 @@ TODO: write equations.
 
-
-

3.6.2 Compute

+
+

3.6.2 Compute

-
+
@@ -3338,8 +3338,8 @@ TODO: write equations. -
-

3.6.3 Test

+
+

3.6.3 Test

/* Check if Jastrow is properly initialized */
@@ -3361,8 +3361,8 @@ rc = qmckl_get_jastrow_factor_en_deriv_e(context, &(factor_en_deriv_e[0][0][
 
-
-

3.7 Electron-electron rescaled distances

+
+

3.7 Electron-electron rescaled distances

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

-
-

3.7.1 Get

+
+

3.7.1 Get

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

3.7.2 Compute

+
+

3.7.2 Compute

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

3.7.3 Test

+
+

3.7.3 Test

assert(qmckl_electron_provided(context));
@@ -3541,8 +3541,8 @@ rc = qmckl_get_jastrow_ee_distance_rescaled(context, ee_distance_rescaled);
 
-
-

3.8 Electron-electron rescaled distance gradients and Laplacian with respect to electron coords

+
+

3.8 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\) @@ -3554,8 +3554,8 @@ gives the Laplacian \(\partial x^2 + \partial y^2 + \partial z^2\).

-
-

3.8.1 Get

+
+

3.8.1 Get

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

3.8.2 Compute

+
+

3.8.2 Compute

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

3.8.3 Test

+
+

3.8.3 Test

assert(qmckl_electron_provided(context));
@@ -3716,8 +3716,8 @@ rc = qmckl_get_jastrow_ee_distance_rescaled_deriv_e(context, ee_distance_rescale
 
-
-

3.9 Electron-electron-nucleus rescaled distances for each order

+
+

3.9 Electron-electron-nucleus rescaled distances for each order

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

-
-

3.9.1 Get

+
+

3.9.1 Get

qmckl_exit_code
@@ -3748,10 +3748,10 @@ where \(C_{ij}\) is the matrix of electron-electron distances.
 
-
-

3.9.2 Compute

+
+

3.9.2 Compute

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

3.9.3 Test

+
+

3.9.3 Test

assert(qmckl_electron_provided(context));
@@ -4107,8 +4107,8 @@ rc = qmckl_get_jastrow_een_rescaled_e(context, &(een_rescaled_e[0][0][0][0])
 
-
-

3.10 Electron-electron-nucleus rescaled distances for each order and derivatives

+
+

3.10 Electron-electron-nucleus rescaled distances for each order and derivatives

een_rescaled_e_deriv_e stores the table of the derivatives of the @@ -4123,8 +4123,8 @@ TODO: write formulae

-
-

3.10.1 Get

+
+

3.10.1 Get

qmckl_exit_code
@@ -4136,10 +4136,10 @@ TODO: write formulae
 
-
-

3.10.2 Compute

+
+

3.10.2 Compute

-
+
@@ -4317,8 +4317,8 @@ TODO: write formulae -
-

3.10.3 Test

+
+

3.10.3 Test

double een_rescaled_e_deriv_e[walk_num][(cord_num + 1)][elec_num][4][elec_num];
@@ -4339,8 +4339,8 @@ rc = qmckl_get_jastrow_een_rescaled_e_deriv_e(context,
 
-
-

3.11 Electron-nucleus rescaled distances

+
+

3.11 Electron-nucleus rescaled distances

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

-
-

3.11.1 Get

+
+

3.11.1 Get

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

3.11.2 Compute

+
+

3.11.2 Compute

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

3.11.3 Test

+
+

3.11.3 Test

@@ -4566,8 +4566,8 @@ rc = qmckl_check(context,
 
-
-

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

+
+

3.12 Electron-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\) @@ -4579,8 +4579,8 @@ gives the Laplacian \(\partial x^2 + \partial y^2 + \partial z^2\).

-
-

3.12.1 Get

+
+

3.12.1 Get

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

3.12.2 Compute

+
+

3.12.2 Compute

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

3.12.3 Test

+
+

3.12.3 Test

@@ -4788,8 +4788,8 @@ rc = qmckl_check(context,
 
-
-

3.13 Electron-electron-nucleus rescaled distances for each order

+
+

3.13 Electron-electron-nucleus rescaled distances for each order

een_rescaled_n stores the table of the rescaled distances between @@ -4807,8 +4807,8 @@ where \(C_{ia}\) is the matrix of electron-nucleus distances.

-
-

3.13.1 Get

+
+

3.13.1 Get

qmckl_exit_code
@@ -4820,10 +4820,10 @@ where \(C_{ia}\) is the matrix of electron-nucleus distances.
 
-
-

3.13.2 Compute

+
+

3.13.2 Compute

-
+
@@ -4932,7 +4932,7 @@ where \(C_{ia}\) is the matrix of electron-nucleus distances. integer*8 , intent(in) :: type_nucl_vector(nucl_num) integer*8 , intent(in) :: cord_num double precision , intent(in) :: rescale_factor_en(type_nucl_num) - double precision , intent(in) :: en_distance(elec_num,nucl_num,walk_num) + double precision , intent(in) :: en_distance(nucl_num,elec_num,walk_num) double precision , intent(out) :: een_rescaled_n(elec_num,nucl_num,0:cord_num,walk_num) double precision :: x integer*8 :: i, a, k, l, nw @@ -4973,7 +4973,7 @@ where \(C_{ia}\) is the matrix of electron-nucleus distances. do a = 1, nucl_num do i = 1, elec_num - een_rescaled_n(i, a, 1, nw) = dexp(-rescale_factor_en(type_nucl_vector(a)) * en_distance(i, a, nw)) + een_rescaled_n(i, a, 1, nw) = dexp(-rescale_factor_en(type_nucl_vector(a)) * en_distance(a, i, nw)) end do end do @@ -5036,7 +5036,7 @@ where \(C_{ia}\) is the matrix of electron-nucleus distances. for (int i = 0; i < elec_num; ++i) { een_rescaled_n[i + a*elec_num + nw * elec_num*nucl_num*(cord_num+1)] = 1.0; een_rescaled_n[i + a*elec_num + elec_num*nucl_num + nw*elec_num*nucl_num*(cord_num+1)] = - exp(-rescale_factor_en[type_nucl_vector[a]] * en_distance[i + a*elec_num + nw*elec_num*nucl_num]); + exp(-rescale_factor_en[type_nucl_vector[a]] * en_distance[a + i*nucl_num + nw*elec_num*nucl_num]); } } @@ -5044,7 +5044,7 @@ where \(C_{ia}\) is the matrix of electron-nucleus distances. for (int a = 0; a < nucl_num; ++a) { for (int i = 0; i < elec_num; ++i) { een_rescaled_n[i + a*elec_num + l*elec_num*nucl_num + nw*elec_num*nucl_num*(cord_num+1)] = - een_rescaled_n[i + a*elec_num + (l-1)*elec_num*nucl_num + nw*elec_num*nucl_num*(cord_num+1)] * + een_rescaled_n[i + a*elec_num + (l-1)*elec_num*nucl_num + nw*elec_num*nucl_num*(cord_num+1)] * een_rescaled_n[i + a*elec_num + elec_num*nucl_num + nw*elec_num*nucl_num*(cord_num+1)]; } } @@ -5060,8 +5060,8 @@ where \(C_{ia}\) is the matrix of electron-nucleus distances. -
-

3.13.3 Test

+
+

3.13.3 Test

assert(qmckl_electron_provided(context));
@@ -5083,8 +5083,8 @@ rc = qmckl_get_jastrow_een_rescaled_n(context, &(een_rescaled_n[0][0][0][0])
 
-
-

3.14 Electron-nucleus rescaled distances for each order and derivatives

+
+

3.14 Electron-nucleus rescaled distances for each order and derivatives

een_rescaled_n_deriv_e stores the table of the rescaled distances between @@ -5093,8 +5093,8 @@ electrons and nucleii raised to the power \(p\) defined by cord_num

-
-

3.14.1 Get

+
+

3.14.1 Get

qmckl_exit_code
@@ -5106,10 +5106,10 @@ electrons and nucleii raised to the power \(p\) defined by cord_num
 
-
-

3.14.2 Compute

+
+

3.14.2 Compute

-
+
@@ -5241,7 +5241,7 @@ electrons and nucleii raised to the power \(p\) defined by cord_num double precision , intent(in) :: rescale_factor_en(type_nucl_num) double precision , intent(in) :: coord_ee(elec_num,3,walk_num) double precision , intent(in) :: coord_en(nucl_num,3) - double precision , intent(in) :: en_distance(elec_num,nucl_num,walk_num) + double precision , intent(in) :: en_distance(nucl_num,elec_num,walk_num) double precision , intent(in) :: een_rescaled_n(elec_num,nucl_num,0:cord_num,walk_num) double precision , intent(out) :: een_rescaled_n_deriv_e(elec_num,4,nucl_num,0:cord_num,walk_num) double precision,dimension(:,:,:),allocatable :: elnuc_dist_deriv_e @@ -5284,7 +5284,7 @@ electrons and nucleii raised to the power \(p\) defined by cord_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) + ria_inv = 1.0d0 / en_distance(a, i, nw) do ii = 1, 3 elnuc_dist_deriv_e(ii, i, a) = (coord_ee(i, ii, nw) - coord_en(a, ii)) * ria_inv end do @@ -5325,8 +5325,8 @@ electrons and nucleii raised to the power \(p\) defined by cord_num -
-

3.14.3 Test

+
+

3.14.3 Test

assert(qmckl_electron_provided(context));
@@ -5349,8 +5349,8 @@ rc = qmckl_get_jastrow_een_rescaled_n_deriv_e(context, &(een_rescaled_n_deri
 
-
-

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

+
+

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

Prepare c_vector_full and lkpm_combined_index tables required for the @@ -5359,8 +5359,8 @@ calculation of the three-body jastrow factor_een and its derivative

-
-

3.15.1 Get

+
+

3.15.1 Get

qmckl_exit_code qmckl_get_jastrow_dim_c_vector(qmckl_context context, int64_t* const dim_c_vector);
@@ -5373,10 +5373,10 @@ calculation of the three-body jastrow factor_een and its derivative
 
-
-

3.15.2 Compute dimcvector

+
+

3.15.2 Compute dimcvector

-
+
@@ -5504,10 +5504,10 @@ calculation of the three-body jastrow factor_een and its derivative -
-

3.15.3 Compute cvectorfull

+
+

3.15.3 Compute cvectorfull

-
+
@@ -5711,10 +5711,10 @@ calculation of the three-body jastrow factor_een and its derivative -
-

3.15.4 Compute lkpmcombinedindex

+
+

3.15.4 Compute lkpmcombinedindex

-
+
@@ -5870,10 +5870,10 @@ calculation of the three-body jastrow factor_een and its derivative -
-

3.15.5 Compute tmpc

+
+

3.15.5 Compute tmpc

-
+
@@ -6055,10 +6055,10 @@ calculation of the three-body jastrow factor_een and its derivative -
-

3.15.6 Compute dtmpc

+
+

3.15.6 Compute dtmpc

-
+
@@ -6231,8 +6231,8 @@ calculation of the three-body jastrow factor_een and its derivative -
-

3.15.7 Test

+
+

3.15.7 Test

assert(qmckl_electron_provided(context));
@@ -6254,8 +6254,8 @@ printf("%e\n%e\n", dtmp_c[0][1][0][0][0][0]
 
-
-

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

+
+

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

Calculate the electron-electron-nuclear three-body jastrow component factor_een @@ -6267,8 +6267,8 @@ TODO: write equations.

-
-

3.16.1 Get

+
+

3.16.1 Get

qmckl_exit_code
@@ -6279,8 +6279,8 @@ TODO: write equations.
 
-
-
3.16.1.1 Fortran interface
+
+
3.16.1.1 Fortran interface
interface
@@ -6300,10 +6300,10 @@ TODO: write equations.
 
-
-

3.16.2 Compute naive

+
+

3.16.2 Compute naive

-
+
@@ -6484,10 +6484,10 @@ TODO: write equations. -
-

3.16.3 Compute

+
+

3.16.3 Compute

-
+
@@ -6661,8 +6661,8 @@ TODO: write equations. -
-

3.16.4 Test

+
+

3.16.4 Test

/* Check if Jastrow is properly initialized */
@@ -6678,8 +6678,8 @@ rc = qmckl_get_jastrow_factor_een(context, &(factor_een[0]),walk_num);
 
-
-

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

+
+

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

Calculate the electron-electron-nuclear three-body jastrow component factor_een_deriv_e @@ -6691,8 +6691,8 @@ TODO: write equations.

-
-

3.17.1 Get

+
+

3.17.1 Get

qmckl_exit_code
@@ -6704,10 +6704,10 @@ TODO: write equations.
 
-
-

3.17.2 Compute Naive

+
+

3.17.2 Compute Naive

-
+
@@ -6921,10 +6921,10 @@ TODO: write equations. -
-

3.17.3 Compute

+
+

3.17.3 Compute

-
+
@@ -7132,8 +7132,8 @@ TODO: write equations. -
-

3.17.4 Test

+
+

3.17.4 Test

/* Check if Jastrow is properly initialized */
@@ -7150,14 +7150,14 @@ rc = qmckl_get_jastrow_factor_een_deriv_e(context, &(factor_een_deriv_e[0][0
 
-
-

3.18 TODO Jastrow VGL functions

+
+

3.18 TODO Jastrow VGL functions

Author: TREX CoE

-

Created: 2023-03-09 Thu 10:03

+

Created: 2023-03-17 Fri 13:56

Validate

diff --git a/qmckl_local_energy.html b/qmckl_local_energy.html index 7aa0c19..301d3cc 100644 --- a/qmckl_local_energy.html +++ b/qmckl_local_energy.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Local Energy @@ -346,44 +346,44 @@ for the JavaScript code in this tag.

Table of Contents

-
-

1 Context

+
+

1 Context

The following arrays are stored in the context: @@ -466,8 +466,8 @@ Computed data:

-
-

1.1 Data structure

+
+

1.1 Data structure

typedef struct qmckl_local_energy_struct {
@@ -501,8 +501,8 @@ this mechanism.
 
-
-

1.2 Access functions

+
+

1.2 Access functions

When all the data for the local energy have been provided, the following @@ -517,12 +517,12 @@ function returns true.

-
-

2 Computation

+
+

2 Computation

-
-

2.1 Kinetic energy

+
+

2.1 Kinetic energy

Where the kinetic energy is given as: @@ -546,8 +546,8 @@ case is given as follows:

-
-

2.1.1 Get

+
+

2.1.1 Get

qmckl_exit_code qmckl_get_kinetic_energy(qmckl_context context, double* const kinetic_energy);
@@ -556,14 +556,14 @@ case is given as follows:
 
-
-

2.1.2 Provide

+
+

2.1.2 Provide

-
-

2.1.3 Compute kinetic enregy

+
+

2.1.3 Compute kinetic enregy

- +
@@ -792,12 +792,12 @@ case is given as follows: -
-

2.1.4 Test

+
+

2.1.4 Test

-
-

2.2 Potential energy

+
+

2.2 Potential energy

The potential energy is the sum of all the following terms @@ -833,8 +833,8 @@ contributions.

-
-

2.2.1 Get

+
+

2.2.1 Get

qmckl_exit_code qmckl_get_potential_energy(qmckl_context context, double* const potential_energy);
@@ -843,14 +843,14 @@ contributions.
 
-
-

2.2.2 Provide

+
+

2.2.2 Provide

-
-

2.2.3 Compute potential enregy

+
+

2.2.3 Compute potential enregy

-
+
@@ -977,12 +977,12 @@ contributions. -
-

2.2.4 Test

+
+

2.2.4 Test

-
-

2.3 Local energy

+
+

2.3 Local energy

The local energy is the sum of kinetic and potential energies. @@ -996,8 +996,8 @@ E_L = KE + PE

-
-

2.3.1 Get

+
+

2.3.1 Get

qmckl_exit_code qmckl_get_local_energy(qmckl_context context, double* const local_energy, const int64_t size_max);
@@ -1006,14 +1006,14 @@ E_L = KE + PE
 
-
-

2.3.2 Provide

+
+

2.3.2 Provide

-
-

2.3.3 Compute local enregy

+
+

2.3.3 Compute local enregy

-
+
@@ -1109,12 +1109,12 @@ E_L = KE + PE -
-

2.3.4 Test

+
+

2.3.4 Test

-
-

2.4 Drift vector

+
+

2.4 Drift vector

The drift vector is calculated as the ration of the gradient @@ -1128,8 +1128,8 @@ with the determinant of the wavefunction.

-
-

2.4.1 Get

+
+

2.4.1 Get

qmckl_exit_code qmckl_get_drift_vector(qmckl_context context, double* const drift_vector);
@@ -1138,14 +1138,14 @@ with the determinant of the wavefunction.
 
-
-

2.4.2 Provide

+
+

2.4.2 Provide

-
-

2.4.3 Compute drift vector

+
+

2.4.3 Compute drift vector

-
+
@@ -1366,15 +1366,15 @@ with the determinant of the wavefunction. -
-

2.4.4 Test

+
+

2.4.4 Test

Author: TREX CoE

-

Created: 2023-03-09 Thu 10:03

+

Created: 2023-03-17 Fri 13:56

Validate

diff --git a/qmckl_memory.html b/qmckl_memory.html index 33771d3..b22fe88 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 @@ -324,16 +324,16 @@ 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 @@ -375,8 +375,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 @@ -385,8 +385,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 @@ -550,8 +550,8 @@ allocation and needs to be updated.

-
-

4 Get the size of a memory block

+
+

4 Get the size of a memory block

All the blocks allocated with qmckl_malloc keep track of how many @@ -646,7 +646,7 @@ rc = qmckl_context_destroy(context);

Author: TREX CoE

-

Created: 2023-03-09 Thu 10:03

+

Created: 2023-03-17 Fri 13:56

Validate

diff --git a/qmckl_mo.html b/qmckl_mo.html index 0a93d3b..3a5b962 100644 --- a/qmckl_mo.html +++ b/qmckl_mo.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Molecular Orbitals @@ -312,6 +312,28 @@ for the JavaScript code in this tag. } /*]]>*///--> + + -
-

1 Context

+
+

1 Context

The following arrays are stored in the context:

-
@@ -406,6 +441,12 @@ The following arrays are stored in the context: + + + + + +
[ao_num][mo_num] Transposed of the Orbital coefficients
r_cusp[nucl_num]Radius of the functions for Cusp adjustments
@@ -425,15 +466,15 @@ Computed data: -mo_value -[point_num][mo_num] -Value of the MOs at point positions +cusp_param +[nucl_num][4][mo_num] +Parameters of the functions for Cusp adjustments -mo_value_date -uint64_t -Late modification date of the value of the MOs at point positions +mo_value +[point_num][mo_num] +Value of the MOs at point positions @@ -441,27 +482,24 @@ Computed data: [point_num][5][mo_num] Value, gradients, Laplacian of the MOs at point positions - - -mo_vgl_date -uint64_t -Late modification date of Value, gradients, Laplacian of the MOs at point positions -
-
-

1.1 Data structure

+
+

1.1 Data structure

typedef struct qmckl_mo_basis_struct {
   int64_t  mo_num;
   double * restrict coefficient;
   double * restrict coefficient_t;
+  double * restrict r_cusp;
 
   double * restrict mo_vgl;
   double * restrict mo_value;
+  qmckl_tensor cusp_param;
+
   uint64_t  mo_vgl_date;
   uint64_t  mo_value_date;
 
@@ -495,6 +533,8 @@ this mechanism.
   qmckl_context_struct* const ctx = (qmckl_context_struct*) context;
   assert (ctx != NULL);
 
+  ctx->mo_basis.r_cusp = NULL;
+
   ctx->mo_basis.uninitialized = (1 << 2) - 1;
 
   return QMCKL_SUCCESS;
@@ -504,8 +544,8 @@ this mechanism.
 
-
-

1.2 Initialization functions

+
+

1.2 Initialization functions

To set the basis set, all the following functions need to be @@ -514,7 +554,8 @@ called.

qmckl_exit_code  qmckl_set_mo_basis_mo_num           (qmckl_context context, const int64_t   mo_num);
-qmckl_exit_code  qmckl_set_mo_basis_coefficient      (qmckl_context context, const double  * coefficient);
+qmckl_exit_code  qmckl_set_mo_basis_coefficient      (qmckl_context context, const double  * coefficient, const int64_t size_max);
+qmckl_exit_code  qmckl_set_mo_basis_r_cusp           (qmckl_context context, const double  * r_cusp, const int64_t size_max);
 
@@ -525,10 +566,26 @@ computed to accelerate the calculations.
-
-

1.3 Access functions

+
+

1.3 Cusp adjsutment functions

+To activate the cusp adjustment, the user must enter the radius of +the fitting function for each atom. +

+ +

+This function requires the computation of the value and gradients +of the \(s\) AOs at the distance equal to the radius, and the values +of the non-\(s\) AOs at the center. +

+
+
+ +
+

1.4 Access functions

+
+

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

@@ -539,25 +596,30 @@ function returns true.
-
-

1.3.1 Fortran interfaces

+
+

1.4.1 Fortran interfaces

-
-

1.4 Update

-
+
+

1.5 Update

+

-Useless MOs can be removed, for instance virtual MOs in a single -determinant calculation. +It may be desirable to remove certain molecular orbitals (MOs) that +do not significantly contribute to the wave function. In +particular, in a single determinant calculation, the virtual MOs +can be removed as they do not participate in the ground state +configuration.

-To select a subset of MOs that will be kept, create an array of -integers of size mo_num. If the integer is zero, the MO is dropped, -otherwise it is kept. +To select a subset of MOs that will be kept, an array of integers of +size mo_num can be created. If the integer corresponding to an MO is +zero, that MO is dropped and will not be included in the +calculation. If the integer is non-zero, the MO will be kept.

+
qmckl_exit_code
 qmckl_mo_basis_select_mo (const qmckl_context context,
@@ -567,23 +629,26 @@ otherwise it is kept.
 
-
-

1.4.1 Fortran interface

+
+

1.5.1 Fortran interface

-
-

2 Computation

+
+

2 Computation

-
-

2.1 Computation of MOs: values only

-
+
+

2.1 Parameters of the cusp-correction functions

-
-

2.1.1 Get

-
+
+

2.2 Computation of MOs: values only

+
+
+
+

2.2.1 Get

+
qmckl_exit_code
 qmckl_get_mo_basis_mo_value(qmckl_context context,
@@ -606,9 +671,9 @@ Uses the given array to compute the values.
 
-
-

2.1.2 Provide

-
+
+

2.2.2 Provide

+
qmckl_exit_code qmckl_provide_mo_basis_mo_value(qmckl_context context);
 
@@ -692,10 +757,10 @@ Uses the given array to compute the values.
-
-

2.1.3 Compute

-
- +
+

2.2.3 Compute

+
+
@@ -789,36 +854,17 @@ matrix multiplication instead of a dgemm, as exposed in double precision , intent(in) :: ao_value(ao_num,point_num)double precision , intent(in) :: coefficient_t(mo_num,ao_num)double precision , intent(out) :: mo_value(mo_num,point_num) - integer*8 :: i,j,k - double precision :: c1, c2, c3, c4, c5 - - integer*8 :: LDA, LDB, LDC + integer*8 :: j,k info = QMCKL_SUCCESS - if (.True.) then ! fast algorithm - do j=1,point_num - mo_value(:,j) = 0.d0 - do k=1,ao_num - c1 = ao_value(k,j) - if (c1 /= 0.d0) then - do i=1,mo_num - mo_value(i,j) = mo_value(i,j) + coefficient_t(i,k) * c1 - end do - end if - end do + + do j=1,point_num + mo_value(:,j) = 0.d0 + do k=1,ao_num + if (ao_value(k,j) == 0.d0) cycle + mo_value(:,j) = mo_value(:,j) + coefficient_t(:,k) * ao_value(k,j) end do - - else ! dgemm for checking - - LDA = size(coefficient_t,1) - LDB = size(ao_value,1) - LDC = size(mo_value,1) - - info = qmckl_dgemm(context,'N', 'N', mo_num, point_num, ao_num, 1.d0, & - coefficient_t, LDA, ao_value, LDB, & - 0.d0, mo_value, LDC) - - end if + end doend functionqmckl_compute_mo_basis_mo_value_doc_f @@ -869,9 +915,9 @@ matrix multiplication instead of a dgemm, as exposed in -
-

2.1.4 HPC version

-
+
+

2.2.4 HPC version

+
#ifdef HAVE_HPC
 qmckl_exit_code
@@ -963,13 +1009,13 @@ matrix multiplication instead of a dgemm, as exposed in
 
-
-

2.2 Computation of MOs: values, gradient, Laplacian

-
+
+

2.3 Computation of MOs: values, gradient, Laplacian

+
-
-

2.2.1 Get

-
+
+

2.3.1 Get

+
qmckl_exit_code
 qmckl_get_mo_basis_mo_vgl(qmckl_context context,
@@ -992,9 +1038,9 @@ Uses the given array to compute the VGL.
 
-
-

2.2.2 Provide

-
+
+

2.3.2 Provide

+
qmckl_exit_code qmckl_provide_mo_basis_mo_vgl(qmckl_context context);
 
@@ -1077,10 +1123,10 @@ Uses the given array to compute the VGL.
-
-

2.2.3 Compute

-
-
+
+

2.3.3 Compute

+
+
@@ -1177,6 +1223,8 @@ matrix multiplication instead of a dgemm, as exposed in integer*8 :: i,j,kdouble precision :: c1, c2, c3, c4, c5 + info = QMCKL_SUCCESS + do j=1,point_num mo_vgl(:,:,j) = 0.d0 do k=1,ao_num @@ -1196,7 +1244,6 @@ matrix multiplication instead of a dgemm, as exposed in end ifend doend do - info = QMCKL_SUCCESS ! info = qmckl_dgemm(context,'N', 'N', mo_num, point_num, ao_num, 1.d0, & ! coefficient_t, int(size(coefficient_t,1),8), & @@ -1252,9 +1299,9 @@ matrix multiplication instead of a dgemm, as exposed in -
-

2.2.4 HPC version

-
+
+

2.3.4 HPC version

+
#ifdef HAVE_HPC
 qmckl_exit_code
@@ -1399,9 +1446,886 @@ matrix multiplication instead of a dgemm, as exposed in
 
-
-

2.3 Rescaling of MO coefficients

-
+
+

2.4 Computation of cusp-corrected MOs: values only

+
+
+
+

2.4.1 Compute

+
+
+ + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VariableTypeIn/OutDescription
contextqmckl_contextinGlobal state
nucl_numint64_tinNumber of nuclei
ao_numint64_tinNumber of AOs
mo_numint64_tinNumber of MOs
point_numint64_tinNumber of points
ao_nuclint64_t[ao_num]inNucleus on which the AO is centered
ao_ang_momint32_t[ao_num]inAngular momentum of the shell
en_distancedouble[point_num][nucl_num]inElectron-nucleus distances
r_cuspdouble[nucl_num]inCusp-adjustment radius
cusp_paramdouble[nucl_num][4][mo_num]inCusp-adjustment parameters
coefficient_tdouble[mo_num][ao_num]inTranspose of the AO to MO transformation matrix
ao_valuedouble[point_num][ao_num]inValue of the AOs
mo_valuedouble[point_num][mo_num]outCusp correction for the values of the MOs
+ + + + +
+
integer function qmckl_compute_mo_basis_mo_value_cusp_doc_f(context, &
+     nucl_num, ao_num, mo_num, point_num, ao_nucl, ao_ang_mom, en_distance, &
+     r_cusp, cusp_param, coefficient_t, ao_value, mo_value) &
+     result(info)
+  use qmckl
+  implicit none
+  integer(qmckl_context), intent(in)  :: context
+  integer*8             , intent(in)  :: nucl_num, ao_num, mo_num, point_num
+  integer*8             , intent(in)  :: ao_nucl(ao_num)
+  integer*4             , intent(in)  :: ao_ang_mom(ao_num)
+  double precision      , intent(in)  :: en_distance(nucl_num, point_num)
+  double precision      , intent(in)  :: r_cusp(nucl_num)
+  double precision      , intent(in)  :: cusp_param(mo_num, 4, nucl_num)
+  double precision      , intent(in)  :: coefficient_t(mo_num, ao_num)
+  double precision      , intent(in)  :: ao_value(ao_num, point_num)
+  double precision      , intent(out) :: mo_value(mo_num, point_num)
+
+  integer*8 :: i, j, k, inucl
+  double precision :: r
+
+  info = QMCKL_SUCCESS
+
+  do i=1,point_num
+     mo_value(:,i) = 0.d0
+     do k=1,ao_num
+        if (ao_value(k,i) == 0.d0) cycle
+        inucl = ao_nucl(k)+1
+        if ( (en_distance(inucl,i) < r_cusp(inucl)) .and. (ao_ang_mom(k) == 0) ) cycle
+        mo_value(:,i) = mo_value(:,i) + coefficient_t(:,k) * ao_value(k,i)
+     end do ! k
+
+     do inucl=1,nucl_num
+        r = en_distance(inucl,i)
+        if (r > r_cusp(inucl)) cycle
+
+        do j=1,mo_num
+           mo_value(j,i) = mo_value(j,i) + &
+                cusp_param(j,1,inucl) + r*(cusp_param(j,2,inucl) + r*(  &
+                cusp_param(j,3,inucl) + r* cusp_param(j,4,inucl)     ))
+        enddo
+     enddo ! inucl
+  enddo ! i
+
+end function qmckl_compute_mo_basis_mo_value_cusp_doc_f
+
+
+ +
+
qmckl_exit_code qmckl_compute_mo_basis_mo_value_cusp (
+      const qmckl_context context,
+      const int64_t nucl_num,
+      const int64_t ao_num,
+      const int64_t mo_num,
+      const int64_t point_num,
+      const int64_t* ao_nucl,
+      const int32_t* ao_ang_mom,
+      const double* en_distance,
+      const double* r_cusp,
+      const double* cusp_param,
+      const double* coefficient_t,
+      const double* ao_value,
+      double* const mo_value ); 
+
+
+ +
+
qmckl_exit_code qmckl_compute_mo_basis_mo_value_cusp_doc (
+      const qmckl_context context,
+      const int64_t nucl_num,
+      const int64_t ao_num,
+      const int64_t mo_num,
+      const int64_t point_num,
+      const int64_t* ao_nucl,
+      const int32_t* ao_ang_mom,
+      const double* en_distance,
+      const double* r_cusp,
+      const double* cusp_param,
+      const double* coefficient_t,
+      const double* ao_value,
+      double* const mo_value ); 
+
+
+ +
+
qmckl_exit_code
+qmckl_compute_mo_basis_mo_value_cusp (const qmckl_context context,
+                                      const int64_t nucl_num,
+                                      const int64_t ao_num,
+                                      const int64_t mo_num,
+                                      const int64_t point_num,
+                                      const int64_t* ao_nucl,
+                                      const int32_t* ao_ang_mom,
+                                      const double* en_distance,
+                                      const double* r_cusp,
+                                      const qmckl_tensor cusp_param_tensor,
+                                      const double* coefficient_t,
+                                      const double* ao_value,
+                                      double* const mo_value )
+{
+  qmckl_exit_code rc;
+
+#ifdef HAVE_HPC
+  rc = qmckl_compute_mo_basis_mo_value_cusp_hpc (context, nucl_num, ao_num, mo_num, point_num, 
+                                                 ao_nucl, ao_ang_mom, en_distance, r_cusp,
+                                                 cusp_param_tensor, coefficient_t, ao_value, mo_value ); 
+#else
+  double * cusp_param  = qmckl_alloc_double_of_tensor(context, cusp_param_tensor);
+
+  rc = qmckl_compute_mo_basis_mo_value_cusp_doc (context, nucl_num, ao_num, mo_num, point_num, 
+                                                 ao_nucl, ao_ang_mom, en_distance, r_cusp,
+                                                 cusp_param, coefficient_t, ao_value, mo_value ); 
+
+  qmckl_free(context, cusp_param);
+#endif
+  return rc;
+}
+
+
+
+
+ +
+

2.4.2 HPC version

+
+
+
#ifdef HAVE_HPC
+qmckl_exit_code
+qmckl_compute_mo_basis_mo_value_cusp_hpc (const qmckl_context context,
+                                          const int64_t nucl_num,
+                                          const int64_t ao_num,
+                                          const int64_t mo_num,
+                                          const int64_t point_num,
+                                          const int64_t* ao_nucl,
+                                          const int32_t* ao_ang_mom,
+                                          const double* en_distance,
+                                          const double* r_cusp,
+                                          const qmckl_tensor cusp_param,
+                                          const double* coefficient_t,
+                                          const double* ao_value,
+                                          double* const mo_value ); 
+#endif
+
+
+ +
+
#ifdef HAVE_HPC
+qmckl_exit_code
+qmckl_compute_mo_basis_mo_value_cusp_hpc (const qmckl_context context,
+                                          const int64_t nucl_num,
+                                          const int64_t ao_num,
+                                          const int64_t mo_num,
+                                          const int64_t point_num,
+                                          const int64_t* ao_nucl,
+                                          const int32_t* ao_ang_mom,
+                                          const double* en_distance,
+                                          const double* r_cusp,
+                                          const qmckl_tensor cusp_param,
+                                          const double* coefficient_t,
+                                          const double* ao_value,
+                                          double* const mo_value)
+{
+  assert (context != QMCKL_NULL_CONTEXT);
+
+#ifdef HAVE_OPENMP
+  #pragma omp parallel for
+#endif
+  for (int64_t ipoint=0 ; ipoint < point_num ; ++ipoint) {
+    double* restrict const vgl1  = &(mo_value[ipoint*mo_num]);
+    const double* restrict avgl1 = &(ao_value[ipoint*ao_num]);
+    const double* restrict ria   = &(en_distance[ipoint*nucl_num]);
+
+    for (int64_t i=0 ; i<mo_num ; ++i) {
+      vgl1[i] = 0.;
+    }
+
+    int64_t nidx=0;
+    int64_t idx[ao_num];
+    double  av1[ao_num];
+    for (int64_t k=0 ; k<ao_num ; ++k) {
+      if (avgl1[k] != 0.) {
+        const int64_t inucl = ao_nucl[k];
+        if (ria[inucl] > r_cusp[inucl] || ao_ang_mom[k] > 0) {
+          idx[nidx] = k;
+          av1[nidx] = avgl1[k];
+          ++nidx;
+        }
+      }
+    }
+
+    int64_t n=0;
+
+    for (n=0 ; n < nidx-4 ; n+=4) {
+      const double* restrict ck1 = coefficient_t + idx[n  ]*mo_num;
+      const double* restrict ck2 = coefficient_t + idx[n+1]*mo_num;
+      const double* restrict ck3 = coefficient_t + idx[n+2]*mo_num;
+      const double* restrict ck4 = coefficient_t + idx[n+3]*mo_num;
+
+      const double a11 = av1[n  ];
+      const double a21 = av1[n+1];
+      const double a31 = av1[n+2];
+      const double a41 = av1[n+3];
+
+#ifdef HAVE_OPENMP
+#pragma omp simd
+#endif
+      for (int64_t i=0 ; i<mo_num ; ++i) {
+        vgl1[i] = vgl1[i] + ck1[i] * a11 + ck2[i] * a21 + ck3[i] * a31 + ck4[i] * a41;
+      }
+    }
+
+    for (int64_t m=n ; m < nidx ; m+=1) {
+      const double* restrict ck = coefficient_t + idx[m]*mo_num;
+      const double a1 = av1[m];
+
+#ifdef HAVE_OPENMP
+#pragma omp simd
+#endif
+      for (int64_t i=0 ; i<mo_num ; ++i) {
+        vgl1[i] += ck[i] * a1;
+      }
+    }
+
+    for (int64_t inucl=0 ; inucl<nucl_num ; ++inucl) {
+      if (ria[inucl] < r_cusp[inucl]) {
+        const double r = ria[inucl];
+#ifdef HAVE_OPENMP
+#pragma omp simd
+#endif
+        for (int64_t i=0 ; i<mo_num ; ++i) {
+          vgl1[i] += qmckl_ten3(cusp_param,i,0,inucl) + r*(
+                     qmckl_ten3(cusp_param,i,1,inucl) + r*(
+                     qmckl_ten3(cusp_param,i,2,inucl) + r*(
+                     qmckl_ten3(cusp_param,i,3,inucl) )));
+        }
+      }
+    }
+
+  }
+  return QMCKL_SUCCESS;
+}
+#endif
+
+
+
+
+
+ +
+

2.5 Computation of cusp-corrected MOs: values, gradient, Laplacian

+
+
+
+

2.5.1 Compute

+
+ + + +++ ++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VariableTypeIn/OutDescription
contextqmckl_contextinGlobal state
nucl_numint64_tinNumber of nuclei
ao_numint64_tinNumber of AOs
mo_numint64_tinNumber of MOs
point_numint64_tinNumber of points
ao_nuclint64_t[ao_num]inNucleus on which the AO is centered
ao_ang_momint32_t[ao_num]inAngular momentum of the shell
en_distancedouble[point_num][nucl_num]inElectron-nucleus distances
nucl_coorddouble[3][nucl_num]inNuclear coordinates
point_coorddouble[3][point_num]inElectron coordinates
r_cuspdouble[nucl_num]inCusp-adjustment radius
cusp_paramdouble[nucl_num][4][mo_num]inCusp-adjustment parameters
coefficient_tdouble[mo_num][ao_num]inTranspose of the AO to MO transformation matrix
ao_vgldouble[point_num][5][ao_num]inValue, gradients and Laplacian of the AOs
mo_vgldouble[point_num][5][mo_num]outValue, gradients and Laplacian of the MOs
+ + + +
+
integer function qmckl_compute_mo_basis_mo_vgl_cusp_doc_f(context, &
+     nucl_num, ao_num, mo_num, point_num, ao_nucl, ao_ang_mom, en_distance, &
+     nucl_coord, point_coord, r_cusp, cusp_param, coefficient_t, ao_vgl, mo_vgl) &
+     result(info)
+  use qmckl
+  implicit none
+  integer(qmckl_context), intent(in)  :: context
+  integer*8             , intent(in)  :: nucl_num, ao_num, mo_num, point_num
+  integer*8             , intent(in)  :: ao_nucl(ao_num)
+  integer*4             , intent(in)  :: ao_ang_mom(ao_num)
+  double precision      , intent(in)  :: en_distance(nucl_num, point_num)
+  double precision      , intent(in)  :: nucl_coord(nucl_num,3)
+  double precision      , intent(in)  :: point_coord(point_num,3)
+  double precision      , intent(in)  :: r_cusp(nucl_num)
+  double precision      , intent(in)  :: cusp_param(mo_num,4,nucl_num)
+  double precision      , intent(in)  :: coefficient_t(mo_num,ao_num)
+  double precision      , intent(in)  :: ao_vgl(ao_num,5,point_num)
+  double precision      , intent(out) :: mo_vgl(mo_num,5,point_num)
+  integer*8 :: i,j,k, inucl
+  double precision :: c1, c2, c3, c4, c5
+  double precision :: r, r_inv, r_vec(3)
+
+  do j=1,point_num
+
+     ! Initial contribution of the MO
+     mo_vgl(:,:,j) = 0.d0
+     do k=1,ao_num
+        if (ao_vgl(k,1,j) == 0.d0) cycle
+        inucl = ao_nucl(k)+1
+        if ( (en_distance(inucl,j) < r_cusp(inucl)) .and. (ao_ang_mom(k) == 0) ) cycle
+        c1 = ao_vgl(k,1,j)
+        c2 = ao_vgl(k,2,j)
+        c3 = ao_vgl(k,3,j)
+        c4 = ao_vgl(k,4,j)
+        c5 = ao_vgl(k,5,j)
+        do i=1,mo_num
+           mo_vgl(i,1,j) = mo_vgl(i,1,j) + coefficient_t(i,k) * c1
+           mo_vgl(i,2,j) = mo_vgl(i,2,j) + coefficient_t(i,k) * c2
+           mo_vgl(i,3,j) = mo_vgl(i,3,j) + coefficient_t(i,k) * c3
+           mo_vgl(i,4,j) = mo_vgl(i,4,j) + coefficient_t(i,k) * c4
+           mo_vgl(i,5,j) = mo_vgl(i,5,j) + coefficient_t(i,k) * c5
+        end do
+     end do
+
+     ! Cusp adjustment
+     do inucl=1,nucl_num
+        r = en_distance(inucl,j)
+        if (r > r_cusp(inucl)) cycle
+
+        r_vec(1:3) = point_coord(j,1:3) - nucl_coord(inucl,1:3)
+        r_inv = 1.d0/r
+
+
+        do i=1,mo_num
+           mo_vgl(i,1,j) = mo_vgl(i,1,j) +                              &
+                cusp_param(i,1,inucl) + r*(cusp_param(i,2,inucl) + r*(  &
+                cusp_param(i,3,inucl) + r* cusp_param(i,4,inucl)     ))
+
+           c1 = r_inv * cusp_param(i,2,inucl) + 2.d0*cusp_param(i,3,inucl) +  &
+                r * 3.d0 * cusp_param(i,4,inucl) 
+
+           mo_vgl(i,2,j) = mo_vgl(i,2,j) + r_vec(1) * c1
+           mo_vgl(i,3,j) = mo_vgl(i,3,j) + r_vec(2) * c1
+           mo_vgl(i,4,j) = mo_vgl(i,4,j) + r_vec(3) * c1
+
+           mo_vgl(i,5,j) = mo_vgl(i,5,j) +                &
+                 2.d0*cusp_param(i,2,inucl)*r_inv +       &
+                 6.d0*cusp_param(i,3,inucl) +             &
+                12.d0*cusp_param(i,4,inucl)*r
+
+        enddo
+     enddo ! inucl
+  end do
+  info = QMCKL_SUCCESS
+
+end function qmckl_compute_mo_basis_mo_vgl_cusp_doc_f
+
+
+ +
+
qmckl_exit_code qmckl_compute_mo_basis_mo_vgl_cusp (
+      const qmckl_context context,
+      const int64_t nucl_num,
+      const int64_t ao_num,
+      const int64_t mo_num,
+      const int64_t point_num,
+      const int64_t* ao_nucl,
+      const int32_t* ao_ang_mom,
+      const double* en_distance,
+      const qmckl_matrix nucl_coord,
+      const qmckl_matrix point_coord,
+      const double* r_cusp,
+      const qmckl_tensor cusp_param,
+      const double* coefficient_t,
+      const double* ao_vgl,
+      double* const mo_vgl ); 
+
+
+ +
+
qmckl_exit_code qmckl_compute_mo_basis_mo_vgl_cusp_doc (
+      const qmckl_context context,
+      const int64_t nucl_num,
+      const int64_t ao_num,
+      const int64_t mo_num,
+      const int64_t point_num,
+      const int64_t* ao_nucl,
+      const int32_t* ao_ang_mom,
+      const double* en_distance,
+      const double* nucl_coord,
+      const double* point_coord,
+      const double* r_cusp,
+      const double* cusp_param,
+      const double* coefficient_t,
+      const double* ao_vgl,
+      double* const mo_vgl ); 
+
+
+ +
+
qmckl_exit_code
+qmckl_compute_mo_basis_mo_vgl_cusp (const qmckl_context context,
+                                    const int64_t nucl_num,
+                                    const int64_t ao_num,
+                                    const int64_t mo_num,
+                                    const int64_t point_num,
+                                    const int64_t* ao_nucl,
+                                    const int32_t* ao_ang_mom,
+                                    const double* en_distance,
+                                    const qmckl_matrix nucl_coord_matrix,
+                                    const qmckl_matrix point_coord_matrix,
+                                    const double* r_cusp,
+                                    const qmckl_tensor cusp_param_tensor,
+                                    const double* coefficient_t,
+                                    const double* ao_vgl,
+                                    double* const mo_vgl )
+{
+  qmckl_exit_code rc;
+
+#ifdef HAVE_HPC
+  rc = qmckl_compute_mo_basis_mo_vgl_cusp_hpc (context, nucl_num, ao_num, mo_num, point_num,
+                                               ao_nucl, ao_ang_mom, en_distance, nucl_coord_matrix,
+                                               point_coord_matrix, r_cusp, cusp_param_tensor,
+                                               coefficient_t, ao_vgl, mo_vgl );
+#else
+  double * nucl_coord  = qmckl_alloc_double_of_matrix(context, nucl_coord_matrix);
+  double * point_coord = qmckl_alloc_double_of_matrix(context, point_coord_matrix);
+  double * cusp_param  = qmckl_alloc_double_of_tensor(context, cusp_param_tensor);
+
+  rc = qmckl_compute_mo_basis_mo_vgl_cusp_doc (context, nucl_num, ao_num, mo_num, point_num,
+                                               ao_nucl, ao_ang_mom, en_distance, nucl_coord,
+                                               point_coord, r_cusp, cusp_param, coefficient_t,
+                                               ao_vgl, mo_vgl );
+
+  qmckl_free(context, nucl_coord);
+  qmckl_free(context, point_coord);
+  qmckl_free(context, cusp_param);
+#endif
+  return rc;
+}
+
+
+
+
+ +
+

2.5.2 HPC version

+
+
+
#ifdef HAVE_HPC
+qmckl_exit_code
+qmckl_compute_mo_basis_mo_vgl_cusp_hpc (const qmckl_context context,
+                                        const int64_t nucl_num,
+                                        const int64_t ao_num,
+                                        const int64_t mo_num,
+                                        const int64_t point_num,
+                                        const int64_t* ao_nucl,
+                                        const int32_t* ao_ang_mom,
+                                        const double* en_distance,
+                                        const qmckl_matrix nucl_coord,
+                                        const qmckl_matrix point_coord,
+                                        const double* r_cusp,
+                                        const qmckl_tensor cusp_param,
+                                        const double* coefficient_t,
+                                        const double* ao_vgl,
+                                        double* const mo_vgl ); 
+#endif
+
+
+ +
+
#ifdef HAVE_HPC
+qmckl_exit_code
+qmckl_compute_mo_basis_mo_vgl_cusp_hpc (const qmckl_context context,
+                                        const int64_t nucl_num,
+                                        const int64_t ao_num,
+                                        const int64_t mo_num,
+                                        const int64_t point_num,
+                                        const int64_t* ao_nucl,
+                                        const int32_t* ao_ang_mom,
+                                        const double* en_distance,
+                                        const qmckl_matrix nucl_coord,
+                                        const qmckl_matrix point_coord,
+                                        const double* r_cusp,
+                                        const qmckl_tensor cusp_param,
+                                        const double* coefficient_t,
+                                        const double* ao_vgl,
+                                        double* const mo_vgl )
+{
+  assert (context != QMCKL_NULL_CONTEXT);
+
+#ifdef HAVE_OPENMP
+  #pragma omp parallel for
+#endif
+  for (int64_t ipoint=0 ; ipoint < point_num ; ++ipoint) {
+    double* restrict const vgl1 = &(mo_vgl[ipoint*5*mo_num]);
+    double* restrict const vgl2 =  vgl1 + mo_num;
+    double* restrict const vgl3 =  vgl1 + (mo_num << 1);
+    double* restrict const vgl4 =  vgl1 + (mo_num << 1) + mo_num;
+    double* restrict const vgl5 =  vgl1 + (mo_num << 2);
+
+    const double* restrict avgl1 = &(ao_vgl[ipoint*5*ao_num]);
+    const double* restrict avgl2 = avgl1 + ao_num;
+    const double* restrict avgl3 = avgl1 + (ao_num << 1);
+    const double* restrict avgl4 = avgl1 + (ao_num << 1) + ao_num;
+    const double* restrict avgl5 = avgl1 + (ao_num << 2);
+
+    for (int64_t i=0 ; i<mo_num ; ++i) {
+      vgl1[i] = 0.;
+      vgl2[i] = 0.;
+      vgl3[i] = 0.;
+      vgl4[i] = 0.;
+      vgl5[i] = 0.;
+    }
+
+    const double* restrict ria   = &(en_distance[ipoint*nucl_num]);
+
+    int64_t nidx=0;
+    int64_t idx[ao_num];
+    double  av1[ao_num];
+    double  av2[ao_num];
+    double  av3[ao_num];
+    double  av4[ao_num];
+    double  av5[ao_num];
+    for (int64_t k=0 ; k<ao_num ; ++k) {
+      if (avgl1[k] != 0.) {
+        const int64_t inucl = ao_nucl[k];
+        if (ria[inucl] > r_cusp[inucl] || ao_ang_mom[k] > 0) {
+          idx[nidx] = k;
+          av1[nidx] = avgl1[k];
+          av2[nidx] = avgl2[k];
+          av3[nidx] = avgl3[k];
+          av4[nidx] = avgl4[k];
+          av5[nidx] = avgl5[k];
+          ++nidx;
+        }
+      }
+    }
+
+    int64_t n=0;
+
+    for (n=0 ; n < nidx-4 ; n+=4) {
+      const double* restrict ck1 = coefficient_t + idx[n  ]*mo_num;
+      const double* restrict ck2 = coefficient_t + idx[n+1]*mo_num;
+      const double* restrict ck3 = coefficient_t + idx[n+2]*mo_num;
+      const double* restrict ck4 = coefficient_t + idx[n+3]*mo_num;
+
+      const double a11 = av1[n  ];
+      const double a21 = av1[n+1];
+      const double a31 = av1[n+2];
+      const double a41 = av1[n+3];
+
+      const double a12 = av2[n  ];
+      const double a22 = av2[n+1];
+      const double a32 = av2[n+2];
+      const double a42 = av2[n+3];
+
+      const double a13 = av3[n  ];
+      const double a23 = av3[n+1];
+      const double a33 = av3[n+2];
+      const double a43 = av3[n+3];
+
+      const double a14 = av4[n  ];
+      const double a24 = av4[n+1];
+      const double a34 = av4[n+2];
+      const double a44 = av4[n+3];
+
+      const double a15 = av5[n  ];
+      const double a25 = av5[n+1];
+      const double a35 = av5[n+2];
+      const double a45 = av5[n+3];
+
+#ifdef HAVE_OPENMP
+#pragma omp simd
+#endif
+      for (int64_t i=0 ; i<mo_num ; ++i) {
+        vgl1[i] = vgl1[i] + ck1[i] * a11 + ck2[i] * a21 + ck3[i] * a31 + ck4[i] * a41;
+        vgl2[i] = vgl2[i] + ck1[i] * a12 + ck2[i] * a22 + ck3[i] * a32 + ck4[i] * a42;
+        vgl3[i] = vgl3[i] + ck1[i] * a13 + ck2[i] * a23 + ck3[i] * a33 + ck4[i] * a43;
+        vgl4[i] = vgl4[i] + ck1[i] * a14 + ck2[i] * a24 + ck3[i] * a34 + ck4[i] * a44;
+        vgl5[i] = vgl5[i] + ck1[i] * a15 + ck2[i] * a25 + ck3[i] * a35 + ck4[i] * a45;
+      }
+    }
+
+    for (int64_t m=n ; m < nidx ; m+=1) {
+      const double* restrict ck = coefficient_t + idx[m]*mo_num;
+      const double a1 = av1[m];
+      const double a2 = av2[m];
+      const double a3 = av3[m];
+      const double a4 = av4[m];
+      const double a5 = av5[m];
+
+#ifdef HAVE_OPENMP
+  #pragma omp simd
+#endif
+      for (int64_t i=0 ; i<mo_num ; ++i) {
+        vgl1[i] += ck[i] * a1;
+        vgl2[i] += ck[i] * a2;
+        vgl3[i] += ck[i] * a3;
+        vgl4[i] += ck[i] * a4;
+        vgl5[i] += ck[i] * a5;
+      }
+    }
+
+    // TODO
+    for (int64_t inucl=0 ; inucl<nucl_num ; ++inucl) {
+      if (ria[inucl] < r_cusp[inucl]) {
+        const double r = ria[inucl];
+        const double r_vec[3] = {
+          qmckl_mat(point_coord,ipoint,0) - qmckl_mat(nucl_coord,inucl,0),
+          qmckl_mat(point_coord,ipoint,1) - qmckl_mat(nucl_coord,inucl,1),
+          qmckl_mat(point_coord,ipoint,2) - qmckl_mat(nucl_coord,inucl,2) };
+        const double r_inv = 1./r;
+
+#ifdef HAVE_OPENMP
+#pragma omp simd
+#endif
+        for (int64_t i=0 ; i<mo_num ; ++i) {
+          vgl1[i] += qmckl_ten3(cusp_param,i,0,inucl) + r*(
+                     qmckl_ten3(cusp_param,i,1,inucl) + r*(
+                     qmckl_ten3(cusp_param,i,2,inucl) + r*(
+                     qmckl_ten3(cusp_param,i,3,inucl) )));
+
+          const double c1 = r_inv * qmckl_ten3(cusp_param,i,1,inucl) +
+            2.0*qmckl_ten3(cusp_param,i,2,inucl) +
+            r * 3.0 * qmckl_ten3(cusp_param,i,3,inucl);
+
+           vgl2[i] += r_vec[0] * c1;
+           vgl3[i] += r_vec[1] * c1;
+           vgl4[i] += r_vec[2] * c1;
+
+           vgl5[i] +=  2.0*qmckl_ten3(cusp_param,i,1,inucl)*r_inv +
+                       6.0*qmckl_ten3(cusp_param,i,2,inucl) +
+                      12.0*qmckl_ten3(cusp_param,i,3,inucl)*r;
+        }
+      }
+    }
+  }
+  return QMCKL_SUCCESS;
+}
+#endif
+
+
+
+
+
+ +
+

2.6 Rescaling of MO coefficients

+

When evaluating Slater determinants, the value of the determinants may get out of the range of double precision. A simple fix is to @@ -1417,19 +2341,19 @@ correct range.

-
-

2.3.1 Fortran interface

+
+

2.6.1 Fortran interface

-
-

2.4 Test

+
+

2.7 Test

Author: TREX CoE

-

Created: 2023-03-09 Thu 10:03

+

Created: 2023-03-17 Fri 13:56

Validate

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

Table of Contents

-
-

1 Context

+
+

1 Context

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

-
-

1.1 Data structure

+
+

1.1 Data structure

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

1.2 Access functions

+
+

1.2 Access functions

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

-
-

1.3 Initialization functions

+
+

1.3 Initialization functions

To set the data relative to the nuclei in the context, the @@ -591,8 +591,8 @@ are be given in atomic units.

-
-

1.4 Test

+
+

1.4 Test

const double*   nucl_charge   = chbrclf_charge;
@@ -661,8 +661,8 @@ rc = qmckl_get_nucleus_charge(context, nucl_charge2, chbrclf_nucl_num);
 
-
-

2 Computation

+
+

2 Computation

The computed data is stored in the context so that it can be reused @@ -675,12 +675,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
@@ -692,10 +692,10 @@ current date is stored.
 
-
-

2.1.2 Compute

+
+

2.1.2 Compute

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

2.1.3 Test

+
+

2.1.3 Test

/* Reference input data */
@@ -793,8 +793,8 @@ rc = qmckl_get_nucleus_nn_distance(context, distance, chbrclf_nucl_num*chbrclf_n
 
-
-

2.2 Nuclear repulsion energy

+
+

2.2 Nuclear repulsion energy

\[ @@ -803,8 +803,8 @@ rc = qmckl_get_nucleus_nn_distance(context, distance, chbrclf_nucl_num*chbrclf_n

-
-

2.2.1 Get

+
+

2.2.1 Get

qmckl_exit_code qmckl_get_nucleus_repulsion(qmckl_context context, double* const energy);
@@ -813,10 +813,10 @@ rc = qmckl_get_nucleus_nn_distance(context, distance, chbrclf_nucl_num*chbrclf_n
 
-
-

2.2.2 Compute

+
+

2.2.2 Compute

-
+
@@ -906,8 +906,8 @@ rc = qmckl_get_nucleus_nn_distance(context, distance, chbrclf_nucl_num*chbrclf_n -
-

2.2.3 Test

+
+

2.2.3 Test

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

Author: TREX CoE

-

Created: 2023-03-09 Thu 10:02

+

Created: 2023-03-17 Fri 13:56

Validate

diff --git a/qmckl_numprec.html b/qmckl_numprec.html index 0c0cc0e..5360eeb 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 @@ -346,16 +346,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 @@ -366,7 +366,7 @@ Arithmetic (IEEE 754), refers to the number of exponent bits.

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

2 Precision

+
+

2 Precision

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

-
-

3 Range

+
+

3 Range

qmckl_set_numprec_range modifies the parameter for the numerical @@ -574,8 +574,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. @@ -594,7 +594,7 @@ We need to remove the sign bit from the precision.

Author: TREX CoE

-

Created: 2023-03-09 Thu 10:02

+

Created: 2023-03-17 Fri 13:56

Validate

diff --git a/qmckl_point.html b/qmckl_point.html index 90d7ebd..9053af2 100644 --- a/qmckl_point.html +++ b/qmckl_point.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Point @@ -346,25 +346,25 @@ for the JavaScript code in this tag.

Table of Contents

-
-

1 Context

+
+

1 Context

The following data stored in the context: @@ -414,8 +414,8 @@ corresponds to the 3 × num matrix.

-
-

1.1 Data structure

+
+

1.1 Data structure

typedef struct qmckl_point_struct {
@@ -451,8 +451,8 @@ corresponds to the 3 × num matrix.
 
-
-

1.2 Access functions

+
+

1.2 Access functions

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

-
-

1.2.1 Number of points

+
+

1.2.1 Number of points

Returns the number of points stored in the context. @@ -486,8 +486,8 @@ Returns the number of points stored in the context.

-
-

1.2.2 Point coordinates

+
+

1.2.2 Point coordinates

Returns the point coordinates as sequences of (x,y,z). @@ -515,8 +515,8 @@ The pointer is assumed to point on a memory block of size

-
-

1.3 Initialization functions

+
+

1.3 Initialization functions

When the data is set in the context, if the arrays are large @@ -590,8 +590,8 @@ Copy a sequence of num points \((x,y,z)\) into the context. if (num != ctx->point.num) { if (ctx->point.coord.data != NULL) { - rc = qmckl_matrix_free(context, &(ctx->point.coord)); - assert (rc == QMCKL_SUCCESS); + rc = qmckl_matrix_free(context, &(ctx->point.coord)); + assert (rc == QMCKL_SUCCESS); } ctx->point.coord = qmckl_matrix_alloc(context, num, 3); @@ -655,8 +655,8 @@ Copy a sequence of num points \((x,y,z)\) into the context.

-
-

1.4 Test

+
+

1.4 Test

/* Reference input data */
@@ -715,7 +715,7 @@ rc = qmckl_get_point (context, 'N', coord3,
 

Author: TREX CoE

-

Created: 2023-03-09 Thu 10:02

+

Created: 2023-03-17 Fri 13:56

Validate

diff --git a/qmckl_sherman_morrison_woodbury.html b/qmckl_sherman_morrison_woodbury.html index 257f6f7..3fe7a43 100644 --- a/qmckl_sherman_morrison_woodbury.html +++ b/qmckl_sherman_morrison_woodbury.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Sherman-Morrison-Woodbury @@ -346,76 +346,76 @@ for the JavaScript code in this tag.

Table of Contents

-
-

1 Headers

+
+

1 Headers

#include "qmckl.h"
@@ -437,17 +437,17 @@ This is the range that determines the how many high performance kernel instantce
 

-
-

2 Naïve Sherman-Morrison

+
+

2 Naïve Sherman-Morrison

-
-

2.1 qmckl_sm_naive

+
+

2.1 qmckl_sm_naive

-
-

2.1.1 Introduction

+
+

2.1.1 Introduction

This is the simplest of the available Sherman-Morrison-Woodbury kernels. It applies rank-1 updates one by one in @@ -497,10 +497,10 @@ from applying the updates to the original matrix.

-
-

2.1.2 API

+
+

2.1.2 API

-
+
@@ -588,8 +588,8 @@ from applying the updates to the original matrix. -
-

2.1.3 Requirements

+
+

2.1.3 Requirements

  • context is not QMCKL_NULL_CONTEXT
  • @@ -605,8 +605,8 @@ from applying the updates to the original matrix.
-
-

2.1.4 Pedagogical kernel source (in Fortran)

+
+

2.1.4 Pedagogical kernel source (in Fortran)

The following source code written in Fortran is inteded to illustrate how the kernel works. Even though the kernel is @@ -700,8 +700,8 @@ not be used in real workloads.

-
-
2.1.4.1 C interface to the pedagogical kernel (not directly exposed)
+
+
2.1.4.1 C interface to the pedagogical kernel (not directly exposed)

The following Fortran function qmckl_sm_naive_doc makes sure @@ -713,8 +713,8 @@ for C users and in the module file 'qmcklf.F90' for Fortran users.

-
-

2.1.5 C headers (exposed in qmckl.h)

+
+

2.1.5 C headers (exposed in qmckl.h)

qmckl_exit_code qmckl_sm_naive (
@@ -760,8 +760,8 @@ for C users and in the module file 'qmcklf.F90' for Fortran users.
 
-
-

2.1.6 C sources

+
+

2.1.6 C sources

Common includes and macros used by all the Sherman-Morrison-Woodbury kernels. @@ -879,7 +879,7 @@ multiple of SIMD_LENGTH. qmckl_exit_code qmckl_sm_naive_{Dim} is a C function-template that is used to genereate instances of C fucntions based on the range given above. The advantage of this method is that for each of these instances all the dimensions and loop-bounds are known at compile time, allowing the compiler to optimize more aggressively.

-
static inline qmckl_exit_code qmckl_sm_naive_{Dim}(
+
static inline qmckl_exit_code qmckl_sm_naive_{Dim}(
     const qmckl_context context,
     const uint64_t N_updates,
     const double* __restrict Updates,
@@ -955,7 +955,7 @@ multiple of SIMD_LENGTH.
 This is the kernel generator written in Python. It uses the kernel generator range and templates defined above to generate the C kernel instances.
 

-
text="""
+
text="""
 static inline qmckl_exit_code qmckl_sm_naive_{Dim}(
     const qmckl_context context,
     const uint64_t N_updates,
@@ -1039,7 +1039,7 @@ This is the kernel generator written in Python. It uses the kernel generator ran
 Python script that generated C switch cases that call individual kernel instances.
 

-
text="""
+
text="""
 case {Dim}:  
   return qmckl_sm_naive_{Dim}(context,
     N_updates,
@@ -2679,14 +2679,14 @@ Python script that generated C switch cases that call individual kernel instance
 
-
-

2.1.7 Fortran interfaces (exposed in qmcklf.F90)

+
+

2.1.7 Fortran interfaces (exposed in qmcklf.F90)

-
-

2.1.8 Performance

+
+

2.1.8 Performance

This function performs best when there is only 1 rank-1 update in the update cycle. It is @@ -2695,8 +2695,8 @@ can never resolve a situation where applying the update causes singular behaviou

-
-

2.1.9 Tests

+
+

2.1.9 Tests

The tests for the kernels are executed on datasets that are extracted from a run of @@ -2764,17 +2764,17 @@ rc = QMCKL_SUCCESS;

-
-

3 Sherman-Morrison with Slagel Splitting (core)

+
+

3 Sherman-Morrison with Slagel Splitting (core)

-
-

3.1 qmckl_sm_splitting_core

+
+

3.1 qmckl_sm_splitting_core

-
-

3.1.1 Introduction

+
+

3.1.1 Introduction

qmckl_sm_splitting_core is the inner core part of 'Sherman-Morrison with update splitting' in the next section. @@ -2802,10 +2802,10 @@ If the determinant is passed it will only be partially updated if there were any

-
-

3.1.2 API

+
+

3.1.2 API

-
+
@@ -2914,8 +2914,8 @@ If the determinant is passed it will only be partially updated if there were any -
-

3.1.3 Requirements

+
+

3.1.3 Requirements

  • LDS >= 2
  • @@ -2932,8 +2932,8 @@ If the determinant is passed it will only be partially updated if there were any
-
-

3.1.4 Pedagogical kernel source (in Fortran)

+
+

3.1.4 Pedagogical kernel source (in Fortran)

The following source code written in Fortran is inteded to illustrate how the kernel works. Even though the kernel is @@ -3054,8 +3054,8 @@ not be used in real workloads.

-
-
3.1.4.1 C interface to the pedagogical kernel (not directly exposed)
+
+
3.1.4.1 C interface to the pedagogical kernel (not directly exposed)

The function qmckl_sm_splitting_core_doc makes sure that @@ -3068,8 +3068,8 @@ exposed in qmckl.h and qmckl_f.F90, but

-
-

3.1.5 C headers (exposed in qmckl.h)

+
+

3.1.5 C headers (exposed in qmckl.h)

qmckl_exit_code qmckl_sm_splitting_core (
@@ -3124,8 +3124,8 @@ exposed in qmckl.h and qmckl_f.F90, but
 
-
-

3.1.6 C sources

+
+

3.1.6 C sources

qmckl_exit_code qmckl_sm_splitting_core_hpc(
@@ -3214,7 +3214,7 @@ exposed in qmckl.h and qmckl_f.F90, but
 
-
static inline qmckl_exit_code qmckl_sm_splitting_core_{Dim}(
+
static inline qmckl_exit_code qmckl_sm_splitting_core_{Dim}(
     const qmckl_context context,
     uint64_t N_updates,
     const double* __restrict Updates,
@@ -3298,7 +3298,7 @@ exposed in qmckl.h and qmckl_f.F90, but
 
-
text="""
+
text="""
 static inline qmckl_exit_code qmckl_sm_splitting_core_{Dim}(
     const qmckl_context context,
     uint64_t N_updates,
@@ -3390,7 +3390,7 @@ exposed in qmckl.h and qmckl_f.F90, but
 
-
text="""
+
text="""
 case {Dim}: {
   return qmckl_sm_splitting_core_{Dim}(
       context,
@@ -5379,14 +5379,14 @@ exposed in qmckl.h and qmckl_f.F90, but
 
-
-

3.1.7 Fortran interfaces (exposed in qmcklf.F90)

+
+

3.1.7 Fortran interfaces (exposed in qmcklf.F90)

-
-

3.1.8 Performance

+
+

3.1.8 Performance

This function cannot be used by itself and is used in Sherman-Morrison with update splitting and Woodbury 3x3 and 2x2 @@ -5398,17 +5398,17 @@ with Sherman-Morrison and update splitting. Please look at the performance recco

-
-

4 Sherman-Morrison with Slagel Splitting

+
+

4 Sherman-Morrison with Slagel Splitting

-
-

4.1 qmckl_sm_splitting

+
+

4.1 qmckl_sm_splitting

-
-

4.1.1 Introduction

+
+

4.1.1 Introduction

This is a variation on the 'Naive' Sherman-Morrison kernel. Whenever the denominator \(1+v_j^T S^{-1} u_j\) in @@ -5432,10 +5432,10 @@ from applying the updates to the original matrix.

-
-

4.1.2 API

+
+

4.1.2 API

-
+
@@ -5523,8 +5523,8 @@ from applying the updates to the original matrix. -
-

4.1.3 Requirements

+
+

4.1.3 Requirements

  • context is not QMCKL_NULL_CONTEXT
  • @@ -5539,8 +5539,8 @@ from applying the updates to the original matrix.
-
-

4.1.4 Pedagogical kernel source (in Fortran)

+
+

4.1.4 Pedagogical kernel source (in Fortran)

The following source code written in Fortran is inteded to illustrate how the kernel works. Even though the kernel is @@ -5623,8 +5623,8 @@ not be used in real workloads.

-
-
4.1.4.1 C interface to the pedagogical kernel (not directly exposed)
+
+
4.1.4.1 C interface to the pedagogical kernel (not directly exposed)

The following Fortran function qmckl_sm_splitting_core_doc makes sure @@ -5637,8 +5637,8 @@ for C users and in the module file 'qmcklf.F90' for Fortran users.

-
-

4.1.5 C headers (exposed in qmckl.h)

+
+

4.1.5 C headers (exposed in qmckl.h)

qmckl_exit_code qmckl_sm_splitting (
@@ -5684,11 +5684,11 @@ for C users and in the module file 'qmcklf.F90' for Fortran users.
 
-
-

4.1.6 C source

+
+

4.1.6 C source

-
text="""
+
text="""
 case {Dim}: {
   rc = qmckl_sm_splitting_core_{Dim}(
       context,
@@ -6096,14 +6096,14 @@ for C users and in the module file 'qmcklf.F90' for Fortran users.
 
-
-

4.1.7 Fortran interfaces (exposed in qmcklf.F90)

+
+

4.1.7 Fortran interfaces (exposed in qmcklf.F90)

-
-

4.1.8 Performance…

+
+

4.1.8 Performance…

This kernel performs best when there are 2 or more rank-1 update cycles and fail-rate is high. @@ -6111,8 +6111,8 @@ This kernel performs best when there are 2 or more rank-1 update cycles and fail

-
-

4.1.9 Test

+
+

4.1.9 Test

assert(Updates3 != NULL);
@@ -6150,8 +6150,8 @@ rc = QMCKL_SUCCESS;
 
 
 
-
-

5 End of files

+
+

5 End of files

assert (qmckl_context_destroy(context) == QMCKL_SUCCESS);
@@ -6165,7 +6165,7 @@ rc = QMCKL_SUCCESS;
 

Author: TREX CoE

-

Created: 2023-03-09 Thu 10:03

+

Created: 2023-03-17 Fri 13:56

Validate

diff --git a/qmckl_tests.html b/qmckl_tests.html index 5f9600a..8c1a6ff 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 @@ -246,27 +246,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, @@ -350,8 +350,8 @@ and with a high maximum angular momentum.

-
-

1.1 XYZ coordinates

+
+

1.1 XYZ coordinates

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

1.2 Atomic basis set

+
+

1.2 Atomic basis set

 HYDROGEN
@@ -1301,8 +1301,8 @@ F   1
 
-
-

1.3 Molecular orbitals

+
+

1.3 Molecular orbitals

#define chbrclf_mo_num ((int64_t) 224)
@@ -60226,8 +60226,8 @@ F   1
 
-
-

1.4 Electron coordinates

+
+

1.4 Electron coordinates

Electron coordinates are stored in atomic units in normal format. @@ -60386,8 +60386,8 @@ Electron coordinates are stored in atomic units in normal format.

-
-

2 N2

+
+

2 N2

This test is mainly for the Jastrow factor and was supplied by @@ -60428,8 +60428,8 @@ treated by pseudopotentials thus excluded from the actual calculation.

-
-

2.1 XYZ coordinates

+
+

2.1 XYZ coordinates

   2
@@ -60456,8 +60456,8 @@ Nuclear coordinates are stored in atomic units in transposed format.
 
-
-

2.2 Electron coordinates

+
+

2.2 Electron coordinates

Electron coordinates are stored in atomic units in normal format. @@ -60486,8 +60486,8 @@ Electron coordinates are stored in atomic units in normal format.

-
-

2.3 Jastrow related data

+
+

2.3 Jastrow related data

This test is mainly for the Jastrow factor and was supplied by @@ -60586,7 +60586,7 @@ Ramon Panades Baruetta.

-

Created: 2023-03-09 Thu 10:03

+

Created: 2023-03-17 Fri 13:56

Validate

diff --git a/qmckl_trexio.html b/qmckl_trexio.html index c0fc7e4..5a83e85 100644 --- a/qmckl_trexio.html +++ b/qmckl_trexio.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + TREXIO I/O library @@ -324,53 +324,53 @@ for the JavaScript code in this tag.

Table of Contents

-
-

1 Local functions

+
+

1 Local functions

Functions defined in this section are all local: they should not be @@ -403,8 +403,8 @@ In the functions defined in this section, we use as local variables

-
-

1.1 Open file

+
+

1.1 Open file

We first define a helper function to open a file by first trying to @@ -442,8 +442,8 @@ groups of data by passing the trexio_t handle.

-
-

1.2 Electron

+
+

1.2 Electron

In this section we read all the data into the electron data structure. @@ -494,8 +494,8 @@ We read the number of up-spin and down-spin electrons.

-
-

1.3 Nucleus

+
+

1.3 Nucleus

In this section we read the number of nuclei, the molecular geometry and nuclear charges. @@ -515,8 +515,8 @@ In this section we read the number of nuclei, the molecular geometry and nuclear

-
-

1.3.1 Number of nuclei

+
+

1.3.1 Number of nuclei

int64_t nucleus_num = 0L;
@@ -539,8 +539,8 @@ rc = qmckl_set_nucleus_num(context, nucleus_num);
 
-
-

1.3.2 Nuclear charges

+
+

1.3.2 Nuclear charges

{
@@ -580,8 +580,8 @@ rc = qmckl_set_nucleus_num(context, nucleus_num);
 
-
-

1.3.3 Nuclear coordinates

+
+

1.3.3 Nuclear coordinates

Now, we read the molecular geometry. It is stored in normal format @@ -626,7 +626,7 @@ in the TREXIO file ('N'), so it will be automatically transposed in

-
+
  assert ( qmckl_nucleus_provided(context) );
   return QMCKL_SUCCESS;
 }
 #endif
@@ -636,8 +636,8 @@ in the TREXIO file ('N'), so it will be automatically transposed in
 
-
-

1.4 Basis set and AOs

+
+

1.4 Basis set and AOs

In this section we read the atomic basis set and atomic orbitals. @@ -663,8 +663,8 @@ In this section we read the atomic basis set and atomic orbitals.

-
-

1.4.1 Basis set type

+
+

1.4.1 Basis set type

#define MAX_STR_LEN 1024
@@ -695,8 +695,8 @@ In this section we read the atomic basis set and atomic orbitals.
 
-
-

1.4.2 Number of shells

+
+

1.4.2 Number of shells

int64_t shell_num = 0L;
@@ -720,8 +720,8 @@ rc = qmckl_set_ao_basis_shell_num(context, shell_num);
 
-
-

1.4.3 Number of primitives

+
+

1.4.3 Number of primitives

int64_t prim_num = 0L;
@@ -745,8 +745,8 @@ rc = qmckl_set_ao_basis_prim_num(context, prim_num);
 
-
-

1.4.4 Number of atomic orbitals

+
+

1.4.4 Number of atomic orbitals

int64_t ao_num = 0LL;
@@ -770,8 +770,8 @@ rc = qmckl_set_ao_basis_ao_num(context, ao_num);
 
-
-

1.4.5 Nucleusindex array

+
+

1.4.5 Nucleusindex array

{
@@ -851,8 +851,8 @@ rc = qmckl_set_ao_basis_ao_num(context, ao_num);
 
-
-

1.4.6 Number of shells per nucleus

+
+

1.4.6 Number of shells per nucleus

{
@@ -937,8 +937,8 @@ rc = qmckl_set_ao_basis_ao_num(context, ao_num);
 
-
-

1.4.7 Angular momentum

+
+

1.4.7 Angular momentum

{
@@ -983,8 +983,8 @@ rc = qmckl_set_ao_basis_ao_num(context, ao_num);
 
-
-

1.4.8 Number of primitives per shell

+
+

1.4.8 Number of primitives per shell

{
@@ -1068,8 +1068,8 @@ rc = qmckl_set_ao_basis_ao_num(context, ao_num);
 
-
-

1.4.9 Indices of the primitives

+
+

1.4.9 Indices of the primitives

{
@@ -1149,8 +1149,8 @@ rc = qmckl_set_ao_basis_ao_num(context, ao_num);
 
-
-

1.4.10 Normalization of the shells

+
+

1.4.10 Normalization of the shells

{
@@ -1195,8 +1195,8 @@ rc = qmckl_set_ao_basis_ao_num(context, ao_num);
 
-
-

1.4.11 Exponents

+
+

1.4.11 Exponents

{
@@ -1241,8 +1241,8 @@ rc = qmckl_set_ao_basis_ao_num(context, ao_num);
 
-
-

1.4.12 Coefficients

+
+

1.4.12 Coefficients

{
@@ -1287,8 +1287,8 @@ rc = qmckl_set_ao_basis_ao_num(context, ao_num);
 
-
-

1.4.13 Normalization of the primitivies

+
+

1.4.13 Normalization of the primitivies

{
@@ -1333,8 +1333,8 @@ rc = qmckl_set_ao_basis_ao_num(context, ao_num);
 
-
-

1.4.14 AO Normalization

+
+

1.4.14 AO Normalization

{
@@ -1389,8 +1389,8 @@ rc = qmckl_set_ao_basis_ao_num(context, ao_num);
 
-
-

1.5 Molecular orbitals

+
+

1.5 Molecular orbitals

In this section we read the MO coefficients. @@ -1416,8 +1416,8 @@ In this section we read the MO coefficients.

-
-

1.5.1 Number of MOs

+
+

1.5.1 Number of MOs

int64_t mo_num = 0L;
@@ -1440,8 +1440,8 @@ rc = qmckl_set_mo_basis_mo_num(context, mo_num);
 
-
-

1.5.2 MO coefficients

+
+

1.5.2 MO coefficients

{
@@ -1467,7 +1467,7 @@ rc = qmckl_set_mo_basis_mo_num(context, mo_num);
                            trexio_string_of_error(rcio));
   }
 
-  rc = qmckl_set_mo_basis_coefficient(context, mo_coef);
+  rc = qmckl_set_mo_basis_coefficient(context, mo_coef, ao_num*mo_num);
 
   qmckl_free(context, mo_coef);
   mo_coef = NULL;
@@ -1490,12 +1490,12 @@ rc = qmckl_set_mo_basis_mo_num(context, mo_num);
 
-
-

1.6 TODO ECP

+
+

1.6 TODO ECP

-
-

2 Read everything

+
+

2 Read everything

qmckl_exit_code
@@ -1570,8 +1570,8 @@ rc = qmckl_set_mo_basis_mo_num(context, mo_num);
 
-
-

3 Test

+
+

3 Test

#ifdef HAVE_TREXIO
@@ -1595,8 +1595,8 @@ rc = qmckl_trexio_read(context, filename, 255);
 
-
-

3.0.1 Electrons

+
+

3.0.1 Electrons

printf("Electrons\n");
@@ -1614,8 +1614,8 @@ rc = qmckl_get_electron_down_num(context, &dn_num);
 
-
-

3.0.2 Nuclei

+
+

3.0.2 Nuclei

printf("Nuclei\n");
@@ -1655,8 +1655,8 @@ coord = NULL;
 
-
-

3.0.3 Atomic basis

+
+

3.0.3 Atomic basis

printf("Atomic basis\n");
@@ -1764,8 +1764,8 @@ prim_factor = NULL;
 
-
-

3.0.4 MO Basis

+
+

3.0.4 MO Basis

printf("MOs\n");
@@ -1796,7 +1796,7 @@ charge = NULL;
 

Author: TREX CoE

-

Created: 2023-03-09 Thu 10:03

+

Created: 2023-03-17 Fri 13:56

Validate

diff --git a/qmckl_verificarlo.html b/qmckl_verificarlo.html index 5cc7721..088eaec 100644 --- a/qmckl_verificarlo.html +++ b/qmckl_verificarlo.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Verificarlo CI @@ -324,22 +324,22 @@ for the JavaScript code in this tag.

Table of Contents

-
-

1 Verificarlo probes

+
+

1 Verificarlo probes

This file contains utility functions to enable the Verificarlo @@ -390,8 +390,8 @@ To learn more about Verificarlo CI :

-
-

1.1 Automatically initialize the vfc_probe object if VFC_CI is defined

+
+

1.1 Automatically initialize the vfc_probe object if VFC_CI is defined

void qmckl_init_probes();
@@ -409,8 +409,8 @@ To learn more about Verificarlo CI :
 
-
-

1.2 Standard probe, without check

+
+

1.2 Standard probe, without check

  • if VFC_CI is defined, place a standard probe
  • @@ -445,8 +445,8 @@ if VFC_CI is undefined, return false (no error)
-
-

1.3 Probe with absolute check

+
+

1.3 Probe with absolute check

  • if VFC_CI is defined, place a probe with an absolute check
  • @@ -486,8 +486,8 @@ and accuracy
-
-

1.4 Probe with relative check

+
+

1.4 Probe with relative check

  • if VFC_CI is defined, place a probe with a relative check
  • @@ -527,8 +527,8 @@ and accuracy
-
-

1.5 Automatically delete and dump the vfcprobe object if VFC_CI is defined

+
+

1.5 Automatically delete and dump the vfcprobe object if VFC_CI is defined

void qmckl_dump_probes();
@@ -547,8 +547,8 @@ and accuracy
 
-
-

2 Fortran wrappers

+
+

2 Fortran wrappers

bool qmckl_probe_f(
@@ -672,7 +672,7 @@ and accuracy
 

Author: TREX CoE

-

Created: 2023-03-09 Thu 10:02

+

Created: 2023-03-17 Fri 13:56

Validate