diff --git a/README.html b/README.html index 0555276..c89740f 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 @@ -312,24 +312,25 @@ for the JavaScript code in this tag. @@ -361,7 +362,7 @@ and bug reports should be submitted at

Author: TREX CoE

-

Created: 2022-01-17 Mon 15:13

+

Created: 2022-01-20 Thu 11:10

Validate

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

Table of Contents

-
-

1 Using QMCkl

+
+

1 Installing QMCkl

+The latest version fo QMCkl can be downloaded +here, and the source code is accessible on the +GitHub repository. +

+
+ +
+

1.1 Installing from the released tarball (for end users)

+
+

+QMCkl is built with GNU Autotools, so the usual +configure ; make ; make check ; make install scheme will be used. +

+ +

+As usual, the C compiler can be specified with the CC variable +and the Fortran compiler with the FC variable. The compiler +options are defined using CFLAGS and FCFLAGS. +

+
+
+ +
+

1.2 Installing from the source repository (for developers)

+
+

+To compile from the source repository, additional dependencies are +required to generated the source files: +

+
    +
  • Emacs >= 26
  • +
  • Autotools
  • +
  • Python3
  • +
+ +

+When the repository is downloaded, the Makefile is not yet +generated, as well as the configure script. ./autogen.sh has +to be executed first. +

+
+
+
+ +
+

2 Using QMCkl

+
+

The qmckl.h header file installed in the ${prefix}/include directory has to be included in C codes when QMCkl functions are used:

@@ -385,13 +439,13 @@ Both files are located in the include/ directory.
-
-

2 Developing in QMCkl

-
+
+

3 Developing in QMCkl

+
-
-

2.1 Literate programming

-
+
+

3.1 Literate programming

+

In a traditional source code, most of the lines of source files of a program are code, scripts, Makefiles, and only a few lines are comments explaining @@ -432,12 +486,17 @@ the command-line in the Makefile, and then the produced files are c Moreover, within the Emacs text editor the source code blocks can be executed interactively, in the same spirit as Jupyter notebooks.

+ +

+Note that Emacs is not needed for end users because the distributed +tarball contains the generated source code. +

-
-

2.2 Source code editing

-
+
+

3.2 Source code editing

+

For a tutorial on literate programming with org-mode, follow this link.

@@ -467,46 +526,62 @@ org-mode.
-
-

2.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 scripts in -Bash and Python. Outside of the CoE, Fortran is also important (Casino, Amolqc), -and other important languages used by the community are C and C++ (QMCPack, -QWalk), and Julia is gaining in popularity. The library we design should be -compatible with all of these languages. The QMCkl API has to be compatible -with the C language since libraries with a C-compatible API can be used in -every other language. +Most of the codes of the TREX CoE are written in Fortran with some +scripts in Bash and Python. Outside of the CoE, Fortran is also +important in QMC codes (Casino, Amolqc), and other important +languages used by the community are C and C++ (QMCPack, QWalk), +Julia and Rust are gaining in popularity. We want QMCkl to be +compatible with all of these languages, so the QMCkl API has to be +compatible with the C language since libraries with a C-compatible +API can be used in every other language.

-High-performance versions of the QMCkl, with the same API, will be rewritten by -the experts in HPC. These optimized libraries will be tuned for specific -architectures, among which we can cite x86 based processors, and GPU -accelerators. Nowadays, the most efficient software tools to take advantage of -low-level features of the processor (intrinsics) and of GPUs are for C++ -developers. It is highly probable that the optimized implementations will be -written in C++, and this is agreement with our choice to make the API -C-compatible. +High-performance versions of QMCkl, with the same API, can be +rewritten by HPC experts. These optimized libraries will be tuned +for specific architectures, among which we can cite x86 based +processors, and GPU accelerators. Nowadays, the most efficient +software tools to take advantage of low-level features +(intrinsics, prefetching, aligned or pinned memory allocation, +…) are for C++ developers. It is highly probable that optimized +implementations will be written in C++, but as the API is +C-compatible this doesn't pose any problem for linking the library +in other languages.

-Fortran is one of the most common languages used by the community, and is simple -enough to make the algorithms readable both by experts in QMC, and experts in -HPC. Hence we propose in this pedagogical implementation of QMCkl to use Fortran -to express the QMC algorithms. As the main languages of the library is C, this -implies that the exposed C functions call the Fortran routine. However, for -internal functions related to system programming, the C language is more natural -than Fortran. +Fortran is one of the most common languages used by the community, +and is simple enough to make the algorithms readable both by +experts in QMC, and experts in HPC. Hence we propose in this +pedagogical implementation of QMCkl to use Fortran to express the +QMC algorithms. However, for internal functions related to system +programming, the C language is more natural than Fortran.

-The Fortran source files should provide a C interface using the -iso_c_binding module. The name of the Fortran source files should end with -_f.f90 to be properly handled by the Makefile. The names of the functions -defined in Fortran should be the same as those exposed in the API suffixed by -_f. +As QMCkl appears like a C library, for each Fortran function there +is an iso_c_binding interface to make the Fortran function +callable from C. It is this C interface which is exposed to the +user. As a consequence, the Fortran users of the library never +call directly the Fortran routines, but call instead the C binding +function and an iso_c_binding is still required: +

+ +
+         ISO_C_BINDING        ISO_C_BINDING
+Fortran --------------->  C  --------------->  Fortran
+
+ +

+ The name of the Fortran source files should end with _f.f90 to +be properly handled by the Makefile and to avoid collision of +object files (*.o) with the compiled C source files. The names +of the functions defined in Fortran should be the same as those +exposed in the API suffixed by _f.

@@ -516,9 +591,9 @@ For more guidelines on using Fortran to generate a C interface, see

-
-

2.4 Coding rules

-
+
+

3.4 Coding rules

+

The authors should follow the recommendations of the C99 SEI+CERT C Coding Standard. @@ -530,14 +605,16 @@ Compliance can be checked with cppcheck as:

cppcheck --addon=cert --enable=all *.c &> cppcheck.out
+# or
+make cppcheck ; cat cppcheck.out
 
-
-

2.5 Design of the library

-
+
+

3.5 Design of the library

+

The proposed API should allow the library to: deal with memory transfers between CPU and accelerators, and to use different levels of floating-point @@ -547,9 +624,9 @@ functions (see below).

-
-

2.6 Naming conventions

-
+
+

3.6 Naming conventions

+

To avoid namespace collisions, we use qmckl_ as a prefix for all exported functions and variables. All exported header files should have a file name @@ -562,10 +639,6 @@ produced C files should be xxx.c and xxx.h and the nam produced Fortran file should be xxx.f90.

-

-Arrays are in uppercase and scalars are in lowercase. -

-

In the names of the variables and functions, only the singular form is allowed. @@ -573,9 +646,9 @@ form is allowed.

-
-

2.7 Application programming interface

-
+
+

3.7 Application programming interface

+

In the C language, the number of bits used by the integer types can change from one architecture to another one. To circumvent this problem, we choose to @@ -606,15 +679,15 @@ bindings in other languages in other repositories.

-
-

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

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

2.9 Headers

-
+
+

3.9 Headers

+

A single qmckl.h header to be distributed by the library is built by concatenating some of the produced header files. @@ -717,9 +790,9 @@ and the types definitions should be written in the *fh_type.f90 fil

-
-

2.10 Low-level functions

-
+
+

3.10 Low-level functions

+

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

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

-
-

2.11 High-level functions

-
+
+

3.11 High-level functions

+

High-level functions are at the top of the function call tree. They are able to choose which lower-level function to call @@ -743,33 +816,26 @@ depending on the required precision, and do the corresponding type conversions. These functions are also responsible for allocating temporary storage, to simplify the use of accelerators.

- -

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

-
-

2.12 Numerical precision

-
+
+

3.12 Numerical precision

+

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

In order to automatize numerical accuracy tests, QMCkl uses -Verificarlo and -its CI functionality. You can read Verificarlo CI's documentation -at the following link. -Reading it is advised to understand the remainder of this section. +Verificarlo and its CI functionality. You can read Verificarlo CI's +documentation at the following link. Reading it is advised to +understand the remainder of this section.

@@ -778,7 +844,7 @@ library, use the following configure command :

-
QMCKL_DEVEL=1 ./configure --prefix=$PWD/_install --enable-silent-rules --enable-maintainer-mode CC=verificarlo-f FC=verificarlo-f --host=x86_64 --enable-vfc_ci
+
./configure CC=verificarlo-f FC=verificarlo-f --host=x86_64 --enable-vfc_ci
 
@@ -810,7 +876,7 @@ Here are these 3 functions :

-If you need more details on these functions or their Fortran +If you need more detail on these functions or their Fortran interfaces, have a look at the tools/qmckl_probes files.

@@ -830,9 +896,9 @@ following points :
-
-

2.13 Algorithms

-
+
+

3.13 Algorithms

