1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-08-24 22:21:46 +02:00

Deploying to gh-pages from @ TREX-CoE/qmckl@e18655b147 🚀

This commit is contained in:
scemama 2021-04-20 23:58:32 +00:00
parent 0c67ce7a46
commit 7091e5f58b
11 changed files with 1133 additions and 293 deletions

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-04-20 Tue 22:01 -->
<!-- 2021-04-20 Tue 23:58 -->
<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>
@ -315,6 +315,7 @@ for the JavaScript code in this tag.
<li><a href="./qmckl_error.html">Error handling</a></li>
<li><a href="./qmckl_context.html">Context</a></li>
<li><a href="./qmckl_memory.html">Memory management</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>
<li><a href="./test_qmckl.html">Testing</a></li>
@ -348,7 +349,7 @@ and bug reports should be submitted at
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX CoE</p>
<p class="date">Created: 2021-04-20 Tue 22:01</p>
<p class="date">Created: 2021-04-20 Tue 23:58</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-04-20 Tue 22:01 -->
<!-- 2021-04-20 Tue 23:58 -->
<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>
@ -315,6 +315,7 @@ for the JavaScript code in this tag.
<li><a href="./qmckl_error.html">Error handling</a></li>
<li><a href="./qmckl_context.html">Context</a></li>
<li><a href="./qmckl_memory.html">Memory management</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>
<li><a href="./test_qmckl.html">Testing</a></li>
@ -348,7 +349,7 @@ and bug reports should be submitted at
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX CoE</p>
<p class="date">Created: 2021-04-20 Tue 22:01</p>
<p class="date">Created: 2021-04-20 Tue 23:58</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-04-20 Tue 22:01 -->
<!-- 2021-04-20 Tue 23:58 -->
<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="#orgfad701e">1. Using QMCkl</a></li>
<li><a href="#org666b0a8">2. Developing in QMCkl</a>
<li><a href="#orgb39614c">1. Using QMCkl</a></li>
<li><a href="#org47eebb8">2. Developing in QMCkl</a>
<ul>
<li><a href="#orgc90ef5a">2.1. Literate programming</a></li>
<li><a href="#orgcd82212">2.2. Source code editing</a></li>
<li><a href="#orga892df6">2.3. Choice of the programming language</a></li>
<li><a href="#org91f35ed">2.4. Coding rules</a></li>
<li><a href="#org4363ef9">2.5. Design of the library</a></li>
<li><a href="#orgb99ff1c">2.6. Naming conventions</a></li>
<li><a href="#org33dc21d">2.7. Application programming interface</a></li>
<li><a href="#org99e6046">2.8. Global state</a></li>
<li><a href="#org8d8ca42">2.9. Headers</a></li>
<li><a href="#org813fe30">2.10. Low-level functions</a></li>
<li><a href="#org0fbd9f2">2.11. High-level functions</a></li>
<li><a href="#org649b7e0">2.12. Numerical precision</a></li>
<li><a href="#org83f62db">2.13. Algorithms</a></li>
<li><a href="#orge8d85ab">2.1. Literate programming</a></li>
<li><a href="#orgc74e2e9">2.2. Source code editing</a></li>
<li><a href="#org9c1bc9c">2.3. Choice of the programming language</a></li>
<li><a href="#org48f31ad">2.4. Coding rules</a></li>
<li><a href="#org7425b8d">2.5. Design of the library</a></li>
<li><a href="#org52c4332">2.6. Naming conventions</a></li>
<li><a href="#orge08eed5">2.7. Application programming interface</a></li>
<li><a href="#orgde432c6">2.8. Global state</a></li>
<li><a href="#org1b846e9">2.9. Headers</a></li>
<li><a href="#org15e7220">2.10. Low-level functions</a></li>
<li><a href="#orgaf0612e">2.11. High-level functions</a></li>
<li><a href="#org45c91be">2.12. Numerical precision</a></li>
<li><a href="#orga3016ce">2.13. Algorithms</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-orgfad701e" class="outline-2">
<h2 id="orgfad701e"><span class="section-number-2">1</span> Using QMCkl</h2>
<div id="outline-container-orgb39614c" class="outline-2">
<h2 id="orgb39614c"><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 has to be included in C codes when
@ -385,12 +385,12 @@ Both files are located in the <code>include/</code> directory.
</div>
</div>
<div id="outline-container-org666b0a8" class="outline-2">
<h2 id="org666b0a8"><span class="section-number-2">2</span> Developing in QMCkl</h2>
<div id="outline-container-org47eebb8" class="outline-2">
<h2 id="org47eebb8"><span class="section-number-2">2</span> Developing in QMCkl</h2>
<div class="outline-text-2" id="text-2">
</div>
<div id="outline-container-orgc90ef5a" class="outline-3">
<h3 id="orgc90ef5a"><span class="section-number-3">2.1</span> Literate programming</h3>
<div id="outline-container-orge8d85ab" class="outline-3">
<h3 id="orge8d85ab"><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-orgcd82212" class="outline-3">
<h3 id="orgcd82212"><span class="section-number-3">2.2</span> Source code editing</h3>
<div id="outline-container-orgc74e2e9" class="outline-3">
<h3 id="orgc74e2e9"><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-orga892df6" class="outline-3">
<h3 id="orga892df6"><span class="section-number-3">2.3</span> Choice of the programming language</h3>
<div id="outline-container-org9c1bc9c" class="outline-3">
<h3 id="org9c1bc9c"><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-org91f35ed" class="outline-3">
<h3 id="org91f35ed"><span class="section-number-3">2.4</span> Coding rules</h3>
<div id="outline-container-org48f31ad" class="outline-3">
<h3 id="org48f31ad"><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-org4363ef9" class="outline-3">
<h3 id="org4363ef9"><span class="section-number-3">2.5</span> Design of the library</h3>
<div id="outline-container-org7425b8d" class="outline-3">
<h3 id="org7425b8d"><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-orgb99ff1c" class="outline-3">
<h3 id="orgb99ff1c"><span class="section-number-3">2.6</span> Naming conventions</h3>
<div id="outline-container-org52c4332" class="outline-3">
<h3 id="org52c4332"><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-org33dc21d" class="outline-3">
<h3 id="org33dc21d"><span class="section-number-3">2.7</span> Application programming interface</h3>
<div id="outline-container-orge08eed5" class="outline-3">
<h3 id="orge08eed5"><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-org99e6046" class="outline-3">
<h3 id="org99e6046"><span class="section-number-3">2.8</span> Global state</h3>
<div id="outline-container-orgde432c6" class="outline-3">
<h3 id="orgde432c6"><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="org8da452a">=context=</a> contains the global
<code>qmckl_context_create</code> function. The <a id="orgf27b1bb">=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-org8d8ca42" class="outline-3">
<h3 id="org8d8ca42"><span class="section-number-3">2.9</span> Headers</h3>
<div id="outline-container-org1b846e9" class="outline-3">
<h3 id="org1b846e9"><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-org813fe30" class="outline-3">
<h3 id="org813fe30"><span class="section-number-3">2.10</span> Low-level functions</h3>
<div id="outline-container-org15e7220" class="outline-3">
<h3 id="org15e7220"><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="#org8da452a"><code>context</code></a>. They are not allowed to allocate/deallocate memory, and
<a href="#orgf27b1bb"><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-org0fbd9f2" class="outline-3">
<h3 id="org0fbd9f2"><span class="section-number-3">2.11</span> High-level functions</h3>
<div id="outline-container-orgaf0612e" class="outline-3">
<h3 id="orgaf0612e"><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="#org8da452a"><code>context</code></a> variable.
the <a href="#orgf27b1bb"><code>context</code></a> variable.
</p>
</div>
</div>
<div id="outline-container-org649b7e0" class="outline-3">
<h3 id="org649b7e0"><span class="section-number-3">2.12</span> Numerical precision</h3>
<div id="outline-container-org45c91be" class="outline-3">
<h3 id="org45c91be"><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="#org8da452a"><code>context</code></a>
functions will use the precision specified in the <a href="#orgf27b1bb"><code>context</code></a>
variable.
</p>
</div>
</div>
<div id="outline-container-org83f62db" class="outline-3">
<h3 id="org83f62db"><span class="section-number-3">2.13</span> Algorithms</h3>
<div id="outline-container-orga3016ce" class="outline-3">
<h3 id="orga3016ce"><span class="section-number-3">2.13</span> Algorithms</h3>
<div class="outline-text-3" id="text-2-13">
<p>
Reducing the scaling of an algorithm usually implies also reducing
@ -783,7 +783,7 @@ implemented adapted to different problem sizes.
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX CoE</p>
<p class="date">Created: 2021-04-20 Tue 22:01</p>
<p class="date">Created: 2021-04-20 Tue 23:58</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-04-20 Tue 22:01 -->
<!-- 2021-04-20 Tue 23:58 -->
<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,53 +333,53 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orgce1522e">1. Context</a>
<li><a href="#orgb3c54d6">1. Context</a>
<ul>
<li><a href="#orgcdcc5b5">1.1. Data structure</a></li>
<li><a href="#org258ad60">1.2. Access functions</a></li>
<li><a href="#org3e065e2">1.3. Initialization functions</a></li>
<li><a href="#org4da0693">1.4. Fortran interfaces</a></li>
<li><a href="#org2b96616">1.5. Test</a></li>
<li><a href="#org60778e8">1.1. Data structure</a></li>
<li><a href="#orgfc374b2">1.2. Access functions</a></li>
<li><a href="#org949381e">1.3. Initialization functions</a></li>
<li><a href="#org1e1d403">1.4. Fortran interfaces</a></li>
<li><a href="#orga27fbc0">1.5. Test</a></li>
</ul>
</li>
<li><a href="#org0bced8c">2. Polynomial part</a>
<li><a href="#org2dd3152">2. Polynomial part</a>
<ul>
<li><a href="#orgcba21c7">2.1. Powers of \(x-X_i\)</a>
<li><a href="#org81ef740">2.1. Powers of \(x-X_i\)</a>
<ul>
<li><a href="#org1bb8b0a">2.1.1. Requirements:</a></li>
<li><a href="#org6494fd7">2.1.2. C Header</a></li>
<li><a href="#org329019a">2.1.3. Source</a></li>
<li><a href="#orga94d462">2.1.4. C interface</a></li>
<li><a href="#org59cca8f">2.1.5. Fortran interface</a></li>
<li><a href="#orgb0888d8">2.1.6. Test</a></li>
<li><a href="#org13ea040">2.1.1. Requirements:</a></li>
<li><a href="#orga3db3e5">2.1.2. C Header</a></li>
<li><a href="#org2f6a735">2.1.3. Source</a></li>
<li><a href="#org0c99fed">2.1.4. C interface</a></li>
<li><a href="#orgddba532">2.1.5. Fortran interface</a></li>
<li><a href="#orgf14d0f0">2.1.6. Test</a></li>
</ul>
</li>
<li><a href="#org7c2ef9a">2.2. Value, Gradient and Laplacian of a polynomial</a>
<li><a href="#org29ed836">2.2. Value, Gradient and Laplacian of a polynomial</a>
<ul>
<li><a href="#orgd54ce22">2.2.1. Requirements:</a></li>
<li><a href="#orga26f3c4">2.2.2. C Header</a></li>
<li><a href="#org22be8b7">2.2.3. Source</a></li>
<li><a href="#org2785a0c">2.2.4. C interface</a></li>
<li><a href="#org0e8bb66">2.2.5. Fortran interface</a></li>
<li><a href="#org0505231">2.2.6. Test</a></li>
<li><a href="#orgd683718">2.2.1. Requirements:</a></li>
<li><a href="#orga00f890">2.2.2. C Header</a></li>
<li><a href="#org3294b51">2.2.3. Source</a></li>
<li><a href="#org9dcaf9c">2.2.4. C interface</a></li>
<li><a href="#org1e96c28">2.2.5. Fortran interface</a></li>
<li><a href="#orgc4a7ebb">2.2.6. Test</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#orgc487072">3. Radial part</a>
<li><a href="#orgbd9787e">3. Radial part</a>
<ul>
<li><a href="#org6a2a1e5">3.1. Gaussian basis functions</a></li>
<li><a href="#org2a6851f">3.2. <span class="todo TODO">TODO</span> Slater basis functions</a></li>
<li><a href="#orgffe9622">3.3. <span class="todo TODO">TODO</span> Radial functions on a grid</a></li>
<li><a href="#org10af1a6">3.1. Gaussian basis functions</a></li>
<li><a href="#orgd3757be">3.2. <span class="todo TODO">TODO</span> Slater basis functions</a></li>
<li><a href="#org1949806">3.3. <span class="todo TODO">TODO</span> Radial functions on a grid</a></li>
</ul>
</li>
<li><a href="#orge4de929">4. Combining radial and polynomial parts</a></li>
<li><a href="#orgda9c56e">4. Combining radial and polynomial parts</a></li>
</ul>
</div>
</div>
<div id="outline-container-orgce1522e" class="outline-2">
<h2 id="orgce1522e"><span class="section-number-2">1</span> Context</h2>
<div id="outline-container-orgb3c54d6" class="outline-2">
<h2 id="orgb3c54d6"><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:
@ -504,12 +504,11 @@ coefficient = [ 0.006068, 0.045308, 0.202822, 0.503903, 0.383421,
</pre>
</div>
<div id="outline-container-orgcdcc5b5" class="outline-3">
<h3 id="orgcdcc5b5"><span class="section-number-3">1.1</span> Data structure</h3>
<div id="outline-container-org60778e8" class="outline-3">
<h3 id="org60778e8"><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> {
<span style="color: #228b22;">int32_t</span> <span style="color: #a0522d;">provided</span>;
<span style="color: #228b22;">int32_t</span> <span style="color: #a0522d;">uninitialized</span>;
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">shell_num</span>;
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">prim_num</span>;
@ -520,6 +519,7 @@ coefficient = [ 0.006068, 0.045308, 0.202822, 0.503903, 0.383421,
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">shell_factor</span>;
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">exponent</span> ;
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">coefficient</span> ;
<span style="color: #228b22;">bool</span> <span style="color: #a0522d;">provided</span>;
<span style="color: #228b22;">char</span> <span style="color: #a0522d;">type</span>;
} <span style="color: #228b22;">qmckl_ao_basis_struct</span>;
</pre>
@ -529,13 +529,13 @@ coefficient = [ 0.006068, 0.045308, 0.202822, 0.503903, 0.383421,
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 == 1</code>.
struct is then initialized and <code>provided == true</code>.
</p>
</div>
</div>
<div id="outline-container-org258ad60" class="outline-3">
<h3 id="org258ad60"><span class="section-number-3">1.2</span> Access functions</h3>
<div id="outline-container-orgfc374b2" class="outline-3">
<h3 id="orgfc374b2"><span class="section-number-3">1.2</span> Access functions</h3>
<div class="outline-text-3" id="text-1-2">
<p>
Access to scalars copies the values at the passed address, and
@ -557,12 +557,12 @@ for array values a pointer to the array is returned.
</div>
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">int32_t</span> <span style="color: #0000ff;">qmckl_ao_basis_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_ao_basis_provided</span> (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>);
</pre>
</div>
<div class="org-src-container">
<pre class="src src-c" id="org96ca732"><span style="color: #a020f0;">if</span> ( (ctx-&gt;ao_basis.uninitialized &amp; mask) != 0) {
<pre class="src src-c" id="orgc57d02b"><span style="color: #a020f0;">if</span> ( (ctx-&gt;ao_basis.uninitialized &amp; mask) != 0) {
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
}
</pre>
@ -761,10 +761,10 @@ for array values a pointer to the array is returned.
}
<span style="color: #228b22;">int32_t</span> <span style="color: #0000ff;">qmckl_ao_basis_provided</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>) {
<span style="color: #228b22;">bool</span> <span style="color: #0000ff;">qmckl_ao_basis_provided</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>) {
<span style="color: #a020f0;">if</span> (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
<span style="color: #a020f0;">return</span> 0;
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">false</span>;
}
<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">ctx</span> = (<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a020f0;">const</span>) context;
@ -777,8 +777,8 @@ for array values a pointer to the array is returned.
</div>
</div>
<div id="outline-container-org3e065e2" class="outline-3">
<h3 id="org3e065e2"><span class="section-number-3">1.3</span> Initialization functions</h3>
<div id="outline-container-org949381e" class="outline-3">
<h3 id="org949381e"><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
@ -800,7 +800,7 @@ called. When
</div>
<div class="org-src-container">
<pre class="src src-c" id="org8277761"><span style="color: #a020f0;">if</span> (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
<pre class="src src-c" id="org24d06f1"><span style="color: #a020f0;">if</span> (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
<span style="color: #a020f0;">return</span> QMCKL_NULL_CONTEXT;
}
@ -809,11 +809,8 @@ called. When
</div>
<div class="org-src-container">
<pre class="src src-c" id="org88e7054">ctx-&gt;ao_basis.uninitialized &amp;= ~mask;
<span style="color: #a020f0;">if</span> (ctx-&gt;ao_basis.uninitialized == 0) {
ctx-&gt;ao_basis.provided = 1;
}
<pre class="src src-c" id="org390e21f">ctx-&gt;ao_basis.uninitialized &amp;= ~mask;
ctx-&gt;ao_basis.provided = (ctx-&gt;ao_basis.uninitialized == 0);
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
</pre>
@ -839,10 +836,7 @@ called. When
ctx-&gt;ao_basis.type = t;
ctx-&gt;ao_basis.uninitialized &amp;= ~mask;
<span style="color: #a020f0;">if</span> (ctx-&gt;ao_basis.uninitialized == 0) {
ctx-&gt;ao_basis.provided = 1;
}
ctx-&gt;ao_basis.provided = (ctx-&gt;ao_basis.uninitialized == 0);
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
}
@ -875,10 +869,7 @@ called. When
ctx-&gt;ao_basis.shell_num = shell_num;
ctx-&gt;ao_basis.uninitialized &amp;= ~mask;
<span style="color: #a020f0;">if</span> (ctx-&gt;ao_basis.uninitialized == 0) {
ctx-&gt;ao_basis.provided = 1;
}
ctx-&gt;ao_basis.provided = (ctx-&gt;ao_basis.uninitialized == 0);
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
}
@ -911,10 +902,7 @@ called. When
ctx-&gt;ao_basis.prim_num = prim_num;
ctx-&gt;ao_basis.uninitialized &amp;= ~mask;
<span style="color: #a020f0;">if</span> (ctx-&gt;ao_basis.uninitialized == 0) {
ctx-&gt;ao_basis.provided = 1;
}
ctx-&gt;ao_basis.provided = (ctx-&gt;ao_basis.uninitialized == 0);
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
}
@ -962,10 +950,7 @@ called. When
ctx-&gt;ao_basis.shell_center = new_array;
ctx-&gt;ao_basis.uninitialized &amp;= ~mask;
<span style="color: #a020f0;">if</span> (ctx-&gt;ao_basis.uninitialized == 0) {
ctx-&gt;ao_basis.provided = 1;
}
ctx-&gt;ao_basis.provided = (ctx-&gt;ao_basis.uninitialized == 0);
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
}
@ -1014,10 +999,7 @@ called. When
ctx-&gt;ao_basis.shell_ang_mom = new_array;
ctx-&gt;ao_basis.uninitialized &amp;= ~mask;
<span style="color: #a020f0;">if</span> (ctx-&gt;ao_basis.uninitialized == 0) {
ctx-&gt;ao_basis.provided = 1;
}
ctx-&gt;ao_basis.provided = (ctx-&gt;ao_basis.uninitialized == 0);
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
}
@ -1066,10 +1048,7 @@ called. When
ctx-&gt;ao_basis.shell_prim_num = new_array;
ctx-&gt;ao_basis.uninitialized &amp;= ~mask;
<span style="color: #a020f0;">if</span> (ctx-&gt;ao_basis.uninitialized == 0) {
ctx-&gt;ao_basis.provided = 1;
}
ctx-&gt;ao_basis.provided = (ctx-&gt;ao_basis.uninitialized == 0);
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
}
@ -1117,10 +1096,7 @@ called. When
ctx-&gt;ao_basis.shell_prim_index = new_array;
ctx-&gt;ao_basis.uninitialized &amp;= ~mask;
<span style="color: #a020f0;">if</span> (ctx-&gt;ao_basis.uninitialized == 0) {
ctx-&gt;ao_basis.provided = 1;
}
ctx-&gt;ao_basis.provided = (ctx-&gt;ao_basis.uninitialized == 0);
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
}
@ -1169,10 +1145,7 @@ called. When
ctx-&gt;ao_basis.shell_factor = new_array;
ctx-&gt;ao_basis.uninitialized &amp;= ~mask;
<span style="color: #a020f0;">if</span> (ctx-&gt;ao_basis.uninitialized == 0) {
ctx-&gt;ao_basis.provided = 1;
}
ctx-&gt;ao_basis.provided = (ctx-&gt;ao_basis.uninitialized == 0);
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
}
@ -1219,10 +1192,7 @@ called. When
ctx-&gt;ao_basis.exponent = new_array;
ctx-&gt;ao_basis.uninitialized &amp;= ~mask;
<span style="color: #a020f0;">if</span> (ctx-&gt;ao_basis.uninitialized == 0) {
ctx-&gt;ao_basis.provided = 1;
}
ctx-&gt;ao_basis.provided = (ctx-&gt;ao_basis.uninitialized == 0);
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
}
@ -1269,10 +1239,7 @@ called. When
ctx-&gt;ao_basis.coefficient = new_array;
ctx-&gt;ao_basis.uninitialized &amp;= ~mask;
<span style="color: #a020f0;">if</span> (ctx-&gt;ao_basis.uninitialized == 0) {
ctx-&gt;ao_basis.provided = 1;
}
ctx-&gt;ao_basis.provided = (ctx-&gt;ao_basis.uninitialized == 0);
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
}
@ -1283,10 +1250,10 @@ called. When
</div>
<div id="outline-container-org4da0693" class="outline-3">
<h3 id="org4da0693"><span class="section-number-3">1.4</span> Fortran interfaces</h3>
<div id="outline-container-org1e1d403" class="outline-3">
<h3 id="org1e1d403"><span class="section-number-3">1.4</span> Fortran interfaces</h3>
<div class="outline-text-3" id="text-1-4">
<table id="orgdc0c7e2" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="orgb9ca26f" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1345,8 +1312,8 @@ called. When
</div>
</div>
<div id="outline-container-org2b96616" class="outline-3">
<h3 id="org2b96616"><span class="section-number-3">1.5</span> Test</h3>
<div id="outline-container-orga27fbc0" class="outline-3">
<h3 id="orga27fbc0"><span class="section-number-3">1.5</span> Test</h3>
<div class="outline-text-3" id="text-1-5">
<div class="org-src-container">
<pre class="src src-c">/* <span style="color: #b22222;">Reference input data </span>*/
@ -1383,51 +1350,51 @@ called. When
<span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #a0522d;">rc</span>;
<span style="color: #0000ff;">munit_assert_int</span>(<span style="color: #228b22;">qmckl_ao_basis_provided</span>(<span style="color: #a0522d;">context</span>), ==, 0);
munit_assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_type (context, typ);
<span style="color: #0000ff;">munit_assert_int64</span>(rc, ==, QMCKL_SUCCESS);
<span style="color: #0000ff;">munit_assert_int</span>(<span style="color: #228b22;">qmckl_ao_basis_provided</span>(<span style="color: #a0522d;">context</span>), ==, 0);
munit_assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_shell_num (context, shell_num);
<span style="color: #0000ff;">munit_assert_int64</span>(rc, ==, QMCKL_SUCCESS);
<span style="color: #0000ff;">munit_assert_int</span>(<span style="color: #228b22;">qmckl_ao_basis_provided</span>(<span style="color: #a0522d;">context</span>), ==, 0);
munit_assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_prim_num (context, prim_num);
<span style="color: #0000ff;">munit_assert_int64</span>(rc, ==, QMCKL_SUCCESS);
<span style="color: #0000ff;">munit_assert_int</span>(<span style="color: #228b22;">qmckl_ao_basis_provided</span>(<span style="color: #a0522d;">context</span>), ==, 0);
munit_assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_shell_center (context, shell_center);
<span style="color: #0000ff;">munit_assert_int64</span>(rc, ==, QMCKL_SUCCESS);
<span style="color: #0000ff;">munit_assert_int</span>(<span style="color: #228b22;">qmckl_ao_basis_provided</span>(<span style="color: #a0522d;">context</span>), ==, 0);
munit_assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_shell_ang_mom (context, shell_ang_mom);
<span style="color: #0000ff;">munit_assert_int64</span>(rc, ==, QMCKL_SUCCESS);
<span style="color: #0000ff;">munit_assert_int</span>(<span style="color: #228b22;">qmckl_ao_basis_provided</span>(<span style="color: #a0522d;">context</span>), ==, 0);
munit_assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_shell_factor (context, shell_factor);
<span style="color: #0000ff;">munit_assert_int64</span>(rc, ==, QMCKL_SUCCESS);
<span style="color: #0000ff;">munit_assert_int</span>(<span style="color: #228b22;">qmckl_ao_basis_provided</span>(<span style="color: #a0522d;">context</span>), ==, 0);
munit_assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_shell_center (context, shell_prim_num);
<span style="color: #0000ff;">munit_assert_int64</span>(rc, ==, QMCKL_SUCCESS);
<span style="color: #0000ff;">munit_assert_int</span>(<span style="color: #228b22;">qmckl_ao_basis_provided</span>(<span style="color: #a0522d;">context</span>), ==, 0);
munit_assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_shell_prim_num (context, shell_prim_num);
<span style="color: #0000ff;">munit_assert_int64</span>(rc, ==, QMCKL_SUCCESS);
<span style="color: #0000ff;">munit_assert_int</span>(<span style="color: #228b22;">qmckl_ao_basis_provided</span>(<span style="color: #a0522d;">context</span>), ==, 0);
munit_assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_shell_prim_index (context, shell_prim_index);
<span style="color: #0000ff;">munit_assert_int64</span>(rc, ==, QMCKL_SUCCESS);
<span style="color: #0000ff;">munit_assert_int</span>(<span style="color: #228b22;">qmckl_ao_basis_provided</span>(<span style="color: #a0522d;">context</span>), ==, 0);
munit_assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_exponent (context, exponent);
<span style="color: #0000ff;">munit_assert_int64</span>(rc, ==, QMCKL_SUCCESS);
<span style="color: #0000ff;">munit_assert_int</span>(<span style="color: #228b22;">qmckl_ao_basis_provided</span>(<span style="color: #a0522d;">context</span>), ==, 0);
munit_assert(!qmckl_ao_basis_provided(context));
rc = qmckl_set_ao_basis_coefficient (context, coefficient);
<span style="color: #0000ff;">munit_assert_int64</span>(rc, ==, QMCKL_SUCCESS);
<span style="color: #0000ff;">munit_assert_int</span>(<span style="color: #228b22;">qmckl_ao_basis_provided</span>(<span style="color: #a0522d;">context</span>), ==, 1);
<span style="color: #0000ff;">munit_assert</span>(<span style="color: #228b22;">qmckl_ao_basis_provided</span>(<span style="color: #a0522d;">context</span>));
</pre>
</div>
@ -1435,12 +1402,12 @@ rc = qmckl_set_ao_basis_coefficient (context, coefficient);
</div>
</div>
<div id="outline-container-org0bced8c" class="outline-2">
<h2 id="org0bced8c"><span class="section-number-2">2</span> Polynomial part</h2>
<div id="outline-container-org2dd3152" class="outline-2">
<h2 id="org2dd3152"><span class="section-number-2">2</span> Polynomial part</h2>
<div class="outline-text-2" id="text-2">
</div>
<div id="outline-container-orgcba21c7" class="outline-3">
<h3 id="orgcba21c7"><span class="section-number-3">2.1</span> Powers of \(x-X_i\)</h3>
<div id="outline-container-org81ef740" class="outline-3">
<h3 id="org81ef740"><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>
@ -1452,7 +1419,7 @@ the \(n\) points:
\[ P_{ik} = X_i^k \]
</p>
<table id="orgfac4149" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org4bfb571" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1510,8 +1477,8 @@ the \(n\) points:
</table>
</div>
<div id="outline-container-org1bb8b0a" class="outline-4">
<h4 id="org1bb8b0a"><span class="section-number-4">2.1.1</span> Requirements:</h4>
<div id="outline-container-org13ea040" class="outline-4">
<h4 id="org13ea040"><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>
@ -1524,8 +1491,8 @@ the \(n\) points:
</div>
</div>
<div id="outline-container-org6494fd7" class="outline-4">
<h4 id="org6494fd7"><span class="section-number-4">2.1.2</span> C Header</h4>
<div id="outline-container-orga3db3e5" class="outline-4">
<h4 id="orga3db3e5"><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> (
@ -1540,8 +1507,8 @@ the \(n\) points:
</div>
</div>
<div id="outline-container-org329019a" class="outline-4">
<h4 id="org329019a"><span class="section-number-4">2.1.3</span> Source</h4>
<div id="outline-container-org2f6a735" class="outline-4">
<h4 id="org2f6a735"><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>
@ -1592,15 +1559,15 @@ the \(n\) points:
</div>
</div>
<div id="outline-container-orga94d462" class="outline-4">
<h4 id="orga94d462"><span class="section-number-4">2.1.4</span> C interface</h4>
<div id="outline-container-org0c99fed" class="outline-4">
<h4 id="org0c99fed"><span class="section-number-4">2.1.4</span> C interface</h4>
</div>
<div id="outline-container-org59cca8f" class="outline-4">
<h4 id="org59cca8f"><span class="section-number-4">2.1.5</span> Fortran interface</h4>
<div id="outline-container-orgddba532" class="outline-4">
<h4 id="orgddba532"><span class="section-number-4">2.1.5</span> Fortran interface</h4>
</div>
<div id="outline-container-orgb0888d8" class="outline-4">
<h4 id="orgb0888d8"><span class="section-number-4">2.1.6</span> Test</h4>
<div id="outline-container-orgf14d0f0" class="outline-4">
<h4 id="orgf14d0f0"><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)
@ -1651,8 +1618,8 @@ the \(n\) points:
</div>
</div>
<div id="outline-container-org7c2ef9a" class="outline-3">
<h3 id="org7c2ef9a"><span class="section-number-3">2.2</span> Value, Gradient and Laplacian of a polynomial</h3>
<div id="outline-container-org29ed836" class="outline-3">
<h3 id="org29ed836"><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\)
@ -1697,7 +1664,7 @@ Laplacians at a given point in space, of all polynomials with an
angular momentum up to <code>lmax</code>.
</p>
<table id="org9c19ab3" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org0b82b7f" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1776,8 +1743,8 @@ angular momentum up to <code>lmax</code>.
</table>
</div>
<div id="outline-container-orgd54ce22" class="outline-4">
<h4 id="orgd54ce22"><span class="section-number-4">2.2.1</span> Requirements:</h4>
<div id="outline-container-orgd683718" class="outline-4">
<h4 id="orgd683718"><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>
@ -1802,8 +1769,8 @@ For example, with a=0, b=2 and c=1 the string is "yyz"</li>
</div>
</div>
<div id="outline-container-orga26f3c4" class="outline-4">
<h4 id="orga26f3c4"><span class="section-number-4">2.2.2</span> C Header</h4>
<div id="outline-container-orga00f890" class="outline-4">
<h4 id="orga00f890"><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> (
@ -1821,8 +1788,8 @@ For example, with a=0, b=2 and c=1 the string is "yyz"</li>
</div>
</div>
<div id="outline-container-org22be8b7" class="outline-4">
<h4 id="org22be8b7"><span class="section-number-4">2.2.3</span> Source</h4>
<div id="outline-container-org3294b51" class="outline-4">
<h4 id="org3294b51"><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>
@ -1957,16 +1924,16 @@ For example, with a=0, b=2 and c=1 the string is "yyz"</li>
</div>
</div>
<div id="outline-container-org2785a0c" class="outline-4">
<h4 id="org2785a0c"><span class="section-number-4">2.2.4</span> C interface</h4>
<div id="outline-container-org9dcaf9c" class="outline-4">
<h4 id="org9dcaf9c"><span class="section-number-4">2.2.4</span> C interface</h4>
</div>
<div id="outline-container-org0e8bb66" class="outline-4">
<h4 id="org0e8bb66"><span class="section-number-4">2.2.5</span> Fortran interface</h4>
<div id="outline-container-org1e96c28" class="outline-4">
<h4 id="org1e96c28"><span class="section-number-4">2.2.5</span> Fortran interface</h4>
</div>
<div id="outline-container-org0505231" class="outline-4">
<h4 id="org0505231"><span class="section-number-4">2.2.6</span> Test</h4>
<div id="outline-container-orgc4a7ebb" class="outline-4">
<h4 id="orgc4a7ebb"><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)
@ -2071,12 +2038,12 @@ munit_assert_int(0, ==, test_qmckl_ao_polynomial_vgl(context));
</div>
</div>
<div id="outline-container-orgc487072" class="outline-2">
<h2 id="orgc487072"><span class="section-number-2">3</span> Radial part</h2>
<div id="outline-container-orgbd9787e" class="outline-2">
<h2 id="orgbd9787e"><span class="section-number-2">3</span> Radial part</h2>
<div class="outline-text-2" id="text-3">
</div>
<div id="outline-container-org6a2a1e5" class="outline-3">
<h3 id="org6a2a1e5"><span class="section-number-3">3.1</span> Gaussian basis functions</h3>
<div id="outline-container-org10af1a6" class="outline-3">
<h3 id="org10af1a6"><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
@ -2308,21 +2275,21 @@ Requirements :
</div>
</div>
<div id="outline-container-org2a6851f" class="outline-3">
<h3 id="org2a6851f"><span class="section-number-3">3.2</span> <span class="todo TODO">TODO</span> Slater basis functions</h3>
<div id="outline-container-orgd3757be" class="outline-3">
<h3 id="orgd3757be"><span class="section-number-3">3.2</span> <span class="todo TODO">TODO</span> Slater basis functions</h3>
</div>
<div id="outline-container-orgffe9622" class="outline-3">
<h3 id="orgffe9622"><span class="section-number-3">3.3</span> <span class="todo TODO">TODO</span> Radial functions on a grid</h3>
<div id="outline-container-org1949806" class="outline-3">
<h3 id="org1949806"><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-orge4de929" class="outline-2">
<h2 id="orge4de929"><span class="section-number-2">4</span> Combining radial and polynomial parts</h2>
<div id="outline-container-orgda9c56e" class="outline-2">
<h2 id="orgda9c56e"><span class="section-number-2">4</span> Combining radial and polynomial parts</h2>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX CoE</p>
<p class="date">Created: 2021-04-20 Tue 22:01</p>
<p class="date">Created: 2021-04-20 Tue 23:58</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-04-20 Tue 22:01 -->
<!-- 2021-04-20 Tue 23:58 -->
<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="#org322e8fc">1. Context handling</a>
<li><a href="#org9e8a41d">1. Context handling</a>
<ul>
<li><a href="#org294f8f8">1.1. Data structure</a></li>
<li><a href="#org17e1518">1.2. Creation</a></li>
<li><a href="#org2b8cb32">1.3. Locking</a></li>
<li><a href="#org7f12f56">1.4. <span class="todo TODO">TODO</span> Copy</a></li>
<li><a href="#org5b36e75">1.5. Destroy</a></li>
<li><a href="#org7335c59">1.1. Data structure</a></li>
<li><a href="#org4f826ba">1.2. Creation</a></li>
<li><a href="#org6dee257">1.3. Locking</a></li>
<li><a href="#org76914bc">1.4. <span class="todo TODO">TODO</span> Copy</a></li>
<li><a href="#org6332f28">1.5. Destroy</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-org322e8fc" class="outline-2">
<h2 id="org322e8fc"><span class="section-number-2">1</span> Context handling</h2>
<div id="outline-container-org9e8a41d" class="outline-2">
<h2 id="org9e8a41d"><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="orge926044"><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="org93f9d9c"><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,12 +356,18 @@ and <code>ctx</code> is a <code>qmckl_context_struct*</code> pointer.
</p>
</div>
<div id="outline-container-org294f8f8" class="outline-3">
<h3 id="org294f8f8"><span class="section-number-3">1.1</span> Data structure</h3>
<div id="outline-container-org7335c59" class="outline-3">
<h3 id="org7335c59"><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
to be recomputed. The date is incremented when the electron
coordinates are updated.
</p>
<p>
When a new element is added to the context, the functions
<a href="#org17e1518">qmckl<sub>context</sub><sub>create</sub></a>, <a href="#org5b36e75">qmckl<sub>context</sub><sub>destroy</sub></a> and <a href="#org7f12f56">qmckl<sub>context</sub><sub>copy</sub></a>
<a href="#org4f826ba">qmckl<sub>context</sub><sub>create</sub></a>, <a href="#org6332f28">qmckl<sub>context</sub><sub>destroy</sub></a> and <a href="#org76914bc">qmckl<sub>context</sub><sub>copy</sub></a>
should be updated inorder to make deep copies.
</p>
@ -410,8 +416,8 @@ if the context is valid, <code>QMCKL_NULL_CONTEXT</code> otherwise.
</div>
</div>
<div id="outline-container-org17e1518" class="outline-3">
<h3 id="org17e1518"><span class="section-number-3">1.2</span> Creation</h3>
<div id="outline-container-org4f826ba" class="outline-3">
<h3 id="org4f826ba"><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.
@ -462,6 +468,7 @@ To create a new context, <code>qmckl_context_create()</code> should be used.
ctx-&gt;numprec.range = QMCKL_DEFAULT_RANGE;
ctx-&gt;ao_basis.uninitialized = (1 &lt;&lt; 10) - 1;
ctx-&gt;electron.uninitialized = (1 &lt;&lt; 4) - 1;
/* <span style="color: #b22222;">Allocate qmckl_memory_struct </span>*/
{
@ -484,8 +491,8 @@ To create a new context, <code>qmckl_context_create()</code> should be used.
</div>
</div>
</div>
<div id="outline-container-org2b8cb32" class="outline-3">
<h3 id="org2b8cb32"><span class="section-number-3">1.3</span> Locking</h3>
<div id="outline-container-org6dee257" class="outline-3">
<h3 id="org6dee257"><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
@ -530,8 +537,8 @@ number of times the thread has locked it is saved in the
</div>
</div>
<div id="outline-container-org7f12f56" class="outline-3">
<h3 id="org7f12f56"><span class="section-number-3">1.4</span> <span class="todo TODO">TODO</span> Copy</h3>
<div id="outline-container-org76914bc" class="outline-3">
<h3 id="org76914bc"><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
@ -579,8 +586,8 @@ number of times the thread has locked it is saved in the
</div>
</div>
</div>
<div id="outline-container-org5b36e75" class="outline-3">
<h3 id="org5b36e75"><span class="section-number-3">1.5</span> Destroy</h3>
<div id="outline-container-org6332f28" class="outline-3">
<h3 id="org6332f28"><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.
@ -634,7 +641,7 @@ It frees the context, and returns the previous context.
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX CoE</p>
<p class="date">Created: 2021-04-20 Tue 22:01</p>
<p class="date">Created: 2021-04-20 Tue 23:58</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-04-20 Tue 22:01 -->
<!-- 2021-04-20 Tue 23:58 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Inter-particle distances</title>
@ -333,14 +333,14 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org6d00580">1. Squared distance</a>
<li><a href="#org62a68b4">1. Squared distance</a>
<ul>
<li><a href="#orgf62fddd">1.1. <code>qmckl_distance_sq</code></a>
<li><a href="#org30b8871">1.1. <code>qmckl_distance_sq</code></a>
<ul>
<li><a href="#org9acdf00">1.1.1. Requirements</a></li>
<li><a href="#orgd54da10">1.1.2. C header</a></li>
<li><a href="#org2fdb853">1.1.3. Source</a></li>
<li><a href="#orgea3b568">1.1.4. Performance</a></li>
<li><a href="#org34295a8">1.1.1. Requirements</a></li>
<li><a href="#org27aa0e5">1.1.2. C header</a></li>
<li><a href="#org6fad75c">1.1.3. Source</a></li>
<li><a href="#org64a84ab">1.1.4. Performance</a></li>
</ul>
</li>
</ul>
@ -349,12 +349,12 @@ for the JavaScript code in this tag.
</div>
</div>
<div id="outline-container-org6d00580" class="outline-2">
<h2 id="org6d00580"><span class="section-number-2">1</span> Squared distance</h2>
<div id="outline-container-org62a68b4" class="outline-2">
<h2 id="org62a68b4"><span class="section-number-2">1</span> Squared distance</h2>
<div class="outline-text-2" id="text-1">
</div>
<div id="outline-container-orgf62fddd" class="outline-3">
<h3 id="orgf62fddd"><span class="section-number-3">1.1</span> <code>qmckl_distance_sq</code></h3>
<div id="outline-container-org30b8871" class="outline-3">
<h3 id="org30b8871"><span class="section-number-3">1.1</span> <code>qmckl_distance_sq</code></h3>
<div class="outline-text-3" id="text-1-1">
<p>
<code>qmckl_distance_sq</code> computes the matrix of the squared distances
@ -367,7 +367,7 @@ between all pairs of points in two sets, one point within each set:
\]
</p>
<table id="org8266f3b" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org512ec46" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -460,8 +460,8 @@ between all pairs of points in two sets, one point within each set:
</table>
</div>
<div id="outline-container-org9acdf00" class="outline-4">
<h4 id="org9acdf00"><span class="section-number-4">1.1.1</span> Requirements</h4>
<div id="outline-container-org34295a8" class="outline-4">
<h4 id="org34295a8"><span class="section-number-4">1.1.1</span> Requirements</h4>
<div class="outline-text-4" id="text-1-1-1">
<ul class="org-ul">
<li><code>context</code> is not <code>QMCKL_NULL_CONTEXT</code></li>
@ -479,8 +479,8 @@ between all pairs of points in two sets, one point within each set:
</div>
</div>
<div id="outline-container-orgd54da10" class="outline-4">
<h4 id="orgd54da10"><span class="section-number-4">1.1.2</span> C header</h4>
<div id="outline-container-org27aa0e5" class="outline-4">
<h4 id="org27aa0e5"><span class="section-number-4">1.1.2</span> C header</h4>
<div class="outline-text-4" id="text-1-1-2">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_distance_sq</span> (
@ -500,8 +500,8 @@ between all pairs of points in two sets, one point within each set:
</div>
</div>
<div id="outline-container-org2fdb853" class="outline-4">
<h4 id="org2fdb853"><span class="section-number-4">1.1.3</span> Source</h4>
<div id="outline-container-org6fad75c" class="outline-4">
<h4 id="org6fad75c"><span class="section-number-4">1.1.3</span> Source</h4>
<div class="outline-text-4" id="text-1-1-3">
<div class="org-src-container">
<pre class="src src-f90"><span style="color: #228b22;">integer </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">qmckl_distance_sq_f</span><span style="color: #000000; background-color: #ffffff;">(context, transa, transb, m, n, A, LDA, B, LDB, C, LDC) result(info)</span>
@ -634,8 +634,8 @@ between all pairs of points in two sets, one point within each set:
</div>
</div>
<div id="outline-container-orgea3b568" class="outline-4">
<h4 id="orgea3b568"><span class="section-number-4">1.1.4</span> Performance</h4>
<div id="outline-container-org64a84ab" class="outline-4">
<h4 id="org64a84ab"><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
@ -648,7 +648,7 @@ transposed.
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX CoE</p>
<p class="date">Created: 2021-04-20 Tue 22:01</p>
<p class="date">Created: 2021-04-20 Tue 23:58</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

864
qmckl_electron.html Normal file
View File

@ -0,0 +1,864 @@
<?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-04-20 Tue 23:58 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Electrons</title>
<meta name="generator" content="Org mode" />
<meta name="author" content="TREX CoE" />
<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>
<link rel="stylesheet" title="Standard" href="qmckl.css" type="text/css" />
<script type="text/javascript" src="org-info.js">
/**
*
* @source: org-info.js
*
* @licstart The following is the entire license notice for the
* JavaScript code in org-info.js.
*
* 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 org-info.js.
*
*/
</script>
<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[/*><!--*/
org_html_manager.set("TOC_DEPTH", "4");
org_html_manager.set("LINK_HOME", "index.html");
org_html_manager.set("LINK_UP", "");
org_html_manager.set("LOCAL_TOC", "1");
org_html_manager.set("VIEW_BUTTONS", "0");
org_html_manager.set("MOUSE_HINT", "underline");
org_html_manager.set("FIXED_TOC", "0");
org_html_manager.set("TOC", "1");
org_html_manager.set("VIEW", "info");
org_html_manager.setup(); // activate after the parameters are set
/*]]>*///-->
</script>
<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>
</head>
<body>
<div id="org-div-home-and-up">
<a accesskey="h" href=""> UP </a>
|
<a accesskey="H" href="index.html"> HOME </a>
</div><div id="content">
<h1 class="title">Electrons</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org2455186">1. Context</a>
<ul>
<li><a href="#org1e9966c">1.1. Data structure</a></li>
<li><a href="#org56d1b48">1.2. Access functions</a></li>
<li><a href="#org9d8f7a7">1.3. Initialization functions</a></li>
<li><a href="#org6f9778d">1.4. Test</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-org2455186" class="outline-2">
<h2 id="org2455186"><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>date</code></td>
<td class="org-left">uint64<sub>t</sub></td>
<td class="org-left">Last modification date of the coordinates</td>
</tr>
<tr>
<td class="org-left"><code>uninitialized</code></td>
<td class="org-left">int32<sub>t</sub></td>
<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 electrons</td>
</tr>
<tr>
<td class="org-left"><code>up_num</code></td>
<td class="org-left">int64<sub>t</sub></td>
<td class="org-left">Number of up-spin electrons</td>
</tr>
<tr>
<td class="org-left"><code>down_num</code></td>
<td class="org-left">int64<sub>t</sub></td>
<td class="org-left">Number of down-spin electrons</td>
</tr>
<tr>
<td class="org-left"><code>walk_num</code></td>
<td class="org-left">int64<sub>t</sub></td>
<td class="org-left">Number of walkers</td>
</tr>
<tr>
<td class="org-left"><code>provided</code></td>
<td class="org-left">bool</td>
<td class="org-left">If true, <code>electron</code> is valid</td>
</tr>
<tr>
<td class="org-left"><code>coord_new</code></td>
<td class="org-left">double[walk<sub>num</sub>][3][num]</td>
<td class="org-left">New set of electron coordinates</td>
</tr>
<tr>
<td class="org-left"><code>coord_old</code></td>
<td class="org-left">double[walk<sub>num</sub>][3][num]</td>
<td class="org-left">Old set of electron coordinates</td>
</tr>
</tbody>
</table>
</div>
<div id="outline-container-org1e9966c" class="outline-3">
<h3 id="org1e9966c"><span class="section-number-3">1.1</span> Data structure</h3>
<div class="outline-text-3" id="text-1-1">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">qmckl_electron_struct</span> {
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">date</span>;
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">num</span>;
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">up_num</span>;
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">down_num</span>;
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">walk_num</span>;
<span style="color: #228b22;">double</span>* <span style="color: #a0522d;">coord_new</span>;
<span style="color: #228b22;">double</span>* <span style="color: #a0522d;">coord_old</span>;
<span style="color: #228b22;">int32_t</span> <span style="color: #a0522d;">uninitialized</span>;
<span style="color: #228b22;">bool</span> <span style="color: #a0522d;">provided</span>;
} <span style="color: #228b22;">qmckl_electron_struct</span>;
</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-org56d1b48" class="outline-3">
<h3 id="org56d1b48"><span class="section-number-3">1.2</span> Access functions</h3>
<div class="outline-text-3" id="text-1-2">
<p>
Access to scalars copies the values at the passed address, and
for array values a pointer to the array is returned.
</p>
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">int64_t</span> <span style="color: #0000ff;">qmckl_get_electron_num</span> (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>);
<span style="color: #228b22;">int64_t</span> <span style="color: #0000ff;">qmckl_get_electron_up_num</span> (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>);
<span style="color: #228b22;">int64_t</span> <span style="color: #0000ff;">qmckl_get_electron_down_num</span> (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>);
<span style="color: #228b22;">int64_t</span> <span style="color: #0000ff;">qmckl_get_electron_walk_num</span> (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>);
<span style="color: #228b22;">double</span>* <span style="color: #0000ff;">qmckl_get_electron_coord_new</span> (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>);
<span style="color: #228b22;">double</span>* <span style="color: #0000ff;">qmckl_get_electron_coord_old</span> (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>);
</pre>
</div>
<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>
</div>
<div class="org-src-container">
<pre class="src src-c" id="orga4faa6c"><span style="color: #a020f0;">if</span> ( (ctx-&gt;electron.uninitialized &amp; mask) != 0) {
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
}
</pre>
</div>
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">int64_t</span> <span style="color: #0000ff;">qmckl_get_electron_num</span> (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>) {
<span style="color: #a020f0;">if</span> (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
<span style="color: #a020f0;">return</span> (<span style="color: #228b22;">char</span>) 0;
}
<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">ctx</span> = (<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a020f0;">const</span>) context;
assert (ctx != <span style="color: #008b8b;">NULL</span>);
<span style="color: #228b22;">int32_t</span> <span style="color: #a0522d;">mask</span> = 1;
<span style="color: #a020f0;">if</span> ( (ctx-&gt;electron.uninitialized &amp; mask) != 0) {
<span style="color: #a020f0;">return</span> (<span style="color: #228b22;">int64_t</span>) 0;
}
assert (ctx-&gt;electron.num &gt; (<span style="color: #228b22;">int64_t</span>) 0);
<span style="color: #a020f0;">return</span> ctx-&gt;electron.num;
}
<span style="color: #228b22;">int64_t</span> <span style="color: #0000ff;">qmckl_get_electron_up_num</span> (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>) {
<span style="color: #a020f0;">if</span> (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
<span style="color: #a020f0;">return</span> (<span style="color: #228b22;">int64_t</span>) 0;
}
<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">ctx</span> = (<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a020f0;">const</span>) context;
assert (ctx != <span style="color: #008b8b;">NULL</span>);
<span style="color: #228b22;">int32_t</span> <span style="color: #a0522d;">mask</span> = 1 &lt;&lt; 1;
<span style="color: #a020f0;">if</span> ( (ctx-&gt;electron.uninitialized &amp; mask) != 0) {
<span style="color: #a020f0;">return</span> (<span style="color: #228b22;">int64_t</span>) 0;
}
assert (ctx-&gt;electron.up_num &gt; (<span style="color: #228b22;">int64_t</span>) 0);
<span style="color: #a020f0;">return</span> ctx-&gt;electron.up_num;
}
<span style="color: #228b22;">int64_t</span> <span style="color: #0000ff;">qmckl_get_electron_down_num</span> (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>) {
<span style="color: #a020f0;">if</span> (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
<span style="color: #a020f0;">return</span> (<span style="color: #228b22;">int64_t</span>) 0;
}
<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">ctx</span> = (<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a020f0;">const</span>) context;
assert (ctx != <span style="color: #008b8b;">NULL</span>);
<span style="color: #228b22;">int32_t</span> <span style="color: #a0522d;">mask</span> = 1 &lt;&lt; 2;
<span style="color: #a020f0;">if</span> ( (ctx-&gt;electron.uninitialized &amp; mask) != 0) {
<span style="color: #a020f0;">return</span> (<span style="color: #228b22;">int64_t</span>) 0;
}
assert (ctx-&gt;electron.down_num &gt;= (<span style="color: #228b22;">int64_t</span>) 0);
<span style="color: #a020f0;">return</span> ctx-&gt;electron.down_num;
}
<span style="color: #228b22;">int64_t</span> <span style="color: #0000ff;">qmckl_get_electron_walk_num</span> (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>) {
<span style="color: #a020f0;">if</span> (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
<span style="color: #a020f0;">return</span> (<span style="color: #228b22;">int64_t</span>) 0;
}
<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">ctx</span> = (<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a020f0;">const</span>) context;
assert (ctx != <span style="color: #008b8b;">NULL</span>);
<span style="color: #228b22;">int32_t</span> <span style="color: #a0522d;">mask</span> = 1 &lt;&lt; 3;
<span style="color: #a020f0;">if</span> ( (ctx-&gt;electron.uninitialized &amp; mask) != 0) {
<span style="color: #a020f0;">return</span> (<span style="color: #228b22;">int64_t</span>) 0;
}
assert (ctx-&gt;electron.walk_num &gt; (<span style="color: #228b22;">int64_t</span>) 0);
<span style="color: #a020f0;">return</span> ctx-&gt;electron.walk_num;
}
<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>) {
<span style="color: #a020f0;">if</span> (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">false</span>;
}
<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">ctx</span> = (<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a020f0;">const</span>) context;
assert (ctx != <span style="color: #008b8b;">NULL</span>);
<span style="color: #a020f0;">return</span> ctx-&gt;electron.provided;
}
</pre>
</div>
</div>
</div>
<div id="outline-container-org9d8f7a7" class="outline-3">
<h3 id="org9d8f7a7"><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.
</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_electron_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;">up_num</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">down_num</span>);
<span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_set_electron_walk_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;">walk_num</span>);
<span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_set_electron_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>
<div class="org-src-container">
<pre class="src src-c" id="org1e94143"><span style="color: #a020f0;">if</span> (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
<span style="color: #a020f0;">return</span> QMCKL_NULL_CONTEXT;
}
<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">ctx</span> = (<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a020f0;">const</span>) context;
</pre>
</div>
<div class="org-src-container">
<pre class="src src-c" id="org52b69a4">ctx-&gt;electron.uninitialized &amp;= ~mask;
ctx-&gt;electron.provided = (ctx-&gt;electron.uninitialized == 0);
<span style="color: #a020f0;">if</span> (ctx-&gt;electron.provided) {
<span style="color: #a020f0;">if</span> (ctx-&gt;electron.coord_new != <span style="color: #008b8b;">NULL</span>) {
qmckl_free(context, ctx-&gt;electron.coord_new);
ctx-&gt;electron.coord_new = <span style="color: #008b8b;">NULL</span>;
}
<span style="color: #a020f0;">if</span> (ctx-&gt;electron.coord_old != <span style="color: #008b8b;">NULL</span>) {
qmckl_free(context, ctx-&gt;electron.coord_old);
ctx-&gt;electron.coord_old = <span style="color: #008b8b;">NULL</span>;
}
<span style="color: #228b22;">qmckl_memory_info_struct</span> <span style="color: #a0522d;">mem_info</span> = qmckl_memory_info_struct_zero;
mem_info.size = ctx-&gt;electron.num * ctx-&gt;electron.walk_num * 3 * <span style="color: #a020f0;">sizeof</span>(<span style="color: #228b22;">double</span>);
<span style="color: #228b22;">double</span>* <span style="color: #a0522d;">coord_new</span> = (<span style="color: #228b22;">double</span>*) qmckl_malloc(context, mem_info);
<span style="color: #a020f0;">if</span> (coord_new == <span style="color: #008b8b;">NULL</span>) {
<span style="color: #a020f0;">return</span> qmckl_failwith( context,
QMCKL_ALLOCATION_FAILED,
<span style="color: #8b2252;">"qmckl_set_electron_num"</span>,
<span style="color: #008b8b;">NULL</span>);
}
ctx-&gt;electron.coord_new = coord_new;
<span style="color: #228b22;">double</span>* <span style="color: #a0522d;">coord_old</span> = (<span style="color: #228b22;">double</span>*) qmckl_malloc(context, mem_info);
<span style="color: #a020f0;">if</span> (coord_old == <span style="color: #008b8b;">NULL</span>) {
<span style="color: #a020f0;">return</span> qmckl_failwith( context,
QMCKL_ALLOCATION_FAILED,
<span style="color: #8b2252;">"qmckl_set_electron_num"</span>,
<span style="color: #008b8b;">NULL</span>);
}
ctx-&gt;electron.coord_old = coord_old;
}
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
</pre>
</div>
<p>
To set the number of electrons, we give the number of up-spin and
down-spin electrons to the context.
</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_electron_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;">up_num</span>,
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">down_num</span>) {
<span style="color: #a020f0;">if</span> (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
<span style="color: #a020f0;">return</span> QMCKL_NULL_CONTEXT;
}
<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">ctx</span> = (<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a020f0;">const</span>) context;
<span style="color: #a020f0;">if</span> (up_num &lt;= 0) {
<span style="color: #a020f0;">return</span> qmckl_failwith( context,
QMCKL_INVALID_ARG_2,
<span style="color: #8b2252;">"qmckl_set_electron_num"</span>,
<span style="color: #8b2252;">"up_num &lt;= 0"</span>);
}
<span style="color: #a020f0;">if</span> (down_num &lt;= 0) {
<span style="color: #a020f0;">return</span> qmckl_failwith( context,
QMCKL_INVALID_ARG_3,
<span style="color: #8b2252;">"qmckl_set_electron_num"</span>,
<span style="color: #8b2252;">"down_num &lt;= 0"</span>);
}
<span style="color: #228b22;">int32_t</span> <span style="color: #a0522d;">mask</span> = (1 &lt;&lt; 3) -1;
ctx-&gt;electron.up_num = up_num;
ctx-&gt;electron.down_num = down_num;
ctx-&gt;electron.num = up_num + down_num;
ctx-&gt;electron.uninitialized &amp;= ~mask;
ctx-&gt;electron.provided = (ctx-&gt;electron.uninitialized == 0);
<span style="color: #a020f0;">if</span> (ctx-&gt;electron.provided) {
<span style="color: #a020f0;">if</span> (ctx-&gt;electron.coord_new != <span style="color: #008b8b;">NULL</span>) {
qmckl_free(context, ctx-&gt;electron.coord_new);
ctx-&gt;electron.coord_new = <span style="color: #008b8b;">NULL</span>;
}
<span style="color: #a020f0;">if</span> (ctx-&gt;electron.coord_old != <span style="color: #008b8b;">NULL</span>) {
qmckl_free(context, ctx-&gt;electron.coord_old);
ctx-&gt;electron.coord_old = <span style="color: #008b8b;">NULL</span>;
}
<span style="color: #228b22;">qmckl_memory_info_struct</span> <span style="color: #a0522d;">mem_info</span> = qmckl_memory_info_struct_zero;
mem_info.size = ctx-&gt;electron.num * ctx-&gt;electron.walk_num * 3 * <span style="color: #a020f0;">sizeof</span>(<span style="color: #228b22;">double</span>);
<span style="color: #228b22;">double</span>* <span style="color: #a0522d;">coord_new</span> = (<span style="color: #228b22;">double</span>*) qmckl_malloc(context, mem_info);
<span style="color: #a020f0;">if</span> (coord_new == <span style="color: #008b8b;">NULL</span>) {
<span style="color: #a020f0;">return</span> qmckl_failwith( context,
QMCKL_ALLOCATION_FAILED,
<span style="color: #8b2252;">"qmckl_set_electron_num"</span>,
<span style="color: #008b8b;">NULL</span>);
}
ctx-&gt;electron.coord_new = coord_new;
<span style="color: #228b22;">double</span>* <span style="color: #a0522d;">coord_old</span> = (<span style="color: #228b22;">double</span>*) qmckl_malloc(context, mem_info);
<span style="color: #a020f0;">if</span> (coord_old == <span style="color: #008b8b;">NULL</span>) {
<span style="color: #a020f0;">return</span> qmckl_failwith( context,
QMCKL_ALLOCATION_FAILED,
<span style="color: #8b2252;">"qmckl_set_electron_num"</span>,
<span style="color: #008b8b;">NULL</span>);
}
ctx-&gt;electron.coord_old = coord_old;
}
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
}
</pre>
</div>
<p>
Then, we set the number of walkers:
</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_electron_walk_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;">walk_num</span>) {
<span style="color: #a020f0;">if</span> (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
<span style="color: #a020f0;">return</span> QMCKL_NULL_CONTEXT;
}
<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">ctx</span> = (<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a020f0;">const</span>) context;
<span style="color: #a020f0;">if</span> (walk_num &lt;= 0) {
<span style="color: #a020f0;">return</span> qmckl_failwith( context,
QMCKL_INVALID_ARG_2,
<span style="color: #8b2252;">"qmckl_set_electron_walk_num"</span>,
<span style="color: #8b2252;">"walk_num &lt;= 0"</span>);
}
<span style="color: #228b22;">int32_t</span> <span style="color: #a0522d;">mask</span> = 1 &lt;&lt; 3;
ctx-&gt;electron.walk_num = walk_num;
ctx-&gt;electron.uninitialized &amp;= ~mask;
ctx-&gt;electron.provided = (ctx-&gt;electron.uninitialized == 0);
<span style="color: #a020f0;">if</span> (ctx-&gt;electron.provided) {
<span style="color: #a020f0;">if</span> (ctx-&gt;electron.coord_new != <span style="color: #008b8b;">NULL</span>) {
qmckl_free(context, ctx-&gt;electron.coord_new);
ctx-&gt;electron.coord_new = <span style="color: #008b8b;">NULL</span>;
}
<span style="color: #a020f0;">if</span> (ctx-&gt;electron.coord_old != <span style="color: #008b8b;">NULL</span>) {
qmckl_free(context, ctx-&gt;electron.coord_old);
ctx-&gt;electron.coord_old = <span style="color: #008b8b;">NULL</span>;
}
<span style="color: #228b22;">qmckl_memory_info_struct</span> <span style="color: #a0522d;">mem_info</span> = qmckl_memory_info_struct_zero;
mem_info.size = ctx-&gt;electron.num * ctx-&gt;electron.walk_num * 3 * <span style="color: #a020f0;">sizeof</span>(<span style="color: #228b22;">double</span>);
<span style="color: #228b22;">double</span>* <span style="color: #a0522d;">coord_new</span> = (<span style="color: #228b22;">double</span>*) qmckl_malloc(context, mem_info);
<span style="color: #a020f0;">if</span> (coord_new == <span style="color: #008b8b;">NULL</span>) {
<span style="color: #a020f0;">return</span> qmckl_failwith( context,
QMCKL_ALLOCATION_FAILED,
<span style="color: #8b2252;">"qmckl_set_electron_num"</span>,
<span style="color: #008b8b;">NULL</span>);
}
ctx-&gt;electron.coord_new = coord_new;
<span style="color: #228b22;">double</span>* <span style="color: #a0522d;">coord_old</span> = (<span style="color: #228b22;">double</span>*) qmckl_malloc(context, mem_info);
<span style="color: #a020f0;">if</span> (coord_old == <span style="color: #008b8b;">NULL</span>) {
<span style="color: #a020f0;">return</span> qmckl_failwith( context,
QMCKL_ALLOCATION_FAILED,
<span style="color: #8b2252;">"qmckl_set_electron_num"</span>,
<span style="color: #008b8b;">NULL</span>);
}
ctx-&gt;electron.coord_old = coord_old;
}
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
}
</pre>
</div>
<p>
The following function sets the electron coordinates of all the
walkers. When this is done, the pointers to the old and new sets
of coordinates are swapped, and the new coordinates are
overwritten.
</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_electron_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>) {
<span style="color: #a020f0;">if</span> (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
<span style="color: #a020f0;">return</span> QMCKL_NULL_CONTEXT;
}
<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">ctx</span> = (<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a020f0;">const</span>) context;
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">num</span> = qmckl_get_electron_num(context);
<span style="color: #a020f0;">if</span> (num == 0L) {
<span style="color: #a020f0;">return</span> qmckl_failwith( context,
QMCKL_FAILURE,
<span style="color: #8b2252;">"qmckl_set_electron_coord"</span>,
<span style="color: #8b2252;">"num is not set"</span>);
}
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">walk_num</span> = qmckl_get_electron_walk_num(context);
<span style="color: #a020f0;">if</span> (walk_num == 0L) {
<span style="color: #a020f0;">return</span> qmckl_failwith( context,
QMCKL_FAILURE,
<span style="color: #8b2252;">"qmckl_set_electron_coord"</span>,
<span style="color: #8b2252;">"walk_num is not set"</span>);
}
/* <span style="color: #b22222;">If num and walk_num are set, the arrays should be allocated </span>*/
assert (ctx-&gt;electron.coord_old != <span style="color: #008b8b;">NULL</span>);
assert (ctx-&gt;electron.coord_new != <span style="color: #008b8b;">NULL</span>);
/* <span style="color: #b22222;">Increment the date of the context </span>*/
ctx-&gt;date += 1UL;
/* <span style="color: #b22222;">Swap pointers </span>*/
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">swap</span>;
swap = ctx-&gt;electron.coord_old;
ctx-&gt;electron.coord_old = ctx-&gt;electron.coord_new;
ctx-&gt;electron.coord_new = swap;
memcpy(ctx-&gt;electron.coord_new, coord, walk_num * num * 3 * <span style="color: #a020f0;">sizeof</span>(<span style="color: #228b22;">double</span>));
ctx-&gt;electron.date = ctx-&gt;date;
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
}
</pre>
</div>
</div>
</div>
<div id="outline-container-org6f9778d" class="outline-3">
<h3 id="org6f9778d"><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;">up_num</span> ((<span style="color: #228b22;">int64_t</span>) 3)
<span style="color: #483d8b;">#define</span> <span style="color: #a0522d;">down_num</span> ((<span style="color: #228b22;">int64_t</span>) 2)
<span style="color: #483d8b;">#define</span> <span style="color: #a0522d;">walk_num</span> ((<span style="color: #228b22;">int64_t</span>) 2)
<span style="color: #483d8b;">#define</span> <span style="color: #a0522d;">num</span> (up_num+down_num)
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">coord</span>[walk_num*3*num] =
{ 7.303633091022677881e+00, 1.375868694453235719e+01, 1.167371490471771217e-01,
4.547755371567960836e+00, 3.245907105524011182e+00, 2.410764357550297110e-01,
5.932816068137344523e+00, 1.491671465549257469e+01, 3.825374039119375236e-01,
7.347336142660052083e+00, 1.341946976062362129e+00, 1.648917914228352322e+00,
5.735221530102248444e+00, 1.064667491680036271e+01, 4.227201772236627297e-01,
8.099550978782254163e+00, 6.861498941099086757e+00, 4.015884841159429036e-02,
1.014757367558326173e+01, 5.219335322173662917e+00, 5.037004126899931322e-02,
1.484094322159507051e+01, 9.777903829455864226e+00, 5.243007994024882767e-02,
9.081723054990456845e+00, 5.499568496038920173e+00, 2.910446438899221347e-02,
2.583154239492383653e+00, 1.442282811294904432e+00, 6.387191629878670451e-02 };
/* <span style="color: #b22222;">--- </span>*/
<span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #a0522d;">rc</span>;
munit_assert(!qmckl_electron_provided(context));
rc = qmckl_set_electron_num (context, up_num, down_num);
<span style="color: #0000ff;">munit_assert_int64</span>(rc, ==, QMCKL_SUCCESS);
munit_assert(!qmckl_electron_provided(context));
rc = qmckl_set_electron_walk_num (context, walk_num);
<span style="color: #0000ff;">munit_assert_int64</span>(rc, ==, QMCKL_SUCCESS);
<span style="color: #0000ff;">munit_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;">munit_assert_int64</span>(rc, ==, QMCKL_SUCCESS);
</pre>
</div>
</div>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX CoE</p>
<p class="date">Created: 2021-04-20 Tue 23:58</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>
</html>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-04-20 Tue 22:01 -->
<!-- 2021-04-20 Tue 23:58 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Error handling</title>
@ -311,18 +311,18 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org6298949"></a></li>
<li><a href="#org7d7c090">1. Decoding errors</a></li>
<li><a href="#orged55d75">2. Data structure in context</a></li>
<li><a href="#org213eefa">3. Updating errors in the context</a></li>
<li><a href="#orgf2919cf">4. Failing</a></li>
<li><a href="#org23dd132"></a></li>
<li><a href="#org44aab7c">1. Decoding errors</a></li>
<li><a href="#orgba180ac">2. Data structure in context</a></li>
<li><a href="#org9a6b881">3. Updating errors in the context</a></li>
<li><a href="#orgcd0b520">4. Failing</a></li>
</ul>
</div>
</div>
<div id="outline-container-org6298949" class="outline-2">
<h2 id="org6298949"></h2>
<div class="outline-text-2" id="text-org6298949">
<div id="outline-container-org23dd132" class="outline-2">
<h2 id="org23dd132"></h2>
<div class="outline-text-2" id="text-org23dd132">
<p>
The library should never make the calling programs abort, nor
perform any input/output operations. This decision has to be taken
@ -333,7 +333,7 @@ by the developer of the code calling the library.
All the functions return with an exit code, defined as
</p>
<div class="org-src-container">
<pre class="src src-c" id="orgbc1078d"><span style="color: #a020f0;">typedef</span> <span style="color: #228b22;">int32_t</span> <span style="color: #228b22;">qmckl_exit_code</span>;
<pre class="src src-c" id="org0076dbf"><span style="color: #a020f0;">typedef</span> <span style="color: #228b22;">int32_t</span> <span style="color: #228b22;">qmckl_exit_code</span>;
</pre>
</div>
@ -350,7 +350,7 @@ error code is returned to the program.
Here is the complete list of exit codes.
</p>
<table id="orgc6473bc" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org41ed754" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -480,8 +480,8 @@ string is assumed to be large enough to contain the error message
</div>
</div>
<div id="outline-container-org7d7c090" class="outline-2">
<h2 id="org7d7c090"><span class="section-number-2">1</span> Decoding errors</h2>
<div id="outline-container-org44aab7c" class="outline-2">
<h2 id="org44aab7c"><span class="section-number-2">1</span> Decoding errors</h2>
<div class="outline-text-2" id="text-1">
<p>
To decode the error messages, <code>qmckl_string_of_error</code> converts an
@ -575,8 +575,8 @@ The text strings are extracted from the previous table.
</div>
</div>
<div id="outline-container-orged55d75" class="outline-2">
<h2 id="orged55d75"><span class="section-number-2">2</span> Data structure in context</h2>
<div id="outline-container-orgba180ac" class="outline-2">
<h2 id="orgba180ac"><span class="section-number-2">2</span> Data structure in context</h2>
<div class="outline-text-2" id="text-2">
<p>
The strings are declared with a maximum fixed size to avoid
@ -599,8 +599,8 @@ dynamic memory allocation.
</div>
</div>
<div id="outline-container-org213eefa" class="outline-2">
<h2 id="org213eefa"><span class="section-number-2">3</span> Updating errors in the context</h2>
<div id="outline-container-org9a6b881" class="outline-2">
<h2 id="org9a6b881"><span class="section-number-2">3</span> Updating errors in the context</h2>
<div class="outline-text-2" id="text-3">
<p>
The error is updated in the context using <code>qmckl_set_error</code>.
@ -646,8 +646,8 @@ explaining the error. The exit code can't be <code>QMCKL_SUCCESS</code>.
</div>
</div>
<div id="outline-container-orgf2919cf" class="outline-2">
<h2 id="orgf2919cf"><span class="section-number-2">4</span> Failing</h2>
<div id="outline-container-orgcd0b520" class="outline-2">
<h2 id="orgcd0b520"><span class="section-number-2">4</span> Failing</h2>
<div class="outline-text-2" id="text-4">
<p>
To make a function fail, the <code>qmckl_failwith</code> function should be
@ -710,7 +710,7 @@ For example, this function can be used as
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX CoE</p>
<p class="date">Created: 2021-04-20 Tue 22:01</p>
<p class="date">Created: 2021-04-20 Tue 23:58</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-04-20 Tue 22:01 -->
<!-- 2021-04-20 Tue 23:58 -->
<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="#orgbe3847d">1. Memory data structure for the context</a></li>
<li><a href="#org72f037a">2. Passing info to allocation routines</a></li>
<li><a href="#org7b74e31">3. Allocation/deallocation functions</a></li>
<li><a href="#org26c1d31">1. Memory data structure for the context</a></li>
<li><a href="#orgb057496">2. Passing info to allocation routines</a></li>
<li><a href="#orgbc14e37">3. Allocation/deallocation functions</a></li>
</ul>
</div>
</div>
<div id="outline-container-orgbe3847d" class="outline-2">
<h2 id="orgbe3847d"><span class="section-number-2">1</span> Memory data structure for the context</h2>
<div id="outline-container-org26c1d31" class="outline-2">
<h2 id="org26c1d31"><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-org72f037a" class="outline-2">
<h2 id="org72f037a"><span class="section-number-2">2</span> Passing info to allocation routines</h2>
<div id="outline-container-orgb057496" class="outline-2">
<h2 id="orgb057496"><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-org7b74e31" class="outline-2">
<h2 id="org7b74e31"><span class="section-number-2">3</span> Allocation/deallocation functions</h2>
<div id="outline-container-orgbc14e37" class="outline-2">
<h2 id="orgbc14e37"><span class="section-number-2">3</span> Allocation/deallocation functions</h2>
<div class="outline-text-2" id="text-3">
<p>
Memory allocation inside the library should be done with
@ -535,7 +535,7 @@ allocation and needs to be updated.
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX CoE</p>
<p class="date">Created: 2021-04-20 Tue 22:01</p>
<p class="date">Created: 2021-04-20 Tue 23:58</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-04-20 Tue 22:01 -->
<!-- 2021-04-20 Tue 23:58 -->
<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="#org648ec29">1. Control of the numerical precision</a></li>
<li><a href="#org278a6b5">2. Precision</a></li>
<li><a href="#orgade5a74">3. Range</a></li>
<li><a href="#orgb04ac39">4. Helper functions</a></li>
<li><a href="#orgf2b7ae8">1. Control of the numerical precision</a></li>
<li><a href="#org38430c1">2. Precision</a></li>
<li><a href="#org2df1b99">3. Range</a></li>
<li><a href="#org40f397b">4. Helper functions</a></li>
</ul>
</div>
</div>
<div id="outline-container-org648ec29" class="outline-2">
<h2 id="org648ec29"><span class="section-number-2">1</span> Control of the numerical precision</h2>
<div id="outline-container-orgf2b7ae8" class="outline-2">
<h2 id="orgf2b7ae8"><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="org92a550e" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org22dbc5d" 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-org278a6b5" class="outline-2">
<h2 id="org278a6b5"><span class="section-number-2">2</span> Precision</h2>
<div id="outline-container-org38430c1" class="outline-2">
<h2 id="org38430c1"><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-orgade5a74" class="outline-2">
<h2 id="orgade5a74"><span class="section-number-2">3</span> Range</h2>
<div id="outline-container-org2df1b99" class="outline-2">
<h2 id="org2df1b99"><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-orgb04ac39" class="outline-2">
<h2 id="orgb04ac39"><span class="section-number-2">4</span> Helper functions</h2>
<div id="outline-container-org40f397b" class="outline-2">
<h2 id="org40f397b"><span class="section-number-2">4</span> Helper functions</h2>
<div class="outline-text-2" id="text-4">
<p>
<code>qmckl_get_numprec_epsilon</code> returns \(\epsilon = 2^{1-n}\) where <code>n</code> is the precision.
@ -581,7 +581,7 @@ We need to remove the sign bit from the precision.
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX CoE</p>
<p class="date">Created: 2021-04-20 Tue 22:01</p>
<p class="date">Created: 2021-04-20 Tue 23:58</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2021-04-20 Tue 22:01 -->
<!-- 2021-04-20 Tue 23:58 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Testing</title>
@ -311,7 +311,7 @@ for the JavaScript code in this tag.
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX CoE</p>
<p class="date">Created: 2021-04-20 Tue 22:01</p>
<p class="date">Created: 2021-04-20 Tue 23:58</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>