From 9dadce97070a576725e53e60becc1ba1bbc964c3 Mon Sep 17 00:00:00 2001 From: scemama Date: Sat, 7 Nov 2020 15:39:45 +0000 Subject: [PATCH] deploy: d50737687c451b88367d25d7af55a2e090deb452 --- index.html | 370 ++++++++++++++++++++++++++++------------------------- 1 file changed, 197 insertions(+), 173 deletions(-) diff --git a/index.html b/index.html index e61ac49..899c991 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + QMCkl source code documentation @@ -261,67 +261,67 @@ for the JavaScript code in this tag.

Table of Contents

-
-

1 Introduction

+
+

1 Introduction

The ultimate goal of QMCkl is to provide a high-performance @@ -348,8 +348,8 @@ tool in the Makefile, and then the produced files are compiled.

-
-

1.1 Language used

+
+

1.1 Language used

Fortran is one of the most common languages used by the community, @@ -373,8 +373,8 @@ justified.

-
-

1.2 Source code editing

+
+

1.2 Source code editing

Any text editor can be used to edit org-mode files. For a better @@ -409,8 +409,8 @@ And pandoc can convert multiple markdown formats into org-mode.

-
-

1.3 Writing in Fortran

+
+

1.3 Writing in Fortran

The Fortran source files should provide a C interface using @@ -429,8 +429,8 @@ For more guidelines on using Fortran to generate a C interface, see

-
-

1.4 Coding style

+
+

1.4 Coding style

To improve readability, we maintain a consistent coding style in the library. @@ -447,8 +447,8 @@ Coding style can be automatically checked with -

1.5 Design of the library

+
+

1.5 Design of the library

The proposed API should allow the library to: @@ -464,8 +464,8 @@ functions (see below).

-
-

1.5.1 Naming conventions

+
+

1.5.1 Naming conventions

Use qmckl_ as a prefix for all exported functions and variables. @@ -485,8 +485,8 @@ Arrays are in uppercase and scalars are in lowercase.

-
-

1.5.2 Application programming interface

+
+

1.5.2 Application programming interface

The application programming interface (API) is designed to be @@ -515,8 +515,8 @@ bindings in other languages in other repositories.

-
-

1.5.3 Global state

+
+

1.5.3 Global state

Global variables should be avoided in the library, because it is @@ -543,8 +543,8 @@ The context and its old versions can be destroyed with

-
-

1.5.4 Low-level functions

+
+

1.5.4 Low-level functions

Low-level functions are very simple functions which are leaves of the @@ -559,8 +559,8 @@ temporary memory it should be provided in input.

-
-

1.5.5 High-level functions

+
+

1.5.5 High-level functions

High-level functions are at the top of the function call tree. @@ -579,8 +579,8 @@ non-purity is justified. All the side effects should be made in the

-
-

1.5.6 Numerical precision

+
+

1.5.6 Numerical precision

The number of bits of precision required for a function should be @@ -594,8 +594,8 @@ High-level functions will use the precision specified in the

-
-

1.6 Algorithms

+
+

1.6 Algorithms

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

-
-

1.7 Rules for the API

+
+

1.7 Rules for the API

  • stdint should be used for integers (int32_t, int64_t)
  • @@ -621,12 +621,12 @@ be implemented adapted to different problem sizes.
-
-

2 Documentation

+
+

2 Documentation

-
-

2.1 qmckl.h header file

+
+

2.1 qmckl.h header file

This file produces the qmckl.h header file, which is to be included @@ -638,12 +638,12 @@ We also create here the qmckl_f.f90 which is the Fortran interface

-
-

2.1.1 Constants

+
+

2.1.1 Constants

    -
  1. Success/failure
    +
  2. Success/failure

    These are the codes returned by the functions to indicate success @@ -668,7 +668,7 @@ or failure. All such functions should have as a return type qmckl_exit_cod

  3. -
  4. Precision-related constants
    +
  5. Precision-related constants

    Controlling numerical precision enables optimizations. Here, the @@ -692,8 +692,8 @@ range are defined.

-
-

2.2 Memory management

+
+

2.2 Memory management

We override the allocation functions to enable the possibility of @@ -709,8 +709,8 @@ optimized libraries to fine-tune the memory allocation.

-
-

2.2.1 qmckl_malloc

+
+

2.2.1 qmckl_malloc