+

Reducing the scaling of an algorithm usually implies also reducing its arithmetic complexity (number of flops per byte). Therefore, @@ -847,7 +913,7 @@ implemented adapted to different problem sizes.

Author: TREX CoE

-

Created: 2022-01-17 Mon 15:13

+

Created: 2022-01-20 Thu 11:10

Validate

diff --git a/qmckl_ao.html b/qmckl_ao.html index b3f1b51..9b21626 100644 --- a/qmckl_ao.html +++ b/qmckl_ao.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Atomic Orbitals @@ -333,53 +333,53 @@ 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 @@ -432,19 +432,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:

- +
@@ -618,7 +618,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,
@@ -655,7 +655,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);
 
@@ -693,17 +693,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 @@ -827,8 +827,8 @@ called.

-
-
2.1.1.2 Fortran interface
+
+
2.1.1.2 Fortran interface
interface
@@ -1011,17 +1011,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
@@ -1143,8 +1143,8 @@ function returns true.
 
-
-
2.1.2.2 Fortran interface
+
+
2.1.2.2 Fortran interface
interface
@@ -1328,8 +1328,8 @@ function returns true.
 
-
-

2.2 Computed data

+
+

2.2 Computed data

The following data is computed as described in the next sections: @@ -1393,8 +1393,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 @@ -1408,8 +1408,8 @@ the context.

-
-

2.2.2 Access functions

+
+

2.2.2 Access functions

qmckl_exit_code
@@ -1422,7 +1422,7 @@ the context.
 

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.

@@ -1435,7 +1435,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.

@@ -1449,19 +1449,19 @@ 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.

-
-

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 @@ -1632,10 +1632,10 @@ Requirements:

-
-

3.2 Computation of primitives

+
+

3.2 Computation of primitives

-
+
@@ -1794,10 +1794,10 @@ Requirements: -
-

3.3 Computation of shells

+
+

3.3 Computation of shells

-
+
@@ -2036,8 +2036,8 @@ Requirements: -
-

4 Polynomial part

+
+

4 Polynomial part

Going from the atomic basis set to AOs implies a systematic @@ -2057,8 +2057,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 @@ -2070,7 +2070,7 @@ the \(n\) points: \[ P_{ik} = X_i^k \]

-
+
@@ -2208,8 +2208,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\) @@ -2254,7 +2254,7 @@ Laplacians at a given point in space, of all polynomials with an angular momentum up to lmax.

-
+
@@ -2514,10 +2514,10 @@ 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

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

Author: TREX CoE

-

Created: 2022-01-17 Mon 15:13

+

Created: 2022-01-20 Thu 11:10

Validate

diff --git a/qmckl_blas.html b/qmckl_blas.html index 0ec7c29..1db0f8b 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 @@ -333,23 +333,705 @@ for the JavaScript code in this tag.

Table of Contents

-
-

1 Matrix operations

+
+

1 Data types

-
-

1.1 qmckl_dgemm

+
+

1.1 Vector

+
+ + +++ ++ ++ + + + + + + + + + + + + + + + + + + + + +
VariableTypeDescription
sizeint64_tDimension of the vector
datadouble*Elements
+ +
+
typedef struct qmckl_vector {
+  int64_t size;
+  double* data;
+} qmckl_vector;
+
+
+ + +
+
qmckl_vector
+qmckl_vector_alloc( qmckl_context context, 
+                    const int64_t size);
+
+
+ +

+Allocates a new vector. If the allocation failed the size is zero. +

+ +
+
qmckl_vector
+qmckl_vector_alloc( qmckl_context context, 
+                    const int64_t size)
+{
+  /* Should always be true by contruction */
+  assert (size > (int64_t) 0);
+
+  qmckl_vector result;
+  result.size = size;
+
+  qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
+  mem_info.size = size * sizeof(double);
+  result.data = (double*) qmckl_malloc (context, mem_info);
+
+  if (result.data == NULL) {
+    result.size = (int64_t) 0;
+  }
+
+  return result;
+}
+
+
+ +
+
qmckl_exit_code
+qmckl_vector_free( qmckl_context context, 
+                   qmckl_vector vector);
+
+
+ +
+
qmckl_exit_code
+qmckl_vector_free( qmckl_context context, 
+                   qmckl_vector vector)
+{
+  /* Always true */
+  assert (vector.data != NULL);
+
+  qmckl_exit_code rc;
+
+  rc = qmckl_free(context, vector.data);
+  if (rc != QMCKL_SUCCESS) {
+    return rc;
+  }
+
+  vector.size = (int64_t) 0;
+  vector.data = NULL;
+  return QMCKL_SUCCESS;
+}
+
+
+
+
+ +
+

1.2 Matrix

+
+ + + +++ ++ ++ + + + + + + + + + + + + + + + + + + + + +
VariableTypeDescription
sizeint64_t[2]Dimension of each component
datadouble*Elements
+ +

+The dimensions use Fortran ordering: two elements differing by one +in the first dimension are consecutive in memory. +

+ +
+
typedef struct qmckl_matrix {
+  int64_t size[2];
+  double* data;
+} qmckl_matrix;
+
+
+ + +
+
qmckl_matrix
+qmckl_matrix_alloc( qmckl_context context, 
+                    const int64_t size1,
+                    const int64_t size2);
+
+
+ +

+Allocates a new matrix. If the allocation failed the sizes are zero. +

+ +
+
qmckl_matrix
+qmckl_matrix_alloc( qmckl_context context, 
+                    const int64_t size1,
+                    const int64_t size2)
+{
+  /* Should always be true by contruction */
+  assert (size1 * size2 > (int64_t) 0);
+
+  qmckl_matrix result;
+
+  result.size[0] = size1;
+  result.size[1] = size2;
+
+  qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
+  mem_info.size = size1 * size2 * sizeof(double);
+  result.data = (double*) qmckl_malloc (context, mem_info);
+
+  if (result.data == NULL) {
+    result.size[0] = (int64_t) 0;
+    result.size[1] = (int64_t) 0;
+  }
+
+  return result;
+}
+
+
+ +
+
qmckl_exit_code
+qmckl_matrix_free( qmckl_context context, 
+                   qmckl_matrix matrix);
+
+
+ +
+
qmckl_exit_code
+qmckl_matrix_free( qmckl_context context, 
+                   qmckl_matrix matrix)
+{
+  /* Always true */
+  assert (matrix.data != NULL);
+
+  qmckl_exit_code rc;
+
+  rc = qmckl_free(context, matrix.data);
+  if (rc != QMCKL_SUCCESS) {
+    return rc;
+  }
+  matrix.data = NULL;
+  matrix.size[0] = (int64_t) 0;
+  matrix.size[1] = (int64_t) 0;
+
+  return QMCKL_SUCCESS;
+}
+
+
+
+
+ +
+

1.3 Tensor

+
+ + + +++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
VariableTypeDescription
orderint64_tOrder of the tensor
sizeint64_t[QMCKL_TENSOR_ORDER_MAX]Dimension of each component
datadouble*Elements
+ +

+The dimensions use Fortran ordering: two elements differing by one +in the first dimension are consecutive in memory. +

+ +
+
#define QMCKL_TENSOR_ORDER_MAX 16
+
+typedef struct qmckl_tensor {
+  int64_t order;
+  int64_t size[QMCKL_TENSOR_ORDER_MAX];
+  double* data;
+} qmckl_tensor;
+
+
+ + +
+
qmckl_tensor
+qmckl_tensor_alloc( qmckl_context context, 
+                    const int64_t order,
+                    const int64_t* size);
+
+
+ +

+Allocates memory for a tensor. If the allocation failed, the size +is zero. +

+ +
+
qmckl_tensor
+qmckl_tensor_alloc( qmckl_context context, 
+                    const int64_t  order,
+                    const int64_t* size)
+{
+  /* Should always be true by contruction */
+  assert (order > 0);
+  assert (order <= QMCKL_TENSOR_ORDER_MAX);
+  assert (size  != NULL);
+
+  qmckl_tensor result;
+  result.order = order;
+
+  int64_t prod_size = (int64_t) 1;
+  for (int64_t i=0 ; i<order ; ++i) {
+    assert (size[i] > (int64_t) 0);
+    result.size[i] = size[i];
+    prod_size *= size[i];
+  }
+
+  qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
+  mem_info.size = prod_size * sizeof(double);
+
+  result.data = (double*) qmckl_malloc (context, mem_info);
+
+  if (result.data == NULL) {
+    memset(&result, 0, sizeof(qmckl_tensor));
+  }
+
+  return result;
+}
+
+
+ +
+
qmckl_exit_code
+qmckl_tensor_free( qmckl_context context, 
+                   qmckl_tensor tensor);
+
+
+ +
+
qmckl_exit_code
+qmckl_tensor_free( qmckl_context context, 
+                   qmckl_tensor tensor)
+{
+  /* Always true */
+  assert (tensor.data != NULL);
+
+  qmckl_exit_code rc;
+
+  rc = qmckl_free(context, tensor.data);
+  if (rc != QMCKL_SUCCESS) {
+    return rc;
+  }
+
+  memset(&tensor, 0, sizeof(qmckl_tensor));
+
+  return QMCKL_SUCCESS;
+}
+
+
+
+
+ +
+

