1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-12-25 05:43:53 +01:00

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

This commit is contained in:
q-posev 2022-05-19 15:24:20 +00:00
parent 3f8c54b04b
commit ed6192f1b2
7 changed files with 557 additions and 620 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>
<!-- 2022-05-18 Wed 09:56 -->
<!-- 2022-05-19 Thu 15:24 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>TREXIO source code documentation</title>
@ -347,7 +347,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: 2022-05-18 Wed 09:56</p>
<p class="date">Created: 2022-05-19 Thu 15:24</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>
<!-- 2022-05-18 Wed 09:56 -->
<!-- 2022-05-19 Thu 15:24 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Examples</title>
@ -333,24 +333,24 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org37af446">1. Accessing sparse quantities</a>
<li><a href="#org28ef408">1. Accessing sparse quantities</a>
<ul>
<li><a href="#org6d50677">1.1. Fortran</a>
<li><a href="#org44dfb52">1.1. Fortran</a>
<ul>
<li><a href="#org6a86eda">1.1.1. Declare Temporary variables</a></li>
<li><a href="#orgdf0fd07">1.1.2. Obtain the name of the TREXIO file from the command line, and open it for reading</a></li>
<li><a href="#orga4a5c6f">1.1.3. Read the nuclear repulsion energy</a></li>
<li><a href="#org98a3bdc">1.1.4. Read the number of molecular orbitals</a></li>
<li><a href="#org073da58">1.1.5. Allocate memory</a></li>
<li><a href="#orgd7365b3">1.1.6. Read one-electron quantities</a></li>
<li><a href="#org82a2dcf">1.1.7. Read two-electron quantities</a>
<li><a href="#org6139681">1.1.1. Declare Temporary variables</a></li>
<li><a href="#orgf47e428">1.1.2. Obtain the name of the TREXIO file from the command line, and open it for reading</a></li>
<li><a href="#org6163eb2">1.1.3. Read the nuclear repulsion energy</a></li>
<li><a href="#org2459293">1.1.4. Read the number of molecular orbitals</a></li>
<li><a href="#org0af4f20">1.1.5. Allocate memory</a></li>
<li><a href="#orge47cfa1">1.1.6. Read one-electron quantities</a></li>
<li><a href="#orgcb31bcd">1.1.7. Read two-electron quantities</a>
<ul>
<li><a href="#org7567762">1.1.7.1. Electron repulsion integrals</a></li>
<li><a href="#org6431bf8">1.1.7.2. Reduced density matrix</a></li>
<li><a href="#org2d2f258">1.1.7.1. Electron repulsion integrals</a></li>
<li><a href="#org5dbe092">1.1.7.2. Reduced density matrix</a></li>
</ul>
</li>
<li><a href="#org86fde4e">1.1.8. Compute the energy</a></li>
<li><a href="#orgbdce9ba">1.1.9. Terminate</a></li>
<li><a href="#org69a8b23">1.1.8. Compute the energy</a></li>
<li><a href="#org6374510">1.1.9. Terminate</a></li>
</ul>
</li>
</ul>
@ -360,12 +360,12 @@ for the JavaScript code in this tag.
</div>
<div id="outline-container-org37af446" class="outline-2">
<h2 id="org37af446"><span class="section-number-2">1</span> Accessing sparse quantities</h2>
<div id="outline-container-org28ef408" class="outline-2">
<h2 id="org28ef408"><span class="section-number-2">1</span> Accessing sparse quantities</h2>
<div class="outline-text-2" id="text-1">
</div>
<div id="outline-container-org6d50677" class="outline-3">
<h3 id="org6d50677"><span class="section-number-3">1.1</span> Fortran</h3>
<div id="outline-container-org44dfb52" class="outline-3">
<h3 id="org44dfb52"><span class="section-number-3">1.1</span> Fortran</h3>
<div class="outline-text-3" id="text-1-1">
<div class="org-src-container">
<pre class="src src-f90"><span style="color: #a020f0;">program</span> <span style="color: #0000ff;">print_energy</span>
@ -411,8 +411,8 @@ One needs to read from the TREXIO file:
</div>
</div>
<div id="outline-container-org6a86eda" class="outline-4">
<h4 id="org6a86eda"><span class="section-number-4">1.1.1</span> Declare Temporary variables</h4>
<div id="outline-container-org6139681" class="outline-4">
<h4 id="org6139681"><span class="section-number-4">1.1.1</span> Declare Temporary variables</h4>
<div class="outline-text-4" id="text-1-1-1">
<div class="org-src-container">
<pre class="src src-f90"><span style="color: #228b22;">integer</span> ::<span style="color: #a0522d;"> i, j, k, l, m</span>
@ -427,8 +427,8 @@ One needs to read from the TREXIO file:
</div>
</div>
<div id="outline-container-orgdf0fd07" class="outline-4">
<h4 id="orgdf0fd07"><span class="section-number-4">1.1.2</span> Obtain the name of the TREXIO file from the command line, and open it for reading</h4>
<div id="outline-container-orgf47e428" class="outline-4">
<h4 id="orgf47e428"><span class="section-number-4">1.1.2</span> Obtain the name of the TREXIO file from the command line, and open it for reading</h4>
<div class="outline-text-4" id="text-1-1-2">
<div class="org-src-container">
<pre class="src src-f90"><span style="color: #a020f0;">call</span> <span style="color: #0000ff;">getarg</span>(1, filename)
@ -444,8 +444,8 @@ f = trexio_open (filename, <span style="color: #8b2252;">'r'</span>, TREXIO_HDF5
</div>
</div>
<div id="outline-container-orga4a5c6f" class="outline-4">
<h4 id="orga4a5c6f"><span class="section-number-4">1.1.3</span> Read the nuclear repulsion energy</h4>
<div id="outline-container-org6163eb2" class="outline-4">
<h4 id="org6163eb2"><span class="section-number-4">1.1.3</span> Read the nuclear repulsion energy</h4>
<div class="outline-text-4" id="text-1-1-3">
<div class="org-src-container">
<pre class="src src-f90">rc = trexio_read_nucleus_repulsion(f, E_nn)
@ -459,8 +459,8 @@ f = trexio_open (filename, <span style="color: #8b2252;">'r'</span>, TREXIO_HDF5
</div>
</div>
<div id="outline-container-org98a3bdc" class="outline-4">
<h4 id="org98a3bdc"><span class="section-number-4">1.1.4</span> Read the number of molecular orbitals</h4>
<div id="outline-container-org2459293" class="outline-4">
<h4 id="org2459293"><span class="section-number-4">1.1.4</span> Read the number of molecular orbitals</h4>
<div class="outline-text-4" id="text-1-1-4">
<div class="org-src-container">
<pre class="src src-f90">rc = trexio_read_mo_num(f, n)
@ -474,8 +474,8 @@ f = trexio_open (filename, <span style="color: #8b2252;">'r'</span>, TREXIO_HDF5
</div>
</div>
<div id="outline-container-org073da58" class="outline-4">
<h4 id="org073da58"><span class="section-number-4">1.1.5</span> Allocate memory</h4>
<div id="outline-container-org0af4f20" class="outline-4">
<h4 id="org0af4f20"><span class="section-number-4">1.1.5</span> Allocate memory</h4>
<div class="outline-text-4" id="text-1-1-5">
<div class="org-src-container">
<pre class="src src-f90"><span style="color: #a020f0;">allocate</span>( D(n,n), h0(n,n) )
@ -487,8 +487,8 @@ W(:,:,:,:) = 0.d0
</div>
</div>
<div id="outline-container-orgd7365b3" class="outline-4">
<h4 id="orgd7365b3"><span class="section-number-4">1.1.6</span> Read one-electron quantities</h4>
<div id="outline-container-orge47cfa1" class="outline-4">
<h4 id="orge47cfa1"><span class="section-number-4">1.1.6</span> Read one-electron quantities</h4>
<div class="outline-text-4" id="text-1-1-6">
<div class="org-src-container">
<pre class="src src-f90">rc = trexio_has_mo_1e_int_core_hamiltonian(f)
@ -520,8 +520,8 @@ rc = trexio_read_rdm_1e(f, D)
</div>
</div>
<div id="outline-container-org82a2dcf" class="outline-4">
<h4 id="org82a2dcf"><span class="section-number-4">1.1.7</span> Read two-electron quantities</h4>
<div id="outline-container-orgcb31bcd" class="outline-4">
<h4 id="orgcb31bcd"><span class="section-number-4">1.1.7</span> Read two-electron quantities</h4>
<div class="outline-text-4" id="text-1-1-7">
<p>
Reading is done with OpenMP. Each thread reads its own buffer, and
@ -537,8 +537,8 @@ to be protected in the critical section when modified.
</p>
</div>
<div id="outline-container-org7567762" class="outline-5">
<h5 id="org7567762"><span class="section-number-5">1.1.7.1</span> Electron repulsion integrals</h5>
<div id="outline-container-org2d2f258" class="outline-5">
<h5 id="org2d2f258"><span class="section-number-5">1.1.7.1</span> Electron repulsion integrals</h5>
<div class="outline-text-5" id="text-1-1-7-1">
<div class="org-src-container">
<pre class="src src-f90">rc = trexio_has_mo_2e_int_eri(f)
@ -587,8 +587,8 @@ icount = BUFSIZE
</div>
</div>
<div id="outline-container-org6431bf8" class="outline-5">
<h5 id="org6431bf8"><span class="section-number-5">1.1.7.2</span> Reduced density matrix</h5>
<div id="outline-container-org5dbe092" class="outline-5">
<h5 id="org5dbe092"><span class="section-number-5">1.1.7.2</span> Reduced density matrix</h5>
<div class="outline-text-5" id="text-1-1-7-2">
<div class="org-src-container">
<pre class="src src-f90">rc = trexio_has_rdm_2e(f)
@ -632,8 +632,8 @@ icount = bufsize
</div>
</div>
<div id="outline-container-org86fde4e" class="outline-4">
<h4 id="org86fde4e"><span class="section-number-4">1.1.8</span> Compute the energy</h4>
<div id="outline-container-org69a8b23" class="outline-4">
<h4 id="org69a8b23"><span class="section-number-4">1.1.8</span> Compute the energy</h4>
<div class="outline-text-4" id="text-1-1-8">
<p>
When the orbitals are real, we can use
@ -679,8 +679,8 @@ E = E + E_nn
</div>
</div>
<div id="outline-container-orgbdce9ba" class="outline-4">
<h4 id="orgbdce9ba"><span class="section-number-4">1.1.9</span> Terminate</h4>
<div id="outline-container-org6374510" class="outline-4">
<h4 id="org6374510"><span class="section-number-4">1.1.9</span> Terminate</h4>
<div class="outline-text-4" id="text-1-1-9">
<div class="org-src-container">
<pre class="src src-f90"> <span style="color: #a020f0;">deallocate</span>( D, h0, G, W )
@ -695,7 +695,7 @@ E = E + E_nn
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2022-05-18 Wed 09:56</p>
<p class="date">Created: 2022-05-19 Thu 15:24</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>
<!-- 2022-05-18 Wed 09:56 -->
<!-- 2022-05-19 Thu 15:24 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>TREXIO source code documentation</title>
@ -347,7 +347,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: 2022-05-18 Wed 09:56</p>
<p class="date">Created: 2022-05-19 Thu 15:24</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

File diff suppressed because it is too large Load Diff

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>
<!-- 2022-05-18 Wed 09:56 -->
<!-- 2022-05-19 Thu 15:24 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>HDF5 back end</title>
@ -311,23 +311,23 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org1a73ab0">1. Template for HDF5 definitions</a></li>
<li><a href="#orgb56a4cb">2. Template for HDF5 structures</a></li>
<li><a href="#orgba2ac96">3. Template for HDF5 init/deinit</a></li>
<li><a href="#orgd1b318c">4. Template for HDF5 has/read/write a numerical attribute</a></li>
<li><a href="#org3590ebe">5. Template for HDF5 has/read/write a dataset of numerical data</a></li>
<li><a href="#org360c1c3">6. Template for HDF5 has/read/write a dataset of sparse data</a></li>
<li><a href="#org636694b">7. Template for HDF5 has/read/write a dataset of strings</a></li>
<li><a href="#org4e825d3">8. Template for HDF5 has/read/write a string attribute</a></li>
<li><a href="#org0b4b28d">9. Template for HDF5 delete a group (UNSAFE mode)</a></li>
<li><a href="#org55a734d">10. Source code for the determinant part</a></li>
<li><a href="#org0c6becf">11. Helper functions</a></li>
<li><a href="#orga288d56">1. Template for HDF5 definitions</a></li>
<li><a href="#org96d7d56">2. Template for HDF5 structures</a></li>
<li><a href="#org84751b2">3. Template for HDF5 init/deinit</a></li>
<li><a href="#org1084ba3">4. Template for HDF5 has/read/write a numerical attribute</a></li>
<li><a href="#org7c1a45e">5. Template for HDF5 has/read/write a dataset of numerical data</a></li>
<li><a href="#org9048834">6. Template for HDF5 has/read/write a dataset of sparse data</a></li>
<li><a href="#org9cc34b6">7. Template for HDF5 has/read/write a dataset of strings</a></li>
<li><a href="#org2d5a756">8. Template for HDF5 has/read/write a string attribute</a></li>
<li><a href="#org849da45">9. Template for HDF5 delete a group (UNSAFE mode)</a></li>
<li><a href="#org0abf02a">10. Source code for the determinant part</a></li>
<li><a href="#orgc61eaaa">11. Helper functions</a></li>
</ul>
</div>
</div>
<div id="outline-container-org1a73ab0" class="outline-2">
<h2 id="org1a73ab0"><span class="section-number-2">1</span> Template for HDF5 definitions</h2>
<div id="outline-container-orga288d56" class="outline-2">
<h2 id="orga288d56"><span class="section-number-2">1</span> Template for HDF5 definitions</h2>
<div class="outline-text-2" id="text-1">
<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>
@ -339,9 +339,16 @@ for the JavaScript code in this tag.
</div>
</div>
<div id="outline-container-orgb56a4cb" class="outline-2">
<h2 id="orgb56a4cb"><span class="section-number-2">2</span> Template for HDF5 structures</h2>
<div id="outline-container-org96d7d56" class="outline-2">
<h2 id="org96d7d56"><span class="section-number-2">2</span> Template for HDF5 structures</h2>
<div class="outline-text-2" id="text-2">
<p>
Polymorphism of the <code>trexio_t</code> type is handled by ensuring that the
corresponding types for all back ends can be safely casted to
<code>trexio_t</code>. This is done by making the back-end structs start with
<code>trexio_t parent</code> attribute:
</p>
<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> {
<span style="color: #228b22;">trexio_t</span> <span style="color: #a0522d;">parent</span> ;
@ -353,8 +360,8 @@ for the JavaScript code in this tag.
</div>
</div>
<div id="outline-container-orgba2ac96" class="outline-2">
<h2 id="orgba2ac96"><span class="section-number-2">3</span> Template for HDF5 init/deinit</h2>
<div id="outline-container-org84751b2" class="outline-2">
<h2 id="org84751b2"><span class="section-number-2">3</span> Template for HDF5 init/deinit</h2>
<div class="outline-text-2" id="text-3">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -459,8 +466,8 @@ for the JavaScript code in this tag.
</div>
</div>
<div id="outline-container-orgd1b318c" class="outline-2">
<h2 id="orgd1b318c"><span class="section-number-2">4</span> Template for HDF5 has/read/write a numerical attribute</h2>
<div id="outline-container-org1084ba3" class="outline-2">
<h2 id="org1084ba3"><span class="section-number-2">4</span> Template for HDF5 has/read/write a numerical attribute</h2>
<div class="outline-text-2" id="text-4">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -564,8 +571,8 @@ for the JavaScript code in this tag.
</div>
</div>
<div id="outline-container-org3590ebe" class="outline-2">
<h2 id="org3590ebe"><span class="section-number-2">5</span> Template for HDF5 has/read/write a dataset of numerical data</h2>
<div id="outline-container-org7c1a45e" class="outline-2">
<h2 id="org7c1a45e"><span class="section-number-2">5</span> Template for HDF5 has/read/write a dataset of numerical data</h2>
<div class="outline-text-2" id="text-5">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -699,8 +706,8 @@ for the JavaScript code in this tag.
</div>
</div>
<div id="outline-container-org360c1c3" class="outline-2">
<h2 id="org360c1c3"><span class="section-number-2">6</span> Template for HDF5 has/read/write a dataset of sparse data</h2>
<div id="outline-container-org9048834" class="outline-2">
<h2 id="org9048834"><span class="section-number-2">6</span> Template for HDF5 has/read/write a dataset of sparse data</h2>
<div class="outline-text-2" id="text-6">
<p>
Sparse data is stored using extensible datasets of HDF5. Extensibility is required
@ -903,8 +910,8 @@ due to the fact that the sparse data will be written in chunks of user-defined s
</div>
</div>
<div id="outline-container-org636694b" class="outline-2">
<h2 id="org636694b"><span class="section-number-2">7</span> Template for HDF5 has/read/write a dataset of strings</h2>
<div id="outline-container-org9cc34b6" class="outline-2">
<h2 id="org9cc34b6"><span class="section-number-2">7</span> Template for HDF5 has/read/write a dataset of strings</h2>
<div class="outline-text-2" id="text-7">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -1102,8 +1109,8 @@ due to the fact that the sparse data will be written in chunks of user-defined s
</div>
</div>
<div id="outline-container-org4e825d3" class="outline-2">
<h2 id="org4e825d3"><span class="section-number-2">8</span> Template for HDF5 has/read/write a string attribute</h2>
<div id="outline-container-org2d5a756" class="outline-2">
<h2 id="org2d5a756"><span class="section-number-2">8</span> Template for HDF5 has/read/write a string attribute</h2>
<div class="outline-text-2" id="text-8">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -1230,8 +1237,8 @@ due to the fact that the sparse data will be written in chunks of user-defined s
</div>
</div>
</div>
<div id="outline-container-org0b4b28d" class="outline-2">
<h2 id="org0b4b28d"><span class="section-number-2">9</span> Template for HDF5 delete a group (UNSAFE mode)</h2>
<div id="outline-container-org849da45" class="outline-2">
<h2 id="org849da45"><span class="section-number-2">9</span> Template for HDF5 delete a group (UNSAFE mode)</h2>
<div class="outline-text-2" id="text-9">
<p>
<b><b>Note:</b></b> in early versions of the HDF5 library (v &lt; 1.10) unlinking an object was not working as expected
@ -1271,8 +1278,8 @@ Thus, any corrupted/lost file space will remain in the first file. The use of <c
</div>
</div>
<div id="outline-container-org55a734d" class="outline-2">
<h2 id="org55a734d"><span class="section-number-2">10</span> Source code for the determinant part</h2>
<div id="outline-container-org0abf02a" class="outline-2">
<h2 id="org0abf02a"><span class="section-number-2">10</span> Source code for the determinant part</h2>
<div class="outline-text-2" id="text-10">
<p>
Each array is stored in a separate HDF5 dataset due to the fact that determinant I/O has to be decoupled.
@ -1525,8 +1532,8 @@ Size specifies the number of data items (e.g. determinants) to process.
</div>
</div>
<div id="outline-container-org0c6becf" class="outline-2">
<h2 id="org0c6becf"><span class="section-number-2">11</span> Helper functions</h2>
<div id="outline-container-orgc61eaaa" class="outline-2">
<h2 id="orgc61eaaa"><span class="section-number-2">11</span> Helper functions</h2>
<div class="outline-text-2" id="text-11">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -1789,7 +1796,7 @@ Size specifies the number of data items (e.g. determinants) to process.
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2022-05-18 Wed 09:56</p>
<p class="date">Created: 2022-05-19 Thu 15:24</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>
<!-- 2022-05-18 Wed 09:56 -->
<!-- 2022-05-19 Thu 15:24 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>TEXT back end</title>
@ -311,20 +311,20 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org02786e9">1. Template for group-related structures in text back end</a></li>
<li><a href="#org5ce48d7">2. Template for general structure in text back end</a></li>
<li><a href="#org5eebf3a">3. Initialize function (constant part)</a></li>
<li><a href="#org1fa0258">4. Deinitialize function (templated part)</a></li>
<li><a href="#org6bdb0ff">5. Template for text read a group</a></li>
<li><a href="#org4935693">6. Template for text flush a group</a></li>
<li><a href="#org81b0478">7. Template for text free memory</a></li>
<li><a href="#orgc4cf68f">8. Template for has/read/write a numerical attribute</a></li>
<li><a href="#orgc63e851">9. Template for has/read/write a dataset of numerical data</a></li>
<li><a href="#orgf4d3dda">10. Template for has/read/write a dataset of strings</a></li>
<li><a href="#org7822561">11. Template for has/read/write a string attribute</a></li>
<li><a href="#org43c9d82">12. Template for has/read/write the dataset of sparse data</a></li>
<li><a href="#org20d868f">13. Template for text delete a group (UNSAFE mode)</a></li>
<li><a href="#org9bf2c90">14. Source code for the determinant part</a></li>
<li><a href="#orga935dd8">1. Template for group-related structures in text back end</a></li>
<li><a href="#org87a7fdc">2. Template for general structure in text back end</a></li>
<li><a href="#orgafd951f">3. Initialize function (constant part)</a></li>
<li><a href="#orgcf521f9">4. Deinitialize function (templated part)</a></li>
<li><a href="#orge334616">5. Template for text read a group</a></li>
<li><a href="#org823c20f">6. Template for text flush a group</a></li>
<li><a href="#orga8cfc76">7. Template for text free memory</a></li>
<li><a href="#org3d1b9a4">8. Template for has/read/write a numerical attribute</a></li>
<li><a href="#org80472c9">9. Template for has/read/write a dataset of numerical data</a></li>
<li><a href="#org0ea5123">10. Template for has/read/write a dataset of strings</a></li>
<li><a href="#orgcc92c82">11. Template for has/read/write a string attribute</a></li>
<li><a href="#org15d67fe">12. Template for has/read/write the dataset of sparse data</a></li>
<li><a href="#org1145665">13. Template for text delete a group (UNSAFE mode)</a></li>
<li><a href="#orgb99d426">14. Source code for the determinant part</a></li>
</ul>
</div>
</div>
@ -346,8 +346,8 @@ directory.
The file is written when closed, or when the flush function is called.
</p>
<div id="outline-container-org02786e9" class="outline-2">
<h2 id="org02786e9"><span class="section-number-2">1</span> Template for group-related structures in text back end</h2>
<div id="outline-container-orga935dd8" class="outline-2">
<h2 id="orga935dd8"><span class="section-number-2">1</span> Template for group-related structures in text back end</h2>
<div class="outline-text-2" id="text-1">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> $group$_s {
@ -366,9 +366,16 @@ The file is written when closed, or when the flush function is called.
</div>
</div>
<div id="outline-container-org5ce48d7" class="outline-2">
<h2 id="org5ce48d7"><span class="section-number-2">2</span> Template for general structure in text back end</h2>
<div id="outline-container-org87a7fdc" class="outline-2">
<h2 id="org87a7fdc"><span class="section-number-2">2</span> Template for general structure in text back end</h2>
<div class="outline-text-2" id="text-2">
<p>
Polymorphism of the <code>trexio_t</code> type is handled by ensuring that the
corresponding types for all back ends can be safely casted to
<code>trexio_t</code>. This is done by making the back-end structs start with
<code>trexio_t parent</code> attribute:
</p>
<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_text_s</span> {
<span style="color: #228b22;">trexio_t</span> <span style="color: #a0522d;">parent</span> ;
@ -380,8 +387,8 @@ The file is written when closed, or when the flush function is called.
</div>
</div>
<div id="outline-container-org5eebf3a" class="outline-2">
<h2 id="org5eebf3a"><span class="section-number-2">3</span> Initialize function (constant part)</h2>
<div id="outline-container-orgafd951f" class="outline-2">
<h2 id="orgafd951f"><span class="section-number-2">3</span> Initialize function (constant part)</h2>
<div class="outline-text-2" id="text-3">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -524,8 +531,8 @@ The file is written when closed, or when the flush function is called.
</div>
</div>
<div id="outline-container-org1fa0258" class="outline-2">
<h2 id="org1fa0258"><span class="section-number-2">4</span> Deinitialize function (templated part)</h2>
<div id="outline-container-orgcf521f9" class="outline-2">
<h2 id="orgcf521f9"><span class="section-number-2">4</span> Deinitialize function (templated part)</h2>
<div class="outline-text-2" id="text-4">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -547,8 +554,8 @@ The file is written when closed, or when the flush function is called.
</div>
</div>
<div id="outline-container-org6bdb0ff" class="outline-2">
<h2 id="org6bdb0ff"><span class="section-number-2">5</span> Template for text read a group</h2>
<div id="outline-container-orge334616" class="outline-2">
<h2 id="orge334616"><span class="section-number-2">5</span> Template for text read a group</h2>
<div class="outline-text-2" id="text-5">
<div class="org-src-container">
<pre class="src src-c">$group$_t*
@ -614,12 +621,7 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
rc = fscanf(f, <span style="color: #8b2252;">"%u"</span>, &amp;($group$-&gt;rank_$group_dset$));
<span style="color: #a020f0;">if</span> (rc != 1) {
FREE(buffer);
fclose(f);
/* <span style="color: #b22222;">Set pointer to the struct so that the garbage collector can do the job on file handle </span>*/
file-&gt;$group$ = $group$;
rc_free = trexio_text_free_$group$(file);
assert(rc_free == TREXIO_SUCCESS);
trexio_text_free_read_$group$(buffer, f, file, $group$);
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
}
@ -630,24 +632,14 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
<span style="color: #228b22;">uint32_t</span> <span style="color: #a0522d;">j</span>=0;
rc = fscanf(f, <span style="color: #8b2252;">"%1023s %u"</span>, buffer, &amp;j);
<span style="color: #a020f0;">if</span> ((rc != 2) || (strcmp(buffer, <span style="color: #8b2252;">"dims_$group_dset$"</span>) != 0) || (j!=i)) {
FREE(buffer);
fclose(f);
/* <span style="color: #b22222;">Set pointer to the struct so that the garbage collector can do the job on file handle </span>*/
file-&gt;$group$ = $group$;
rc_free = trexio_text_free_$group$(file);
assert(rc_free == TREXIO_SUCCESS);
trexio_text_free_read_$group$(buffer, f, file, $group$);
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
}
rc = fscanf(f, <span style="color: #8b2252;">"%"</span> SCNu64 <span style="color: #8b2252;">"\n"</span>, &amp;($group$-&gt;dims_$group_dset$[i]));
assert(!(rc != 1));
<span style="color: #a020f0;">if</span> (rc != 1) {
FREE(buffer);
fclose(f);
/* <span style="color: #b22222;">Set pointer to the struct so that the garbage collector can do the job on file handle </span>*/
file-&gt;$group$ = $group$;
rc_free = trexio_text_free_$group$(file);
assert(rc_free == TREXIO_SUCCESS);
trexio_text_free_read_$group$(buffer, f, file, $group$);
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
}
@ -660,24 +652,14 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
/* <span style="color: #b22222;">Allocate arrays </span>*/
$group$-&gt;$group_dset$ = CALLOC(size_$group_dset$, $group_dset_dtype$);
<span style="color: #a020f0;">if</span> ($group$-&gt;$group_dset$ == <span style="color: #008b8b;">NULL</span>) {
FREE(buffer);
fclose(f);
/* <span style="color: #b22222;">Set pointer to the struct so that the garbage collector can do the job on file handle </span>*/
file-&gt;$group$ = $group$;
rc_free = trexio_text_free_$group$(file);
assert(rc_free == TREXIO_SUCCESS);
trexio_text_free_read_$group$(buffer, f, file, $group$);
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
}
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">i</span>=0 ; i&lt;size_$group_dset$ ; ++i) {
rc = fscanf(f, <span style="color: #8b2252;">"%$group_dset_format_scanf$"</span>, &amp;($group$-&gt;$group_dset$[i]));
<span style="color: #a020f0;">if</span> (rc != 1) {
FREE(buffer);
fclose(f);
/* <span style="color: #b22222;">Set pointer to the struct so that the garbage collector can do the job on file handle </span>*/
file-&gt;$group$ = $group$;
rc_free = trexio_text_free_$group$(file);
assert(rc_free == TREXIO_SUCCESS);
trexio_text_free_read_$group$(buffer, f, file, $group$);
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
}
}
@ -690,17 +672,12 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
/* <span style="color: #b22222;">Allocate arrays </span>*/
$group$-&gt;$group_dset$ = CALLOC(size_$group_dset$, $group_dset_dtype$);
<span style="color: #a020f0;">if</span> ($group$-&gt;$group_dset$ == <span style="color: #008b8b;">NULL</span>) {
FREE(buffer);
fclose(f);
/* <span style="color: #b22222;">Set pointer to the struct so that the garbage collector can do the job on file handle </span>*/
file-&gt;$group$ = $group$;
rc_free = trexio_text_free_$group$(file);
assert(rc_free == TREXIO_SUCCESS);
trexio_text_free_read_$group$(buffer, f, file, $group$);
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
}
/* <span style="color: #b22222;">WARNING: this tmp array allows to avoid allocation of space for each element of array of string</span>
<span style="color: #b22222;"> BUT it's size has to be number_of_str*max_len_str where max_len_str is somewhat arbitrary, e.g. 32.</span>
<span style="color: #b22222;"> * BUT it's size has to be number_of_str*max_len_str where max_len_str is somewhat arbitrary, e.g. 32.</span>
<span style="color: #b22222;"> </span>*/
<span style="color: #228b22;">char</span>* <span style="color: #a0522d;">tmp_$group_dset$</span>;
tmp_$group_dset$ = CALLOC(size_$group_dset$*32, <span style="color: #228b22;">char</span>);
@ -709,16 +686,10 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
$group$-&gt;$group_dset$[i] = tmp_$group_dset$;
/* <span style="color: #b22222;">conventional fcanf with "%s" only return the string before the first space character</span>
<span style="color: #b22222;"> * to read string with spaces use "%[^\n]" possible with space before or after, i.e. " %[^\n]"</span>
<span style="color: #b22222;"> * Q: depending on what ? </span>*/
<span style="color: #b22222;"> </span>*/
rc = fscanf(f, <span style="color: #8b2252;">" %1023[^\n]"</span>, tmp_$group_dset$);
assert(!(rc != 1));
<span style="color: #a020f0;">if</span> (rc != 1) {
FREE(buffer);
fclose(f);
/* <span style="color: #b22222;">Set pointer to the struct so that the garbage collector can do the job on file handle </span>*/
file-&gt;$group$ = $group$;
rc_free = trexio_text_free_$group$(file);
assert(rc_free == TREXIO_SUCCESS);
trexio_text_free_read_$group$(buffer, f, file, $group$);
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
}
@ -735,41 +706,25 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
/* <span style="color: #b22222;">additional parameter $group_num$_isSet is needed to suppress warning when fscanf into bool variable using %u or %d </span>*/
rc = fscanf(f, <span style="color: #8b2252;">"%u"</span>, &amp;($group_num$_isSet));
$group$-&gt;$group_num$_isSet = (bool) $group_num$_isSet;
assert(!(rc != 1));
<span style="color: #a020f0;">if</span> (rc != 1) {
FREE(buffer);
fclose(f);
/* <span style="color: #b22222;">Set pointer to the struct so that the garbage collector can do the job on file handle </span>*/
file-&gt;$group$ = $group$;
rc_free = trexio_text_free_$group$(file);
assert(rc_free == TREXIO_SUCCESS);
trexio_text_free_read_$group$(buffer, f, file, $group$);
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
}
<span style="color: #a020f0;">if</span> ($group$-&gt;$group_num$_isSet == <span style="color: #008b8b;">true</span>) {
rc = fscanf(f, <span style="color: #8b2252;">"%1023s"</span>, buffer);
assert(!((rc != 1) || (strcmp(buffer, <span style="color: #8b2252;">"$group_num$"</span>) != 0)));
<span style="color: #a020f0;">if</span> ((rc != 1) || (strcmp(buffer, <span style="color: #8b2252;">"$group_num$"</span>) != 0)) {
FREE(buffer);
fclose(f);
/* <span style="color: #b22222;">Set pointer to the struct so that the garbage collector can do the job on file handle </span>*/
file-&gt;$group$ = $group$;
rc_free = trexio_text_free_$group$(file);
assert(rc_free == TREXIO_SUCCESS);
trexio_text_free_read_$group$(buffer, f, file, $group$);
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
}
rc = fscanf(f, <span style="color: #8b2252;">"%$group_num_format_scanf$"</span>, &amp;($group$-&gt;$group_num$));
assert(!(rc != 1));
<span style="color: #a020f0;">if</span> (rc != 1) {
FREE(buffer);
fclose(f);
/* <span style="color: #b22222;">Set pointer to the struct so that the garbage collector can do the job on file handle </span>*/
file-&gt;$group$ = $group$;
rc_free = trexio_text_free_$group$(file);
assert(rc_free == TREXIO_SUCCESS);
trexio_text_free_read_$group$(buffer, f, file, $group$);
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
}
}
// <span style="color: #b22222;">END REPEAT GROUP_NUM</span>
@ -777,52 +732,28 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
} <span style="color: #a020f0;">else</span> <span style="color: #a020f0;">if</span> (strcmp(buffer, <span style="color: #8b2252;">"len_$group_str$"</span>) == 0) {
rc = fscanf(f, <span style="color: #8b2252;">"%"</span> SCNu64 <span style="color: #8b2252;">""</span>, &amp;($group$-&gt;len_$group_str$));
assert(!(rc != 1));
<span style="color: #a020f0;">if</span> (rc != 1) {
FREE(buffer);
fclose(f);
/* <span style="color: #b22222;">Set pointer to the struct so that the garbage collector can do the job on file handle </span>*/
file-&gt;$group$ = $group$;
rc_free = trexio_text_free_$group$(file);
assert(rc_free == TREXIO_SUCCESS);
trexio_text_free_read_$group$(buffer, f, file, $group$);
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
}
rc = fscanf(f, <span style="color: #8b2252;">"%1023s"</span>, buffer);
assert(!((rc != 1) || (strcmp(buffer, <span style="color: #8b2252;">"$group_str$"</span>) != 0)));
<span style="color: #a020f0;">if</span> ((rc != 1) || (strcmp(buffer, <span style="color: #8b2252;">"$group_str$"</span>) != 0)) {
FREE(buffer);
fclose(f);
/* <span style="color: #b22222;">Set pointer to the struct so that the garbage collector can do the job on file handle </span>*/
file-&gt;$group$ = $group$;
rc_free = trexio_text_free_$group$(file);
assert(rc_free == TREXIO_SUCCESS);
trexio_text_free_read_$group$(buffer, f, file, $group$);
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
}
<span style="color: #a020f0;">if</span> ($group$-&gt;len_$group_str$ != 0) {
$group$-&gt;$group_str$ = CALLOC($group$-&gt;len_$group_str$, <span style="color: #228b22;">char</span>);
assert (!($group$-&gt;$group_str$ == <span style="color: #008b8b;">NULL</span>));
<span style="color: #a020f0;">if</span> ($group$-&gt;$group_str$ == <span style="color: #008b8b;">NULL</span>) {
FREE(buffer);
fclose(f);
/* <span style="color: #b22222;">Set pointer to the struct so that the garbage collector can do the job on file handle </span>*/
file-&gt;$group$ = $group$;
rc_free = trexio_text_free_$group$(file);
assert(rc_free == TREXIO_SUCCESS);
trexio_text_free_read_$group$(buffer, f, file, $group$);
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
}
rc = fscanf(f, <span style="color: #8b2252;">" %1023[^\n]"</span>, $group$-&gt;$group_str$);
assert(!(rc != 1));
<span style="color: #a020f0;">if</span> (rc != 1) {
FREE(buffer);
fclose(f);
/* <span style="color: #b22222;">Set pointer to the struct so that the garbage collector can do the job on file handle </span>*/
file-&gt;$group$ = $group$;
rc_free = trexio_text_free_$group$(file);
assert(rc_free == TREXIO_SUCCESS);
trexio_text_free_read_$group$(buffer, f, file, $group$);
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
}
@ -842,15 +773,14 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
file-&gt;$group$ = $group$;
<span style="color: #a020f0;">return</span> $group$;
}
</pre>
</div>
</div>
</div>
<div id="outline-container-org4935693" class="outline-2">
<h2 id="org4935693"><span class="section-number-2">6</span> Template for text flush a group</h2>
<div id="outline-container-org823c20f" class="outline-2">
<h2 id="org823c20f"><span class="section-number-2">6</span> Template for text flush a group</h2>
<div class="outline-text-2" id="text-6">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -914,8 +844,8 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
</div>
</div>
<div id="outline-container-org81b0478" class="outline-2">
<h2 id="org81b0478"><span class="section-number-2">7</span> Template for text free memory</h2>
<div id="outline-container-orga8cfc76" class="outline-2">
<h2 id="orga8cfc76"><span class="section-number-2">7</span> Template for text free memory</h2>
<div class="outline-text-2" id="text-7">
<p>
Memory is allocated when reading. The following function frees memory.
@ -959,11 +889,33 @@ Memory is allocated when reading. The following function frees memory.
}
</pre>
</div>
<p>
This function is called upon the non-successful exit from the <code>trexio_text_read_group</code> function.
</p>
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_text_free_read_$group$</span> (<span style="color: #228b22;">char</span>* <span style="color: #a0522d;">buffer</span>, <span style="color: #228b22;">FILE</span>* <span style="color: #a0522d;">txt_file</span>, <span style="color: #228b22;">trexio_text_t</span>* <span style="color: #a0522d;">trexio_file</span>, $group$_t* $group$)
{
<span style="color: #228b22;">trexio_exit_code</span> <span style="color: #a0522d;">rc_free</span>;
FREE(buffer);
fclose(txt_file);
/* <span style="color: #b22222;">Set pointer to the struct so that the garbage collector can do the job on file handle </span>*/
trexio_file-&gt;$group$ = $group$;
rc_free = trexio_text_free_$group$(trexio_file);
assert(rc_free == TREXIO_SUCCESS);
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
}
</pre>
</div>
</div>
</div>
<div id="outline-container-orgc4cf68f" class="outline-2">
<h2 id="orgc4cf68f"><span class="section-number-2">8</span> Template for has/read/write a numerical attribute</h2>
<div id="outline-container-org3d1b9a4" class="outline-2">
<h2 id="org3d1b9a4"><span class="section-number-2">8</span> Template for has/read/write a numerical attribute</h2>
<div class="outline-text-2" id="text-8">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -1026,8 +978,8 @@ Memory is allocated when reading. The following function frees memory.
</div>
</div>
<div id="outline-container-orgc63e851" class="outline-2">
<h2 id="orgc63e851"><span class="section-number-2">9</span> Template for has/read/write a dataset of numerical data</h2>
<div id="outline-container-org80472c9" class="outline-2">
<h2 id="org80472c9"><span class="section-number-2">9</span> Template for has/read/write a dataset of numerical data</h2>
<div class="outline-text-2" id="text-9">
<p>
The <code>group_dset</code> array is assumed allocated with the appropriate size.
@ -1123,8 +1075,8 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div>
</div>
</div>
<div id="outline-container-orgf4d3dda" class="outline-2">
<h2 id="orgf4d3dda"><span class="section-number-2">10</span> Template for has/read/write a dataset of strings</h2>
<div id="outline-container-org0ea5123" class="outline-2">
<h2 id="org0ea5123"><span class="section-number-2">10</span> Template for has/read/write a dataset of strings</h2>
<div class="outline-text-2" id="text-10">
<p>
The <code>group_dset</code> array is assumed allocated with the appropriate size.
@ -1225,8 +1177,8 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div>
</div>
</div>
<div id="outline-container-org7822561" class="outline-2">
<h2 id="org7822561"><span class="section-number-2">11</span> Template for has/read/write a string attribute</h2>
<div id="outline-container-orgcc92c82" class="outline-2">
<h2 id="orgcc92c82"><span class="section-number-2">11</span> Template for has/read/write a string attribute</h2>
<div class="outline-text-2" id="text-11">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -1300,8 +1252,8 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div>
</div>
</div>
<div id="outline-container-org43c9d82" class="outline-2">
<h2 id="org43c9d82"><span class="section-number-2">12</span> Template for has/read/write the dataset of sparse data</h2>
<div id="outline-container-org15d67fe" class="outline-2">
<h2 id="org15d67fe"><span class="section-number-2">12</span> Template for has/read/write the dataset of sparse data</h2>
<div class="outline-text-2" id="text-12">
<p>
Each sparse array is stored in a separate <code>.txt</code> file due to the fact that sparse I/O has to be decoupled
@ -1342,7 +1294,6 @@ User provides indices and values of the sparse array as two separate variables.
<span style="color: #228b22;">FILE</span>* <span style="color: #a0522d;">f</span> = fopen(file_full_path, <span style="color: #8b2252;">"a"</span>);
<span style="color: #a020f0;">if</span> (f == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_FILE_ERROR;
/* <span style="color: #b22222;">Specify the line length in order to offset properly. For example, for 4-index quantities</span>
<span style="color: #b22222;"> the line_length is 69 because 10 per index + 4 spaces + 24 for floating point value + 1 for the new line char.</span>
<span style="color: #b22222;"> CURRENTLY NO OFFSET IS USED WHEN WRITING !</span>
@ -1575,8 +1526,8 @@ User provides indices and values of the sparse array as two separate variables.
</div>
</div>
<div id="outline-container-org20d868f" class="outline-2">
<h2 id="org20d868f"><span class="section-number-2">13</span> Template for text delete a group (UNSAFE mode)</h2>
<div id="outline-container-org1145665" class="outline-2">
<h2 id="org1145665"><span class="section-number-2">13</span> Template for text delete a group (UNSAFE mode)</h2>
<div class="outline-text-2" id="text-13">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -1604,8 +1555,8 @@ User provides indices and values of the sparse array as two separate variables.
</div>
</div>
<div id="outline-container-org9bf2c90" class="outline-2">
<h2 id="org9bf2c90"><span class="section-number-2">14</span> Source code for the determinant part</h2>
<div id="outline-container-orgb99d426" class="outline-2">
<h2 id="orgb99d426"><span class="section-number-2">14</span> Source code for the determinant part</h2>
<div class="outline-text-2" id="text-14">
<p>
Each array is stored in a separate <code>.txt</code> file due to the fact that determinant I/O has to be decoupled
@ -2009,7 +1960,7 @@ Size specifies the number of data items, e.g. determinants.
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2022-05-18 Wed 09:56</p>
<p class="date">Created: 2022-05-19 Thu 15:24</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

134
trex.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>
<!-- 2022-05-18 Wed 09:56 -->
<!-- 2022-05-19 Thu 15:24 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>TREX Configuration file</title>
@ -333,35 +333,35 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org39aecf0">1. Metadata (metadata group)</a></li>
<li><a href="#orgff3c918">2. Electron (electron group)</a></li>
<li><a href="#orgbfedf30">3. Nucleus (nucleus group)</a></li>
<li><a href="#orgbe51561">4. Effective core potentials (ecp group)</a>
<li><a href="#org582bbd5">1. Metadata (metadata group)</a></li>
<li><a href="#orgb13b58f">2. Electron (electron group)</a></li>
<li><a href="#orgf3e13de">3. Nucleus (nucleus group)</a></li>
<li><a href="#org6707717">4. Effective core potentials (ecp group)</a>
<ul>
<li><a href="#orgff9b62d">4.1. Example</a></li>
<li><a href="#orga927028">4.1. Example</a></li>
</ul>
</li>
<li><a href="#orgaaf6f48">5. Basis set (basis group)</a>
<li><a href="#orgb2f693e">5. Basis set (basis group)</a>
<ul>
<li><a href="#orga640d2e">5.1. Example</a></li>
<li><a href="#orgf02bf30">5.1. Example</a></li>
</ul>
</li>
<li><a href="#org08b6ff6">6. Atomic orbitals (ao group)</a>
<li><a href="#org0e7fe15">6. Atomic orbitals (ao group)</a>
<ul>
<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>
</ul>
</li>
<li><a href="#org06d529b">7. Molecular orbitals (mo group)</a>
<li><a href="#orgef9063d">7. Molecular orbitals (mo group)</a>
<ul>
<li><a href="#orgc8965f7">7.1. One-electron integrals (<code>mo_1e_int</code> group)</a></li>
<li><a href="#org6a396a6">7.2. Two-electron integrals (<code>mo_2e_int</code> group)</a></li>
<li><a href="#org2b0f071">7.1. One-electron integrals (<code>mo_1e_int</code> group)</a></li>
<li><a href="#org7272da5">7.2. Two-electron integrals (<code>mo_2e_int</code> group)</a></li>
</ul>
</li>
<li><a href="#org9e29804">8. Slater determinants (determinant group)</a></li>
<li><a href="#orgc4c49d3">9. Excited states (state group)</a></li>
<li><a href="#org2436c98">10. Reduced density matrices (rdm group)</a></li>
<li><a href="#orgf0f0e0c">11. Quantum Monte Carlo data (qmc group)</a></li>
<li><a href="#org985fa0d">8. Slater determinants (determinant group)</a></li>
<li><a href="#orgea345e2">9. Excited states (state group)</a></li>
<li><a href="#org9c1d174">10. Reduced density matrices (rdm group)</a></li>
<li><a href="#org50d3ff1">11. Quantum Monte Carlo data (qmc group)</a></li>
</ul>
</div>
</div>
@ -411,8 +411,8 @@ the <a href="./examples.html">examples</a>.
</p>
<div id="outline-container-org39aecf0" class="outline-2">
<h2 id="org39aecf0"><span class="section-number-2">1</span> Metadata (metadata group)</h2>
<div id="outline-container-org582bbd5" class="outline-2">
<h2 id="org582bbd5"><span class="section-number-2">1</span> Metadata (metadata group)</h2>
<div class="outline-text-2" id="text-1">
<p>
As we expect our files to be archived in open-data repositories, we
@ -422,7 +422,7 @@ which have participated to the creation of the file, a list of
authors of the file, and a textual description.
</p>
<table id="org684fbce" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org55b96de" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -503,15 +503,15 @@ then the <code>unsafe</code> attribute value can be manually overwritten (in uns
</div>
</div>
<div id="outline-container-orgff3c918" class="outline-2">
<h2 id="orgff3c918"><span class="section-number-2">2</span> Electron (electron group)</h2>
<div id="outline-container-orgb13b58f" class="outline-2">
<h2 id="orgb13b58f"><span class="section-number-2">2</span> Electron (electron group)</h2>
<div class="outline-text-2" id="text-2">
<p>
We consider wave functions expressed in the spin-free formalism, where
the number of &uarr; and &darr; electrons is fixed.
</p>
<table id="orgfdcc5eb" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org6be37e6" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -557,15 +557,15 @@ the number of &uarr; and &darr; electrons is fixed.
</div>
</div>
<div id="outline-container-orgbfedf30" class="outline-2">
<h2 id="orgbfedf30"><span class="section-number-2">3</span> Nucleus (nucleus group)</h2>
<div id="outline-container-orgf3e13de" class="outline-2">
<h2 id="orgf3e13de"><span class="section-number-2">3</span> Nucleus (nucleus group)</h2>
<div class="outline-text-2" id="text-3">
<p>
The nuclei are considered as fixed point charges. Coordinates are
given in Cartesian \((x,y,z)\) format.
</p>
<table id="org9f075ea" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org8eba686" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -632,8 +632,8 @@ given in Cartesian \((x,y,z)\) format.
</div>
</div>
<div id="outline-container-orgbe51561" class="outline-2">
<h2 id="orgbe51561"><span class="section-number-2">4</span> Effective core potentials (ecp group)</h2>
<div id="outline-container-org6707717" class="outline-2">
<h2 id="org6707717"><span class="section-number-2">4</span> Effective core potentials (ecp group)</h2>
<div class="outline-text-2" id="text-4">
<p>
An effective core potential (ECP) \(V_A^{\text{ECP}}\) replacing the
@ -666,7 +666,7 @@ The functions \(V_{A\ell}\) are parameterized as:
See <a href="http://dx.doi.org/10.1063/1.4984046">http://dx.doi.org/10.1063/1.4984046</a> or <a href="https://doi.org/10.1063/1.5121006">https://doi.org/10.1063/1.5121006</a> for more info.
</p>
<table id="org1ce1f68" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org39371ac" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -768,8 +768,8 @@ If you encounter the aforementioned issue, please report it to our <a href="http
</p>
</div>
<div id="outline-container-orgff9b62d" class="outline-3">
<h3 id="orgff9b62d"><span class="section-number-3">4.1</span> Example</h3>
<div id="outline-container-orga927028" class="outline-3">
<h3 id="orga927028"><span class="section-number-3">4.1</span> Example</h3>
<div class="outline-text-3" id="text-4-1">
<p>
For example, consider H<sub>2</sub> molecule with the following
@ -832,8 +832,8 @@ power = [
</div>
</div>
<div id="outline-container-orgaaf6f48" class="outline-2">
<h2 id="orgaaf6f48"><span class="section-number-2">5</span> Basis set (basis group)</h2>
<div id="outline-container-orgb2f693e" class="outline-2">
<h2 id="orgb2f693e"><span class="section-number-2">5</span> Basis set (basis group)</h2>
<div class="outline-text-2" id="text-5">
<p>
We consider here basis functions centered on nuclei. Hence, we enable
@ -886,7 +886,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:
</p>
<table id="org3fa290a" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="orgaebc136" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -980,8 +980,8 @@ All the basis set parameters are stored in one-dimensional arrays:
</table>
</div>
<div id="outline-container-orga640d2e" class="outline-3">
<h3 id="orga640d2e"><span class="section-number-3">5.1</span> Example</h3>
<div id="outline-container-orgf02bf30" class="outline-3">
<h3 id="orgf02bf30"><span class="section-number-3">5.1</span> Example</h3>
<div class="outline-text-3" id="text-5-1">
<p>
For example, consider H<sub>2</sub> with the following basis set (in GAMESS
@ -1059,8 +1059,8 @@ prim_factor =
</div>
</div>
<div id="outline-container-org08b6ff6" class="outline-2">
<h2 id="org08b6ff6"><span class="section-number-2">6</span> Atomic orbitals (ao group)</h2>
<div id="outline-container-org0e7fe15" class="outline-2">
<h2 id="org0e7fe15"><span class="section-number-2">6</span> Atomic orbitals (ao group)</h2>
<div class="outline-text-2" id="text-6">
<p>
Going from the atomic basis set to AOs implies a systematic
@ -1113,13 +1113,13 @@ shell, as in the GAMESS convention where
<p>
In such a case, one should set the normalization of the shell (in
the <a href="#orgaaf6f48">Basis set</a> section) to \(\mathcal{N}_{z^2}\), which is the
the <a href="#orgb2f693e">Basis set</a> section) to \(\mathcal{N}_{z^2}\), which is the
normalization factor of the atomic orbitals in spherical coordinates.
The normalization factor of the \(xy\) function which should be
introduced here should be \(\frac{\mathcal{N}_{xy}}{\mathcal{N}_{z^2}}\).
</p>
<table id="orgb9d94de" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="orgeedfcf3" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1171,8 +1171,8 @@ introduced here should be \(\frac{\mathcal{N}_{xy}}{\mathcal{N}_{z^2}}\).
</table>
</div>
<div id="outline-container-org13b9379" class="outline-3">
<h3 id="ao_one_e"><a id="org13b9379"></a><span class="section-number-3">6.1</span> One-electron integrals (<code>ao_1e_int</code> group)</h3>
<div id="outline-container-orgee341a6" class="outline-3">
<h3 id="ao_one_e"><a id="orgee341a6"></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">
<ul class="org-ul">
<li>\[ \hat{V}_{\text{ne}} = \sum_{A=1}^{N_\text{nucl}}
@ -1189,7 +1189,7 @@ The one-electron integrals for a one-electron operator \(\hat{O}\) are
over atomic orbitals.
</p>
<table id="orge6a80c7" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org670882d" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1249,8 +1249,8 @@ over atomic orbitals.
</div>
</div>
<div id="outline-container-orgb1d52f8" class="outline-3">
<h3 id="ao_two_e"><a id="orgb1d52f8"></a><span class="section-number-3">6.2</span> Two-electron integrals (<code>ao_2e_int</code> group)</h3>
<div id="outline-container-org3c280d2" class="outline-3">
<h3 id="ao_two_e"><a id="org3c280d2"></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">
<p>
The two-electron integrals for a two-electron operator \(\hat{O}\) are
@ -1271,7 +1271,7 @@ notation.
\mathbf{r}_j \vert)}{\vert \mathbf{r}_i - \mathbf{r}_j \vert} \] : electron-electron long range potential</li>
</ul>
<table id="orgf561b5a" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org0a631ee" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1311,10 +1311,10 @@ notation.
</div>
</div>
<div id="outline-container-org06d529b" class="outline-2">
<h2 id="org06d529b"><span class="section-number-2">7</span> Molecular orbitals (mo group)</h2>
<div id="outline-container-orgef9063d" class="outline-2">
<h2 id="orgef9063d"><span class="section-number-2">7</span> Molecular orbitals (mo group)</h2>
<div class="outline-text-2" id="text-7">
<table id="org11aabf8" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="orgabaf615" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1380,8 +1380,8 @@ notation.
</table>
</div>
<div id="outline-container-orgc8965f7" class="outline-3">
<h3 id="orgc8965f7"><span class="section-number-3">7.1</span> One-electron integrals (<code>mo_1e_int</code> group)</h3>
<div id="outline-container-org2b0f071" class="outline-3">
<h3 id="org2b0f071"><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">
<p>
The operators as the same as those defined in the
@ -1389,7 +1389,7 @@ The operators as the same as those defined in the
the basis of molecular orbitals.
</p>
<table id="org4232212" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org3e7d3ab" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1449,8 +1449,8 @@ the basis of molecular orbitals.
</div>
</div>
<div id="outline-container-org6a396a6" class="outline-3">
<h3 id="org6a396a6"><span class="section-number-3">7.2</span> Two-electron integrals (<code>mo_2e_int</code> group)</h3>
<div id="outline-container-org7272da5" class="outline-3">
<h3 id="org7272da5"><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">
<p>
The operators as the same as those defined in the
@ -1458,7 +1458,7 @@ The operators as the same as those defined in the
the basis of molecular orbitals.
</p>
<table id="org9560f2a" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org1d596df" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1498,8 +1498,8 @@ the basis of molecular orbitals.
</div>
</div>
<div id="outline-container-org9e29804" class="outline-2">
<h2 id="org9e29804"><span class="section-number-2">8</span> Slater determinants (determinant group)</h2>
<div id="outline-container-org985fa0d" class="outline-2">
<h2 id="org985fa0d"><span class="section-number-2">8</span> Slater determinants (determinant group)</h2>
<div class="outline-text-2" id="text-8">
<p>
The configuration interaction (CI) wave function \(\Psi\)
@ -1532,7 +1532,7 @@ where \(\alpha\) and \(\beta\) denote $&uarr;$-spin and $&darr;$-spin electrons,
\(n\uparrow\) and \(n\downarrow\) correspond to <code>electron.up_num</code> and <code>electron.dn_num</code>, respectively.
</p>
<table id="orga095b19" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org0393b72" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1578,8 +1578,8 @@ where \(\alpha\) and \(\beta\) denote $&uarr;$-spin and $&darr;$-spin electrons,
</div>
</div>
<div id="outline-container-orgc4c49d3" class="outline-2">
<h2 id="orgc4c49d3"><span class="section-number-2">9</span> Excited states (state group)</h2>
<div id="outline-container-orgea345e2" class="outline-2">
<h2 id="orgea345e2"><span class="section-number-2">9</span> Excited states (state group)</h2>
<div class="outline-text-2" id="text-9">
<p>
By default, the <code>determinant</code> group corresponds to the ground state.
@ -1588,7 +1588,7 @@ correspond to excited state wave functions for the same set of
determinants. This is the goal of the present group
</p>
<table id="org2e3a6c3" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org9ba5494" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1627,8 +1627,8 @@ determinants. This is the goal of the present group
</div>
</div>
<div id="outline-container-org2436c98" class="outline-2">
<h2 id="org2436c98"><span class="section-number-2">10</span> Reduced density matrices (rdm group)</h2>
<div id="outline-container-org9c1d174" class="outline-2">
<h2 id="org9c1d174"><span class="section-number-2">10</span> Reduced density matrices (rdm group)</h2>
<div class="outline-text-2" id="text-10">
<p>
The reduced density matrices are defined in the basis of molecular
@ -1681,7 +1681,7 @@ The total energy can be computed as:
\]
</p>
<table id="orgd99ebcc" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="orgc86553d" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1762,8 +1762,8 @@ The total energy can be computed as:
</div>
</div>
<div id="outline-container-orgf0f0e0c" class="outline-2">
<h2 id="orgf0f0e0c"><span class="section-number-2">11</span> Quantum Monte Carlo data (qmc group)</h2>
<div id="outline-container-org50d3ff1" class="outline-2">
<h2 id="org50d3ff1"><span class="section-number-2">11</span> Quantum Monte Carlo data (qmc group)</h2>
<div class="outline-text-2" id="text-11">
<p>
In quantum Monte Carlo calculations, the wave function is evaluated
@ -1777,7 +1777,7 @@ By convention, the electron coordinates contain first all the electrons
of $&uarr;$-spin and then all the $&darr;$-spin.
</p>
<table id="org0c7c2a2" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org46d2392" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1832,7 +1832,7 @@ of $&uarr;$-spin and then all the $&darr;$-spin.
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2022-05-18 Wed 09:56</p>
<p class="date">Created: 2022-05-19 Thu 15:24</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>