1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-10-02 14:31:05 +02:00

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

This commit is contained in:
scemama 2022-07-04 11:02:49 +00:00
parent 836fb1a1c9
commit 05553ffb3c
7 changed files with 818 additions and 526 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-07-01 Fri 17:00 -->
<!-- 2022-07-04 Mon 11:02 -->
<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-07-01 Fri 17:00</p>
<p class="date">Created: 2022-07-04 Mon 11:02</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-07-01 Fri 17:00 -->
<!-- 2022-07-04 Mon 11:02 -->
<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,31 +333,31 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org054272b">1. Accessing sparse quantities (integrals)</a>
<li><a href="#org4b4a533">1. Accessing sparse quantities (integrals)</a>
<ul>
<li><a href="#org74d188d">1.1. Fortran</a>
<li><a href="#org87e249e">1.1. Fortran</a>
<ul>
<li><a href="#orgc6a813e">1.1.1. Declare Temporary variables</a></li>
<li><a href="#orgd282ca6">1.1.2. Obtain the name of the TREXIO file from the command line, and open it for reading</a></li>
<li><a href="#orgf87e4b5">1.1.3. Read the nuclear repulsion energy</a></li>
<li><a href="#orge639317">1.1.4. Read the number of molecular orbitals</a></li>
<li><a href="#org7f47ec4">1.1.5. Allocate memory</a></li>
<li><a href="#org6d8eff1">1.1.6. Read one-electron quantities</a></li>
<li><a href="#orgf296722">1.1.7. Read two-electron quantities</a>
<li><a href="#org83b72e8">1.1.1. Declare Temporary variables</a></li>
<li><a href="#orgc55fb03">1.1.2. Obtain the name of the TREXIO file from the command line, and open it for reading</a></li>
<li><a href="#org25d29a2">1.1.3. Read the nuclear repulsion energy</a></li>
<li><a href="#orgd1e960f">1.1.4. Read the number of molecular orbitals</a></li>
<li><a href="#org4387b3c">1.1.5. Allocate memory</a></li>
<li><a href="#org3dd831d">1.1.6. Read one-electron quantities</a></li>
<li><a href="#orgec6f343">1.1.7. Read two-electron quantities</a>
<ul>
<li><a href="#org8dd3990">1.1.7.1. Electron repulsion integrals</a></li>
<li><a href="#org9e8bf67">1.1.7.2. Reduced density matrix</a></li>
<li><a href="#org726147d">1.1.7.1. Electron repulsion integrals</a></li>
<li><a href="#org2d43cde">1.1.7.2. Reduced density matrix</a></li>
</ul>
</li>
<li><a href="#org15b912c">1.1.8. Compute the energy</a></li>
<li><a href="#org17b2769">1.1.9. Terminate</a></li>
<li><a href="#org128ac20">1.1.8. Compute the energy</a></li>
<li><a href="#org4076dda">1.1.9. Terminate</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#org8fb944d">2. Reading determinants</a>
<li><a href="#org1644ba6">2. Reading determinants</a>
<ul>
<li><a href="#org6aded94">2.1. Fortran</a></li>
<li><a href="#org21c2806">2.1. Fortran</a></li>
</ul>
</li>
</ul>
@ -365,12 +365,12 @@ for the JavaScript code in this tag.
</div>
<div id="outline-container-org054272b" class="outline-2">
<h2 id="org054272b"><span class="section-number-2">1</span> Accessing sparse quantities (integrals)</h2>
<div id="outline-container-org4b4a533" class="outline-2">
<h2 id="org4b4a533"><span class="section-number-2">1</span> Accessing sparse quantities (integrals)</h2>
<div class="outline-text-2" id="text-1">
</div>
<div id="outline-container-org74d188d" class="outline-3">
<h3 id="org74d188d"><span class="section-number-3">1.1</span> Fortran</h3>
<div id="outline-container-org87e249e" class="outline-3">
<h3 id="org87e249e"><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>
@ -416,8 +416,8 @@ One needs to read from the TREXIO file:
</div>
</div>
<div id="outline-container-orgc6a813e" class="outline-4">
<h4 id="orgc6a813e"><span class="section-number-4">1.1.1</span> Declare Temporary variables</h4>
<div id="outline-container-org83b72e8" class="outline-4">
<h4 id="org83b72e8"><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>
@ -432,8 +432,8 @@ One needs to read from the TREXIO file:
</div>
</div>
<div id="outline-container-orgd282ca6" class="outline-4">
<h4 id="orgd282ca6"><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-orgc55fb03" class="outline-4">
<h4 id="orgc55fb03"><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)
@ -449,8 +449,8 @@ f = trexio_open (filename, <span style="color: #8b2252;">'r'</span>, TREXIO_HDF5
</div>
</div>
<div id="outline-container-orgf87e4b5" class="outline-4">
<h4 id="orgf87e4b5"><span class="section-number-4">1.1.3</span> Read the nuclear repulsion energy</h4>
<div id="outline-container-org25d29a2" class="outline-4">
<h4 id="org25d29a2"><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)
@ -464,8 +464,8 @@ f = trexio_open (filename, <span style="color: #8b2252;">'r'</span>, TREXIO_HDF5
</div>
</div>
<div id="outline-container-orge639317" class="outline-4">
<h4 id="orge639317"><span class="section-number-4">1.1.4</span> Read the number of molecular orbitals</h4>
<div id="outline-container-orgd1e960f" class="outline-4">
<h4 id="orgd1e960f"><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)
@ -479,8 +479,8 @@ f = trexio_open (filename, <span style="color: #8b2252;">'r'</span>, TREXIO_HDF5
</div>
</div>
<div id="outline-container-org7f47ec4" class="outline-4">
<h4 id="org7f47ec4"><span class="section-number-4">1.1.5</span> Allocate memory</h4>
<div id="outline-container-org4387b3c" class="outline-4">
<h4 id="org4387b3c"><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) )
@ -492,8 +492,8 @@ W(:,:,:,:) = 0.d0
</div>
</div>
<div id="outline-container-org6d8eff1" class="outline-4">
<h4 id="org6d8eff1"><span class="section-number-4">1.1.6</span> Read one-electron quantities</h4>
<div id="outline-container-org3dd831d" class="outline-4">
<h4 id="org3dd831d"><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)
@ -525,8 +525,8 @@ rc = trexio_read_rdm_1e(f, D)
</div>
</div>
<div id="outline-container-orgf296722" class="outline-4">
<h4 id="orgf296722"><span class="section-number-4">1.1.7</span> Read two-electron quantities</h4>
<div id="outline-container-orgec6f343" class="outline-4">
<h4 id="orgec6f343"><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
@ -542,8 +542,8 @@ to be protected in the critical section when modified.
</p>
</div>
<div id="outline-container-org8dd3990" class="outline-5">
<h5 id="org8dd3990"><span class="section-number-5">1.1.7.1</span> Electron repulsion integrals</h5>
<div id="outline-container-org726147d" class="outline-5">
<h5 id="org726147d"><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)
@ -592,8 +592,8 @@ icount = BUFSIZE
</div>
</div>
<div id="outline-container-org9e8bf67" class="outline-5">
<h5 id="org9e8bf67"><span class="section-number-5">1.1.7.2</span> Reduced density matrix</h5>
<div id="outline-container-org2d43cde" class="outline-5">
<h5 id="org2d43cde"><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)
@ -637,8 +637,8 @@ icount = bufsize
</div>
</div>
<div id="outline-container-org15b912c" class="outline-4">
<h4 id="org15b912c"><span class="section-number-4">1.1.8</span> Compute the energy</h4>
<div id="outline-container-org128ac20" class="outline-4">
<h4 id="org128ac20"><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
@ -684,8 +684,8 @@ E = E + E_nn
</div>
</div>
<div id="outline-container-org17b2769" class="outline-4">
<h4 id="org17b2769"><span class="section-number-4">1.1.9</span> Terminate</h4>
<div id="outline-container-org4076dda" class="outline-4">
<h4 id="org4076dda"><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 )
@ -699,12 +699,12 @@ E = E + E_nn
</div>
<div id="outline-container-org8fb944d" class="outline-2">
<h2 id="org8fb944d"><span class="section-number-2">2</span> Reading determinants</h2>
<div id="outline-container-org1644ba6" class="outline-2">
<h2 id="org1644ba6"><span class="section-number-2">2</span> Reading determinants</h2>
<div class="outline-text-2" id="text-2">
</div>
<div id="outline-container-org6aded94" class="outline-3">
<h3 id="org6aded94"><span class="section-number-3">2.1</span> Fortran</h3>
<div id="outline-container-org21c2806" class="outline-3">
<h3 id="org21c2806"><span class="section-number-3">2.1</span> Fortran</h3>
<div class="outline-text-3" id="text-2-1">
<div class="org-src-container">
<pre class="src src-f90"><span style="color: #a020f0;">program</span> <span style="color: #0000ff;">test</span>
@ -783,7 +783,7 @@ end
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2022-07-01 Fri 17:00</p>
<p class="date">Created: 2022-07-04 Mon 11:02</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-07-01 Fri 17:00 -->
<!-- 2022-07-04 Mon 11:02 -->
<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-07-01 Fri 17:00</p>
<p class="date">Created: 2022-07-04 Mon 11:02</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-07-01 Fri 17:00 -->
<!-- 2022-07-04 Mon 11:02 -->
<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,24 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org2d4c4ac">1. Template for HDF5 definitions</a></li>
<li><a href="#org049f1c6">2. Template for HDF5 structures</a></li>
<li><a href="#org4bb5622">3. Template for HDF5 init/deinit</a></li>
<li><a href="#org55f383c">4. Template for HDF5 has/read/write a numerical attribute</a></li>
<li><a href="#org848e098">5. Template for HDF5 has/read/write a dataset of numerical data</a></li>
<li><a href="#orgbe96f11">6. Template for HDF5 has/read/write a dataset of sparse data</a></li>
<li><a href="#org655bf37">7. Template for HDF5 has/read/write a dataset of strings</a></li>
<li><a href="#org1c47e07">8. Template for HDF5 has/read/write a string attribute</a></li>
<li><a href="#org99ed368">9. Template for HDF5 delete a group (UNSAFE mode)</a></li>
<li><a href="#org370d80f">10. Source code for the determinant part</a></li>
<li><a href="#org1816027">11. Helper functions</a></li>
<li><a href="#org125acfe">1. Template for HDF5 definitions</a></li>
<li><a href="#org3ef779f">2. Template for HDF5 structures</a></li>
<li><a href="#orgc8f9e7f">3. Template for HDF5 init/deinit</a></li>
<li><a href="#org5ab79d8">4. Template for HDF5 has a group</a></li>
<li><a href="#orged3a241">5. Template for HDF5 has/read/write a numerical attribute</a></li>
<li><a href="#orgcb66a6d">6. Template for HDF5 has/read/write a dataset of numerical data</a></li>
<li><a href="#org206b005">7. Template for HDF5 has/read/write a dataset of sparse data</a></li>
<li><a href="#orged616ab">8. Template for HDF5 has/read/write a dataset of strings</a></li>
<li><a href="#orge995b51">9. Template for HDF5 has/read/write a string attribute</a></li>
<li><a href="#org7b2bf0b">10. Template for HDF5 delete a group (UNSAFE mode)</a></li>
<li><a href="#org96a336c">11. Source code for the determinant part</a></li>
<li><a href="#orgdedee23">12. Helper functions</a></li>
</ul>
</div>
</div>
<div id="outline-container-org2d4c4ac" class="outline-2">
<h2 id="org2d4c4ac"><span class="section-number-2">1</span> Template for HDF5 definitions</h2>
<div id="outline-container-org125acfe" class="outline-2">
<h2 id="org125acfe"><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,8 +340,8 @@ for the JavaScript code in this tag.
</div>
</div>
<div id="outline-container-org049f1c6" class="outline-2">
<h2 id="org049f1c6"><span class="section-number-2">2</span> Template for HDF5 structures</h2>
<div id="outline-container-org3ef779f" class="outline-2">
<h2 id="org3ef779f"><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
@ -360,8 +361,8 @@ corresponding types for all back ends can be safely casted to
</div>
</div>
<div id="outline-container-org4bb5622" class="outline-2">
<h2 id="org4bb5622"><span class="section-number-2">3</span> Template for HDF5 init/deinit</h2>
<div id="outline-container-orgc8f9e7f" class="outline-2">
<h2 id="orgc8f9e7f"><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>
@ -466,11 +467,42 @@ corresponding types for all back ends can be safely casted to
</div>
</div>
<div id="outline-container-org55f383c" class="outline-2">
<h2 id="org55f383c"><span class="section-number-2">4</span> Template for HDF5 has/read/write a numerical attribute</h2>
<div id="outline-container-org5ab79d8" class="outline-2">
<h2 id="org5ab79d8"><span class="section-number-2">4</span> Template for HDF5 has a group</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>
<span style="color: #0000ff;">trexio_hdf5_has_$group$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>)
{
<span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1;
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">trexio_hdf5_t</span>* <span style="color: #a0522d;">f</span> = (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">trexio_hdf5_t</span>*) file;
<span style="color: #a020f0;">struct</span> <span style="color: #228b22;">H5G_info_t</span> <span style="color: #a0522d;">group_info</span>;
/* <span style="color: #b22222;">H5Gget_info return info about the HDF5 group as a group_info struct </span>*/
<span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status</span> = H5Gget_info(f-&gt;$group$_group, &amp;group_info);
<span style="color: #a020f0;">if</span> (status &lt; 0) <span style="color: #a020f0;">return</span> TREXIO_FAILURE;
/* <span style="color: #b22222;">If nlinks==0 --&gt; the group is empty, i.e. non-existent </span>*/
<span style="color: #a020f0;">if</span> (group_info.nlinks == (<span style="color: #228b22;">hsize_t</span>) 0) {
<span style="color: #a020f0;">return</span> TREXIO_HAS_NOT;
} <span style="color: #a020f0;">else</span> {
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
}
}
</pre>
</div>
</div>
</div>
<div id="outline-container-orged3a241" class="outline-2">
<h2 id="orged3a241"><span class="section-number-2">5</span> Template for HDF5 has/read/write a numerical attribute</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>
<span style="color: #0000ff;">trexio_hdf5_read_$group_num$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, $group_num_dtype_double$* <span style="color: #a020f0;">const</span> num)
{
@ -571,9 +603,9 @@ corresponding types for all back ends can be safely casted to
</div>
</div>
<div id="outline-container-org848e098" class="outline-2">
<h2 id="org848e098"><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 id="outline-container-orgcb66a6d" class="outline-2">
<h2 id="orgcb66a6d"><span class="section-number-2">6</span> Template for HDF5 has/read/write a dataset of numerical data</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>
<span style="color: #0000ff;">trexio_hdf5_read_$group_dset$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, $group_dset_dtype$* <span style="color: #a020f0;">const</span> $group_dset$, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">uint32_t</span> <span style="color: #a0522d;">rank</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">uint64_t</span>* <span style="color: #a0522d;">dims</span>)
@ -706,9 +738,9 @@ corresponding types for all back ends can be safely casted to
</div>
</div>
<div id="outline-container-orgbe96f11" class="outline-2">
<h2 id="orgbe96f11"><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">
<div id="outline-container-org206b005" class="outline-2">
<h2 id="org206b005"><span class="section-number-2">7</span> Template for HDF5 has/read/write a dataset of sparse data</h2>
<div class="outline-text-2" id="text-7">
<p>
Sparse data is stored using extensible datasets of HDF5. Extensibility is required
due to the fact that the sparse data will be written in chunks of user-defined size.
@ -910,9 +942,9 @@ due to the fact that the sparse data will be written in chunks of user-defined s
</div>
</div>
<div id="outline-container-org655bf37" class="outline-2">
<h2 id="org655bf37"><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 id="outline-container-orged616ab" class="outline-2">
<h2 id="orged616ab"><span class="section-number-2">8</span> Template for HDF5 has/read/write a dataset of strings</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>
<span style="color: #0000ff;">trexio_hdf5_read_$group_dset$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, <span style="color: #228b22;">char</span>* <span style="color: #a020f0;">const</span> $group_dset$, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">uint32_t</span> <span style="color: #a0522d;">rank</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">uint64_t</span>* <span style="color: #a0522d;">dims</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">uint32_t</span> <span style="color: #a0522d;">max_str_len</span>)
@ -1109,9 +1141,9 @@ due to the fact that the sparse data will be written in chunks of user-defined s
</div>
</div>
<div id="outline-container-org1c47e07" class="outline-2">
<h2 id="org1c47e07"><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 id="outline-container-orge995b51" class="outline-2">
<h2 id="orge995b51"><span class="section-number-2">9</span> Template for HDF5 has/read/write a string attribute</h2>
<div class="outline-text-2" id="text-9">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_hdf5_read_$group_str$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, <span style="color: #228b22;">char</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">str</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">uint32_t</span> <span style="color: #a0522d;">max_str_len</span>)
@ -1237,9 +1269,9 @@ due to the fact that the sparse data will be written in chunks of user-defined s
</div>
</div>
</div>
<div id="outline-container-org99ed368" class="outline-2">
<h2 id="org99ed368"><span class="section-number-2">9</span> Template for HDF5 delete a group (UNSAFE mode)</h2>
<div class="outline-text-2" id="text-9">
<div id="outline-container-org7b2bf0b" class="outline-2">
<h2 id="org7b2bf0b"><span class="section-number-2">10</span> Template for HDF5 delete a group (UNSAFE mode)</h2>
<div class="outline-text-2" id="text-10">
<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
and the associated memory was not necessarily freed (see <a href="https://stackoverflow.com/questions/1124994/removing-data-from-a-hdf5-file">this StackOverflow discussion</a> for example).
@ -1278,9 +1310,9 @@ Thus, any corrupted/lost file space will remain in the first file. The use of <c
</div>
</div>
<div id="outline-container-org370d80f" class="outline-2">
<h2 id="org370d80f"><span class="section-number-2">10</span> Source code for the determinant part</h2>
<div class="outline-text-2" id="text-10">
<div id="outline-container-org96a336c" class="outline-2">
<h2 id="org96a336c"><span class="section-number-2">11</span> Source code for the determinant part</h2>
<div class="outline-text-2" id="text-11">
<p>
Each array is stored in a separate HDF5 dataset due to the fact that determinant I/O has to be decoupled.
Chunks are used to read/write the data to prevent memory overflow. Chunks have a given <code>int64_t dims[0]*dims[1]</code>.
@ -1532,9 +1564,9 @@ Size specifies the number of data items (e.g. determinants) to process.
</div>
</div>
<div id="outline-container-org1816027" class="outline-2">
<h2 id="org1816027"><span class="section-number-2">11</span> Helper functions</h2>
<div class="outline-text-2" id="text-11">
<div id="outline-container-orgdedee23" class="outline-2">
<h2 id="orgdedee23"><span class="section-number-2">12</span> Helper functions</h2>
<div class="outline-text-2" id="text-12">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_hdf5_create_write_dset_sparse</span> (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">group_id</span>,
@ -1796,7 +1828,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-07-01 Fri 17:00</p>
<p class="date">Created: 2022-07-04 Mon 11:02</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-07-01 Fri 17:00 -->
<!-- 2022-07-04 Mon 11:02 -->
<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,21 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orgee3c736">1. Template for group-related structures in text back end</a></li>
<li><a href="#orge8e3db4">2. Template for general structure in text back end</a></li>
<li><a href="#orgb011dcb">3. Initialize function (constant part)</a></li>
<li><a href="#org5aba818">4. Deinitialize function (templated part)</a></li>
<li><a href="#org7ae56d8">5. Template for text read a group</a></li>
<li><a href="#orgd961d2d">6. Template for text flush a group</a></li>
<li><a href="#org4c394a9">7. Template for text free memory</a></li>
<li><a href="#orgcba114b">8. Template for has/read/write a numerical attribute</a></li>
<li><a href="#org6dfd8a1">9. Template for has/read/write a dataset of numerical data</a></li>
<li><a href="#orgd8bf893">10. Template for has/read/write a dataset of strings</a></li>
<li><a href="#org48500c4">11. Template for has/read/write a string attribute</a></li>
<li><a href="#org5208c3b">12. Template for has/read/write the dataset of sparse data</a></li>
<li><a href="#orgc19a4d2">13. Template for text delete a group (UNSAFE mode)</a></li>
<li><a href="#org015831b">14. Source code for the determinant part</a></li>
<li><a href="#orgf2ce4cc">1. Template for group-related structures in text back end</a></li>
<li><a href="#org25c03f1">2. Template for general structure in text back end</a></li>
<li><a href="#org0292440">3. Initialize function (constant part)</a></li>
<li><a href="#orgb1100fe">4. Deinitialize function (templated part)</a></li>
<li><a href="#org8b60a56">5. Template for text read a group</a></li>
<li><a href="#org0a8aafc">6. Template for text has a group</a></li>
<li><a href="#orgd2b576f">7. Template for text flush a group</a></li>
<li><a href="#org9320809">8. Template for text free memory</a></li>
<li><a href="#orgb3a23ed">9. Template for has/read/write a numerical attribute</a></li>
<li><a href="#orgacfcb8f">10. Template for has/read/write a dataset of numerical data</a></li>
<li><a href="#orgd9d5725">11. Template for has/read/write a dataset of strings</a></li>
<li><a href="#org33110fe">12. Template for has/read/write a string attribute</a></li>
<li><a href="#orga1d2463">13. Template for has/read/write the dataset of sparse data</a></li>
<li><a href="#org7e727bc">14. Template for text delete a group (UNSAFE mode)</a></li>
<li><a href="#org4654432">15. Source code for the determinant part</a></li>
</ul>
</div>
</div>
@ -346,8 +347,8 @@ directory.
The file is written when closed, or when the flush function is called.
</p>
<div id="outline-container-orgee3c736" class="outline-2">
<h2 id="orgee3c736"><span class="section-number-2">1</span> Template for group-related structures in text back end</h2>
<div id="outline-container-orgf2ce4cc" class="outline-2">
<h2 id="orgf2ce4cc"><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,8 +367,8 @@ The file is written when closed, or when the flush function is called.
</div>
</div>
<div id="outline-container-orge8e3db4" class="outline-2">
<h2 id="orge8e3db4"><span class="section-number-2">2</span> Template for general structure in text back end</h2>
<div id="outline-container-org25c03f1" class="outline-2">
<h2 id="org25c03f1"><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
@ -387,9 +388,25 @@ corresponding types for all back ends can be safely casted to
</div>
</div>
<div id="outline-container-orgb011dcb" class="outline-2">
<h2 id="orgb011dcb"><span class="section-number-2">3</span> Initialize function (constant part)</h2>
<div id="outline-container-org0292440" class="outline-2">
<h2 id="org0292440"><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;">bool</span>
<span style="color: #0000ff;">trexio_text_file_exists</span> (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">char</span>* <span style="color: #a0522d;">file_name</span>)
{
/* <span style="color: #b22222;">Check if the file with "file_name" exists </span>*/
<span style="color: #a020f0;">struct</span> <span style="color: #228b22;">stat</span> <span style="color: #a0522d;">st</span>;
<span style="color: #228b22;">int</span> <span style="color: #a0522d;">rc</span> = stat(file_name, &amp;st);
<span style="color: #228b22;">bool</span> <span style="color: #a0522d;">file_exists</span> = rc == 0;
<span style="color: #a020f0;">return</span> file_exists;
}
</pre>
</div>
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_text_inquire</span> (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">char</span>* <span style="color: #a0522d;">file_name</span>)
@ -531,8 +548,8 @@ corresponding types for all back ends can be safely casted to
</div>
</div>
<div id="outline-container-org5aba818" class="outline-2">
<h2 id="org5aba818"><span class="section-number-2">4</span> Deinitialize function (templated part)</h2>
<div id="outline-container-orgb1100fe" class="outline-2">
<h2 id="orgb1100fe"><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>
@ -554,8 +571,8 @@ corresponding types for all back ends can be safely casted to
</div>
</div>
<div id="outline-container-org7ae56d8" class="outline-2">
<h2 id="org7ae56d8"><span class="section-number-2">5</span> Template for text read a group</h2>
<div id="outline-container-org8b60a56" class="outline-2">
<h2 id="org8b60a56"><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*
@ -779,11 +796,52 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
</div>
</div>
<div id="outline-container-orgd961d2d" class="outline-2">
<h2 id="orgd961d2d"><span class="section-number-2">6</span> Template for text flush a group</h2>
<div id="outline-container-org0a8aafc" class="outline-2">
<h2 id="org0a8aafc"><span class="section-number-2">6</span> Template for text has 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>
<span style="color: #0000ff;">trexio_text_has_$group$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>)
{
<span style="color: #a020f0;">if</span> (file == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_1;
/* <span style="color: #b22222;">Flush the group to make sure the group.txt file is created </span>*/
<span style="color: #a020f0;">if</span> (file-&gt;mode != <span style="color: #8b2252;">'r'</span>) {
<span style="color: #228b22;">trexio_exit_code</span> <span style="color: #a0522d;">rc</span> = trexio_text_flush_$group$((<span style="color: #228b22;">trexio_text_t</span>*) file);
<span style="color: #a020f0;">if</span> (rc != TREXIO_SUCCESS) <span style="color: #a020f0;">return</span> TREXIO_FAILURE;
}
/* <span style="color: #b22222;">Build the file name </span>*/
<span style="color: #228b22;">char</span> $group$_full_path[TREXIO_MAX_FILENAME_LENGTH];
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">char</span>* $group$_file_name = <span style="color: #8b2252;">"/$group$.txt"</span>;
strncpy ($group$_full_path, file-&gt;file_name, TREXIO_MAX_FILENAME_LENGTH);
strncat ($group$_full_path, $group$_file_name,
TREXIO_MAX_FILENAME_LENGTH-strlen($group$_file_name));
<span style="color: #a020f0;">if</span> ($group$_full_path[TREXIO_MAX_FILENAME_LENGTH-1] != <span style="color: #8b2252;">'\0'</span>) <span style="color: #a020f0;">return</span> TREXIO_FAILURE;
<span style="color: #228b22;">bool</span> <span style="color: #a0522d;">file_exists</span>;
file_exists = trexio_text_file_exists($group$_full_path);
<span style="color: #a020f0;">if</span> (file_exists) {
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
} <span style="color: #a020f0;">else</span> {
<span style="color: #a020f0;">return</span> TREXIO_HAS_NOT;
}
}
</pre>
</div>
</div>
</div>
<div id="outline-container-orgd2b576f" class="outline-2">
<h2 id="orgd2b576f"><span class="section-number-2">7</span> Template for text flush a group</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>
<span style="color: #0000ff;">trexio_text_flush_$group$</span> (<span style="color: #228b22;">trexio_text_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>)
{
@ -844,9 +902,9 @@ trexio_text_read_$group$ (<span style="color: #228b22;">trexio_text_t</span>* <s
</div>
</div>
<div id="outline-container-org4c394a9" class="outline-2">
<h2 id="org4c394a9"><span class="section-number-2">7</span> Template for text free memory</h2>
<div class="outline-text-2" id="text-7">
<div id="outline-container-org9320809" class="outline-2">
<h2 id="org9320809"><span class="section-number-2">8</span> Template for text free memory</h2>
<div class="outline-text-2" id="text-8">
<p>
Memory is allocated when reading. The following function frees memory.
</p>
@ -914,9 +972,9 @@ This function is called upon the non-successful exit from the <code>trexio_text_
</div>
</div>
<div id="outline-container-orgcba114b" class="outline-2">
<h2 id="orgcba114b"><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 id="outline-container-orgb3a23ed" class="outline-2">
<h2 id="orgb3a23ed"><span class="section-number-2">9</span> Template for has/read/write a numerical attribute</h2>
<div class="outline-text-2" id="text-9">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_text_read_$group_num$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, $group_num_dtype_double$* <span style="color: #a020f0;">const</span> num)
@ -978,9 +1036,9 @@ This function is called upon the non-successful exit from the <code>trexio_text_
</div>
</div>
<div id="outline-container-org6dfd8a1" class="outline-2">
<h2 id="org6dfd8a1"><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">
<div id="outline-container-orgacfcb8f" class="outline-2">
<h2 id="orgacfcb8f"><span class="section-number-2">10</span> Template for has/read/write a dataset of numerical data</h2>
<div class="outline-text-2" id="text-10">
<p>
The <code>group_dset</code> array is assumed allocated with the appropriate size.
</p>
@ -1075,9 +1133,9 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div>
</div>
</div>
<div id="outline-container-orgd8bf893" class="outline-2">
<h2 id="orgd8bf893"><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">
<div id="outline-container-orgd9d5725" class="outline-2">
<h2 id="orgd9d5725"><span class="section-number-2">11</span> Template for has/read/write a dataset of strings</h2>
<div class="outline-text-2" id="text-11">
<p>
The <code>group_dset</code> array is assumed allocated with the appropriate size.
</p>
@ -1177,9 +1235,9 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div>
</div>
</div>
<div id="outline-container-org48500c4" class="outline-2">
<h2 id="org48500c4"><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 id="outline-container-org33110fe" class="outline-2">
<h2 id="org33110fe"><span class="section-number-2">12</span> Template for has/read/write a string attribute</h2>
<div class="outline-text-2" id="text-12">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_text_read_$group_str$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>, <span style="color: #228b22;">char</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">str</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">uint32_t</span> <span style="color: #a0522d;">max_str_len</span>)
@ -1252,9 +1310,9 @@ The <code>group_dset</code> array is assumed allocated with the appropriate size
</div>
</div>
</div>
<div id="outline-container-org5208c3b" class="outline-2">
<h2 id="org5208c3b"><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">
<div id="outline-container-orga1d2463" class="outline-2">
<h2 id="orga1d2463"><span class="section-number-2">13</span> Template for has/read/write the dataset of sparse data</h2>
<div class="outline-text-2" id="text-13">
<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
from conventional write/read/flush behaviour of the TEXT back end. Chunks are used to read/write sparse data
@ -1355,6 +1413,23 @@ User provides indices and values of the sparse array as two separate variables.
rc = fclose(f_wSize);
<span style="color: #a020f0;">if</span> (rc != 0) <span style="color: #a020f0;">return</span> TREXIO_FILE_ERROR;
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">char</span> $group$_file_name[256] = <span style="color: #8b2252;">"/$group$.txt"</span>;
memset (file_full_path, 0, TREXIO_MAX_FILENAME_LENGTH);
/* <span style="color: #b22222;">Copy directory name in file_full_path </span>*/
strncpy (file_full_path, file-&gt;file_name, TREXIO_MAX_FILENAME_LENGTH);
/* <span style="color: #b22222;">Append name of the file with sparse data </span>*/
strncat (file_full_path, $group$_file_name,
TREXIO_MAX_FILENAME_LENGTH-strlen($group$_file_name));
<span style="color: #228b22;">bool</span> <span style="color: #a0522d;">file_exists</span> = trexio_text_file_exists(file_full_path);
/* <span style="color: #b22222;">Create an empty file for the trexio_text_has_group to work </span>*/
<span style="color: #a020f0;">if</span> (!file_exists) {
<span style="color: #228b22;">FILE</span> *<span style="color: #a0522d;">fp</span> = fopen(file_full_path, <span style="color: #8b2252;">"ab+"</span>);
fclose(fp);
}
/* <span style="color: #b22222;">Exit upon success </span>*/
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
}
@ -1526,9 +1601,9 @@ User provides indices and values of the sparse array as two separate variables.
</div>
</div>
<div id="outline-container-orgc19a4d2" class="outline-2">
<h2 id="orgc19a4d2"><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 id="outline-container-org7e727bc" class="outline-2">
<h2 id="org7e727bc"><span class="section-number-2">14</span> Template for text delete a group (UNSAFE mode)</h2>
<div class="outline-text-2" id="text-14">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_text_delete_$group$</span> (<span style="color: #228b22;">trexio_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">file</span>)
@ -1555,9 +1630,9 @@ User provides indices and values of the sparse array as two separate variables.
</div>
</div>
<div id="outline-container-org015831b" class="outline-2">
<h2 id="org015831b"><span class="section-number-2">14</span> Source code for the determinant part</h2>
<div class="outline-text-2" id="text-14">
<div id="outline-container-org4654432" class="outline-2">
<h2 id="org4654432"><span class="section-number-2">15</span> Source code for the determinant part</h2>
<div class="outline-text-2" id="text-15">
<p>
Each array is stored in a separate <code>.txt</code> file due to the fact that determinant I/O has to be decoupled
from conventional write/read/flush behaviour of the TEXT back end. Chunks are used to read/write the data
@ -1825,6 +1900,24 @@ Size specifies the number of data items, e.g. determinants.
rc = fclose(f);
<span style="color: #a020f0;">if</span> (rc != 0) <span style="color: #a020f0;">return</span> TREXIO_FILE_ERROR;
/* <span style="color: #b22222;">Additional part for the trexio_text_has_group to work </span>*/
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">char</span> <span style="color: #a0522d;">det_file_name</span>[256] = <span style="color: #8b2252;">"/determinant.txt"</span>;
memset (file_full_path, 0, TREXIO_MAX_FILENAME_LENGTH);
/* <span style="color: #b22222;">Copy directory name in file_full_path </span>*/
strncpy (file_full_path, file-&gt;file_name, TREXIO_MAX_FILENAME_LENGTH);
/* <span style="color: #b22222;">Append name of the file with sparse data </span>*/
strncat (file_full_path, det_file_name,
TREXIO_MAX_FILENAME_LENGTH-strlen(det_file_name));
<span style="color: #228b22;">bool</span> <span style="color: #a0522d;">file_exists</span> = trexio_text_file_exists(file_full_path);
/* <span style="color: #b22222;">Create an empty file for the trexio_text_has_group to work </span>*/
<span style="color: #a020f0;">if</span> (!file_exists) {
<span style="color: #228b22;">FILE</span> *<span style="color: #a0522d;">fp</span> = fopen(file_full_path, <span style="color: #8b2252;">"ab+"</span>);
fclose(fp);
}
/* <span style="color: #b22222;">Exit upon success </span>*/
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
}
@ -1894,6 +1987,24 @@ Size specifies the number of data items, e.g. determinants.
rc = fclose(f_wSize);
<span style="color: #a020f0;">if</span> (rc != 0) <span style="color: #a020f0;">return</span> TREXIO_FILE_ERROR;
/* <span style="color: #b22222;">Additional part for the trexio_text_has_group to work </span>*/
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">char</span> <span style="color: #a0522d;">det_file_name</span>[256] = <span style="color: #8b2252;">"/determinant.txt"</span>;
memset (file_full_path, 0, TREXIO_MAX_FILENAME_LENGTH);
/* <span style="color: #b22222;">Copy directory name in file_full_path </span>*/
strncpy (file_full_path, file-&gt;file_name, TREXIO_MAX_FILENAME_LENGTH);
/* <span style="color: #b22222;">Append name of the file with sparse data </span>*/
strncat (file_full_path, det_file_name,
TREXIO_MAX_FILENAME_LENGTH-strlen(det_file_name));
<span style="color: #228b22;">bool</span> <span style="color: #a0522d;">file_exists</span> = trexio_text_file_exists(file_full_path);
/* <span style="color: #b22222;">Create an empty file for the trexio_text_has_group to work </span>*/
<span style="color: #a020f0;">if</span> (!file_exists) {
<span style="color: #228b22;">FILE</span> *<span style="color: #a0522d;">fp</span> = fopen(file_full_path, <span style="color: #8b2252;">"ab+"</span>);
fclose(fp);
}
/* <span style="color: #b22222;">Exit upon success </span>*/
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
}
@ -1960,7 +2071,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-07-01 Fri 17:00</p>
<p class="date">Created: 2022-07-04 Mon 11:02</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>

150
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-07-01 Fri 17:00 -->
<!-- 2022-07-04 Mon 11:02 -->
<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,37 +333,37 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org87fd8b4">1. Metadata (metadata group)</a></li>
<li><a href="#orgee117f4">2. Electron (electron group)</a></li>
<li><a href="#org0f1b9cd">3. Nucleus (nucleus group)</a></li>
<li><a href="#orgcc5b4e5">4. Effective core potentials (ecp group)</a>
<li><a href="#org68e2569">1. Metadata (metadata group)</a></li>
<li><a href="#orgeef68e6">2. Electron (electron group)</a></li>
<li><a href="#org08ed2cf">3. Nucleus (nucleus group)</a></li>
<li><a href="#orge544d7d">4. Effective core potentials (ecp group)</a>
<ul>
<li><a href="#org448c314">4.1. Example</a></li>
<li><a href="#org8d12efe">4.1. Example</a></li>
</ul>
</li>
<li><a href="#org495a768">5. Basis set (basis group)</a>
<li><a href="#org0e0128e">5. Basis set (basis group)</a>
<ul>
<li><a href="#orgf1d5188">5.1. Example</a></li>
<li><a href="#orgc12628f">5.1. Example</a></li>
</ul>
</li>
<li><a href="#org391e743">6. Atomic orbitals (ao group)</a>
<li><a href="#org5052d1b">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="#org7f6ada6">7. Molecular orbitals (mo group)</a>
<li><a href="#org29d44b2">7. Molecular orbitals (mo group)</a>
<ul>
<li><a href="#org932ac48">7.1. One-electron integrals (<code>mo_1e_int</code> group)</a></li>
<li><a href="#org62075e9">7.2. Two-electron integrals (<code>mo_2e_int</code> group)</a></li>
<li><a href="#orgf8bd186">7.1. One-electron integrals (<code>mo_1e_int</code> group)</a></li>
<li><a href="#org0dd0d67">7.2. Two-electron integrals (<code>mo_2e_int</code> group)</a></li>
</ul>
</li>
<li><a href="#org971f5b7">8. Slater determinants (determinant group)</a></li>
<li><a href="#org685658b">9. Excited states (state group)</a></li>
<li><a href="#org95cdcba">10. Reduced density matrices (rdm group)</a></li>
<li><a href="#org8ba41e0">11. Cell (cell group)</a></li>
<li><a href="#orgde40f5d">12. Periodic boundary calculations (pbc group)</a></li>
<li><a href="#org0c9a7d5">13. Quantum Monte Carlo data (qmc group)</a></li>
<li><a href="#org0170e09">8. Slater determinants (determinant group)</a></li>
<li><a href="#orgc3c7724">9. Excited states (state group)</a></li>
<li><a href="#org012e2b4">10. Reduced density matrices (rdm group)</a></li>
<li><a href="#org3b417eb">11. Cell (cell group)</a></li>
<li><a href="#orge912a48">12. Periodic boundary calculations (pbc group)</a></li>
<li><a href="#org5f81947">13. Quantum Monte Carlo data (qmc group)</a></li>
</ul>
</div>
</div>
@ -417,8 +417,8 @@ For determinants, the <code>special</code> attribute is present in the type. Thi
means that the source code is not produced by the generator, but hand-written.
</p>
<div id="outline-container-org87fd8b4" class="outline-2">
<h2 id="org87fd8b4"><span class="section-number-2">1</span> Metadata (metadata group)</h2>
<div id="outline-container-org68e2569" class="outline-2">
<h2 id="org68e2569"><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
@ -428,7 +428,7 @@ which have participated to the creation of the file, a list of
authors of the file, and a textual description.
</p>
<table id="org0b10d6c" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="orgce7d227" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -509,15 +509,15 @@ then the <code>unsafe</code> attribute value can be manually overwritten (in uns
</div>
</div>
<div id="outline-container-orgee117f4" class="outline-2">
<h2 id="orgee117f4"><span class="section-number-2">2</span> Electron (electron group)</h2>
<div id="outline-container-orgeef68e6" class="outline-2">
<h2 id="orgeef68e6"><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="org0a14137" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="orgc95d8eb" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -563,15 +563,15 @@ the number of &uarr; and &darr; electrons is fixed.
</div>
</div>
<div id="outline-container-org0f1b9cd" class="outline-2">
<h2 id="org0f1b9cd"><span class="section-number-2">3</span> Nucleus (nucleus group)</h2>
<div id="outline-container-org08ed2cf" class="outline-2">
<h2 id="org08ed2cf"><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="org56cd3f3" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org514665b" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -638,8 +638,8 @@ given in Cartesian \((x,y,z)\) format.
</div>
</div>
<div id="outline-container-orgcc5b4e5" class="outline-2">
<h2 id="orgcc5b4e5"><span class="section-number-2">4</span> Effective core potentials (ecp group)</h2>
<div id="outline-container-orge544d7d" class="outline-2">
<h2 id="orge544d7d"><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
@ -672,7 +672,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="org39b861a" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="orgdc30da0" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -774,8 +774,8 @@ If you encounter the aforementioned issue, please report it to our <a href="http
</p>
</div>
<div id="outline-container-org448c314" class="outline-3">
<h3 id="org448c314"><span class="section-number-3">4.1</span> Example</h3>
<div id="outline-container-org8d12efe" class="outline-3">
<h3 id="org8d12efe"><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
@ -838,8 +838,8 @@ power = [
</div>
</div>
<div id="outline-container-org495a768" class="outline-2">
<h2 id="org495a768"><span class="section-number-2">5</span> Basis set (basis group)</h2>
<div id="outline-container-org0e0128e" class="outline-2">
<h2 id="org0e0128e"><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
@ -892,7 +892,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="org331baa2" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="orgf14827e" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -986,8 +986,8 @@ All the basis set parameters are stored in one-dimensional arrays:
</table>
</div>
<div id="outline-container-orgf1d5188" class="outline-3">
<h3 id="orgf1d5188"><span class="section-number-3">5.1</span> Example</h3>
<div id="outline-container-orgc12628f" class="outline-3">
<h3 id="orgc12628f"><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
@ -1065,8 +1065,8 @@ prim_factor =
</div>
</div>
<div id="outline-container-org391e743" class="outline-2">
<h2 id="org391e743"><span class="section-number-2">6</span> Atomic orbitals (ao group)</h2>
<div id="outline-container-org5052d1b" class="outline-2">
<h2 id="org5052d1b"><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
@ -1119,13 +1119,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="#org495a768">Basis set</a> section) to \(\mathcal{N}_{z^2}\), which is the
the <a href="#org0e0128e">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="orga085532" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="orgb9d17af" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1177,8 +1177,8 @@ introduced here should be \(\frac{\mathcal{N}_{xy}}{\mathcal{N}_{z^2}}\).
</table>
</div>
<div id="outline-container-orgf340726" class="outline-3">
<h3 id="ao_one_e"><a id="orgf340726"></a><span class="section-number-3">6.1</span> One-electron integrals (<code>ao_1e_int</code> group)</h3>
<div id="outline-container-org95e578a" class="outline-3">
<h3 id="ao_one_e"><a id="org95e578a"></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}}
@ -1195,7 +1195,7 @@ The one-electron integrals for a one-electron operator \(\hat{O}\) are
over atomic orbitals.
</p>
<table id="orgee44cd0" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org53120d7" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1290,8 +1290,8 @@ over atomic orbitals.
</div>
</div>
<div id="outline-container-orgc140cca" class="outline-3">
<h3 id="ao_two_e"><a id="orgc140cca"></a><span class="section-number-3">6.2</span> Two-electron integrals (<code>ao_2e_int</code> group)</h3>
<div id="outline-container-orga88574f" class="outline-3">
<h3 id="ao_two_e"><a id="orga88574f"></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
@ -1312,7 +1312,7 @@ notation.
\mathbf{r}_j \vert)}{\vert \mathbf{r}_i - \mathbf{r}_j \vert} \] : electron-electron long range potential</li>
</ul>
<table id="orgdf397fe" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org5f7ae37" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1352,10 +1352,10 @@ notation.
</div>
</div>
<div id="outline-container-org7f6ada6" class="outline-2">
<h2 id="org7f6ada6"><span class="section-number-2">7</span> Molecular orbitals (mo group)</h2>
<div id="outline-container-org29d44b2" class="outline-2">
<h2 id="org29d44b2"><span class="section-number-2">7</span> Molecular orbitals (mo group)</h2>
<div class="outline-text-2" id="text-7">
<table id="org2fb3718" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="orge7b4c7c" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1428,8 +1428,8 @@ notation.
</table>
</div>
<div id="outline-container-org932ac48" class="outline-3">
<h3 id="org932ac48"><span class="section-number-3">7.1</span> One-electron integrals (<code>mo_1e_int</code> group)</h3>
<div id="outline-container-orgf8bd186" class="outline-3">
<h3 id="orgf8bd186"><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
@ -1437,7 +1437,7 @@ The operators as the same as those defined in the
the basis of molecular orbitals.
</p>
<table id="orgf614d3e" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org151279c" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1532,8 +1532,8 @@ the basis of molecular orbitals.
</div>
</div>
<div id="outline-container-org62075e9" class="outline-3">
<h3 id="org62075e9"><span class="section-number-3">7.2</span> Two-electron integrals (<code>mo_2e_int</code> group)</h3>
<div id="outline-container-org0dd0d67" class="outline-3">
<h3 id="org0dd0d67"><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
@ -1541,7 +1541,7 @@ The operators as the same as those defined in the
the basis of molecular orbitals.
</p>
<table id="orgcda8801" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="orgf99cac9" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1581,8 +1581,8 @@ the basis of molecular orbitals.
</div>
</div>
<div id="outline-container-org971f5b7" class="outline-2">
<h2 id="org971f5b7"><span class="section-number-2">8</span> Slater determinants (determinant group)</h2>
<div id="outline-container-org0170e09" class="outline-2">
<h2 id="org0170e09"><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\)
@ -1624,7 +1624,7 @@ produced by the code generator.
An illustration on how to read determinants is presented in the <a href="./examples.html">examples</a>.
</p>
<table id="org069dce1" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org9a81f46" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1670,8 +1670,8 @@ An illustration on how to read determinants is presented in the <a href="./examp
</div>
</div>
<div id="outline-container-org685658b" class="outline-2">
<h2 id="org685658b"><span class="section-number-2">9</span> Excited states (state group)</h2>
<div id="outline-container-orgc3c7724" class="outline-2">
<h2 id="orgc3c7724"><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.
@ -1680,7 +1680,7 @@ correspond to excited state wave functions for the same set of
determinants. This is the goal of the present group
</p>
<table id="orgb508e5a" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org2bf56b7" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1719,8 +1719,8 @@ determinants. This is the goal of the present group
</div>
</div>
<div id="outline-container-org95cdcba" class="outline-2">
<h2 id="org95cdcba"><span class="section-number-2">10</span> Reduced density matrices (rdm group)</h2>
<div id="outline-container-org012e2b4" class="outline-2">
<h2 id="org012e2b4"><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
@ -1773,7 +1773,7 @@ The total energy can be computed as:
\]
</p>
<table id="org66345c9" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org7f47400" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1854,10 +1854,10 @@ The total energy can be computed as:
</div>
</div>
<div id="outline-container-org8ba41e0" class="outline-2">
<h2 id="org8ba41e0"><span class="section-number-2">11</span> Cell (cell group)</h2>
<div id="outline-container-org3b417eb" class="outline-2">
<h2 id="org3b417eb"><span class="section-number-2">11</span> Cell (cell group)</h2>
<div class="outline-text-2" id="text-11">
<table id="org59d7a8d" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org717b196" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1903,10 +1903,10 @@ The total energy can be computed as:
</div>
</div>
<div id="outline-container-orgde40f5d" class="outline-2">
<h2 id="orgde40f5d"><span class="section-number-2">12</span> Periodic boundary calculations (pbc group)</h2>
<div id="outline-container-orge912a48" class="outline-2">
<h2 id="orge912a48"><span class="section-number-2">12</span> Periodic boundary calculations (pbc group)</h2>
<div class="outline-text-2" id="text-12">
<table id="org9b50d11" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org54a808d" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1945,8 +1945,8 @@ The total energy can be computed as:
</div>
</div>
<div id="outline-container-org0c9a7d5" class="outline-2">
<h2 id="org0c9a7d5"><span class="section-number-2">13</span> Quantum Monte Carlo data (qmc group)</h2>
<div id="outline-container-org5f81947" class="outline-2">
<h2 id="org5f81947"><span class="section-number-2">13</span> Quantum Monte Carlo data (qmc group)</h2>
<div class="outline-text-2" id="text-13">
<p>
In quantum Monte Carlo calculations, the wave function is evaluated
@ -1960,7 +1960,7 @@ By convention, the electron coordinates contain first all the electrons
of $&uarr;$-spin and then all the $&darr;$-spin.
</p>
<table id="org058ab86" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="orgadb2a31" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -2015,7 +2015,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-07-01 Fri 17:00</p>
<p class="date">Created: 2022-07-04 Mon 11:02</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>