Memory allocation function, letting the library choose how the @@ -735,7 +735,7 @@ memory will be allocated, and a pointer is returned to the user.

    -
  1. Source
    +
  2. Source
    void* qmckl_malloc(const qmckl_context ctx, const size_t size) {
    @@ -753,8 +753,8 @@ memory will be allocated, and a pointer is returned to the user.
     
-
-

2.2.2 qmckl_free

+
+

2.2.2 qmckl_free

void qmckl_free(void *ptr);
@@ -772,7 +772,7 @@ memory will be allocated, and a pointer is returned to the user.
 
    -
  1. Source
    +
  2. Source
    void qmckl_free(void *ptr) {
    @@ -785,8 +785,8 @@ memory will be allocated, and a pointer is returned to the user.
     
-
-

2.3 Context

+
+

2.3 Context

This file is written in C because it is more natural to express the context in @@ -802,8 +802,8 @@ C than in Fortran.

-
-

2.3.1 Context

+
+

2.3.1 Context

The context variable is a handle for the state of the library, and @@ -821,7 +821,7 @@ A value of 0 for the context is equivalent to a NULL pointer.

    -
  1. Source
    +
  2. Source

    The tag is used internally to check if the memory domain pointed by @@ -844,7 +844,7 @@ a pointer is a valid context.

-
  • qmckl_context_check
    +
  • qmckl_context_check

    Checks if the domain pointed by the pointer is a valid context. @@ -858,7 +858,7 @@ Returns the input qmckl_context if the context is valid, 0 otherwis

      -
    1. Source
      +
    2. Source
      qmckl_context qmckl_context_check(const qmckl_context context) {
      @@ -878,7 +878,7 @@ Returns the input qmckl_context if the context is valid, 0 otherwis
       
  • -
  • qmckl_context_create
    +
  • qmckl_context_create

    To create a new context, use qmckl_context_create(). @@ -897,7 +897,7 @@ Returns 0 upon failure to allocate the internal data structure

      -
    1. Source
      +
    2. Source
      qmckl_context qmckl_context_create() {
      @@ -920,7 +920,7 @@ Returns 0 upon failure to allocate the internal data structure
       
    3. -
    4. Fortran interface
      +
    5. Fortran interface
      interface
      @@ -935,7 +935,7 @@ Returns 0 upon failure to allocate the internal data structure
       
  • -
  • qmckl_context_copy
    +
  • qmckl_context_copy

    This function makes a shallow copy of the current context. @@ -956,7 +956,7 @@ for the new context

      -
    1. Source
      +
    2. Source
      qmckl_context qmckl_context_copy(const qmckl_context context) {
      @@ -988,7 +988,7 @@ for the new context
       
    3. -
    4. Fortran interface
      +
    5. Fortran interface
      interface
      @@ -1004,7 +1004,7 @@ for the new context
       
  • -
  • qmckl_context_previous
    +
  • qmckl_context_previous

    Returns the previous context @@ -1024,7 +1024,7 @@ Returns 0 for the 0-valued context

      -
    1. Source
      +
    2. Source
      qmckl_context qmckl_context_previous(const qmckl_context context) {
      @@ -1042,7 +1042,7 @@ Returns 0 for the 0-valued context
       
    3. -
    4. Fortran interface
      +
    5. Fortran interface
      interface
      @@ -1058,7 +1058,7 @@ Returns 0 for the 0-valued context
       
  • -
  • qmckl_context_destroy
    +
  • qmckl_context_destroy

    Destroys the current context, leaving the ancestors untouched. @@ -1079,7 +1079,7 @@ Fails if the the pointer is not a valid context

      -
    1. Source
      +
    2. Source
      qmckl_exit_code qmckl_context_destroy(const qmckl_context context) {
      @@ -1099,7 +1099,7 @@ Fails if the the pointer is not a valid context
       
    3. -
    4. Fortran interface
      +
    5. Fortran interface
      interface
      @@ -1118,8 +1118,8 @@ Fails if the the pointer is not a valid context
       
      -
      -

      2.3.2 Precision

      +
      +

      2.3.2 Precision

      The following functions set and get the expected required precision @@ -1135,7 +1135,7 @@ The update functions return QMCKL_SUCCESS or QMCKL_FAILURE

        -
      1. qmckl_context_update_precision
        +
      2. qmckl_context_update_precision

        Modifies the parameter for the numerical precision in a given context. @@ -1147,7 +1147,7 @@ Modifies the parameter for the numerical precision in a given context.

          -
        1. Source
          +
        2. Source
          qmckl_exit_code qmckl_context_update_precision(const qmckl_context context, const int precision) {
          @@ -1166,7 +1166,7 @@ Modifies the parameter for the numerical precision in a given context.
           
        3. -
        4. Fortran interface
          +
        5. Fortran interface
          interface
          @@ -1182,7 +1182,7 @@ Modifies the parameter for the numerical precision in a given context.
           
      3. -
      4. qmckl_context_update_range
        +
      5. qmckl_context_update_range

        Modifies the parameter for the numerical range in a given context. @@ -1194,7 +1194,7 @@ Modifies the parameter for the numerical range in a given context.

          -
        1. Source
          +
        2. Source
          qmckl_exit_code qmckl_context_update_range(const qmckl_context context, const int range) {
          @@ -1213,7 +1213,7 @@ Modifies the parameter for the numerical range in a given context.
           
        3. -
        4. Fortran interface
          +
        5. Fortran interface
          interface
          @@ -1229,7 +1229,7 @@ Modifies the parameter for the numerical range in a given context.
           
      6. -
      7. qmckl_context_set_precision
        +
      8. qmckl_context_set_precision

        Returns a copy of the context with a different precision parameter. @@ -1241,7 +1241,7 @@ Returns a copy of the context with a different precision parameter.

          -
        1. Source
          +
        2. Source
          qmckl_context qmckl_context_set_precision(const qmckl_context context, const int precision) {
          @@ -1257,7 +1257,7 @@ Returns a copy of the context with a different precision parameter.
           
        3. -
        4. Fortran interface
          +
        5. Fortran interface
          interface
          @@ -1273,7 +1273,7 @@ Returns a copy of the context with a different precision parameter.
           
      9. -
      10. qmckl_context_set_range
        +
      11. qmckl_context_set_range

        Returns a copy of the context with a different precision parameter. @@ -1285,7 +1285,7 @@ Returns a copy of the context with a different precision parameter.

          -
        1. Source
          +
        2. Source
          qmckl_context qmckl_context_set_range(const qmckl_context context, const int range) {
          @@ -1301,7 +1301,7 @@ Returns a copy of the context with a different precision parameter.
           
        3. -
        4. Fortran interface
          +
        5. Fortran interface
          interface
          @@ -1318,7 +1318,7 @@ Returns a copy of the context with a different precision parameter.
           
      12. -
      13. qmckl_context_get_precision
        +
      14. qmckl_context_get_precision

        Returns the value of the numerical precision in the context @@ -1330,7 +1330,7 @@ Returns the value of the numerical precision in the context

          -
        1. Source
          +
        2. Source
          int qmckl_context_get_precision(const qmckl_context context) {
          @@ -1342,7 +1342,7 @@ Returns the value of the numerical precision in the context
           
        3. -
        4. Fortran interface
          +
        5. Fortran interface
          interface
          @@ -1357,7 +1357,7 @@ Returns the value of the numerical precision in the context
           
      15. -
      16. qmckl_context_get_range
        +
      17. qmckl_context_get_range

        Returns the value of the numerical range in the context @@ -1369,7 +1369,7 @@ Returns the value of the numerical range in the context

          -
        1. Source
          +
        2. Source
          int qmckl_context_get_range(const qmckl_context context) {
          @@ -1381,7 +1381,7 @@ Returns the value of the numerical range in the context
           
        3. -
        4. Fortran interface
          +
        5. Fortran interface
          interface
          @@ -1397,7 +1397,7 @@ Returns the value of the numerical range in the context
           
      18. -
      19. qmckl_context_get_epsilon
        +
      20. qmckl_context_get_epsilon

        Returns \(\epsilon = 2^{1-n}\) where n is the precision @@ -1409,7 +1409,7 @@ Returns \(\epsilon = 2^{1-n}\) where n is the precision

          -
        1. Source
          +
        2. Source
          double qmckl_context_get_epsilon(const qmckl_context context) {
          @@ -1421,7 +1421,7 @@ Returns \(\epsilon = 2^{1-n}\) where n is the precision
           
        3. -
        4. Fortran interface
          +
        5. Fortran interface
          interface
          @@ -1439,19 +1439,19 @@ Returns \(\epsilon = 2^{1-n}\) where n is the precision
           
      -
      -

      2.3.3 Info about the molecular system

      +
      +

      2.3.3 Info about the molecular system

        -
      1. TODO qmckl_context_set_nucl_coord
      2. -
      3. TODO qmckl_context_set_nucl_charge
      4. -
      5. TODO qmckl_context_set_elec_num
      6. +
      7. TODO qmckl_context_set_nucl_coord
      8. +
      9. TODO qmckl_context_set_nucl_charge
      10. +
      11. TODO qmckl_context_set_elec_num
      -
      -

      2.4 Computation of distances

      +
      +

      2.4 Computation of distances

      Function for the computation of distances between particles. @@ -1467,12 +1467,12 @@ Function for the computation of distances between particles.

      -
      -

      2.4.1 Squared distance

      +
      +

      2.4.1 Squared distance

        -
      1. qmckl_distance_sq
        +
      2. qmckl_distance_sq

        Computes the matrix of the squared distances between all pairs of @@ -1484,7 +1484,7 @@ points in two sets, one point within each set:

          -
        1. Arguments
          +
        2. Arguments
          @@ -1567,7 +1567,7 @@ points in two sets, one point within each set: -
        3. Requirements
          +
        4. Requirements
          • context is not 0
          • @@ -1585,7 +1585,7 @@ points in two sets, one point within each set:
        5. -
        6. Performance
          +
        7. Performance

          This function might be more efficient when A and B are @@ -1604,7 +1604,7 @@ transposed.

        8. -
        9. Source
          +
        10. Source
          integer function qmckl_distance_sq_f(context, transa, transb, m, n, A, LDA, B, LDB, C, LDC) result(info)
          @@ -1740,8 +1740,8 @@ transposed.
           
           
          -
          -

          2.5 Atomic Orbitals

          +
          +

          2.5 Atomic Orbitals

          This files contains all the routines for the computation of the @@ -1758,8 +1758,8 @@ values, gradients and Laplacian of the atomic basis functions.

          -
          -

          2.5.1 Polynomials

          +
          +

          2.5.1 Polynomials

          \[ @@ -1783,7 +1783,7 @@ values, gradients and Laplacian of the atomic basis functions.

            -
          1. qmckl_ao_powers
            +
          2. qmckl_ao_powers

            Computes all the powers of the n input data up to the given @@ -1796,7 +1796,7 @@ maximum value given in input for each of the \(n\) points:

              -
            1. Arguments
              +
            2. Arguments
        11. @@ -1849,7 +1849,7 @@ maximum value given in input for each of the \(n\) points: -
        12. Requirements
          +
        13. Requirements
          • context is not 0
          • @@ -1862,7 +1862,7 @@ maximum value given in input for each of the \(n\) points:
        14. -
        15. Header
          +
        16. Header
          qmckl_exit_code qmckl_ao_powers(const qmckl_context context,
          @@ -1874,7 +1874,7 @@ maximum value given in input for each of the \(n\) points:
           
        17. -
        18. Source
          +
        19. Source
          integer function qmckl_ao_powers_f(context, n, X, LMAX, P, ldp) result(info)
          @@ -1916,7 +1916,7 @@ maximum value given in input for each of the \(n\) points:
           
        20. -
        21. qmckl_ao_polynomial_vgl
          +
        22. qmckl_ao_polynomial_vgl

          Computes the values, gradients and Laplacians at a given point of @@ -1925,7 +1925,7 @@ all polynomials with an angular momentum up to lmax.

            -
          1. Arguments
            +
          2. Arguments
        23. @@ -1996,7 +1996,7 @@ all polynomials with an angular momentum up to lmax. -
        24. Requirements
          +
        25. Requirements
          • context is not 0
          • @@ -2021,7 +2021,7 @@ For example, with a=0, b=2 and c=1 the string is "yyz"
        26. -
        27. Error codes
          +
        28. Error codes
        29. @@ -2056,7 +2056,7 @@ For example, with a=0, b=2 and c=1 the string is "yyz" -
        30. Header
          +
        31. Header
          qmckl_exit_code qmckl_ao_polynomial_vgl(const qmckl_context context,
          @@ -2069,7 +2069,7 @@ For example, with a=0, b=2 and c=1 the string is "yyz"
        32. -
        33. Source
          +
        34. Source
          integer function qmckl_ao_polynomial_vgl_f(context, X, R, lmax, n, L, ldl, VGL, ldv) result(info)
          @@ -2118,23 +2118,46 @@ For example, with a=0, b=2 and c=1 the string is "yyz"
        35. do i=1,3 Y(i) = X(i) - R(i) end do - pows(-2:-1,1:3) = 0.d0 - pows(0,1:3) = 1.d0 + lmax_array(1:3) = lmax - info = qmckl_ao_powers_f(context, 1_8, Y(1), (/lmax/), pows(1,1), size(pows,1,kind=8)) - if (info /= 0) return - info = qmckl_ao_powers_f(context, 1_8, Y(2), (/lmax/), pows(1,2), size(pows,1,kind=8)) - if (info /= 0) return - info = qmckl_ao_powers_f(context, 1_8, Y(3), (/lmax/), pows(1,3), size(pows,1,kind=8)) - if (info /= 0) return + if (lmax == 0) then + VGL(1,1) = 1.d0 + vgL(2:5,1) = 0.d0 + l(1:3,1) = 0 + n=1 + else if (lmax > 0) then + pows(-2:0,1:3) = 1.d0 + do i=1,lmax + pows(i,1) = pows(i-1,1) * Y(1) + pows(i,2) = pows(i-1,2) * Y(2) + pows(i,3) = pows(i-1,3) * Y(3) + end do - VGL(1,1) = 1.d0 - vgL(2:5,1) = 0.d0 - l(1:3,1) = 0 - n=1 - dd = 1.d0 - do d=1,lmax + VGL(1:5,1:4) = 0.d0 + l(1:3,1:4) = 0 + + VGL(1,1) = 1.d0 + vgl(1:5,2:4) = 0.d0 + + l(1,2) = 1 + vgl(1,2) = pows(1,1) + vgL(2,2) = 1.d0 + + l(2,3) = 1 + vgl(1,3) = pows(1,2) + vgL(3,3) = 1.d0 + + l(3,4) = 1 + vgl(1,4) = pows(1,3) + vgL(4,4) = 1.d0 + + n=4 + endif + + ! l>=2 + dd = 2.d0 + do d=2,lmax da = dd do a=d,0,-1 db = dd-da @@ -2142,6 +2165,7 @@ For example, with a=0, b=2 and c=1 the string is "yyz" c = d - a - b dc = dd - da - db n = n+1 + l(1,n) = a l(2,n) = b l(3,n) = c @@ -2184,12 +2208,12 @@ For example, with a=0, b=2 and c=1 the string is "yyz" -
          -

          2.5.2 Gaussian basis functions

          +
          +

          2.5.2 Gaussian basis functions

            -
          1. qmckl_ao_gaussians_vgl
            +
          2. qmckl_ao_gaussians_vgl

            Computes the values, gradients and Laplacians at a given point of @@ -2206,7 +2230,7 @@ Computes the values, gradients and Laplacians at a given point of

              -
            1. Arguments
              +
            2. Arguments
          @@ -2265,7 +2289,7 @@ Computes the values, gradients and Laplacians at a given point of -
        36. Requirements
          +
        37. Requirements
          • context is not 0
          • @@ -2280,7 +2304,7 @@ Computes the values, gradients and Laplacians at a given point of
        38. -
        39. Header
          +
        40. Header
          qmckl_exit_code qmckl_ao_gaussians_vgl(const qmckl_context context,
          @@ -2292,7 +2316,7 @@ Computes the values, gradients and Laplacians at a given point of
           
        41. -
        42. Source
          +
        43. Source
          integer function qmckl_ao_gaussians_vgl_f(context, X, R, n, A, VGL, ldv) result(info)
          @@ -2364,13 +2388,13 @@ Computes the values, gradients and Laplacians at a given point of
           
          -
          -

          2.5.3 TODO Slater basis functions

          +
          +

          2.5.3 TODO Slater basis functions

          -
          -

          3 Acknowledgments

          +
          +

          3 Acknowledgments

          euflag.jpg @@ -2380,7 +2404,7 @@ Computes the values, gradients and Laplacians at a given point of

          -

          Created: 2020-11-07 Sat 15:29

          +

          Created: 2020-11-07 Sat 15:39

          Validate