mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-08 20:33:40 +01:00
Deploying to gh-pages from @ TREX-CoE/qmckl@f2b109e14b 🚀
This commit is contained in:
parent
b04fea42d5
commit
f1e6089133
@ -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-05-12 Wed 21:59 -->
|
||||
<!-- 2021-05-15 Sat 23:32 -->
|
||||
<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>
|
||||
@ -316,6 +316,7 @@ for the JavaScript code in this tag.
|
||||
<li><a href="./qmckl_context.html">Context</a></li>
|
||||
<li><a href="./qmckl_memory.html">Memory management</a></li>
|
||||
<li><a href="./qmckl_numprec.html">Numerical precision</a></li>
|
||||
<li><a href="./qmckl_nucleus.html">Nucleus</a></li>
|
||||
<li><a href="./qmckl_electron.html">Electrons</a></li>
|
||||
<li><a href="./qmckl_ao.html">Atomic Orbitals</a></li>
|
||||
<li><a href="./qmckl_distance.html">Inter-particle distances</a></li>
|
||||
@ -349,7 +350,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-05-12 Wed 21:59</p>
|
||||
<p class="date">Created: 2021-05-15 Sat 23:32</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-05-12 Wed 21:59 -->
|
||||
<!-- 2021-05-15 Sat 23:32 -->
|
||||
<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="#org12695bb">1. Using QMCkl</a></li>
|
||||
<li><a href="#org4ab5b28">2. Developing in QMCkl</a>
|
||||
<li><a href="#org5dde07e">1. Using QMCkl</a></li>
|
||||
<li><a href="#orgd439da8">2. Developing in QMCkl</a>
|
||||
<ul>
|
||||
<li><a href="#orgd93323d">2.1. Literate programming</a></li>
|
||||
<li><a href="#org778d04e">2.2. Source code editing</a></li>
|
||||
<li><a href="#org7bc3a88">2.3. Choice of the programming language</a></li>
|
||||
<li><a href="#orga65df98">2.4. Coding rules</a></li>
|
||||
<li><a href="#org6ead2ea">2.5. Design of the library</a></li>
|
||||
<li><a href="#org8b7d275">2.6. Naming conventions</a></li>
|
||||
<li><a href="#org8f2a325">2.7. Application programming interface</a></li>
|
||||
<li><a href="#org598fbd6">2.8. Global state</a></li>
|
||||
<li><a href="#orgc00e340">2.9. Headers</a></li>
|
||||
<li><a href="#org843e8b3">2.10. Low-level functions</a></li>
|
||||
<li><a href="#orgb39d37a">2.11. High-level functions</a></li>
|
||||
<li><a href="#org2b7b551">2.12. Numerical precision</a></li>
|
||||
<li><a href="#orgfa84567">2.13. Algorithms</a></li>
|
||||
<li><a href="#org4752070">2.1. Literate programming</a></li>
|
||||
<li><a href="#org9038bdd">2.2. Source code editing</a></li>
|
||||
<li><a href="#org7ec9b65">2.3. Choice of the programming language</a></li>
|
||||
<li><a href="#org8bdef6d">2.4. Coding rules</a></li>
|
||||
<li><a href="#orgce14f4b">2.5. Design of the library</a></li>
|
||||
<li><a href="#org57af30e">2.6. Naming conventions</a></li>
|
||||
<li><a href="#orgedb3f75">2.7. Application programming interface</a></li>
|
||||
<li><a href="#org6ae8033">2.8. Global state</a></li>
|
||||
<li><a href="#org3fc4913">2.9. Headers</a></li>
|
||||
<li><a href="#orgaa7373d">2.10. Low-level functions</a></li>
|
||||
<li><a href="#org59ff860">2.11. High-level functions</a></li>
|
||||
<li><a href="#orgd505b09">2.12. Numerical precision</a></li>
|
||||
<li><a href="#orgec5a0c8">2.13. Algorithms</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org12695bb" class="outline-2">
|
||||
<h2 id="org12695bb"><span class="section-number-2">1</span> Using QMCkl</h2>
|
||||
<div id="outline-container-org5dde07e" class="outline-2">
|
||||
<h2 id="org5dde07e"><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-org4ab5b28" class="outline-2">
|
||||
<h2 id="org4ab5b28"><span class="section-number-2">2</span> Developing in QMCkl</h2>
|
||||
<div id="outline-container-orgd439da8" class="outline-2">
|
||||
<h2 id="orgd439da8"><span class="section-number-2">2</span> Developing in QMCkl</h2>
|
||||
<div class="outline-text-2" id="text-2">
|
||||
</div>
|
||||
<div id="outline-container-orgd93323d" class="outline-3">
|
||||
<h3 id="orgd93323d"><span class="section-number-3">2.1</span> Literate programming</h3>
|
||||
<div id="outline-container-org4752070" class="outline-3">
|
||||
<h3 id="org4752070"><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-org778d04e" class="outline-3">
|
||||
<h3 id="org778d04e"><span class="section-number-3">2.2</span> Source code editing</h3>
|
||||
<div id="outline-container-org9038bdd" class="outline-3">
|
||||
<h3 id="org9038bdd"><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-org7bc3a88" class="outline-3">
|
||||
<h3 id="org7bc3a88"><span class="section-number-3">2.3</span> Choice of the programming language</h3>
|
||||
<div id="outline-container-org7ec9b65" class="outline-3">
|
||||
<h3 id="org7ec9b65"><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-orga65df98" class="outline-3">
|
||||
<h3 id="orga65df98"><span class="section-number-3">2.4</span> Coding rules</h3>
|
||||
<div id="outline-container-org8bdef6d" class="outline-3">
|
||||
<h3 id="org8bdef6d"><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-org6ead2ea" class="outline-3">
|
||||
<h3 id="org6ead2ea"><span class="section-number-3">2.5</span> Design of the library</h3>
|
||||
<div id="outline-container-orgce14f4b" class="outline-3">
|
||||
<h3 id="orgce14f4b"><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-org8b7d275" class="outline-3">
|
||||
<h3 id="org8b7d275"><span class="section-number-3">2.6</span> Naming conventions</h3>
|
||||
<div id="outline-container-org57af30e" class="outline-3">
|
||||
<h3 id="org57af30e"><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-org8f2a325" class="outline-3">
|
||||
<h3 id="org8f2a325"><span class="section-number-3">2.7</span> Application programming interface</h3>
|
||||
<div id="outline-container-orgedb3f75" class="outline-3">
|
||||
<h3 id="orgedb3f75"><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-org598fbd6" class="outline-3">
|
||||
<h3 id="org598fbd6"><span class="section-number-3">2.8</span> Global state</h3>
|
||||
<div id="outline-container-org6ae8033" class="outline-3">
|
||||
<h3 id="org6ae8033"><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="org3a67e74">=context=</a> contains the global
|
||||
<code>qmckl_context_create</code> function. The <a id="orgdbed6a8">=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-orgc00e340" class="outline-3">
|
||||
<h3 id="orgc00e340"><span class="section-number-3">2.9</span> Headers</h3>
|
||||
<div id="outline-container-org3fc4913" class="outline-3">
|
||||
<h3 id="org3fc4913"><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-org843e8b3" class="outline-3">
|
||||
<h3 id="org843e8b3"><span class="section-number-3">2.10</span> Low-level functions</h3>
|
||||
<div id="outline-container-orgaa7373d" class="outline-3">
|
||||
<h3 id="orgaa7373d"><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="#org3a67e74"><code>context</code></a>. They are not allowed to allocate/deallocate memory, and
|
||||
<a href="#orgdbed6a8"><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-orgb39d37a" class="outline-3">
|
||||
<h3 id="orgb39d37a"><span class="section-number-3">2.11</span> High-level functions</h3>
|
||||
<div id="outline-container-org59ff860" class="outline-3">
|
||||
<h3 id="org59ff860"><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="#org3a67e74"><code>context</code></a> variable.
|
||||
the <a href="#orgdbed6a8"><code>context</code></a> variable.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org2b7b551" class="outline-3">
|
||||
<h3 id="org2b7b551"><span class="section-number-3">2.12</span> Numerical precision</h3>
|
||||
<div id="outline-container-orgd505b09" class="outline-3">
|
||||
<h3 id="orgd505b09"><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="#org3a67e74"><code>context</code></a>
|
||||
functions will use the precision specified in the <a href="#orgdbed6a8"><code>context</code></a>
|
||||
variable.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgfa84567" class="outline-3">
|
||||
<h3 id="orgfa84567"><span class="section-number-3">2.13</span> Algorithms</h3>
|
||||
<div id="outline-container-orgec5a0c8" class="outline-3">
|
||||
<h3 id="orgec5a0c8"><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-05-12 Wed 21:59</p>
|
||||
<p class="date">Created: 2021-05-15 Sat 23:32</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-05-12 Wed 21:59 -->
|
||||
<!-- 2021-05-15 Sat 23:32 -->
|
||||
<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="#orgcd3f467">1. Context</a>
|
||||
<li><a href="#orgbf86560">1. Context</a>
|
||||
<ul>
|
||||
<li><a href="#orgdf9e43a">1.1. Data structure</a></li>
|
||||
<li><a href="#org2656207">1.2. Access functions</a></li>
|
||||
<li><a href="#org3e983d0">1.3. Initialization functions</a></li>
|
||||
<li><a href="#orga446a99">1.4. <span class="todo TODO">TODO</span> Fortran interfaces</a></li>
|
||||
<li><a href="#org0197020">1.1. Data structure</a></li>
|
||||
<li><a href="#orgfa3213a">1.2. Access functions</a></li>
|
||||
<li><a href="#orgcdeb6ac">1.3. Initialization functions</a></li>
|
||||
<li><a href="#org4e4dc4e">1.4. <span class="todo TODO">TODO</span> Fortran interfaces</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#org0ea0b71">2. Polynomial part</a>
|
||||
<li><a href="#org1c7b82c">2. Polynomial part</a>
|
||||
<ul>
|
||||
<li><a href="#orge4fd660">2.1. Powers of \(x-X_i\)</a>
|
||||
<li><a href="#orga529d9e">2.1. Powers of \(x-X_i\)</a>
|
||||
<ul>
|
||||
<li><a href="#org935bad0">2.1.1. Requirements</a></li>
|
||||
<li><a href="#orgb20b53d">2.1.2. C Header</a></li>
|
||||
<li><a href="#org86cac3e">2.1.3. Source</a></li>
|
||||
<li><a href="#orgec5e28c">2.1.4. C interface</a></li>
|
||||
<li><a href="#orgf814d8d">2.1.5. Fortran interface</a></li>
|
||||
<li><a href="#orgf6fc171">2.1.6. Test</a></li>
|
||||
<li><a href="#orgf6adaef">2.1.1. Requirements</a></li>
|
||||
<li><a href="#org7069492">2.1.2. C Header</a></li>
|
||||
<li><a href="#org300eefa">2.1.3. Source</a></li>
|
||||
<li><a href="#org02358f3">2.1.4. C interface</a></li>
|
||||
<li><a href="#orgd6cfeaf">2.1.5. Fortran interface</a></li>
|
||||
<li><a href="#org2faa678">2.1.6. Test</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#orga1c5974">2.2. Value, Gradient and Laplacian of a polynomial</a>
|
||||
<li><a href="#orge04fe73">2.2. Value, Gradient and Laplacian of a polynomial</a>
|
||||
<ul>
|
||||
<li><a href="#org0976e7f">2.2.1. Requirements</a></li>
|
||||
<li><a href="#org12e1f9c">2.2.2. C Header</a></li>
|
||||
<li><a href="#org1836749">2.2.3. Source</a></li>
|
||||
<li><a href="#org6662068">2.2.4. C interface</a></li>
|
||||
<li><a href="#orgeac9814">2.2.5. Fortran interface</a></li>
|
||||
<li><a href="#orgdb89143">2.2.6. Test</a></li>
|
||||
<li><a href="#orgfb04210">2.2.1. Requirements</a></li>
|
||||
<li><a href="#orgb6083cf">2.2.2. C Header</a></li>
|
||||
<li><a href="#org5d04fe2">2.2.3. Source</a></li>
|
||||
<li><a href="#org14cde30">2.2.4. C interface</a></li>
|
||||
<li><a href="#org01ce82d">2.2.5. Fortran interface</a></li>
|
||||
<li><a href="#orge427d67">2.2.6. Test</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#org0960314">3. Radial part</a>
|
||||
<li><a href="#orgf5671dc">3. Radial part</a>
|
||||
<ul>
|
||||
<li><a href="#org1e5aae2">3.1. Gaussian basis functions</a></li>
|
||||
<li><a href="#org0fc555f">3.2. <span class="todo TODO">TODO</span> Slater basis functions</a></li>
|
||||
<li><a href="#orgd4d72b9">3.3. <span class="todo TODO">TODO</span> Radial functions on a grid</a></li>
|
||||
<li><a href="#org293660f">3.1. Gaussian basis functions</a></li>
|
||||
<li><a href="#orgdab6601">3.2. <span class="todo TODO">TODO</span> Slater basis functions</a></li>
|
||||
<li><a href="#orgefa4080">3.3. <span class="todo TODO">TODO</span> Radial functions on a grid</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#org35fab23">4. Combining radial and polynomial parts</a></li>
|
||||
<li><a href="#org81e5a72">4. Combining radial and polynomial parts</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgcd3f467" class="outline-2">
|
||||
<h2 id="orgcd3f467"><span class="section-number-2">1</span> Context</h2>
|
||||
<div id="outline-container-orgbf86560" class="outline-2">
|
||||
<h2 id="orgbf86560"><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-orgdf9e43a" class="outline-3">
|
||||
<h3 id="orgdf9e43a"><span class="section-number-3">1.1</span> Data structure</h3>
|
||||
<div id="outline-container-org0197020" class="outline-3">
|
||||
<h3 id="org0197020"><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-org2656207" class="outline-3">
|
||||
<h3 id="org2656207"><span class="section-number-3">1.2</span> Access functions</h3>
|
||||
<div id="outline-container-orgfa3213a" class="outline-3">
|
||||
<h3 id="orgfa3213a"><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-org3e983d0" class="outline-3">
|
||||
<h3 id="org3e983d0"><span class="section-number-3">1.3</span> Initialization functions</h3>
|
||||
<div id="outline-container-orgcdeb6ac" class="outline-3">
|
||||
<h3 id="orgcdeb6ac"><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-orga446a99" class="outline-3">
|
||||
<h3 id="orga446a99"><span class="section-number-3">1.4</span> <span class="todo TODO">TODO</span> Fortran interfaces</h3>
|
||||
<div id="outline-container-org4e4dc4e" class="outline-3">
|
||||
<h3 id="org4e4dc4e"><span class="section-number-3">1.4</span> <span class="todo TODO">TODO</span> Fortran interfaces</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org0ea0b71" class="outline-2">
|
||||
<h2 id="org0ea0b71"><span class="section-number-2">2</span> Polynomial part</h2>
|
||||
<div id="outline-container-org1c7b82c" class="outline-2">
|
||||
<h2 id="org1c7b82c"><span class="section-number-2">2</span> Polynomial part</h2>
|
||||
<div class="outline-text-2" id="text-2">
|
||||
</div>
|
||||
<div id="outline-container-orge4fd660" class="outline-3">
|
||||
<h3 id="orge4fd660"><span class="section-number-3">2.1</span> Powers of \(x-X_i\)</h3>
|
||||
<div id="outline-container-orga529d9e" class="outline-3">
|
||||
<h3 id="orga529d9e"><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="orge69edf7" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
<table id="org4812fa1" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
|
||||
|
||||
<colgroup>
|
||||
@ -652,8 +652,8 @@ the \(n\) points:
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org935bad0" class="outline-4">
|
||||
<h4 id="org935bad0"><span class="section-number-4">2.1.1</span> Requirements</h4>
|
||||
<div id="outline-container-orgf6adaef" class="outline-4">
|
||||
<h4 id="orgf6adaef"><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-orgb20b53d" class="outline-4">
|
||||
<h4 id="orgb20b53d"><span class="section-number-4">2.1.2</span> C Header</h4>
|
||||
<div id="outline-container-org7069492" class="outline-4">
|
||||
<h4 id="org7069492"><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-org86cac3e" class="outline-4">
|
||||
<h4 id="org86cac3e"><span class="section-number-4">2.1.3</span> Source</h4>
|
||||
<div id="outline-container-org300eefa" class="outline-4">
|
||||
<h4 id="org300eefa"><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-orgec5e28c" class="outline-4">
|
||||
<h4 id="orgec5e28c"><span class="section-number-4">2.1.4</span> C interface</h4>
|
||||
<div id="outline-container-org02358f3" class="outline-4">
|
||||
<h4 id="org02358f3"><span class="section-number-4">2.1.4</span> C interface</h4>
|
||||
</div>
|
||||
<div id="outline-container-orgf814d8d" class="outline-4">
|
||||
<h4 id="orgf814d8d"><span class="section-number-4">2.1.5</span> Fortran interface</h4>
|
||||
<div id="outline-container-orgd6cfeaf" class="outline-4">
|
||||
<h4 id="orgd6cfeaf"><span class="section-number-4">2.1.5</span> Fortran interface</h4>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgf6fc171" class="outline-4">
|
||||
<h4 id="orgf6fc171"><span class="section-number-4">2.1.6</span> Test</h4>
|
||||
<div id="outline-container-org2faa678" class="outline-4">
|
||||
<h4 id="org2faa678"><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-orga1c5974" class="outline-3">
|
||||
<h3 id="orga1c5974"><span class="section-number-3">2.2</span> Value, Gradient and Laplacian of a polynomial</h3>
|
||||
<div id="outline-container-orge04fe73" class="outline-3">
|
||||
<h3 id="orge04fe73"><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="orgf0732d2" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
<table id="org31e173e" 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-org0976e7f" class="outline-4">
|
||||
<h4 id="org0976e7f"><span class="section-number-4">2.2.1</span> Requirements</h4>
|
||||
<div id="outline-container-orgfb04210" class="outline-4">
|
||||
<h4 id="orgfb04210"><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-org12e1f9c" class="outline-4">
|
||||
<h4 id="org12e1f9c"><span class="section-number-4">2.2.2</span> C Header</h4>
|
||||
<div id="outline-container-orgb6083cf" class="outline-4">
|
||||
<h4 id="orgb6083cf"><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-org1836749" class="outline-4">
|
||||
<h4 id="org1836749"><span class="section-number-4">2.2.3</span> Source</h4>
|
||||
<div id="outline-container-org5d04fe2" class="outline-4">
|
||||
<h4 id="org5d04fe2"><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-org6662068" class="outline-4">
|
||||
<h4 id="org6662068"><span class="section-number-4">2.2.4</span> C interface</h4>
|
||||
<div id="outline-container-org14cde30" class="outline-4">
|
||||
<h4 id="org14cde30"><span class="section-number-4">2.2.4</span> C interface</h4>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgeac9814" class="outline-4">
|
||||
<h4 id="orgeac9814"><span class="section-number-4">2.2.5</span> Fortran interface</h4>
|
||||
<div id="outline-container-org01ce82d" class="outline-4">
|
||||
<h4 id="org01ce82d"><span class="section-number-4">2.2.5</span> Fortran interface</h4>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgdb89143" class="outline-4">
|
||||
<h4 id="orgdb89143"><span class="section-number-4">2.2.6</span> Test</h4>
|
||||
<div id="outline-container-orge427d67" class="outline-4">
|
||||
<h4 id="orge427d67"><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 @@ assert(0 == test_qmckl_ao_polynomial_vgl(context));
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org0960314" class="outline-2">
|
||||
<h2 id="org0960314"><span class="section-number-2">3</span> Radial part</h2>
|
||||
<div id="outline-container-orgf5671dc" class="outline-2">
|
||||
<h2 id="orgf5671dc"><span class="section-number-2">3</span> Radial part</h2>
|
||||
<div class="outline-text-2" id="text-3">
|
||||
</div>
|
||||
<div id="outline-container-org1e5aae2" class="outline-3">
|
||||
<h3 id="org1e5aae2"><span class="section-number-3">3.1</span> Gaussian basis functions</h3>
|
||||
<div id="outline-container-org293660f" class="outline-3">
|
||||
<h3 id="org293660f"><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-org0fc555f" class="outline-3">
|
||||
<h3 id="org0fc555f"><span class="section-number-3">3.2</span> <span class="todo TODO">TODO</span> Slater basis functions</h3>
|
||||
<div id="outline-container-orgdab6601" class="outline-3">
|
||||
<h3 id="orgdab6601"><span class="section-number-3">3.2</span> <span class="todo TODO">TODO</span> Slater basis functions</h3>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgd4d72b9" class="outline-3">
|
||||
<h3 id="orgd4d72b9"><span class="section-number-3">3.3</span> <span class="todo TODO">TODO</span> Radial functions on a grid</h3>
|
||||
<div id="outline-container-orgefa4080" class="outline-3">
|
||||
<h3 id="orgefa4080"><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-org35fab23" class="outline-2">
|
||||
<h2 id="org35fab23"><span class="section-number-2">4</span> Combining radial and polynomial parts</h2>
|
||||
<div id="outline-container-org81e5a72" class="outline-2">
|
||||
<h2 id="org81e5a72"><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-05-12 Wed 21:59</p>
|
||||
<p class="date">Created: 2021-05-15 Sat 23:32</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-05-12 Wed 21:59 -->
|
||||
<!-- 2021-05-15 Sat 23:32 -->
|
||||
<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="#org6cb06cf">1. Context handling</a>
|
||||
<li><a href="#org091a71d">1. Context handling</a>
|
||||
<ul>
|
||||
<li><a href="#org3bd8cb0">1.1. Data structure</a></li>
|
||||
<li><a href="#orga91d7c0">1.2. Creation</a></li>
|
||||
<li><a href="#org6e0b02b">1.3. Locking</a></li>
|
||||
<li><a href="#org313c0f3">1.4. <span class="todo TODO">TODO</span> Copy</a></li>
|
||||
<li><a href="#orgc179147">1.5. Destroy</a></li>
|
||||
<li><a href="#org7d0ec27">1.1. Data structure</a></li>
|
||||
<li><a href="#org7154972">1.2. Creation</a></li>
|
||||
<li><a href="#orgaf9f864">1.3. Locking</a></li>
|
||||
<li><a href="#org48a943e">1.4. <span class="todo TODO">TODO</span> Copy</a></li>
|
||||
<li><a href="#org2f1ff84">1.5. Destroy</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org6cb06cf" class="outline-2">
|
||||
<h2 id="org6cb06cf"><span class="section-number-2">1</span> Context handling</h2>
|
||||
<div id="outline-container-org091a71d" class="outline-2">
|
||||
<h2 id="org091a71d"><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="org631d3cf"><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="org7a25219"><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-org3bd8cb0" class="outline-3">
|
||||
<h3 id="org3bd8cb0"><span class="section-number-3">1.1</span> Data structure</h3>
|
||||
<div id="outline-container-org7d0ec27" class="outline-3">
|
||||
<h3 id="org7d0ec27"><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="#orga91d7c0">qmckl<sub>context</sub><sub>create</sub></a>, <a href="#orgc179147">qmckl<sub>context</sub><sub>destroy</sub></a> and <a href="#org313c0f3">qmckl<sub>context</sub><sub>copy</sub></a>
|
||||
<a href="#org7154972">qmckl<sub>context</sub><sub>create</sub></a>, <a href="#org2f1ff84">qmckl<sub>context</sub><sub>destroy</sub></a> and <a href="#org48a943e">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-orga91d7c0" class="outline-3">
|
||||
<h3 id="orga91d7c0"><span class="section-number-3">1.2</span> Creation</h3>
|
||||
<div id="outline-container-org7154972" class="outline-3">
|
||||
<h3 id="org7154972"><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,6 +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->nucleus.uninitialized = (1 << 3) - 1;
|
||||
ctx->electron.uninitialized = (1 << 2) - 1;
|
||||
|
||||
/* <span style="color: #b22222;">Allocate qmckl_memory_struct </span>*/
|
||||
@ -491,8 +492,8 @@ To create a new context, <code>qmckl_context_create()</code> should be used.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="outline-container-org6e0b02b" class="outline-3">
|
||||
<h3 id="org6e0b02b"><span class="section-number-3">1.3</span> Locking</h3>
|
||||
<div id="outline-container-orgaf9f864" class="outline-3">
|
||||
<h3 id="orgaf9f864"><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 +538,8 @@ number of times the thread has locked it is saved in the
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org313c0f3" class="outline-3">
|
||||
<h3 id="org313c0f3"><span class="section-number-3">1.4</span> <span class="todo TODO">TODO</span> Copy</h3>
|
||||
<div id="outline-container-org48a943e" class="outline-3">
|
||||
<h3 id="org48a943e"><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 +587,8 @@ number of times the thread has locked it is saved in the
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="outline-container-orgc179147" class="outline-3">
|
||||
<h3 id="orgc179147"><span class="section-number-3">1.5</span> Destroy</h3>
|
||||
<div id="outline-container-org2f1ff84" class="outline-3">
|
||||
<h3 id="org2f1ff84"><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 +642,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-05-12 Wed 21:59</p>
|
||||
<p class="date">Created: 2021-05-15 Sat 23:32</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-05-12 Wed 21:59 -->
|
||||
<!-- 2021-05-15 Sat 23:32 -->
|
||||
<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,26 +333,26 @@ for the JavaScript code in this tag.
|
||||
<h2>Table of Contents</h2>
|
||||
<div id="text-table-of-contents">
|
||||
<ul>
|
||||
<li><a href="#orga44f70f">1. Squared distance</a>
|
||||
<li><a href="#org559c2bb">1. Squared distance</a>
|
||||
<ul>
|
||||
<li><a href="#org9f2167b">1.1. <code>qmckl_distance_sq</code></a>
|
||||
<li><a href="#orgaaa7a3f">1.1. <code>qmckl_distance_sq</code></a>
|
||||
<ul>
|
||||
<li><a href="#org623daa5">1.1.1. Requirements</a></li>
|
||||
<li><a href="#orgab35e1d">1.1.2. C header</a></li>
|
||||
<li><a href="#orgc04b262">1.1.3. Source</a></li>
|
||||
<li><a href="#org2041955">1.1.4. Performance</a></li>
|
||||
<li><a href="#org1167adf">1.1.1. Requirements</a></li>
|
||||
<li><a href="#org50dabdb">1.1.2. C header</a></li>
|
||||
<li><a href="#org9a46a0b">1.1.3. Source</a></li>
|
||||
<li><a href="#orgbfe1486">1.1.4. Performance</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#org922d627">2. Distance</a>
|
||||
<li><a href="#org3d49a98">2. Distance</a>
|
||||
<ul>
|
||||
<li><a href="#org256e91f">2.1. <code>qmckl_distance</code></a>
|
||||
<li><a href="#org4d4905b">2.1. <code>qmckl_distance</code></a>
|
||||
<ul>
|
||||
<li><a href="#org61ee26a">2.1.1. Requirements</a></li>
|
||||
<li><a href="#org9030bbf">2.1.2. C header</a></li>
|
||||
<li><a href="#org4215a1d">2.1.3. Source</a></li>
|
||||
<li><a href="#org0ad41b3">2.1.4. Performance</a></li>
|
||||
<li><a href="#org7332153">2.1.1. Requirements</a></li>
|
||||
<li><a href="#orga049cf9">2.1.2. C header</a></li>
|
||||
<li><a href="#org82e70e9">2.1.3. Source</a></li>
|
||||
<li><a href="#orgfdb6590">2.1.4. Performance</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@ -361,12 +361,12 @@ for the JavaScript code in this tag.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orga44f70f" class="outline-2">
|
||||
<h2 id="orga44f70f"><span class="section-number-2">1</span> Squared distance</h2>
|
||||
<div id="outline-container-org559c2bb" class="outline-2">
|
||||
<h2 id="org559c2bb"><span class="section-number-2">1</span> Squared distance</h2>
|
||||
<div class="outline-text-2" id="text-1">
|
||||
</div>
|
||||
<div id="outline-container-org9f2167b" class="outline-3">
|
||||
<h3 id="org9f2167b"><span class="section-number-3">1.1</span> <code>qmckl_distance_sq</code></h3>
|
||||
<div id="outline-container-orgaaa7a3f" class="outline-3">
|
||||
<h3 id="orgaaa7a3f"><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
|
||||
@ -379,7 +379,7 @@ between all pairs of points in two sets, one point within each set:
|
||||
\]
|
||||
</p>
|
||||
|
||||
<table id="org71b5d80" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
<table id="org42cb6f4" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
|
||||
|
||||
<colgroup>
|
||||
@ -472,8 +472,8 @@ between all pairs of points in two sets, one point within each set:
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org623daa5" class="outline-4">
|
||||
<h4 id="org623daa5"><span class="section-number-4">1.1.1</span> Requirements</h4>
|
||||
<div id="outline-container-org1167adf" class="outline-4">
|
||||
<h4 id="org1167adf"><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>
|
||||
@ -491,8 +491,8 @@ between all pairs of points in two sets, one point within each set:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgab35e1d" class="outline-4">
|
||||
<h4 id="orgab35e1d"><span class="section-number-4">1.1.2</span> C header</h4>
|
||||
<div id="outline-container-org50dabdb" class="outline-4">
|
||||
<h4 id="org50dabdb"><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</span> (
|
||||
@ -512,8 +512,8 @@ between all pairs of points in two sets, one point within each set:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgc04b262" class="outline-4">
|
||||
<h4 id="orgc04b262"><span class="section-number-4">1.1.3</span> Source</h4>
|
||||
<div id="outline-container-org9a46a0b" class="outline-4">
|
||||
<h4 id="org9a46a0b"><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: #a0522d;"> function qmckl_distance_sq_f(context, transa, transb, m, n, </span><span style="color: #a020f0;">&</span>
|
||||
@ -648,8 +648,8 @@ between all pairs of points in two sets, one point within each set:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org2041955" class="outline-4">
|
||||
<h4 id="org2041955"><span class="section-number-4">1.1.4</span> Performance</h4>
|
||||
<div id="outline-container-orgbfe1486" class="outline-4">
|
||||
<h4 id="orgbfe1486"><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
|
||||
@ -659,12 +659,12 @@ transposed.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="outline-container-org922d627" class="outline-2">
|
||||
<h2 id="org922d627"><span class="section-number-2">2</span> Distance</h2>
|
||||
<div id="outline-container-org3d49a98" class="outline-2">
|
||||
<h2 id="org3d49a98"><span class="section-number-2">2</span> Distance</h2>
|
||||
<div class="outline-text-2" id="text-2">
|
||||
</div>
|
||||
<div id="outline-container-org256e91f" class="outline-3">
|
||||
<h3 id="org256e91f"><span class="section-number-3">2.1</span> <code>qmckl_distance</code></h3>
|
||||
<div id="outline-container-org4d4905b" class="outline-3">
|
||||
<h3 id="org4d4905b"><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
|
||||
@ -677,7 +677,7 @@ pairs of points in two sets, one point within each set:
|
||||
\]
|
||||
</p>
|
||||
|
||||
<table id="orgb093358" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
<table id="org5f897ac" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
|
||||
|
||||
<colgroup>
|
||||
@ -770,8 +770,8 @@ pairs of points in two sets, one point within each set:
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org61ee26a" class="outline-4">
|
||||
<h4 id="org61ee26a"><span class="section-number-4">2.1.1</span> Requirements</h4>
|
||||
<div id="outline-container-org7332153" class="outline-4">
|
||||
<h4 id="org7332153"><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>
|
||||
@ -789,8 +789,8 @@ pairs of points in two sets, one point within each set:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org9030bbf" class="outline-4">
|
||||
<h4 id="org9030bbf"><span class="section-number-4">2.1.2</span> C header</h4>
|
||||
<div id="outline-container-orga049cf9" class="outline-4">
|
||||
<h4 id="orga049cf9"><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> (
|
||||
@ -810,8 +810,8 @@ pairs of points in two sets, one point within each set:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org4215a1d" class="outline-4">
|
||||
<h4 id="org4215a1d"><span class="section-number-4">2.1.3</span> Source</h4>
|
||||
<div id="outline-container-org82e70e9" class="outline-4">
|
||||
<h4 id="org82e70e9"><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>
|
||||
@ -950,8 +950,8 @@ pairs of points in two sets, one point within each set:
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org0ad41b3" class="outline-4">
|
||||
<h4 id="org0ad41b3"><span class="section-number-4">2.1.4</span> Performance</h4>
|
||||
<div id="outline-container-orgfdb6590" class="outline-4">
|
||||
<h4 id="orgfdb6590"><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
|
||||
@ -964,7 +964,7 @@ transposed.
|
||||
</div>
|
||||
<div id="postamble" class="status">
|
||||
<p class="author">Author: TREX CoE</p>
|
||||
<p class="date">Created: 2021-05-12 Wed 21:59</p>
|
||||
<p class="date">Created: 2021-05-15 Sat 23:32</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-05-12 Wed 21:59 -->
|
||||
<!-- 2021-05-15 Sat 23:32 -->
|
||||
<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,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="#org695a45a">1. Context</a>
|
||||
<li><a href="#org4af5922">1. Context</a>
|
||||
<ul>
|
||||
<li><a href="#org5c8a5e4">1.1. Data structure</a></li>
|
||||
<li><a href="#orgd151127">1.2. Access functions</a></li>
|
||||
<li><a href="#org9365d7a">1.3. Initialization functions</a></li>
|
||||
<li><a href="#org0d3083f">1.4. Test</a></li>
|
||||
<li><a href="#org3074b70">1.1. Data structure</a></li>
|
||||
<li><a href="#org5dec71e">1.2. <span class="todo TODO">TODO</span> Access functions</a></li>
|
||||
<li><a href="#org383aca0">1.3. Initialization functions</a></li>
|
||||
<li><a href="#orgac7001e">1.4. Test</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#orgf3baf21">2. Computation</a>
|
||||
<li><a href="#org3018162">2. Computation</a>
|
||||
<ul>
|
||||
<li><a href="#org3a6e404">2.1. Electron-electron distances</a>
|
||||
<li><a href="#org31280fc">2.1. Electron-electron distances</a>
|
||||
<ul>
|
||||
<li><a href="#org8c9af3d">2.1.1. Get</a></li>
|
||||
<li><a href="#orga6b78c5">2.1.2. Compute</a></li>
|
||||
<li><a href="#orgac11e3a">2.1.3. Test</a></li>
|
||||
<li><a href="#orgc95b870">2.1.1. Get</a></li>
|
||||
<li><a href="#orga68544c">2.1.2. Compute</a></li>
|
||||
<li><a href="#orgc34ae7b">2.1.3. Test</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@ -334,8 +334,8 @@ for the JavaScript code in this tag.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org695a45a" class="outline-2">
|
||||
<h2 id="org695a45a"><span class="section-number-2">1</span> Context</h2>
|
||||
<div id="outline-container-org4af5922" class="outline-2">
|
||||
<h2 id="org4af5922"><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:
|
||||
@ -421,8 +421,8 @@ The following data stored in the context:
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org5c8a5e4" class="outline-3">
|
||||
<h3 id="org5c8a5e4"><span class="section-number-3">1.1</span> Data structure</h3>
|
||||
<div id="outline-container-org3074b70" class="outline-3">
|
||||
<h3 id="org3074b70"><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> {
|
||||
@ -450,28 +450,39 @@ struct is then initialized and <code>provided == true</code>.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgd151127" class="outline-3">
|
||||
<h3 id="orgd151127"><span class="section-number-3">1.2</span> Access functions</h3>
|
||||
<div id="outline-container-org5dec71e" class="outline-3">
|
||||
<h3 id="org5dec71e"><span class="section-number-3">1.2</span> <span class="todo TODO">TODO</span> Access functions</h3>
|
||||
<div class="outline-text-3" id="text-1-2">
|
||||
<p>
|
||||
Access functions return <code>QMCKL_SUCCESS</code> when the data has been
|
||||
successfully retrieved. It returnes <code>QMCKL_INVALID_CONTEXT</code> when
|
||||
the context is not a valid context, and <code>QMCKL_NOT_PROVIDED</code> when
|
||||
the data has not been provided. If the function returns
|
||||
successfully, the variable pointed by the pointer given in argument
|
||||
contains the requested data. Otherwise, this variable is untouched.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
When all the data relative to electrons have been set, the
|
||||
following function returns <code>true</code>.
|
||||
</p>
|
||||
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-c"><span style="color: #228b22;">bool</span> <span style="color: #0000ff;">qmckl_electron_provided</span> (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>);
|
||||
<pre class="src src-c"><span style="color: #228b22;">bool</span> <span style="color: #0000ff;">qmckl_electron_provided</span> (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>);
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org9365d7a" class="outline-3">
|
||||
<h3 id="org9365d7a"><span class="section-number-3">1.3</span> Initialization functions</h3>
|
||||
|
||||
<div id="outline-container-org383aca0" class="outline-3">
|
||||
<h3 id="org383aca0"><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
|
||||
following functions need to be called. When the data structure is
|
||||
initialized, the <code>coord_new</code> and <code>coord_old</code> arrays are both allocated.
|
||||
initialized, the internal <code>coord_new</code> and <code>coord_old</code> arrays are
|
||||
both allocated.
|
||||
</p>
|
||||
|
||||
<div class="org-src-container">
|
||||
@ -496,8 +507,8 @@ electrons have been set.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org0d3083f" class="outline-3">
|
||||
<h3 id="org0d3083f"><span class="section-number-3">1.4</span> Test</h3>
|
||||
<div id="outline-container-orgac7001e" class="outline-3">
|
||||
<h3 id="orgac7001e"><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>*/
|
||||
@ -525,25 +536,69 @@ electrons have been set.
|
||||
|
||||
assert(!qmckl_electron_provided(context));
|
||||
|
||||
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">n</span>;
|
||||
rc = qmckl_get_electron_num (context, &n);
|
||||
<span style="color: #0000ff;">assert</span>(rc == QMCKL_NOT_PROVIDED);
|
||||
|
||||
rc = qmckl_get_electron_up_num (context, &n);
|
||||
<span style="color: #0000ff;">assert</span>(rc == QMCKL_NOT_PROVIDED);
|
||||
|
||||
rc = qmckl_get_electron_down_num (context, &n);
|
||||
<span style="color: #0000ff;">assert</span>(rc == QMCKL_NOT_PROVIDED);
|
||||
|
||||
|
||||
rc = qmckl_set_electron_num (context, up_num, down_num);
|
||||
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
||||
assert(!qmckl_electron_provided(context));
|
||||
|
||||
rc = qmckl_get_electron_up_num (context, &n);
|
||||
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
||||
<span style="color: #0000ff;">assert</span>(n == up_num);
|
||||
|
||||
rc = qmckl_get_electron_down_num (context, &n);
|
||||
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
||||
<span style="color: #0000ff;">assert</span>(n == down_num);
|
||||
|
||||
rc = qmckl_get_electron_num (context, &n);
|
||||
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
||||
<span style="color: #0000ff;">assert</span>(n == num);
|
||||
|
||||
|
||||
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">w</span>;
|
||||
rc = qmckl_get_electron_walk_num (context, &w);
|
||||
<span style="color: #0000ff;">assert</span>(rc == QMCKL_NOT_PROVIDED);
|
||||
|
||||
|
||||
rc = qmckl_set_electron_walk_num (context, walk_num);
|
||||
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
||||
|
||||
rc = qmckl_get_electron_walk_num (context, &w);
|
||||
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
||||
<span style="color: #0000ff;">assert</span>(w == walk_num);
|
||||
|
||||
<span style="color: #0000ff;">assert</span>(<span style="color: #228b22;">qmckl_electron_provided</span>(<span style="color: #a0522d;">context</span>));
|
||||
|
||||
rc = qmckl_set_electron_coord (context, coord);
|
||||
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
||||
|
||||
/*
|
||||
<span style="color: #b22222;">double coord2[walk_num*3*num];</span>
|
||||
|
||||
<span style="color: #b22222;">rc = qmckl_get_electron_coord_new (context, coord2);</span>
|
||||
<span style="color: #b22222;">assert(rc == QMCKL_SUCCESS);</span>
|
||||
<span style="color: #b22222;">for (size_t i=0 ; i<3*num ; ++i) {</span>
|
||||
<span style="color: #b22222;"> assert( coord[i] == coord2[i] );</span>
|
||||
<span style="color: #b22222;"> }</span>
|
||||
<span style="color: #b22222;"> </span>*/
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgf3baf21" class="outline-2">
|
||||
<h2 id="orgf3baf21"><span class="section-number-2">2</span> Computation</h2>
|
||||
<div id="outline-container-org3018162" class="outline-2">
|
||||
<h2 id="org3018162"><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
|
||||
@ -556,12 +611,12 @@ current date is stored.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org3a6e404" class="outline-3">
|
||||
<h3 id="org3a6e404"><span class="section-number-3">2.1</span> Electron-electron distances</h3>
|
||||
<div id="outline-container-org31280fc" class="outline-3">
|
||||
<h3 id="org31280fc"><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-org8c9af3d" class="outline-4">
|
||||
<h4 id="org8c9af3d"><span class="section-number-4">2.1.1</span> Get</h4>
|
||||
<div id="outline-container-orgc95b870" class="outline-4">
|
||||
<h4 id="orgc95b870"><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>);
|
||||
@ -570,10 +625,10 @@ current date is stored.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orga6b78c5" class="outline-4">
|
||||
<h4 id="orga6b78c5"><span class="section-number-4">2.1.2</span> Compute</h4>
|
||||
<div id="outline-container-orga68544c" class="outline-4">
|
||||
<h4 id="orga68544c"><span class="section-number-4">2.1.2</span> Compute</h4>
|
||||
<div class="outline-text-4" id="text-2-1-2">
|
||||
<table id="org7fbaff8" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
<table id="org2a76d37" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
|
||||
|
||||
<colgroup>
|
||||
@ -670,8 +725,8 @@ current date is stored.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgac11e3a" class="outline-4">
|
||||
<h4 id="orgac11e3a"><span class="section-number-4">2.1.3</span> Test</h4>
|
||||
<div id="outline-container-orgc34ae7b" class="outline-4">
|
||||
<h4 id="orgc34ae7b"><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>*/
|
||||
@ -694,7 +749,7 @@ rc = qmckl_get_electron_ee_distance(context, distance);
|
||||
</div>
|
||||
<div id="postamble" class="status">
|
||||
<p class="author">Author: TREX CoE</p>
|
||||
<p class="date">Created: 2021-05-12 Wed 21:59</p>
|
||||
<p class="date">Created: 2021-05-15 Sat 23:32</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-05-12 Wed 21:59 -->
|
||||
<!-- 2021-05-15 Sat 23:32 -->
|
||||
<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,16 +311,16 @@ for the JavaScript code in this tag.
|
||||
<h2>Table of Contents</h2>
|
||||
<div id="text-table-of-contents">
|
||||
<ul>
|
||||
<li><a href="#org48a30cf">1. Decoding errors</a></li>
|
||||
<li><a href="#org26274c0">2. Data structure in context</a></li>
|
||||
<li><a href="#orgfe5a587">3. Updating errors in the context</a></li>
|
||||
<li><a href="#orge3f57a8">4. Failing</a></li>
|
||||
<li><a href="#org9de947c">1. Decoding errors</a></li>
|
||||
<li><a href="#org5e03145">2. Data structure in context</a></li>
|
||||
<li><a href="#orge1d4a96">3. Updating errors in the context</a></li>
|
||||
<li><a href="#org0d30da5">4. Failing</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org48a30cf" class="outline-2">
|
||||
<h2 id="org48a30cf"><span class="section-number-2">1</span> Decoding errors</h2>
|
||||
<div id="outline-container-org9de947c" class="outline-2">
|
||||
<h2 id="org9de947c"><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
|
||||
@ -387,6 +387,9 @@ The text strings are extracted from the previous table.
|
||||
<span style="color: #a020f0;">case</span> QMCKL_DEALLOCATION_FAILED:
|
||||
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"De-allocation failed"</span>;
|
||||
<span style="color: #a020f0;">break</span>;
|
||||
<span style="color: #a020f0;">case</span> QMCKL_NOT_PROVIDED:
|
||||
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Not provided"</span>;
|
||||
<span style="color: #a020f0;">break</span>;
|
||||
<span style="color: #a020f0;">case</span> QMCKL_INVALID_EXIT_CODE:
|
||||
<span style="color: #a020f0;">return</span> <span style="color: #8b2252;">"Invalid exit code"</span>;
|
||||
<span style="color: #a020f0;">break</span>;
|
||||
@ -414,8 +417,8 @@ The text strings are extracted from the previous table.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org26274c0" class="outline-2">
|
||||
<h2 id="org26274c0"><span class="section-number-2">2</span> Data structure in context</h2>
|
||||
<div id="outline-container-org5e03145" class="outline-2">
|
||||
<h2 id="org5e03145"><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
|
||||
@ -438,8 +441,8 @@ dynamic memory allocation.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgfe5a587" class="outline-2">
|
||||
<h2 id="orgfe5a587"><span class="section-number-2">3</span> Updating errors in the context</h2>
|
||||
<div id="outline-container-orge1d4a96" class="outline-2">
|
||||
<h2 id="orge1d4a96"><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>.
|
||||
@ -485,8 +488,8 @@ explaining the error. The exit code can't be <code>QMCKL_SUCCESS</code>.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orge3f57a8" class="outline-2">
|
||||
<h2 id="orge3f57a8"><span class="section-number-2">4</span> Failing</h2>
|
||||
<div id="outline-container-org0d30da5" class="outline-2">
|
||||
<h2 id="org0d30da5"><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
|
||||
@ -549,7 +552,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-05-12 Wed 21:59</p>
|
||||
<p class="date">Created: 2021-05-15 Sat 23:32</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-05-12 Wed 21:59 -->
|
||||
<!-- 2021-05-15 Sat 23:32 -->
|
||||
<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="#org14a3261">1. Memory data structure for the context</a></li>
|
||||
<li><a href="#org731ecc8">2. Passing info to allocation routines</a></li>
|
||||
<li><a href="#org6a48719">3. Allocation/deallocation functions</a></li>
|
||||
<li><a href="#orgd87bcff">1. Memory data structure for the context</a></li>
|
||||
<li><a href="#orga78e3ba">2. Passing info to allocation routines</a></li>
|
||||
<li><a href="#orgaf9c348">3. Allocation/deallocation functions</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org14a3261" class="outline-2">
|
||||
<h2 id="org14a3261"><span class="section-number-2">1</span> Memory data structure for the context</h2>
|
||||
<div id="outline-container-orgd87bcff" class="outline-2">
|
||||
<h2 id="orgd87bcff"><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-org731ecc8" class="outline-2">
|
||||
<h2 id="org731ecc8"><span class="section-number-2">2</span> Passing info to allocation routines</h2>
|
||||
<div id="outline-container-orga78e3ba" class="outline-2">
|
||||
<h2 id="orga78e3ba"><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-org6a48719" class="outline-2">
|
||||
<h2 id="org6a48719"><span class="section-number-2">3</span> Allocation/deallocation functions</h2>
|
||||
<div id="outline-container-orgaf9c348" class="outline-2">
|
||||
<h2 id="orgaf9c348"><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-05-12 Wed 21:59</p>
|
||||
<p class="date">Created: 2021-05-15 Sat 23:32</p>
|
||||
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
|
||||
</div>
|
||||
</body>
|
||||
|
783
qmckl_nucleus.html
Normal file
783
qmckl_nucleus.html
Normal file
@ -0,0 +1,783 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"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-05-15 Sat 23:32 -->
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>‎</title>
|
||||
<meta name="generator" content="Org mode" />
|
||||
<style type="text/css">
|
||||
<!--/*--><![CDATA[/*><!--*/
|
||||
.title { text-align: center;
|
||||
margin-bottom: .2em; }
|
||||
.subtitle { text-align: center;
|
||||
font-size: medium;
|
||||
font-weight: bold;
|
||||
margin-top:0; }
|
||||
.todo { font-family: monospace; color: red; }
|
||||
.done { font-family: monospace; color: green; }
|
||||
.priority { font-family: monospace; color: orange; }
|
||||
.tag { background-color: #eee; font-family: monospace;
|
||||
padding: 2px; font-size: 80%; font-weight: normal; }
|
||||
.timestamp { color: #bebebe; }
|
||||
.timestamp-kwd { color: #5f9ea0; }
|
||||
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
|
||||
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
|
||||
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
|
||||
.underline { text-decoration: underline; }
|
||||
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
|
||||
p.verse { margin-left: 3%; }
|
||||
pre {
|
||||
border: 1px solid #ccc;
|
||||
box-shadow: 3px 3px 3px #eee;
|
||||
padding: 8pt;
|
||||
font-family: monospace;
|
||||
overflow: auto;
|
||||
margin: 1.2em;
|
||||
}
|
||||
pre.src {
|
||||
position: relative;
|
||||
overflow: visible;
|
||||
padding-top: 1.2em;
|
||||
}
|
||||
pre.src:before {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
top: -10px;
|
||||
right: 10px;
|
||||
padding: 3px;
|
||||
border: 1px solid black;
|
||||
}
|
||||
pre.src:hover:before { display: inline;}
|
||||
/* Languages per Org manual */
|
||||
pre.src-asymptote:before { content: 'Asymptote'; }
|
||||
pre.src-awk:before { content: 'Awk'; }
|
||||
pre.src-C:before { content: 'C'; }
|
||||
/* pre.src-C++ doesn't work in CSS */
|
||||
pre.src-clojure:before { content: 'Clojure'; }
|
||||
pre.src-css:before { content: 'CSS'; }
|
||||
pre.src-D:before { content: 'D'; }
|
||||
pre.src-ditaa:before { content: 'ditaa'; }
|
||||
pre.src-dot:before { content: 'Graphviz'; }
|
||||
pre.src-calc:before { content: 'Emacs Calc'; }
|
||||
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
|
||||
pre.src-fortran:before { content: 'Fortran'; }
|
||||
pre.src-gnuplot:before { content: 'gnuplot'; }
|
||||
pre.src-haskell:before { content: 'Haskell'; }
|
||||
pre.src-hledger:before { content: 'hledger'; }
|
||||
pre.src-java:before { content: 'Java'; }
|
||||
pre.src-js:before { content: 'Javascript'; }
|
||||
pre.src-latex:before { content: 'LaTeX'; }
|
||||
pre.src-ledger:before { content: 'Ledger'; }
|
||||
pre.src-lisp:before { content: 'Lisp'; }
|
||||
pre.src-lilypond:before { content: 'Lilypond'; }
|
||||
pre.src-lua:before { content: 'Lua'; }
|
||||
pre.src-matlab:before { content: 'MATLAB'; }
|
||||
pre.src-mscgen:before { content: 'Mscgen'; }
|
||||
pre.src-ocaml:before { content: 'Objective Caml'; }
|
||||
pre.src-octave:before { content: 'Octave'; }
|
||||
pre.src-org:before { content: 'Org mode'; }
|
||||
pre.src-oz:before { content: 'OZ'; }
|
||||
pre.src-plantuml:before { content: 'Plantuml'; }
|
||||
pre.src-processing:before { content: 'Processing.js'; }
|
||||
pre.src-python:before { content: 'Python'; }
|
||||
pre.src-R:before { content: 'R'; }
|
||||
pre.src-ruby:before { content: 'Ruby'; }
|
||||
pre.src-sass:before { content: 'Sass'; }
|
||||
pre.src-scheme:before { content: 'Scheme'; }
|
||||
pre.src-screen:before { content: 'Gnu Screen'; }
|
||||
pre.src-sed:before { content: 'Sed'; }
|
||||
pre.src-sh:before { content: 'shell'; }
|
||||
pre.src-sql:before { content: 'SQL'; }
|
||||
pre.src-sqlite:before { content: 'SQLite'; }
|
||||
/* additional languages in org.el's org-babel-load-languages alist */
|
||||
pre.src-forth:before { content: 'Forth'; }
|
||||
pre.src-io:before { content: 'IO'; }
|
||||
pre.src-J:before { content: 'J'; }
|
||||
pre.src-makefile:before { content: 'Makefile'; }
|
||||
pre.src-maxima:before { content: 'Maxima'; }
|
||||
pre.src-perl:before { content: 'Perl'; }
|
||||
pre.src-picolisp:before { content: 'Pico Lisp'; }
|
||||
pre.src-scala:before { content: 'Scala'; }
|
||||
pre.src-shell:before { content: 'Shell Script'; }
|
||||
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
|
||||
/* additional language identifiers per "defun org-babel-execute"
|
||||
in ob-*.el */
|
||||
pre.src-cpp:before { content: 'C++'; }
|
||||
pre.src-abc:before { content: 'ABC'; }
|
||||
pre.src-coq:before { content: 'Coq'; }
|
||||
pre.src-groovy:before { content: 'Groovy'; }
|
||||
/* additional language identifiers from org-babel-shell-names in
|
||||
ob-shell.el: ob-shell is the only babel language using a lambda to put
|
||||
the execution function name together. */
|
||||
pre.src-bash:before { content: 'bash'; }
|
||||
pre.src-csh:before { content: 'csh'; }
|
||||
pre.src-ash:before { content: 'ash'; }
|
||||
pre.src-dash:before { content: 'dash'; }
|
||||
pre.src-ksh:before { content: 'ksh'; }
|
||||
pre.src-mksh:before { content: 'mksh'; }
|
||||
pre.src-posh:before { content: 'posh'; }
|
||||
/* Additional Emacs modes also supported by the LaTeX listings package */
|
||||
pre.src-ada:before { content: 'Ada'; }
|
||||
pre.src-asm:before { content: 'Assembler'; }
|
||||
pre.src-caml:before { content: 'Caml'; }
|
||||
pre.src-delphi:before { content: 'Delphi'; }
|
||||
pre.src-html:before { content: 'HTML'; }
|
||||
pre.src-idl:before { content: 'IDL'; }
|
||||
pre.src-mercury:before { content: 'Mercury'; }
|
||||
pre.src-metapost:before { content: 'MetaPost'; }
|
||||
pre.src-modula-2:before { content: 'Modula-2'; }
|
||||
pre.src-pascal:before { content: 'Pascal'; }
|
||||
pre.src-ps:before { content: 'PostScript'; }
|
||||
pre.src-prolog:before { content: 'Prolog'; }
|
||||
pre.src-simula:before { content: 'Simula'; }
|
||||
pre.src-tcl:before { content: 'tcl'; }
|
||||
pre.src-tex:before { content: 'TeX'; }
|
||||
pre.src-plain-tex:before { content: 'Plain TeX'; }
|
||||
pre.src-verilog:before { content: 'Verilog'; }
|
||||
pre.src-vhdl:before { content: 'VHDL'; }
|
||||
pre.src-xml:before { content: 'XML'; }
|
||||
pre.src-nxml:before { content: 'XML'; }
|
||||
/* add a generic configuration mode; LaTeX export needs an additional
|
||||
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
|
||||
pre.src-conf:before { content: 'Configuration File'; }
|
||||
|
||||
table { border-collapse:collapse; }
|
||||
caption.t-above { caption-side: top; }
|
||||
caption.t-bottom { caption-side: bottom; }
|
||||
td, th { vertical-align:top; }
|
||||
th.org-right { text-align: center; }
|
||||
th.org-left { text-align: center; }
|
||||
th.org-center { text-align: center; }
|
||||
td.org-right { text-align: right; }
|
||||
td.org-left { text-align: left; }
|
||||
td.org-center { text-align: center; }
|
||||
dt { font-weight: bold; }
|
||||
.footpara { display: inline; }
|
||||
.footdef { margin-bottom: 1em; }
|
||||
.figure { padding: 1em; }
|
||||
.figure p { text-align: center; }
|
||||
.inlinetask {
|
||||
padding: 10px;
|
||||
border: 2px solid gray;
|
||||
margin: 10px;
|
||||
background: #ffffcc;
|
||||
}
|
||||
#org-div-home-and-up
|
||||
{ text-align: right; font-size: 70%; white-space: nowrap; }
|
||||
textarea { overflow-x: auto; }
|
||||
.linenr { font-size: smaller }
|
||||
.code-highlighted { background-color: #ffff00; }
|
||||
.org-info-js_info-navigation { border-style: none; }
|
||||
#org-info-js_console-label
|
||||
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
|
||||
.org-info-js_search-highlight
|
||||
{ background-color: #ffff00; color: #000000; font-weight: bold; }
|
||||
.org-svg { width: 90%; }
|
||||
/*]]>*/-->
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
/*
|
||||
@licstart The following is the entire license notice for the
|
||||
JavaScript code in this tag.
|
||||
|
||||
Copyright (C) 2012-2019 Free Software Foundation, Inc.
|
||||
|
||||
The JavaScript code in this tag is free software: you can
|
||||
redistribute it and/or modify it under the terms of the GNU
|
||||
General Public License (GNU GPL) as published by the Free Software
|
||||
Foundation, either version 3 of the License, or (at your option)
|
||||
any later version. The code is distributed WITHOUT ANY WARRANTY;
|
||||
without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
|
||||
|
||||
As additional permission under GNU GPL version 3 section 7, you
|
||||
may distribute non-source (e.g., minimized or compacted) forms of
|
||||
that code without the copy of the GNU GPL normally required by
|
||||
section 4, provided you include this license notice and a URL
|
||||
through which recipients can access the Corresponding Source.
|
||||
|
||||
|
||||
@licend The above is the entire license notice
|
||||
for the JavaScript code in this tag.
|
||||
*/
|
||||
<!--/*--><![CDATA[/*><!--*/
|
||||
function CodeHighlightOn(elem, id)
|
||||
{
|
||||
var target = document.getElementById(id);
|
||||
if(null != target) {
|
||||
elem.cacheClassElem = elem.className;
|
||||
elem.cacheClassTarget = target.className;
|
||||
target.className = "code-highlighted";
|
||||
elem.className = "code-highlighted";
|
||||
}
|
||||
}
|
||||
function CodeHighlightOff(elem, id)
|
||||
{
|
||||
var target = document.getElementById(id);
|
||||
if(elem.cacheClassElem)
|
||||
elem.className = elem.cacheClassElem;
|
||||
if(elem.cacheClassTarget)
|
||||
target.className = elem.cacheClassTarget;
|
||||
}
|
||||
/*]]>*///-->
|
||||
</script>
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
displayAlign: "center",
|
||||
displayIndent: "0em",
|
||||
|
||||
"HTML-CSS": { scale: 100,
|
||||
linebreaks: { automatic: "false" },
|
||||
webFont: "TeX"
|
||||
},
|
||||
SVG: {scale: 100,
|
||||
linebreaks: { automatic: "false" },
|
||||
font: "TeX"},
|
||||
NativeMML: {scale: 100},
|
||||
TeX: { equationNumbers: {autoNumber: "AMS"},
|
||||
MultLineWidth: "85%",
|
||||
TagSide: "right",
|
||||
TagIndent: ".8em"
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="content">
|
||||
<div id="table-of-contents">
|
||||
<h2>Table of Contents</h2>
|
||||
<div id="text-table-of-contents">
|
||||
<ul>
|
||||
<li><a href="#org791b593">1. Context</a>
|
||||
<ul>
|
||||
<li><a href="#org660447e">1.1. Data structure</a></li>
|
||||
<li><a href="#orgfcff5f3">1.2. Access functions</a></li>
|
||||
<li><a href="#orgea7e904">1.3. Initialization functions</a></li>
|
||||
<li><a href="#org203c8f5">1.4. Test</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#orga0d3283">2. Computation</a>
|
||||
<ul>
|
||||
<li><a href="#org6cd5f26">2.1. Nucleus-nucleus distances</a>
|
||||
<ul>
|
||||
<li><a href="#orgcd546bf">2.1.1. Get</a></li>
|
||||
<li><a href="#org85b7eb4">2.1.2. Compute</a></li>
|
||||
<li><a href="#org48a2dd8">2.1.3. Test</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#orgf571366">2.2. Nuclear repulsion energy</a>
|
||||
<ul>
|
||||
<li><a href="#orgc9f40da">2.2.1. Get</a></li>
|
||||
<li><a href="#org63cabf9">2.2.2. Compute</a></li>
|
||||
<li><a href="#orge762106">2.2.3. Test</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
#i+TITLE: Nucleus
|
||||
</p>
|
||||
|
||||
<p>
|
||||
A ll the data relative to the molecular geometry is described here.
|
||||
</p>
|
||||
|
||||
<div id="outline-container-org791b593" class="outline-2">
|
||||
<h2 id="org791b593"><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:
|
||||
</p>
|
||||
|
||||
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
|
||||
|
||||
<colgroup>
|
||||
<col class="org-left" />
|
||||
|
||||
<col class="org-left" />
|
||||
|
||||
<col class="org-left" />
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="org-left"><code>uninitialized</code></td>
|
||||
<td class="org-left">int32<sub>t</sub></td>
|
||||
<td class="org-left">Keeps bit set for uninitialized data</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left"><code>num</code></td>
|
||||
<td class="org-left">int64<sub>t</sub></td>
|
||||
<td class="org-left">Total number of nuclei</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left"><code>provided</code></td>
|
||||
<td class="org-left">bool</td>
|
||||
<td class="org-left">If true, <code>nucleus</code> is valid</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left"><code>charge</code></td>
|
||||
<td class="org-left">double[num]</td>
|
||||
<td class="org-left">Nuclear charges</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left"><code>coord</code></td>
|
||||
<td class="org-left">double[3][num]</td>
|
||||
<td class="org-left">Nuclear coordinates</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left"><code>nn_distance</code></td>
|
||||
<td class="org-left">double[num][num]</td>
|
||||
<td class="org-left">Nucleus-nucleus distances</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left"><code>nn_distance_date</code></td>
|
||||
<td class="org-left">int64<sub>t</sub></td>
|
||||
<td class="org-left">Date when Nucleus-nucleus distances were computed</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left"><code>repulsion</code></td>
|
||||
<td class="org-left">double</td>
|
||||
<td class="org-left">Nuclear repulsion energy</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left"><code>repulsion_date</code></td>
|
||||
<td class="org-left">int64<sub>t</sub></td>
|
||||
<td class="org-left">Date when the nuclear repulsion energy was computed</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org660447e" class="outline-3">
|
||||
<h3 id="org660447e"><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_nucleus_struct</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;">repulsion_date</span>;
|
||||
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">nn_distance_date</span>;
|
||||
<span style="color: #228b22;">double</span>* <span style="color: #a0522d;">coord</span>;
|
||||
<span style="color: #228b22;">double</span>* <span style="color: #a0522d;">charge</span>;
|
||||
<span style="color: #228b22;">double</span>* <span style="color: #a0522d;">nn_distance</span>;
|
||||
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">repulsion</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_nucleus_struct</span>;
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
The <code>uninitialized</code> integer contains one bit set to one for each
|
||||
initialization function which has not bee called. It becomes equal
|
||||
to zero after all initialization functions have been called. The
|
||||
struct is then initialized and <code>provided == true</code>.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgfcff5f3" class="outline-3">
|
||||
<h3 id="orgfcff5f3"><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 nuclei have been set, the following
|
||||
function returns <code>true</code>.
|
||||
</p>
|
||||
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-c"><span style="color: #228b22;">bool</span> <span style="color: #0000ff;">qmckl_nucleus_provided</span> (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>);
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgea7e904" class="outline-3">
|
||||
<h3 id="orgea7e904"><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 nuclei in the context, the
|
||||
following functions need to be called.
|
||||
</p>
|
||||
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_set_nucleus_num</span> (<span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">num</span>);
|
||||
<span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_set_nucleus_charge</span> (<span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span>* <span style="color: #a0522d;">charge</span>);
|
||||
<span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_set_nucleus_coord</span> (<span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span>* <span style="color: #a0522d;">coord</span>);
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
To set the number of nuclei, use
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The following function sets the nuclear charges of all the atoms.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The following function sets the nuclear coordinates of all the
|
||||
atoms. The coordinates should be given in atomic units.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org203c8f5" class="outline-3">
|
||||
<h3 id="org203c8f5"><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>*/
|
||||
|
||||
<span style="color: #483d8b;">#define</span> <span style="color: #a0522d;">num</span> ((<span style="color: #228b22;">int64_t</span>) 9)
|
||||
|
||||
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">charge</span>[num] = { 6., 6., 6., 7., 7., 1., 1., 1., 1. };
|
||||
|
||||
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">coord</span>[3*num] =
|
||||
{ 4.166279566732572e-01, -1.526183863767697e+00, 1.041604719335635e+00,
|
||||
-1.903457631371503e+00, 2.242154435363994e+00, 6.550163404813796e-01,
|
||||
-3.575005445908036e+00, -3.063638942318878e+00, 2.086739409279095e+00,
|
||||
2.060062599100338e+00, -1.623431626827498e+00, -1.930074272670425e+00,
|
||||
9.491495662916423e-01, 3.808343139803397e-01, 4.077482772289367e+00,
|
||||
1.841031662652821e+00, -2.945591662994877e+00, -3.670011011125464e+00,
|
||||
0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
|
||||
0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00,
|
||||
0.000000000000000e+00, 0.000000000000000e+00, 0.000000000000000e+00};
|
||||
|
||||
/* <span style="color: #b22222;">--- </span>*/
|
||||
|
||||
<span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #a0522d;">rc</span>;
|
||||
|
||||
assert(!qmckl_nucleus_provided(context));
|
||||
|
||||
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">n</span>;
|
||||
rc = qmckl_get_nucleus_num (context, &n);
|
||||
<span style="color: #0000ff;">assert</span>(rc == QMCKL_NOT_PROVIDED);
|
||||
|
||||
|
||||
rc = qmckl_set_nucleus_num (context, num);
|
||||
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
||||
assert(!qmckl_nucleus_provided(context));
|
||||
|
||||
rc = qmckl_get_nucleus_num (context, &n);
|
||||
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
||||
<span style="color: #0000ff;">assert</span>(n == num);
|
||||
|
||||
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">coord2</span>[3*num];
|
||||
|
||||
rc = qmckl_get_nucleus_coord (context, coord2);
|
||||
<span style="color: #0000ff;">assert</span>(rc == QMCKL_NOT_PROVIDED);
|
||||
|
||||
rc = qmckl_set_nucleus_coord (context, coord);
|
||||
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
||||
|
||||
rc = qmckl_get_nucleus_coord (context, coord2);
|
||||
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
||||
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">size_t</span> <span style="color: #a0522d;">i</span>=0 ; i<3*num ; ++i) {
|
||||
assert( coord[i] == coord2[i] );
|
||||
}
|
||||
|
||||
assert(!qmckl_nucleus_provided(context));
|
||||
|
||||
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">charge2</span>[num];
|
||||
|
||||
rc = qmckl_get_nucleus_charge(context, charge2);
|
||||
<span style="color: #0000ff;">assert</span>(rc == QMCKL_NOT_PROVIDED);
|
||||
|
||||
rc = qmckl_set_nucleus_charge(context, charge);
|
||||
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
||||
|
||||
rc = qmckl_get_nucleus_charge(context, charge2);
|
||||
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
||||
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">size_t</span> <span style="color: #a0522d;">i</span>=0 ; i<num ; ++i) {
|
||||
assert( charge[i] == charge2[i] );
|
||||
}
|
||||
<span style="color: #0000ff;">assert</span>(<span style="color: #228b22;">qmckl_nucleus_provided</span>(<span style="color: #a0522d;">context</span>));
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orga0d3283" class="outline-2">
|
||||
<h2 id="orga0d3283"><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-org6cd5f26" class="outline-3">
|
||||
<h3 id="org6cd5f26"><span class="section-number-3">2.1</span> Nucleus-nucleus distances</h3>
|
||||
<div class="outline-text-3" id="text-2-1">
|
||||
</div>
|
||||
<div id="outline-container-orgcd546bf" class="outline-4">
|
||||
<h4 id="orgcd546bf"><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_nucleus_nn_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-org85b7eb4" class="outline-4">
|
||||
<h4 id="org85b7eb4"><span class="section-number-4">2.1.2</span> Compute</h4>
|
||||
<div class="outline-text-4" id="text-2-1-2">
|
||||
<table id="org4a31db3" 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">nucl<sub>num</sub></td>
|
||||
<td class="org-left">in</td>
|
||||
<td class="org-left">Number of nuclei</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left">double</td>
|
||||
<td class="org-left">coord[3][nucl<sub>num</sub>]</td>
|
||||
<td class="org-left">in</td>
|
||||
<td class="org-left">Nuclear coordinates (au)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left">double</td>
|
||||
<td class="org-left">nn<sub>distance</sub>[nucl<sub>num</sub>][nucl<sub>num</sub>]</td>
|
||||
<td class="org-left">out</td>
|
||||
<td class="org-left">Nucleus-nucleus distances (au)</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_nn_distance_f</span><span style="color: #000000; background-color: #ffffff;">(context, nucl_num, coord, nn_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;"> nucl_num</span>
|
||||
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> coord(nucl_num,3)</span>
|
||||
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(out) ::<span style="color: #a0522d;"> nn_distance(nucl_num,nucl_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> (nucl_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>
|
||||
|
||||
info = qmckl_distance(context, <span style="color: #8b2252;">'T'</span>, <span style="color: #8b2252;">'T'</span>, nucl_num, nucl_num, <span style="color: #a020f0;">&</span>
|
||||
coord, nucl_num, <span style="color: #a020f0;">&</span>
|
||||
coord, nucl_num, <span style="color: #a020f0;">&</span>
|
||||
nn_distance, nucl_num)
|
||||
|
||||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_compute_nn_distance_f</span>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org48a2dd8" class="outline-4">
|
||||
<h4 id="org48a2dd8"><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;">assert</span>(<span style="color: #228b22;">qmckl_nucleus_provided</span>(<span style="color: #a0522d;">context</span>));
|
||||
|
||||
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">distance</span>[num*num];
|
||||
rc = qmckl_get_nucleus_nn_distance(context, distance);
|
||||
rc = qmckl_get_nucleus_nn_distance(context, distance);
|
||||
<span style="color: #0000ff;">assert</span>(<span style="color: #228b22;">distance</span>[0] == 0.);
|
||||
<span style="color: #0000ff;">assert</span>(<span style="color: #228b22;">distance</span>[1] == distance[num]);
|
||||
<span style="color: #0000ff;">assert</span>(abs(<span style="color: #228b22;">distance</span>[1]-4.164450441785663) < 1.e-12);
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgf571366" class="outline-3">
|
||||
<h3 id="orgf571366"><span class="section-number-3">2.2</span> Nuclear repulsion energy</h3>
|
||||
<div class="outline-text-3" id="text-2-2">
|
||||
<p>
|
||||
\[
|
||||
V_{NN} = \sum_{A=1}^{N-1} \sum_{B>A}^N \frac{Q_A Q_B}{R_{AB}}
|
||||
\]
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgc9f40da" class="outline-4">
|
||||
<h4 id="orgc9f40da"><span class="section-number-4">2.2.1</span> Get</h4>
|
||||
<div class="outline-text-4" id="text-2-2-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_nucleus_repulsion</span>(<span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>, <span style="color: #228b22;">double</span>* <span style="color: #a0522d;">energy</span>);
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-org63cabf9" class="outline-4">
|
||||
<h4 id="org63cabf9"><span class="section-number-4">2.2.2</span> Compute</h4>
|
||||
<div class="outline-text-4" id="text-2-2-2">
|
||||
<table id="org124e520" 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">nucl<sub>num</sub></td>
|
||||
<td class="org-left">in</td>
|
||||
<td class="org-left">Number of nuclei</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left">double</td>
|
||||
<td class="org-left">charge[nucl<sub>num</sub>]</td>
|
||||
<td class="org-left">in</td>
|
||||
<td class="org-left">Nuclear charges (au)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left">double</td>
|
||||
<td class="org-left">nn<sub>distance</sub>[nucl<sub>num</sub>][nucl<sub>num</sub>]</td>
|
||||
<td class="org-left">in</td>
|
||||
<td class="org-left">Nucleus-nucleus distances (au)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="org-left">double</td>
|
||||
<td class="org-left">energy</td>
|
||||
<td class="org-left">out</td>
|
||||
<td class="org-left">Nuclear repulsion energy</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_nucleus_repulsion_f</span><span style="color: #000000; background-color: #ffffff;">(context, nucl_num, charge, nn_distance, energy)</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;"> nucl_num</span>
|
||||
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> charge(nucl_num)</span>
|
||||
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> nn_distance(nucl_num,nucl_num)</span>
|
||||
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(out) ::<span style="color: #a0522d;"> energy</span>
|
||||
|
||||
<span style="color: #228b22;">integer</span>*8 ::<span style="color: #a0522d;"> i, j</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> (nucl_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>
|
||||
|
||||
energy = 0.d0
|
||||
<span style="color: #a020f0;">do</span> j=2, nucl_num
|
||||
<span style="color: #a020f0;">do</span> i=1, j-1
|
||||
energy = energy + charge(i) * charge(j) / nn_distance(i,j)
|
||||
<span style="color: #a020f0;">end do</span>
|
||||
<span style="color: #a020f0;">end do</span>
|
||||
<span style="color: #a020f0;">print</span> *, energy
|
||||
|
||||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_compute_nucleus_repulsion_f</span>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orge762106" class="outline-4">
|
||||
<h4 id="orge762106"><span class="section-number-4">2.2.3</span> Test</h4>
|
||||
<div class="outline-text-4" id="text-2-2-3">
|
||||
<div class="org-src-container">
|
||||
<pre class="src src-c">/* <span style="color: #b22222;">Reference input data </span>*/
|
||||
|
||||
<span style="color: #0000ff;">assert</span>(<span style="color: #228b22;">qmckl_nucleus_provided</span>(<span style="color: #a0522d;">context</span>));
|
||||
|
||||
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">rep</span>;
|
||||
rc = qmckl_get_nucleus_repulsion(context, &rep);
|
||||
<span style="color: #0000ff;">assert</span>(rep - 163.50434957121263 < 1.e-10);
|
||||
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="postamble" class="status">
|
||||
<p class="date">Created: 2021-05-15 Sat 23:32</p>
|
||||
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
|
||||
</div>
|
||||
</body>
|
||||
</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-05-12 Wed 21:59 -->
|
||||
<!-- 2021-05-15 Sat 23:32 -->
|
||||
<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="#orgd2bfadf">1. Control of the numerical precision</a></li>
|
||||
<li><a href="#org76f444c">2. Precision</a></li>
|
||||
<li><a href="#org0810937">3. Range</a></li>
|
||||
<li><a href="#org6dc8c08">4. Helper functions</a></li>
|
||||
<li><a href="#org7b24b19">1. Control of the numerical precision</a></li>
|
||||
<li><a href="#orgcde4cf4">2. Precision</a></li>
|
||||
<li><a href="#org928fb26">3. Range</a></li>
|
||||
<li><a href="#orgb731157">4. Helper functions</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-orgd2bfadf" class="outline-2">
|
||||
<h2 id="orgd2bfadf"><span class="section-number-2">1</span> Control of the numerical precision</h2>
|
||||
<div id="outline-container-org7b24b19" class="outline-2">
|
||||
<h2 id="org7b24b19"><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="orgbdc9a5f" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
<table id="org8a79000" 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-org76f444c" class="outline-2">
|
||||
<h2 id="org76f444c"><span class="section-number-2">2</span> Precision</h2>
|
||||
<div id="outline-container-orgcde4cf4" class="outline-2">
|
||||
<h2 id="orgcde4cf4"><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-org0810937" class="outline-2">
|
||||
<h2 id="org0810937"><span class="section-number-2">3</span> Range</h2>
|
||||
<div id="outline-container-org928fb26" class="outline-2">
|
||||
<h2 id="org928fb26"><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-org6dc8c08" class="outline-2">
|
||||
<h2 id="org6dc8c08"><span class="section-number-2">4</span> Helper functions</h2>
|
||||
<div id="outline-container-orgb731157" class="outline-2">
|
||||
<h2 id="orgb731157"><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-05-12 Wed 21:59</p>
|
||||
<p class="date">Created: 2021-05-15 Sat 23:32</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