1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-12-26 06:15:05 +01:00

Deploying to gh-pages from @ TREX-CoE/trexio@a880b0b354 🚀

This commit is contained in:
scemama 2021-09-13 16:10:40 +00:00
parent 269369cc1d
commit f6ffbdec76
8 changed files with 654 additions and 240 deletions

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2021-08-25 Wed 13:50 --> <!-- 2021-09-13 Mon 16:10 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>TREXIO source code documentation</title> <title>TREXIO source code documentation</title>
@ -342,7 +342,7 @@ and bug reports should be submitted at
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p> <p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-08-25 Wed 13:50</p> <p class="date">Created: 2021-09-13 Mon 16:10</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2021-08-25 Wed 13:50 --> <!-- 2021-09-13 Mon 16:10 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>&lrm;</title> <title>&lrm;</title>
@ -232,8 +232,8 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<div id="text-table-of-contents"> <div id="text-table-of-contents">
<ul> <ul>
<li><a href="#org22c954b">1. Text back end</a></li> <li><a href="#orgdb85130">1. Text back end</a></li>
<li><a href="#org50ed0b1">2. HDF5 Back end</a></li> <li><a href="#orgd8c5353">2. HDF5 Back end</a></li>
</ul> </ul>
</div> </div>
</div> </div>
@ -241,8 +241,8 @@ for the JavaScript code in this tag.
See templator<sub>front.org</sub> See templator<sub>front.org</sub>
</p> </p>
<div id="outline-container-org22c954b" class="outline-2"> <div id="outline-container-orgdb85130" class="outline-2">
<h2 id="org22c954b"><span class="section-number-2">1</span> Text back end</h2> <h2 id="orgdb85130"><span class="section-number-2">1</span> Text back end</h2>
<div class="outline-text-2" id="text-1"> <div class="outline-text-2" id="text-1">
<p> <p>
As the size of the dataset should be extensible, the simplest As the size of the dataset should be extensible, the simplest
@ -256,8 +256,8 @@ The offset can be used with <code>fseek(69L*offset, SEEK_SET)</code>
</div> </div>
</div> </div>
<div id="outline-container-org50ed0b1" class="outline-2"> <div id="outline-container-orgd8c5353" class="outline-2">
<h2 id="org50ed0b1"><span class="section-number-2">2</span> HDF5 Back end</h2> <h2 id="orgd8c5353"><span class="section-number-2">2</span> HDF5 Back end</h2>
<div class="outline-text-2" id="text-2"> <div class="outline-text-2" id="text-2">
<p> <p>
We need to declare the number of rows of the dataset as We need to declare the number of rows of the dataset as
@ -278,7 +278,7 @@ If the offset+num &gt; nmax, we need to extend the dataset.
</div> </div>
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="date">Created: 2021-08-25 Wed 13:50</p> <p class="date">Created: 2021-09-13 Mon 16:10</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2021-08-25 Wed 13:50 --> <!-- 2021-09-13 Mon 16:10 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>TREXIO source code documentation</title> <title>TREXIO source code documentation</title>
@ -342,7 +342,7 @@ and bug reports should be submitted at
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p> <p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-08-25 Wed 13:50</p> <p class="date">Created: 2021-09-13 Mon 16:10</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2021-08-25 Wed 13:50 --> <!-- 2021-09-13 Mon 16:10 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Front end API</title> <title>Front end API</title>
@ -333,61 +333,61 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<div id="text-table-of-contents"> <div id="text-table-of-contents">
<ul> <ul>
<li><a href="#org6c8bcbf">1. Coding conventions</a> <li><a href="#org472bba2">1. Coding conventions</a>
<ul> <ul>
<li><a href="#org785f1d8">1.1. Memory allocation</a></li> <li><a href="#org9c1b455">1.1. Memory allocation</a></li>
</ul> </ul>
</li> </li>
<li><a href="#orgd75d19f">2. Front end</a> <li><a href="#orgf5febb7">2. Front end</a>
<ul> <ul>
<li><a href="#org3938afd">2.1. Error handling</a></li> <li><a href="#orge71acf1">2.1. Error handling</a></li>
<li><a href="#org4710917">2.2. Back ends</a></li> <li><a href="#org4e6ad54">2.2. Back ends</a></li>
<li><a href="#orgc01e705">2.3. Read/write behavior</a></li> <li><a href="#org86c1f75">2.3. Read/write behavior</a></li>
<li><a href="#orgb3d7acb">2.4. TREXIO file type</a></li> <li><a href="#orgfe1dbcb">2.4. TREXIO file type</a></li>
<li><a href="#org94abad9">2.5. Polymorphism of the file handle</a></li> <li><a href="#org03dd53a">2.5. Polymorphism of the file handle</a></li>
<li><a href="#org7ad7e46">2.6. File opening</a></li> <li><a href="#org15e8f54">2.6. File opening</a></li>
<li><a href="#org685ae39">2.7. File closing</a></li> <li><a href="#org00e3047">2.7. File closing</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org0218826">3. Templates for front end</a> <li><a href="#org006d327">3. Templates for front end</a>
<ul> <ul>
<li><a href="#org7ae4cf2">3.1. Description</a></li> <li><a href="#orgac02dfc">3.1. Description</a></li>
<li><a href="#org1330499">3.2. Templates for front end has/read/write a single dimensioning variable</a> <li><a href="#org29ae9af">3.2. Templates for front end has/read/write a single dimensioning variable</a>
<ul> <ul>
<li><a href="#org407b153">3.2.1. C templates for front end</a></li> <li><a href="#org80c321c">3.2.1. C templates for front end</a></li>
<li><a href="#orgcd9892c">3.2.2. Fortran templates for front end</a></li> <li><a href="#org4af88a4">3.2.2. Fortran templates for front end</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org6ecbef5">3.3. Templates for front end has/read/write a dataset of numerical data</a> <li><a href="#orgbec4d9f">3.3. Templates for front end has/read/write a dataset of numerical data</a>
<ul> <ul>
<li><a href="#orgdc4ab37">3.3.1. C templates for front end</a></li> <li><a href="#org7b45360">3.3.1. C templates for front end</a></li>
<li><a href="#org6ca3455">3.3.2. Fortran templates for front end</a></li> <li><a href="#orge5b4812">3.3.2. Fortran templates for front end</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org6180a77">3.4. Sparse data structures</a></li> <li><a href="#org6a2c381">3.4. Sparse data structures</a></li>
<li><a href="#org322ad79">3.5. Templates for front end has/read/write a dataset of strings</a> <li><a href="#org5dc0a24">3.5. Templates for front end has/read/write a dataset of strings</a>
<ul> <ul>
<li><a href="#org16dc553">3.5.1. Introduction</a></li> <li><a href="#orgdcf81fd">3.5.1. Introduction</a></li>
<li><a href="#org0ae2332">3.5.2. C templates for front end</a></li> <li><a href="#orgba88ba0">3.5.2. C templates for front end</a></li>
<li><a href="#org7f8fedb">3.5.3. Fortran templates for front end</a></li> <li><a href="#org29968a3">3.5.3. Fortran templates for front end</a></li>
</ul> </ul>
</li> </li>
<li><a href="#org47b57bd">3.6. Templates for front end has/read/write a single string attribute</a> <li><a href="#org04ee4da">3.6. Templates for front end has/read/write a single string attribute</a>
<ul> <ul>
<li><a href="#org082bf39">3.6.1. Introduction</a></li> <li><a href="#org9dc8261">3.6.1. Introduction</a></li>
<li><a href="#org1a55b87">3.6.2. C templates for front end</a></li> <li><a href="#orgbf153c2">3.6.2. C templates for front end</a></li>
<li><a href="#org97a2328">3.6.3. Fortran templates for front end</a></li> <li><a href="#orgc8d8f14">3.6.3. Fortran templates for front end</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</li> </li>
<li><a href="#org994753d">4. Fortran helper/wrapper functions</a></li> <li><a href="#org6ab40e4">4. Fortran helper/wrapper functions</a></li>
</ul> </ul>
</div> </div>
</div> </div>
<div id="outline-container-org6c8bcbf" class="outline-2"> <div id="outline-container-org472bba2" class="outline-2">
<h2 id="org6c8bcbf"><span class="section-number-2">1</span> Coding conventions</h2> <h2 id="org472bba2"><span class="section-number-2">1</span> Coding conventions</h2>
<div class="outline-text-2" id="text-1"> <div class="outline-text-2" id="text-1">
<ul class="org-ul"> <ul class="org-ul">
<li>integer types will be defined using types given in <code>stdint.h</code></li> <li>integer types will be defined using types given in <code>stdint.h</code></li>
@ -402,8 +402,8 @@ for the JavaScript code in this tag.
</ul> </ul>
</div> </div>
<div id="outline-container-org785f1d8" class="outline-3"> <div id="outline-container-org9c1b455" class="outline-3">
<h3 id="org785f1d8"><span class="section-number-3">1.1</span> Memory allocation</h3> <h3 id="org9c1b455"><span class="section-number-3">1.1</span> Memory allocation</h3>
<div class="outline-text-3" id="text-1-1"> <div class="outline-text-3" id="text-1-1">
<p> <p>
Memory allocation of structures can be facilitated by using the Memory allocation of structures can be facilitated by using the
@ -438,8 +438,8 @@ The maximum string size for the filenames is 4096 characters.
</div> </div>
</div> </div>
<div id="outline-container-orgd75d19f" class="outline-2"> <div id="outline-container-orgf5febb7" class="outline-2">
<h2 id="orgd75d19f"><span class="section-number-2">2</span> Front end</h2> <h2 id="orgf5febb7"><span class="section-number-2">2</span> Front end</h2>
<div class="outline-text-2" id="text-2"> <div class="outline-text-2" id="text-2">
<p> <p>
All calls to TREXIO are thread-safe. All calls to TREXIO are thread-safe.
@ -447,10 +447,10 @@ TREXIO front end is modular, which simplifies implementation of new back ends.
</p> </p>
</div> </div>
<div id="outline-container-org3938afd" class="outline-3"> <div id="outline-container-orge71acf1" class="outline-3">
<h3 id="org3938afd"><span class="section-number-3">2.1</span> Error handling</h3> <h3 id="orge71acf1"><span class="section-number-3">2.1</span> Error handling</h3>
<div class="outline-text-3" id="text-2-1"> <div class="outline-text-3" id="text-2-1">
<table id="orgb55b5bd" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="org5dc2b7b" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -750,8 +750,8 @@ The text strings are extracted from the previous table.
</div> </div>
</div> </div>
<div id="outline-container-org4710917" class="outline-3"> <div id="outline-container-org4e6ad54" class="outline-3">
<h3 id="org4710917"><span class="section-number-3">2.2</span> Back ends</h3> <h3 id="org4e6ad54"><span class="section-number-3">2.2</span> Back ends</h3>
<div class="outline-text-3" id="text-2-2"> <div class="outline-text-3" id="text-2-2">
<p> <p>
TREXIO has several back ends: TREXIO has several back ends:
@ -783,8 +783,8 @@ lines that correspond to the <code>TREXIO_JSON</code> back end (not implemented
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-orgc01e705" class="outline-3"> <div id="outline-container-org86c1f75" class="outline-3">
<h3 id="orgc01e705"><span class="section-number-3">2.3</span> Read/write behavior</h3> <h3 id="org86c1f75"><span class="section-number-3">2.3</span> Read/write behavior</h3>
<div class="outline-text-3" id="text-2-3"> <div class="outline-text-3" id="text-2-3">
<p> <p>
Every time a reading function is called, the data is read from the Every time a reading function is called, the data is read from the
@ -812,8 +812,8 @@ concurrent programs, the behavior is not specified.
</p> </p>
</div> </div>
</div> </div>
<div id="outline-container-orgb3d7acb" class="outline-3"> <div id="outline-container-orgfe1dbcb" class="outline-3">
<h3 id="orgb3d7acb"><span class="section-number-3">2.4</span> TREXIO file type</h3> <h3 id="orgfe1dbcb"><span class="section-number-3">2.4</span> TREXIO file type</h3>
<div class="outline-text-3" id="text-2-4"> <div class="outline-text-3" id="text-2-4">
<p> <p>
<code>trexio_s</code> is the the main type for TREXIO files, visible to the users <code>trexio_s</code> is the the main type for TREXIO files, visible to the users
@ -847,8 +847,8 @@ TREXIO files will have as a first argument the TREXIO file handle.
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-org94abad9" class="outline-3"> <div id="outline-container-org03dd53a" class="outline-3">
<h3 id="org94abad9"><span class="section-number-3">2.5</span> Polymorphism of the file handle</h3> <h3 id="org03dd53a"><span class="section-number-3">2.5</span> Polymorphism of the file handle</h3>
<div class="outline-text-3" id="text-2-5"> <div class="outline-text-3" id="text-2-5">
<p> <p>
Polymorphism of the <code>trexio_t</code> type is handled by ensuring that the Polymorphism of the <code>trexio_t</code> type is handled by ensuring that the
@ -867,8 +867,8 @@ corresponding types for all back ends can be safely casted to
</div> </div>
</div> </div>
<div id="outline-container-org7ad7e46" class="outline-3"> <div id="outline-container-org15e8f54" class="outline-3">
<h3 id="org7ad7e46"><span class="section-number-3">2.6</span> File opening</h3> <h3 id="org15e8f54"><span class="section-number-3">2.6</span> File opening</h3>
<div class="outline-text-3" id="text-2-6"> <div class="outline-text-3" id="text-2-6">
<p> <p>
<code>trexio_open</code> creates a new TREXIO file or opens existing one. <code>trexio_open</code> creates a new TREXIO file or opens existing one.
@ -1095,8 +1095,8 @@ know if we need to shift by 1 arrays of indices.
</div> </div>
</div> </div>
<div id="outline-container-org685ae39" class="outline-3"> <div id="outline-container-org00e3047" class="outline-3">
<h3 id="org685ae39"><span class="section-number-3">2.7</span> File closing</h3> <h3 id="org00e3047"><span class="section-number-3">2.7</span> File closing</h3>
<div class="outline-text-3" id="text-2-7"> <div class="outline-text-3" id="text-2-7">
<p> <p>
<code>trexio_close</code> closes an existing <code>trexio_t</code> file. <code>trexio_close</code> closes an existing <code>trexio_t</code> file.
@ -1192,12 +1192,12 @@ output:
</div> </div>
</div> </div>
<div id="outline-container-org0218826" class="outline-2"> <div id="outline-container-org006d327" class="outline-2">
<h2 id="org0218826"><span class="section-number-2">3</span> Templates for front end</h2> <h2 id="org006d327"><span class="section-number-2">3</span> Templates for front end</h2>
<div class="outline-text-2" id="text-3"> <div class="outline-text-2" id="text-3">
</div> </div>
<div id="outline-container-org7ae4cf2" class="outline-3"> <div id="outline-container-orgac02dfc" class="outline-3">
<h3 id="org7ae4cf2"><span class="section-number-3">3.1</span> Description</h3> <h3 id="orgac02dfc"><span class="section-number-3">3.1</span> Description</h3>
<div class="outline-text-3" id="text-3-1"> <div class="outline-text-3" id="text-3-1">
<p> <p>
Consider the following block of <code>trex.json</code>: Consider the following block of <code>trex.json</code>:
@ -1387,8 +1387,8 @@ or double precision for integer and floating point numbers.
</div> </div>
</div> </div>
<div id="outline-container-org1330499" class="outline-3"> <div id="outline-container-org29ae9af" class="outline-3">
<h3 id="org1330499"><span class="section-number-3">3.2</span> Templates for front end has/read/write a single dimensioning variable</h3> <h3 id="org29ae9af"><span class="section-number-3">3.2</span> Templates for front end has/read/write a single dimensioning variable</h3>
<div class="outline-text-3" id="text-3-2"> <div class="outline-text-3" id="text-3-2">
<p> <p>
This section concerns API calls related to dimensioning variables. This section concerns API calls related to dimensioning variables.
@ -1457,8 +1457,8 @@ This section concerns API calls related to dimensioning variables.
</table> </table>
</div> </div>
<div id="outline-container-org407b153" class="outline-4"> <div id="outline-container-org80c321c" class="outline-4">
<h4 id="org407b153"><span class="section-number-4">3.2.1</span> C templates for front end</h4> <h4 id="org80c321c"><span class="section-number-4">3.2.1</span> C templates for front end</h4>
<div class="outline-text-4" id="text-3-2-1"> <div class="outline-text-4" id="text-3-2-1">
<p> <p>
The <code>C</code> templates that correspond to each of the abovementioned The <code>C</code> templates that correspond to each of the abovementioned
@ -1647,8 +1647,8 @@ precision (see Table above).
</div> </div>
</div> </div>
<div id="outline-container-orgcd9892c" class="outline-4"> <div id="outline-container-org4af88a4" class="outline-4">
<h4 id="orgcd9892c"><span class="section-number-4">3.2.2</span> Fortran templates for front end</h4> <h4 id="org4af88a4"><span class="section-number-4">3.2.2</span> Fortran templates for front end</h4>
<div class="outline-text-4" id="text-3-2-2"> <div class="outline-text-4" id="text-3-2-2">
<p> <p>
The <code>Fortran</code> templates that provide an access to the <code>C</code> API calls from Fortran. The <code>Fortran</code> templates that provide an access to the <code>C</code> API calls from Fortran.
@ -1734,8 +1734,8 @@ These templates are based on the use of <code>iso_c_binding</code>. Pointers hav
</div> </div>
</div> </div>
<div id="outline-container-org6ecbef5" class="outline-3"> <div id="outline-container-orgbec4d9f" class="outline-3">
<h3 id="org6ecbef5"><span class="section-number-3">3.3</span> Templates for front end has/read/write a dataset of numerical data</h3> <h3 id="orgbec4d9f"><span class="section-number-3">3.3</span> Templates for front end has/read/write a dataset of numerical data</h3>
<div class="outline-text-3" id="text-3-3"> <div class="outline-text-3" id="text-3-3">
<p> <p>
This section concerns API calls related to datasets. This section concerns API calls related to datasets.
@ -1804,8 +1804,8 @@ This section concerns API calls related to datasets.
</table> </table>
</div> </div>
<div id="outline-container-orgdc4ab37" class="outline-4"> <div id="outline-container-org7b45360" class="outline-4">
<h4 id="orgdc4ab37"><span class="section-number-4">3.3.1</span> C templates for front end</h4> <h4 id="org7b45360"><span class="section-number-4">3.3.1</span> C templates for front end</h4>
<div class="outline-text-4" id="text-3-3-1"> <div class="outline-text-4" id="text-3-3-1">
<p> <p>
The C templates that correspond to each of the abovementioned functions can be found below. The C templates that correspond to each of the abovementioned functions can be found below.
@ -2124,8 +2124,8 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
</div> </div>
</div> </div>
<div id="outline-container-org6ca3455" class="outline-4"> <div id="outline-container-orge5b4812" class="outline-4">
<h4 id="org6ca3455"><span class="section-number-4">3.3.2</span> Fortran templates for front end</h4> <h4 id="orge5b4812"><span class="section-number-4">3.3.2</span> Fortran templates for front end</h4>
<div class="outline-text-4" id="text-3-3-2"> <div class="outline-text-4" id="text-3-3-2">
<p> <p>
The <code>Fortran</code> templates that provide an access to the <code>C</code> API calls from <code>Fortran</code>. The <code>Fortran</code> templates that provide an access to the <code>C</code> API calls from <code>Fortran</code>.
@ -2211,8 +2211,8 @@ These templates are based on the use of <code>iso_c_binding</code>. Pointers hav
</div> </div>
</div> </div>
<div id="outline-container-org6180a77" class="outline-3"> <div id="outline-container-org6a2c381" class="outline-3">
<h3 id="org6180a77"><span class="section-number-3">3.4</span> Sparse data structures</h3> <h3 id="org6a2c381"><span class="section-number-3">3.4</span> Sparse data structures</h3>
<div class="outline-text-3" id="text-3-4"> <div class="outline-text-3" id="text-3-4">
<p> <p>
Sparse data structures are used typically for large tensors such as Sparse data structures are used typically for large tensors such as
@ -2353,12 +2353,12 @@ For the values,
</div> </div>
</div> </div>
<div id="outline-container-org322ad79" class="outline-3"> <div id="outline-container-org5dc0a24" class="outline-3">
<h3 id="org322ad79"><span class="section-number-3">3.5</span> Templates for front end has/read/write a dataset of strings</h3> <h3 id="org5dc0a24"><span class="section-number-3">3.5</span> Templates for front end has/read/write a dataset of strings</h3>
<div class="outline-text-3" id="text-3-5"> <div class="outline-text-3" id="text-3-5">
</div> </div>
<div id="outline-container-org16dc553" class="outline-4"> <div id="outline-container-orgdcf81fd" class="outline-4">
<h4 id="org16dc553"><span class="section-number-4">3.5.1</span> Introduction</h4> <h4 id="orgdcf81fd"><span class="section-number-4">3.5.1</span> Introduction</h4>
<div class="outline-text-4" id="text-3-5-1"> <div class="outline-text-4" id="text-3-5-1">
<p> <p>
This section concerns API calls related to datasets of strings. This section concerns API calls related to datasets of strings.
@ -2398,8 +2398,8 @@ This section concerns API calls related to datasets of strings.
</div> </div>
</div> </div>
<div id="outline-container-org0ae2332" class="outline-4"> <div id="outline-container-orgba88ba0" class="outline-4">
<h4 id="org0ae2332"><span class="section-number-4">3.5.2</span> C templates for front end</h4> <h4 id="orgba88ba0"><span class="section-number-4">3.5.2</span> C templates for front end</h4>
<div class="outline-text-4" id="text-3-5-2"> <div class="outline-text-4" id="text-3-5-2">
<p> <p>
First parameter is the <code>TREXIO</code> file handle. Second parameter is the variable to be written/read First parameter is the <code>TREXIO</code> file handle. Second parameter is the variable to be written/read
@ -2642,8 +2642,8 @@ to/from the <code>TREXIO</code> file (except for <code>trexio_has_</code> functi
</div> </div>
</div> </div>
<div id="outline-container-org7f8fedb" class="outline-4"> <div id="outline-container-org29968a3" class="outline-4">
<h4 id="org7f8fedb"><span class="section-number-4">3.5.3</span> Fortran templates for front end</h4> <h4 id="org29968a3"><span class="section-number-4">3.5.3</span> Fortran templates for front end</h4>
<div class="outline-text-4" id="text-3-5-3"> <div class="outline-text-4" id="text-3-5-3">
<p> <p>
The <code>Fortran</code> templates that provide an access to the <code>C</code> API calls from <code>Fortran</code>. The <code>Fortran</code> templates that provide an access to the <code>C</code> API calls from <code>Fortran</code>.
@ -2740,12 +2740,12 @@ These templates are based on the use of <code>iso_c_binding</code>. Pointers hav
</div> </div>
</div> </div>
<div id="outline-container-org47b57bd" class="outline-3"> <div id="outline-container-org04ee4da" class="outline-3">
<h3 id="org47b57bd"><span class="section-number-3">3.6</span> Templates for front end has/read/write a single string attribute</h3> <h3 id="org04ee4da"><span class="section-number-3">3.6</span> Templates for front end has/read/write a single string attribute</h3>
<div class="outline-text-3" id="text-3-6"> <div class="outline-text-3" id="text-3-6">
</div> </div>
<div id="outline-container-org082bf39" class="outline-4"> <div id="outline-container-org9dc8261" class="outline-4">
<h4 id="org082bf39"><span class="section-number-4">3.6.1</span> Introduction</h4> <h4 id="org9dc8261"><span class="section-number-4">3.6.1</span> Introduction</h4>
<div class="outline-text-4" id="text-3-6-1"> <div class="outline-text-4" id="text-3-6-1">
<p> <p>
This section concerns API calls related to string attributes. This section concerns API calls related to string attributes.
@ -2785,8 +2785,8 @@ This section concerns API calls related to string attributes.
</div> </div>
</div> </div>
<div id="outline-container-org1a55b87" class="outline-4"> <div id="outline-container-orgbf153c2" class="outline-4">
<h4 id="org1a55b87"><span class="section-number-4">3.6.2</span> C templates for front end</h4> <h4 id="orgbf153c2"><span class="section-number-4">3.6.2</span> C templates for front end</h4>
<div class="outline-text-4" id="text-3-6-2"> <div class="outline-text-4" id="text-3-6-2">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -2886,8 +2886,8 @@ This section concerns API calls related to string attributes.
</div> </div>
</div> </div>
<div id="outline-container-org97a2328" class="outline-4"> <div id="outline-container-orgc8d8f14" class="outline-4">
<h4 id="org97a2328"><span class="section-number-4">3.6.3</span> Fortran templates for front end</h4> <h4 id="orgc8d8f14"><span class="section-number-4">3.6.3</span> Fortran templates for front end</h4>
<div class="outline-text-4" id="text-3-6-3"> <div class="outline-text-4" id="text-3-6-3">
<p> <p>
The <code>Fortran</code> templates that provide an access to the <code>C</code> API calls from Fortran. The <code>Fortran</code> templates that provide an access to the <code>C</code> API calls from Fortran.
@ -2966,8 +2966,8 @@ These templates are based on the use of <code>iso_c_binding</code>. Pointers hav
</div> </div>
</div> </div>
<div id="outline-container-org994753d" class="outline-2"> <div id="outline-container-org6ab40e4" class="outline-2">
<h2 id="org994753d"><span class="section-number-2">4</span> Fortran helper/wrapper functions</h2> <h2 id="org6ab40e4"><span class="section-number-2">4</span> Fortran helper/wrapper functions</h2>
<div class="outline-text-2" id="text-4"> <div class="outline-text-2" id="text-4">
<p> <p>
The function below adapts the original C-based <code>trexio_open</code> for Fortran. The function below adapts the original C-based <code>trexio_open</code> for Fortran.
@ -3101,7 +3101,7 @@ two code are identical, i.e. if the <code>assert</code> statement pass.
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p> <p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-08-25 Wed 13:50</p> <p class="date">Created: 2021-09-13 Mon 16:10</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2021-08-25 Wed 13:50 --> <!-- 2021-09-13 Mon 16:10 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>HDF5 back end</title> <title>HDF5 back end</title>
@ -311,27 +311,27 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<div id="text-table-of-contents"> <div id="text-table-of-contents">
<ul> <ul>
<li><a href="#org6436362">1. HDF5 back end</a> <li><a href="#org1b627ce">1. HDF5 back end</a>
<ul> <ul>
<li><a href="#orga064252">1.1. Template for HDF5 definitions</a></li> <li><a href="#org928c5c5">1.1. Template for HDF5 definitions</a></li>
<li><a href="#orge0955ff">1.2. Template for HDF5 structures</a></li> <li><a href="#org9d53230">1.2. Template for HDF5 structures</a></li>
<li><a href="#org6464620">1.3. Template for HDF5 init/deinit</a></li> <li><a href="#orgf738e74">1.3. Template for HDF5 init/deinit</a></li>
<li><a href="#org1fc87b6">1.4. Template for HDF5 has/read/write a single dimensioning variable</a></li> <li><a href="#orgdbb1d7f">1.4. Template for HDF5 has/read/write a single dimensioning variable</a></li>
<li><a href="#orge3de339">1.5. Template for HDF5 has/read/write a dataset of numerical data</a></li> <li><a href="#org8b7d923">1.5. Template for HDF5 has/read/write a dataset of numerical data</a></li>
<li><a href="#org5126a55">1.6. Template for HDF5 has/read/write a dataset of strings</a></li> <li><a href="#org528acf7">1.6. Template for HDF5 has/read/write a dataset of strings</a></li>
<li><a href="#org18cb9ff">1.7. Template for HDF5 has/read/write a single string attribute</a></li> <li><a href="#orga980398">1.7. Template for HDF5 has/read/write a single string attribute</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
<div id="outline-container-org6436362" class="outline-2"> <div id="outline-container-org1b627ce" class="outline-2">
<h2 id="org6436362"><span class="section-number-2">1</span> HDF5 back end</h2> <h2 id="org1b627ce"><span class="section-number-2">1</span> HDF5 back end</h2>
<div class="outline-text-2" id="text-1"> <div class="outline-text-2" id="text-1">
</div> </div>
<div id="outline-container-orga064252" class="outline-3"> <div id="outline-container-org928c5c5" class="outline-3">
<h3 id="orga064252"><span class="section-number-3">1.1</span> Template for HDF5 definitions</h3> <h3 id="org928c5c5"><span class="section-number-3">1.1</span> Template for HDF5 definitions</h3>
<div class="outline-text-3" id="text-1-1"> <div class="outline-text-3" id="text-1-1">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #483d8b;">#define</span> $GROUP$_GROUP_NAME <span style="color: #8b2252;">"$group$"</span> <pre class="src src-c"><span style="color: #483d8b;">#define</span> $GROUP$_GROUP_NAME <span style="color: #8b2252;">"$group$"</span>
@ -343,8 +343,8 @@ for the JavaScript code in this tag.
</div> </div>
</div> </div>
<div id="outline-container-orge0955ff" class="outline-3"> <div id="outline-container-org9d53230" class="outline-3">
<h3 id="orge0955ff"><span class="section-number-3">1.2</span> Template for HDF5 structures</h3> <h3 id="org9d53230"><span class="section-number-3">1.2</span> Template for HDF5 structures</h3>
<div class="outline-text-3" id="text-1-2"> <div class="outline-text-3" id="text-1-2">
<div class="org-src-container"> <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;">trexio_hdf5_s</span> { <pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">trexio_hdf5_s</span> {
@ -359,8 +359,8 @@ for the JavaScript code in this tag.
</div> </div>
<div id="outline-container-org6464620" class="outline-3"> <div id="outline-container-orgf738e74" class="outline-3">
<h3 id="org6464620"><span class="section-number-3">1.3</span> Template for HDF5 init/deinit</h3> <h3 id="orgf738e74"><span class="section-number-3">1.3</span> Template for HDF5 init/deinit</h3>
<div class="outline-text-3" id="text-1-3"> <div class="outline-text-3" id="text-1-3">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -440,8 +440,8 @@ for the JavaScript code in this tag.
</div> </div>
</div> </div>
<div id="outline-container-org1fc87b6" class="outline-3"> <div id="outline-container-orgdbb1d7f" class="outline-3">
<h3 id="org1fc87b6"><span class="section-number-3">1.4</span> Template for HDF5 has/read/write a single dimensioning variable</h3> <h3 id="orgdbb1d7f"><span class="section-number-3">1.4</span> Template for HDF5 has/read/write a single dimensioning variable</h3>
<div class="outline-text-3" id="text-1-4"> <div class="outline-text-3" id="text-1-4">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -557,8 +557,8 @@ for the JavaScript code in this tag.
</div> </div>
</div> </div>
<div id="outline-container-orge3de339" class="outline-3"> <div id="outline-container-org8b7d923" class="outline-3">
<h3 id="orge3de339"><span class="section-number-3">1.5</span> Template for HDF5 has/read/write a dataset of numerical data</h3> <h3 id="org8b7d923"><span class="section-number-3">1.5</span> Template for HDF5 has/read/write a dataset of numerical data</h3>
<div class="outline-text-3" id="text-1-5"> <div class="outline-text-3" id="text-1-5">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -687,8 +687,8 @@ for the JavaScript code in this tag.
</div> </div>
</div> </div>
<div id="outline-container-org5126a55" class="outline-3"> <div id="outline-container-org528acf7" class="outline-3">
<h3 id="org5126a55"><span class="section-number-3">1.6</span> Template for HDF5 has/read/write a dataset of strings</h3> <h3 id="org528acf7"><span class="section-number-3">1.6</span> Template for HDF5 has/read/write a dataset of strings</h3>
<div class="outline-text-3" id="text-1-6"> <div class="outline-text-3" id="text-1-6">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -892,8 +892,8 @@ for the JavaScript code in this tag.
</div> </div>
</div> </div>
<div id="outline-container-org18cb9ff" class="outline-3"> <div id="outline-container-orga980398" class="outline-3">
<h3 id="org18cb9ff"><span class="section-number-3">1.7</span> Template for HDF5 has/read/write a single string attribute</h3> <h3 id="orga980398"><span class="section-number-3">1.7</span> Template for HDF5 has/read/write a single string attribute</h3>
<div class="outline-text-3" id="text-1-7"> <div class="outline-text-3" id="text-1-7">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -1020,7 +1020,7 @@ for the JavaScript code in this tag.
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p> <p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-08-25 Wed 13:50</p> <p class="date">Created: 2021-09-13 Mon 16:10</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2021-08-25 Wed 13:50 --> <!-- 2021-09-13 Mon 16:10 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>TEXT back end</title> <title>TEXT back end</title>
@ -311,26 +311,26 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<div id="text-table-of-contents"> <div id="text-table-of-contents">
<ul> <ul>
<li><a href="#org00605c9">1. TEXT back end</a> <li><a href="#org2feb97a">1. TEXT back end</a>
<ul> <ul>
<li><a href="#orgde578bf">1.1. Template for group-related structures in text back end</a></li> <li><a href="#org624505b">1.1. Template for group-related structures in text back end</a></li>
<li><a href="#org3faf77f">1.2. Template for general structure in text back end</a></li> <li><a href="#org13394c4">1.2. Template for general structure in text back end</a></li>
<li><a href="#orgf9a8604">1.3. Initialize function (constant part)</a></li> <li><a href="#org65107da">1.3. Initialize function (constant part)</a></li>
<li><a href="#org9738fc9">1.4. Deinitialize function (templated part)</a></li> <li><a href="#orgb332f70">1.4. Deinitialize function (templated part)</a></li>
<li><a href="#org65da8fa">1.5. Template for text read struct</a></li> <li><a href="#org6310ace">1.5. Template for text read struct</a></li>
<li><a href="#org65ce2fa">1.6. Template for text flush struct</a></li> <li><a href="#org8adcbb6">1.6. Template for text flush struct</a></li>
<li><a href="#org590b317">1.7. Template for text free memory</a></li> <li><a href="#orgba9ef41">1.7. Template for text free memory</a></li>
<li><a href="#orgf671f9f">1.8. Template for has/read/write the num attribute</a></li> <li><a href="#org973a8d2">1.8. Template for has/read/write the num attribute</a></li>
<li><a href="#orge799a1c">1.9. Template for has/read/write the dataset of numerical data</a></li> <li><a href="#orgca4da6e">1.9. Template for has/read/write the dataset of numerical data</a></li>
<li><a href="#org2d94a65">1.10. Template for has/read/write the dataset of strings</a></li> <li><a href="#orga2eaf62">1.10. Template for has/read/write the dataset of strings</a></li>
<li><a href="#org51f2b00">1.11. Template for has/read/write the string attribute</a></li> <li><a href="#org1d571e2">1.11. Template for has/read/write the string attribute</a></li>
<li><a href="#orgb33addd">1.12. RDM struct (hard-coded)</a> <li><a href="#orgf2ce2ee">1.12. RDM struct (hard-coded)</a>
<ul> <ul>
<li><a href="#org7749c59">1.12.1. Read the complete struct</a></li> <li><a href="#org1dfae6a">1.12.1. Read the complete struct</a></li>
<li><a href="#org2383f3c">1.12.2. Flush the complete struct</a></li> <li><a href="#org31063cf">1.12.2. Flush the complete struct</a></li>
<li><a href="#org8ad3b30">1.12.3. Free memory</a></li> <li><a href="#org0f07460">1.12.3. Free memory</a></li>
<li><a href="#orga80c35c">1.12.4. Read/Write the one<sub>e</sub> attribute</a></li> <li><a href="#orgb119f46">1.12.4. Read/Write the one<sub>e</sub> attribute</a></li>
<li><a href="#org5e6a3e4">1.12.5. Read/Write the two<sub>e</sub> attribute</a></li> <li><a href="#org6970825">1.12.5. Read/Write the two<sub>e</sub> attribute</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -339,8 +339,8 @@ for the JavaScript code in this tag.
</div> </div>
</div> </div>
<div id="outline-container-org00605c9" class="outline-2"> <div id="outline-container-org2feb97a" class="outline-2">
<h2 id="org00605c9"><span class="section-number-2">1</span> TEXT back end</h2> <h2 id="org2feb97a"><span class="section-number-2">1</span> TEXT back end</h2>
<div class="outline-text-2" id="text-1"> <div class="outline-text-2" id="text-1">
<p> <p>
The "file" produced by the text back end is a directory with one The "file" produced by the text back end is a directory with one
@ -361,8 +361,8 @@ The file is written when closed, or when the flush function is called.
</p> </p>
</div> </div>
<div id="outline-container-orgde578bf" class="outline-3"> <div id="outline-container-org624505b" class="outline-3">
<h3 id="orgde578bf"><span class="section-number-3">1.1</span> Template for group-related structures in text back end</h3> <h3 id="org624505b"><span class="section-number-3">1.1</span> Template for group-related structures in text back end</h3>
<div class="outline-text-3" id="text-1-1"> <div class="outline-text-3" id="text-1-1">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> $group$_s { <pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> $group$_s {
@ -380,8 +380,8 @@ The file is written when closed, or when the flush function is called.
</div> </div>
</div> </div>
<div id="outline-container-org3faf77f" class="outline-3"> <div id="outline-container-org13394c4" class="outline-3">
<h3 id="org3faf77f"><span class="section-number-3">1.2</span> Template for general structure in text back end</h3> <h3 id="org13394c4"><span class="section-number-3">1.2</span> Template for general structure in text back end</h3>
<div class="outline-text-3" id="text-1-2"> <div class="outline-text-3" id="text-1-2">
<div class="org-src-container"> <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;">rdm_s</span> { <pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">rdm_s</span> {
@ -407,8 +407,8 @@ The file is written when closed, or when the flush function is called.
</div> </div>
</div> </div>
<div id="outline-container-orgf9a8604" class="outline-3"> <div id="outline-container-org65107da" class="outline-3">
<h3 id="orgf9a8604"><span class="section-number-3">1.3</span> Initialize function (constant part)</h3> <h3 id="org65107da"><span class="section-number-3">1.3</span> Initialize function (constant part)</h3>
<div class="outline-text-3" id="text-1-3"> <div class="outline-text-3" id="text-1-3">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -509,8 +509,8 @@ The file is written when closed, or when the flush function is called.
</div> </div>
</div> </div>
<div id="outline-container-org9738fc9" class="outline-3"> <div id="outline-container-orgb332f70" class="outline-3">
<h3 id="org9738fc9"><span class="section-number-3">1.4</span> Deinitialize function (templated part)</h3> <h3 id="orgb332f70"><span class="section-number-3">1.4</span> Deinitialize function (templated part)</h3>
<div class="outline-text-3" id="text-1-4"> <div class="outline-text-3" id="text-1-4">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -535,8 +535,8 @@ The file is written when closed, or when the flush function is called.
</div> </div>
</div> </div>
<div id="outline-container-org65da8fa" class="outline-3"> <div id="outline-container-org6310ace" class="outline-3">
<h3 id="org65da8fa"><span class="section-number-3">1.5</span> Template for text read struct</h3> <h3 id="org6310ace"><span class="section-number-3">1.5</span> Template for text read struct</h3>
<div class="outline-text-3" id="text-1-5"> <div class="outline-text-3" id="text-1-5">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c">$group$_t* <pre class="src src-c">$group$_t*
@ -807,8 +807,8 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
</div> </div>
</div> </div>
<div id="outline-container-org65ce2fa" class="outline-3"> <div id="outline-container-org8adcbb6" class="outline-3">
<h3 id="org65ce2fa"><span class="section-number-3">1.6</span> Template for text flush struct</h3> <h3 id="org8adcbb6"><span class="section-number-3">1.6</span> Template for text flush struct</h3>
<div class="outline-text-3" id="text-1-6"> <div class="outline-text-3" id="text-1-6">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -872,8 +872,8 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
</div> </div>
</div> </div>
<div id="outline-container-org590b317" class="outline-3"> <div id="outline-container-orgba9ef41" class="outline-3">
<h3 id="org590b317"><span class="section-number-3">1.7</span> Template for text free memory</h3> <h3 id="orgba9ef41"><span class="section-number-3">1.7</span> Template for text free memory</h3>
<div class="outline-text-3" id="text-1-7"> <div class="outline-text-3" id="text-1-7">
<p> <p>
Memory is allocated when reading. The following function frees memory. Memory is allocated when reading. The following function frees memory.
@ -918,8 +918,8 @@ Memory is allocated when reading. The following function frees memory.
</div> </div>
</div> </div>
<div id="outline-container-orgf671f9f" class="outline-3"> <div id="outline-container-org973a8d2" class="outline-3">
<h3 id="orgf671f9f"><span class="section-number-3">1.8</span> Template for has/read/write the num attribute</h3> <h3 id="org973a8d2"><span class="section-number-3">1.8</span> Template for has/read/write the num attribute</h3>
<div class="outline-text-3" id="text-1-8"> <div class="outline-text-3" id="text-1-8">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -981,8 +981,8 @@ Memory is allocated when reading. The following function frees memory.
</div> </div>
</div> </div>
<div id="outline-container-orge799a1c" class="outline-3"> <div id="outline-container-orgca4da6e" class="outline-3">
<h3 id="orge799a1c"><span class="section-number-3">1.9</span> Template for has/read/write the dataset of numerical data</h3> <h3 id="orgca4da6e"><span class="section-number-3">1.9</span> Template for has/read/write the dataset of numerical data</h3>
<div class="outline-text-3" id="text-1-9"> <div class="outline-text-3" id="text-1-9">
<p> <p>
The <code>group_dset</code> array is assumed allocated with the appropriate size. The <code>group_dset</code> array is assumed allocated with the appropriate size.
@ -1078,8 +1078,8 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-org2d94a65" class="outline-3"> <div id="outline-container-orga2eaf62" class="outline-3">
<h3 id="org2d94a65"><span class="section-number-3">1.10</span> Template for has/read/write the dataset of strings</h3> <h3 id="orga2eaf62"><span class="section-number-3">1.10</span> Template for has/read/write the dataset of strings</h3>
<div class="outline-text-3" id="text-1-10"> <div class="outline-text-3" id="text-1-10">
<p> <p>
The <code>group_dset</code> array is assumed allocated with the appropriate size. The <code>group_dset</code> array is assumed allocated with the appropriate size.
@ -1181,8 +1181,8 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-org51f2b00" class="outline-3"> <div id="outline-container-org1d571e2" class="outline-3">
<h3 id="org51f2b00"><span class="section-number-3">1.11</span> Template for has/read/write the string attribute</h3> <h3 id="org1d571e2"><span class="section-number-3">1.11</span> Template for has/read/write the string attribute</h3>
<div class="outline-text-3" id="text-1-11"> <div class="outline-text-3" id="text-1-11">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -1256,12 +1256,12 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div> </div>
</div> </div>
</div> </div>
<div id="outline-container-orgb33addd" class="outline-3"> <div id="outline-container-orgf2ce2ee" class="outline-3">
<h3 id="orgb33addd"><span class="section-number-3">1.12</span> RDM struct (hard-coded)</h3> <h3 id="orgf2ce2ee"><span class="section-number-3">1.12</span> RDM struct (hard-coded)</h3>
<div class="outline-text-3" id="text-1-12"> <div class="outline-text-3" id="text-1-12">
</div> </div>
<div id="outline-container-org7749c59" class="outline-4"> <div id="outline-container-org1dfae6a" class="outline-4">
<h4 id="org7749c59"><span class="section-number-4">1.12.1</span> Read the complete struct</h4> <h4 id="org1dfae6a"><span class="section-number-4">1.12.1</span> Read the complete struct</h4>
<div class="outline-text-4" id="text-1-12-1"> <div class="outline-text-4" id="text-1-12-1">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">rdm_t</span>* <span style="color: #0000ff;">trexio_text_read_rdm</span>(<span style="color: #228b22;">trexio_text_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>); <pre class="src src-c"><span style="color: #228b22;">rdm_t</span>* <span style="color: #0000ff;">trexio_text_read_rdm</span>(<span style="color: #228b22;">trexio_text_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>);
@ -1356,8 +1356,8 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div> </div>
</div> </div>
<div id="outline-container-org2383f3c" class="outline-4"> <div id="outline-container-org31063cf" class="outline-4">
<h4 id="org2383f3c"><span class="section-number-4">1.12.2</span> Flush the complete struct</h4> <h4 id="org31063cf"><span class="section-number-4">1.12.2</span> Flush the complete struct</h4>
<div class="outline-text-4" id="text-1-12-2"> <div class="outline-text-4" id="text-1-12-2">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <span style="color: #0000ff;">trexio_text_flush_rdm</span>(<span style="color: #228b22;">trexio_text_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>); <pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span> <span style="color: #0000ff;">trexio_text_flush_rdm</span>(<span style="color: #228b22;">trexio_text_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>);
@ -1399,8 +1399,8 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div> </div>
</div> </div>
<div id="outline-container-org8ad3b30" class="outline-4"> <div id="outline-container-org0f07460" class="outline-4">
<h4 id="org8ad3b30"><span class="section-number-4">1.12.3</span> Free memory</h4> <h4 id="org0f07460"><span class="section-number-4">1.12.3</span> Free memory</h4>
<div class="outline-text-4" id="text-1-12-3"> <div class="outline-text-4" id="text-1-12-3">
<p> <p>
Memory is allocated when reading. The followig function frees memory. Memory is allocated when reading. The followig function frees memory.
@ -1436,8 +1436,8 @@ Memory is allocated when reading. The followig function frees memory.
</div> </div>
</div> </div>
<div id="outline-container-orga80c35c" class="outline-4"> <div id="outline-container-orgb119f46" class="outline-4">
<h4 id="orga80c35c"><span class="section-number-4">1.12.4</span> Read/Write the one<sub>e</sub> attribute</h4> <h4 id="orgb119f46"><span class="section-number-4">1.12.4</span> Read/Write the one<sub>e</sub> attribute</h4>
<div class="outline-text-4" id="text-1-12-4"> <div class="outline-text-4" id="text-1-12-4">
<p> <p>
The <code>one_e</code> array is assumed allocated with the appropriate size. The <code>one_e</code> array is assumed allocated with the appropriate size.
@ -1503,8 +1503,8 @@ The <code>one_e</code> array is assumed allocated with the appropriate size.
</div> </div>
</div> </div>
<div id="outline-container-org5e6a3e4" class="outline-4"> <div id="outline-container-org6970825" class="outline-4">
<h4 id="org5e6a3e4"><span class="section-number-4">1.12.5</span> Read/Write the two<sub>e</sub> attribute</h4> <h4 id="org6970825"><span class="section-number-4">1.12.5</span> Read/Write the two<sub>e</sub> attribute</h4>
<div class="outline-text-4" id="text-1-12-5"> <div class="outline-text-4" id="text-1-12-5">
<p> <p>
<code>two_e</code> is a sparse data structure, which can be too large to fit <code>two_e</code> is a sparse data structure, which can be too large to fit
@ -1612,7 +1612,7 @@ file for each sparse float structure.
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p> <p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-08-25 Wed 13:50</p> <p class="date">Created: 2021-09-13 Mon 16:10</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

118
trex.html
View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2021-08-25 Wed 13:50 --> <!-- 2021-09-13 Mon 16:10 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>TREX Configuration file</title> <title>TREX Configuration file</title>
@ -333,28 +333,28 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2> <h2>Table of Contents</h2>
<div id="text-table-of-contents"> <div id="text-table-of-contents">
<ul> <ul>
<li><a href="#org1622d86">1. Metadata (metadata group)</a></li> <li><a href="#orgf7ae80c">1. Metadata (metadata group)</a></li>
<li><a href="#org4298072">2. Electron (electron group)</a></li> <li><a href="#org7420507">2. Electron (electron group)</a></li>
<li><a href="#org6fb0b37">3. Nucleus (nucleus group)</a></li> <li><a href="#org9853b17">3. Nucleus (nucleus group)</a></li>
<li><a href="#org5bb7ca9">4. <span class="todo TODO">TODO</span> Effective core potentials (ecp group)</a></li> <li><a href="#org4419e2a">4. <span class="todo TODO">TODO</span> Effective core potentials (ecp group)</a></li>
<li><a href="#org1b63891">5. Basis set (basis group)</a></li> <li><a href="#org6041641">5. Basis set (basis group)</a></li>
<li><a href="#org611a71e">6. Atomic orbitals (ao group)</a> <li><a href="#orgf6efef7">6. Atomic orbitals (ao group)</a>
<ul> <ul>
<li><a href="#ao_one_e">6.1. One-electron integrals (<code>ao_1e_int</code> group)</a></li> <li><a href="#ao_one_e">6.1. One-electron integrals (<code>ao_1e_int</code> group)</a></li>
<li><a href="#ao_two_e">6.2. Two-electron integrals (<code>ao_2e_int</code> group)</a></li> <li><a href="#ao_two_e">6.2. Two-electron integrals (<code>ao_2e_int</code> group)</a></li>
</ul> </ul>
</li> </li>
<li><a href="#orgef2cd91">7. Molecular orbitals (mo group)</a> <li><a href="#org8d6a9a4">7. Molecular orbitals (mo group)</a>
<ul> <ul>
<li><a href="#org6ad697b">7.1. One-electron integrals (<code>mo_1e_int</code> group)</a></li> <li><a href="#orgb8eb476">7.1. One-electron integrals (<code>mo_1e_int</code> group)</a></li>
<li><a href="#org9d1a6d1">7.2. Two-electron integrals (<code>mo_2e_int</code> group)</a></li> <li><a href="#org81c7265">7.2. Two-electron integrals (<code>mo_2e_int</code> group)</a></li>
</ul> </ul>
</li> </li>
<li><a href="#orgabb52e2">8. <span class="todo TODO">TODO</span> Slater determinants</a></li> <li><a href="#org576b240">8. <span class="todo TODO">TODO</span> Slater determinants</a></li>
<li><a href="#orgf9cec2e">9. <span class="todo TODO">TODO</span> Reduced density matrices (rdm group)</a></li> <li><a href="#orge426a33">9. <span class="todo TODO">TODO</span> Reduced density matrices (rdm group)</a></li>
<li><a href="#orgd466ac0">10. Appendix</a> <li><a href="#org941cb95">10. Appendix</a>
<ul> <ul>
<li><a href="#org47f44a3">10.1. Python script from table to json</a></li> <li><a href="#orgec453ae">10.1. Python script from table to json</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
@ -386,8 +386,8 @@ arrays are 0-based. Hence, we introduce the <code>index</code> type which is an
1-based <code>int</code> in the Fortran interface and 0-based otherwise. 1-based <code>int</code> in the Fortran interface and 0-based otherwise.
</p> </p>
<div id="outline-container-org1622d86" class="outline-2"> <div id="outline-container-orgf7ae80c" class="outline-2">
<h2 id="org1622d86"><span class="section-number-2">1</span> Metadata (metadata group)</h2> <h2 id="orgf7ae80c"><span class="section-number-2">1</span> Metadata (metadata group)</h2>
<div class="outline-text-2" id="text-1"> <div class="outline-text-2" id="text-1">
<p> <p>
As we expect our files to be archived in open-data repositories, we As we expect our files to be archived in open-data repositories, we
@ -397,7 +397,7 @@ which have participated to the creation of the file, a list of
authors of the file, and a textual description. authors of the file, and a textual description.
</p> </p>
<table id="org6e2730f" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="org382141a" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -464,15 +464,15 @@ authors of the file, and a textual description.
</div> </div>
</div> </div>
<div id="outline-container-org4298072" class="outline-2"> <div id="outline-container-org7420507" class="outline-2">
<h2 id="org4298072"><span class="section-number-2">2</span> Electron (electron group)</h2> <h2 id="org7420507"><span class="section-number-2">2</span> Electron (electron group)</h2>
<div class="outline-text-2" id="text-2"> <div class="outline-text-2" id="text-2">
<p> <p>
We consider wave functions expressed in the spin-free formalism, where We consider wave functions expressed in the spin-free formalism, where
the number of &uarr; and &darr; electrons is fixed. the number of &uarr; and &darr; electrons is fixed.
</p> </p>
<table id="org9275e59" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="orgc588e8d" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -511,15 +511,15 @@ the number of &uarr; and &darr; electrons is fixed.
</div> </div>
</div> </div>
<div id="outline-container-org6fb0b37" class="outline-2"> <div id="outline-container-org9853b17" class="outline-2">
<h2 id="org6fb0b37"><span class="section-number-2">3</span> Nucleus (nucleus group)</h2> <h2 id="org9853b17"><span class="section-number-2">3</span> Nucleus (nucleus group)</h2>
<div class="outline-text-2" id="text-3"> <div class="outline-text-2" id="text-3">
<p> <p>
The nuclei are considered as fixed point charges. Coordinates are The nuclei are considered as fixed point charges. Coordinates are
given in Cartesian \((x,y,z)\) format. given in Cartesian \((x,y,z)\) format.
</p> </p>
<table id="orgd1070fb" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="orgb90eb91" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -579,8 +579,8 @@ given in Cartesian \((x,y,z)\) format.
</div> </div>
</div> </div>
<div id="outline-container-org5bb7ca9" class="outline-2"> <div id="outline-container-org4419e2a" class="outline-2">
<h2 id="org5bb7ca9"><span class="section-number-2">4</span> <span class="todo TODO">TODO</span> Effective core potentials (ecp group)</h2> <h2 id="org4419e2a"><span class="section-number-2">4</span> <span class="todo TODO">TODO</span> Effective core potentials (ecp group)</h2>
<div class="outline-text-2" id="text-4"> <div class="outline-text-2" id="text-4">
<p> <p>
An effective core potential (ECP) \(V_A^{\text{pp}}\) replacing the An effective core potential (ECP) \(V_A^{\text{pp}}\) replacing the
@ -625,7 +625,7 @@ letters are parameters.
<li>\(\hat{V}_\text{ecp,nl} = \sum_A \hat{V}_A^{\text{nl}}\) : non-local component</li> <li>\(\hat{V}_\text{ecp,nl} = \sum_A \hat{V}_A^{\text{nl}}\) : non-local component</li>
</ul> </ul>
<table id="orgfa7ca14" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="org8466b0e" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -734,8 +734,8 @@ letters are parameters.
</div> </div>
</div> </div>
<div id="outline-container-org1b63891" class="outline-2"> <div id="outline-container-org6041641" class="outline-2">
<h2 id="org1b63891"><span class="section-number-2">5</span> Basis set (basis group)</h2> <h2 id="org6041641"><span class="section-number-2">5</span> Basis set (basis group)</h2>
<div class="outline-text-2" id="text-5"> <div class="outline-text-2" id="text-5">
<p> <p>
We consider here basis functions centered on nuclei. Hence, we enable We consider here basis functions centered on nuclei. Hence, we enable
@ -788,7 +788,7 @@ If the the basis function is not considered normalized, \(\mathcal{N}_s=1\).
All the basis set parameters are stored in one-dimensional arrays: All the basis set parameters are stored in one-dimensional arrays:
</p> </p>
<table id="orge8b12de" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="org88a7750" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -957,8 +957,8 @@ prim_factor =
</div> </div>
</div> </div>
<div id="outline-container-org611a71e" class="outline-2"> <div id="outline-container-orgf6efef7" class="outline-2">
<h2 id="org611a71e"><span class="section-number-2">6</span> Atomic orbitals (ao group)</h2> <h2 id="orgf6efef7"><span class="section-number-2">6</span> Atomic orbitals (ao group)</h2>
<div class="outline-text-2" id="text-6"> <div class="outline-text-2" id="text-6">
<p> <p>
Going from the atomic basis set to AOs implies a systematic Going from the atomic basis set to AOs implies a systematic
@ -1006,13 +1006,13 @@ shell, as in the GAMESS convention where
<p> <p>
In such a case, one should set the normalization of the shell (in In such a case, one should set the normalization of the shell (in
the <a href="#org1b63891">Basis set</a> section) to \(\mathcal{N}_{z^2}\), which is the the <a href="#org6041641">Basis set</a> section) to \(\mathcal{N}_{z^2}\), which is the
normalization factor of the atomic orbitals in spherical coordinates. normalization factor of the atomic orbitals in spherical coordinates.
The normalization factor of the \(xy\) function which should be The normalization factor of the \(xy\) function which should be
introduced here should be \(\frac{\mathcal{N}_{xy}}{\mathcal{N}_{z^2}}\). introduced here should be \(\frac{\mathcal{N}_{xy}}{\mathcal{N}_{z^2}}\).
</p> </p>
<table id="org4062ebd" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="org69a9a19" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -1064,8 +1064,8 @@ introduced here should be \(\frac{\mathcal{N}_{xy}}{\mathcal{N}_{z^2}}\).
</table> </table>
</div> </div>
<div id="outline-container-org2cc7d65" class="outline-3"> <div id="outline-container-orgae985e2" class="outline-3">
<h3 id="ao_one_e"><a id="org2cc7d65"></a><span class="section-number-3">6.1</span> One-electron integrals (<code>ao_1e_int</code> group)</h3> <h3 id="ao_one_e"><a id="orgae985e2"></a><span class="section-number-3">6.1</span> One-electron integrals (<code>ao_1e_int</code> group)</h3>
<div class="outline-text-3" id="text-ao_one_e"> <div class="outline-text-3" id="text-ao_one_e">
<ul class="org-ul"> <ul class="org-ul">
<li>\[ \hat{V}_{\text{ne}} = \sum_{A=1}^{N_\text{nucl}} <li>\[ \hat{V}_{\text{ne}} = \sum_{A=1}^{N_\text{nucl}}
@ -1083,7 +1083,7 @@ The one-electron integrals for a one-electron operator \(\hat{O}\) are
over atomic orbitals. over atomic orbitals.
</p> </p>
<table id="orgf50ce5a" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="orgfe27e82" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -1150,8 +1150,8 @@ over atomic orbitals.
</div> </div>
</div> </div>
<div id="outline-container-orgb78a547" class="outline-3"> <div id="outline-container-orge86e5cc" class="outline-3">
<h3 id="ao_two_e"><a id="orgb78a547"></a><span class="section-number-3">6.2</span> Two-electron integrals (<code>ao_2e_int</code> group)</h3> <h3 id="ao_two_e"><a id="orge86e5cc"></a><span class="section-number-3">6.2</span> Two-electron integrals (<code>ao_2e_int</code> group)</h3>
<div class="outline-text-3" id="text-ao_two_e"> <div class="outline-text-3" id="text-ao_two_e">
<p> <p>
The two-electron integrals for a two-electron operator \(\hat{O}\) are The two-electron integrals for a two-electron operator \(\hat{O}\) are
@ -1172,7 +1172,7 @@ notation.
\mathbf{r}_j \vert)}{\vert \mathbf{r}_i - \mathbf{r}_j \vert} \] : electron-electron long range potential</li> \mathbf{r}_j \vert)}{\vert \mathbf{r}_i - \mathbf{r}_j \vert} \] : electron-electron long range potential</li>
</ul> </ul>
<table id="org8fa0781" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="orgb867bc1" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -1212,10 +1212,10 @@ notation.
</div> </div>
</div> </div>
<div id="outline-container-orgef2cd91" class="outline-2"> <div id="outline-container-org8d6a9a4" class="outline-2">
<h2 id="orgef2cd91"><span class="section-number-2">7</span> Molecular orbitals (mo group)</h2> <h2 id="org8d6a9a4"><span class="section-number-2">7</span> Molecular orbitals (mo group)</h2>
<div class="outline-text-2" id="text-7"> <div class="outline-text-2" id="text-7">
<table id="orgd597368" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="org9145b33" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -1281,8 +1281,8 @@ notation.
</table> </table>
</div> </div>
<div id="outline-container-org6ad697b" class="outline-3"> <div id="outline-container-orgb8eb476" class="outline-3">
<h3 id="org6ad697b"><span class="section-number-3">7.1</span> One-electron integrals (<code>mo_1e_int</code> group)</h3> <h3 id="orgb8eb476"><span class="section-number-3">7.1</span> One-electron integrals (<code>mo_1e_int</code> group)</h3>
<div class="outline-text-3" id="text-7-1"> <div class="outline-text-3" id="text-7-1">
<p> <p>
The operators as the same as those defined in the The operators as the same as those defined in the
@ -1290,7 +1290,7 @@ The operators as the same as those defined in the
the basis of molecular orbitals. the basis of molecular orbitals.
</p> </p>
<table id="orga356ac8" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="org77ab820" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -1357,8 +1357,8 @@ the basis of molecular orbitals.
</div> </div>
</div> </div>
<div id="outline-container-org9d1a6d1" class="outline-3"> <div id="outline-container-org81c7265" class="outline-3">
<h3 id="org9d1a6d1"><span class="section-number-3">7.2</span> Two-electron integrals (<code>mo_2e_int</code> group)</h3> <h3 id="org81c7265"><span class="section-number-3">7.2</span> Two-electron integrals (<code>mo_2e_int</code> group)</h3>
<div class="outline-text-3" id="text-7-2"> <div class="outline-text-3" id="text-7-2">
<p> <p>
The operators as the same as those defined in the The operators as the same as those defined in the
@ -1366,7 +1366,7 @@ The operators as the same as those defined in the
the basis of molecular orbitals. the basis of molecular orbitals.
</p> </p>
<table id="org49850fc" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="orgecc5150" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -1406,13 +1406,13 @@ the basis of molecular orbitals.
</div> </div>
</div> </div>
<div id="outline-container-orgabb52e2" class="outline-2"> <div id="outline-container-org576b240" class="outline-2">
<h2 id="orgabb52e2"><span class="section-number-2">8</span> <span class="todo TODO">TODO</span> Slater determinants</h2> <h2 id="org576b240"><span class="section-number-2">8</span> <span class="todo TODO">TODO</span> Slater determinants</h2>
</div> </div>
<div id="outline-container-orgf9cec2e" class="outline-2"> <div id="outline-container-orge426a33" class="outline-2">
<h2 id="orgf9cec2e"><span class="section-number-2">9</span> <span class="todo TODO">TODO</span> Reduced density matrices (rdm group)</h2> <h2 id="orge426a33"><span class="section-number-2">9</span> <span class="todo TODO">TODO</span> Reduced density matrices (rdm group)</h2>
<div class="outline-text-2" id="text-9"> <div class="outline-text-2" id="text-9">
<table id="org8db976a" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"> <table id="org8e657cf" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup> <colgroup>
@ -1465,15 +1465,15 @@ the basis of molecular orbitals.
</div> </div>
</div> </div>
<div id="outline-container-orgd466ac0" class="outline-2"> <div id="outline-container-org941cb95" class="outline-2">
<h2 id="orgd466ac0"><span class="section-number-2">10</span> Appendix</h2> <h2 id="org941cb95"><span class="section-number-2">10</span> Appendix</h2>
<div class="outline-text-2" id="text-10"> <div class="outline-text-2" id="text-10">
</div> </div>
<div id="outline-container-org47f44a3" class="outline-3"> <div id="outline-container-orgec453ae" class="outline-3">
<h3 id="org47f44a3"><span class="section-number-3">10.1</span> Python script from table to json</h3> <h3 id="orgec453ae"><span class="section-number-3">10.1</span> Python script from table to json</h3>
<div class="outline-text-3" id="text-10-1"> <div class="outline-text-3" id="text-10-1">
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-python" id="org0912cfe"><span style="color: #a020f0;">print</span>(<span style="color: #8b2252;">"""#+begin_src python :tangle trex.json"""</span>) <pre class="src src-python" id="orgaf30752"><span style="color: #a020f0;">print</span>(<span style="color: #8b2252;">"""#+begin_src python :tangle trex.json"""</span>)
<span style="color: #a020f0;">print</span>(<span style="color: #8b2252;">""" "%s": {"""</span>%(title)) <span style="color: #a020f0;">print</span>(<span style="color: #8b2252;">""" "%s": {"""</span>%(title))
<span style="color: #a0522d;">indent</span> = <span style="color: #8b2252;">" "</span> <span style="color: #a0522d;">indent</span> = <span style="color: #8b2252;">" "</span>
<span style="color: #a0522d;">f1</span> = 0 ; <span style="color: #a0522d;">f2</span> = 0 ; <span style="color: #a0522d;">f3</span> = 0 <span style="color: #a0522d;">f1</span> = 0 ; <span style="color: #a0522d;">f2</span> = 0 ; <span style="color: #a0522d;">f3</span> = 0
@ -1526,7 +1526,7 @@ the basis of molecular orbitals.
</div> </div>
<div id="postamble" class="status"> <div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p> <p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2021-08-25 Wed 13:50</p> <p class="date">Created: 2021-09-13 Mon 16:10</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p> <p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div> </div>
</body> </body>

414
tutorial_benzene.md Normal file
View File

@ -0,0 +1,414 @@
# TREXIO Tutorial
This interactive Tutorial covers some basic use cases of the TREXIO library based on the Python API. At this point, it is assumed that the TREXIO Python package has been sucessfully installed on the user machine or in the virtual environment. If this is not the case, feel free to follow the [installation guide](https://github.com/TREX-CoE/trexio/blob/master/python/README.md).
## Importing TREXIO
First of all, let's import the TREXIO package.
```python
try:
import trexio
except ImportError:
raise Exception("Unable to import trexio. Please check that trexio is properly instaled.")
```
If no error occurs, then it means that the TREXIO package has been sucessfully imported. Within the current import, TREXIO attributes can be accessed using the corresponding `trexio.attribute` notation. If you prefer to bound a shorter name to the imported module (as commonly done by the NumPy users with `import numpy as np`), this is also possible. To do so, replace `import trexio` with `import trexio as tr` for example. To learn more about importing modules, see the corresponding page of the [Python documentation](https://docs.python.org/3/tutorial/modules.html#more-on-modules).
## Creating a new TREXIO file
TREXIO currently supports two back ends for file I/O:
1. `TREXIO_HDF5`, which relies on extensive use of the [HDF5 library](https://portal.hdfgroup.org/display/HDF5/HDF5) and the associated binary file format. This back end is optimized for high performance but it requires HDF5 to be installed on the user machine.
2. `TREXIO_TEXT`, which relies on basic I/O operations that are available in the standard C library. This back end is not optimized for performance but it is supposed to work "out-of-the-box" since there are no external dependencies.
Armed with these new definitions, let's proceed with the tutorial. The first task is to create a TREXIO file called `benzene_demo.h5`. But first we have to remove the file if it exists in the current directory
```python
filename = 'benzene_demo.h5'
import os
try:
os.remove(filename)
except:
print(f"File {filename} does not exist.")
```
File benzene_demo.h5 does not exist.
We are now ready to create a new TREXIO file:
```python
demo_file = trexio.File(filename, mode='w', back_end=trexio.TREXIO_HDF5)
```
This creates an instance of the `trexio.File` class, which we refer to as `demo_file` in this tutorial. You can check that the corresponding file called `benzene_demo.h5` exists in the root directory. It is now open for writing as indicated by the user-supplied argument `mode='w'`. The file has been initiated using `TREXIO_HDF5` back end and will be accessed accordingly from now on. The information about back end is stored internally by TREXIO, which means that there is no need to specify it every time the I/O operation is performed. If the file named `benzene_demo.h5` already exists, then it is re-opened for writing (and not truncated to prevent data loss).
## Writing data in the TREXIO file
Prior to any work with TREXIO library, we highly recommend users to read about [TREXIO internal configuration](https://trex-coe.github.io/trexio/trex.html), which explains the structure of the wavefunction file. The reason is that TREXIO API has a naming convention, which is based on the groups and variables names that are pre-defined by the developers. In this Tutorial, we will only cover contents of the `nucleus` group. Note that custom groups and variables can be added to the TREXIO API.
In this Tutorial, we consider benzene molecule (C6H6) as an example. Since benzene has 12 atoms, let's specify it in the previously created `demo_file`. In order to do so, one has to call `trexio.write_nucleus_num` function, which accepts an instance of the `trexio.File` class as a first argument and an `int` value corresponding to the number of nuclei as a second argument.
```python
nucleus_num = 12
```
```python
trexio.write_nucleus_num(demo_file, nucleus_num)
```
In fact, all API functions that contain `write_` prefix can be used in a similar way.
Variables that contain `_num` suffix are important part of the TREXIO file because some of them define dimensions of arrays. For example, `nucleus_num` variable corresponds to the number of atoms, which will be internally used to write/read the `nucleus_coord` array of nuclear coordinates. In order for TREXIO files to be self-consistent, overwriting num-suffixed variables is currently disabled.
The number of atoms is not sufficient to define a molecule. Let's first create a list of nuclear charges, which correspond to benzene.
```python
charges = [6., 6., 6., 6., 6., 6., 1., 1., 1., 1., 1., 1.]
```
According to the TREX configuration file, there is a `charge` attribute of the `nucleus` group, which has `float` type and `[nucleus_num]` dimension. The `charges` list defined above fits nicely in the description and can be written as follows
```python
trexio.write_nucleus_charge(demo_file, charges)
```
**Note: TREXIO function names only contain parts in singular form.** This means that, both `write_nucleus_charges` and `write_nuclear_charges` are invalid API calls. These functions simply do not exist in the `trexio` Python package and the corresponding error message should appear.
Alternatively, one can provide a list of nuclear labels (chemical elements from the periodic table) that correspond to the aforementioned charges. There is a `label` attribute of the `nucleus` group, which has `str` type and `[nucleus_num]` dimension. Let's create a list of 12 strings, which correspond to 6 carbon and 6 hydrogen atoms:
```python
labels = [
'C',
'C',
'C',
'C',
'C',
'C',
'H',
'H',
'H',
'H',
'H',
'H']
```
This can now be written using the corresponding `trexio.write_nucleus_label` function:
```python
trexio.write_nucleus_label(demo_file, labels)
```
Two examples above demonstrate how to write arrays of numbers or strings in the file. TREXIO also supports I/O operations on single numerical or string attributes. In fact, in this Tutorial you have already written one numerical attribute: `nucleus_num`. Let's now write a string `'D6h'`, which indicates a point group of benzene molecule. According to the TREX configuration file, `point_group` is a `str` attribute of the `nucleus` group, thus it can be written in the `demo_file` as follows
```python
point_group = 'D6h'
```
```python
trexio.write_nucleus_point_group(demo_file, point_group)
```
### Writing NumPy arrays (float or int types)
The aforementioned examples cover the majority of the currently implemented functionality related to writing data in the file. It is worth mentioning that I/O of numerical arrays in TREXIO Python API relies on extensive use of the [NumPy package](https://numpy.org/). This will be discussed in more details in the [section about reading data](#Reading-data-from-the-TREXIO-file). However, TREXIO `write_` functions that work with numerical arrays also accept `numpy.ndarray` objects. For example, consider a `coords` list of nuclear coordinates that correspond to benzene molecule
```python
coords = [
[0.00000000 , 1.39250319 , 0.00000000 ],
[-1.20594314 , 0.69625160 , 0.00000000 ],
[-1.20594314 , -0.69625160 , 0.00000000 ],
[0.00000000 , -1.39250319 , 0.00000000 ],
[1.20594314 , -0.69625160 , 0.00000000 ],
[1.20594314 , 0.69625160 , 0.00000000 ],
[-2.14171677 , 1.23652075 , 0.00000000 ],
[-2.14171677 , -1.23652075 , 0.00000000 ],
[0.00000000 , -2.47304151 , 0.00000000 ],
[2.14171677 , -1.23652075 , 0.00000000 ],
[2.14171677 , 1.23652075 , 0.00000000 ],
[0.00000000 , 2.47304151 , 0.00000000 ],
]
```
Let's take advantage of using NumPy arrays with fixed precision for floating point numbers. But first, try to import the `numpy` package
```python
try:
import numpy as np
except ImportError:
raise Exception("Unable to import numpy. Please check that numpy is properly instaled.")
```
You can now convert the previously defined `coords` list into a numpy array with fixed `float64` type as follows
```python
coords_np = np.array(coords, dtype=np.float64)
```
TREXIO functions that write numerical arrays accept both lists and numpy arrays as a second argument. That is, both `trexio.write_nucleus_coord(demo_file, coords)` and `trexio.write_nucleus_coord(demo_file, coords_np)` are valid API calls. Let's use the latter and see if it works
```python
trexio.write_nucleus_coord(demo_file, coords_np)
```
Congratulations, you have just completed the `nucleus` section of the TREXIO file for benzene molecule! Note that TREXIO API is rather permissive and do not impose any strict ordering on the I/O operations. The only requirement is that dimensioning (`_num` suffixed) variables have to be written in the file **before** writing arrays that depend on these variables. For example, attempting to write `nucleus_charge` or `nucleus_coord` fails if `nucleus_num` has not been written.
### TREXIO error handling
TREXIO Python API provides the `trexio.Error` class which simplifies exception handling in the Python scripts. This class wraps up TREXIO return codes and propagates them all the way from the C back end to the Python front end. Let's try to write a negative number of basis set shells `basis_num` in the TREXIO file.
```python
try:
trexio.write_basis_num(demo_file, -256)
except trexio.Error as e:
print(f"TREXIO error message: {e.message}")
```
TREXIO error message: Invalid argument 2
The error message says **Invalid argument 2**, which indicates that the user-provided value `-256` is not valid.
As mentioned before, `_num`-suffixed variables cannot be overwritten in the file. But what happens if you accidentally attempt to do so? Let's have a look at the `write_nucleus_num` function as an example:
```python
try:
trexio.write_nucleus_num(demo_file, 24)
except trexio.Error as e:
print(f"TREXIO error message: {e.message}")
```
TREXIO error message: Attribute already exists
The API rightfully complains that the target attribute already exists and cannot be overwritten.
Alternatively, the aforementioned case can be handled using `trexio.has_nucleus_num` function as follows
```python
if not trexio.has_nucleus_num:
trexio.write_nucleus_num(demo_file, 24)
```
TREXIO functions with `has_` prefix return `True` if the corresponding variable exists and `False` otherwise.
What about writing arrays? Let's try to write an list of 48 nuclear indices instead of 12
```python
indices = [i for i in range(nucleus_num*4)]
```
```python
try:
trexio.write_basis_nucleus_index(demo_file, indices)
except trexio.Error as e:
print(f"TREXIO error message: {e.message}")
```
TREXIO error message: Access to memory beyond allocated
According to the TREX configuration file, `nucleus_index` attribute of a `basis` group is supposed to have `[nucleus_num]` elements. In the example above, we have tried to write 4 times more elements, which might lead to memory and/or file corruption. Luckily, TREXIO internally checks the array dimensions and returns an error in case of inconsistency.
## Closing the TREXIO file
It is good practice to close the TREXIO file at the end of the session. In fact, `trexio.File` class has a destructor, which normally takes care of that. However, if you intend to re-open the TREXIO file, it has to be closed explicitly before. This can be done using the `close` method, i.e.
```python
demo_file.close()
```
Good! You are now ready to inspect the contents of the `benzene_demo.h5` file using the reading functionality of TREXIO.
## Reading data from the TREXIO file
First, let's try to open an existing TREXIO file in read-only mode. This can be done by creating a new instance of the `trexio.File` class but this time with `mode='r'` argument. Back end has to be specified as well.
```python
demo_file_r = trexio.File(filename, mode='r', back_end=trexio.TREXIO_HDF5)
```
When reading data from the TREXIO file, the only required argument is a previously created instance of `trexio.File` class. In our case, it is `demo_file_r`. TREXIO functions with `read_` prefix return the desired variable as an output. For example, `nucleus_num` value can be read from the file as follows
```python
nucleus_num_r = trexio.read_nucleus_num(demo_file_r)
```
```python
print(f"nucleus_num from {filename} file ---> {nucleus_num_r}")
```
nucleus_num from benzene_demo.h5 file ---> 12
The function call assigns `nucleus_num_r` to 12, which is consistent with the number of atoms in benzene that we wrote in the previous section.
All calls to functions that read data can be done in a very similar way. The key point here is a function name, which in turn defines the output format. Hopefully by now you got used to the TREXIO naming convention and the contents of the `nucleus` group. Which function would you call to read a `point_group` attribute of the `nucleus` group? What type does it return? See the answer below:
```python
point_group_r = trexio.read_nucleus_point_group(demo_file_r)
```
```python
print(f"nucleus_point_group from {filename} TREXIO file ---> {point_group_r}\n")
print(f"Is return type of read_nucleus_point_group a string? ---> {isinstance(point_group_r, str)}")
```
nucleus_point_group from benzene_demo.h5 TREXIO file ---> D6h
Is return type of read_nucleus_point_group a string? ---> True
The `trexio.read_nucleus_point_group` function call returns a string `D6h`, which is exactly what we provided in the previous section. Now, let's read nuclear charges and labels.
```python
labels_r = trexio.read_nucleus_label(demo_file_r)
```
```python
print(f"nucleus_label from {filename} file \n---> {labels_r}")
```
nucleus_label from benzene_demo.h5 file
---> ['C', 'C', 'C', 'C', 'C', 'C', 'H', 'H', 'H', 'H', 'H', 'H']
```python
charges_r = trexio.read_nucleus_charge(demo_file_r)
```
```python
print(f"nucleus_charge from {filename} file \n---> {charges_r}")
```
nucleus_charge from benzene_demo.h5 file
---> [6. 6. 6. 6. 6. 6. 1. 1. 1. 1. 1. 1.]
The values are consistent with each other and with the previously written data. Not bad. What about the format of the output?
```python
print(f"nucleus_label return type: {type(labels_r)}")
```
nucleus_label return type: <class 'list'>
This makes sense, isn't it? We have written a `list` of nuclear labels and have received back a `list` of values from the file. What about nuclear charges?
```python
print(f"nucleus_charge return type: {type(charges_r)}")
```
nucleus_charge return type: <class 'numpy.ndarray'>
Looks like `trexio.read_nucleus_charge` function returns a `numpy.ndarray` even though we have provided a python-ic `list` to `trexio.write_nucleus_charge` in the previous section. Why is it so? As has been mentioned before, TREXIO Python API internally relies on the use of the NumPy package to communicate arrays of `float`-like or `int`-like values. This prevents some memory leaks and grants additional flexibility to the API. What kind of flexibility? Check this out:
```python
print(f"return dtype in NumPy notation: ---> {charges_r.dtype}")
```
return dtype in NumPy notation: ---> float64
It means that the default precision of the TREXIO output is double (`np.float64`) for arrays of floating point numbers like `nucleus_charge`. But what if you do not need this extra precision and would like to read nuclear charges in single (`np.float32`) or even reduced (e.g. `np.float16`) precision? TREXIO Python API provides an additional (optional) argument for this. This argument is called `dtype` and accepts one of the [NumPy data types](https://numpy.org/doc/stable/user/basics.types.html). For example,
```python
charges_np = trexio.read_nucleus_charge(demo_file_r, dtype=np.float32)
```
```python
print(f"return dtype in NumPy notation: ---> {charges_np.dtype}")
```
return dtype in NumPy notation: ---> float32
### Reading multidimensional arrays
So far, we have only read flat 1D arrays. However, we have also written a 2D array of nuclear coordinates. Let's now read it back from the file:
```python
coords_r = trexio.read_nucleus_coord(demo_file_r)
```
```python
print(f"nucleus_coord from {filename} TREXIO file: \n{coords_r}")
```
nucleus_coord from benzene_demo.h5 TREXIO file:
[[ 0. 1.39250319 0. ]
[-1.20594314 0.6962516 0. ]
[-1.20594314 -0.6962516 0. ]
[ 0. -1.39250319 0. ]
[ 1.20594314 -0.6962516 0. ]
[ 1.20594314 0.6962516 0. ]
[-2.14171677 1.23652075 0. ]
[-2.14171677 -1.23652075 0. ]
[ 0. -2.47304151 0. ]
[ 2.14171677 -1.23652075 0. ]
[ 2.14171677 1.23652075 0. ]
[ 0. 2.47304151 0. ]]
```python
print(f"return shape: ---> {coords_r.shape}")
```
return shape: ---> (12, 3)
We can see that TREXIO returns a 2D array with 12 rows and 3 columns, which is consistent with the `nucleus_coord` dimensions `[nucleus_num, 3]`. What this means is that **by default TREXIO reshapes the output flat array into a multidimensional one** whenever applicable. This is done based on the shape specified in the TREX configuration file.
In some cases, it might be a good idea to explicitly check that the data exists in the file before reading it. This can be achieved using `has_`-suffixed functions of the API. For example,
```python
if trexio.has_nucleus_coord(demo_file_r):
coords_safer = trexio.read_nucleus_coord(demo_file_r)
```
## Conclusion
In this Tutorial, you have created a TREXIO file using HDF5 back end and have written the number of atoms, point group, nuclear charges, labels and coordinates, which correspond to benzene molecule. You have also learned how to read this data back from the TREXIO file and how to handle some TREXIO errors.