1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2025-04-30 04:14:54 +02:00

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

This commit is contained in:
scemama 2022-12-01 18:20:26 +00:00
parent 6f19aa8d98
commit 1b74f336e3
7 changed files with 1055 additions and 834 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-10-07 Fri 12:58 -->
<!-- 2022-12-01 Thu 18:20 -->
<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>
@ -161,6 +161,19 @@
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.equation-container {
display: table;
text-align: center;
width: 100%;
}
.equation {
vertical-align: middle;
}
.equation-label {
display: table-cell;
text-align: right;
vertical-align: middle;
}
.inlinetask {
padding: 10px;
border: 2px solid gray;
@ -190,7 +203,7 @@
* @licstart The following is the entire license notice for the
* JavaScript code in org-info.js.
*
* Copyright (C) 2012-2019 Free Software Foundation, Inc.
* Copyright (C) 2012-2020 Free Software Foundation, Inc.
*
*
* The JavaScript code in this tag is free software: you can
@ -219,7 +232,7 @@
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2019 Free Software Foundation, Inc.
Copyright (C) 2012-2020 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
@ -258,7 +271,7 @@ org_html_manager.setup(); // activate after the parameters are set
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2019 Free Software Foundation, Inc.
Copyright (C) 2012-2020 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
@ -347,7 +360,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-10-07 Fri 12:58</p>
<p class="date">Created: 2022-12-01 Thu 18:20</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-10-07 Fri 12:58 -->
<!-- 2022-12-01 Thu 18:20 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Examples</title>
@ -161,6 +161,19 @@
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.equation-container {
display: table;
text-align: center;
width: 100%;
}
.equation {
vertical-align: middle;
}
.equation-label {
display: table-cell;
text-align: right;
vertical-align: middle;
}
.inlinetask {
padding: 10px;
border: 2px solid gray;
@ -190,7 +203,7 @@
* @licstart The following is the entire license notice for the
* JavaScript code in org-info.js.
*
* Copyright (C) 2012-2019 Free Software Foundation, Inc.
* Copyright (C) 2012-2020 Free Software Foundation, Inc.
*
*
* The JavaScript code in this tag is free software: you can
@ -219,7 +232,7 @@
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2019 Free Software Foundation, Inc.
Copyright (C) 2012-2020 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
@ -258,7 +271,7 @@ org_html_manager.setup(); // activate after the parameters are set
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2019 Free Software Foundation, Inc.
Copyright (C) 2012-2020 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
@ -333,31 +346,31 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#org5012470">1. Accessing sparse quantities (integrals)</a>
<li><a href="#org2319ed2">1. Accessing sparse quantities (integrals)</a>
<ul>
<li><a href="#orgaf4a4db">1.1. Fortran</a>
<li><a href="#org9566fea">1.1. Fortran</a>
<ul>
<li><a href="#org9987117">1.1.1. Declare Temporary variables</a></li>
<li><a href="#org3c12ba1">1.1.2. Obtain the name of the TREXIO file from the command line, and open it for reading</a></li>
<li><a href="#orgf6fd0ec">1.1.3. Read the nuclear repulsion energy</a></li>
<li><a href="#org1f9100a">1.1.4. Read the number of molecular orbitals</a></li>
<li><a href="#org07111d0">1.1.5. Allocate memory</a></li>
<li><a href="#orgc6d76a2">1.1.6. Read one-electron quantities</a></li>
<li><a href="#orgb95bdc4">1.1.7. Read two-electron quantities</a>
<li><a href="#orgf6f5710">1.1.1. Declare Temporary variables</a></li>
<li><a href="#org75d2ef9">1.1.2. Obtain the name of the TREXIO file from the command line, and open it for reading</a></li>
<li><a href="#orgc52f491">1.1.3. Read the nuclear repulsion energy</a></li>
<li><a href="#org4a9f1ad">1.1.4. Read the number of molecular orbitals</a></li>
<li><a href="#org7a548d3">1.1.5. Allocate memory</a></li>
<li><a href="#org5c60cd0">1.1.6. Read one-electron quantities</a></li>
<li><a href="#org4c7d5ff">1.1.7. Read two-electron quantities</a>
<ul>
<li><a href="#org6e0b0c3">1.1.7.1. Electron repulsion integrals</a></li>
<li><a href="#org18c6d00">1.1.7.2. Reduced density matrix</a></li>
<li><a href="#org1af921c">1.1.7.1. Electron repulsion integrals</a></li>
<li><a href="#orgecf043f">1.1.7.2. Reduced density matrix</a></li>
</ul>
</li>
<li><a href="#org0813d73">1.1.8. Compute the energy</a></li>
<li><a href="#org1c88523">1.1.9. Terminate</a></li>
<li><a href="#orgbbb0fc7">1.1.8. Compute the energy</a></li>
<li><a href="#org3ceecff">1.1.9. Terminate</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#org697cb9f">2. Reading determinants</a>
<li><a href="#org6e27917">2. Reading determinants</a>
<ul>
<li><a href="#org8c8c5d9">2.1. Fortran</a></li>
<li><a href="#org5f01b2d">2.1. Fortran</a></li>
</ul>
</li>
</ul>
@ -365,12 +378,12 @@ for the JavaScript code in this tag.
</div>
<div id="outline-container-org5012470" class="outline-2">
<h2 id="org5012470"><span class="section-number-2">1</span> Accessing sparse quantities (integrals)</h2>
<div id="outline-container-org2319ed2" class="outline-2">
<h2 id="org2319ed2"><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-orgaf4a4db" class="outline-3">
<h3 id="orgaf4a4db"><span class="section-number-3">1.1</span> Fortran</h3>
<div id="outline-container-org9566fea" class="outline-3">
<h3 id="org9566fea"><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 +429,8 @@ One needs to read from the TREXIO file:
</div>
</div>
<div id="outline-container-org9987117" class="outline-4">
<h4 id="org9987117"><span class="section-number-4">1.1.1</span> Declare Temporary variables</h4>
<div id="outline-container-orgf6f5710" class="outline-4">
<h4 id="orgf6f5710"><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 +445,8 @@ One needs to read from the TREXIO file:
</div>
</div>
<div id="outline-container-org3c12ba1" class="outline-4">
<h4 id="org3c12ba1"><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-org75d2ef9" class="outline-4">
<h4 id="org75d2ef9"><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 +462,8 @@ f = trexio_open (filename, <span style="color: #8b2252;">'r'</span>, TREXIO_HDF5
</div>
</div>
<div id="outline-container-orgf6fd0ec" class="outline-4">
<h4 id="orgf6fd0ec"><span class="section-number-4">1.1.3</span> Read the nuclear repulsion energy</h4>
<div id="outline-container-orgc52f491" class="outline-4">
<h4 id="orgc52f491"><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 +477,8 @@ f = trexio_open (filename, <span style="color: #8b2252;">'r'</span>, TREXIO_HDF5
</div>
</div>
<div id="outline-container-org1f9100a" class="outline-4">
<h4 id="org1f9100a"><span class="section-number-4">1.1.4</span> Read the number of molecular orbitals</h4>
<div id="outline-container-org4a9f1ad" class="outline-4">
<h4 id="org4a9f1ad"><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 +492,8 @@ f = trexio_open (filename, <span style="color: #8b2252;">'r'</span>, TREXIO_HDF5
</div>
</div>
<div id="outline-container-org07111d0" class="outline-4">
<h4 id="org07111d0"><span class="section-number-4">1.1.5</span> Allocate memory</h4>
<div id="outline-container-org7a548d3" class="outline-4">
<h4 id="org7a548d3"><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 +505,8 @@ W(:,:,:,:) = 0.d0
</div>
</div>
<div id="outline-container-orgc6d76a2" class="outline-4">
<h4 id="orgc6d76a2"><span class="section-number-4">1.1.6</span> Read one-electron quantities</h4>
<div id="outline-container-org5c60cd0" class="outline-4">
<h4 id="org5c60cd0"><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 +538,8 @@ rc = trexio_read_rdm_1e(f, D)
</div>
</div>
<div id="outline-container-orgb95bdc4" class="outline-4">
<h4 id="orgb95bdc4"><span class="section-number-4">1.1.7</span> Read two-electron quantities</h4>
<div id="outline-container-org4c7d5ff" class="outline-4">
<h4 id="org4c7d5ff"><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 +555,8 @@ to be protected in the critical section when modified.
</p>
</div>
<div id="outline-container-org6e0b0c3" class="outline-5">
<h5 id="org6e0b0c3"><span class="section-number-5">1.1.7.1</span> Electron repulsion integrals</h5>
<div id="outline-container-org1af921c" class="outline-5">
<h5 id="org1af921c"><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 +605,8 @@ icount = BUFSIZE
</div>
</div>
<div id="outline-container-org18c6d00" class="outline-5">
<h5 id="org18c6d00"><span class="section-number-5">1.1.7.2</span> Reduced density matrix</h5>
<div id="outline-container-orgecf043f" class="outline-5">
<h5 id="orgecf043f"><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 +650,8 @@ icount = bufsize
</div>
</div>
<div id="outline-container-org0813d73" class="outline-4">
<h4 id="org0813d73"><span class="section-number-4">1.1.8</span> Compute the energy</h4>
<div id="outline-container-orgbbb0fc7" class="outline-4">
<h4 id="orgbbb0fc7"><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 +697,8 @@ E = E + E_nn
</div>
</div>
<div id="outline-container-org1c88523" class="outline-4">
<h4 id="org1c88523"><span class="section-number-4">1.1.9</span> Terminate</h4>
<div id="outline-container-org3ceecff" class="outline-4">
<h4 id="org3ceecff"><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 +712,12 @@ E = E + E_nn
</div>
<div id="outline-container-org697cb9f" class="outline-2">
<h2 id="org697cb9f"><span class="section-number-2">2</span> Reading determinants</h2>
<div id="outline-container-org6e27917" class="outline-2">
<h2 id="org6e27917"><span class="section-number-2">2</span> Reading determinants</h2>
<div class="outline-text-2" id="text-2">
</div>
<div id="outline-container-org8c8c5d9" class="outline-3">
<h3 id="org8c8c5d9"><span class="section-number-3">2.1</span> Fortran</h3>
<div id="outline-container-org5f01b2d" class="outline-3">
<h3 id="org5f01b2d"><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 +796,7 @@ end
</div>
<div id="postamble" class="status">
<p class="author">Author: TREX-CoE</p>
<p class="date">Created: 2022-10-07 Fri 12:58</p>
<p class="date">Created: 2022-12-01 Thu 18:20</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-10-07 Fri 12:58 -->
<!-- 2022-12-01 Thu 18:20 -->
<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>
@ -161,6 +161,19 @@
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.equation-container {
display: table;
text-align: center;
width: 100%;
}
.equation {
vertical-align: middle;
}
.equation-label {
display: table-cell;
text-align: right;
vertical-align: middle;
}
.inlinetask {
padding: 10px;
border: 2px solid gray;
@ -190,7 +203,7 @@
* @licstart The following is the entire license notice for the
* JavaScript code in org-info.js.
*
* Copyright (C) 2012-2019 Free Software Foundation, Inc.
* Copyright (C) 2012-2020 Free Software Foundation, Inc.
*
*
* The JavaScript code in this tag is free software: you can
@ -219,7 +232,7 @@
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2019 Free Software Foundation, Inc.
Copyright (C) 2012-2020 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
@ -258,7 +271,7 @@ org_html_manager.setup(); // activate after the parameters are set
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2019 Free Software Foundation, Inc.
Copyright (C) 2012-2020 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
@ -347,7 +360,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-10-07 Fri 12:58</p>
<p class="date">Created: 2022-12-01 Thu 18:20</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-10-07 Fri 12:58 -->
<!-- 2022-12-01 Thu 18:20 -->
<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>
@ -161,6 +161,19 @@
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.equation-container {
display: table;
text-align: center;
width: 100%;
}
.equation {
vertical-align: middle;
}
.equation-label {
display: table-cell;
text-align: right;
vertical-align: middle;
}
.inlinetask {
padding: 10px;
border: 2px solid gray;
@ -190,7 +203,7 @@
* @licstart The following is the entire license notice for the
* JavaScript code in org-info.js.
*
* Copyright (C) 2012-2019 Free Software Foundation, Inc.
* Copyright (C) 2012-2020 Free Software Foundation, Inc.
*
*
* The JavaScript code in this tag is free software: you can
@ -219,7 +232,7 @@
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2019 Free Software Foundation, Inc.
Copyright (C) 2012-2020 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
@ -258,7 +271,7 @@ org_html_manager.setup(); // activate after the parameters are set
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2019 Free Software Foundation, Inc.
Copyright (C) 2012-2020 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
@ -311,25 +324,25 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orgf42fc5c">1. Template for HDF5 definitions</a></li>
<li><a href="#org8eadc93">2. Template for HDF5 structures</a></li>
<li><a href="#org038ce02">3. Template for HDF5 init/deinit</a></li>
<li><a href="#orgf940780">4. Template for HDF5 has a group</a></li>
<li><a href="#org87d4ec7">5. Template for HDF5 has/read/write a numerical attribute</a></li>
<li><a href="#org0310a71">6. Template for HDF5 has/read/write a dataset of numerical data</a></li>
<li><a href="#org833a302">7. Template for HDF5 has/read/write a dataset of sparse data</a></li>
<li><a href="#orgfafbbd0">8. Template for HDF5 has/read/write a dataset of buffered vectors</a></li>
<li><a href="#org86af391">9. Template for HDF5 has/read/write a dataset of strings</a></li>
<li><a href="#orga3ca0fe">10. Template for HDF5 has/read/write a string attribute</a></li>
<li><a href="#orgf350de4">11. Template for HDF5 delete a group (UNSAFE mode)</a></li>
<li><a href="#org31f93ee">12. Source code for the determinant part</a></li>
<li><a href="#orgccd4eab">13. Helper functions</a></li>
<li><a href="#org28015b0">1. Template for HDF5 definitions</a></li>
<li><a href="#orgd93988b">2. Template for HDF5 structures</a></li>
<li><a href="#orgd6dd7ca">3. Template for HDF5 init/deinit</a></li>
<li><a href="#org452d97d">4. Template for HDF5 has a group</a></li>
<li><a href="#orgae07204">5. Template for HDF5 has/read/write a numerical attribute</a></li>
<li><a href="#org519e292">6. Template for HDF5 has/read/write a dataset of numerical data</a></li>
<li><a href="#orgbaa1263">7. Template for HDF5 has/read/write a dataset of sparse data</a></li>
<li><a href="#org5fc0c01">8. Template for HDF5 has/read/write a dataset of buffered vectors</a></li>
<li><a href="#org7ec92c7">9. Template for HDF5 has/read/write a dataset of strings</a></li>
<li><a href="#org9734933">10. Template for HDF5 has/read/write a string attribute</a></li>
<li><a href="#orgf71dca6">11. Template for HDF5 delete a group (UNSAFE mode)</a></li>
<li><a href="#org5308856">12. Source code for the determinant part</a></li>
<li><a href="#org814ab10">13. Helper functions</a></li>
</ul>
</div>
</div>
<div id="outline-container-orgf42fc5c" class="outline-2">
<h2 id="orgf42fc5c"><span class="section-number-2">1</span> Template for HDF5 definitions</h2>
<div id="outline-container-org28015b0" class="outline-2">
<h2 id="org28015b0"><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>
@ -341,8 +354,8 @@ for the JavaScript code in this tag.
</div>
</div>
<div id="outline-container-org8eadc93" class="outline-2">
<h2 id="org8eadc93"><span class="section-number-2">2</span> Template for HDF5 structures</h2>
<div id="outline-container-orgd93988b" class="outline-2">
<h2 id="orgd93988b"><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
@ -362,8 +375,8 @@ corresponding types for all back ends can be safely casted to
</div>
</div>
<div id="outline-container-org038ce02" class="outline-2">
<h2 id="org038ce02"><span class="section-number-2">3</span> Template for HDF5 init/deinit</h2>
<div id="outline-container-orgd6dd7ca" class="outline-2">
<h2 id="orgd6dd7ca"><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>
@ -384,7 +397,7 @@ corresponding types for all back ends can be safely casted to
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
<span style="color: #0000ff;">trexio_hdf5_inquire</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">char</span>* <span style="color: #a0522d;">file_name</span>)
{
/* <span style="color: #b22222;">H5Fis_hdf5 determines whether file is in HDF5 format </span>*/
/* <span style="color: #b22222;">H5Fis_hdf5 determines whether file is in HDF5 format</span> */
<span style="color: #228b22;">htri_t</span> <span style="color: #a0522d;">rc</span> = H5Fis_hdf5(file_name);
<span style="color: #a020f0;">if</span> (rc &gt; 0 ) {
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS; //<span style="color: #b22222;">exists and HDF5</span>
@ -404,7 +417,7 @@ corresponding types for all back ends can be safely casted to
<span style="color: #228b22;">trexio_hdf5_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">f</span> = (<span style="color: #228b22;">trexio_hdf5_t</span>*) file;
/* <span style="color: #b22222;">If file doesn't exist, create it </span>*/
/* <span style="color: #b22222;">If file doesn't exist, create it</span> */
<span style="color: #228b22;">int</span> <span style="color: #a0522d;">f_exists</span> = 0;
<span style="color: #a020f0;">struct</span> <span style="color: #228b22;">stat</span> <span style="color: #a0522d;">st</span>;
@ -439,7 +452,7 @@ corresponding types for all back ends can be safely casted to
}
/* <span style="color: #b22222;">Create or open groups in the hdf5 file assuming that they exist if file exists </span>*/
/* <span style="color: #b22222;">Create or open groups in the hdf5 file assuming that they exist if file exists</span> */
<span style="color: #a020f0;">switch</span> (file-&gt;mode) {
<span style="color: #a020f0;">case</span> <span style="color: #8b2252;">'r'</span>:
<span style="color: #a020f0;">if</span> (H5Lexists(f-&gt;file_id, $GROUP$_GROUP_NAME, H5P_DEFAULT) &gt; 0) f-&gt;$group$_group = H5Gopen(f-&gt;file_id, $GROUP$_GROUP_NAME, H5P_DEFAULT);
@ -483,8 +496,8 @@ corresponding types for all back ends can be safely casted to
</div>
</div>
<div id="outline-container-orgf940780" class="outline-2">
<h2 id="orgf940780"><span class="section-number-2">4</span> Template for HDF5 has a group</h2>
<div id="outline-container-org452d97d" class="outline-2">
<h2 id="org452d97d"><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>
@ -497,11 +510,11 @@ corresponding types for all back ends can be safely casted to
<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: #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: #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> {
@ -514,8 +527,8 @@ corresponding types for all back ends can be safely casted to
</div>
</div>
<div id="outline-container-org87d4ec7" class="outline-2">
<h2 id="org87d4ec7"><span class="section-number-2">5</span> Template for HDF5 has/read/write a numerical attribute</h2>
<div id="outline-container-orgae07204" class="outline-2">
<h2 id="orgae07204"><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>
@ -526,10 +539,10 @@ corresponding types for all back ends can be safely casted to
<span style="color: #a020f0;">if</span> (num == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_2;
<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: #b22222;">Quit if the dimensioning attribute is missing in the file </span>*/
/* <span style="color: #b22222;">Quit if the dimensioning attribute is missing in the file</span> */
<span style="color: #a020f0;">if</span> (H5Aexists(f-&gt;$group$_group, $GROUP_NUM$_NAME) == 0) <span style="color: #a020f0;">return</span> TREXIO_FAILURE;
/* <span style="color: #b22222;">Read the $group_num$ attribute of $group$ group </span>*/
/* <span style="color: #b22222;">Read the $group_num$ attribute of $group$ group</span> */
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">num_id</span> = H5Aopen(f-&gt;$group$_group, $GROUP_NUM$_NAME, H5P_DEFAULT);
<span style="color: #a020f0;">if</span> (num_id &lt;= 0) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ID;
@ -555,13 +568,13 @@ corresponding types for all back ends can be safely casted to
<span style="color: #228b22;">trexio_hdf5_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">f</span> = (<span style="color: #228b22;">trexio_hdf5_t</span>*) file;
/* <span style="color: #b22222;">Delete the attribute if it exists and if the file is open in UNSAFE mode </span>*/
/* <span style="color: #b22222;">Delete the attribute if it exists and if the file is open in UNSAFE mode</span> */
<span style="color: #a020f0;">if</span> (trexio_hdf5_has_$group_num$(file) == TREXIO_SUCCESS &amp;&amp; file-&gt;mode == <span style="color: #8b2252;">'u'</span>) {
<span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status_del</span> = H5Adelete(f-&gt;$group$_group, $GROUP_NUM$_NAME);
<span style="color: #a020f0;">if</span> (status_del &lt; 0) <span style="color: #a020f0;">return</span> TREXIO_FAILURE;
}
/* <span style="color: #b22222;">Setup the dataspace </span>*/
/* <span style="color: #b22222;">Setup the dataspace</span> */
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">dtype_id</span> = H5Tcopy(H5T_$GROUP_NUM_H5_DTYPE$);
<span style="color: #a020f0;">if</span> (dtype_id &lt;= 0) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ID;
@ -604,7 +617,7 @@ corresponding types for all back ends can be safely casted to
<span style="color: #a020f0;">if</span> (f-&gt;$group$_group == (<span style="color: #228b22;">hsize_t</span>) 0) <span style="color: #a020f0;">return</span> TREXIO_HAS_NOT;
<span style="color: #228b22;">htri_t</span> <span style="color: #a0522d;">status</span> = H5Aexists(f-&gt;$group$_group, $GROUP_NUM$_NAME);
/* <span style="color: #b22222;">H5Aexists returns positive value if attribute exists, 0 if does not, negative if error </span>*/
/* <span style="color: #b22222;">H5Aexists returns positive value if attribute exists, 0 if does not, negative if error</span> */
<span style="color: #a020f0;">if</span> (status &gt; 0){
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
} <span style="color: #a020f0;">else</span> <span style="color: #a020f0;">if</span> (status == 0) {
@ -619,8 +632,8 @@ corresponding types for all back ends can be safely casted to
</div>
</div>
<div id="outline-container-org0310a71" class="outline-2">
<h2 id="org0310a71"><span class="section-number-2">6</span> Template for HDF5 has/read/write a dataset of numerical data</h2>
<div id="outline-container-org519e292" class="outline-2">
<h2 id="org519e292"><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>
@ -665,7 +678,7 @@ corresponding types for all back ends can be safely casted to
H5Sclose(dspace_id);
H5Dclose(dset_id);
/* <span style="color: #b22222;">High-level H5LT API. No need to deal with dataspaces and datatypes </span>*/
/* <span style="color: #b22222;">High-level H5LT API. No need to deal with dataspaces and datatypes</span> */
<span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status</span> = H5LTread_dataset(f-&gt;$group$_group,
$GROUP_DSET$_NAME,
H5T_$GROUP_DSET_H5_DTYPE$,
@ -693,7 +706,7 @@ corresponding types for all back ends can be safely casted to
<span style="color: #b22222;"> thus reducing the size of the HDF5 file. In practic, this is not always the case.</span>
<span style="color: #b22222;"> Consider using HDF5-native h5repack utility after deleting/overwriting big datasets.</span>
<span style="color: #b22222;"> </span>*/
*/
<span style="color: #a020f0;">if</span> (H5LTfind_dataset(f-&gt;$group$_group, $GROUP_DSET$_NAME) == 1 &amp;&amp; file-&gt;mode == <span style="color: #8b2252;">'u'</span>) {
<span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status_del</span> = H5Ldelete(f-&gt;$group$_group, $GROUP_DSET$_NAME, H5P_DEFAULT);
<span style="color: #a020f0;">if</span> (status_del &lt; 0) <span style="color: #a020f0;">return</span> TREXIO_FAILURE;
@ -739,7 +752,7 @@ corresponding types for all back ends can be safely casted to
<span style="color: #a020f0;">if</span> (f-&gt;$group$_group == (<span style="color: #228b22;">hsize_t</span>) 0) <span style="color: #a020f0;">return</span> TREXIO_HAS_NOT;
<span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status</span> = H5LTfind_dataset(f-&gt;$group$_group, $GROUP_DSET$_NAME);
/* <span style="color: #b22222;">H5LTfind_dataset returns 1 if dataset exists, 0 otherwise </span>*/
/* <span style="color: #b22222;">H5LTfind_dataset returns 1 if dataset exists, 0 otherwise</span> */
<span style="color: #a020f0;">if</span> (status == 1){
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
} <span style="color: #a020f0;">else</span> <span style="color: #a020f0;">if</span> (status == 0) {
@ -754,8 +767,8 @@ corresponding types for all back ends can be safely casted to
</div>
</div>
<div id="outline-container-org833a302" class="outline-2">
<h2 id="org833a302"><span class="section-number-2">7</span> Template for HDF5 has/read/write a dataset of sparse data</h2>
<div id="outline-container-orgbaa1263" class="outline-2">
<h2 id="orgbaa1263"><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
@ -779,7 +792,7 @@ due to the fact that the sparse data will be written in chunks of user-defined s
<span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">index_dtype</span>;
<span style="color: #228b22;">void</span>* <span style="color: #a0522d;">index_p</span> = <span style="color: #008b8b;">NULL</span>;
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">size_ranked</span> = (<span style="color: #228b22;">uint64_t</span>) size * $group_dset_rank$;
/* <span style="color: #b22222;">Determine the optimal type for storing indices depending on the size_max (usually mo_num or ao_num) </span>*/
/* <span style="color: #b22222;">Determine the optimal type for storing indices depending on the size_max (usually mo_num or ao_num)</span> */
<span style="color: #a020f0;">if</span> (size_max &lt; UINT8_MAX) {
<span style="color: #228b22;">uint8_t</span>* <span style="color: #a0522d;">index</span> = CALLOC(size_ranked, uint8_t);
<span style="color: #a020f0;">if</span> (index == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_ALLOCATION_FAILED;
@ -801,44 +814,44 @@ due to the fact that the sparse data will be written in chunks of user-defined s
index_dtype = H5T_NATIVE_INT32;
}
/* <span style="color: #b22222;">Store float values in double precision </span>*/
/* <span style="color: #b22222;">Store float values in double precision</span> */
<span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">value_dtype</span> = H5T_NATIVE_DOUBLE;
/* <span style="color: #b22222;">Arrays of chunk dims that will be used for chunking the dataset </span>*/
/* <span style="color: #b22222;">Arrays of chunk dims that will be used for chunking the dataset</span> */
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hsize_t</span> <span style="color: #a0522d;">chunk_i_dims</span>[1] = {size_ranked};
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hsize_t</span> <span style="color: #a0522d;">chunk_v_dims</span>[1] = {size};
/* <span style="color: #b22222;">Indices and values are stored as 2 independent datasets in the HDF5 file </span>*/
/* <span style="color: #b22222;">Indices and values are stored as 2 independent datasets in the HDF5 file</span> */
<span style="color: #228b22;">char</span> <span style="color: #a0522d;">dset_index_name</span>[256];
<span style="color: #228b22;">char</span> <span style="color: #a0522d;">dset_value_name</span>[256];
/* <span style="color: #b22222;">Build the names of the datasets </span>*/
/* <span style="color: #b22222;">Build the names of the datasets</span> */
strncpy(dset_index_name, $GROUP_DSET$_NAME <span style="color: #8b2252;">"_indices"</span>, 256);
strncpy(dset_value_name, $GROUP_DSET$_NAME <span style="color: #8b2252;">"_values"</span>, 256);
<span style="color: #228b22;">trexio_exit_code</span> <span style="color: #a0522d;">rc_write</span> = TREXIO_FAILURE;
/* <span style="color: #b22222;">NOTE: chunk size is set upon creation of the HDF5 dataset and cannot be changed ! </span>*/
/* <span style="color: #b22222;">NOTE: chunk size is set upon creation of the HDF5 dataset and cannot be changed !</span> */
<span style="color: #a020f0;">if</span> ( H5LTfind_dataset(f-&gt;$group$_group, dset_index_name) != 1 ) {
/* <span style="color: #b22222;">If the file does not exist -&gt; create it and write </span>*/
/* <span style="color: #b22222;">If the file does not exist -&gt; create it and write</span> */
/* <span style="color: #b22222;">Create chunked dataset with index_dtype datatype and write indices into it </span>*/
/* <span style="color: #b22222;">Create chunked dataset with index_dtype datatype and write indices into it</span> */
rc_write = trexio_hdf5_create_write_dset_sparse(f-&gt;$group$_group, dset_index_name, index_dtype, chunk_i_dims, index_p);
<span style="color: #a020f0;">if</span> (index_p != index_sparse) FREE(index_p);
<span style="color: #a020f0;">if</span> (rc_write != TREXIO_SUCCESS) <span style="color: #a020f0;">return</span> rc_write;
/* <span style="color: #b22222;">Create chunked dataset with value_dtype datatype and write values into it </span>*/
/* <span style="color: #b22222;">Create chunked dataset with value_dtype datatype and write values into it</span> */
rc_write = trexio_hdf5_create_write_dset_sparse(f-&gt;$group$_group, dset_value_name, value_dtype, chunk_v_dims, value_sparse);
<span style="color: #a020f0;">if</span> (rc_write != TREXIO_SUCCESS) <span style="color: #a020f0;">return</span> rc_write;
} <span style="color: #a020f0;">else</span> {
/* <span style="color: #b22222;">If the file exists -&gt; open it and write </span>*/
/* <span style="color: #b22222;">If the file exists -&gt; open it and write</span> */
<span style="color: #228b22;">hsize_t</span> <span style="color: #a0522d;">offset_i</span>[1] = {(<span style="color: #228b22;">hsize_t</span>) offset_file * $group_dset_rank$};
<span style="color: #228b22;">hsize_t</span> <span style="color: #a0522d;">offset_v</span>[1] = {(<span style="color: #228b22;">hsize_t</span>) offset_file};
/* <span style="color: #b22222;">Create chunked dataset with index_dtype datatype and write indices into it </span>*/
/* <span style="color: #b22222;">Create chunked dataset with index_dtype datatype and write indices into it</span> */
rc_write = trexio_hdf5_open_write_dset_sparse(f-&gt;$group$_group, dset_index_name, index_dtype, chunk_i_dims, offset_i, index_p);
<span style="color: #a020f0;">if</span> (index_p != index_sparse) FREE(index_p);
<span style="color: #a020f0;">if</span> (rc_write != TREXIO_SUCCESS) <span style="color: #a020f0;">return</span> rc_write;
/* <span style="color: #b22222;">Create chunked dataset with value_dtype datatype and write values into it </span>*/
/* <span style="color: #b22222;">Create chunked dataset with value_dtype datatype and write values into it</span> */
rc_write = trexio_hdf5_open_write_dset_sparse(f-&gt;$group$_group, dset_value_name, value_dtype, chunk_v_dims, offset_v, value_sparse);
<span style="color: #a020f0;">if</span> (rc_write != TREXIO_SUCCESS) <span style="color: #a020f0;">return</span> rc_write;
@ -866,10 +879,10 @@ due to the fact that the sparse data will be written in chunks of user-defined s
<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: #b22222;">Indices and values are stored as 2 independent datasets in the HDF5 file </span>*/
/* <span style="color: #b22222;">Indices and values are stored as 2 independent datasets in the HDF5 file</span> */
<span style="color: #228b22;">char</span> <span style="color: #a0522d;">dset_index_name</span>[256];
<span style="color: #228b22;">char</span> <span style="color: #a0522d;">dset_value_name</span>[256];
/* <span style="color: #b22222;">Build the names of the datasets </span>*/
/* <span style="color: #b22222;">Build the names of the datasets</span> */
strncpy(dset_index_name, $GROUP_DSET$_NAME <span style="color: #8b2252;">"_indices"</span>, 256);
strncpy(dset_value_name, $GROUP_DSET$_NAME <span style="color: #8b2252;">"_values"</span>, 256);
@ -943,7 +956,7 @@ due to the fact that the sparse data will be written in chunks of user-defined s
<span style="color: #a020f0;">if</span> (f-&gt;$group$_group == (<span style="color: #228b22;">hsize_t</span>) 0) <span style="color: #a020f0;">return</span> TREXIO_HAS_NOT;
<span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status</span> = H5LTfind_dataset(f-&gt;$group$_group, $GROUP_DSET$_NAME <span style="color: #8b2252;">"_values"</span>);
/* <span style="color: #b22222;">H5LTfind_dataset returns 1 if dataset exists, 0 otherwise </span>*/
/* <span style="color: #b22222;">H5LTfind_dataset returns 1 if dataset exists, 0 otherwise</span> */
<span style="color: #a020f0;">if</span> (status == 1){
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
} <span style="color: #a020f0;">else</span> <span style="color: #a020f0;">if</span> (status == 0) {
@ -958,8 +971,8 @@ due to the fact that the sparse data will be written in chunks of user-defined s
</div>
</div>
<div id="outline-container-orgfafbbd0" class="outline-2">
<h2 id="orgfafbbd0"><span class="section-number-2">8</span> Template for HDF5 has/read/write a dataset of buffered vectors</h2>
<div id="outline-container-org5fc0c01" class="outline-2">
<h2 id="org5fc0c01"><span class="section-number-2">8</span> Template for HDF5 has/read/write a dataset of buffered vectors</h2>
<div class="outline-text-2" id="text-8">
<p>
Chunked I/O in HDF5 for <code>buffered</code> data.
@ -1008,23 +1021,23 @@ Chunked I/O in HDF5 for <code>buffered</code> data.
<span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">dtype</span> = H5T_NATIVE_DOUBLE;
/* <span style="color: #b22222;">Arrays of chunk dims that will be used for chunking the dataset </span>*/
/* <span style="color: #b22222;">Arrays of chunk dims that will be used for chunking the dataset</span> */
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hsize_t</span> <span style="color: #a0522d;">chunk_dims</span>[1] = {(<span style="color: #228b22;">hsize_t</span>) dims[0]};
<span style="color: #228b22;">trexio_exit_code</span> <span style="color: #a0522d;">rc_write</span> = TREXIO_FAILURE;
/* <span style="color: #b22222;">NOTE: chunk size is set upon creation of the HDF5 dataset and cannot be changed ! </span>*/
/* <span style="color: #b22222;">NOTE: chunk size is set upon creation of the HDF5 dataset and cannot be changed !</span> */
<span style="color: #a020f0;">if</span> ( H5LTfind_dataset(f-&gt;$group$_group, dset_name) != 1 ) {
/* <span style="color: #b22222;">If the file does not exist -&gt; create it and write </span>*/
/* <span style="color: #b22222;">If the file does not exist -&gt; create it and write</span> */
/* <span style="color: #b22222;">Create chunked dataset with dtype datatype and write indices into it </span>*/
/* <span style="color: #b22222;">Create chunked dataset with dtype datatype and write indices into it</span> */
rc_write = trexio_hdf5_create_write_dset_sparse(f-&gt;$group$_group, dset_name, dtype, chunk_dims, dset);
<span style="color: #a020f0;">if</span> (rc_write != TREXIO_SUCCESS) <span style="color: #a020f0;">return</span> rc_write;
} <span style="color: #a020f0;">else</span> {
/* <span style="color: #b22222;">If the file exists -&gt; open it and write </span>*/
/* <span style="color: #b22222;">If the file exists -&gt; open it and write</span> */
<span style="color: #228b22;">hsize_t</span> <span style="color: #a0522d;">offset_data</span>[1] = {(<span style="color: #228b22;">hsize_t</span>) offset_file};
/* <span style="color: #b22222;">Create chunked dataset with dtype datatype and write indices into it </span>*/
/* <span style="color: #b22222;">Create chunked dataset with dtype datatype and write indices into it</span> */
rc_write = trexio_hdf5_open_write_dset_sparse(f-&gt;$group$_group, dset_name, dtype, chunk_dims, offset_data, dset);
<span style="color: #a020f0;">if</span> (rc_write != TREXIO_SUCCESS) <span style="color: #a020f0;">return</span> rc_write;
@ -1080,7 +1093,7 @@ Chunked I/O in HDF5 for <code>buffered</code> data.
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">char</span> <span style="color: #a0522d;">dset_name</span>[256] = <span style="color: #8b2252;">"$group_dset$"</span>;
<span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status</span> = H5LTfind_dataset(f-&gt;$group$_group, dset_name);
/* <span style="color: #b22222;">H5LTfind_dataset returns 1 if dataset exists, 0 otherwise </span>*/
/* <span style="color: #b22222;">H5LTfind_dataset returns 1 if dataset exists, 0 otherwise</span> */
<span style="color: #a020f0;">if</span> (status == 1){
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
} <span style="color: #a020f0;">else</span> <span style="color: #a020f0;">if</span> (status == 0) {
@ -1094,8 +1107,8 @@ Chunked I/O in HDF5 for <code>buffered</code> data.
</div>
</div>
<div id="outline-container-org86af391" class="outline-2">
<h2 id="org86af391"><span class="section-number-2">9</span> Template for HDF5 has/read/write a dataset of strings</h2>
<div id="outline-container-org7ec92c7" class="outline-2">
<h2 id="org7ec92c7"><span class="section-number-2">9</span> Template for HDF5 has/read/write a dataset of strings</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>
@ -1220,7 +1233,7 @@ Chunked I/O in HDF5 for <code>buffered</code> data.
<span style="color: #b22222;"> thus reducing the size of the HDF5 file. In practic, this is not always the case.</span>
<span style="color: #b22222;"> Consider using HDF5-provided h5repack utility after deleting/overwriting big datasets.</span>
<span style="color: #b22222;"> </span>*/
*/
<span style="color: #a020f0;">if</span> (H5LTfind_dataset(f-&gt;$group$_group, $GROUP_DSET$_NAME) == 1 &amp;&amp; file-&gt;mode == <span style="color: #8b2252;">'u'</span>) {
<span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status_del</span> = H5Ldelete(f-&gt;$group$_group, $GROUP_DSET$_NAME, H5P_DEFAULT);
<span style="color: #a020f0;">if</span> (status_del &lt; 0) <span style="color: #a020f0;">return</span> TREXIO_FAILURE;
@ -1229,7 +1242,7 @@ Chunked I/O in HDF5 for <code>buffered</code> data.
<span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status</span>;
<span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">dset_id</span>;
/* <span style="color: #b22222;">we are going to write variable-length strings </span>*/
/* <span style="color: #b22222;">we are going to write variable-length strings</span> */
<span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">memtype</span> = H5Tcopy (H5T_C_S1);
<span style="color: #a020f0;">if</span> (memtype &lt;= 0) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ID;
@ -1239,7 +1252,7 @@ Chunked I/O in HDF5 for <code>buffered</code> data.
<span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">dspace</span> = H5Screate_simple( (<span style="color: #228b22;">int</span>) rank, (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hsize_t</span>*) dims, <span style="color: #008b8b;">NULL</span>);
<span style="color: #a020f0;">if</span> (dspace &lt;= 0) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ID;
/* <span style="color: #b22222;">code to create dataset </span>*/
/* <span style="color: #b22222;">code to create dataset</span> */
<span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">filetype</span> = H5Tcopy (H5T_FORTRAN_S1);
<span style="color: #a020f0;">if</span> (filetype &lt;= 0) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ID;
@ -1278,7 +1291,7 @@ Chunked I/O in HDF5 for <code>buffered</code> data.
<span style="color: #a020f0;">if</span> (f-&gt;$group$_group == (<span style="color: #228b22;">hsize_t</span>) 0) <span style="color: #a020f0;">return</span> TREXIO_HAS_NOT;
<span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status</span> = H5LTfind_dataset(f-&gt;$group$_group, $GROUP_DSET$_NAME);
/* <span style="color: #b22222;">H5LTfind_dataset returns 1 if dataset exists, 0 otherwise </span>*/
/* <span style="color: #b22222;">H5LTfind_dataset returns 1 if dataset exists, 0 otherwise</span> */
<span style="color: #a020f0;">if</span> (status == 1){
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
} <span style="color: #a020f0;">else</span> <span style="color: #a020f0;">if</span> (status == 0) {
@ -1293,8 +1306,8 @@ Chunked I/O in HDF5 for <code>buffered</code> data.
</div>
</div>
<div id="outline-container-orga3ca0fe" class="outline-2">
<h2 id="orga3ca0fe"><span class="section-number-2">10</span> Template for HDF5 has/read/write a string attribute</h2>
<div id="outline-container-org9734933" class="outline-2">
<h2 id="org9734933"><span class="section-number-2">10</span> Template for HDF5 has/read/write a string attribute</h2>
<div class="outline-text-2" id="text-10">
<div class="org-src-container">
<pre class="src src-c"><span style="color: #228b22;">trexio_exit_code</span>
@ -1305,17 +1318,17 @@ Chunked I/O in HDF5 for <code>buffered</code> data.
<span style="color: #a020f0;">if</span> (str == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ARG_2;
<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: #b22222;">Quit if the string attribute is missing in the file </span>*/
/* <span style="color: #b22222;">Quit if the string attribute is missing in the file</span> */
<span style="color: #a020f0;">if</span> (H5Aexists(f-&gt;$group$_group, $GROUP_STR$_NAME) == 0) <span style="color: #a020f0;">return</span> TREXIO_HAS_NOT;
/* <span style="color: #b22222;">Read the $group_str$ attribute of $group$ group </span>*/
/* <span style="color: #b22222;">Read the $group_str$ attribute of $group$ group</span> */
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">str_id</span> = H5Aopen(f-&gt;$group$_group, $GROUP_STR$_NAME, H5P_DEFAULT);
<span style="color: #a020f0;">if</span> (str_id &lt;= 0) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ID;
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">ftype_id</span> = H5Aget_type(str_id);
<span style="color: #a020f0;">if</span> (ftype_id &lt;= 0) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ID;
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">sdim</span> = H5Tget_size(ftype_id);
sdim++; /* <span style="color: #b22222;">Make room for null terminator </span>*/
sdim++; /* <span style="color: #b22222;">Make room for null terminator</span> */
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">mem_id</span> = H5Tcopy(H5T_C_S1);
<span style="color: #a020f0;">if</span> (mem_id &lt;= 0) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ID;
@ -1348,13 +1361,13 @@ Chunked I/O in HDF5 for <code>buffered</code> data.
<span style="color: #228b22;">trexio_hdf5_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">f</span> = (<span style="color: #228b22;">trexio_hdf5_t</span>*) file;
/* <span style="color: #b22222;">Delete the attribute if it exists and if the file is open in UNSAFE mode </span>*/
/* <span style="color: #b22222;">Delete the attribute if it exists and if the file is open in UNSAFE mode</span> */
<span style="color: #a020f0;">if</span> (trexio_hdf5_has_$group_str$(file) == TREXIO_SUCCESS &amp;&amp; file-&gt;mode == <span style="color: #8b2252;">'u'</span>) {
<span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status_del</span> = H5Adelete(f-&gt;$group$_group, $GROUP_STR$_NAME);
<span style="color: #a020f0;">if</span> (status_del &lt; 0) <span style="color: #a020f0;">return</span> TREXIO_FAILURE;
}
/* <span style="color: #b22222;">Setup the datatype for variable length string </span>*/
/* <span style="color: #b22222;">Setup the datatype for variable length string</span> */
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">dtype_id</span> = H5Tcopy(H5T_C_S1);
<span style="color: #a020f0;">if</span> (dtype_id &lt;= 0) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ID;
@ -1367,11 +1380,11 @@ Chunked I/O in HDF5 for <code>buffered</code> data.
status = H5Tset_strpad(dtype_id, H5T_STR_NULLTERM);
<span style="color: #a020f0;">if</span> (status &lt; 0) <span style="color: #a020f0;">return</span> TREXIO_FAILURE;
/* <span style="color: #b22222;">Setup the dataspace </span>*/
/* <span style="color: #b22222;">Setup the dataspace</span> */
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">dspace_id</span> = H5Screate(H5S_SCALAR);
<span style="color: #a020f0;">if</span> (dspace_id &lt;= 0) <span style="color: #a020f0;">return</span> TREXIO_INVALID_ID;
/* <span style="color: #b22222;">Create the $group_str$ attribute of $group$ group </span>*/
/* <span style="color: #b22222;">Create the $group_str$ attribute of $group$ group</span> */
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">str_id</span> = H5Acreate(f-&gt;$group$_group,
$GROUP_STR$_NAME,
dtype_id, dspace_id,
@ -1407,7 +1420,7 @@ Chunked I/O in HDF5 for <code>buffered</code> data.
<span style="color: #a020f0;">if</span> (f-&gt;$group$_group == (<span style="color: #228b22;">hsize_t</span>) 0) <span style="color: #a020f0;">return</span> TREXIO_HAS_NOT;
<span style="color: #228b22;">htri_t</span> <span style="color: #a0522d;">status</span> = H5Aexists(f-&gt;$group$_group, $GROUP_STR$_NAME);
/* <span style="color: #b22222;">H5Aexists returns positive value if attribute exists, 0 if does not, negative if error </span>*/
/* <span style="color: #b22222;">H5Aexists returns positive value if attribute exists, 0 if does not, negative if error</span> */
<span style="color: #a020f0;">if</span> (status &gt; 0){
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
} <span style="color: #a020f0;">else</span> <span style="color: #a020f0;">if</span> (status == 0) {
@ -1421,8 +1434,8 @@ Chunked I/O in HDF5 for <code>buffered</code> data.
</div>
</div>
</div>
<div id="outline-container-orgf350de4" class="outline-2">
<h2 id="orgf350de4"><span class="section-number-2">11</span> Template for HDF5 delete a group (UNSAFE mode)</h2>
<div id="outline-container-orgf71dca6" class="outline-2">
<h2 id="orgf71dca6"><span class="section-number-2">11</span> Template for HDF5 delete a group (UNSAFE mode)</h2>
<div class="outline-text-2" id="text-11">
<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
@ -1462,8 +1475,8 @@ Thus, any corrupted/lost file space will remain in the first file. The use of <c
</div>
</div>
<div id="outline-container-org31f93ee" class="outline-2">
<h2 id="org31f93ee"><span class="section-number-2">12</span> Source code for the determinant part</h2>
<div id="outline-container-org5308856" class="outline-2">
<h2 id="org5308856"><span class="section-number-2">12</span> Source code for the determinant part</h2>
<div class="outline-text-2" id="text-12">
<p>
Each array is stored in a separate HDF5 dataset due to the fact that determinant I/O has to be decoupled.
@ -1513,26 +1526,26 @@ Size specifies the number of data items (e.g. determinants) to process.
<span style="color: #228b22;">hid_t</span> <span style="color: #a0522d;">det_dtype</span> = H5T_NATIVE_INT64;
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">size_ranked</span> = dims[1]*dims[0];
/* <span style="color: #b22222;">Arrays of chunk dims that will be used for chunking the dataset </span>*/
/* <span style="color: #b22222;">Arrays of chunk dims that will be used for chunking the dataset</span> */
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">hsize_t</span> <span style="color: #a0522d;">chunk_dims</span>[1] = {size_ranked};
/* <span style="color: #b22222;">Indices and values are stored as 2 independent datasets in the HDF5 file </span>*/
/* <span style="color: #b22222;">Indices and values are stored as 2 independent datasets in the HDF5 file</span> */
<span style="color: #228b22;">char</span> <span style="color: #a0522d;">dset_det_name</span>[256] = <span style="color: #8b2252;">"determinant_list"</span>;
<span style="color: #228b22;">trexio_exit_code</span> <span style="color: #a0522d;">rc_write</span> = TREXIO_FAILURE;
/* <span style="color: #b22222;">NOTE: chunk size is set upon creation of the HDF5 dataset and cannot be changed ! </span>*/
/* <span style="color: #b22222;">NOTE: chunk size is set upon creation of the HDF5 dataset and cannot be changed !</span> */
<span style="color: #a020f0;">if</span> ( H5LTfind_dataset(f-&gt;determinant_group, dset_det_name) != 1 ) {
/* <span style="color: #b22222;">If the file does not exist -&gt; create it and write </span>*/
/* <span style="color: #b22222;">If the file does not exist -&gt; create it and write</span> */
/* <span style="color: #b22222;">Create chunked dataset with det_dtype datatype and write indices into it </span>*/
/* <span style="color: #b22222;">Create chunked dataset with det_dtype datatype and write indices into it</span> */
rc_write = trexio_hdf5_create_write_dset_sparse(f-&gt;determinant_group, dset_det_name, det_dtype, chunk_dims, list);
<span style="color: #a020f0;">if</span> (rc_write != TREXIO_SUCCESS) <span style="color: #a020f0;">return</span> rc_write;
} <span style="color: #a020f0;">else</span> {
/* <span style="color: #b22222;">If the file exists -&gt; open it and write </span>*/
/* <span style="color: #b22222;">If the file exists -&gt; open it and write</span> */
<span style="color: #228b22;">hsize_t</span> <span style="color: #a0522d;">offset_data</span>[1] = {(<span style="color: #228b22;">hsize_t</span>) offset_file * dims[1]};
/* <span style="color: #b22222;">Create chunked dataset with det_dtype datatype and write indices into it </span>*/
/* <span style="color: #b22222;">Create chunked dataset with det_dtype datatype and write indices into it</span> */
rc_write = trexio_hdf5_open_write_dset_sparse(f-&gt;determinant_group, dset_det_name, det_dtype, chunk_dims, offset_data, list);
<span style="color: #a020f0;">if</span> (rc_write != TREXIO_SUCCESS) <span style="color: #a020f0;">return</span> rc_write;
@ -1552,7 +1565,7 @@ Size specifies the number of data items (e.g. determinants) to process.
<span style="color: #a020f0;">if</span> (f-&gt;determinant_group == (<span style="color: #228b22;">hsize_t</span>) 0) <span style="color: #a020f0;">return</span> TREXIO_HAS_NOT;
<span style="color: #228b22;">herr_t</span> <span style="color: #a0522d;">status</span> = H5LTfind_dataset(f-&gt;determinant_group, <span style="color: #8b2252;">"determinant_list"</span>);
/* <span style="color: #b22222;">H5LTfind_dataset returns 1 if dataset exists, 0 otherwise </span>*/
/* <span style="color: #b22222;">H5LTfind_dataset returns 1 if dataset exists, 0 otherwise</span> */
<span style="color: #a020f0;">if</span> (status == 1){
<span style="color: #a020f0;">return</span> TREXIO_SUCCESS;
} <span style="color: #a020f0;">else</span> <span style="color: #a020f0;">if</span> (status == 0) {
@ -1566,8 +1579,8 @@ Size specifies the number of data items (e.g. determinants) to process.
</div>
</div>
<div id="outline-container-orgccd4eab" class="outline-2">
<h2 id="orgccd4eab"><span class="section-number-2">13</span> Helper functions</h2>
<div id="outline-container-org814ab10" class="outline-2">
<h2 id="org814ab10"><span class="section-number-2">13</span> Helper functions</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>
@ -1727,7 +1740,7 @@ Size specifies the number of data items (e.g. determinants) to process.
/* <span style="color: #b22222;">get dims of the dset stored in the file to check whether reading with user-provided chunk size</span>
<span style="color: #b22222;"> will reach end of the dataset (i.e. EOF in TEXT back end)</span>
<span style="color: #b22222;"> </span>*/
*/
<span style="color: #228b22;">hsize_t</span> <span style="color: #a0522d;">ddims</span>[1] = {0};
<span style="color: #228b22;">int</span> <span style="color: #a0522d;">rrank</span> = H5Sget_simple_extent_dims(fspace_id, ddims, <span style="color: #008b8b;">NULL</span>);
<span style="color: #a020f0;">if</span> (rrank != h5_rank) {
@ -1830,7 +1843,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-10-07 Fri 12:58</p>
<p class="date">Created: 2022-12-01 Thu 18:20</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

309
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-10-07 Fri 12:58 -->
<!-- 2022-12-01 Thu 18:20 -->
<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>
@ -161,6 +161,19 @@
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.equation-container {
display: table;
text-align: center;
width: 100%;
}
.equation {
vertical-align: middle;
}
.equation-label {
display: table-cell;
text-align: right;
vertical-align: middle;
}
.inlinetask {
padding: 10px;
border: 2px solid gray;
@ -190,7 +203,7 @@
* @licstart The following is the entire license notice for the
* JavaScript code in org-info.js.
*
* Copyright (C) 2012-2019 Free Software Foundation, Inc.
* Copyright (C) 2012-2020 Free Software Foundation, Inc.
*
*
* The JavaScript code in this tag is free software: you can
@ -219,7 +232,7 @@
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2019 Free Software Foundation, Inc.
Copyright (C) 2012-2020 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
@ -258,7 +271,7 @@ org_html_manager.setup(); // activate after the parameters are set
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2019 Free Software Foundation, Inc.
Copyright (C) 2012-2020 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
@ -333,38 +346,38 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#orgdcc4370">1. Metadata (metadata group)</a></li>
<li><a href="#orgc04c169">2. Electron (electron group)</a></li>
<li><a href="#org13b08f4">3. Nucleus (nucleus group)</a></li>
<li><a href="#org34300f8">4. Effective core potentials (ecp group)</a>
<li><a href="#org9084e47">1. Metadata (metadata group)</a></li>
<li><a href="#org0079050">2. Electron (electron group)</a></li>
<li><a href="#org6af4211">3. Nucleus (nucleus group)</a></li>
<li><a href="#orgae1cb45">4. Effective core potentials (ecp group)</a>
<ul>
<li><a href="#org978cac1">4.1. Example</a></li>
<li><a href="#org12a08ea">4.1. Example</a></li>
</ul>
</li>
<li><a href="#org668dbdf">5. Basis set (basis group)</a>
<li><a href="#org53ba67b">5. Basis set (basis group)</a>
<ul>
<li><a href="#orgd34cadf">5.1. Example</a></li>
<li><a href="#orgaa057e8">5.1. Example</a></li>
</ul>
</li>
<li><a href="#org7cf49bd">6. Atomic orbitals (ao group)</a>
<li><a href="#org7a073c2">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="#orgf92bb5a">7. Molecular orbitals (mo group)</a>
<li><a href="#org6617b7a">7. Molecular orbitals (mo group)</a>
<ul>
<li><a href="#org1afe0b4">7.1. One-electron integrals (<code>mo_1e_int</code> group)</a></li>
<li><a href="#org756a28a">7.2. Two-electron integrals (<code>mo_2e_int</code> group)</a></li>
<li><a href="#org0cb1ed8">7.1. One-electron integrals (<code>mo_1e_int</code> group)</a></li>
<li><a href="#org304482e">7.2. Two-electron integrals (<code>mo_2e_int</code> group)</a></li>
</ul>
</li>
<li><a href="#org0a53fe6">8. Slater determinants (determinant group)</a></li>
<li><a href="#org333ce02">9. Configuration state functions (csf group)</a></li>
<li><a href="#org7b888e8">10. Excited states (state group)</a></li>
<li><a href="#org74887e9">11. Reduced density matrices (rdm group)</a></li>
<li><a href="#orgf261075">12. Cell (cell group)</a></li>
<li><a href="#org73ad001">13. Periodic boundary calculations (pbc group)</a></li>
<li><a href="#org6b885a5">14. Quantum Monte Carlo data (qmc group)</a></li>
<li><a href="#org8f33879">8. Slater determinants (determinant group)</a></li>
<li><a href="#org0cdc8fe">9. Configuration state functions (csf group)</a></li>
<li><a href="#orgef1389f">10. Excited states (state group)</a></li>
<li><a href="#org621cf81">11. Reduced density matrices (rdm group)</a></li>
<li><a href="#org67fd674">12. Cell (cell group)</a></li>
<li><a href="#org821a9c6">13. Periodic boundary calculations (pbc group)</a></li>
<li><a href="#org4a41efa">14. Quantum Monte Carlo data (qmc group)</a></li>
</ul>
</div>
</div>
@ -426,8 +439,8 @@ For determinant lists (integer bit fields), the <code>special</code> attribute i
This means that the source code is not produced by the generator, but hand-written.
</p>
<div id="outline-container-orgdcc4370" class="outline-2">
<h2 id="orgdcc4370"><span class="section-number-2">1</span> Metadata (metadata group)</h2>
<div id="outline-container-org9084e47" class="outline-2">
<h2 id="org9084e47"><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
@ -437,7 +450,7 @@ which have participated to the creation of the file, a list of
authors of the file, and a textual description.
</p>
<table id="org0cd3118" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org088daed" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -518,15 +531,15 @@ then the <code>unsafe</code> attribute value can be manually overwritten (in uns
</div>
</div>
<div id="outline-container-orgc04c169" class="outline-2">
<h2 id="orgc04c169"><span class="section-number-2">2</span> Electron (electron group)</h2>
<div id="outline-container-org0079050" class="outline-2">
<h2 id="org0079050"><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="org75327cd" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="orgddfa06b" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -572,15 +585,15 @@ the number of &uarr; and &darr; electrons is fixed.
</div>
</div>
<div id="outline-container-org13b08f4" class="outline-2">
<h2 id="org13b08f4"><span class="section-number-2">3</span> Nucleus (nucleus group)</h2>
<div id="outline-container-org6af4211" class="outline-2">
<h2 id="org6af4211"><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="org46c8aaa" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org0ad98c8" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -647,8 +660,8 @@ given in Cartesian \((x,y,z)\) format.
</div>
</div>
<div id="outline-container-org34300f8" class="outline-2">
<h2 id="org34300f8"><span class="section-number-2">4</span> Effective core potentials (ecp group)</h2>
<div id="outline-container-orgae1cb45" class="outline-2">
<h2 id="orgae1cb45"><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
@ -681,7 +694,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="orgb6d1c1e" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org29f6312" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -783,8 +796,8 @@ If you encounter the aforementioned issue, please report it to our <a href="http
</p>
</div>
<div id="outline-container-org978cac1" class="outline-3">
<h3 id="org978cac1"><span class="section-number-3">4.1</span> Example</h3>
<div id="outline-container-org12a08ea" class="outline-3">
<h3 id="org12a08ea"><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
@ -847,8 +860,8 @@ power = [
</div>
</div>
<div id="outline-container-org668dbdf" class="outline-2">
<h2 id="org668dbdf"><span class="section-number-2">5</span> Basis set (basis group)</h2>
<div id="outline-container-org53ba67b" class="outline-2">
<h2 id="org53ba67b"><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
@ -901,7 +914,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="org7973a73" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org1ce2302" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -995,8 +1008,8 @@ All the basis set parameters are stored in one-dimensional arrays:
</table>
</div>
<div id="outline-container-orgd34cadf" class="outline-3">
<h3 id="orgd34cadf"><span class="section-number-3">5.1</span> Example</h3>
<div id="outline-container-orgaa057e8" class="outline-3">
<h3 id="orgaa057e8"><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
@ -1074,8 +1087,8 @@ prim_factor =
</div>
</div>
<div id="outline-container-org7cf49bd" class="outline-2">
<h2 id="org7cf49bd"><span class="section-number-2">6</span> Atomic orbitals (ao group)</h2>
<div id="outline-container-org7a073c2" class="outline-2">
<h2 id="org7a073c2"><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
@ -1128,13 +1141,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="#org668dbdf">Basis set</a> section) to \(\mathcal{N}_{z^2}\), which is the
the <a href="#org53ba67b">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="org61a0617" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="orgf42513a" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1186,8 +1199,8 @@ introduced here should be \(\frac{\mathcal{N}_{xy}}{\mathcal{N}_{z^2}}\).
</table>
</div>
<div id="outline-container-orgd38f3e0" class="outline-3">
<h3 id="ao_one_e"><a id="orgd38f3e0"></a><span class="section-number-3">6.1</span> One-electron integrals (<code>ao_1e_int</code> group)</h3>
<div id="outline-container-org81770c7" class="outline-3">
<h3 id="ao_one_e"><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}}
@ -1204,7 +1217,7 @@ The one-electron integrals for a one-electron operator \(\hat{O}\) are
over atomic orbitals.
</p>
<table id="org4dd8c75" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org8dce719" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1299,8 +1312,8 @@ over atomic orbitals.
</div>
</div>
<div id="outline-container-org050fc63" class="outline-3">
<h3 id="ao_two_e"><a id="org050fc63"></a><span class="section-number-3">6.2</span> Two-electron integrals (<code>ao_2e_int</code> group)</h3>
<div id="outline-container-orgbbaff9c" class="outline-3">
<h3 id="ao_two_e"><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
@ -1321,7 +1334,7 @@ notation.
\mathbf{r}_j \vert)}{\vert \mathbf{r}_i - \mathbf{r}_j \vert} \] : electron-electron long range potential</li>
</ul>
<table id="org3cb5f1f" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org9fa36c9" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1361,10 +1374,10 @@ notation.
</div>
</div>
<div id="outline-container-orgf92bb5a" class="outline-2">
<h2 id="orgf92bb5a"><span class="section-number-2">7</span> Molecular orbitals (mo group)</h2>
<div id="outline-container-org6617b7a" class="outline-2">
<h2 id="org6617b7a"><span class="section-number-2">7</span> Molecular orbitals (mo group)</h2>
<div class="outline-text-2" id="text-7">
<table id="org7bb4382" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org7c22ae8" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1451,8 +1464,8 @@ notation.
</table>
</div>
<div id="outline-container-org1afe0b4" class="outline-3">
<h3 id="org1afe0b4"><span class="section-number-3">7.1</span> One-electron integrals (<code>mo_1e_int</code> group)</h3>
<div id="outline-container-org0cb1ed8" class="outline-3">
<h3 id="org0cb1ed8"><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
@ -1460,7 +1473,7 @@ The operators as the same as those defined in the
the basis of molecular orbitals.
</p>
<table id="org3aa8268" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org884388a" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1555,16 +1568,26 @@ the basis of molecular orbitals.
</div>
</div>
<div id="outline-container-org756a28a" class="outline-3">
<h3 id="org756a28a"><span class="section-number-3">7.2</span> Two-electron integrals (<code>mo_2e_int</code> group)</h3>
<div id="outline-container-org304482e" class="outline-3">
<h3 id="org304482e"><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
The operators are the same as those defined in the
<a href="#ao_two_e">AO two-electron integrals section</a>. Here, the integrals are given in
the basis of molecular orbitals.
</p>
<table id="orgef3eabd" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<p>
The Cholesky decomposition of the integrals can also be stored:
</p>
<p>
\[
\A_{ijkl} = \sum_{\alpha} G_{il\alpha} G_{jl\alpha}
\]
</p>
<table id="orga4fac98" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1598,14 +1621,42 @@ the basis of molecular orbitals.
<td class="org-left"><code>(mo.num, mo.num, mo.num, mo.num)</code></td>
<td class="org-left">Long-range Electron repulsion integrals</td>
</tr>
<tr>
<td class="org-left"><code>eri_cholesky_num</code></td>
<td class="org-left"><code>dim</code></td>
<td class="org-left">&#xa0;</td>
<td class="org-left">Number of Cholesky vectors for ERI</td>
</tr>
<tr>
<td class="org-left"><code>eri_cholesky</code></td>
<td class="org-left"><code>float sparse</code></td>
<td class="org-left"><code>(mo.num, mo.num, rdm.2e_cholesky_num)</code></td>
<td class="org-left">Cholesky decomposition of the ERI</td>
</tr>
<tr>
<td class="org-left"><code>eri_lr_cholesky_num</code></td>
<td class="org-left"><code>dim</code></td>
<td class="org-left">&#xa0;</td>
<td class="org-left">Number of Cholesky vectors for long range ERI</td>
</tr>
<tr>
<td class="org-left"><code>eri_lr_cholesky</code></td>
<td class="org-left"><code>float sparse</code></td>
<td class="org-left"><code>(mo.num, mo.num, rdm.2e_cholesky_num)</code></td>
<td class="org-left">Cholesky decomposition of the long range ERI</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="outline-container-org0a53fe6" class="outline-2">
<h2 id="org0a53fe6"><span class="section-number-2">8</span> Slater determinants (determinant group)</h2>
<div id="outline-container-org8f33879" class="outline-2">
<h2 id="org8f33879"><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\)
@ -1647,7 +1698,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="org8a1fcba" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="orgf2f7c67" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1693,8 +1744,8 @@ An illustration on how to read determinants is presented in the <a href="./examp
</div>
</div>
<div id="outline-container-org333ce02" class="outline-2">
<h2 id="org333ce02"><span class="section-number-2">9</span> Configuration state functions (csf group)</h2>
<div id="outline-container-org0cdc8fe" class="outline-2">
<h2 id="org0cdc8fe"><span class="section-number-2">9</span> Configuration state functions (csf group)</h2>
<div class="outline-text-2" id="text-9">
<p>
The configuration interaction (CI) wave function \(\Psi\) can be
@ -1716,7 +1767,7 @@ matrix \(\langle D_I | \psi_J \rangle\) needed to project the CSFs in
the basis of Slater determinants.
</p>
<table id="orgeecf21a" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org2b9e692" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1762,8 +1813,8 @@ the basis of Slater determinants.
</div>
</div>
<div id="outline-container-org7b888e8" class="outline-2">
<h2 id="org7b888e8"><span class="section-number-2">10</span> Excited states (state group)</h2>
<div id="outline-container-orgef1389f" class="outline-2">
<h2 id="orgef1389f"><span class="section-number-2">10</span> Excited states (state group)</h2>
<div class="outline-text-2" id="text-10">
<p>
This group contains information about excited state. Since TREXIO version 2.3.0
@ -1778,7 +1829,7 @@ The <code>id</code> and <code>current_label</code> attributes have to be specifi
(containing both ground and excited state data).
</p>
<table id="orgdf45400" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org5d7fe36" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1838,8 +1889,8 @@ The <code>id</code> and <code>current_label</code> attributes have to be specifi
</div>
</div>
<div id="outline-container-org74887e9" class="outline-2">
<h2 id="org74887e9"><span class="section-number-2">11</span> Reduced density matrices (rdm group)</h2>
<div id="outline-container-org621cf81" class="outline-2">
<h2 id="org621cf81"><span class="section-number-2">11</span> Reduced density matrices (rdm group)</h2>
<div class="outline-text-2" id="text-11">
<p>
The reduced density matrices are defined in the basis of molecular
@ -1892,7 +1943,29 @@ The total energy can be computed as:
\]
</p>
<table id="org6d8997f" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<p>
To compress the storage, the Cholesky decomposition of the RDMs can
be stored:
</p>
<p>
\[
\Gamma_{ijkl} = \sum_{\alpha} G_{ij\alpha} G_{kl\alpha}
\]
</p>
<p>
Warning: as opposed to electron repulsion integrals, the
decomposition is made such that the Cholesky vectors are expanded
in a two-electron basis
\(f_{ij}(\mathbf{r}_1,\mathbf{r}_2) = \phi_i(\mathbf{r}_1) \phi_j(\mathbf{r}_2)\),
whereas in electron repulsion integrals each Cholesky vector is
expressed in a basis of a one-electron function
\(g_{ik}(\mathbf{r}_1) = \phi_i(\mathbf{r}_1) \phi_k(\mathbf{r}_1)\).
</p>
<table id="org1264d51" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -1968,15 +2041,85 @@ The total energy can be computed as:
<td class="org-left"><code>(mo.num, mo.num, mo.num, mo.num)</code></td>
<td class="org-left">&darr;&uarr; component of the two-body reduced density matrix</td>
</tr>
<tr>
<td class="org-left"><code>2e_cholesky_num</code></td>
<td class="org-left"><code>dim</code></td>
<td class="org-left">&#xa0;</td>
<td class="org-left">Number of Cholesky vectors</td>
</tr>
<tr>
<td class="org-left"><code>2e_cholesky</code></td>
<td class="org-left"><code>float sparse</code></td>
<td class="org-left"><code>(mo.num, mo.num, rdm.2e_cholesky_num)</code></td>
<td class="org-left">Cholesky decomposition of the Two-body RDM (spin trace)</td>
</tr>
<tr>
<td class="org-left"><code>2e_upup_cholesky_num</code></td>
<td class="org-left"><code>dim</code></td>
<td class="org-left">&#xa0;</td>
<td class="org-left">Number of Cholesky vectors</td>
</tr>
<tr>
<td class="org-left"><code>2e_upup_cholesky</code></td>
<td class="org-left"><code>float sparse</code></td>
<td class="org-left"><code>(mo.num, mo.num, rdm.2e_upup_cholesky_num)</code></td>
<td class="org-left">Cholesky decomposition of the Two-body RDM (&uarr;&uarr;)</td>
</tr>
<tr>
<td class="org-left"><code>2e_dndn_cholesky_num</code></td>
<td class="org-left"><code>dim</code></td>
<td class="org-left">&#xa0;</td>
<td class="org-left">Number of Cholesky vectors</td>
</tr>
<tr>
<td class="org-left"><code>2e_dndn_cholesky</code></td>
<td class="org-left"><code>float sparse</code></td>
<td class="org-left"><code>(mo.num, mo.num, rdm.2e_dndn_cholesky_num)</code></td>
<td class="org-left">Cholesky decomposition of the Two-body RDM (&darr;&darr;)</td>
</tr>
<tr>
<td class="org-left"><code>2e_updn_cholesky_num</code></td>
<td class="org-left"><code>dim</code></td>
<td class="org-left">&#xa0;</td>
<td class="org-left">Number of Cholesky vectors</td>
</tr>
<tr>
<td class="org-left"><code>2e_updn_cholesky</code></td>
<td class="org-left"><code>float sparse</code></td>
<td class="org-left"><code>(mo.num, mo.num, rdm.2e_updn_cholesky_num)</code></td>
<td class="org-left">Cholesky decomposition of the Two-body RDM (&uarr;&darr;)</td>
</tr>
<tr>
<td class="org-left"><code>2e_dnup_cholesky_num</code></td>
<td class="org-left"><code>dim</code></td>
<td class="org-left">&#xa0;</td>
<td class="org-left">Number of Cholesky vectors</td>
</tr>
<tr>
<td class="org-left"><code>2e_dnup_cholesky</code></td>
<td class="org-left"><code>float sparse</code></td>
<td class="org-left"><code>(mo.num, mo.num, rdm.2e_dnup_cholesky_num)</code></td>
<td class="org-left">Cholesky decomposition of the Two-body RDM (&darr;&uarr;)</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="outline-container-orgf261075" class="outline-2">
<h2 id="orgf261075"><span class="section-number-2">12</span> Cell (cell group)</h2>
<div id="outline-container-org67fd674" class="outline-2">
<h2 id="org67fd674"><span class="section-number-2">12</span> Cell (cell group)</h2>
<div class="outline-text-2" id="text-12">
<table id="orgc0bedae" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org406e544" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -2022,10 +2165,10 @@ The total energy can be computed as:
</div>
</div>
<div id="outline-container-org73ad001" class="outline-2">
<h2 id="org73ad001"><span class="section-number-2">13</span> Periodic boundary calculations (pbc group)</h2>
<div id="outline-container-org821a9c6" class="outline-2">
<h2 id="org821a9c6"><span class="section-number-2">13</span> Periodic boundary calculations (pbc group)</h2>
<div class="outline-text-2" id="text-13">
<table id="org56f31da" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="orgda0b833" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -2064,8 +2207,8 @@ The total energy can be computed as:
</div>
</div>
<div id="outline-container-org6b885a5" class="outline-2">
<h2 id="org6b885a5"><span class="section-number-2">14</span> Quantum Monte Carlo data (qmc group)</h2>
<div id="outline-container-org4a41efa" class="outline-2">
<h2 id="org4a41efa"><span class="section-number-2">14</span> Quantum Monte Carlo data (qmc group)</h2>
<div class="outline-text-2" id="text-14">
<p>
In quantum Monte Carlo calculations, the wave function is evaluated
@ -2079,7 +2222,7 @@ By convention, the electron coordinates contain first all the electrons
of $&uarr;$-spin and then all the $&darr;$-spin.
</p>
<table id="org9ba3c53" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<table id="org8bd07f0" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
@ -2134,7 +2277,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-10-07 Fri 12:58</p>
<p class="date">Created: 2022-12-01 Thu 18:20</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>