mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-08 04:19:15 +01:00
Deploying to gh-pages from @ TREX-CoE/qmckl@f0f6ac7d85 🚀
This commit is contained in:
parent
4ab43c23ed
commit
786496773c
@ -3,7 +3,7 @@
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<!-- 2021-04-21 Wed 11:31 -->
|
||||
<!-- 2021-04-25 Sun 23:48 -->
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>QMCkl source code documentation</title>
|
||||
@ -349,7 +349,7 @@ and bug reports should be submitted at
|
||||
</div>
|
||||
<div id="postamble" class="status">
|
||||
<p class="author">Author: TREX CoE</p>
|
||||
<p class="date">Created: 2021-04-21 Wed 11:31</p>
|
||||
<p class="date">Created: 2021-04-25 Sun 23:48</p>
|
||||
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
|
||||
</div>
|
||||
</body>
|
||||
|
@ -3,7 +3,7 @@
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<!-- 2021-04-21 Wed 11:31 -->
|
||||
<!-- 2021-04-25 Sun 23:48 -->
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>QMCkl source code documentation</title>
|
||||
@ -349,7 +349,7 @@ and bug reports should be submitted at
|
||||
</div>
|
||||
<div id="postamble" class="status">
|
||||
<p class="author">Author: TREX CoE</p>
|
||||
<p class="date">Created: 2021-04-21 Wed 11:31</p>
|
||||
<p class="date">Created: 2021-04-25 Sun 23:48</p>
|
||||
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
|
||||
</div>
|
||||
</body>
|
||||
|
102
qmckl.html
102
qmckl.html
@ -3,7 +3,7 @@
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<!-- 2021-04-21 Wed 11:31 -->
|
||||
<!-- 2021-04-25 Sun 23:49 -->
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Introduction</title>
|
||||
@ -333,30 +333,30 @@ for the JavaScript code in this tag.
|
||||
<h2>Table of Contents</h2>
|
||||
<div id="text-table-of-contents">
|
||||
<ul>
|
||||
<li><a href="#org1a51cae">1. Using QMCkl</a></li>
|
||||
<li><a href="#orgf509a04">2. Developing in QMCkl</a>
|
||||
<li><a href="#org8c1815a">1. Using QMCkl</a></li>
|
||||
<li><a href="#org3631175">2. Developing in QMCkl</a>
|
||||
<ul>
|
||||
<li><a href="#org3f5e16c">2.1. Literate programming</a></li>
|
||||
<li><a href="#org3abb3ce">2.2. Source code editing</a></li>
|
||||
<li><a href="#org9e3f2d1">2.3. Choice of the programming language</a></li>
|
||||
<li><a href="#org032a0b3">2.4. Coding rules</a></li>
|
||||
<li><a href="#org990f5fe">2.5. Design of the library</a></li>
|
||||
<li><a href="#org1cfb2c4">2.6. Naming conventions</a></li>
|
||||
<li><a href="#org1492ab5">2.7. Application programming interface</a></li>
|
||||
<li><a href="#org20afcba">2.8. Global state</a></li>
|
||||
<li><a href="#org15be415">2.9. Headers</a></li>
|
||||
<li><a href="#org9e09b58">2.10. Low-level functions</a></li>
|
||||
<li><a href="#org9018903">2.11. High-level functions</a></li>
|
||||
<li><a href="#org04ad76a">2.12. Numerical precision</a></li>
|
||||
<li><a href="#org39b1b40">2.13. Algorithms</a></li>
|
||||
<li><a href="#org6054e2c">2.1. Literate programming</a></li>
|
||||
<li><a href="#org4fe4641">2.2. Source code editing</a></li>
|
||||
<li><a href="#org6a4b2c4">2.3. Choice of the programming language</a></li>
|
||||
<li><a href="#orgb7b893b">2.4. Coding rules</a></li>
|
||||
<li><a href="#orgaed066e">2.5. Design of the library</a></li>
|
||||
<li><a href="#org66a6fdd">2.6. Naming conventions</a></li>
|
||||
<li><a href="#orgab0ecae">2.7. Application programming interface</a></li>
|
||||
<li><a href="#orgfb7aa60">2.8. Global state</a></li>
|
||||
<li><a href="#org94264f8">2.9. Headers</a></li>
|
||||
<li><a href="#org71711c5">2.10. Low-level functions</a></li>
|
||||
<li><a href="#org413ce64">2.11. High-level functions</a></li>
|
||||
<li><a href="#org44974aa">2.12. Numerical precision</a></li>
|
||||
<li><a href="#org1e38edd">2.13. Algorithms</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org1a51cae" class="outline-2">
|
||||
<h2 id="org1a51cae"><span class="section-number-2">1</span> Using QMCkl</h2>
|
||||
<div id="outline-container-org8c1815a" class="outline-2">
|
||||
<h2 id="org8c1815a"><span class="section-number-2">1</span> Using QMCkl</h2>
|
||||
<div class="outline-text-2" id="text-1">
|
||||
<p>
|
||||
The <code>qmckl.h</code> header file installed in the <code>${prefix}/include</code> directory
|
||||
@ -385,12 +385,12 @@ Both files are located in the <code>include/</code> directory.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgf509a04" class="outline-2">
|
||||
<h2 id="orgf509a04"><span class="section-number-2">2</span> Developing in QMCkl</h2>
|
||||
<div id="outline-container-org3631175" class="outline-2">
|
||||
<h2 id="org3631175"><span class="section-number-2">2</span> Developing in QMCkl</h2>
|
||||
<div class="outline-text-2" id="text-2">
|
||||
</div>
|
||||
<div id="outline-container-org3f5e16c" class="outline-3">
|
||||
<h3 id="org3f5e16c"><span class="section-number-3">2.1</span> Literate programming</h3>
|
||||
<div id="outline-container-org6054e2c" class="outline-3">
|
||||
<h3 id="org6054e2c"><span class="section-number-3">2.1</span> Literate programming</h3>
|
||||
<div class="outline-text-3" id="text-2-1">
|
||||
<p>
|
||||
In a traditional source code, most of the lines of source files of a program
|
||||
@ -435,8 +435,8 @@ interactively, in the same spirit as Jupyter notebooks.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org3abb3ce" class="outline-3">
|
||||
<h3 id="org3abb3ce"><span class="section-number-3">2.2</span> Source code editing</h3>
|
||||
<div id="outline-container-org4fe4641" class="outline-3">
|
||||
<h3 id="org4fe4641"><span class="section-number-3">2.2</span> Source code editing</h3>
|
||||
<div class="outline-text-3" id="text-2-2">
|
||||
<p>
|
||||
For a tutorial on literate programming with org-mode, follow <a href="http://www.howardism.org/Technical/Emacs/literate-programming-tutorial.html">this link</a>.
|
||||
@ -467,8 +467,8 @@ org-mode.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org9e3f2d1" class="outline-3">
|
||||
<h3 id="org9e3f2d1"><span class="section-number-3">2.3</span> Choice of the programming language</h3>
|
||||
<div id="outline-container-org6a4b2c4" class="outline-3">
|
||||
<h3 id="org6a4b2c4"><span class="section-number-3">2.3</span> Choice of the programming language</h3>
|
||||
<div class="outline-text-3" id="text-2-3">
|
||||
<p>
|
||||
Most of the codes of the <a href="https://trex-coe.eu">TREX CoE</a> are written in Fortran with some scripts in
|
||||
@ -516,8 +516,8 @@ For more guidelines on using Fortran to generate a C interface, see
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org032a0b3" class="outline-3">
|
||||
<h3 id="org032a0b3"><span class="section-number-3">2.4</span> Coding rules</h3>
|
||||
<div id="outline-container-orgb7b893b" class="outline-3">
|
||||
<h3 id="orgb7b893b"><span class="section-number-3">2.4</span> Coding rules</h3>
|
||||
<div class="outline-text-3" id="text-2-4">
|
||||
<p>
|
||||
The authors should follow the recommendations of the C99
|
||||
@ -535,8 +535,8 @@ Compliance can be checked with <code>cppcheck</code> as:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org990f5fe" class="outline-3">
|
||||
<h3 id="org990f5fe"><span class="section-number-3">2.5</span> Design of the library</h3>
|
||||
<div id="outline-container-orgaed066e" class="outline-3">
|
||||
<h3 id="orgaed066e"><span class="section-number-3">2.5</span> Design of the library</h3>
|
||||
<div class="outline-text-3" id="text-2-5">
|
||||
<p>
|
||||
The proposed API should allow the library to: deal with memory transfers
|
||||
@ -547,8 +547,8 @@ functions (see below).
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org1cfb2c4" class="outline-3">
|
||||
<h3 id="org1cfb2c4"><span class="section-number-3">2.6</span> Naming conventions</h3>
|
||||
<div id="outline-container-org66a6fdd" class="outline-3">
|
||||
<h3 id="org66a6fdd"><span class="section-number-3">2.6</span> Naming conventions</h3>
|
||||
<div class="outline-text-3" id="text-2-6">
|
||||
<p>
|
||||
To avoid namespace collisions, we use <code>qmckl_</code> as a prefix for all exported
|
||||
@ -573,8 +573,8 @@ form is allowed.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org1492ab5" class="outline-3">
|
||||
<h3 id="org1492ab5"><span class="section-number-3">2.7</span> Application programming interface</h3>
|
||||
<div id="outline-container-orgab0ecae" class="outline-3">
|
||||
<h3 id="orgab0ecae"><span class="section-number-3">2.7</span> Application programming interface</h3>
|
||||
<div class="outline-text-3" id="text-2-7">
|
||||
<p>
|
||||
In the C language, the number of bits used by the integer types can change
|
||||
@ -606,15 +606,15 @@ bindings in other languages in other repositories.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org20afcba" class="outline-3">
|
||||
<h3 id="org20afcba"><span class="section-number-3">2.8</span> Global state</h3>
|
||||
<div id="outline-container-orgfb7aa60" class="outline-3">
|
||||
<h3 id="orgfb7aa60"><span class="section-number-3">2.8</span> Global state</h3>
|
||||
<div class="outline-text-3" id="text-2-8">
|
||||
<p>
|
||||
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 <a href="./qmckl_context.html"><code>context</code></a> variable, built by the library with the
|
||||
<code>qmckl_context_create</code> function. The <a id="orgc796101">=context=</a> contains the global
|
||||
<code>qmckl_context_create</code> function. The <a id="org9ced7e5">=context=</a> contains the global
|
||||
state of the library, and is used as the first argument of many
|
||||
QMCkl functions.
|
||||
</p>
|
||||
@ -628,8 +628,8 @@ the state is done by setters and getters, prefixed by
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org15be415" class="outline-3">
|
||||
<h3 id="org15be415"><span class="section-number-3">2.9</span> Headers</h3>
|
||||
<div id="outline-container-org94264f8" class="outline-3">
|
||||
<h3 id="org94264f8"><span class="section-number-3">2.9</span> Headers</h3>
|
||||
<div class="outline-text-3" id="text-2-9">
|
||||
<p>
|
||||
A single <code>qmckl.h</code> header to be distributed by the library
|
||||
@ -717,8 +717,8 @@ and the types definitions should be written in the <code>*_f_type.f90</code> fil
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org9e09b58" class="outline-3">
|
||||
<h3 id="org9e09b58"><span class="section-number-3">2.10</span> Low-level functions</h3>
|
||||
<div id="outline-container-org71711c5" class="outline-3">
|
||||
<h3 id="org71711c5"><span class="section-number-3">2.10</span> Low-level functions</h3>
|
||||
<div class="outline-text-3" id="text-2-10">
|
||||
<p>
|
||||
Low-level functions are very simple functions which are leaves of
|
||||
@ -727,14 +727,14 @@ the function call tree (they don't call any other QMCkl function).
|
||||
|
||||
<p>
|
||||
These functions are <i>pure</i>, and unaware of the QMCkl
|
||||
<a href="#orgc796101"><code>context</code></a>. They are not allowed to allocate/deallocate memory, and
|
||||
<a href="#org9ced7e5"><code>context</code></a>. They are not allowed to allocate/deallocate memory, and
|
||||
if they need temporary memory it should be provided in input.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org9018903" class="outline-3">
|
||||
<h3 id="org9018903"><span class="section-number-3">2.11</span> High-level functions</h3>
|
||||
<div id="outline-container-org413ce64" class="outline-3">
|
||||
<h3 id="org413ce64"><span class="section-number-3">2.11</span> High-level functions</h3>
|
||||
<div class="outline-text-3" id="text-2-11">
|
||||
<p>
|
||||
High-level functions are at the top of the function call tree.
|
||||
@ -747,27 +747,27 @@ temporary storage, to simplify the use of accelerators.
|
||||
<p>
|
||||
The high-level functions should be pure, unless the introduction
|
||||
of non-purity is justified. All the side effects should be made in
|
||||
the <a href="#orgc796101"><code>context</code></a> variable.
|
||||
the <a href="#org9ced7e5"><code>context</code></a> variable.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org04ad76a" class="outline-3">
|
||||
<h3 id="org04ad76a"><span class="section-number-3">2.12</span> Numerical precision</h3>
|
||||
<div id="outline-container-org44974aa" class="outline-3">
|
||||
<h3 id="org44974aa"><span class="section-number-3">2.12</span> Numerical precision</h3>
|
||||
<div class="outline-text-3" id="text-2-12">
|
||||
<p>
|
||||
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 <a href="#orgc796101"><code>context</code></a>
|
||||
functions will use the precision specified in the <a href="#org9ced7e5"><code>context</code></a>
|
||||
variable.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org39b1b40" class="outline-3">
|
||||
<h3 id="org39b1b40"><span class="section-number-3">2.13</span> Algorithms</h3>
|
||||
<div id="outline-container-org1e38edd" class="outline-3">
|
||||
<h3 id="org1e38edd"><span class="section-number-3">2.13</span> Algorithms</h3>
|
||||
<div class="outline-text-3" id="text-2-13">
|
||||
<p>
|
||||
Reducing the scaling of an algorithm usually implies also reducing
|
||||
@ -783,7 +783,7 @@ implemented adapted to different problem sizes.
|
||||
</div>
|
||||
<div id="postamble" class="status">
|
||||
<p class="author">Author: TREX CoE</p>
|
||||
<p class="date">Created: 2021-04-21 Wed 11:31</p>
|
||||
<p class="date">Created: 2021-04-25 Sun 23:49</p>
|
||||
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
|
||||
</div>
|
||||
</body>
|
||||
|
158
qmckl_ao.html
158
qmckl_ao.html
@ -3,7 +3,7 @@
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<!-- 2021-04-21 Wed 11:31 -->
|
||||
<!-- 2021-04-25 Sun 23:49 -->
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Atomic Orbitals</title>
|
||||
@ -333,52 +333,52 @@ for the JavaScript code in this tag.
|
||||
<h2>Table of Contents</h2>
|
||||
<div id="text-table-of-contents">
|
||||
<ul>
|
||||
<li><a href="#org4aeb169">1. Context</a>
|
||||
<li><a href="#org16f1ec9">1. Context</a>
|
||||
<ul>
|
||||
<li><a href="#org2b77157">1.1. Data structure</a></li>
|
||||
<li><a href="#orgf141f34">1.2. Access functions</a></li>
|
||||
<li><a href="#org9ba935f">1.3. Initialization functions</a></li>
|
||||
<li><a href="#org4ef131e">1.4. <span class="todo TODO">TODO</span> Fortran interfaces</a></li>
|
||||
<li><a href="#orgceeeeec">1.1. Data structure</a></li>
|
||||
<li><a href="#orgede4c0e">1.2. Access functions</a></li>
|
||||
<li><a href="#orgb08f0fa">1.3. Initialization functions</a></li>
|
||||
<li><a href="#org1c59889">1.4. <span class="todo TODO">TODO</span> Fortran interfaces</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#org960323c">2. Polynomial part</a>
|
||||
<li><a href="#org7c1fc57">2. Polynomial part</a>
|
||||
<ul>
|
||||
<li><a href="#org26826da">2.1. Powers of \(x-X_i\)</a>
|
||||
<li><a href="#orgf7a2003">2.1. Powers of \(x-X_i\)</a>
|
||||
<ul>
|
||||
<li><a href="#orgf066fd3">2.1.1. Requirements</a></li>
|
||||
<li><a href="#org514fb42">2.1.2. C Header</a></li>
|
||||
<li><a href="#org6351e78">2.1.3. Source</a></li>
|
||||
<li><a href="#orgc05b9b8">2.1.4. C interface</a></li>
|
||||
<li><a href="#org466243c">2.1.5. Fortran interface</a></li>
|
||||
<li><a href="#org874a51a">2.1.6. Test</a></li>
|
||||
<li><a href="#org3452a49">2.1.1. Requirements</a></li>
|
||||
<li><a href="#org7f29123">2.1.2. C Header</a></li>
|
||||
<li><a href="#org78e6ffb">2.1.3. Source</a></li>
|
||||
<li><a href="#org998ae2c">2.1.4. C interface</a></li>
|
||||
<li><a href="#orgca41eee">2.1.5. Fortran interface</a></li>
|
||||
<li><a href="#orgb070311">2.1.6. Test</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#orgab07155">2.2. Value, Gradient and Laplacian of a polynomial</a>
|
||||
<li><a href="#org87d9624">2.2. Value, Gradient and Laplacian of a polynomial</a>
|
||||
<ul>
|
||||
<li><a href="#org6fdf5dc">2.2.1. Requirements</a></li>
|
||||
<li><a href="#org053d276">2.2.2. C Header</a></li>
|
||||
<li><a href="#org7f01ece">2.2.3. Source</a></li>
|
||||
<li><a href="#orgc90c63c">2.2.4. C interface</a></li>
|
||||
<li><a href="#org90594ca">2.2.5. Fortran interface</a></li>
|
||||
<li><a href="#org1cd6a0b">2.2.6. Test</a></li>
|
||||
<li><a href="#org8c20ef8">2.2.1. Requirements</a></li>
|
||||
<li><a href="#org3ab8e2b">2.2.2. C Header</a></li>
|
||||
<li><a href="#orgf8ba43c">2.2.3. Source</a></li>
|
||||
<li><a href="#org2200411">2.2.4. C interface</a></li>
|
||||
<li><a href="#org1e95396">2.2.5. Fortran interface</a></li>
|
||||
<li><a href="#org9e4cf63">2.2.6. Test</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#orgddb9423">3. Radial part</a>
|
||||
<li><a href="#org679adac">3. Radial part</a>
|
||||
<ul>
|
||||
<li><a href="#orgb77fbb4">3.1. Gaussian basis functions</a></li>
|
||||
<li><a href="#orgca3a9c3">3.2. <span class="todo TODO">TODO</span> Slater basis functions</a></li>
|
||||
<li><a href="#org1d2d1c6">3.3. <span class="todo TODO">TODO</span> Radial functions on a grid</a></li>
|
||||
<li><a href="#orgb1f1165">3.1. Gaussian basis functions</a></li>
|
||||
<li><a href="#org11f527f">3.2. <span class="todo TODO">TODO</span> Slater basis functions</a></li>
|
||||
<li><a href="#org20b79f3">3.3. <span class="todo TODO">TODO</span> Radial functions on a grid</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#org6707378">4. Combining radial and polynomial parts</a></li>
|
||||
<li><a href="#org18fae86">4. Combining radial and polynomial parts</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org4aeb169" class="outline-2">
|
||||
<h2 id="org4aeb169"><span class="section-number-2">1</span> Context</h2>
|
||||
<div id="outline-container-org16f1ec9" class="outline-2">
|
||||
<h2 id="org16f1ec9"><span class="section-number-2">1</span> Context</h2>
|
||||
<div class="outline-text-2" id="text-1">
|
||||
<p>
|
||||
The following arrays are stored in the context:
|
||||
@ -503,8 +503,8 @@ coefficient = [ 0.006068, 0.045308, 0.202822, 0.503903, 0.383421,
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org2b77157" class="outline-3">
|
||||
<h3 id="org2b77157"><span class="section-number-3">1.1</span> Data structure</h3>
|
||||
<div id="outline-container-orgceeeeec" class="outline-3">
|
||||
<h3 id="orgceeeeec"><span class="section-number-3">1.1</span> Data structure</h3>
|
||||
<div class="outline-text-3" id="text-1-1">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">qmckl_ao_basis_struct</span> {
|
||||
@ -533,8 +533,8 @@ struct is then initialized and <code>provided == true</code>.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgf141f34" class="outline-3">
|
||||
<h3 id="orgf141f34"><span class="section-number-3">1.2</span> Access functions</h3>
|
||||
<div id="outline-container-orgede4c0e" class="outline-3">
|
||||
<h3 id="orgede4c0e"><span class="section-number-3">1.2</span> Access functions</h3>
|
||||
<div class="outline-text-3" id="text-1-2">
|
||||
<p>
|
||||
When all the data for the AOs have been provided, the following
|
||||
@ -548,8 +548,8 @@ function returns <code>true</code>.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org9ba935f" class="outline-3">
|
||||
<h3 id="org9ba935f"><span class="section-number-3">1.3</span> Initialization functions</h3>
|
||||
<div id="outline-container-orgb08f0fa" class="outline-3">
|
||||
<h3 id="orgb08f0fa"><span class="section-number-3">1.3</span> Initialization functions</h3>
|
||||
<div class="outline-text-3" id="text-1-3">
|
||||
<p>
|
||||
To set the basis set, all the following functions need to be
|
||||
@ -572,17 +572,17 @@ called. When
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org4ef131e" class="outline-3">
|
||||
<h3 id="org4ef131e"><span class="section-number-3">1.4</span> <span class="todo TODO">TODO</span> Fortran interfaces</h3>
|
||||
<div id="outline-container-org1c59889" class="outline-3">
|
||||
<h3 id="org1c59889"><span class="section-number-3">1.4</span> <span class="todo TODO">TODO</span> Fortran interfaces</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org960323c" class="outline-2">
|
||||
<h2 id="org960323c"><span class="section-number-2">2</span> Polynomial part</h2>
|
||||
<div id="outline-container-org7c1fc57" class="outline-2">
|
||||
<h2 id="org7c1fc57"><span class="section-number-2">2</span> Polynomial part</h2>
|
||||
<div class="outline-text-2" id="text-2">
|
||||
</div>
|
||||
<div id="outline-container-org26826da" class="outline-3">
|
||||
<h3 id="org26826da"><span class="section-number-3">2.1</span> Powers of \(x-X_i\)</h3>
|
||||
<div id="outline-container-orgf7a2003" class="outline-3">
|
||||
<h3 id="orgf7a2003"><span class="section-number-3">2.1</span> Powers of \(x-X_i\)</h3>
|
||||
<div class="outline-text-3" id="text-2-1">
|
||||
<p>
|
||||
The <code>qmckl_ao_power</code> function computes all the powers of the <code>n</code>
|
||||
@ -594,7 +594,7 @@ the \(n\) points:
|
||||
\[ P_{ik} = X_i^k \]
|
||||
</p>
|
||||
|
||||
<table id="org4522219" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
<table id="org40d3f44" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
|
||||
|
||||
<colgroup>
|
||||
@ -652,8 +652,8 @@ the \(n\) points:
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgf066fd3" class="outline-4">
|
||||
<h4 id="orgf066fd3"><span class="section-number-4">2.1.1</span> Requirements</h4>
|
||||
<div id="outline-container-org3452a49" class="outline-4">
|
||||
<h4 id="org3452a49"><span class="section-number-4">2.1.1</span> Requirements</h4>
|
||||
<div class="outline-text-4" id="text-2-1-1">
|
||||
<ul class="org-ul">
|
||||
<li><code>context</code> is not <code>QMCKL_NULL_CONTEXT</code></li>
|
||||
@ -666,8 +666,8 @@ the \(n\) points:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org514fb42" class="outline-4">
|
||||
<h4 id="org514fb42"><span class="section-number-4">2.1.2</span> C Header</h4>
|
||||
<div id="outline-container-org7f29123" class="outline-4">
|
||||
<h4 id="org7f29123"><span class="section-number-4">2.1.2</span> C Header</h4>
|
||||
<div class="outline-text-4" id="text-2-1-2">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_ao_power</span> (
|
||||
@ -682,8 +682,8 @@ the \(n\) points:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org6351e78" class="outline-4">
|
||||
<h4 id="org6351e78"><span class="section-number-4">2.1.3</span> Source</h4>
|
||||
<div id="outline-container-org78e6ffb" class="outline-4">
|
||||
<h4 id="org78e6ffb"><span class="section-number-4">2.1.3</span> Source</h4>
|
||||
<div class="outline-text-4" id="text-2-1-3">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-f90"><span style="color: #228b22;">integer </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">qmckl_ao_power_f</span><span style="color: #000000; background-color: #ffffff;">(context, n, X, LMAX, P, ldp) result(info)</span>
|
||||
@ -734,15 +734,15 @@ the \(n\) points:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgc05b9b8" class="outline-4">
|
||||
<h4 id="orgc05b9b8"><span class="section-number-4">2.1.4</span> C interface</h4>
|
||||
<div id="outline-container-org998ae2c" class="outline-4">
|
||||
<h4 id="org998ae2c"><span class="section-number-4">2.1.4</span> C interface</h4>
|
||||
</div>
|
||||
<div id="outline-container-org466243c" class="outline-4">
|
||||
<h4 id="org466243c"><span class="section-number-4">2.1.5</span> Fortran interface</h4>
|
||||
<div id="outline-container-orgca41eee" class="outline-4">
|
||||
<h4 id="orgca41eee"><span class="section-number-4">2.1.5</span> Fortran interface</h4>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org874a51a" class="outline-4">
|
||||
<h4 id="org874a51a"><span class="section-number-4">2.1.6</span> Test</h4>
|
||||
<div id="outline-container-orgb070311" class="outline-4">
|
||||
<h4 id="orgb070311"><span class="section-number-4">2.1.6</span> Test</h4>
|
||||
<div class="outline-text-4" id="text-2-1-6">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-f90"><span style="color: #228b22;">integer</span>(<span style="color: #008b8b;">c_int32_t</span>) <span style="color: #a020f0;">function</span> <span style="color: #0000ff;">test_qmckl_ao_power</span>(context) <span style="color: #a020f0;">bind</span>(C)
|
||||
@ -793,8 +793,8 @@ the \(n\) points:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgab07155" class="outline-3">
|
||||
<h3 id="orgab07155"><span class="section-number-3">2.2</span> Value, Gradient and Laplacian of a polynomial</h3>
|
||||
<div id="outline-container-org87d9624" class="outline-3">
|
||||
<h3 id="org87d9624"><span class="section-number-3">2.2</span> Value, Gradient and Laplacian of a polynomial</h3>
|
||||
<div class="outline-text-3" id="text-2-2">
|
||||
<p>
|
||||
A polynomial is centered on a nucleus \(\mathbf{R}_i\)
|
||||
@ -839,7 +839,7 @@ Laplacians at a given point in space, of all polynomials with an
|
||||
angular momentum up to <code>lmax</code>.
|
||||
</p>
|
||||
|
||||
<table id="org0a6c351" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
<table id="orgd204381" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
|
||||
|
||||
<colgroup>
|
||||
@ -918,8 +918,8 @@ angular momentum up to <code>lmax</code>.
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org6fdf5dc" class="outline-4">
|
||||
<h4 id="org6fdf5dc"><span class="section-number-4">2.2.1</span> Requirements</h4>
|
||||
<div id="outline-container-org8c20ef8" class="outline-4">
|
||||
<h4 id="org8c20ef8"><span class="section-number-4">2.2.1</span> Requirements</h4>
|
||||
<div class="outline-text-4" id="text-2-2-1">
|
||||
<ul class="org-ul">
|
||||
<li><code>context</code> is not <code>QMCKL_NULL_CONTEXT</code></li>
|
||||
@ -944,8 +944,8 @@ For example, with a=0, b=2 and c=1 the string is "yyz"</li>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org053d276" class="outline-4">
|
||||
<h4 id="org053d276"><span class="section-number-4">2.2.2</span> C Header</h4>
|
||||
<div id="outline-container-org3ab8e2b" class="outline-4">
|
||||
<h4 id="org3ab8e2b"><span class="section-number-4">2.2.2</span> C Header</h4>
|
||||
<div class="outline-text-4" id="text-2-2-2">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_ao_polynomial_vgl</span> (
|
||||
@ -963,8 +963,8 @@ For example, with a=0, b=2 and c=1 the string is "yyz"</li>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org7f01ece" class="outline-4">
|
||||
<h4 id="org7f01ece"><span class="section-number-4">2.2.3</span> Source</h4>
|
||||
<div id="outline-container-orgf8ba43c" class="outline-4">
|
||||
<h4 id="orgf8ba43c"><span class="section-number-4">2.2.3</span> Source</h4>
|
||||
<div class="outline-text-4" id="text-2-2-3">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-f90"><span style="color: #228b22;">integer </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">qmckl_ao_polynomial_vgl_f</span><span style="color: #000000; background-color: #ffffff;">(context, X, R, lmax, n, L, ldl, VGL, ldv) result(info)</span>
|
||||
@ -1099,16 +1099,16 @@ For example, with a=0, b=2 and c=1 the string is "yyz"</li>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgc90c63c" class="outline-4">
|
||||
<h4 id="orgc90c63c"><span class="section-number-4">2.2.4</span> C interface</h4>
|
||||
<div id="outline-container-org2200411" class="outline-4">
|
||||
<h4 id="org2200411"><span class="section-number-4">2.2.4</span> C interface</h4>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org90594ca" class="outline-4">
|
||||
<h4 id="org90594ca"><span class="section-number-4">2.2.5</span> Fortran interface</h4>
|
||||
<div id="outline-container-org1e95396" class="outline-4">
|
||||
<h4 id="org1e95396"><span class="section-number-4">2.2.5</span> Fortran interface</h4>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org1cd6a0b" class="outline-4">
|
||||
<h4 id="org1cd6a0b"><span class="section-number-4">2.2.6</span> Test</h4>
|
||||
<div id="outline-container-org9e4cf63" class="outline-4">
|
||||
<h4 id="org9e4cf63"><span class="section-number-4">2.2.6</span> Test</h4>
|
||||
<div class="outline-text-4" id="text-2-2-6">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-f90"><span style="color: #228b22;">integer</span>(<span style="color: #008b8b;">c_int32_t</span>) <span style="color: #a020f0;">function</span> <span style="color: #0000ff;">test_qmckl_ao_polynomial_vgl</span>(context) <span style="color: #a020f0;">bind</span>(C)
|
||||
@ -1213,12 +1213,12 @@ munit_assert_int(0, ==, test_qmckl_ao_polynomial_vgl(context));
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgddb9423" class="outline-2">
|
||||
<h2 id="orgddb9423"><span class="section-number-2">3</span> Radial part</h2>
|
||||
<div id="outline-container-org679adac" class="outline-2">
|
||||
<h2 id="org679adac"><span class="section-number-2">3</span> Radial part</h2>
|
||||
<div class="outline-text-2" id="text-3">
|
||||
</div>
|
||||
<div id="outline-container-orgb77fbb4" class="outline-3">
|
||||
<h3 id="orgb77fbb4"><span class="section-number-3">3.1</span> Gaussian basis functions</h3>
|
||||
<div id="outline-container-orgb1f1165" class="outline-3">
|
||||
<h3 id="orgb1f1165"><span class="section-number-3">3.1</span> Gaussian basis functions</h3>
|
||||
<div class="outline-text-3" id="text-3-1">
|
||||
<p>
|
||||
<code>qmckl_ao_gaussian_vgl</code> computes the values, gradients and
|
||||
@ -1450,21 +1450,21 @@ Requirements
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgca3a9c3" class="outline-3">
|
||||
<h3 id="orgca3a9c3"><span class="section-number-3">3.2</span> <span class="todo TODO">TODO</span> Slater basis functions</h3>
|
||||
<div id="outline-container-org11f527f" class="outline-3">
|
||||
<h3 id="org11f527f"><span class="section-number-3">3.2</span> <span class="todo TODO">TODO</span> Slater basis functions</h3>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org1d2d1c6" class="outline-3">
|
||||
<h3 id="org1d2d1c6"><span class="section-number-3">3.3</span> <span class="todo TODO">TODO</span> Radial functions on a grid</h3>
|
||||
<div id="outline-container-org20b79f3" class="outline-3">
|
||||
<h3 id="org20b79f3"><span class="section-number-3">3.3</span> <span class="todo TODO">TODO</span> Radial functions on a grid</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div id="outline-container-org6707378" class="outline-2">
|
||||
<h2 id="org6707378"><span class="section-number-2">4</span> Combining radial and polynomial parts</h2>
|
||||
<div id="outline-container-org18fae86" class="outline-2">
|
||||
<h2 id="org18fae86"><span class="section-number-2">4</span> Combining radial and polynomial parts</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div id="postamble" class="status">
|
||||
<p class="author">Author: TREX CoE</p>
|
||||
<p class="date">Created: 2021-04-21 Wed 11:31</p>
|
||||
<p class="date">Created: 2021-04-25 Sun 23:49</p>
|
||||
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
|
||||
</div>
|
||||
</body>
|
||||
|
@ -3,7 +3,7 @@
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<!-- 2021-04-21 Wed 11:31 -->
|
||||
<!-- 2021-04-25 Sun 23:49 -->
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Context</title>
|
||||
@ -311,21 +311,21 @@ for the JavaScript code in this tag.
|
||||
<h2>Table of Contents</h2>
|
||||
<div id="text-table-of-contents">
|
||||
<ul>
|
||||
<li><a href="#org5665b0d">1. Context handling</a>
|
||||
<li><a href="#org4c7a77f">1. Context handling</a>
|
||||
<ul>
|
||||
<li><a href="#orgb22af19">1.1. Data structure</a></li>
|
||||
<li><a href="#org9ced637">1.2. Creation</a></li>
|
||||
<li><a href="#org1cee4e8">1.3. Locking</a></li>
|
||||
<li><a href="#orged1bba1">1.4. <span class="todo TODO">TODO</span> Copy</a></li>
|
||||
<li><a href="#org8ccfd2e">1.5. Destroy</a></li>
|
||||
<li><a href="#org18bdad7">1.1. Data structure</a></li>
|
||||
<li><a href="#orgd1a792c">1.2. Creation</a></li>
|
||||
<li><a href="#org988ea75">1.3. Locking</a></li>
|
||||
<li><a href="#org53dc43c">1.4. <span class="todo TODO">TODO</span> Copy</a></li>
|
||||
<li><a href="#org646ddd6">1.5. Destroy</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org5665b0d" class="outline-2">
|
||||
<h2 id="org5665b0d"><span class="section-number-2">1</span> Context handling</h2>
|
||||
<div id="outline-container-org4c7a77f" class="outline-2">
|
||||
<h2 id="org4c7a77f"><span class="section-number-2">1</span> Context handling</h2>
|
||||
<div class="outline-text-2" id="text-1">
|
||||
<p>
|
||||
The context variable is a handle for the state of the library,
|
||||
@ -338,7 +338,7 @@ A value of <code>QMCKL_NULL_CONTEXT</code> for the context is equivalent to a
|
||||
</p>
|
||||
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-c" id="org6243ac1"><span style="color: #a020f0;">typedef</span> <span style="color: #228b22;">int64_t</span> <span style="color: #228b22;">qmckl_context</span> ;
|
||||
<pre class="src src-c" id="org639b6a7"><span style="color: #a020f0;">typedef</span> <span style="color: #228b22;">int64_t</span> <span style="color: #228b22;">qmckl_context</span> ;
|
||||
<span style="color: #483d8b;">#define</span> <span style="color: #a0522d;">QMCKL_NULL_CONTEXT</span> (qmckl_context) 0
|
||||
</pre>
|
||||
</div>
|
||||
@ -356,8 +356,8 @@ and <code>ctx</code> is a <code>qmckl_context_struct*</code> pointer.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgb22af19" class="outline-3">
|
||||
<h3 id="orgb22af19"><span class="section-number-3">1.1</span> Data structure</h3>
|
||||
<div id="outline-container-org18bdad7" class="outline-3">
|
||||
<h3 id="org18bdad7"><span class="section-number-3">1.1</span> Data structure</h3>
|
||||
<div class="outline-text-3" id="text-1-1">
|
||||
<p>
|
||||
The context keeps a ``date'' that allows to check which data needs
|
||||
@ -367,7 +367,7 @@ coordinates are updated.
|
||||
|
||||
<p>
|
||||
When a new element is added to the context, the functions
|
||||
<a href="#org9ced637">qmckl<sub>context</sub><sub>create</sub></a>, <a href="#org8ccfd2e">qmckl<sub>context</sub><sub>destroy</sub></a> and <a href="#orged1bba1">qmckl<sub>context</sub><sub>copy</sub></a>
|
||||
<a href="#orgd1a792c">qmckl<sub>context</sub><sub>create</sub></a>, <a href="#org646ddd6">qmckl<sub>context</sub><sub>destroy</sub></a> and <a href="#org53dc43c">qmckl<sub>context</sub><sub>copy</sub></a>
|
||||
should be updated inorder to make deep copies.
|
||||
</p>
|
||||
|
||||
@ -416,8 +416,8 @@ if the context is valid, <code>QMCKL_NULL_CONTEXT</code> otherwise.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org9ced637" class="outline-3">
|
||||
<h3 id="org9ced637"><span class="section-number-3">1.2</span> Creation</h3>
|
||||
<div id="outline-container-orgd1a792c" class="outline-3">
|
||||
<h3 id="orgd1a792c"><span class="section-number-3">1.2</span> Creation</h3>
|
||||
<div class="outline-text-3" id="text-1-2">
|
||||
<p>
|
||||
To create a new context, <code>qmckl_context_create()</code> should be used.
|
||||
@ -468,7 +468,7 @@ To create a new context, <code>qmckl_context_create()</code> should be used.
|
||||
ctx->numprec.range = QMCKL_DEFAULT_RANGE;
|
||||
|
||||
ctx->ao_basis.uninitialized = (1 << 10) - 1;
|
||||
ctx->electron.uninitialized = (1 << 4) - 1;
|
||||
ctx->electron.uninitialized = (1 << 2) - 1;
|
||||
|
||||
/* <span style="color: #b22222;">Allocate qmckl_memory_struct </span>*/
|
||||
{
|
||||
@ -491,8 +491,8 @@ To create a new context, <code>qmckl_context_create()</code> should be used.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="outline-container-org1cee4e8" class="outline-3">
|
||||
<h3 id="org1cee4e8"><span class="section-number-3">1.3</span> Locking</h3>
|
||||
<div id="outline-container-org988ea75" class="outline-3">
|
||||
<h3 id="org988ea75"><span class="section-number-3">1.3</span> Locking</h3>
|
||||
<div class="outline-text-3" id="text-1-3">
|
||||
<p>
|
||||
For thread safety, the context may be locked/unlocked. The lock is
|
||||
@ -537,8 +537,8 @@ number of times the thread has locked it is saved in the
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orged1bba1" class="outline-3">
|
||||
<h3 id="orged1bba1"><span class="section-number-3">1.4</span> <span class="todo TODO">TODO</span> Copy</h3>
|
||||
<div id="outline-container-org53dc43c" class="outline-3">
|
||||
<h3 id="org53dc43c"><span class="section-number-3">1.4</span> <span class="todo TODO">TODO</span> Copy</h3>
|
||||
<div class="outline-text-3" id="text-1-4">
|
||||
<p>
|
||||
<code>qmckl_context_copy</code> makes a deep copy of a context. It returns
|
||||
@ -586,8 +586,8 @@ number of times the thread has locked it is saved in the
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="outline-container-org8ccfd2e" class="outline-3">
|
||||
<h3 id="org8ccfd2e"><span class="section-number-3">1.5</span> Destroy</h3>
|
||||
<div id="outline-container-org646ddd6" class="outline-3">
|
||||
<h3 id="org646ddd6"><span class="section-number-3">1.5</span> Destroy</h3>
|
||||
<div class="outline-text-3" id="text-1-5">
|
||||
<p>
|
||||
The context is destroyed with <code>qmckl_context_destroy</code>, leaving the ancestors untouched.
|
||||
@ -641,7 +641,7 @@ It frees the context, and returns the previous context.
|
||||
</div>
|
||||
<div id="postamble" class="status">
|
||||
<p class="author">Author: TREX CoE</p>
|
||||
<p class="date">Created: 2021-04-21 Wed 11:31</p>
|
||||
<p class="date">Created: 2021-04-25 Sun 23:49</p>
|
||||
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
|
||||
</div>
|
||||
</body>
|
||||
|
@ -3,7 +3,7 @@
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<!-- 2021-04-21 Wed 11:31 -->
|
||||
<!-- 2021-04-25 Sun 23:49 -->
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Inter-particle distances</title>
|
||||
@ -333,14 +333,26 @@ for the JavaScript code in this tag.
|
||||
<h2>Table of Contents</h2>
|
||||
<div id="text-table-of-contents">
|
||||
<ul>
|
||||
<li><a href="#org9ea8105">1. Squared distance</a>
|
||||
<li><a href="#org76b01bc">1. Squared distance</a>
|
||||
<ul>
|
||||
<li><a href="#org7d4d26a">1.1. <code>qmckl_distance_sq</code></a>
|
||||
<li><a href="#org74397e4">1.1. <code>qmckl_distance_sq</code></a>
|
||||
<ul>
|
||||
<li><a href="#orgac93248">1.1.1. Requirements</a></li>
|
||||
<li><a href="#org44fa451">1.1.2. C header</a></li>
|
||||
<li><a href="#orgee1bb15">1.1.3. Source</a></li>
|
||||
<li><a href="#org99644c4">1.1.4. Performance</a></li>
|
||||
<li><a href="#org6d9b7e8">1.1.1. Requirements</a></li>
|
||||
<li><a href="#org921cc73">1.1.2. C header</a></li>
|
||||
<li><a href="#orgd26c46e">1.1.3. Source</a></li>
|
||||
<li><a href="#orgc2a4bcf">1.1.4. Performance</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#org8343488">2. Distance</a>
|
||||
<ul>
|
||||
<li><a href="#orgd49368d">2.1. <code>qmckl_distance</code></a>
|
||||
<ul>
|
||||
<li><a href="#orgcefcd76">2.1.1. Requirements</a></li>
|
||||
<li><a href="#orga0a84c4">2.1.2. C header</a></li>
|
||||
<li><a href="#org4166741">2.1.3. Source</a></li>
|
||||
<li><a href="#org4471fd5">2.1.4. Performance</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@ -349,12 +361,12 @@ for the JavaScript code in this tag.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org9ea8105" class="outline-2">
|
||||
<h2 id="org9ea8105"><span class="section-number-2">1</span> Squared distance</h2>
|
||||
<div id="outline-container-org76b01bc" class="outline-2">
|
||||
<h2 id="org76b01bc"><span class="section-number-2">1</span> Squared distance</h2>
|
||||
<div class="outline-text-2" id="text-1">
|
||||
</div>
|
||||
<div id="outline-container-org7d4d26a" class="outline-3">
|
||||
<h3 id="org7d4d26a"><span class="section-number-3">1.1</span> <code>qmckl_distance_sq</code></h3>
|
||||
<div id="outline-container-org74397e4" class="outline-3">
|
||||
<h3 id="org74397e4"><span class="section-number-3">1.1</span> <code>qmckl_distance_sq</code></h3>
|
||||
<div class="outline-text-3" id="text-1-1">
|
||||
<p>
|
||||
<code>qmckl_distance_sq</code> computes the matrix of the squared distances
|
||||
@ -367,7 +379,7 @@ between all pairs of points in two sets, one point within each set:
|
||||
\]
|
||||
</p>
|
||||
|
||||
<table id="orgcb933e2" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
<table id="orgc075641" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
|
||||
|
||||
<colgroup>
|
||||
@ -460,8 +472,8 @@ between all pairs of points in two sets, one point within each set:
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgac93248" class="outline-4">
|
||||
<h4 id="orgac93248"><span class="section-number-4">1.1.1</span> Requirements</h4>
|
||||
<div id="outline-container-org6d9b7e8" class="outline-4">
|
||||
<h4 id="org6d9b7e8"><span class="section-number-4">1.1.1</span> Requirements</h4>
|
||||
<div class="outline-text-4" id="text-1-1-1">
|
||||
<ul class="org-ul">
|
||||
<li><code>context</code> is not <code>QMCKL_NULL_CONTEXT</code></li>
|
||||
@ -479,11 +491,11 @@ between all pairs of points in two sets, one point within each set:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org44fa451" class="outline-4">
|
||||
<h4 id="org44fa451"><span class="section-number-4">1.1.2</span> C header</h4>
|
||||
<div id="outline-container-org921cc73" class="outline-4">
|
||||
<h4 id="org921cc73"><span class="section-number-4">1.1.2</span> C header</h4>
|
||||
<div class="outline-text-4" id="text-1-1-2">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_distance_sq</span> (
|
||||
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_distance</span> (
|
||||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>,
|
||||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">char</span> <span style="color: #a0522d;">transa</span>,
|
||||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">char</span> <span style="color: #a0522d;">transb</span>,
|
||||
@ -500,11 +512,13 @@ between all pairs of points in two sets, one point within each set:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgee1bb15" class="outline-4">
|
||||
<h4 id="orgee1bb15"><span class="section-number-4">1.1.3</span> Source</h4>
|
||||
<div id="outline-container-orgd26c46e" class="outline-4">
|
||||
<h4 id="orgd26c46e"><span class="section-number-4">1.1.3</span> Source</h4>
|
||||
<div class="outline-text-4" id="text-1-1-3">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-f90"><span style="color: #228b22;">integer </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">qmckl_distance_sq_f</span><span style="color: #000000; background-color: #ffffff;">(context, transa, transb, m, n, A, LDA, B, LDB, C, LDC) result(info)</span>
|
||||
<pre class="src src-f90"><span style="color: #228b22;">integer</span><span style="color: #a0522d;"> function qmckl_distance_sq_f(context, transa, transb, m, n, </span><span style="color: #a020f0;">&</span>
|
||||
A, LDA, B, LDB, C, LDC) <span style="color: #a020f0;">&</span>
|
||||
<span style="color: #a020f0;">result</span>(info)
|
||||
<span style="color: #a020f0;">use</span> <span style="color: #0000ff;">qmckl</span>
|
||||
<span style="color: #a020f0;">implicit</span> <span style="color: #228b22;">none</span>
|
||||
<span style="color: #228b22;">integer</span>(qmckl_context) , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> context</span>
|
||||
@ -521,7 +535,7 @@ between all pairs of points in two sets, one point within each set:
|
||||
<span style="color: #228b22;">real</span>*8 ::<span style="color: #a0522d;"> x, y, z</span>
|
||||
<span style="color: #228b22;">integer</span> ::<span style="color: #a0522d;"> transab</span>
|
||||
|
||||
info = 0
|
||||
info = QMCKL_SUCCESS
|
||||
|
||||
<span style="color: #a020f0;">if</span> (context == QMCKL_NULL_CONTEXT) <span style="color: #a020f0;">then</span>
|
||||
info = QMCKL_INVALID_CONTEXT
|
||||
@ -634,8 +648,8 @@ between all pairs of points in two sets, one point within each set:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org99644c4" class="outline-4">
|
||||
<h4 id="org99644c4"><span class="section-number-4">1.1.4</span> Performance</h4>
|
||||
<div id="outline-container-orgc2a4bcf" class="outline-4">
|
||||
<h4 id="orgc2a4bcf"><span class="section-number-4">1.1.4</span> Performance</h4>
|
||||
<div class="outline-text-4" id="text-1-1-4">
|
||||
<p>
|
||||
This function might be more efficient when <code>A</code> and <code>B</code> are
|
||||
@ -645,10 +659,312 @@ transposed.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="outline-container-org8343488" class="outline-2">
|
||||
<h2 id="org8343488"><span class="section-number-2">2</span> Distance</h2>
|
||||
<div class="outline-text-2" id="text-2">
|
||||
</div>
|
||||
<div id="outline-container-orgd49368d" class="outline-3">
|
||||
<h3 id="orgd49368d"><span class="section-number-3">2.1</span> <code>qmckl_distance</code></h3>
|
||||
<div class="outline-text-3" id="text-2-1">
|
||||
<p>
|
||||
<code>qmckl_distance</code> computes the matrix of the distances between all
|
||||
pairs of points in two sets, one point within each set:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
\[
|
||||
C_{ij} = \sqrt{\sum_{k=1}^3 (A_{k,i}-B_{k,j})^2}
|
||||
\]
|
||||
</p>
|
||||
|
||||
<table id="org2c7047a" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
|
||||
|
||||
<colgroup>
|
||||
<col class="org-left" />
|
||||
|
||||
<col class="org-left" />
|
||||
|
||||
<col class="org-left" />
|
||||
|
||||
<col class="org-left" />
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="org-left">qmckl<sub>context</sub></td>
|
||||
<td class="org-left">context</td>
|
||||
<td class="org-left">in</td>
|
||||
<td class="org-left">Global state</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left">char</td>
|
||||
<td class="org-left">transa</td>
|
||||
<td class="org-left">in</td>
|
||||
<td class="org-left">Array <code>A</code> is <code>'N'</code>: Normal, <code>'T'</code>: Transposed</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left">char</td>
|
||||
<td class="org-left">transb</td>
|
||||
<td class="org-left">in</td>
|
||||
<td class="org-left">Array <code>B</code> is <code>'N'</code>: Normal, <code>'T'</code>: Transposed</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left">int64<sub>t</sub></td>
|
||||
<td class="org-left">m</td>
|
||||
<td class="org-left">in</td>
|
||||
<td class="org-left">Number of points in the first set</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left">int64<sub>t</sub></td>
|
||||
<td class="org-left">n</td>
|
||||
<td class="org-left">in</td>
|
||||
<td class="org-left">Number of points in the second set</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left">double</td>
|
||||
<td class="org-left">A[][lda]</td>
|
||||
<td class="org-left">in</td>
|
||||
<td class="org-left">Array containing the \(m \times 3\) matrix \(A\)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left">int64<sub>t</sub></td>
|
||||
<td class="org-left">lda</td>
|
||||
<td class="org-left">in</td>
|
||||
<td class="org-left">Leading dimension of array <code>A</code></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left">double</td>
|
||||
<td class="org-left">B[][ldb]</td>
|
||||
<td class="org-left">in</td>
|
||||
<td class="org-left">Array containing the \(n \times 3\) matrix \(B\)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left">int64<sub>t</sub></td>
|
||||
<td class="org-left">ldb</td>
|
||||
<td class="org-left">in</td>
|
||||
<td class="org-left">Leading dimension of array <code>B</code></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left">double</td>
|
||||
<td class="org-left">C[n][ldc]</td>
|
||||
<td class="org-left">out</td>
|
||||
<td class="org-left">Array containing the \(m \times n\) matrix \(C\)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left">int64<sub>t</sub></td>
|
||||
<td class="org-left">ldc</td>
|
||||
<td class="org-left">in</td>
|
||||
<td class="org-left">Leading dimension of array <code>C</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgcefcd76" class="outline-4">
|
||||
<h4 id="orgcefcd76"><span class="section-number-4">2.1.1</span> Requirements</h4>
|
||||
<div class="outline-text-4" id="text-2-1-1">
|
||||
<ul class="org-ul">
|
||||
<li><code>context</code> is not <code>QMCKL_NULL_CONTEXT</code></li>
|
||||
<li><code>m > 0</code></li>
|
||||
<li><code>n > 0</code></li>
|
||||
<li><code>lda >= 3</code> if <code>transa == 'N'</code></li>
|
||||
<li><code>lda >= m</code> if <code>transa == 'T'</code></li>
|
||||
<li><code>ldb >= 3</code> if <code>transb == 'N'</code></li>
|
||||
<li><code>ldb >= n</code> if <code>transb == 'T'</code></li>
|
||||
<li><code>ldc >= m</code></li>
|
||||
<li><code>A</code> is allocated with at least \(3 \times m \times 8\) bytes</li>
|
||||
<li><code>B</code> is allocated with at least \(3 \times n \times 8\) bytes</li>
|
||||
<li><code>C</code> is allocated with at least \(m \times n \times 8\) bytes</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orga0a84c4" class="outline-4">
|
||||
<h4 id="orga0a84c4"><span class="section-number-4">2.1.2</span> C header</h4>
|
||||
<div class="outline-text-4" id="text-2-1-2">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_distance</span> (
|
||||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>,
|
||||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">char</span> <span style="color: #a0522d;">transa</span>,
|
||||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">char</span> <span style="color: #a0522d;">transb</span>,
|
||||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">m</span>,
|
||||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">n</span>,
|
||||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span>* <span style="color: #a0522d;">A</span>,
|
||||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">lda</span>,
|
||||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span>* <span style="color: #a0522d;">B</span>,
|
||||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">ldb</span>,
|
||||
<span style="color: #228b22;">double</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">C</span>,
|
||||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">ldc</span> );
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org4166741" class="outline-4">
|
||||
<h4 id="org4166741"><span class="section-number-4">2.1.3</span> Source</h4>
|
||||
<div class="outline-text-4" id="text-2-1-3">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-f90"><span style="color: #228b22;">integer</span><span style="color: #a0522d;"> function qmckl_distance_f(context, transa, transb, m, n, </span><span style="color: #a020f0;">&</span>
|
||||
A, LDA, B, LDB, C, LDC) <span style="color: #a020f0;">&</span>
|
||||
<span style="color: #a020f0;">result</span>(info)
|
||||
<span style="color: #a020f0;">use</span> <span style="color: #0000ff;">qmckl</span>
|
||||
<span style="color: #a020f0;">implicit</span> <span style="color: #228b22;">none</span>
|
||||
<span style="color: #228b22;">integer</span>(qmckl_context) , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> context</span>
|
||||
<span style="color: #228b22;">character</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> transa, transb</span>
|
||||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> m, n</span>
|
||||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> lda</span>
|
||||
<span style="color: #228b22;">real</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> A(lda,*)</span>
|
||||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> ldb</span>
|
||||
<span style="color: #228b22;">real</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> B(ldb,*)</span>
|
||||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> ldc</span>
|
||||
<span style="color: #228b22;">real</span>*8 , <span style="color: #a020f0;">intent</span>(out) ::<span style="color: #a0522d;"> C(ldc,*)</span>
|
||||
|
||||
<span style="color: #228b22;">integer</span>*8 ::<span style="color: #a0522d;"> i,j</span>
|
||||
<span style="color: #228b22;">real</span>*8 ::<span style="color: #a0522d;"> x, y, z</span>
|
||||
<span style="color: #228b22;">integer</span> ::<span style="color: #a0522d;"> transab</span>
|
||||
|
||||
info = QMCKL_SUCCESS
|
||||
|
||||
<span style="color: #a020f0;">if</span> (context == QMCKL_NULL_CONTEXT) <span style="color: #a020f0;">then</span>
|
||||
info = QMCKL_INVALID_CONTEXT
|
||||
<span style="color: #a020f0;">return</span>
|
||||
<span style="color: #a020f0;">endif</span>
|
||||
|
||||
<span style="color: #a020f0;">if</span> (m <= 0_8) <span style="color: #a020f0;">then</span>
|
||||
info = QMCKL_INVALID_ARG_4
|
||||
<span style="color: #a020f0;">return</span>
|
||||
<span style="color: #a020f0;">endif</span>
|
||||
|
||||
<span style="color: #a020f0;">if</span> (n <= 0_8) <span style="color: #a020f0;">then</span>
|
||||
info = QMCKL_INVALID_ARG_5
|
||||
<span style="color: #a020f0;">return</span>
|
||||
<span style="color: #a020f0;">endif</span>
|
||||
|
||||
<span style="color: #a020f0;">if</span> (transa == <span style="color: #8b2252;">'N'</span> <span style="color: #a020f0;">.or.</span> transa == <span style="color: #8b2252;">'n'</span>) <span style="color: #a020f0;">then</span>
|
||||
transab = 0
|
||||
<span style="color: #a020f0;">else if</span> (transa == <span style="color: #8b2252;">'T'</span> <span style="color: #a020f0;">.or.</span> transa == <span style="color: #8b2252;">'t'</span>) <span style="color: #a020f0;">then</span>
|
||||
transab = 1
|
||||
<span style="color: #a020f0;">else</span>
|
||||
transab = -100
|
||||
<span style="color: #a020f0;">endif</span>
|
||||
|
||||
<span style="color: #a020f0;">if</span> (transb == <span style="color: #8b2252;">'N'</span> <span style="color: #a020f0;">.or.</span> transb == <span style="color: #8b2252;">'n'</span>) <span style="color: #a020f0;">then</span>
|
||||
<span style="color: #a020f0;">continue</span>
|
||||
<span style="color: #a020f0;">else if</span> (transa == <span style="color: #8b2252;">'T'</span> <span style="color: #a020f0;">.or.</span> transa == <span style="color: #8b2252;">'t'</span>) <span style="color: #a020f0;">then</span>
|
||||
transab = transab + 2
|
||||
<span style="color: #a020f0;">else</span>
|
||||
transab = -100
|
||||
<span style="color: #a020f0;">endif</span>
|
||||
|
||||
<span style="color: #a020f0;">if</span> (transab < 0) <span style="color: #a020f0;">then</span>
|
||||
info = QMCKL_INVALID_ARG_1
|
||||
<span style="color: #a020f0;">return</span>
|
||||
<span style="color: #a020f0;">endif</span>
|
||||
|
||||
<span style="color: #a020f0;">if</span> (<span style="color: #a020f0;">iand</span>(transab,1) == 0 <span style="color: #a020f0;">.and.</span> LDA < 3) <span style="color: #a020f0;">then</span>
|
||||
info = QMCKL_INVALID_ARG_7
|
||||
<span style="color: #a020f0;">return</span>
|
||||
<span style="color: #a020f0;">endif</span>
|
||||
|
||||
<span style="color: #a020f0;">if</span> (<span style="color: #a020f0;">iand</span>(transab,1) == 1 <span style="color: #a020f0;">.and.</span> LDA < m) <span style="color: #a020f0;">then</span>
|
||||
info = QMCKL_INVALID_ARG_7
|
||||
<span style="color: #a020f0;">return</span>
|
||||
<span style="color: #a020f0;">endif</span>
|
||||
|
||||
<span style="color: #a020f0;">if</span> (<span style="color: #a020f0;">iand</span>(transab,2) == 0 <span style="color: #a020f0;">.and.</span> LDA < 3) <span style="color: #a020f0;">then</span>
|
||||
info = QMCKL_INVALID_ARG_7
|
||||
<span style="color: #a020f0;">return</span>
|
||||
<span style="color: #a020f0;">endif</span>
|
||||
|
||||
<span style="color: #a020f0;">if</span> (<span style="color: #a020f0;">iand</span>(transab,2) == 2 <span style="color: #a020f0;">.and.</span> LDA < m) <span style="color: #a020f0;">then</span>
|
||||
info = QMCKL_INVALID_ARG_7
|
||||
<span style="color: #a020f0;">return</span>
|
||||
<span style="color: #a020f0;">endif</span>
|
||||
|
||||
|
||||
<span style="color: #a020f0;">select case</span> (transab)
|
||||
|
||||
<span style="color: #a020f0;">case</span>(0)
|
||||
|
||||
<span style="color: #a020f0;">do</span> j=1,n
|
||||
<span style="color: #a020f0;">do</span> i=1,m
|
||||
x = A(1,i) - B(1,j)
|
||||
y = A(2,i) - B(2,j)
|
||||
z = A(3,i) - B(3,j)
|
||||
C(i,j) = x*x + y*y + z*z
|
||||
<span style="color: #a020f0;">end do</span>
|
||||
C(:,j) = dsqrt(C(:,j))
|
||||
<span style="color: #a020f0;">end do</span>
|
||||
|
||||
<span style="color: #a020f0;">case</span>(1)
|
||||
|
||||
<span style="color: #a020f0;">do</span> j=1,n
|
||||
<span style="color: #a020f0;">do</span> i=1,m
|
||||
x = A(i,1) - B(1,j)
|
||||
y = A(i,2) - B(2,j)
|
||||
z = A(i,3) - B(3,j)
|
||||
C(i,j) = x*x + y*y + z*z
|
||||
<span style="color: #a020f0;">end do</span>
|
||||
C(:,j) = dsqrt(C(:,j))
|
||||
<span style="color: #a020f0;">end do</span>
|
||||
|
||||
<span style="color: #a020f0;">case</span>(2)
|
||||
|
||||
<span style="color: #a020f0;">do</span> j=1,n
|
||||
<span style="color: #a020f0;">do</span> i=1,m
|
||||
x = A(1,i) - B(j,1)
|
||||
y = A(2,i) - B(j,2)
|
||||
z = A(3,i) - B(j,3)
|
||||
C(i,j) = x*x + y*y + z*z
|
||||
<span style="color: #a020f0;">end do</span>
|
||||
C(:,j) = dsqrt(C(:,j))
|
||||
<span style="color: #a020f0;">end do</span>
|
||||
|
||||
<span style="color: #a020f0;">case</span>(3)
|
||||
|
||||
<span style="color: #a020f0;">do</span> j=1,n
|
||||
<span style="color: #a020f0;">do</span> i=1,m
|
||||
x = A(i,1) - B(j,1)
|
||||
y = A(i,2) - B(j,2)
|
||||
z = A(i,3) - B(j,3)
|
||||
C(i,j) = x*x + y*y + z*z
|
||||
<span style="color: #a020f0;">end do</span>
|
||||
C(:,j) = dsqrt(C(:,j))
|
||||
<span style="color: #a020f0;">end do</span>
|
||||
|
||||
<span style="color: #a020f0;">end select</span>
|
||||
|
||||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_distance_f</span>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org4471fd5" class="outline-4">
|
||||
<h4 id="org4471fd5"><span class="section-number-4">2.1.4</span> Performance</h4>
|
||||
<div class="outline-text-4" id="text-2-1-4">
|
||||
<p>
|
||||
This function might be more efficient when <code>A</code> and <code>B</code> are
|
||||
transposed.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="postamble" class="status">
|
||||
<p class="author">Author: TREX CoE</p>
|
||||
<p class="date">Created: 2021-04-21 Wed 11:31</p>
|
||||
<p class="date">Created: 2021-04-25 Sun 23:49</p>
|
||||
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
|
||||
</div>
|
||||
</body>
|
||||
|
@ -3,7 +3,7 @@
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<!-- 2021-04-21 Wed 11:31 -->
|
||||
<!-- 2021-04-25 Sun 23:49 -->
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Electrons</title>
|
||||
@ -311,20 +311,31 @@ for the JavaScript code in this tag.
|
||||
<h2>Table of Contents</h2>
|
||||
<div id="text-table-of-contents">
|
||||
<ul>
|
||||
<li><a href="#org051781c">1. Context</a>
|
||||
<li><a href="#org1e649cb">1. Context</a>
|
||||
<ul>
|
||||
<li><a href="#orgfe6b7be">1.1. Data structure</a></li>
|
||||
<li><a href="#org44faf94">1.2. Access functions</a></li>
|
||||
<li><a href="#orgddde970">1.3. Initialization functions</a></li>
|
||||
<li><a href="#orgfe64eba">1.4. Test</a></li>
|
||||
<li><a href="#org5b1f0c1">1.1. Data structure</a></li>
|
||||
<li><a href="#org6eb9e68">1.2. Access functions</a></li>
|
||||
<li><a href="#org8f106f5">1.3. Initialization functions</a></li>
|
||||
<li><a href="#org933bca1">1.4. Test</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#orgd1313f9">2. Computation</a>
|
||||
<ul>
|
||||
<li><a href="#org3db28d6">2.1. Electron-electron distances</a>
|
||||
<ul>
|
||||
<li><a href="#orgb787bba">2.1.1. Get</a></li>
|
||||
<li><a href="#orgaa15136">2.1.2. Compute</a></li>
|
||||
<li><a href="#org9567118">2.1.3. Test</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org051781c" class="outline-2">
|
||||
<h2 id="org051781c"><span class="section-number-2">1</span> Context</h2>
|
||||
<div id="outline-container-org1e649cb" class="outline-2">
|
||||
<h2 id="org1e649cb"><span class="section-number-2">1</span> Context</h2>
|
||||
<div class="outline-text-2" id="text-1">
|
||||
<p>
|
||||
The following data stored in the context:
|
||||
@ -341,12 +352,6 @@ The following data stored in the context:
|
||||
<col class="org-left" />
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="org-left"><code>date</code></td>
|
||||
<td class="org-left">uint64<sub>t</sub></td>
|
||||
<td class="org-left">Last modification date of the coordinates</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left"><code>uninitialized</code></td>
|
||||
<td class="org-left">int32<sub>t</sub></td>
|
||||
@ -394,22 +399,42 @@ The following data stored in the context:
|
||||
<td class="org-left">double[walk<sub>num</sub>][3][num]</td>
|
||||
<td class="org-left">Old set of electron coordinates</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left"><code>coord_new_date</code></td>
|
||||
<td class="org-left">uint64<sub>t</sub></td>
|
||||
<td class="org-left">Last modification date of the coordinates</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left">~ee<sub>distance</sub>~e</td>
|
||||
<td class="org-left">double[walk<sub>num</sub>][num][num]</td>
|
||||
<td class="org-left">Electron-electron distances</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left"><code>ee_distance_date</code></td>
|
||||
<td class="org-left">uint64<sub>t</sub></td>
|
||||
<td class="org-left">Last modification date of the electron-electron distances</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgfe6b7be" class="outline-3">
|
||||
<h3 id="orgfe6b7be"><span class="section-number-3">1.1</span> Data structure</h3>
|
||||
<div id="outline-container-org5b1f0c1" class="outline-3">
|
||||
<h3 id="org5b1f0c1"><span class="section-number-3">1.1</span> Data structure</h3>
|
||||
<div class="outline-text-3" id="text-1-1">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">qmckl_electron_struct</span> {
|
||||
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">date</span>;
|
||||
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">num</span>;
|
||||
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">up_num</span>;
|
||||
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">down_num</span>;
|
||||
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">walk_num</span>;
|
||||
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">coord_new_date</span>;
|
||||
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">ee_distance_date</span>;
|
||||
<span style="color: #228b22;">double</span>* <span style="color: #a0522d;">coord_new</span>;
|
||||
<span style="color: #228b22;">double</span>* <span style="color: #a0522d;">coord_old</span>;
|
||||
<span style="color: #228b22;">double</span>* <span style="color: #a0522d;">ee_distance</span>;
|
||||
<span style="color: #228b22;">int32_t</span> <span style="color: #a0522d;">uninitialized</span>;
|
||||
<span style="color: #228b22;">bool</span> <span style="color: #a0522d;">provided</span>;
|
||||
} <span style="color: #228b22;">qmckl_electron_struct</span>;
|
||||
@ -425,8 +450,8 @@ struct is then initialized and <code>provided == true</code>.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org44faf94" class="outline-3">
|
||||
<h3 id="org44faf94"><span class="section-number-3">1.2</span> Access functions</h3>
|
||||
<div id="outline-container-org6eb9e68" class="outline-3">
|
||||
<h3 id="org6eb9e68"><span class="section-number-3">1.2</span> Access functions</h3>
|
||||
<div class="outline-text-3" id="text-1-2">
|
||||
<p>
|
||||
When all the data relative to electrons have been set, the
|
||||
@ -440,8 +465,8 @@ following function returns <code>true</code>.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgddde970" class="outline-3">
|
||||
<h3 id="orgddde970"><span class="section-number-3">1.3</span> Initialization functions</h3>
|
||||
<div id="outline-container-org8f106f5" class="outline-3">
|
||||
<h3 id="org8f106f5"><span class="section-number-3">1.3</span> Initialization functions</h3>
|
||||
<div class="outline-text-3" id="text-1-3">
|
||||
<p>
|
||||
To set the data relative to the electrons in the context, the
|
||||
@ -471,8 +496,8 @@ electrons have been set.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgfe64eba" class="outline-3">
|
||||
<h3 id="orgfe64eba"><span class="section-number-3">1.4</span> Test</h3>
|
||||
<div id="outline-container-org933bca1" class="outline-3">
|
||||
<h3 id="org933bca1"><span class="section-number-3">1.4</span> Test</h3>
|
||||
<div class="outline-text-3" id="text-1-4">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-c">/* <span style="color: #b22222;">Reference input data </span>*/
|
||||
@ -516,10 +541,160 @@ rc = qmckl_set_electron_coord (context, coord);
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgd1313f9" class="outline-2">
|
||||
<h2 id="orgd1313f9"><span class="section-number-2">2</span> Computation</h2>
|
||||
<div class="outline-text-2" id="text-2">
|
||||
<p>
|
||||
The computed data is stored in the context so that it can be reused
|
||||
by different kernels. To ensure that the data is valid, for each
|
||||
computed data the date of the context is stored when it is computed.
|
||||
To know if some data needs to be recomputed, we check if the date of
|
||||
the dependencies are more recent than the date of the data to
|
||||
compute. If it is the case, then the data is recomputed and the
|
||||
current date is stored.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org3db28d6" class="outline-3">
|
||||
<h3 id="org3db28d6"><span class="section-number-3">2.1</span> Electron-electron distances</h3>
|
||||
<div class="outline-text-3" id="text-2-1">
|
||||
</div>
|
||||
<div id="outline-container-orgb787bba" class="outline-4">
|
||||
<h4 id="orgb787bba"><span class="section-number-4">2.1.1</span> Get</h4>
|
||||
<div class="outline-text-4" id="text-2-1-1">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_get_electron_ee_distance</span>(<span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>, <span style="color: #228b22;">double</span>* <span style="color: #a0522d;">distance</span>);
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgaa15136" class="outline-4">
|
||||
<h4 id="orgaa15136"><span class="section-number-4">2.1.2</span> Compute</h4>
|
||||
<div class="outline-text-4" id="text-2-1-2">
|
||||
<table id="org53d1927" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
|
||||
|
||||
<colgroup>
|
||||
<col class="org-left" />
|
||||
|
||||
<col class="org-left" />
|
||||
|
||||
<col class="org-left" />
|
||||
|
||||
<col class="org-left" />
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="org-left">qmckl<sub>context</sub></td>
|
||||
<td class="org-left">context</td>
|
||||
<td class="org-left">in</td>
|
||||
<td class="org-left">Global state</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left">int64<sub>t</sub></td>
|
||||
<td class="org-left">elec<sub>num</sub></td>
|
||||
<td class="org-left">in</td>
|
||||
<td class="org-left">Number of electrons</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left">int64<sub>t</sub></td>
|
||||
<td class="org-left">walk<sub>num</sub></td>
|
||||
<td class="org-left">in</td>
|
||||
<td class="org-left">Number of walkers</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left">double</td>
|
||||
<td class="org-left">coord[walk<sub>num</sub>][3][elec<sub>num</sub>]</td>
|
||||
<td class="org-left">in</td>
|
||||
<td class="org-left">Electron coordinates</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left">double</td>
|
||||
<td class="org-left">ee<sub>distance</sub>[walk<sub>num</sub>][elec<sub>num</sub>][elec<sub>num</sub>]</td>
|
||||
<td class="org-left">out</td>
|
||||
<td class="org-left">Electron-electron distances</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-f90"><span style="color: #228b22;">integer </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">qmckl_compute_ee_distance_f</span><span style="color: #000000; background-color: #ffffff;">(context, elec_num, walk_num, coord, ee_distance)</span><span style="color: #a0522d;"> </span><span style="color: #a020f0;">&</span>
|
||||
<span style="color: #a020f0;">result</span>(info)
|
||||
<span style="color: #a020f0;">use</span> <span style="color: #0000ff;">qmckl</span>
|
||||
<span style="color: #a020f0;">implicit</span> <span style="color: #228b22;">none</span>
|
||||
<span style="color: #228b22;">integer</span>(qmckl_context), <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> context</span>
|
||||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> elec_num</span>
|
||||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> walk_num</span>
|
||||
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> coord(elec_num,3,walk_num)</span>
|
||||
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(out) ::<span style="color: #a0522d;"> ee_distance(elec_num,elec_num,walk_num)</span>
|
||||
|
||||
<span style="color: #228b22;">integer</span>*8 ::<span style="color: #a0522d;"> k</span>
|
||||
|
||||
info = QMCKL_SUCCESS
|
||||
|
||||
<span style="color: #a020f0;">if</span> (context == QMCKL_NULL_CONTEXT) <span style="color: #a020f0;">then</span>
|
||||
info = QMCKL_INVALID_CONTEXT
|
||||
<span style="color: #a020f0;">return</span>
|
||||
<span style="color: #a020f0;">endif</span>
|
||||
|
||||
<span style="color: #a020f0;">if</span> (elec_num <= 0) <span style="color: #a020f0;">then</span>
|
||||
info = QMCKL_INVALID_ARG_2
|
||||
<span style="color: #a020f0;">return</span>
|
||||
<span style="color: #a020f0;">endif</span>
|
||||
|
||||
<span style="color: #a020f0;">if</span> (walk_num <= 0) <span style="color: #a020f0;">then</span>
|
||||
info = QMCKL_INVALID_ARG_3
|
||||
<span style="color: #a020f0;">return</span>
|
||||
<span style="color: #a020f0;">endif</span>
|
||||
|
||||
!<span style="color: #b22222;">$OMP PARALLEL DO DEFAULT(NONE) &</span>
|
||||
!<span style="color: #b22222;">$OMP SHARED(elec_num, walk_num, coord, ee_distance)</span>
|
||||
!<span style="color: #b22222;">$OMP PRIVATE(k)</span>
|
||||
<span style="color: #a020f0;">do</span> k=1,walk_num
|
||||
info = qmckl_distance(context, <span style="color: #8b2252;">'T'</span>, <span style="color: #8b2252;">'T'</span>, elec_num, elec_num, <span style="color: #a020f0;">&</span>
|
||||
coord(1,1,k), elec_num, <span style="color: #a020f0;">&</span>
|
||||
coord(1,1,k), elec_num, <span style="color: #a020f0;">&</span>
|
||||
ee_distance(1,1,k), elec_num)
|
||||
<span style="color: #a020f0;">end do</span>
|
||||
!<span style="color: #b22222;">$OMP END PARALLEL DO</span>
|
||||
|
||||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_compute_ee_distance_f</span>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org9567118" class="outline-4">
|
||||
<h4 id="org9567118"><span class="section-number-4">2.1.3</span> Test</h4>
|
||||
<div class="outline-text-4" id="text-2-1-3">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-c">/* <span style="color: #b22222;">Reference input data </span>*/
|
||||
|
||||
<span style="color: #0000ff;">munit_assert</span>(<span style="color: #228b22;">qmckl_electron_provided</span>(<span style="color: #a0522d;">context</span>));
|
||||
|
||||
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">distance</span>[walk_num*num*num];
|
||||
rc = qmckl_get_electron_ee_distance(context, distance);
|
||||
rc = qmckl_get_electron_ee_distance(context, distance);
|
||||
<span style="color: #0000ff;">munit_assert_double</span>(<span style="color: #228b22;">distance</span>[0], ==, 0.);
|
||||
<span style="color: #0000ff;">munit_assert_double</span>(<span style="color: #228b22;">distance</span>[1], ==, <span style="color: #228b22;">distance</span>[num]);
|
||||
<span style="color: #0000ff;">munit_assert_double_equal</span>(<span style="color: #228b22;">distance</span>[1], 8.6114953086801, 12);
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="postamble" class="status">
|
||||
<p class="author">Author: TREX CoE</p>
|
||||
<p class="date">Created: 2021-04-21 Wed 11:31</p>
|
||||
<p class="date">Created: 2021-04-25 Sun 23:49</p>
|
||||
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
|
||||
</div>
|
||||
</body>
|
||||
|
@ -3,7 +3,7 @@
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<!-- 2021-04-21 Wed 11:31 -->
|
||||
<!-- 2021-04-25 Sun 23:49 -->
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Error handling</title>
|
||||
@ -311,18 +311,18 @@ for the JavaScript code in this tag.
|
||||
<h2>Table of Contents</h2>
|
||||
<div id="text-table-of-contents">
|
||||
<ul>
|
||||
<li><a href="#org9e053ca"></a></li>
|
||||
<li><a href="#org48388f7">1. Decoding errors</a></li>
|
||||
<li><a href="#org7f59faf">2. Data structure in context</a></li>
|
||||
<li><a href="#org312362e">3. Updating errors in the context</a></li>
|
||||
<li><a href="#orge71b117">4. Failing</a></li>
|
||||
<li><a href="#org15aa424"></a></li>
|
||||
<li><a href="#org1ac8004">1. Decoding errors</a></li>
|
||||
<li><a href="#org1a3ba94">2. Data structure in context</a></li>
|
||||
<li><a href="#orgd82fff4">3. Updating errors in the context</a></li>
|
||||
<li><a href="#org18c5336">4. Failing</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org9e053ca" class="outline-2">
|
||||
<h2 id="org9e053ca"></h2>
|
||||
<div class="outline-text-2" id="text-org9e053ca">
|
||||
<div id="outline-container-org15aa424" class="outline-2">
|
||||
<h2 id="org15aa424"></h2>
|
||||
<div class="outline-text-2" id="text-org15aa424">
|
||||
<p>
|
||||
The library should never make the calling programs abort, nor
|
||||
perform any input/output operations. This decision has to be taken
|
||||
@ -333,7 +333,7 @@ by the developer of the code calling the library.
|
||||
All the functions return with an exit code, defined as
|
||||
</p>
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-c" id="org3bb7c2f"><span style="color: #a020f0;">typedef</span> <span style="color: #228b22;">int32_t</span> <span style="color: #228b22;">qmckl_exit_code</span>;
|
||||
<pre class="src src-c" id="org156ae9f"><span style="color: #a020f0;">typedef</span> <span style="color: #228b22;">int32_t</span> <span style="color: #228b22;">qmckl_exit_code</span>;
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
@ -350,7 +350,7 @@ error code is returned to the program.
|
||||
Here is the complete list of exit codes.
|
||||
</p>
|
||||
|
||||
<table id="orgfa89dcd" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
<table id="org0fd2dd3" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
|
||||
|
||||
<colgroup>
|
||||
@ -480,8 +480,8 @@ string is assumed to be large enough to contain the error message
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org48388f7" class="outline-2">
|
||||
<h2 id="org48388f7"><span class="section-number-2">1</span> Decoding errors</h2>
|
||||
<div id="outline-container-org1ac8004" class="outline-2">
|
||||
<h2 id="org1ac8004"><span class="section-number-2">1</span> Decoding errors</h2>
|
||||
<div class="outline-text-2" id="text-1">
|
||||
<p>
|
||||
To decode the error messages, <code>qmckl_string_of_error</code> converts an
|
||||
@ -575,8 +575,8 @@ The text strings are extracted from the previous table.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org7f59faf" class="outline-2">
|
||||
<h2 id="org7f59faf"><span class="section-number-2">2</span> Data structure in context</h2>
|
||||
<div id="outline-container-org1a3ba94" class="outline-2">
|
||||
<h2 id="org1a3ba94"><span class="section-number-2">2</span> Data structure in context</h2>
|
||||
<div class="outline-text-2" id="text-2">
|
||||
<p>
|
||||
The strings are declared with a maximum fixed size to avoid
|
||||
@ -599,8 +599,8 @@ dynamic memory allocation.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org312362e" class="outline-2">
|
||||
<h2 id="org312362e"><span class="section-number-2">3</span> Updating errors in the context</h2>
|
||||
<div id="outline-container-orgd82fff4" class="outline-2">
|
||||
<h2 id="orgd82fff4"><span class="section-number-2">3</span> Updating errors in the context</h2>
|
||||
<div class="outline-text-2" id="text-3">
|
||||
<p>
|
||||
The error is updated in the context using <code>qmckl_set_error</code>.
|
||||
@ -646,8 +646,8 @@ explaining the error. The exit code can't be <code>QMCKL_SUCCESS</code>.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orge71b117" class="outline-2">
|
||||
<h2 id="orge71b117"><span class="section-number-2">4</span> Failing</h2>
|
||||
<div id="outline-container-org18c5336" class="outline-2">
|
||||
<h2 id="org18c5336"><span class="section-number-2">4</span> Failing</h2>
|
||||
<div class="outline-text-2" id="text-4">
|
||||
<p>
|
||||
To make a function fail, the <code>qmckl_failwith</code> function should be
|
||||
@ -710,7 +710,7 @@ For example, this function can be used as
|
||||
</div>
|
||||
<div id="postamble" class="status">
|
||||
<p class="author">Author: TREX CoE</p>
|
||||
<p class="date">Created: 2021-04-21 Wed 11:31</p>
|
||||
<p class="date">Created: 2021-04-25 Sun 23:49</p>
|
||||
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
|
||||
</div>
|
||||
</body>
|
||||
|
@ -3,7 +3,7 @@
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<!-- 2021-04-21 Wed 11:31 -->
|
||||
<!-- 2021-04-25 Sun 23:49 -->
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Memory management</title>
|
||||
@ -311,15 +311,15 @@ for the JavaScript code in this tag.
|
||||
<h2>Table of Contents</h2>
|
||||
<div id="text-table-of-contents">
|
||||
<ul>
|
||||
<li><a href="#orgd4e4d1f">1. Memory data structure for the context</a></li>
|
||||
<li><a href="#org3cb3f1a">2. Passing info to allocation routines</a></li>
|
||||
<li><a href="#org832313a">3. Allocation/deallocation functions</a></li>
|
||||
<li><a href="#org571dd5a">1. Memory data structure for the context</a></li>
|
||||
<li><a href="#org18e589c">2. Passing info to allocation routines</a></li>
|
||||
<li><a href="#org60b1a67">3. Allocation/deallocation functions</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgd4e4d1f" class="outline-2">
|
||||
<h2 id="orgd4e4d1f"><span class="section-number-2">1</span> Memory data structure for the context</h2>
|
||||
<div id="outline-container-org571dd5a" class="outline-2">
|
||||
<h2 id="org571dd5a"><span class="section-number-2">1</span> Memory data structure for the context</h2>
|
||||
<div class="outline-text-2" id="text-1">
|
||||
<p>
|
||||
Every time a new block of memory is allocated, the information
|
||||
@ -361,8 +361,8 @@ array, and the number of allocated blocks.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org3cb3f1a" class="outline-2">
|
||||
<h2 id="org3cb3f1a"><span class="section-number-2">2</span> Passing info to allocation routines</h2>
|
||||
<div id="outline-container-org18e589c" class="outline-2">
|
||||
<h2 id="org18e589c"><span class="section-number-2">2</span> Passing info to allocation routines</h2>
|
||||
<div class="outline-text-2" id="text-2">
|
||||
<p>
|
||||
Passing information to the allocation routine should be done by
|
||||
@ -371,8 +371,8 @@ passing an instance of a <code>qmckl_memory_info_struct</code>.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org832313a" class="outline-2">
|
||||
<h2 id="org832313a"><span class="section-number-2">3</span> Allocation/deallocation functions</h2>
|
||||
<div id="outline-container-org60b1a67" class="outline-2">
|
||||
<h2 id="org60b1a67"><span class="section-number-2">3</span> Allocation/deallocation functions</h2>
|
||||
<div class="outline-text-2" id="text-3">
|
||||
<p>
|
||||
Memory allocation inside the library should be done with
|
||||
@ -535,7 +535,7 @@ allocation and needs to be updated.
|
||||
</div>
|
||||
<div id="postamble" class="status">
|
||||
<p class="author">Author: TREX CoE</p>
|
||||
<p class="date">Created: 2021-04-21 Wed 11:31</p>
|
||||
<p class="date">Created: 2021-04-25 Sun 23:49</p>
|
||||
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
|
||||
</div>
|
||||
</body>
|
||||
|
@ -3,7 +3,7 @@
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<!-- 2021-04-21 Wed 11:31 -->
|
||||
<!-- 2021-04-25 Sun 23:49 -->
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Numerical precision</title>
|
||||
@ -333,16 +333,16 @@ for the JavaScript code in this tag.
|
||||
<h2>Table of Contents</h2>
|
||||
<div id="text-table-of-contents">
|
||||
<ul>
|
||||
<li><a href="#org9a09afa">1. Control of the numerical precision</a></li>
|
||||
<li><a href="#org322cc6f">2. Precision</a></li>
|
||||
<li><a href="#org27e212a">3. Range</a></li>
|
||||
<li><a href="#org4a7d443">4. Helper functions</a></li>
|
||||
<li><a href="#org727153e">1. Control of the numerical precision</a></li>
|
||||
<li><a href="#org2b558a5">2. Precision</a></li>
|
||||
<li><a href="#orgdba3f7d">3. Range</a></li>
|
||||
<li><a href="#orgf2b06eb">4. Helper functions</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org9a09afa" class="outline-2">
|
||||
<h2 id="org9a09afa"><span class="section-number-2">1</span> Control of the numerical precision</h2>
|
||||
<div id="outline-container-org727153e" class="outline-2">
|
||||
<h2 id="org727153e"><span class="section-number-2">1</span> Control of the numerical precision</h2>
|
||||
<div class="outline-text-2" id="text-1">
|
||||
<p>
|
||||
Controlling numerical precision enables optimizations. Here, the
|
||||
@ -353,7 +353,7 @@ Arithmetic (IEEE 754),
|
||||
refers to the number of exponent bits.
|
||||
</p>
|
||||
|
||||
<table id="orge243271" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
<table id="orgc8da8bc" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
|
||||
|
||||
<colgroup>
|
||||
@ -397,8 +397,8 @@ integer. The update functions return <code>QMCKL_SUCCESS</code> or
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org322cc6f" class="outline-2">
|
||||
<h2 id="org322cc6f"><span class="section-number-2">2</span> Precision</h2>
|
||||
<div id="outline-container-org2b558a5" class="outline-2">
|
||||
<h2 id="org2b558a5"><span class="section-number-2">2</span> Precision</h2>
|
||||
<div class="outline-text-2" id="text-2">
|
||||
<p>
|
||||
<code>qmckl_context_set_numprec_precision</code> modifies the parameter for the
|
||||
@ -485,8 +485,8 @@ numerical precision in the context.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org27e212a" class="outline-2">
|
||||
<h2 id="org27e212a"><span class="section-number-2">3</span> Range</h2>
|
||||
<div id="outline-container-orgdba3f7d" class="outline-2">
|
||||
<h2 id="orgdba3f7d"><span class="section-number-2">3</span> Range</h2>
|
||||
<div class="outline-text-2" id="text-3">
|
||||
<p>
|
||||
<code>qmckl_set_numprec_range</code> modifies the parameter for the numerical
|
||||
@ -561,8 +561,8 @@ range in a given context.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="outline-container-org4a7d443" class="outline-2">
|
||||
<h2 id="org4a7d443"><span class="section-number-2">4</span> Helper functions</h2>
|
||||
<div id="outline-container-orgf2b06eb" class="outline-2">
|
||||
<h2 id="orgf2b06eb"><span class="section-number-2">4</span> Helper functions</h2>
|
||||
<div class="outline-text-2" id="text-4">
|
||||
<p>
|
||||
<code>qmckl_get_numprec_epsilon</code> returns \(\epsilon = 2^{1-n}\) where <code>n</code> is the precision.
|
||||
@ -581,7 +581,7 @@ We need to remove the sign bit from the precision.
|
||||
</div>
|
||||
<div id="postamble" class="status">
|
||||
<p class="author">Author: TREX CoE</p>
|
||||
<p class="date">Created: 2021-04-21 Wed 11:31</p>
|
||||
<p class="date">Created: 2021-04-25 Sun 23:49</p>
|
||||
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
|
||||
</div>
|
||||
</body>
|
||||
|
@ -3,7 +3,7 @@
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<!-- 2021-04-21 Wed 11:31 -->
|
||||
<!-- 2021-04-25 Sun 23:49 -->
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Testing</title>
|
||||
@ -311,7 +311,7 @@ for the JavaScript code in this tag.
|
||||
</div>
|
||||
<div id="postamble" class="status">
|
||||
<p class="author">Author: TREX CoE</p>
|
||||
<p class="date">Created: 2021-04-21 Wed 11:31</p>
|
||||
<p class="date">Created: 2021-04-25 Sun 23:49</p>
|
||||
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
|
||||
</div>
|
||||
</body>
|
||||
|
Loading…
Reference in New Issue
Block a user