1.4 Reshaping

+
+

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

+
+ +
+

1.4.1 Vector -> Matrix

+
+
+
qmckl_matrix
+qmckl_matrix_of_vector(const qmckl_vector vector,
+                       const int64_t size1,
+                       const int64_t size2);
+
+
+ +

+Reshapes a vector into a matrix. +

+ +
+
qmckl_matrix
+qmckl_matrix_of_vector(const qmckl_vector vector,
+                       const int64_t size1,
+                       const int64_t size2)
+{ 
+  /* Always true */
+  assert (size1 * size2 == vector.size);
+
+  qmckl_matrix result;
+
+  result.size[0] = size1;
+  result.size[1] = size2;
+  result.data    = vector.data;
+
+  return result;
+}
+
+
+
+
+ +
+

1.4.2 Vector -> Tensor

+
+
+
qmckl_tensor
+qmckl_tensor_of_vector(const qmckl_vector vector,
+                       const int64_t order,
+                       const int64_t* size);
+
+
+ +

+Reshapes a vector into a tensor. +

+ +
+
qmckl_tensor
+qmckl_tensor_of_vector(const qmckl_vector vector,
+                       const int64_t order,
+                       const int64_t* size)
+{ 
+  qmckl_tensor result;
+
+  int64_t prod_size = 1;
+  for (int64_t i=0 ; i<order ; ++i) {
+    result.size[i] = size[i];
+    prod_size *= size[i];
+  }
+  assert (prod_size == vector.size);
+
+  result.data = vector.data;
+
+  return result;
+}
+
+
+
+
+ +
+

1.4.3 Matrix -> Vector

+
+
+
qmckl_vector
+qmckl_vector_of_matrix(const qmckl_matrix matrix,
+                       const int64_t size);
+
+
+ +

+Reshapes a matrix into a vector. +

+ +
+
qmckl_vector
+qmckl_vector_of_matrix(const qmckl_matrix matrix,
+                       const int64_t size)
+{ 
+  /* Always true */
+  assert (matrix.size[0] * matrix.size[1] == size);
+
+  qmckl_vector result;
+
+  result.size = size;
+  result.data = matrix.data;
+
+  return result;
+}
+
+
+
+
+ +
+

1.4.4 Matrix -> Tensor

+
+
+
qmckl_tensor
+qmckl_tensor_of_matrix(const qmckl_matrix matrix,
+                       const int64_t order,
+                       const int64_t* size);
+
+
+ +

+Reshapes a matrix into a tensor. +

+ +
+
qmckl_tensor
+qmckl_tensor_of_matrix(const qmckl_matrix matrix,
+                       const int64_t order,
+                       const int64_t* size)
+{ 
+  qmckl_tensor result;
+
+  int64_t prod_size = 1;
+  for (int64_t i=0 ; i<order ; ++i) {
+    result.size[i] = size[i];
+    prod_size *= size[i];
+  }
+  assert (prod_size == matrix.size[0] * matrix.size[1]);
+
+  result.data = matrix.data;
+
+  return result;
+}
+
+
+
+
+ +
+

1.4.5 Tensor -> Vector

+
+
+
qmckl_vector
+qmckl_vector_of_tensor(const qmckl_tensor tensor,
+                       const int64_t size);
+
+
+ +

+Reshapes a tensor into a vector. +

+ +
+
qmckl_vector
+qmckl_vector_of_tensor(const qmckl_tensor tensor,
+                       const int64_t size)
+{ 
+  /* Always true */
+  int64_t prod_size = (int64_t) 1;
+  for (int64_t i=0 ; i<tensor.order ; i++) {
+    prod_size *= tensor.size[i];
+  }
+  assert (prod_size == size);
+
+  qmckl_vector result;
+
+  result.size = size;
+  result.data = tensor.data;
+
+  return result;
+}
+
+
+
+
+ +
+

1.4.6 Tensor -> Matrix

+
+
+
qmckl_matrix
+qmckl_matrix_of_tensor(const qmckl_tensor tensor,
+                       const int64_t size1,
+                       const int64_t size2);
+
+
+ +

+Reshapes a tensor into a vector. +

+ +
+
qmckl_matrix
+qmckl_matrix_of_tensor(const qmckl_tensor tensor,
+                       const int64_t size1,
+                       const int64_t size2)
+{ 
+  /* Always true */
+  int64_t prod_size = (int64_t) 1;
+  for (int64_t i=0 ; i<tensor.order ; i++) {
+    prod_size *= tensor.size[i];
+  }
+  assert (prod_size == size1 * size2);
+
+  qmckl_matrix result;
+
+  result.size[0] = size1;
+  result.size[1] = size2;
+  result.data = tensor.data;
+
+  return result;
+}
+
+
+
+
+
+ +
+

1.5 Access macros

+
+
+
#define qmckl_vec(v, i) v.data[i]
+#define qmckl_mat(m, i, j) m.data[(i) + (j)*m.size[0]]
+
+#define qmckl_ten3(t, i, j, k) t.data[(i) + m.size[0]*((j) + size[1]*(k))]
+#define qmckl_ten4(t, i, j, k, l) t.data[(i) + m.size[0]*((j) + size[1]*((k) + size[2]*(l)))]
+#define qmckl_ten5(t, i, j, k, l, m) t.data[(i) + m.size[0]*((j) + size[1]*((k) + size[2]*((l) + size[3]*(m))))]
+
+
+
+
+ +
+

1.6 Tests

+
+
+
{
+  int64_t m = 3;
+  int64_t n = 4;
+  int64_t p = m*n;
+  qmckl_vector vec = qmckl_vector_alloc(context, p);
+
+  for (int64_t i=0 ; i<p ; ++i) 
+    qmckl_vec(vec, i) = (double) i;
+
+  for (int64_t i=0 ; i<p ; ++i) 
+    assert( vec.data[i] == (double) i );
+
+  qmckl_matrix mat = qmckl_matrix_of_vector(vec, m, n);
+  assert (mat.size[0] == m);
+  assert (mat.size[1] == n);
+  assert (mat.data == vec.data);
+
+  for (int64_t j=0 ; j<n ; ++j)
+    for (int64_t i=0 ; i<m ; ++i)
+      assert ( qmckl_mat(mat, i, j) == qmckl_vec(vec, i+j*m)) ;
+
+  qmckl_vector vec2 = qmckl_vector_of_matrix(mat, p);
+  assert (vec2.size == p);
+  assert (vec2.data == vec.data);
+  for (int64_t i=0 ; i<p ; ++i) 
+      assert ( qmckl_vec(vec2, i) == qmckl_vec(vec, i) ) ;
+
+  qmckl_vector_free(context, vec);
+
+}
+
+
+
+
+
+
+

2 Matrix operations

+
+
+
+

2.1 qmckl_dgemm

+

Matrix multiplication:

@@ -360,7 +1042,7 @@ Matrix multiplication: \]

- +
@@ -580,9 +1262,9 @@ Requirements: -
-

1.2 qmckl_adjugate

-
+
+

2.2 qmckl_adjugate

+

Given a matrix \(\mathbf{A}\), the adjugate matrix \(\text{adj}(\mathbf{A})\) is the transpose of the cofactors matrix @@ -599,7 +1281,7 @@ of \(\mathbf{A}\). See also: https://en.wikipedia.org/wiki/Adjugate_matrix

-
+
@@ -855,7 +1537,7 @@ determinant with the inverse:

Author: TREX CoE

-

Created: 2022-01-17 Mon 15:13

+

Created: 2022-01-20 Thu 11:10

Validate

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

Table of Contents

-
-

1 Context handling

+
+

1 Context handling

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

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

-
-

1.1 Data structure

+
+

1.1 Data structure

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

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

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

1.2 Creation

+
+

1.2 Creation

To create a new context, qmckl_context_create() should be used. @@ -471,6 +471,9 @@ To create a new context, qmckl_context_create() should be used. ctx->numprec.precision = QMCKL_DEFAULT_PRECISION; ctx->numprec.range = QMCKL_DEFAULT_RANGE; + rc = qmckl_init_point(context); + assert (rc == QMCKL_SUCCESS); + rc = qmckl_init_electron(context); assert (rc == QMCKL_SUCCESS); @@ -508,8 +511,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 @@ -554,8 +557,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 @@ -603,8 +606,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. @@ -658,7 +661,7 @@ It frees the context, and returns the previous context.

Author: TREX CoE

-

Created: 2022-01-17 Mon 15:13

+

Created: 2022-01-20 Thu 11:10

