diff --git a/README.html b/README.html index 92dcb9d..c33c101 100644 --- a/README.html +++ b/README.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- +All QMCkl functions return an error code. A convenient way to handle @@ -327,7 +327,7 @@ error in text format and exits the program.
subroutine qmckl_check_error(rc, message) +subroutine qmckl_check_error(rc, message) use qmckl implicit none integer(qmckl_exit_code), intent(in) :: rc @@ -345,8 +345,8 @@ error in text format and exits the program.
The following program, in Fortran, computes the values of an atomic @@ -564,7 +564,7 @@ We finally print the value of the AO:
The latest version fo QMCkl can be downloaded @@ -371,8 +371,8 @@ The latest version fo QMCkl can be downloaded
QMCkl is built with GNU Autotools, so the usual
@@ -387,8 +387,8 @@ options are defined using CFLAGS
and FCFLAGS
.
To compile from the source repository, additional dependencies are @@ -409,8 +409,8 @@ to be executed first.
The qmckl.h
header file installed in the ${prefix}/include
directory
@@ -439,12 +439,12 @@ Both files are located in the include/
directory.
In a traditional source code, most of the lines of source files of a program @@ -494,8 +494,8 @@ tarball contains the generated source code.
For a tutorial on literate programming with org-mode, follow this link. @@ -526,8 +526,8 @@ org-mode.
Most of the codes of the TREX CoE are written in Fortran with some @@ -591,8 +591,8 @@ For more guidelines on using Fortran to generate a C interface, see
The authors should follow the recommendations of the C99 @@ -612,8 +612,8 @@ make cppcheck ; cat cppcheck.out
The proposed API should allow the library to: deal with memory transfers @@ -624,8 +624,8 @@ functions (see below).
To avoid namespace collisions, we use qmckl_
as a prefix for all exported
@@ -646,8 +646,8 @@ form is allowed.
In the C language, the number of bits used by the integer types can change @@ -679,15 +679,15 @@ bindings in other languages in other repositories.
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.
A single qmckl.h
header to be distributed by the library
@@ -790,8 +790,8 @@ and the types definitions should be written in the *fh_type.f90
fil
Low-level functions are very simple functions which are leaves of @@ -800,14 +800,14 @@ the function call tree (they don't call any other QMCkl function).
These functions are pure, and unaware of the QMCkl
-context
. They are not allowed to allocate/deallocate memory, and
+context
. They are not allowed to allocate/deallocate memory, and
if they need temporary memory it should be provided in input.
High-level functions are at the top of the function call tree. @@ -819,8 +819,8 @@ temporary storage, to simplify the use of accelerators.
The minimal number of bits of precision required for a function
@@ -828,7 +828,7 @@ should be given as an input of low-level computational
functions. This input will be used to define the values of the
different thresholds that might be used to avoid computing
unnecessary noise. High-level functions will use the precision
-specified in the context
variable.
+specified in the context
variable.
@@ -896,8 +896,8 @@ following points :
Reducing the scaling of an algorithm usually implies also reducing @@ -913,7 +913,7 @@ implemented adapted to different problem sizes.
The atomic basis set is defined as a list of shells. Each shell \(s\) is @@ -439,19 +450,19 @@ gradients and Laplacian of the atomic basis functions.
The following arrays are stored in the context, and need to be set when initializing the library:
-ao_vgl |
double[point_num][5][ao_num] |
-Value, gradients, Laplacian of the primitives at current positions | +Value, gradients, Laplacian of the AOs at current positions |
uint64_t |
Last modification date of Value, gradients, Laplacian of the AOs at current positions | ||
ao_value |
+double[point_num][ao_num] |
+Values of the the AOs at current positions | +|
ao_value_date |
+uint64_t |
+Last modification date of the values of the AOs at current positions | +
When the basis set is completely entered, extra data structures may be @@ -1414,8 +1437,8 @@ the context.
For faster access, we provide extra arrays for the shell information as: @@ -1445,8 +1468,8 @@ which is a matrix-vector product.
qmckl_exit_code @@ -1459,7 +1482,7 @@ which is a matrix-vector product.Returns the array of values, gradients an Laplacian of primitive basis functions evaluated at the current coordinates. -See section 3.2. +See section 3.2.
@@ -1472,7 +1495,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.
@@ -1486,11 +1509,11 @@ 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.
-Uses the give array to compute the VGL. +Uses the given array to compute the VGL.
@@ -1500,17 +1523,42 @@ Uses the give array to compute the VGL. const int64_t size_max);+ +++ +qmckl_exit_code +qmckl_get_ao_basis_ao_value (qmckl_context context, + double* const ao_value, + const int64_t size_max); +++Returns the array of values of the atomic orbitals evaluated at +the current coordinates. See section 5. +
+ ++Uses the given array to compute the value. +
+ ++qmckl_exit_code +qmckl_get_ao_basis_ao_value_inplace (qmckl_context context, + double* const ao_value, + const int64_t size_max); ++
qmckl_ao_gaussian_vgl
computes the values, gradients and
@@ -1681,10 +1729,10 @@ Requirements:
Variable | +Type | +In/Out | +Description | +
---|---|---|---|
context |
+qmckl_context |
+in | +Global state | +
ao_num |
+int64_t |
+in | +Number of AOs | +
shell_num |
+int64_t |
+in | +Number of shells | +
point_num |
+int64_t |
+in | +Number of points | +
nucl_num |
+int64_t |
+in | +Number of nuclei | +
coord |
+double[3][point_num] |
+in | +Coordinates | +
nucl_coord |
+double[3][nucl_num] |
+in | +Nuclear coordinates | +
nucleus_index |
+int64_t[nucl_num] |
+in | +Index of the 1st shell of each nucleus | +
nucleus_shell_num |
+int64_t[nucl_num] |
+in | +Number of shells per nucleus | +
nucleus_range |
+double[nucl_num] |
+in | +Range beyond which all is zero | +
nucleus_max_ang_mom |
+int32_t[nucl_num] |
+in | +Maximum angular momentum per nucleus | +
shell_ang_mom |
+int32_t[shell_num] |
+in | +Angular momentum of each shell | +
ao_factor |
+double[ao_num] |
+in | +Normalization factor of the AOs | +
shell_vgl |
+double[point_num][5][shell_num] |
+in | +Value, gradients and Laplacian of the shells | +
ao_value |
+double[point_num][ao_num] |
+out | +Values of the AOs | +
integer function qmckl_compute_ao_value_doc_f(context, & + ao_num, shell_num, point_num, nucl_num, & + coord, nucl_coord, nucleus_index, nucleus_shell_num, & + nucleus_range, nucleus_max_ang_mom, shell_ang_mom, & + ao_factor, shell_vgl, ao_value) & + result(info) + use qmckl + implicit none + integer(qmckl_context), intent(in) :: context + integer*8 , intent(in) :: ao_num + integer*8 , intent(in) :: shell_num + integer*8 , intent(in) :: point_num + integer*8 , intent(in) :: nucl_num + double precision , intent(in) :: coord(point_num,3) + double precision , intent(in) :: nucl_coord(nucl_num,3) + integer*8 , intent(in) :: nucleus_index(nucl_num) + integer*8 , intent(in) :: nucleus_shell_num(nucl_num) + double precision , intent(in) :: nucleus_range(nucl_num) + integer , intent(in) :: nucleus_max_ang_mom(nucl_num) + integer , intent(in) :: shell_ang_mom(shell_num) + double precision , intent(in) :: ao_factor(ao_num) + double precision , intent(in) :: shell_vgl(shell_num,5,point_num) + double precision , intent(out) :: ao_value(ao_num,point_num) + + double precision :: e_coord(3), n_coord(3) + integer*8 :: n_poly + integer :: l, il, k + integer*8 :: ipoint, inucl, ishell + integer*8 :: ishell_start, ishell_end + integer :: lstart(0:20) + double precision :: x, y, z, r2 + double precision :: cutoff + integer, external :: qmckl_ao_polynomial_vgl_doc_f + + double precision, allocatable :: poly_vgl(:,:) + integer , allocatable :: powers(:,:), ao_index(:) + + allocate(poly_vgl(5,ao_num), powers(3,ao_num), ao_index(ao_num)) + + ! Pre-computed data + do l=0,20 + lstart(l) = l*(l+1)*(l+2)/6 +1 + end do + + k=1 + do inucl=1,nucl_num + ishell_start = nucleus_index(inucl) + 1 + ishell_end = nucleus_index(inucl) + nucleus_shell_num(inucl) + do ishell = ishell_start, ishell_end + l = shell_ang_mom(ishell) + ao_index(ishell) = k + k = k + lstart(l+1) - lstart(l) + end do + end do + info = QMCKL_SUCCESS + + ! Don't compute polynomials when the radial part is zero. + cutoff = -dlog(1.d-12) + + do ipoint = 1, point_num + e_coord(1) = coord(ipoint,1) + e_coord(2) = coord(ipoint,2) + e_coord(3) = coord(ipoint,3) + do inucl=1,nucl_num + n_coord(1) = nucl_coord(inucl,1) + n_coord(2) = nucl_coord(inucl,2) + n_coord(3) = nucl_coord(inucl,3) + + ! Test if the point is in the range of the nucleus + x = e_coord(1) - n_coord(1) + y = e_coord(2) - n_coord(2) + z = e_coord(3) - n_coord(3) + + r2 = x*x + y*y + z*z + + if (r2 > cutoff*nucleus_range(inucl)) then + cycle + end if + + ! Compute polynomials + info = qmckl_ao_polynomial_vgl_doc_f(context, e_coord, n_coord, & + nucleus_max_ang_mom(inucl), n_poly, powers, 3_8, & + poly_vgl, 5_8) + + ! Loop over shells + ishell_start = nucleus_index(inucl) + 1 + ishell_end = nucleus_index(inucl) + nucleus_shell_num(inucl) + do ishell = ishell_start, ishell_end + k = ao_index(ishell) + l = shell_ang_mom(ishell) + do il = lstart(l), lstart(l+1)-1 + ! Value + ao_value(k,ipoint) = & + poly_vgl(1,il) * shell_vgl(ishell,1,ipoint) * ao_factor(k) + k = k+1 + end do + end do + end do + end do + + deallocate(poly_vgl, powers) +end function qmckl_compute_ao_value_doc_f ++
Variable | +Type | +In/Out | +Description | +
---|---|---|---|
context |
+qmckl_context |
+in | +Global state | +
ao_num |
+int64_t |
+in | +Number of AOs | +
shell_num |
+int64_t |
+in | +Number of shells | +
prim_num |
+int64_t |
+in | +Number of primitives | +
point_num |
+int64_t |
+in | +Number of points | +
nucl_num |
+int64_t |
+in | +Number of nuclei | +
coord |
+double[3][point_num] |
+in | +Coordinates | +
nucl_coord |
+double[3][nucl_num] |
+in | +Nuclear coordinates | +
nucleus_index |
+int64_t[nucl_num] |
+in | +Index of the 1st shell of each nucleus | +
nucleus_shell_num |
+int64_t[nucl_num] |
+in | +Number of shells per nucleus | +
nucleus_range |
+double[nucl_num] |
+in | +Range beyond which all is zero | +
nucleus_max_ang_mom |
+int32_t[nucl_num] |
+in | +Maximum angular momentum per nucleus | +
shell_ang_mom |
+int32_t[shell_num] |
+in | +Angular momentum of each shell | +
shell_prim_index |
+int64_t[shell_num] |
+in | +Index of the 1st primitive of each shell | +
shell_prim_num |
+int64_t[shell_num] |
+in | +Number of primitives per shell | +
ao_factor |
+double[ao_num] |
+in | +Normalization factor of the AOs | +
ao_expo |
+double[prim_num] |
+in | +Value, gradients and Laplacian of the shells | +
coef_normalized |
+double[prim_num] |
+in | +Value, gradients and Laplacian of the shells | +
ao_value |
+double[point_num][ao_num] |
+out | +Values of the AOs | +
qmckl_exit_code qmckl_compute_ao_value_doc ( + const qmckl_context context, + const int64_t ao_num, + const int64_t shell_num, + const int64_t point_num, + const int64_t nucl_num, + const double* coord, + const double* nucl_coord, + const int64_t* nucleus_index, + const int64_t* nucleus_shell_num, + const double* nucleus_range, + const int32_t* nucleus_max_ang_mom, + const int32_t* shell_ang_mom, + const double* ao_factor, + const double* shell_vgl, + double* const ao_value ); ++
#ifdef HAVE_HPC + qmckl_exit_code qmckl_compute_ao_value_hpc_gaussian ( + const qmckl_context context, + const int64_t ao_num, + const int64_t shell_num, + const int32_t* prim_num_per_nucleus, + const int64_t point_num, + const int64_t nucl_num, + const double* coord, + const double* nucl_coord, + const int64_t* nucleus_index, + const int64_t* nucleus_shell_num, + const double* nucleus_range, + const int32_t* nucleus_max_ang_mom, + const int32_t* shell_ang_mom, + const double* ao_factor, + const qmckl_matrix expo_per_nucleus, + const qmckl_tensor coef_per_nucleus, + double* const ao_value ); +#endif ++
typedef struct qmckl_determinant_struct { @@ -598,8 +598,8 @@ this mechanism.
When all the data for the slater determinants have been provided, the following
@@ -613,8 +613,8 @@ function returns true
.
To set the basis set, all the following functions need to be @@ -638,24 +638,24 @@ computed to accelerate the calculations.
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.
context
is not QMCKL_NULL_CONTEXT
[n][3]
in C and (3,n)
in Fortra
qmckl_exit_code qmckl_distance ( @@ -834,8 +834,8 @@ the leading dimension:[n][3]
in C and(3,n)
in Fortra
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
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
qmckl_distance_rescaled
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.
context
is not QMCKL_NULL_CONTEXT
[n][3]
in C and (3,n)
in Fortra
qmckl_exit_code qmckl_distance_rescaled ( @@ -1185,8 +1185,8 @@ the leading dimension:[n][3]
in C and(3,n)
in Fortra
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
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
qmckl_distance_rescaled_deriv_e
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.