From 092317dccb1a41337b9df2ec1c5630bf76f7556f Mon Sep 17 00:00:00 2001 From: scemama Date: Sat, 7 Nov 2020 15:29:06 +0000 Subject: [PATCH] deploy: 03f46f7bb678d302c80094d12b96d9164aa3d10b --- index.html | 408 +++++++++++++++++++++++++++++------------------------ 1 file changed, 223 insertions(+), 185 deletions(-) diff --git a/index.html b/index.html index ffc5835..e61ac49 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,10 +1397,10 @@ Returns the value of the numerical range in the context
           
      18. -
      19. qmckl_context_get_epsilon
        +
      20. qmckl_context_get_epsilon

        -Returns \(\epsilon = 2 / \log_{10} 2^{n-1}\) where n is the precision +Returns \(\epsilon = 2^{1-n}\) where n is the precision

        double qmckl_context_get_epsilon(const qmckl_context context);
        @@ -1409,19 +1409,19 @@ Returns \(\epsilon = 2 / \log_{10} 2^{n-1}\) where n is the precisi
         
          -
        1. Source
          +
        2. Source
          double qmckl_context_get_epsilon(const qmckl_context context) {
             const qmckl_context_struct* ctx = (qmckl_context_struct*) context;
          -  return 1.0 / ((double) ((int64_t) 1 << (ctx->precision-1)));
          +  return pow(2.0,(double) 1-ctx->precision);
           }
           
        3. -
        4. Fortran interface
          +
        5. Fortran interface
          interface
          @@ -1439,19 +1439,19 @@ Returns \(\epsilon = 2 / \log_{10} 2^{n-1}\) where n is the precisi
           
        -
        -

        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. @@ -1981,7 +1981,7 @@ all polynomials with an angular momentum up to lmax. - + @@ -1996,25 +1996,68 @@ all polynomials with an angular momentum up to lmax. -
          24. Requirements
            +
          25. Requirements
            • context is not 0
            • n > 0
            • lmax >= 0
            • ldl >= 3
            • -
            • ldv >= (=lmax=+1)(=lmax=+2)(=lmax=+3)/6
            • +
            • ldv >= 5
            • X is allocated with at least \(3 \times 8\) bytes
            • R is allocated with at least \(3 \times 8\) bytes
            • +
            • n >= (lmax+1)(lmax+2)(lmax+3)/6
            • L is allocated with at least \(3 \times n \times 4\) bytes
            • -
            • VGL is allocated with at least \(n \times 5 \times 8\) bytes
            • -
            • On output, n should be equal to (=lmax=+1)(=lmax=+2)(=lmax=+3)/6
            • +
            • VGL is allocated with at least \(5 \times n \times 8\) bytes
            • +
            • On output, n should be equal to (lmax+1)(lmax+2)(lmax+3)/6
            • +
            • On output, the powers are given in the following order (l=a+b+c): +
                +
              • Increase values of l
              • +
              • Within a given value of l, alphabetical order of the +string made by a*"x" + b*"y" + c*"z" (in Python notation). +For example, with a=0, b=2 and c=1 the string is "yyz"
              • +
          26. -
          27. Header
            +
          28. Error codes
            +
          29. VGL(ldv,5)VGL(ldv,n) output Value, gradients and Laplacian of the polynomials
            + + +++ ++ + + + + + + + + + + + + + + + + + + + + + +
            -1Null context
            -2Inconsistent ldl
            -3Inconsistent ldv
            -4Inconsistent lmax
            +
            +
          30. + +
          31. Header
            +
            qmckl_exit_code qmckl_ao_polynomial_vgl(const qmckl_context context,
                             const double *X, const double *R,
            @@ -2026,8 +2069,8 @@ all polynomials with an angular momentum up to lmax.
             
          32. -
          33. Source
            -
            +
          34. Source
            +
            integer function qmckl_ao_polynomial_vgl_f(context, X, R, lmax, n, L, ldl, VGL, ldv) result(info)
               implicit none
            @@ -2037,7 +2080,7 @@ all polynomials with an angular momentum up to lmax.
               integer*8 , intent(out) :: n
               integer   , intent(out) :: L(ldl,(lmax+1)*(lmax+2)*(lmax+3)/6)
               integer*8 , intent(in)  :: ldl
            -  real*8    , intent(out) :: VGL(ldv,5)
            +  real*8    , intent(out) :: VGL(ldv,(lmax+1)*(lmax+2)*(lmax+3)/6)
               integer*8 , intent(in)  :: ldv
             
               integer*8         :: i,j
            @@ -2061,7 +2104,7 @@ all polynomials with an angular momentum up to lmax.
                  return
               endif
             
            -  if (ldv < (lmax+1)*(lmax+2)*(lmax+3)/6) then
            +  if (ldv < 5) then
                  info = -3
                  return
               endif
            @@ -2086,16 +2129,16 @@ all polynomials with an angular momentum up to lmax.
               if (info /= 0) return
             
             
            -  vgl(1,1) = 1.d0
            -  vgl(1,2:5) = 0.d0
            +  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
            -     da = 0.d0
            -     do a=0,d
            -        db = 0.d0
            -        do b=0,d-a
            +     da = dd
            +     do a=d,0,-1
            +        db = dd-da
            +        do b=d-a,0,-1
                        c  = d  - a  - b
                        dc = dd - da - db
                        n = n+1
            @@ -2107,33 +2150,28 @@ all polynomials with an angular momentum up to lmax.
                        yz = pows(b,2) * pows(c,3)
                        xz = pows(a,1) * pows(c,3)
             
            -           vgl(n,1) = xy * pows(c,3)
            +           vgl(1,n) = xy * pows(c,3)
             
                        xy = dc * xy
                        xz = db * xz
                        yz = da * yz
             
            -           vgl(n,2) = pows(a-1,1) * yz
            -           vgl(n,3) = pows(b-1,2) * xz
            -           vgl(n,4) = pows(c-1,3) * xy
            +           vgl(2,n) = pows(a-1,1) * yz
            +           vgl(3,n) = pows(b-1,2) * xz
            +           vgl(4,n) = pows(c-1,3) * xy
             
            -           vgl(n,5) = &
            +           vgl(5,n) = &
                             (da-1.d0) * pows(a-2,1) * yz + &
                             (db-1.d0) * pows(b-2,2) * xz + &
                             (dc-1.d0) * pows(c-2,3) * xy
             
            -           db = db + 1.d0
            +           db = db - 1.d0
                     end do
            -        da = da + 1.d0
            +        da = da - 1.d0
                  end do
                  dd = dd + 1.d0
               end do
             
            -  if (n /= (lmax+1)*(lmax+2)*(lmax+3)/6) then
            -    info = -5
            -    return
            -  endif
            -
               info = 0
             
             end function qmckl_ao_polynomial_vgl_f
            @@ -2146,12 +2184,12 @@ all polynomials with an angular momentum up to lmax.
             
        -
        -

        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 @@ -2168,7 +2206,7 @@ Computes the values, gradients and Laplacians at a given point of

            -
          1. Arguments
            +
          2. Arguments
            @@ -2227,7 +2265,7 @@ Computes the values, gradients and Laplacians at a given point of -
          3. Requirements
            +
          4. Requirements
            • context is not 0
            • @@ -2242,7 +2280,7 @@ Computes the values, gradients and Laplacians at a given point of
          5. -
          6. Header
            +
          7. Header
            qmckl_exit_code qmckl_ao_gaussians_vgl(const qmckl_context context,
            @@ -2254,7 +2292,7 @@ Computes the values, gradients and Laplacians at a given point of
             
          8. -
          9. Source
            +
          10. Source
            integer function qmckl_ao_gaussians_vgl_f(context, X, R, n, A, VGL, ldv) result(info)
            @@ -2326,13 +2364,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 @@ -2342,7 +2380,7 @@ Computes the values, gradients and Laplacians at a given point of

            -

            Created: 2020-11-07 Sat 15:19

            +

            Created: 2020-11-07 Sat 15:29

            Validate