Validate

diff --git a/qmckl_determinant.html b/qmckl_determinant.html index ba159b6..bb5bc53 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 @@ -311,32 +311,32 @@ for the JavaScript code in this tag.

Table of Contents

-
-

1 Context

+
+

1 Context

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

-
-

1.1 Data structure

+
+

1.1 Data structure

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

1.2 Access functions

+
+

1.2 Access functions

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

-
-

1.3 Initialization functions

+
+

1.3 Initialization functions

To set the basis set, all the following functions need to be @@ -638,24 +638,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);
@@ -665,14 +665,14 @@ computed to accelerate the calculations.
 
-
-

2.1.2 Provide

+
+

2.1.2 Provide

-
-

2.1.3 Compute alpha

+
+

2.1.3 Compute alpha

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

2.1.4 Compute beta

+
+

2.1.4 Compute beta

-
+
@@ -1023,18 +1023,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);
@@ -1048,14 +1048,14 @@ computed to accelerate the calculations.
 
-
-

2.2.2 Provide

+
+

2.2.2 Provide

-
-

2.2.3 Compute alpha

+
+

2.2.3 Compute alpha

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

2.2.4 Compute beta

+
+

2.2.4 Compute beta

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

Author: TREX CoE

-

Created: 2022-01-17 Mon 15:13

+

Created: 2022-01-20 Thu 11:10

Validate

diff --git a/qmckl_distance.html b/qmckl_distance.html index dd786db..4d49c4f 100644 --- a/qmckl_distance.html +++ b/qmckl_distance.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - +Inter-particle distances @@ -333,54 +333,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 @@ -393,7 +393,7 @@ between all pairs of points in two sets, one point within each set: \]

-
+
@@ -659,8 +659,8 @@ Requirements: -
-

1.1.1 Performance

+
+

1.1.1 Performance

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

-
-

2 Distance

+
+

2 Distance

-
-

2.1 qmckl_distance

+
+

2.1 qmckl_distance

qmckl_distance computes the matrix of the distances between all @@ -693,7 +693,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.

-
+
@@ -794,8 +794,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
  • @@ -813,8 +813,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 (
@@ -834,8 +834,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, &
@@ -1002,8 +1002,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. @@ -1013,12 +1013,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 @@ -1036,7 +1036,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.

- +
@@ -1144,8 +1144,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
  • @@ -1163,8 +1163,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 (
@@ -1185,8 +1185,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, &
@@ -1356,8 +1356,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. @@ -1366,12 +1366,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 @@ -1438,7 +1438,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.

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

Author: TREX CoE

-

Created: 2022-01-17 Mon 15:13

+

Created: 2022-01-20 Thu 11:10

Validate

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

Table of Contents

-
-

1 Context

+
+

1 Context

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

-
-

1.1 Data structure

+
+

1.1 Data structure

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

1.2 Access functions

+
+

1.2 Access functions

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

-
-

1.2.1 Number of electrons

+
+

1.2.1 Number of electrons

-
-

1.2.2 Number of walkers

+
+

1.2.2 Number of walkers

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

-
-

1.2.3 Scaling factors Kappa

+
+

1.2.3 Scaling factors Kappa

-
-

1.2.4 Electron coordinates

+
+

1.2.4 Electron coordinates

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

-
-

1.3 Initialization functions

+
+

1.3 Initialization functions

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

-
-

1.4 Test

+
+

1.4 Test

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

2.1.2 Compute

+
+

2.1.2 Compute

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

2.1.3 Test

+
+

2.1.3 Test

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

2.2 Electron-electron rescaled distances

+
+

2.2 Electron-electron rescaled distances

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

-
-

2.2.1 Get

+
+

2.2.1 Get

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

2.2.2 Compute

+
+

2.2.2 Compute

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

2.2.3 Test

+
+

2.2.3 Test

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

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

+
+

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

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

-
-

2.3.1 Get

+
+

2.3.1 Get

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

2.3.2 Compute

+
+

2.3.2 Compute

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

2.3.3 Test

+
+

2.3.3 Test

assert(qmckl_electron_provided(context));
@@ -1504,8 +1504,8 @@ rc = qmckl_get_electron_ee_distance_rescaled_deriv_e(context, ee_distance_rescal
 
-
-

2.4 Electron-electron potential

+
+

2.4 Electron-electron potential

ee_pot calculates the ee potential energy. @@ -1523,8 +1523,8 @@ distance.

-
-

2.4.1 Get

+
+

2.4.1 Get

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

2.4.2 Compute

+
+

2.4.2 Compute

-
+
@@ -1652,8 +1652,8 @@ distance. -
-

2.4.3 Test

+
+

2.4.3 Test

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

2.5 Electron-nucleus distances

+
+

2.5 Electron-nucleus distances

-
-

2.5.1 Get

+
+

2.5.1 Get

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

2.5.2 Compute

+
+

2.5.2 Compute

-
+
@@ -1807,8 +1807,8 @@ rc = qmckl_get_electron_ee_potential(context, &(ee_pot[0])); -
-

2.5.3 Test

+
+

2.5.3 Test

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

2.6 Electron-nucleus rescaled distances

+
+

2.6 Electron-nucleus rescaled distances

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

-
-

2.6.1 Get

+
+

2.6.1 Get

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

2.6.2 Compute

+
+

2.6.2 Compute

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

2.6.3 Test

+
+

2.6.3 Test

@@ -2077,8 +2077,8 @@ rc = qmckl_get_electron_en_distance_rescaled(context, &(en_distance_rescaled
 
-
-

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

+
+

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

-
-

2.7.1 Get

+
+

2.7.1 Get

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

2.7.2 Compute

+
+

2.7.2 Compute

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

2.7.3 Test

+
+

2.7.3 Test

@@ -2297,8 +2297,8 @@ rc = qmckl_get_electron_en_distance_rescaled_deriv_e(context, &(en_distance_
 
-
-

2.8 Electron-nucleus potential

+
+

2.8 Electron-nucleus potential

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

-
-

2.8.1 Get

+
+

2.8.1 Get

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

2.8.2 Compute

+
+

2.8.2 Compute

-
+
@@ -2463,8 +2463,8 @@ distance and \[Z_A\] is the nuclear charge. -
-

2.8.3 Test

+
+

2.8.3 Test

double en_pot[walk_num];
@@ -2477,14 +2477,14 @@ rc = qmckl_get_electron_en_potential(context, &(en_pot[0]));
 
-
-

2.9 Generate initial coordinates

+
+

2.9 Generate initial coordinates

Author: TREX CoE

-

Created: 2022-01-17 Mon 15:13

+

Created: 2022-01-20 Thu 11:10

Validate

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

Table of Contents

-
-

1 Decoding errors

+
+

1 Decoding errors

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

-
-

2 Data structure in context

+
+

2 Data structure in context

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

-
-

3 Updating errors in the context

+
+

3 Updating errors in the context

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

-
-

4 Get the error

+
+

4 Get the error

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

-
-

5 Failing

+
+

5 Failing

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

Author: TREX CoE

-

Created: 2022-01-17 Mon 15:13

+

Created: 2022-01-20 Thu 11:10

Validate

diff --git a/qmckl_jastrow.html b/qmckl_jastrow.html index 9a02c62..b25fcc2 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 @@ -333,100 +333,100 @@ for the JavaScript code in this tag.

Table of Contents

-
-

1 Context

+
+

1 Context

The following data stored in the context:

-
+
@@ -770,7 +770,7 @@ For H2O we have the following data:

-
import numpy as np
+
import numpy as np
 
 elec_num     = 10
 nucl_num     = 2
@@ -920,8 +920,8 @@ For H2O we have the following data:
 
-
-

1.1 Data structure

+
+

1.1 Data structure

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

1.2 Access functions

+
+

1.2 Access functions

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

-
-

1.3 Initialization functions

+
+

1.3 Initialization functions

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

-
-

1.4 Test

+
+

1.4 Test

/* Reference input data */
@@ -1232,8 +1232,8 @@ rc = qmckl_get_nucleus_charge(context, nucl_charge2);
 
-
-

2 Computation

+
+

2 Computation

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

-
-

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

+
+

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

Calculate the asymptotic component asymp_jasb to be substracted from the final @@ -1262,8 +1262,8 @@ via the bord_vector and the electron-electron rescale factor

-
-

2.1.1 Get

+
+

2.1.1 Get

qmckl_exit_code qmckl_get_jastrow_asymp_jasb(qmckl_context context, double* const asymp_jasb);
@@ -1272,10 +1272,10 @@ via the bord_vector and the electron-electron rescale factor 
 
-
-

2.1.2 Compute

+
+

2.1.2 Compute

-
+
@@ -1388,8 +1388,8 @@ via the bord_vector and the electron-electron rescale factor -
-

2.1.3 Test

+
+

2.1.3 Test

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

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

+
+

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

Calculate the electron-electron jastrow component factor_ee using the asymp_jasb @@ -1457,8 +1457,8 @@ f_{ee} = \sum_{i,j -

-

2.2.1 Get

+
+

2.2.1 Get

qmckl_exit_code qmckl_get_jastrow_factor_ee(qmckl_context context, double* const factor_ee);
@@ -1467,10 +1467,10 @@ f_{ee} = \sum_{i,j
 
-
-

2.2.2 Compute

+
+

2.2.2 Compute

-
+
@@ -1645,8 +1645,8 @@ f_{ee} = \sum_{i,j -
-

2.2.3 Test

+
+

2.2.3 Test

/* Check if Jastrow is properly initialized */
@@ -1664,8 +1664,8 @@ rc = qmckl_get_jastrow_factor_ee(context, factor_ee);
 
-
-

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

+
+

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

Calculate the derivative of the factor_ee using the ee_distance_rescaled and @@ -1680,8 +1680,8 @@ TODO: Add equation

-
-

2.3.1 Get

+
+

2.3.1 Get

qmckl_exit_code qmckl_get_jastrow_factor_ee_deriv_e(qmckl_context context, double* const factor_ee_deriv_e);
@@ -1690,10 +1690,10 @@ TODO: Add equation
 
-
-

2.3.2 Compute

+
+

2.3.2 Compute

-
+
@@ -1908,8 +1908,8 @@ TODO: Add equation -
-

2.3.3 Test

+
+

2.3.3 Test

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

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

+
+

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

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

-

2.4.1 Get

+
+

2.4.1 Get

qmckl_exit_code qmckl_get_jastrow_factor_en(qmckl_context context, double* const factor_en);
@@ -1957,10 +1957,10 @@ f_{en} = \sum_{i,j
 
-
-

2.4.2 Compute

+
+

2.4.2 Compute

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

2.4.3 Test

+
+

2.4.3 Test

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

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

+
+

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

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

-
-

2.5.1 Get

+
+

2.5.1 Get

qmckl_exit_code qmckl_get_jastrow_factor_en_deriv_e(qmckl_context context, double* const factor_en_deriv_e);
@@ -2185,10 +2185,10 @@ TODO: write equations.
 
-
-

2.5.2 Compute

+
+

2.5.2 Compute

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

2.5.3 Test

+
+

2.5.3 Test

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

2.6 Electron-electron rescaled distances for each order

+
+

2.6 Electron-electron rescaled distances for each order

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

-
-

2.6.1 Get

+
+

2.6.1 Get

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

2.6.2 Compute

+
+

2.6.2 Compute

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

2.6.3 Test

+
+

2.6.3 Test

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

2.7 Electron-electron rescaled distances for each order and derivatives

+
+

2.7 Electron-electron rescaled distances for each order and derivatives

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

-
-

2.7.1 Get

+
+

2.7.1 Get

qmckl_exit_code qmckl_get_jastrow_een_rescaled_e_deriv_e(qmckl_context context, double* const distance_rescaled);
@@ -2688,10 +2688,10 @@ TODO: write formulae
 
-
-

2.7.2 Compute

+
+

2.7.2 Compute

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

2.7.3 Test

+
+

2.7.3 Test

//assert(qmckl_electron_provided(context));
@@ -2899,8 +2899,8 @@ rc = qmckl_get_jastrow_een_rescaled_e_deriv_e(context, &(een_rescaled_e_deri
 
-
-

2.8 Electron-nucleus rescaled distances for each order

+
+

2.8 Electron-nucleus rescaled distances for each order

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

-
-

2.8.1 Get

+
+

2.8.1 Get

qmckl_exit_code qmckl_get_jastrow_een_rescaled_n(qmckl_context context, double* const distance_rescaled);
@@ -2928,10 +2928,10 @@ where \(C_{ia}\) is the matrix of electron-nucleus distances.
 
-
-

2.8.2 Compute

+
+

2.8.2 Compute

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

2.8.3 Test

+
+

2.8.3 Test

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

2.9 Electron-nucleus rescaled distances for each order and derivatives

+
+

2.9 Electron-nucleus rescaled distances for each order and derivatives

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

-
-

2.9.1 Get

+
+

2.9.1 Get

qmckl_exit_code qmckl_get_jastrow_een_rescaled_n_deriv_e(qmckl_context context, double* const distance_rescaled);
@@ -3138,10 +3138,10 @@ electrons and nucleii raised to the power \(p\) defined by cord_num
 
-
-

2.9.2 Compute

+
+

2.9.2 Compute

-
+
@@ -3351,8 +3351,8 @@ electrons and nucleii raised to the power \(p\) defined by cord_num -
-

2.9.3 Test

+
+

2.9.3 Test

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

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

+
+

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

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

-
-

2.10.1 Get

+
+

2.10.1 Get

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

2.10.2 Compute dimcordvect

+
+

2.10.2 Compute dimcordvect

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

2.10.3 Compute cordvectfull

+
+

2.10.3 Compute cordvectfull

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

2.10.4 Compute lkpmcombinedindex

+
+

2.10.4 Compute lkpmcombinedindex

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

2.10.5 Test

+
+

2.10.5 Test

//assert(qmckl_electron_provided(context));
@@ -3768,8 +3768,8 @@ calculation of the three-body jastrow factor_een and its derivative
 
-
-

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

+
+

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

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

-
-

2.11.1 Get

+
+

2.11.1 Get

qmckl_exit_code qmckl_get_jastrow_factor_een(qmckl_context context, double* const factor_een);
@@ -3791,10 +3791,10 @@ TODO: write equations.
 
-
-

2.11.2 Compute

+
+

2.11.2 Compute

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

2.11.3 Test

+
+

2.11.3 Test

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

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

+
+

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

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

-
-

2.12.1 Get

+
+

2.12.1 Get

qmckl_exit_code qmckl_get_jastrow_factor_een_deriv_e(qmckl_context context, double* const factor_een_deriv_e);
@@ -4030,10 +4030,10 @@ TODO: write equations.
 
-
-

2.12.2 Compute

+
+

2.12.2 Compute

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

2.12.3 Test

+
+

2.12.3 Test

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

Author: TREX CoE

-

Created: 2022-01-17 Mon 15:13

+

Created: 2022-01-20 Thu 11:10

Validate

diff --git a/qmckl_local_energy.html b/qmckl_local_energy.html index 44ca55b..e9a1d8c 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 @@ -333,43 +333,43 @@ for the JavaScript code in this tag.

Table of Contents

-
-

1 Context

+
+

1 Context

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

-
-

1.1 Data structure

+
+

1.1 Data structure

typedef struct qmckl_local_energy_struct {
@@ -488,12 +488,12 @@ this mechanism.
 
-
-

2 Computation

+
+

2 Computation

-
-

2.1 Kinetic energy

+
+

2.1 Kinetic energy

Where the kinetic energy is given as: @@ -517,8 +517,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);
@@ -527,14 +527,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

- +
@@ -763,12 +763,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 @@ -804,8 +804,8 @@ contributions.

-
-

2.2.1 Get

+
+

2.2.1 Get

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

2.2.2 Provide

+
+

2.2.2 Provide

-
-

2.2.3 Compute potential enregy

+
+

2.2.3 Compute potential enregy

-
+
@@ -949,12 +949,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. @@ -968,8 +968,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);
@@ -978,14 +978,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

-
+
@@ -1081,12 +1081,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 @@ -1100,8 +1100,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);
@@ -1110,14 +1110,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

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

2.4.4 Test

+
+

2.4.4 Test

Author: TREX CoE

-

Created: 2022-01-17 Mon 15:13

+

Created: 2022-01-20 Thu 11:10

Validate

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

Table of Contents

-
-

1 Memory data structure for the context

+
+

1 Memory data structure for the context

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

-
-

2 Passing info to allocation routines

+
+

2 Passing info to allocation routines

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

-
-

3 Allocation/deallocation functions

+
+

3 Allocation/deallocation functions

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

Author: TREX CoE

-

Created: 2022-01-17 Mon 15:13

+

Created: 2022-01-20 Thu 11:10

Validate

diff --git a/qmckl_mo.html b/qmckl_mo.html index c201fab..f0781fd 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 @@ -311,21 +311,21 @@ for the JavaScript code in this tag.

Table of Contents

-
-

1 Context

+
+

1 Context

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

-
-

1.1 Data structure

+
+

1.1 Data structure

typedef struct qmckl_mo_basis_struct {
@@ -447,8 +447,8 @@ this mechanism.
 
-
-

1.2 Access functions

+
+

1.2 Access functions

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

-
-

1.3 Initialization functions

+
+

1.3 Initialization functions

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

-
-

2 Computation

+
+

2 Computation

-
-

2.1 Computation of MOs

+
+

2.1 Computation of MOs

-
-

2.1.1 Get

+
+

2.1.1 Get

qmckl_exit_code qmckl_get_mo_basis_vgl(qmckl_context context, double* const mo_vgl);
@@ -502,14 +502,14 @@ computed to accelerate the calculations.
 
-
-

2.1.2 Provide

+
+

2.1.2 Provide

-
-

2.1.3 Compute

+
+

2.1.3 Compute

- +
@@ -667,15 +667,15 @@ computed to accelerate the calculations. -
-

2.1.4 Test

+
+

2.1.4 Test

Author: TREX CoE

-

Created: 2022-01-17 Mon 15:13

+

Created: 2022-01-20 Thu 11:10

Validate

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

Table of Contents

-
-

1 Context

+
+

1 Context

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

-
-

1.1 Data structure

+
+

1.1 Data structure

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

1.2 Access functions

+
+

1.2 Access functions

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

-
-

1.3 Initialization functions

+
+

1.3 Initialization functions

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

-
-

1.4 Test

+
+

1.4 Test

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

2 Computation

+
+

2 Computation

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

-
-

2.1 Nucleus-nucleus distances

+
+

2.1 Nucleus-nucleus distances

-
-

2.1.1 Get

+
+

2.1.1 Get

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

2.1.2 Compute

+
+

2.1.2 Compute

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

2.1.3 Test

+
+

2.1.3 Test

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

2.2 Nucleus-nucleus rescaled distances

+
+

2.2 Nucleus-nucleus rescaled distances

-
-

2.2.1 Get

+
+

2.2.1 Get

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

2.2.2 Compute

+
+

2.2.2 Compute

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

2.2.3 Test

+
+

2.2.3 Test

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

2.3 Nuclear repulsion energy

+
+

2.3 Nuclear repulsion energy

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

-
-

2.3.1 Get

+
+

2.3.1 Get

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

2.3.2 Compute

+
+

2.3.2 Compute

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

2.3.3 Test

+
+

2.3.3 Test

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

Author: TREX CoE

-

Created: 2022-01-17 Mon 15:13

+

Created: 2022-01-20 Thu 11:10

Validate

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

Table of Contents

-
-

1 Control of the numerical precision

+
+

1 Control of the numerical precision

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

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

2 Precision

+
+

2 Precision

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

-
-

3 Range

+
+

3 Range

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

-
-

4 Helper functions

+
+

4 Helper functions

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

Author: TREX CoE

-

Created: 2022-01-17 Mon 15:13

+

Created: 2022-01-20 Thu 11:10

Validate

diff --git a/qmckl_point.html b/qmckl_point.html new file mode 100644 index 0000000..ac91d75 --- /dev/null +++ b/qmckl_point.html @@ -0,0 +1,825 @@ + + + + + + + +Point + + + + + + + + + + + +
+ UP + | + HOME +
+

Point

+ + +
+

1 Context

+
+

+The following data stored in the context: +

+ +
+ + +++ ++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VariableTypeDescription
numint64_tTotal number of points
coord_xdouble[num]X coordinates
coord_ydouble[num]Y coordinates
coord_zdouble[num]Z coordinates
+ +

+We consider that 'transposed' and 'normal' storage follows the convention: +

+ + + + +++ ++ ++ + + + + + + + + + + + + + + + + + + + + +
 NormalTransposed
C[point_num][3][3][point_num]
Fortran(3,point_num)(point_num,3)
+
+ +
+

1.1 Data structure

+
+
+
typedef struct qmckl_point_struct {
+  double*   coord_x;
+  double*   coord_y;
+  double*   coord_z;
+  int64_t   num;
+} qmckl_point_struct;
+
+
+
+ +
+
qmckl_exit_code qmckl_init_point(qmckl_context context);
+
+
+ +
+
qmckl_exit_code qmckl_init_point(qmckl_context context) {
+
+  if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
+    return false;
+  }
+
+  qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
+  assert (ctx != NULL);
+
+  qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
+  mem_info.size = sizeof(qmckl_point_struct);
+  ctx->point = (qmckl_point_struct*) qmckl_malloc(context, mem_info);
+  if (ctx->point == NULL) {
+    return qmckl_failwith( context,
+                           QMCKL_ALLOCATION_FAILED,
+                           "qmckl_init_point",
+                           NULL);
+  }
+  memset(ctx->point, 0, sizeof(qmckl_point_struct)); 
+
+  return QMCKL_SUCCESS;
+}
+
+
+
+
+ +
+

1.2 Access functions

+
+

+Access functions return QMCKL_SUCCESS when the data has been +successfully retrieved. They return QMCKL_INVALID_CONTEXT when +the context is not a valid context. If the function returns +successfully, the variable pointed by the pointer given in argument +contains the requested data. Otherwise, this variable is untouched. +

+
+ +
+

1.2.1 Number of points

+
+

+Returns the number of points stored in the context. +

+ +
+
interface
+  integer(c_int32_t) function qmckl_get_point_num(context, num) bind(C)
+    use, intrinsic :: iso_c_binding
+    import
+    implicit none
+
+    integer (c_int64_t) , intent(in)  , value :: context                                  
+    integer (c_int64_t) , intent(out)         :: num 
+  end function
+end interface
+
+
+
+
+ +
+

1.2.2 Point coordinates

+
+

+Returns the point coordinates as sequences of (x,y,z). +The pointer is assumed to point on a memory block of size +size_max3 * point_num. +

+ +
+
interface
+  integer(c_int32_t) function qmckl_get_point(context, coord, size_max) bind(C)
+    use, intrinsic :: iso_c_binding
+    import
+    implicit none
+
+    integer (c_int64_t) , intent(in)  , value :: context
+    real    (c_double ) , intent(out)         :: coord(*)
+    integer (c_int64_t) , intent(in)          :: size_max
+  end function
+end interface
+
+
+ + +

+Returns the point coordinates in three different arrays, one for +each component x,y,z. +The pointers are assumed to point on a memory block of size +size_maxpoint_num. +

+ +
+
interface
+  integer(c_int32_t) function qmckl_get_point_xyz(context, &
+       coord_x, coord_y, coord_z, size_max) bind(C)
+    use, intrinsic :: iso_c_binding
+    import
+    implicit none
+
+    integer (c_int64_t) , intent(in)  , value :: context
+    real    (c_double ) , intent(out)         :: coord_x(*)
+    real    (c_double ) , intent(out)         :: coord_y(*)
+    real    (c_double ) , intent(out)         :: coord_z(*)
+    integer (c_int64_t) , intent(in)          :: size_max
+  end function
+end interface
+
+
+
+
+
+ +
+

1.3 Initialization functions

+
+

+When the data is set in the context, if the arrays are large +enough, we overwrite the data contained in them. +

+ +

+To set the data relative to the points in the context, one of the +following functions need to be called. +

+ +
+
qmckl_exit_code qmckl_set_point (qmckl_context context,
+                                 const double* coord,
+                                 const int64_t num);
+
+
+ +

+Copy a sequence of (x,y,z) into the context. +

+ +
+
qmckl_exit_code
+qmckl_set_point (qmckl_context context,
+                 const double* coord,
+                 const int64_t num)
+{
+
+  if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
+    return QMCKL_NULL_CONTEXT;
+  }
+
+  qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
+  assert (ctx != NULL);
+  assert (ctx->point != NULL);
+
+  if (ctx->point->num < num) {
+
+    if (ctx->point->coord_x != NULL) {
+      qmckl_free(context, ctx->point->coord_x);
+      ctx->point->coord_x = NULL;
+    }
+
+    if (ctx->point->coord_y != NULL) {
+      qmckl_free(context, ctx->point->coord_y);
+      ctx->point->coord_y = NULL;
+    }
+
+    if (ctx->point->coord_z != NULL) {
+      qmckl_free(context, ctx->point->coord_z);
+      ctx->point->coord_z = NULL;
+    }
+
+    qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
+    mem_info.size = num*sizeof(double);
+
+    ctx->point->coord_x = (double*) qmckl_malloc(context, mem_info);
+    if (ctx->point->coord_x == NULL) {
+      return qmckl_failwith( context,
+                             QMCKL_ALLOCATION_FAILED,
+                             "qmckl_set_point",
+                             NULL);
+    }
+
+    ctx->point->coord_y = (double*) qmckl_malloc(context, mem_info);
+    if (ctx->point->coord_y == NULL) {
+      return qmckl_failwith( context,
+                             QMCKL_ALLOCATION_FAILED,
+                             "qmckl_set_point",
+                             NULL);
+    }
+
+    ctx->point->coord_z = (double*) qmckl_malloc(context, mem_info);
+    if (ctx->point->coord_z == NULL) {
+      return qmckl_failwith( context,
+                             QMCKL_ALLOCATION_FAILED,
+                             "qmckl_set_point",
+                             NULL);
+    }
+  };
+
+  ctx->point->num = num;
+
+  for (int64_t i=0 ; i<num ; ++i) {
+    ctx->point->coord_x[i] = coord[3*i  ];
+    ctx->point->coord_y[i] = coord[3*i+1];
+    ctx->point->coord_z[i] = coord[3*i+2];
+  }
+
+  return QMCKL_SUCCESS;
+
+}
+
+
+ +
+
interface
+  integer(c_int32_t) function qmckl_set_point(context, &
+       coord_x, coord_y, coord_z, size_max) bind(C)
+    use, intrinsic :: iso_c_binding
+    import
+    implicit none
+
+    integer (c_int64_t) , intent(in)  , value :: context
+    real    (c_double ) , intent(in)          :: coord_x(*)
+    real    (c_double ) , intent(in)          :: coord_y(*)
+    real    (c_double ) , intent(in)          :: coord_z(*)
+    integer (c_int64_t) , intent(in)  , value :: size_max
+  end function
+end interface
+
+
+ +
+
qmckl_exit_code qmckl_set_point_xyz (qmckl_context context,
+                                 const double* coord_x,
+                                 const double* coord_y,
+                                 const double* coord_z,
+                                 const int64_t num);
+
+
+ +
+
qmckl_exit_code
+qmckl_set_point_xyz (qmckl_context context,
+                     const double* coord_x,
+                     const double* coord_y,
+                     const double* coord_z,
+                     const int64_t num)
+{
+
+  if (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
+    return QMCKL_NULL_CONTEXT;
+  }
+
+  qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
+  assert (ctx != NULL);
+  assert (ctx->point != NULL);
+
+  if (ctx->point->num < num) {
+
+    if (ctx->point->coord_x != NULL) {
+      qmckl_free(context, ctx->point->coord_x);
+      ctx->point->coord_x = NULL;
+    }
+
+    if (ctx->point->coord_y != NULL) {
+      qmckl_free(context, ctx->point->coord_y);
+      ctx->point->coord_y = NULL;
+    }
+
+    if (ctx->point->coord_z != NULL) {
+      qmckl_free(context, ctx->point->coord_z);
+      ctx->point->coord_z = NULL;
+    }
+
+    qmckl_memory_info_struct mem_info = qmckl_memory_info_struct_zero;
+    mem_info.size = num*sizeof(double);
+
+    ctx->point->coord_x = (double*) qmckl_malloc(context, mem_info);
+    if (ctx->point->coord_x == NULL) {
+      return qmckl_failwith( context,
+                             QMCKL_ALLOCATION_FAILED,
+                             "qmckl_set_point",
+                             NULL);
+    }
+
+    ctx->point->coord_y = (double*) qmckl_malloc(context, mem_info);
+    if (ctx->point->coord_y == NULL) {
+      return qmckl_failwith( context,
+                             QMCKL_ALLOCATION_FAILED,
+                             "qmckl_set_point",
+                             NULL);
+    }
+
+    ctx->point->coord_z = (double*) qmckl_malloc(context, mem_info);
+    if (ctx->point->coord_z == NULL) {
+      return qmckl_failwith( context,
+                             QMCKL_ALLOCATION_FAILED,
+                             "qmckl_set_point",
+                             NULL);
+    }
+  };
+
+  ctx->point->num = num;
+
+  memcpy(ctx->point->coord_x, coord_x, num*sizeof(double));
+  memcpy(ctx->point->coord_y, coord_y, num*sizeof(double));
+  memcpy(ctx->point->coord_z, coord_z, num*sizeof(double));
+
+  return QMCKL_SUCCESS;
+}
+
+
+ +
+
interface
+  integer(c_int32_t) function qmckl_set_point_xyz(context, &
+       coord_x, coord_y, coord_z, size_max) bind(C)
+    use, intrinsic :: iso_c_binding
+    import
+    implicit none
+
+    integer (c_int64_t) , intent(in)  , value :: context
+    real    (c_double ) , intent(in)          :: coord_x(*)
+    real    (c_double ) , intent(in)          :: coord_y(*)
+    real    (c_double ) , intent(in)          :: coord_z(*)
+    integer (c_int64_t) , intent(in)  , value :: size_max
+  end function
+end interface
+
+
+
+
+ +
+

1.4 Test

+
+
+
/* Reference input data */
+int64_t point_num = chbrclf_elec_num;
+double* coord     = &(chbrclf_elec_coord[0][0][0]);
+
+/* --- */
+
+qmckl_exit_code rc;
+
+rc = qmckl_set_point (context, coord, point_num);
+assert(rc == QMCKL_SUCCESS);
+
+int64_t n;
+rc = qmckl_get_point_num (context, &n);
+assert(rc == QMCKL_SUCCESS);
+assert(n == point_num);
+
+double coord2[point_num*3];
+double coord_x[point_num];
+double coord_y[point_num];
+double coord_z[point_num];
+
+rc = qmckl_get_point_xyz (context, coord_x, coord_y, coord_z, point_num);
+assert(rc == QMCKL_SUCCESS);
+
+rc = qmckl_get_point (context, coord2, (point_num*3));
+assert(rc == QMCKL_SUCCESS);
+
+for (int64_t i=0 ; i<3*point_num ; ++i) {
+  assert( coord[i] == coord2[i] );
+}
+
+for (int64_t i=0 ; i<point_num ; ++i) {
+  assert( coord[3*i+0] == coord_x[i] );
+  assert( coord[3*i+1] == coord_y[i] );
+  assert( coord[3*i+2] == coord_z[i] );
+}
+
+
+
+
+
+
+
+
+

Author: TREX CoE

+

Created: 2022-01-20 Thu 11:10

+

Validate

+
+ + diff --git a/qmckl_sherman_morrison_woodbury.html b/qmckl_sherman_morrison_woodbury.html index 069ee78..9e5aa4d 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 @@ -333,86 +333,86 @@ for the JavaScript code in this tag.

Table of Contents

-
-

1 Headers

+
+

1 Headers

#include "qmckl.h"
@@ -431,12 +431,12 @@ for the JavaScript code in this tag.
 
-
-

2 Naïve Sherman-Morrison

+
+

2 Naïve Sherman-Morrison

-
-

2.1 qmckl_sherman_morrison

+
+

2.1 qmckl_sherman_morrison

This is the simplest of the available Sherman-Morrison-Woodbury kernels. It applies rank-1 updates one by one in @@ -478,7 +478,7 @@ If the determinant of the Slater-matrix is passed, it will be updated to the det from applying the updates to the original matrix.

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

2.1.1 Requirements

+
+

2.1.1 Requirements

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

2.1.2 C header

+
+

2.1.2 C header

qmckl_exit_code qmckl_sherman_morrison (
@@ -592,8 +592,8 @@ from applying the updates to the original matrix.
 
-
-

2.1.3 C source

+
+

2.1.3 C source

#include <stdbool.h>
@@ -663,8 +663,8 @@ from applying the updates to the original matrix.
 
-
-

2.1.4 Performance

+
+

2.1.4 Performance

This function performs best when there is only 1 rank-1 update in the update cycle. It is not useful to @@ -676,12 +676,12 @@ where applying the update causes singular behaviour.

-
-

3 Woodbury 2x2

+
+

3 Woodbury 2x2

-
-

3.1 qmckl_woodbury_2

+
+

3.1 qmckl_woodbury_2

The Woodbury 2x2 kernel. It is used to apply two rank-1 updates at once. The formula used in @@ -705,7 +705,7 @@ from applying the updates to the original matrix. - +
@@ -777,8 +777,8 @@ from applying the updates to the original matrix.

-
-

3.1.1 Requirements

+
+

3.1.1 Requirements

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

3.1.2 C header

+
+

3.1.2 C header

qmckl_exit_code qmckl_woodbury_2 (
@@ -810,8 +810,8 @@ from applying the updates to the original matrix.
 
-
-

3.1.3 C source

+
+

3.1.3 C source

#include <stdbool.h>
@@ -898,8 +898,8 @@ from applying the updates to the original matrix.
 
-
-

3.1.4 Performance

+
+

3.1.4 Performance

This function is most efficient when used in cases where there are only 2 rank-1 updates and @@ -910,12 +910,12 @@ it is sure they will not result in a singular matrix.

-
-

4 Woodbury 3x3

+
+

4 Woodbury 3x3

-
-

4.1 qmckl_woodbury_3

+
+

4.1 qmckl_woodbury_3

The 3x3 version of the Woodbury 2x2 kernel. It is used to apply three @@ -936,7 +936,7 @@ from applying the updates to the original matrix. - +
@@ -1008,8 +1008,8 @@ from applying the updates to the original matrix.

-
-

4.1.1 Requirements

+
+

4.1.1 Requirements

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

4.1.2 C header

+
+

4.1.2 C header

qmckl_exit_code qmckl_woodbury_3 (
@@ -1041,8 +1041,8 @@ from applying the updates to the original matrix.
 
-
-

4.1.3 C source

+
+

4.1.3 C source

#include <stdbool.h>
@@ -1144,8 +1144,8 @@ from applying the updates to the original matrix.
 
-
-

4.1.4 Performance…

+
+

4.1.4 Performance…

This function is most efficient when used in cases where there are only 3 rank-1 updates and @@ -1156,12 +1156,12 @@ it is sure they will not result in a singular matrix.

-
-

5 Sherman-Morrison with update splitting

+
+

5 Sherman-Morrison with update splitting

-
-

5.1 qmckl_sherman_morrison_splitting

+
+

5.1 qmckl_sherman_morrison_splitting

This is a variation on the 'Naive' Sherman-Morrison kernel. Whenever the denominator \(1+v_j^T S^{-1} u_j\) in @@ -1183,7 +1183,7 @@ If the determinant of the Slater-matrix is passed, it will be updated to the det from applying the updates to the original matrix.

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

5.1.1 Requirements

+
+

5.1.1 Requirements

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

5.1.2 C header

+
+

5.1.2 C header

qmckl_exit_code qmckl_sherman_morrison_splitting (
@@ -1302,8 +1302,8 @@ from applying the updates to the original matrix.
 
-
-

5.1.3 C source

+
+

5.1.3 C source

#include <stdbool.h>
@@ -1343,8 +1343,8 @@ from applying the updates to the original matrix.
 
-
-

5.1.4 Performance…

+
+

5.1.4 Performance…

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

-
-

6 Woodbury 3x3 and 2x2 with Sherman-Morrison and update splitting

+
+

6 Woodbury 3x3 and 2x2 with Sherman-Morrison and update splitting

-
-

6.1 qmckl_sherman_morrison_smw32s

+
+

6.1 qmckl_sherman_morrison_smw32s

The Woodbury 3x3 and 2x2 kernel with Sherman-Morrison and update splitting combines the low-level Woodbury 3x3 kernel, @@ -1374,7 +1374,7 @@ If the determinant of the Slater-matrix is passed, it will be updated to the det from applying the updates to the original matrix.

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

6.1.1 Requirements

+
+

6.1.1 Requirements

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

6.1.2 C header

+
+

6.1.2 C header

qmckl_exit_code qmckl_sherman_morrison_smw32s (
@@ -1489,8 +1489,8 @@ from applying the updates to the original matrix.
 
-
-

6.1.3 C source

+
+

6.1.3 C source

#include <stdbool.h>
@@ -1568,8 +1568,8 @@ from applying the updates to the original matrix.
 
-
-

6.1.4 Performance…

+
+

6.1.4 Performance…

This kernel performs best for update cycles with 2 or more rank-1 updates and the fail-rate is low. @@ -1579,8 +1579,8 @@ This kernel performs best for update cycles with 2 or more rank-1 updates and th

-
-

7 Helper Functions

+
+

7 Helper Functions

Private helper-functions that are used by the Sherman-Morrison-Woodbury kernels. @@ -1588,8 +1588,8 @@ These functions can only be used internally by the kernels in this module.

-
-

7.1 qmckl_slagel_splitting

+
+

7.1 qmckl_slagel_splitting

qmckl_slagel_splitting is the non-recursive, inner part of the 'Sherman-Morrison with update splitting'-kernel. @@ -1609,7 +1609,7 @@ If the determinant of the Slater-matrix is passed, it will be updated to the det from applying the updates to the original matrix.

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

7.1.1 Requirements

+
+

7.1.1 Requirements

  • LDS >= 2
  • @@ -1721,8 +1721,8 @@ from applying the updates to the original matrix.
-
-

7.1.2 C header

+
+

7.1.2 C header

double qmckl_slagel_splitting (
@@ -1742,8 +1742,8 @@ from applying the updates to the original matrix.
 
-
-

7.1.3 C source

+
+

7.1.3 C source

#include <stdbool.h>
@@ -1821,8 +1821,8 @@ from applying the updates to the original matrix.
 
-
-

7.1.4 Performance

+
+

7.1.4 Performance

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

-
-

8 End of files

+
+

8 End of files

  assert (qmckl_context_destroy(context) == QMCKL_SUCCESS);
@@ -1848,7 +1848,7 @@ with Sherman-Morrison and update splitting. Please look at the performance recco
 

Author: TREX CoE

-

Created: 2022-01-17 Mon 15:13

+

Created: 2022-01-20 Thu 11:10

Validate

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

Table of Contents

-
-

1 CHBrClF

+
+

1 CHBrClF

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

-
-

1.1 XYZ coordinates

+
+

1.1 XYZ coordinates

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

1.2 Atomic basis set

+
+

1.2 Atomic basis set

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

1.3 Molecular orbitals

+
+

1.3 Molecular orbitals

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

1.4 Electron coordinates

+
+

1.4 Electron coordinates

Electron coordinates are stored in atomic units in normal format. @@ -60373,8 +60373,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 @@ -60415,8 +60415,8 @@ treated by pseudopotentials thus excluded from the actual calculation.

-
-

2.1 XYZ coordinates

+
+

2.1 XYZ coordinates

   2
@@ -60443,8 +60443,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. @@ -60473,8 +60473,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 @@ -60573,7 +60573,7 @@ Ramon Panades Baruetta.

-

Created: 2022-01-17 Mon 15:13

+

Created: 2022-01-20 Thu 11:10

Validate

diff --git a/qmckl_trexio.html b/qmckl_trexio.html index 131823a..43e45b2 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 @@ -311,53 +311,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 @@ -390,8 +390,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 @@ -423,8 +423,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. @@ -475,8 +475,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. @@ -496,8 +496,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;
@@ -520,8 +520,8 @@ rc = qmckl_set_nucleus_num(context, nucleus_num);
 
-
-

1.3.2 Nuclear charges

+
+

1.3.2 Nuclear charges

{
@@ -562,8 +562,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 @@ -619,8 +619,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. @@ -646,8 +646,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
@@ -678,8 +678,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;
@@ -703,8 +703,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;
@@ -728,8 +728,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;
@@ -753,8 +753,8 @@ rc = qmckl_set_ao_basis_ao_num(context, ao_num);
 
-
-

1.4.5 Nucleusindex array

+
+

1.4.5 Nucleusindex array

{
@@ -836,8 +836,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

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

1.4.7 Angular momentum

+
+

1.4.7 Angular momentum

{
@@ -968,8 +968,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

{
@@ -1053,8 +1053,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

{
@@ -1134,8 +1134,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

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

1.4.11 Exponents

+
+

1.4.11 Exponents

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

1.4.12 Coefficients

+
+

1.4.12 Coefficients

{
@@ -1272,8 +1272,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

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

1.4.14 AO Normalization

+
+

1.4.14 AO Normalization

{
@@ -1374,8 +1374,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. @@ -1401,8 +1401,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;
@@ -1425,8 +1425,8 @@ rc = qmckl_set_mo_basis_mo_num(context, mo_num);
 
-
-

1.5.2 MO coefficients

+
+

1.5.2 MO coefficients

{
@@ -1475,12 +1475,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 qmckl_trexio_read(const qmckl_context context, const char* file_name);
@@ -1561,8 +1561,8 @@ rc = qmckl_set_mo_basis_mo_num(context, mo_num);
 
-
-

3 Test

+
+

3 Test

#ifdef HAVE_TREXIO
@@ -1596,8 +1596,8 @@ rc = qmckl_trexio_read(context, fname);
 
-
-

3.0.1 Electrons

+
+

3.0.1 Electrons

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

3.0.2 Nuclei

+
+

3.0.2 Nuclei

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

3.0.3 Atomic basis

+
+

3.0.3 Atomic basis

printf("Atomic basis\n");
@@ -1765,8 +1765,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: 2022-01-17 Mon 15:13

+

Created: 2022-01-20 Thu 11:10

Validate

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

Table of Contents

-
-

1 Matrix operations

+
+

1 Matrix operations

-
-

1.1 qmckl_transpose

+
+

1.1 qmckl_transpose

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

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

1.1.1 Requirements

+
+

1.1.1 Requirements

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

1.1.2 C header

+
+

1.1.2 C header

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

1.1.3 Source

+
+

1.1.3 Source

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

Author: TREX CoE

-

Created: 2022-01-17 Mon 15:13

+

Created: 2022-01-20 Thu 11:10

Validate

diff --git a/qmckl_verificarlo.html b/qmckl_verificarlo.html index 6814ca3..2912207 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 @@ -311,22 +311,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 @@ -377,8 +377,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

#ifdef VFC_CI
@@ -398,8 +398,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
  • @@ -434,8 +434,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
  • @@ -475,8 +475,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
  • @@ -516,8 +516,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

#ifdef VFC_CI
@@ -538,8 +538,8 @@ and accuracy
 
-
-

2 Fortran wrappers

+
+

2 Fortran wrappers

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

Author: TREX CoE

-

Created: 2022-01-17 Mon 15:13

+

Created: 2022-01-20 Thu 11:10

Validate