mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2024-11-03 12:43:57 +01:00
2872 lines
135 KiB
HTML
2872 lines
135 KiB
HTML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||
<head>
|
||
<!-- 2021-02-19 Fri 00:40 -->
|
||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
<title>QMCkl source code documentation</title>
|
||
<meta name="generator" content="Org mode" />
|
||
<style type="text/css">
|
||
<!--/*--><![CDATA[/*><!--*/
|
||
.title { text-align: center;
|
||
margin-bottom: .2em; }
|
||
.subtitle { text-align: center;
|
||
font-size: medium;
|
||
font-weight: bold;
|
||
margin-top:0; }
|
||
.todo { font-family: monospace; color: red; }
|
||
.done { font-family: monospace; color: green; }
|
||
.priority { font-family: monospace; color: orange; }
|
||
.tag { background-color: #eee; font-family: monospace;
|
||
padding: 2px; font-size: 80%; font-weight: normal; }
|
||
.timestamp { color: #bebebe; }
|
||
.timestamp-kwd { color: #5f9ea0; }
|
||
.org-right { margin-left: auto; margin-right: 0px; text-align: right; }
|
||
.org-left { margin-left: 0px; margin-right: auto; text-align: left; }
|
||
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
|
||
.underline { text-decoration: underline; }
|
||
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
|
||
p.verse { margin-left: 3%; }
|
||
pre {
|
||
border: 1px solid #ccc;
|
||
box-shadow: 3px 3px 3px #eee;
|
||
padding: 8pt;
|
||
font-family: monospace;
|
||
overflow: auto;
|
||
margin: 1.2em;
|
||
}
|
||
pre.src {
|
||
position: relative;
|
||
overflow: visible;
|
||
padding-top: 1.2em;
|
||
}
|
||
pre.src:before {
|
||
display: none;
|
||
position: absolute;
|
||
background-color: white;
|
||
top: -10px;
|
||
right: 10px;
|
||
padding: 3px;
|
||
border: 1px solid black;
|
||
}
|
||
pre.src:hover:before { display: inline;}
|
||
/* Languages per Org manual */
|
||
pre.src-asymptote:before { content: 'Asymptote'; }
|
||
pre.src-awk:before { content: 'Awk'; }
|
||
pre.src-C:before { content: 'C'; }
|
||
/* pre.src-C++ doesn't work in CSS */
|
||
pre.src-clojure:before { content: 'Clojure'; }
|
||
pre.src-css:before { content: 'CSS'; }
|
||
pre.src-D:before { content: 'D'; }
|
||
pre.src-ditaa:before { content: 'ditaa'; }
|
||
pre.src-dot:before { content: 'Graphviz'; }
|
||
pre.src-calc:before { content: 'Emacs Calc'; }
|
||
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
|
||
pre.src-fortran:before { content: 'Fortran'; }
|
||
pre.src-gnuplot:before { content: 'gnuplot'; }
|
||
pre.src-haskell:before { content: 'Haskell'; }
|
||
pre.src-hledger:before { content: 'hledger'; }
|
||
pre.src-java:before { content: 'Java'; }
|
||
pre.src-js:before { content: 'Javascript'; }
|
||
pre.src-latex:before { content: 'LaTeX'; }
|
||
pre.src-ledger:before { content: 'Ledger'; }
|
||
pre.src-lisp:before { content: 'Lisp'; }
|
||
pre.src-lilypond:before { content: 'Lilypond'; }
|
||
pre.src-lua:before { content: 'Lua'; }
|
||
pre.src-matlab:before { content: 'MATLAB'; }
|
||
pre.src-mscgen:before { content: 'Mscgen'; }
|
||
pre.src-ocaml:before { content: 'Objective Caml'; }
|
||
pre.src-octave:before { content: 'Octave'; }
|
||
pre.src-org:before { content: 'Org mode'; }
|
||
pre.src-oz:before { content: 'OZ'; }
|
||
pre.src-plantuml:before { content: 'Plantuml'; }
|
||
pre.src-processing:before { content: 'Processing.js'; }
|
||
pre.src-python:before { content: 'Python'; }
|
||
pre.src-R:before { content: 'R'; }
|
||
pre.src-ruby:before { content: 'Ruby'; }
|
||
pre.src-sass:before { content: 'Sass'; }
|
||
pre.src-scheme:before { content: 'Scheme'; }
|
||
pre.src-screen:before { content: 'Gnu Screen'; }
|
||
pre.src-sed:before { content: 'Sed'; }
|
||
pre.src-sh:before { content: 'shell'; }
|
||
pre.src-sql:before { content: 'SQL'; }
|
||
pre.src-sqlite:before { content: 'SQLite'; }
|
||
/* additional languages in org.el's org-babel-load-languages alist */
|
||
pre.src-forth:before { content: 'Forth'; }
|
||
pre.src-io:before { content: 'IO'; }
|
||
pre.src-J:before { content: 'J'; }
|
||
pre.src-makefile:before { content: 'Makefile'; }
|
||
pre.src-maxima:before { content: 'Maxima'; }
|
||
pre.src-perl:before { content: 'Perl'; }
|
||
pre.src-picolisp:before { content: 'Pico Lisp'; }
|
||
pre.src-scala:before { content: 'Scala'; }
|
||
pre.src-shell:before { content: 'Shell Script'; }
|
||
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
|
||
/* additional language identifiers per "defun org-babel-execute"
|
||
in ob-*.el */
|
||
pre.src-cpp:before { content: 'C++'; }
|
||
pre.src-abc:before { content: 'ABC'; }
|
||
pre.src-coq:before { content: 'Coq'; }
|
||
pre.src-groovy:before { content: 'Groovy'; }
|
||
/* additional language identifiers from org-babel-shell-names in
|
||
ob-shell.el: ob-shell is the only babel language using a lambda to put
|
||
the execution function name together. */
|
||
pre.src-bash:before { content: 'bash'; }
|
||
pre.src-csh:before { content: 'csh'; }
|
||
pre.src-ash:before { content: 'ash'; }
|
||
pre.src-dash:before { content: 'dash'; }
|
||
pre.src-ksh:before { content: 'ksh'; }
|
||
pre.src-mksh:before { content: 'mksh'; }
|
||
pre.src-posh:before { content: 'posh'; }
|
||
/* Additional Emacs modes also supported by the LaTeX listings package */
|
||
pre.src-ada:before { content: 'Ada'; }
|
||
pre.src-asm:before { content: 'Assembler'; }
|
||
pre.src-caml:before { content: 'Caml'; }
|
||
pre.src-delphi:before { content: 'Delphi'; }
|
||
pre.src-html:before { content: 'HTML'; }
|
||
pre.src-idl:before { content: 'IDL'; }
|
||
pre.src-mercury:before { content: 'Mercury'; }
|
||
pre.src-metapost:before { content: 'MetaPost'; }
|
||
pre.src-modula-2:before { content: 'Modula-2'; }
|
||
pre.src-pascal:before { content: 'Pascal'; }
|
||
pre.src-ps:before { content: 'PostScript'; }
|
||
pre.src-prolog:before { content: 'Prolog'; }
|
||
pre.src-simula:before { content: 'Simula'; }
|
||
pre.src-tcl:before { content: 'tcl'; }
|
||
pre.src-tex:before { content: 'TeX'; }
|
||
pre.src-plain-tex:before { content: 'Plain TeX'; }
|
||
pre.src-verilog:before { content: 'Verilog'; }
|
||
pre.src-vhdl:before { content: 'VHDL'; }
|
||
pre.src-xml:before { content: 'XML'; }
|
||
pre.src-nxml:before { content: 'XML'; }
|
||
/* add a generic configuration mode; LaTeX export needs an additional
|
||
(add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
|
||
pre.src-conf:before { content: 'Configuration File'; }
|
||
|
||
table { border-collapse:collapse; }
|
||
caption.t-above { caption-side: top; }
|
||
caption.t-bottom { caption-side: bottom; }
|
||
td, th { vertical-align:top; }
|
||
th.org-right { text-align: center; }
|
||
th.org-left { text-align: center; }
|
||
th.org-center { text-align: center; }
|
||
td.org-right { text-align: right; }
|
||
td.org-left { text-align: left; }
|
||
td.org-center { text-align: center; }
|
||
dt { font-weight: bold; }
|
||
.footpara { display: inline; }
|
||
.footdef { margin-bottom: 1em; }
|
||
.figure { padding: 1em; }
|
||
.figure p { text-align: center; }
|
||
.inlinetask {
|
||
padding: 10px;
|
||
border: 2px solid gray;
|
||
margin: 10px;
|
||
background: #ffffcc;
|
||
}
|
||
#org-div-home-and-up
|
||
{ text-align: right; font-size: 70%; white-space: nowrap; }
|
||
textarea { overflow-x: auto; }
|
||
.linenr { font-size: smaller }
|
||
.code-highlighted { background-color: #ffff00; }
|
||
.org-info-js_info-navigation { border-style: none; }
|
||
#org-info-js_console-label
|
||
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
|
||
.org-info-js_search-highlight
|
||
{ background-color: #ffff00; color: #000000; font-weight: bold; }
|
||
.org-svg { width: 90%; }
|
||
/*]]>*/-->
|
||
</style>
|
||
<link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/htmlize.css"/>
|
||
<link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/readtheorg.css"/>
|
||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
|
||
<script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/lib/js/jquery.stickytableheaders.min.js"></script>
|
||
<script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/js/readtheorg.js"></script>
|
||
<script type="text/javascript">
|
||
/*
|
||
@licstart The following is the entire license notice for the
|
||
JavaScript code in this tag.
|
||
|
||
Copyright (C) 2012-2019 Free Software Foundation, Inc.
|
||
|
||
The JavaScript code in this tag is free software: you can
|
||
redistribute it and/or modify it under the terms of the GNU
|
||
General Public License (GNU GPL) as published by the Free Software
|
||
Foundation, either version 3 of the License, or (at your option)
|
||
any later version. The code is distributed WITHOUT ANY WARRANTY;
|
||
without even the implied warranty of MERCHANTABILITY or FITNESS
|
||
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
|
||
|
||
As additional permission under GNU GPL version 3 section 7, you
|
||
may distribute non-source (e.g., minimized or compacted) forms of
|
||
that code without the copy of the GNU GPL normally required by
|
||
section 4, provided you include this license notice and a URL
|
||
through which recipients can access the Corresponding Source.
|
||
|
||
|
||
@licend The above is the entire license notice
|
||
for the JavaScript code in this tag.
|
||
*/
|
||
<!--/*--><![CDATA[/*><!--*/
|
||
function CodeHighlightOn(elem, id)
|
||
{
|
||
var target = document.getElementById(id);
|
||
if(null != target) {
|
||
elem.cacheClassElem = elem.className;
|
||
elem.cacheClassTarget = target.className;
|
||
target.className = "code-highlighted";
|
||
elem.className = "code-highlighted";
|
||
}
|
||
}
|
||
function CodeHighlightOff(elem, id)
|
||
{
|
||
var target = document.getElementById(id);
|
||
if(elem.cacheClassElem)
|
||
elem.className = elem.cacheClassElem;
|
||
if(elem.cacheClassTarget)
|
||
target.className = elem.cacheClassTarget;
|
||
}
|
||
/*]]>*///-->
|
||
</script>
|
||
<script type="text/x-mathjax-config">
|
||
MathJax.Hub.Config({
|
||
displayAlign: "center",
|
||
displayIndent: "0em",
|
||
|
||
"HTML-CSS": { scale: 100,
|
||
linebreaks: { automatic: "false" },
|
||
webFont: "TeX"
|
||
},
|
||
SVG: {scale: 100,
|
||
linebreaks: { automatic: "false" },
|
||
font: "TeX"},
|
||
NativeMML: {scale: 100},
|
||
TeX: { equationNumbers: {autoNumber: "AMS"},
|
||
MultLineWidth: "85%",
|
||
TagSide: "right",
|
||
TagIndent: ".8em"
|
||
}
|
||
});
|
||
</script>
|
||
<script type="text/javascript"
|
||
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML"></script>
|
||
</head>
|
||
<body>
|
||
<div id="content">
|
||
<h1 class="title">QMCkl source code documentation</h1>
|
||
<div id="table-of-contents">
|
||
<h2>Table of Contents</h2>
|
||
<div id="text-table-of-contents">
|
||
<ul>
|
||
<li><a href="#orgd8513bb">1. Introduction</a>
|
||
<ul>
|
||
<li><a href="#orge6721e0">1.1. Language used</a></li>
|
||
<li><a href="#orge3f3a7a">1.2. Source code editing</a></li>
|
||
<li><a href="#orgc1ab2f1">1.3. Writing in Fortran</a></li>
|
||
<li><a href="#org712fc52">1.4. Coding style</a></li>
|
||
<li><a href="#org1992366">1.5. Design of the library</a>
|
||
<ul>
|
||
<li><a href="#org7d10ad7">1.5.1. Naming conventions</a></li>
|
||
<li><a href="#orgde65c59">1.5.2. Application programming interface</a></li>
|
||
<li><a href="#orgfdd0d3a">1.5.3. Global state</a></li>
|
||
<li><a href="#orgb771a4d">1.5.4. Low-level functions</a></li>
|
||
<li><a href="#org8b7ca0d">1.5.5. High-level functions</a></li>
|
||
<li><a href="#org932e4d9">1.5.6. Numerical precision</a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a href="#orgad0925a">1.6. Algorithms</a></li>
|
||
<li><a href="#orga6789b6">1.7. Rules for the API</a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a href="#org3cbeb94">2. Documentation</a>
|
||
<ul>
|
||
<li><a href="#orgd91a65e">2.1. <code>qmckl.h</code> header file</a>
|
||
<ul>
|
||
<li><a href="#org8764577">2.1.1. Constants</a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a href="#org813d24e">2.2. Memory management</a>
|
||
<ul>
|
||
<li><a href="#org09cefda">2.2.1. <code>qmckl_malloc</code></a></li>
|
||
<li><a href="#org406a1c3">2.2.2. <code>qmckl_free</code></a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a href="#org0640218">2.3. Context</a>
|
||
<ul>
|
||
<li><a href="#orgd9c0b6f">2.3.1. Context</a></li>
|
||
<li><a href="#org163f3be">2.3.2. Basis set</a></li>
|
||
<li><a href="#org72f1bc8">2.3.3. Precision</a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a href="#org195ac19">2.4. Computation of distances</a>
|
||
<ul>
|
||
<li><a href="#orga14880c">2.4.1. Squared distance</a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a href="#orgd6c92e4">2.5. Atomic Orbitals</a>
|
||
<ul>
|
||
<li><a href="#org479343c">2.5.1. Polynomials</a></li>
|
||
<li><a href="#org6397a61">2.5.2. Gaussian basis functions</a></li>
|
||
<li><a href="#org1f80bc0">2.5.3. <span class="todo TODO">TODO</span> Slater basis functions</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li><a href="#org259b251">3. Acknowledgments</a></li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="outline-container-orgd8513bb" class="outline-2">
|
||
<h2 id="orgd8513bb"><span class="section-number-2">1</span> Introduction</h2>
|
||
<div class="outline-text-2" id="text-1">
|
||
<p>
|
||
The ultimate goal of QMCkl is to provide a high-performance
|
||
implementation of the main kernels of QMC. In this particular
|
||
repository, we focus on the definition of the API and the tests, and
|
||
on a <i>pedagogical</i> presentation of the algorithms. We expect the
|
||
HPC experts to use this repository as a reference for re-writing
|
||
optimized libraries.
|
||
</p>
|
||
|
||
<p>
|
||
Literate programming is particularly adapted in this context.
|
||
Source files are written in <a href="https://karl-voit.at/2017/09/23/orgmode-as-markup-only/">org-mode</a> format, to provide useful
|
||
comments and LaTex formulas close to the code. There exists multiple
|
||
possibilities to convert org-mode files into different formats such
|
||
as HTML or pdf. For a tutorial on literate programming with
|
||
org-mode, follow <a href="http://www.howardism.org/Technical/Emacs/literate-programming-tutorial.html">this link</a>.
|
||
</p>
|
||
|
||
<p>
|
||
The code is extracted from the org files using Emacs as a
|
||
command-line tool in the <code>Makefile</code>, and then the produced files are
|
||
compiled.
|
||
</p>
|
||
</div>
|
||
|
||
<div id="outline-container-orge6721e0" class="outline-3">
|
||
<h3 id="orge6721e0"><span class="section-number-3">1.1</span> Language used</h3>
|
||
<div class="outline-text-3" id="text-1-1">
|
||
<p>
|
||
Fortran is one of the most common languages used by the community,
|
||
and is simple enough to make the algorithms readable. Hence we
|
||
propose in this pedagogical implementation of QMCkl to use Fortran
|
||
to express the algorithms. For specific internal functions where
|
||
the C language is more natural, C is used.
|
||
</p>
|
||
|
||
<p>
|
||
As Fortran modules generate compiler-dependent files, the use of
|
||
modules is restricted to the internal use of the library, otherwise
|
||
the compliance with C is violated.
|
||
</p>
|
||
|
||
<p>
|
||
The external dependencies should be kept as small as possible, so
|
||
external libraries should be used <i>only</i> if their used is strongly
|
||
justified.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="outline-container-orge3f3a7a" class="outline-3">
|
||
<h3 id="orge3f3a7a"><span class="section-number-3">1.2</span> Source code editing</h3>
|
||
<div class="outline-text-3" id="text-1-2">
|
||
<p>
|
||
Any text editor can be used to edit org-mode files. For a better
|
||
user experience Emacs is recommended. For users hating Emacs, it
|
||
is good to know that Emacs can behave like Vim when switched into
|
||
``Evil'' mode. There also exists <a href="https://www.spacemacs.org">Spacemacs</a> which helps the
|
||
transition for Vim users.
|
||
</p>
|
||
|
||
<p>
|
||
For users with a preference for Jupyter notebooks, the following
|
||
script can convert jupyter notebooks to org-mode files:
|
||
</p>
|
||
|
||
<div class="org-src-container">
|
||
<pre class="src src-sh">#<span style="color: #b22222;">!/bin/</span><span style="color: #a020f0;">bash</span>
|
||
# <span style="color: #b22222;">$ nb_to_org.sh notebook.ipynb</span>
|
||
# <span style="color: #b22222;">produces the org-mode file notebook.org</span>
|
||
|
||
<span style="color: #483d8b;">set</span> -e
|
||
|
||
<span style="color: #a0522d;">nb</span>=$(basename $<span style="color: #a0522d;">1</span> .ipynb)
|
||
jupyter nbconvert --to markdown ${<span style="color: #a0522d;">nb</span>}.ipynb --output ${<span style="color: #a0522d;">nb</span>}.md
|
||
pandoc ${<span style="color: #a0522d;">nb</span>}.md -o ${<span style="color: #a0522d;">nb</span>}.org
|
||
rm ${<span style="color: #a0522d;">nb</span>}.md
|
||
</pre>
|
||
</div>
|
||
|
||
<p>
|
||
And pandoc can convert multiple markdown formats into org-mode.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="outline-container-orgc1ab2f1" class="outline-3">
|
||
<h3 id="orgc1ab2f1"><span class="section-number-3">1.3</span> Writing in Fortran</h3>
|
||
<div class="outline-text-3" id="text-1-3">
|
||
<p>
|
||
The Fortran source files should provide a C interface using
|
||
<code>iso_c_binding</code>. The name of the Fortran source files should end
|
||
with <code>_f.f90</code> to be properly handled by the Makefile. The names of
|
||
the functions defined in fortran should be the same as those
|
||
exposed in the API suffixed by <code>_f</code>. Fortran interface files
|
||
should also be written in the <code>qmckl_f.f90</code> file.
|
||
</p>
|
||
|
||
<p>
|
||
For more guidelines on using Fortran to generate a C interface, see
|
||
<a href="http://fortranwiki.org/fortran/show/Generating+C+Interfaces">this link</a>.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="outline-container-org712fc52" class="outline-3">
|
||
<h3 id="org712fc52"><span class="section-number-3">1.4</span> Coding style</h3>
|
||
<div class="outline-text-3" id="text-1-4">
|
||
<p>
|
||
To improve readability, we maintain a consistent coding style in
|
||
the library.
|
||
</p>
|
||
|
||
<ul class="org-ul">
|
||
<li>For C source files, we will use <span class="underline"><span class="underline">(decide on a coding style)</span></span></li>
|
||
<li>For Fortran source files, we will use <span class="underline"><span class="underline">(decide on a coding
|
||
style)</span></span></li>
|
||
</ul>
|
||
|
||
<p>
|
||
Coding style can be automatically checked with <a href="https://clang.llvm.org/docs/ClangFormat.html">clang-format</a>.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="outline-container-org1992366" class="outline-3">
|
||
<h3 id="org1992366"><span class="section-number-3">1.5</span> Design of the library</h3>
|
||
<div class="outline-text-3" id="text-1-5">
|
||
<p>
|
||
The proposed API should allow the library to:
|
||
</p>
|
||
<ul class="org-ul">
|
||
<li>deal with memory transfers between CPU and accelerators</li>
|
||
<li>use different levels of floating-point precision</li>
|
||
</ul>
|
||
|
||
<p>
|
||
We chose a multi-layered design with low-level and high-level
|
||
functions (see below).
|
||
</p>
|
||
</div>
|
||
|
||
<div id="outline-container-org7d10ad7" class="outline-4">
|
||
<h4 id="org7d10ad7"><span class="section-number-4">1.5.1</span> Naming conventions</h4>
|
||
<div class="outline-text-4" id="text-1-5-1">
|
||
<p>
|
||
Use <code>qmckl_</code> as a prefix for all exported functions and variables.
|
||
All exported header files should have a filename with the prefix
|
||
<code>qmckl_</code>.
|
||
</p>
|
||
|
||
<p>
|
||
If the name of the org-mode file is <code>xxx.org</code>, the name of the
|
||
produced C files should be <code>xxx.c</code> and <code>xxx.h</code> and the name of the
|
||
produced Fortran files should be <code>xxx.f90</code>
|
||
</p>
|
||
|
||
<p>
|
||
Arrays are in uppercase and scalars are in lowercase.
|
||
</p>
|
||
|
||
<p>
|
||
In the names of the variables and functions, only the singular
|
||
form is allowed.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="outline-container-orgde65c59" class="outline-4">
|
||
<h4 id="orgde65c59"><span class="section-number-4">1.5.2</span> Application programming interface</h4>
|
||
<div class="outline-text-4" id="text-1-5-2">
|
||
<p>
|
||
The application programming interface (API) is designed to be
|
||
compatible with the C programming language (not C++), to ensure
|
||
that the library will be easily usable in <i>any</i> language. This
|
||
implies that only the following data types are allowed in the API:
|
||
</p>
|
||
|
||
<ul class="org-ul">
|
||
<li>32-bit and 64-bit floats and arrays (<code>real</code> and <code>double</code>)</li>
|
||
<li>32-bit and 64-bit integers and arrays (<code>int32_t</code> and <code>int64_t</code>)</li>
|
||
<li>Pointers should be represented as 64-bit integers (even on
|
||
32-bit architectures)</li>
|
||
<li>ASCII strings are represented as a pointers to a character
|
||
arrays and terminated by a zero character (C convention).</li>
|
||
</ul>
|
||
|
||
<p>
|
||
Complex numbers can be represented by an array of 2 floats.
|
||
</p>
|
||
|
||
<p>
|
||
To facilitate the use in other languages than C, we provide some
|
||
bindings in other languages in other repositories.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="outline-container-orgfdd0d3a" class="outline-4">
|
||
<h4 id="orgfdd0d3a"><span class="section-number-4">1.5.3</span> Global state</h4>
|
||
<div class="outline-text-4" id="text-1-5-3">
|
||
<p>
|
||
Global variables should be avoided in the library, because it is
|
||
possible that one single program needs to use multiple instances
|
||
of the library. To solve this problem we propose to use a pointer
|
||
to a <code>context</code> variable, built by the library with the
|
||
<code>qmckl_context_create</code> function. The <code>context</code> contains the global
|
||
state of the library, and is used as the first argument of many
|
||
QMCkl functions.
|
||
</p>
|
||
|
||
<p>
|
||
The internal structure of the context is not specified, to give a
|
||
maximum of freedom to the different implementations. Modifying
|
||
the state is done by setters and getters, prefixed by
|
||
<code>qmckl_context_set_</code> an <code>qmckl_context_get_</code>. When a context
|
||
variable is modified by a setter, a copy of the old data structure
|
||
is made and updated, and the pointer to the new data structure is
|
||
returned, such that the old contexts can still be accessed. It is
|
||
also possible to modify the state in an impure fashion, using the
|
||
<code>qmckl_context_update_</code> functions. The context and its old
|
||
versions can be destroyed with <code>qmckl_context_destroy</code>.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="outline-container-orgb771a4d" class="outline-4">
|
||
<h4 id="orgb771a4d"><span class="section-number-4">1.5.4</span> Low-level functions</h4>
|
||
<div class="outline-text-4" id="text-1-5-4">
|
||
<p>
|
||
Low-level functions are very simple functions which are leaves of
|
||
the function call tree (they don't call any other QMCkl function).
|
||
</p>
|
||
|
||
<p>
|
||
These functions are <i>pure</i>, and unaware of the QMCkl
|
||
<code>context</code>. They are not allowed to allocate/deallocate memory, and
|
||
if they need temporary memory it should be provided in input.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="outline-container-org8b7ca0d" class="outline-4">
|
||
<h4 id="org8b7ca0d"><span class="section-number-4">1.5.5</span> High-level functions</h4>
|
||
<div class="outline-text-4" id="text-1-5-5">
|
||
<p>
|
||
High-level functions are at the top of the function call tree.
|
||
They are able to choose which lower-level function to call
|
||
depending on the required precision, and do the corresponding type
|
||
conversions. These functions are also responsible for allocating
|
||
temporary storage, to simplify the use of accelerators.
|
||
</p>
|
||
|
||
<p>
|
||
The high-level functions should be pure, unless the introduction
|
||
of non-purity is justified. All the side effects should be made in
|
||
the <code>context</code> variable.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="outline-container-org932e4d9" class="outline-4">
|
||
<h4 id="org932e4d9"><span class="section-number-4">1.5.6</span> Numerical precision</h4>
|
||
<div class="outline-text-4" id="text-1-5-6">
|
||
<p>
|
||
The number of bits of precision required for a function should be
|
||
given as an input of low-level computational functions. This input
|
||
will be used to define the values of the different thresholds that
|
||
might be used to avoid computing unnecessary noise. High-level
|
||
functions will use the precision specified in the <code>context</code>
|
||
variable.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="outline-container-orgad0925a" class="outline-3">
|
||
<h3 id="orgad0925a"><span class="section-number-3">1.6</span> Algorithms</h3>
|
||
<div class="outline-text-3" id="text-1-6">
|
||
<p>
|
||
Reducing the scaling of an algorithm usually implies also reducing
|
||
its arithmetic complexity (number of flops per byte). Therefore,
|
||
for small sizes \(\mathcal{O}(N^3)\) and \(\mathcal{O}(N^2)\)
|
||
algorithms are better adapted than linear scaling algorithms. As
|
||
QMCkl is a general purpose library, multiple algorithms should be
|
||
implemented adapted to different problem sizes.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="outline-container-orga6789b6" class="outline-3">
|
||
<h3 id="orga6789b6"><span class="section-number-3">1.7</span> Rules for the API</h3>
|
||
<div class="outline-text-3" id="text-1-7">
|
||
<ul class="org-ul">
|
||
<li><code>stdint</code> should be used for integers (<code>int32_t</code>, <code>int64_t</code>)</li>
|
||
<li>integers used for counting should always be <code>int64_t</code></li>
|
||
<li>floats should be by default <code>double</code>, unless explicitly mentioned</li>
|
||
<li>pointers are converted to <code>int64_t</code> to increase portability</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="outline-container-org3cbeb94" class="outline-2">
|
||
<h2 id="org3cbeb94"><span class="section-number-2">2</span> Documentation</h2>
|
||
<div class="outline-text-2" id="text-2">
|
||
</div>
|
||
<div id="outline-container-orgd91a65e" class="outline-3">
|
||
<h3 id="orgd91a65e"><span class="section-number-3">2.1</span> <code>qmckl.h</code> header file</h3>
|
||
<div class="outline-text-3" id="text-2-1">
|
||
<p>
|
||
This file produces the <code>qmckl.h</code> header file, which is to be included
|
||
when qmckl functions are used.
|
||
</p>
|
||
|
||
<p>
|
||
We also create here the <code>qmckl_f.f90</code> which is the Fortran interface file.
|
||
</p>
|
||
</div>
|
||
|
||
<div id="outline-container-org8764577" class="outline-4">
|
||
<h4 id="org8764577"><span class="section-number-4">2.1.1</span> Constants</h4>
|
||
<div class="outline-text-4" id="text-2-1-1">
|
||
</div>
|
||
<ol class="org-ol">
|
||
<li><a id="org1d3887b"></a>Success/failure<br />
|
||
<div class="outline-text-5" id="text-2-1-1-1">
|
||
<p>
|
||
These are the codes returned by the functions to indicate success
|
||
or failure. All such functions should have as a return type <code>qmckl_exit_code</code>.
|
||
</p>
|
||
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #483d8b;">#define</span> <span style="color: #a0522d;">QMCKL_SUCCESS</span> 0
|
||
<span style="color: #483d8b;">#define</span> <span style="color: #a0522d;">QMCKL_FAILURE</span> 1
|
||
|
||
<span style="color: #a020f0;">typedef</span> <span style="color: #228b22;">int32_t</span> <span style="color: #228b22;">qmckl_exit_code</span>;
|
||
<span style="color: #a020f0;">typedef</span> <span style="color: #228b22;">int64_t</span> <span style="color: #228b22;">qmckl_context</span> ;
|
||
|
||
</pre>
|
||
</div>
|
||
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #228b22;">integer</span>, <span style="color: #a020f0;">parameter</span> ::<span style="color: #a0522d;"> QMCKL_SUCCESS = 0</span>
|
||
<span style="color: #228b22;">integer</span>, <span style="color: #a020f0;">parameter</span> ::<span style="color: #a0522d;"> QMCKL_FAILURE = 0</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org33779d0"></a>Precision-related constants<br />
|
||
<div class="outline-text-5" id="text-2-1-1-2">
|
||
<p>
|
||
Controlling numerical precision enables optimizations. Here, the
|
||
default parameters determining the target numerical precision and
|
||
range are defined.
|
||
</p>
|
||
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #483d8b;">#define</span> <span style="color: #a0522d;">QMCKL_DEFAULT_PRECISION</span> 53
|
||
<span style="color: #483d8b;">#define</span> <span style="color: #a0522d;">QMCKL_DEFAULT_RANGE</span> 11
|
||
</pre>
|
||
</div>
|
||
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #228b22;">integer</span>, <span style="color: #a020f0;">parameter</span> ::<span style="color: #a0522d;"> QMCKL_DEFAULT_PRECISION = 53</span>
|
||
<span style="color: #228b22;">integer</span>, <span style="color: #a020f0;">parameter</span> ::<span style="color: #a0522d;"> QMCKL_DEFAULT_RANGE = 11</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
</div>
|
||
</div>
|
||
<div id="outline-container-org813d24e" class="outline-3">
|
||
<h3 id="org813d24e"><span class="section-number-3">2.2</span> Memory management</h3>
|
||
<div class="outline-text-3" id="text-2-2">
|
||
<p>
|
||
We override the allocation functions to enable the possibility of
|
||
optimized libraries to fine-tune the memory allocation.
|
||
</p>
|
||
|
||
<p>
|
||
2 files are produced:
|
||
</p>
|
||
<ul class="org-ul">
|
||
<li>a source file : <code>qmckl_memory.c</code></li>
|
||
<li>a test file : <code>test_qmckl_memory.c</code></li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div id="outline-container-org09cefda" class="outline-4">
|
||
<h4 id="org09cefda"><span class="section-number-4">2.2.1</span> <code>qmckl_malloc</code></h4>
|
||
<div class="outline-text-4" id="text-2-2-1">
|
||
<p>
|
||
Memory allocation function, letting the library choose how the
|
||
memory will be allocated, and a pointer is returned to the user.
|
||
The context is passed to let the library store data related to the
|
||
allocation inside the context.
|
||
</p>
|
||
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">void</span>* <span style="color: #0000ff;">qmckl_malloc</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">ctx</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">size_t</span> <span style="color: #a0522d;">size</span>);
|
||
</pre>
|
||
</div>
|
||
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #a020f0;">interface</span>
|
||
<span style="color: #228b22;">type (c_ptr) </span><span style="color: #a020f0;">function</span> <span style="color: #0000ff;">qmckl_malloc</span> <span style="color: #000000; background-color: #ffffff;">(context, size) bind(C)</span>
|
||
<span style="color: #a020f0;">use</span>, <span style="color: #a020f0;">intrinsic</span> :: <span style="color: #0000ff;">iso_c_binding</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> context</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> size</span>
|
||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_malloc</span>
|
||
<span style="color: #a020f0;">end interface</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="org42904dc"></a>Source<br />
|
||
<div class="outline-text-5" id="text-2-2-1-1">
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">void</span>* <span style="color: #0000ff;">qmckl_malloc</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">ctx</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">size_t</span> <span style="color: #a0522d;">size</span>) {
|
||
<span style="color: #a020f0;">if</span> (ctx == (<span style="color: #228b22;">qmckl_context</span>) 0) {}; /* <span style="color: #b22222;">Avoid unused argument warning </span>*/
|
||
<span style="color: #228b22;">void</span> * <span style="color: #a0522d;">result</span> = malloc( (<span style="color: #228b22;">size_t</span>) size );
|
||
assert (result != <span style="color: #008b8b;">NULL</span>) ;
|
||
<span style="color: #a020f0;">return</span> result;
|
||
}
|
||
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
</div>
|
||
|
||
<div id="outline-container-org406a1c3" class="outline-4">
|
||
<h4 id="org406a1c3"><span class="section-number-4">2.2.2</span> <code>qmckl_free</code></h4>
|
||
<div class="outline-text-4" id="text-2-2-2">
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">void</span>* <span style="color: #0000ff;">qmckl_free</span>(<span style="color: #228b22;">void</span> *<span style="color: #a0522d;">ptr</span>);
|
||
</pre>
|
||
</div>
|
||
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #a020f0;">interface</span>
|
||
<span style="color: #228b22;">type (c_ptr) </span><span style="color: #a020f0;">function</span> <span style="color: #0000ff;">qmckl_free</span> <span style="color: #000000; background-color: #ffffff;">(ptr) bind(C)</span>
|
||
<span style="color: #a020f0;">use</span>, <span style="color: #a020f0;">intrinsic</span> :: <span style="color: #0000ff;">iso_c_binding</span>
|
||
<span style="color: #228b22;">type (c_ptr)</span>, <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> :: <span style="color: #a0522d;">ptr</span>
|
||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_free</span>
|
||
<span style="color: #a020f0;">end interface</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
<ol class="org-ol">
|
||
<li><a id="org1e51e61"></a>Source<br />
|
||
<div class="outline-text-5" id="text-2-2-2-1">
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">void</span>* <span style="color: #0000ff;">qmckl_free</span>(<span style="color: #228b22;">void</span> *<span style="color: #a0522d;">ptr</span>) {
|
||
assert (ptr != <span style="color: #008b8b;">NULL</span>);
|
||
free(ptr);
|
||
<span style="color: #a020f0;">return</span> <span style="color: #008b8b;">NULL</span>;
|
||
}
|
||
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
</div>
|
||
</div>
|
||
<div id="outline-container-org0640218" class="outline-3">
|
||
<h3 id="org0640218"><span class="section-number-3">2.3</span> Context</h3>
|
||
<div class="outline-text-3" id="text-2-3">
|
||
<p>
|
||
This file is written in C because it is more natural to express the
|
||
context in C than in Fortran.
|
||
</p>
|
||
|
||
<p>
|
||
2 files are produced:
|
||
</p>
|
||
<ul class="org-ul">
|
||
<li>a source file : <code>qmckl_context.c</code></li>
|
||
<li>a test file : <code>test_qmckl_context.c</code></li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div id="outline-container-orgd9c0b6f" class="outline-4">
|
||
<h4 id="orgd9c0b6f"><span class="section-number-4">2.3.1</span> Context</h4>
|
||
<div class="outline-text-4" id="text-2-3-1">
|
||
<p>
|
||
The context variable is a handle for the state of the library, and
|
||
is stored in the following data structure, which can't be seen
|
||
outside of the library. To simplify compatibility with other
|
||
languages, the pointer to the internal data structure is converted
|
||
into a 64-bit signed integer, defined in the <code>qmckl_context</code> type.
|
||
A value of 0 for the context is equivalent to a <code>NULL</code> pointer.
|
||
</p>
|
||
|
||
<div class="org-src-container">
|
||
<pre class="src src-C">
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="org15a4ae8"></a>Basis set data structure<br />
|
||
<div class="outline-text-5" id="text-2-3-1-1">
|
||
<p>
|
||
Data structure for the info related to the atomic orbitals
|
||
basis set.
|
||
</p>
|
||
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">qmckl_ao_basis_struct</span> {
|
||
|
||
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">shell_num</span>;
|
||
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">prim_num</span>;
|
||
<span style="color: #228b22;">int64_t</span> * <span style="color: #a0522d;">shell_center</span>;
|
||
<span style="color: #228b22;">int32_t</span> * <span style="color: #a0522d;">shell_ang_mom</span>;
|
||
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">shell_factor</span>;
|
||
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">exponent</span> ;
|
||
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">coefficient</span> ;
|
||
<span style="color: #228b22;">int64_t</span> * <span style="color: #a0522d;">shell_prim_num</span>;
|
||
<span style="color: #228b22;">char</span> <span style="color: #a0522d;">type</span>;
|
||
|
||
} <span style="color: #228b22;">qmckl_ao_basis_struct</span>;
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org512bbb8"></a>Source<br />
|
||
<div class="outline-text-5" id="text-2-3-1-2">
|
||
<p>
|
||
The tag is used internally to check if the memory domain pointed
|
||
by a pointer is a valid context.
|
||
</p>
|
||
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">qmckl_context_struct</span> {
|
||
|
||
<span style="color: #a020f0;">struct</span> <span style="color: #228b22;">qmckl_context_struct</span> * <span style="color: #a0522d;">prev</span>;
|
||
|
||
/* <span style="color: #b22222;">Molecular system </span>*/
|
||
// <span style="color: #b22222;">struct qmckl_nucleus_struct * nucleus; </span>
|
||
// <span style="color: #b22222;">struct qmckl_electron_struct * electron;</span>
|
||
<span style="color: #a020f0;">struct</span> <span style="color: #228b22;">qmckl_ao_basis_struct</span> * <span style="color: #a0522d;">ao_basis</span>;
|
||
// <span style="color: #b22222;">struct qmckl_mo_struct * mo;</span>
|
||
// <span style="color: #b22222;">struct qmckl_determinant_struct * det;</span>
|
||
|
||
/* <span style="color: #b22222;">Numerical precision </span>*/
|
||
<span style="color: #228b22;">uint32_t</span> <span style="color: #a0522d;">tag</span>;
|
||
<span style="color: #228b22;">int32_t</span> <span style="color: #a0522d;">precision</span>;
|
||
<span style="color: #228b22;">int32_t</span> <span style="color: #a0522d;">range</span>;
|
||
|
||
} <span style="color: #228b22;">qmckl_context_struct</span>;
|
||
|
||
<span style="color: #483d8b;">#define</span> <span style="color: #a0522d;">VALID_TAG</span> 0xBEEFFACE
|
||
<span style="color: #483d8b;">#define</span> <span style="color: #a0522d;">INVALID_TAG</span> 0xDEADBEEF
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="orgffb552d"></a><code>qmckl_context_check</code><br />
|
||
<div class="outline-text-5" id="text-2-3-1-3">
|
||
<p>
|
||
Checks if the domain pointed by the pointer is a valid context.
|
||
Returns the input <code>qmckl_context</code> if the context is valid, 0
|
||
otherwise.
|
||
</p>
|
||
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_context</span> <span style="color: #0000ff;">qmckl_context_check</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>) ;
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="org87b6720"></a>Source<br />
|
||
<div class="outline-text-6" id="text-2-3-1-3-1">
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_context</span> <span style="color: #0000ff;">qmckl_context_check</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>) {
|
||
|
||
<span style="color: #a020f0;">if</span> (context == (<span style="color: #228b22;">qmckl_context</span>) 0) <span style="color: #a020f0;">return</span> (<span style="color: #228b22;">qmckl_context</span>) 0;
|
||
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context_struct</span> * <span style="color: #a0522d;">ctx</span> = (<span style="color: #228b22;">qmckl_context_struct</span>*) context;
|
||
|
||
<span style="color: #a020f0;">if</span> (ctx->tag != VALID_TAG) <span style="color: #a020f0;">return</span> (<span style="color: #228b22;">qmckl_context</span>) 0;
|
||
|
||
<span style="color: #a020f0;">return</span> context;
|
||
}
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
</li>
|
||
|
||
<li><a id="orgf13b06d"></a><code>qmckl_context_create</code><br />
|
||
<div class="outline-text-5" id="text-2-3-1-4">
|
||
<p>
|
||
To create a new context, use <code>qmckl_context_create()</code>.
|
||
</p>
|
||
<ul class="org-ul">
|
||
<li>On success, returns a pointer to a context using the <code>qmckl_context</code> type</li>
|
||
<li><p>
|
||
Returns <code>0</code> upon failure to allocate the internal data structure
|
||
</p>
|
||
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_context</span> <span style="color: #0000ff;">qmckl_context_create</span>();
|
||
</pre>
|
||
</div></li>
|
||
</ul>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="org7bfea89"></a>Source<br />
|
||
<div class="outline-text-6" id="text-2-3-1-4-1">
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_context</span> <span style="color: #0000ff;">qmckl_context_create</span>() {
|
||
|
||
<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a0522d;">context</span> =
|
||
(<span style="color: #228b22;">qmckl_context_struct</span>*) qmckl_malloc ((<span style="color: #228b22;">qmckl_context</span>) 0, <span style="color: #a020f0;">sizeof</span>(qmckl_context_struct));
|
||
<span style="color: #a020f0;">if</span> (context == <span style="color: #008b8b;">NULL</span>) {
|
||
<span style="color: #a020f0;">return</span> (<span style="color: #228b22;">qmckl_context</span>) 0;
|
||
}
|
||
|
||
context->prev = <span style="color: #008b8b;">NULL</span>;
|
||
context->ao_basis = <span style="color: #008b8b;">NULL</span>;
|
||
context->precision = QMCKL_DEFAULT_PRECISION;
|
||
context->range = QMCKL_DEFAULT_RANGE;
|
||
context->tag = VALID_TAG;
|
||
|
||
<span style="color: #a020f0;">return</span> (<span style="color: #228b22;">qmckl_context</span>) context;
|
||
}
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org2c883ff"></a>Fortran interface<br />
|
||
<div class="outline-text-6" id="text-2-3-1-4-2">
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #a020f0;">interface</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>) <span style="color: #a020f0;">function</span> <span style="color: #0000ff;">qmckl_context_create</span>() <span style="color: #a020f0;">bind</span>(C)
|
||
<span style="color: #a020f0;">use</span>, <span style="color: #a020f0;">intrinsic</span> :: <span style="color: #0000ff;">iso_c_binding</span>
|
||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_context_create</span>
|
||
<span style="color: #a020f0;">end interface</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
</li>
|
||
|
||
<li><a id="org565108b"></a><code>qmckl_context_copy</code><br />
|
||
<div class="outline-text-5" id="text-2-3-1-5">
|
||
<p>
|
||
This function makes a shallow copy of the current context.
|
||
</p>
|
||
<ul class="org-ul">
|
||
<li>Copying the 0-valued context returns 0</li>
|
||
<li>On success, returns a pointer to the new context using the <code>qmckl_context</code> type</li>
|
||
<li><p>
|
||
Returns 0 upon failure to allocate the internal data structure
|
||
for the new context
|
||
</p>
|
||
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_context</span> <span style="color: #0000ff;">qmckl_context_copy</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>);
|
||
</pre>
|
||
</div></li>
|
||
</ul>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="orgf7b3f34"></a>Source<br />
|
||
<div class="outline-text-6" id="text-2-3-1-5-1">
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_context</span> <span style="color: #0000ff;">qmckl_context_copy</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>) {
|
||
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">checked_context</span> = qmckl_context_check(context);
|
||
|
||
<span style="color: #a020f0;">if</span> (checked_context == (<span style="color: #228b22;">qmckl_context</span>) 0) {
|
||
<span style="color: #a020f0;">return</span> (<span style="color: #228b22;">qmckl_context</span>) 0;
|
||
}
|
||
|
||
<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a0522d;">old_context</span> = (<span style="color: #228b22;">qmckl_context_struct</span>*) checked_context;
|
||
|
||
<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a0522d;">new_context</span> =
|
||
(<span style="color: #228b22;">qmckl_context_struct</span>*) <span style="color: #0000ff;">qmckl_malloc</span> (context, <span style="color: #a020f0;">sizeof</span>(<span style="color: #228b22;">qmckl_context_struct</span>));
|
||
<span style="color: #a020f0;">if</span> (new_context == <span style="color: #008b8b;">NULL</span>) {
|
||
<span style="color: #a020f0;">return</span> (<span style="color: #228b22;">qmckl_context</span>) 0;
|
||
}
|
||
|
||
new_context->prev = old_context;
|
||
new_context->ao_basis = old_context->ao_basis;
|
||
new_context->precision = old_context->precision;
|
||
new_context->range = old_context->range;
|
||
new_context->tag = VALID_TAG;
|
||
|
||
<span style="color: #a020f0;">return</span> (<span style="color: #228b22;">qmckl_context</span>) new_context;
|
||
}
|
||
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org7ffa988"></a>Fortran interface<br />
|
||
<div class="outline-text-6" id="text-2-3-1-5-2">
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #a020f0;">interface</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>) <span style="color: #a020f0;">function</span> <span style="color: #0000ff;">qmckl_context_copy</span>(context) <span style="color: #a020f0;">bind</span>(C)
|
||
<span style="color: #a020f0;">use</span>, <span style="color: #a020f0;">intrinsic</span> :: <span style="color: #0000ff;">iso_c_binding</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> context</span>
|
||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_context_copy</span>
|
||
<span style="color: #a020f0;">end interface</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
</li>
|
||
|
||
<li><a id="org0d3c42d"></a><code>qmckl_context_previous</code><br />
|
||
<div class="outline-text-5" id="text-2-3-1-6">
|
||
<p>
|
||
Returns the previous context
|
||
</p>
|
||
<ul class="org-ul">
|
||
<li>On success, returns the ancestor of the current context</li>
|
||
<li>Returns 0 for the initial context</li>
|
||
<li><p>
|
||
Returns 0 for the 0-valued context
|
||
</p>
|
||
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_context</span> <span style="color: #0000ff;">qmckl_context_previous</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>);
|
||
</pre>
|
||
</div></li>
|
||
</ul>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="org5ff2266"></a>Source<br />
|
||
<div class="outline-text-6" id="text-2-3-1-6-1">
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_context</span> <span style="color: #0000ff;">qmckl_context_previous</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>) {
|
||
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">checked_context</span> = qmckl_context_check(context);
|
||
<span style="color: #a020f0;">if</span> (checked_context == (<span style="color: #228b22;">qmckl_context</span>) 0) {
|
||
<span style="color: #a020f0;">return</span> (<span style="color: #228b22;">qmckl_context</span>) 0;
|
||
}
|
||
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a0522d;">ctx</span> = (<span style="color: #228b22;">qmckl_context_struct</span>*) checked_context;
|
||
<span style="color: #a020f0;">return</span> qmckl_context_check((<span style="color: #228b22;">qmckl_context</span>) ctx->prev);
|
||
}
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="orgca5e277"></a>Fortran interface<br />
|
||
<div class="outline-text-6" id="text-2-3-1-6-2">
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #a020f0;">interface</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>) <span style="color: #a020f0;">function</span> <span style="color: #0000ff;">qmckl_context_previous</span>(context) <span style="color: #a020f0;">bind</span>(C)
|
||
<span style="color: #a020f0;">use</span>, <span style="color: #a020f0;">intrinsic</span> :: <span style="color: #0000ff;">iso_c_binding</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> context</span>
|
||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_context_previous</span>
|
||
<span style="color: #a020f0;">end interface</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
</li>
|
||
|
||
<li><a id="org7095ae4"></a><code>qmckl_context_destroy</code><br />
|
||
<div class="outline-text-5" id="text-2-3-1-7">
|
||
<p>
|
||
Destroys the current context, leaving the ancestors untouched.
|
||
</p>
|
||
<ul class="org-ul">
|
||
<li>Succeeds if the current context is properly destroyed</li>
|
||
<li>Fails otherwise</li>
|
||
<li>Fails if the 0-valued context is given in argument</li>
|
||
<li>Fails if the the pointer is not a valid context</li>
|
||
</ul>
|
||
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_context_destroy</span>(<span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>);
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="org22584ec"></a>Source<br />
|
||
<div class="outline-text-6" id="text-2-3-1-7-1">
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_context_destroy</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>) {
|
||
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">checked_context</span> = qmckl_context_check(context);
|
||
<span style="color: #a020f0;">if</span> (checked_context == (<span style="color: #228b22;">qmckl_context</span>) 0) <span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
|
||
<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a0522d;">ctx</span> = (<span style="color: #228b22;">qmckl_context_struct</span>*) context;
|
||
<span style="color: #a020f0;">if</span> (ctx == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
|
||
ctx->tag = INVALID_TAG;
|
||
qmckl_free(ctx);
|
||
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
|
||
}
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org2d581ea"></a>Fortran interface<br />
|
||
<div class="outline-text-6" id="text-2-3-1-7-2">
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #a020f0;">interface</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int32_t</span>) <span style="color: #a020f0;">function</span> <span style="color: #0000ff;">qmckl_context_destroy</span>(context) <span style="color: #a020f0;">bind</span>(C)
|
||
<span style="color: #a020f0;">use</span>, <span style="color: #a020f0;">intrinsic</span> :: <span style="color: #0000ff;">iso_c_binding</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> context</span>
|
||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_context_destroy</span>
|
||
<span style="color: #a020f0;">end interface</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
</li>
|
||
</ol>
|
||
</div>
|
||
|
||
<div id="outline-container-org163f3be" class="outline-4">
|
||
<h4 id="org163f3be"><span class="section-number-4">2.3.2</span> Basis set</h4>
|
||
<div class="outline-text-4" id="text-2-3-2">
|
||
<p>
|
||
For H<sub>2</sub> with the following basis set,
|
||
</p>
|
||
|
||
<pre class="example">
|
||
HYDROGEN
|
||
S 5
|
||
1 3.387000E+01 6.068000E-03
|
||
2 5.095000E+00 4.530800E-02
|
||
3 1.159000E+00 2.028220E-01
|
||
4 3.258000E-01 5.039030E-01
|
||
5 1.027000E-01 3.834210E-01
|
||
S 1
|
||
1 3.258000E-01 1.000000E+00
|
||
S 1
|
||
1 1.027000E-01 1.000000E+00
|
||
P 1
|
||
1 1.407000E+00 1.000000E+00
|
||
P 1
|
||
1 3.880000E-01 1.000000E+00
|
||
D 1
|
||
1 1.057000E+00 1.0000000
|
||
</pre>
|
||
|
||
<p>
|
||
we have:
|
||
</p>
|
||
|
||
<pre class="example">
|
||
type = 'G'
|
||
shell_num = 12
|
||
prim_num = 20
|
||
SHELL_CENTER = [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2]
|
||
SHELL_ANG_MOM = ['S', 'S', 'S', 'P', 'P', 'D', 'S', 'S', 'S', 'P', 'P', 'D']
|
||
SHELL_PRIM_NUM = [5, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1]
|
||
prim_index = [1, 6, 7, 8, 9, 10, 11, 16, 17, 18, 19, 20]
|
||
EXPONENT = [ 33.87, 5.095, 1.159, 0.3258, 0.1027, 0.3258, 0.1027,
|
||
1.407, 0.388, 1.057, 33.87, 5.095, 1.159, 0.3258, 0.1027,
|
||
0.3258, 0.1027, 1.407, 0.388, 1.057]
|
||
COEFFICIENT = [ 0.006068, 0.045308, 0.202822, 0.503903, 0.383421,
|
||
1.0, 1.0, 1.0, 1.0, 1.0, 0.006068, 0.045308, 0.202822,
|
||
0.503903, 0.383421, 1.0, 1.0, 1.0, 1.0, 1.0]
|
||
</pre>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="orged7acaa"></a><code>qmckl_context_update_ao_basis</code><br />
|
||
<div class="outline-text-5" id="text-2-3-2-1">
|
||
<p>
|
||
Updates the data describing the AO basis set into the context.
|
||
</p>
|
||
|
||
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||
|
||
|
||
<colgroup>
|
||
<col class="org-left" />
|
||
|
||
<col class="org-left" />
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="org-left"><code>type</code></td>
|
||
<td class="org-left">Gaussian or Slater</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>shell_num</code></td>
|
||
<td class="org-left">Number of shells</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>prim_num</code></td>
|
||
<td class="org-left">Total number of primitives</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>SHELL_CENTER(shell_num)</code></td>
|
||
<td class="org-left">Id of the nucleus on which the shell is centered</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>SHELL_ANG_MOM(shell_num)</code></td>
|
||
<td class="org-left">Id of the nucleus on which the shell is centered</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>SHELL_FACTOR(shell_num)</code></td>
|
||
<td class="org-left">Normalization factor for the shell</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>SHELL_PRIM_NUM(shell_num)</code></td>
|
||
<td class="org-left">Number of primitives in the shell</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>SHELL_PRIM_INDEX(shell_num)</code></td>
|
||
<td class="org-left">Address of the first primitive of the shelll in the <code>EXPONENT</code> array</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>EXPONENT(prim_num)</code></td>
|
||
<td class="org-left">Array of exponents</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>COEFFICIENT(prim_num)</code></td>
|
||
<td class="org-left">Array of coefficients</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_exit_code</span>
|
||
<span style="color: #0000ff;">qmckl_context_update_ao_basis</span>(<span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span> , <span style="color: #a020f0;">const</span> <span style="color: #228b22;">char</span> <span style="color: #a0522d;">type</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">shell_num</span> , <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">prim_num</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> * <span style="color: #a0522d;">SHELL_CENTER</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int32_t</span> * <span style="color: #a0522d;">SHELL_ANG_MOM</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> * <span style="color: #a0522d;">SHELL_FACTOR</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> * <span style="color: #a0522d;">SHELL_PRIM_NUM</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> * <span style="color: #a0522d;">SHELL_PRIM_INDEX</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> * <span style="color: #a0522d;">EXPONENT</span> , <span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> * <span style="color: #a0522d;">COEFFICIENT</span>);
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="org23a1072"></a>Source<br />
|
||
<div class="outline-text-6" id="text-2-3-2-1-1">
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_exit_code</span>
|
||
<span style="color: #0000ff;">qmckl_context_update_ao_basis</span>(<span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span> , <span style="color: #a020f0;">const</span> <span style="color: #228b22;">char</span> <span style="color: #a0522d;">type</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">shell_num</span> , <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">prim_num</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> * <span style="color: #a0522d;">SHELL_CENTER</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int32_t</span> * <span style="color: #a0522d;">SHELL_ANG_MOM</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> * <span style="color: #a0522d;">SHELL_FACTOR</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> * <span style="color: #a0522d;">SHELL_PRIM_NUM</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> * <span style="color: #a0522d;">SHELL_PRIM_INDEX</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> * <span style="color: #a0522d;">EXPONENT</span> , <span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> * <span style="color: #a0522d;">COEFFICIENT</span>)
|
||
{
|
||
|
||
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">i</span>;
|
||
|
||
/* <span style="color: #b22222;">Check input </span>*/
|
||
|
||
<span style="color: #a020f0;">if</span> (type != <span style="color: #8b2252;">'G'</span> && type != <span style="color: #8b2252;">'S'</span>) <span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
<span style="color: #a020f0;">if</span> (shell_num <= 0) <span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
<span style="color: #a020f0;">if</span> (prim_num <= 0) <span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
<span style="color: #a020f0;">if</span> (prim_num < shell_num) <span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
|
||
<span style="color: #a020f0;">for</span> (i=0 ; i<shell_num ; i++) {
|
||
<span style="color: #a020f0;">if</span> (SHELL_CENTER[i] <= 0) <span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
<span style="color: #a020f0;">if</span> (SHELL_PRIM_NUM[i] <= 0) <span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
<span style="color: #a020f0;">if</span> (SHELL_ANG_MOM[i] < 0) <span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
<span style="color: #a020f0;">if</span> (SHELL_PRIM_INDEX[i] < 0) <span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
}
|
||
|
||
<span style="color: #a020f0;">for</span> (i=0 ; i<prim_num ; i++) {
|
||
<span style="color: #a020f0;">if</span> (EXPONENT[i] <= 0) <span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
}
|
||
|
||
<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a0522d;">ctx</span> = (<span style="color: #228b22;">qmckl_context_struct</span>*) context;
|
||
<span style="color: #a020f0;">if</span> (ctx == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
|
||
<span style="color: #228b22;">qmckl_ao_basis_struct</span>* <span style="color: #a0522d;">basis</span> = (<span style="color: #228b22;">qmckl_ao_basis_struct</span>*) malloc (<span style="color: #a020f0;">sizeof</span>(qmckl_ao_basis_struct));
|
||
<span style="color: #a020f0;">if</span> (basis == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
|
||
|
||
/* <span style="color: #b22222;">Memory allocations </span>*/
|
||
|
||
basis->shell_center = (<span style="color: #228b22;">int64_t</span>*) malloc (<span style="color: #228b22;">shell_num</span> * <span style="color: #a020f0;">sizeof</span>(int64_t));
|
||
<span style="color: #a020f0;">if</span> (basis->shell_center == <span style="color: #008b8b;">NULL</span>) {
|
||
free(basis);
|
||
<span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
}
|
||
|
||
basis->shell_ang_mom = (<span style="color: #228b22;">int32_t</span>*) malloc (<span style="color: #228b22;">shell_num</span> * <span style="color: #a020f0;">sizeof</span>(int32_t));
|
||
<span style="color: #a020f0;">if</span> (basis->shell_ang_mom == <span style="color: #008b8b;">NULL</span>) {
|
||
free(basis->shell_center);
|
||
free(basis);
|
||
<span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
}
|
||
|
||
basis->shell_prim_num= (<span style="color: #228b22;">int64_t</span>*) malloc (<span style="color: #228b22;">shell_num</span> * <span style="color: #a020f0;">sizeof</span>(int64_t));
|
||
<span style="color: #a020f0;">if</span> (basis->shell_prim_num == <span style="color: #008b8b;">NULL</span>) {
|
||
free(basis->shell_ang_mom);
|
||
free(basis->shell_center);
|
||
free(basis);
|
||
<span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
}
|
||
|
||
basis->shell_factor = (<span style="color: #228b22;">double</span> *) malloc (<span style="color: #228b22;">shell_num</span> * <span style="color: #a020f0;">sizeof</span>(<span style="color: #228b22;">double</span> ));
|
||
<span style="color: #a020f0;">if</span> (basis->shell_factor == <span style="color: #008b8b;">NULL</span>) {
|
||
free(basis->shell_prim_num);
|
||
free(basis->shell_ang_mom);
|
||
free(basis->shell_center);
|
||
free(basis);
|
||
<span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
}
|
||
|
||
basis->exponent = (<span style="color: #228b22;">double</span> *) malloc (<span style="color: #228b22;">prim_num</span> * <span style="color: #a020f0;">sizeof</span>(<span style="color: #228b22;">double</span> ));
|
||
<span style="color: #a020f0;">if</span> (basis->exponent == <span style="color: #008b8b;">NULL</span>) {
|
||
free(basis->shell_factor);
|
||
free(basis->shell_prim_num);
|
||
free(basis->shell_ang_mom);
|
||
free(basis->shell_center);
|
||
free(basis);
|
||
<span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
}
|
||
|
||
basis->coefficient = (<span style="color: #228b22;">double</span> *) malloc (<span style="color: #228b22;">prim_num</span> * <span style="color: #a020f0;">sizeof</span>(<span style="color: #228b22;">double</span> ));
|
||
<span style="color: #a020f0;">if</span> (basis->coefficient == <span style="color: #008b8b;">NULL</span>) {
|
||
free(basis->exponent);
|
||
free(basis->shell_factor);
|
||
free(basis->shell_prim_num);
|
||
free(basis->shell_ang_mom);
|
||
free(basis->shell_center);
|
||
free(basis);
|
||
<span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
}
|
||
|
||
|
||
/* <span style="color: #b22222;">Assign data </span>*/
|
||
|
||
basis->type = type;
|
||
basis->shell_num = shell_num;
|
||
basis->prim_num = prim_num;
|
||
|
||
<span style="color: #a020f0;">for</span> (i=0 ; i<shell_num ; i++) {
|
||
basis->shell_center [i] = SHELL_CENTER [i];
|
||
basis->shell_ang_mom [i] = SHELL_ANG_MOM [i];
|
||
basis->shell_prim_num[i] = SHELL_PRIM_NUM[i];
|
||
basis->shell_factor [i] = SHELL_FACTOR [i];
|
||
}
|
||
|
||
<span style="color: #a020f0;">for</span> (i=0 ; i<prim_num ; i++) {
|
||
basis->exponent [i] = EXPONENT[i];
|
||
basis->coefficient[i] = COEFFICIENT[i];
|
||
}
|
||
|
||
ctx->ao_basis = basis;
|
||
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
|
||
}
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="orgc4e6e9b"></a>Fortran interface<br />
|
||
<div class="outline-text-6" id="text-2-3-2-1-2">
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #a020f0;">interface</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int32_t</span>)<span style="color: #a0522d;"> function qmckl_context_update_ao_basis(context, </span><span style="color: #a020f0;">&</span>
|
||
typ, shell_num, prim_num, SHELL_CENTER, SHELL_ANG_MOM, SHELL_FACTOR, <span style="color: #a020f0;">&</span>
|
||
SHELL_PRIM_NUM, SHELL_PRIM_INDEX, EXPONENT, COEFFICIENT) <span style="color: #a020f0;">bind</span>(C)
|
||
<span style="color: #a020f0;">use</span>, <span style="color: #a020f0;">intrinsic</span> :: <span style="color: #0000ff;">iso_c_binding</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> context</span>
|
||
<span style="color: #228b22;">character</span>(<span style="color: #008b8b;">c_char</span>) , <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> typ</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> shell_num</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> prim_num</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> SHELL_CENTER(shell_num)</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int32_t</span>), <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> SHELL_ANG_MOM(shell_num)</span>
|
||
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> SHELL_FACTOR(shell_num)</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> SHELL_PRIM_NUM(shell_num)</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> SHELL_PRIM_INDEX(shell_num)</span>
|
||
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> EXPONENT(prim_num)</span>
|
||
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> COEFFICIENT(prim_num)</span>
|
||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_context_update_ao_basis</span>
|
||
<span style="color: #a020f0;">end interface</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org0d9d7c0"></a><span class="todo TODO">TODO</span> Test<br /></li>
|
||
</ol>
|
||
</li>
|
||
|
||
<li><a id="org422d8ae"></a><code>qmckl_context_set_ao_basis</code><br />
|
||
<div class="outline-text-5" id="text-2-3-2-2">
|
||
<p>
|
||
Sets the data describing the AO basis set into the context.
|
||
</p>
|
||
|
||
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||
|
||
|
||
<colgroup>
|
||
<col class="org-left" />
|
||
|
||
<col class="org-left" />
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="org-left"><code>type</code></td>
|
||
<td class="org-left">Gaussian or Slater</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>shell_num</code></td>
|
||
<td class="org-left">Number of shells</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>prim_num</code></td>
|
||
<td class="org-left">Total number of primitives</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>SHELL_CENTER(shell_num)</code></td>
|
||
<td class="org-left">Id of the nucleus on which the shell is centered</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>SHELL_ANG_MOM(shell_num)</code></td>
|
||
<td class="org-left">Id of the nucleus on which the shell is centered</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>SHELL_FACTOR(shell_num)</code></td>
|
||
<td class="org-left">Normalization factor for the shell</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>SHELL_PRIM_NUM(shell_num)</code></td>
|
||
<td class="org-left">Number of primitives in the shell</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>SHELL_PRIM_INDEX(shell_num)</code></td>
|
||
<td class="org-left">Address of the first primitive of the shelll in the <code>EXPONENT</code> array</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>EXPONENT(prim_num)</code></td>
|
||
<td class="org-left">Array of exponents</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>COEFFICIENT(prim_num)</code></td>
|
||
<td class="org-left">Array of coefficients</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_context</span>
|
||
<span style="color: #0000ff;">qmckl_context_set_ao_basis</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span> , <span style="color: #a020f0;">const</span> <span style="color: #228b22;">char</span> <span style="color: #a0522d;">type</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">shell_num</span> , <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">prim_num</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> * <span style="color: #a0522d;">SHELL_CENTER</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int32_t</span> * <span style="color: #a0522d;">SHELL_ANG_MOM</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> * <span style="color: #a0522d;">SHELL_FACTOR</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> * <span style="color: #a0522d;">SHELL_PRIM_NUM</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> * <span style="color: #a0522d;">SHELL_PRIM_INDEX</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> * <span style="color: #a0522d;">EXPONENT</span> , <span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> * <span style="color: #a0522d;">COEFFICIENT</span>);
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="org23ddfa4"></a>Source<br />
|
||
<div class="outline-text-6" id="text-2-3-2-2-1">
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_context</span>
|
||
<span style="color: #0000ff;">qmckl_context_set_ao_basis</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span> , <span style="color: #a020f0;">const</span> <span style="color: #228b22;">char</span> <span style="color: #a0522d;">type</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">shell_num</span> , <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">prim_num</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> * <span style="color: #a0522d;">SHELL_CENTER</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int32_t</span> * <span style="color: #a0522d;">SHELL_ANG_MOM</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> * <span style="color: #a0522d;">SHELL_FACTOR</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> * <span style="color: #a0522d;">SHELL_PRIM_NUM</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> * <span style="color: #a0522d;">SHELL_PRIM_INDEX</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> * <span style="color: #a0522d;">EXPONENT</span> , <span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> * <span style="color: #a0522d;">COEFFICIENT</span>)
|
||
{
|
||
|
||
<span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">new_context</span> = qmckl_context_copy(context);
|
||
<span style="color: #a020f0;">if</span> (new_context == 0) <span style="color: #a020f0;">return</span> 0;
|
||
|
||
<span style="color: #a020f0;">if</span> (qmckl_context_update_ao_basis(context, type, shell_num, prim_num,
|
||
SHELL_CENTER, SHELL_ANG_MOM, SHELL_FACTOR,
|
||
SHELL_PRIM_NUM, SHELL_PRIM_INDEX, EXPONENT,
|
||
COEFFICIENT
|
||
) == QMCKL_FAILURE)
|
||
<span style="color: #a020f0;">return</span> 0;
|
||
|
||
<span style="color: #a020f0;">return</span> new_context;
|
||
}
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org48aecc3"></a>Fortran interface<br />
|
||
<div class="outline-text-6" id="text-2-3-2-2-2">
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #a020f0;">interface</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>)<span style="color: #a0522d;"> function qmckl_context_set_ao_basis(context, </span><span style="color: #a020f0;">&</span>
|
||
typ, shell_num, prim_num, SHELL_CENTER, SHELL_ANG_MOM, SHELL_FACTOR, <span style="color: #a020f0;">&</span>
|
||
SHELL_PRIM_NUM, SHELL_PRIM_INDEX, EXPONENT, COEFFICIENT) <span style="color: #a020f0;">bind</span>(C)
|
||
<span style="color: #a020f0;">use</span>, <span style="color: #a020f0;">intrinsic</span> :: <span style="color: #0000ff;">iso_c_binding</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> context</span>
|
||
<span style="color: #228b22;">character</span>(<span style="color: #008b8b;">c_char</span>) , <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> typ</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> shell_num</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> prim_num</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> SHELL_CENTER(shell_num)</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int32_t</span>), <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> SHELL_ANG_MOM(shell_num)</span>
|
||
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> SHELL_FACTOR(shell_num)</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> SHELL_PRIM_NUM(shell_num)</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> SHELL_PRIM_INDEX(shell_num)</span>
|
||
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> EXPONENT(prim_num)</span>
|
||
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> COEFFICIENT(prim_num)</span>
|
||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_context_set_ao_basis</span>
|
||
<span style="color: #a020f0;">end interface</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="orgf28c714"></a><span class="todo TODO">TODO</span> Test<br /></li>
|
||
</ol>
|
||
</li>
|
||
</ol>
|
||
</div>
|
||
|
||
<div id="outline-container-org72f1bc8" class="outline-4">
|
||
<h4 id="org72f1bc8"><span class="section-number-4">2.3.3</span> Precision</h4>
|
||
<div class="outline-text-4" id="text-2-3-3">
|
||
<p>
|
||
The following functions set and get the expected required
|
||
precision and range. <code>precision</code> should be an integer between 2
|
||
and 53, and <code>range</code> should be an integer between 2 and 11.
|
||
</p>
|
||
|
||
<p>
|
||
The setter functions functions return a new context as a 64-bit
|
||
integer. The getter functions return the value, as a 32-bit
|
||
integer. The update functions return <code>QMCKL_SUCCESS</code> or
|
||
<code>QMCKL_FAILURE</code>.
|
||
</p>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="org8c25055"></a><code>qmckl_context_update_precision</code><br />
|
||
<div class="outline-text-5" id="text-2-3-3-1">
|
||
<p>
|
||
Modifies the parameter for the numerical precision in a given context.
|
||
</p>
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_context_update_precision</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int</span> <span style="color: #a0522d;">precision</span>);
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="orgf0ee2c5"></a>Source<br />
|
||
<div class="outline-text-6" id="text-2-3-3-1-1">
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_context_update_precision</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int</span> <span style="color: #a0522d;">precision</span>) {
|
||
|
||
<span style="color: #a020f0;">if</span> (precision < 2) <span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
<span style="color: #a020f0;">if</span> (precision > 53) <span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
|
||
<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a0522d;">ctx</span> = (<span style="color: #228b22;">qmckl_context_struct</span>*) context;
|
||
<span style="color: #a020f0;">if</span> (ctx == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
|
||
ctx->precision = precision;
|
||
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
|
||
}
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org44f11f8"></a>Fortran interface<br />
|
||
<div class="outline-text-6" id="text-2-3-3-1-2">
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #a020f0;">interface</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int32_t</span>) <span style="color: #a020f0;">function</span> <span style="color: #0000ff;">qmckl_context_update_precision</span>(context, precision) <span style="color: #a020f0;">bind</span>(C)
|
||
<span style="color: #a020f0;">use</span>, <span style="color: #a020f0;">intrinsic</span> :: <span style="color: #0000ff;">iso_c_binding</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> context</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int32_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> precision</span>
|
||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_context_update_precision</span>
|
||
<span style="color: #a020f0;">end interface</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
</li>
|
||
<li><a id="org59d38b2"></a><code>qmckl_context_update_range</code><br />
|
||
<div class="outline-text-5" id="text-2-3-3-2">
|
||
<p>
|
||
Modifies the parameter for the numerical range in a given context.
|
||
</p>
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_context_update_range</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int</span> <span style="color: #a0522d;">range</span>);
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="orgc6f5ef8"></a>Source<br />
|
||
<div class="outline-text-6" id="text-2-3-3-2-1">
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_context_update_range</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int</span> <span style="color: #a0522d;">range</span>) {
|
||
|
||
<span style="color: #a020f0;">if</span> (range < 2) <span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
<span style="color: #a020f0;">if</span> (range > 11) <span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
|
||
<span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a0522d;">ctx</span> = (<span style="color: #228b22;">qmckl_context_struct</span>*) context;
|
||
<span style="color: #a020f0;">if</span> (ctx == <span style="color: #008b8b;">NULL</span>) <span style="color: #a020f0;">return</span> QMCKL_FAILURE;
|
||
|
||
ctx->range = range;
|
||
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
|
||
}
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org81f4bc7"></a>Fortran interface<br />
|
||
<div class="outline-text-6" id="text-2-3-3-2-2">
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #a020f0;">interface</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int32_t</span>) <span style="color: #a020f0;">function</span> <span style="color: #0000ff;">qmckl_context_update_range</span>(context, range) <span style="color: #a020f0;">bind</span>(C)
|
||
<span style="color: #a020f0;">use</span>, <span style="color: #a020f0;">intrinsic</span> :: <span style="color: #0000ff;">iso_c_binding</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> context</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int32_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> range</span>
|
||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_context_update_range</span>
|
||
<span style="color: #a020f0;">end interface</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
</li>
|
||
<li><a id="orgf300d76"></a><code>qmckl_context_set_precision</code><br />
|
||
<div class="outline-text-5" id="text-2-3-3-3">
|
||
<p>
|
||
Returns a copy of the context with a different precision parameter.
|
||
</p>
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_context</span> <span style="color: #0000ff;">qmckl_context_set_precision</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int</span> <span style="color: #a0522d;">precision</span>);
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="org56f5209"></a>Source<br />
|
||
<div class="outline-text-6" id="text-2-3-3-3-1">
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_context</span> <span style="color: #0000ff;">qmckl_context_set_precision</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int</span> <span style="color: #a0522d;">precision</span>) {
|
||
<span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">new_context</span> = qmckl_context_copy(context);
|
||
<span style="color: #a020f0;">if</span> (new_context == 0) <span style="color: #a020f0;">return</span> 0;
|
||
|
||
<span style="color: #a020f0;">if</span> (qmckl_context_update_precision(context, precision) == QMCKL_FAILURE) <span style="color: #a020f0;">return</span> 0;
|
||
|
||
<span style="color: #a020f0;">return</span> new_context;
|
||
}
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org7166a12"></a>Fortran interface<br />
|
||
<div class="outline-text-6" id="text-2-3-3-3-2">
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #a020f0;">interface</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>) <span style="color: #a020f0;">function</span> <span style="color: #0000ff;">qmckl_context_set_precision</span>(context, precision) <span style="color: #a020f0;">bind</span>(C)
|
||
<span style="color: #a020f0;">use</span>, <span style="color: #a020f0;">intrinsic</span> :: <span style="color: #0000ff;">iso_c_binding</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> context</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int32_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> precision</span>
|
||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_context_set_precision</span>
|
||
<span style="color: #a020f0;">end interface</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
</li>
|
||
<li><a id="org3dae3a2"></a><code>qmckl_context_set_range</code><br />
|
||
<div class="outline-text-5" id="text-2-3-3-4">
|
||
<p>
|
||
Returns a copy of the context with a different precision parameter.
|
||
</p>
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_context</span> <span style="color: #0000ff;">qmckl_context_set_range</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int</span> <span style="color: #a0522d;">range</span>);
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="orgf4e4ab7"></a>Source<br />
|
||
<div class="outline-text-6" id="text-2-3-3-4-1">
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_context</span> <span style="color: #0000ff;">qmckl_context_set_range</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int</span> <span style="color: #a0522d;">range</span>) {
|
||
<span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">new_context</span> = qmckl_context_copy(context);
|
||
<span style="color: #a020f0;">if</span> (new_context == 0) <span style="color: #a020f0;">return</span> 0;
|
||
|
||
<span style="color: #a020f0;">if</span> (qmckl_context_update_range(context, range) == QMCKL_FAILURE) <span style="color: #a020f0;">return</span> 0;
|
||
|
||
<span style="color: #a020f0;">return</span> new_context;
|
||
}
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org9a1c25d"></a>Fortran interface<br />
|
||
<div class="outline-text-6" id="text-2-3-3-4-2">
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #a020f0;">interface</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>) <span style="color: #a020f0;">function</span> <span style="color: #0000ff;">qmckl_context_set_range</span>(context, range) <span style="color: #a020f0;">bind</span>(C)
|
||
<span style="color: #a020f0;">use</span>, <span style="color: #a020f0;">intrinsic</span> :: <span style="color: #0000ff;">iso_c_binding</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> context</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int32_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> range</span>
|
||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_context_set_range</span>
|
||
<span style="color: #a020f0;">end interface</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
</li>
|
||
|
||
<li><a id="org7adb83b"></a><code>qmckl_context_get_precision</code><br />
|
||
<div class="outline-text-5" id="text-2-3-3-5">
|
||
<p>
|
||
Returns the value of the numerical precision in the context
|
||
</p>
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">int32_t</span> <span style="color: #0000ff;">qmckl_context_get_precision</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>);
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="orga4f8b9d"></a>Source<br />
|
||
<div class="outline-text-6" id="text-2-3-3-5-1">
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">int</span> <span style="color: #0000ff;">qmckl_context_get_precision</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>) {
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a0522d;">ctx</span> = (<span style="color: #228b22;">qmckl_context_struct</span>*) context;
|
||
<span style="color: #a020f0;">return</span> ctx->precision;
|
||
}
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="orgfe30d78"></a>Fortran interface<br />
|
||
<div class="outline-text-6" id="text-2-3-3-5-2">
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #a020f0;">interface</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int32_t</span>) <span style="color: #a020f0;">function</span> <span style="color: #0000ff;">qmckl_context_get_precision</span>(context) <span style="color: #a020f0;">bind</span>(C)
|
||
<span style="color: #a020f0;">use</span>, <span style="color: #a020f0;">intrinsic</span> :: <span style="color: #0000ff;">iso_c_binding</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> context</span>
|
||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_context_get_precision</span>
|
||
<span style="color: #a020f0;">end interface</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
</li>
|
||
<li><a id="org00bd8bc"></a><code>qmckl_context_get_range</code><br />
|
||
<div class="outline-text-5" id="text-2-3-3-6">
|
||
<p>
|
||
Returns the value of the numerical range in the context
|
||
</p>
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">int32_t</span> <span style="color: #0000ff;">qmckl_context_get_range</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>);
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="orga1517d5"></a>Source<br />
|
||
<div class="outline-text-6" id="text-2-3-3-6-1">
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">int</span> <span style="color: #0000ff;">qmckl_context_get_range</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>) {
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a0522d;">ctx</span> = (<span style="color: #228b22;">qmckl_context_struct</span>*) context;
|
||
<span style="color: #a020f0;">return</span> ctx->range;
|
||
}
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="orgfc04273"></a>Fortran interface<br />
|
||
<div class="outline-text-6" id="text-2-3-3-6-2">
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #a020f0;">interface</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int32_t</span>) <span style="color: #a020f0;">function</span> <span style="color: #0000ff;">qmckl_context_get_range</span>(context) <span style="color: #a020f0;">bind</span>(C)
|
||
<span style="color: #a020f0;">use</span>, <span style="color: #a020f0;">intrinsic</span> :: <span style="color: #0000ff;">iso_c_binding</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> context</span>
|
||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_context_get_range</span>
|
||
<span style="color: #a020f0;">end interface</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
</li>
|
||
|
||
<li><a id="orgadc03a8"></a><code>qmckl_context_get_epsilon</code><br />
|
||
<div class="outline-text-5" id="text-2-3-3-7">
|
||
<p>
|
||
Returns \(\epsilon = 2^{1-n}\) where <code>n</code> is the precision
|
||
</p>
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">double</span> <span style="color: #0000ff;">qmckl_context_get_epsilon</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>);
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="orgdec9729"></a>Source<br />
|
||
<div class="outline-text-6" id="text-2-3-3-7-1">
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">double</span> <span style="color: #0000ff;">qmckl_context_get_epsilon</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>) {
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context_struct</span>* <span style="color: #a0522d;">ctx</span> = (<span style="color: #228b22;">qmckl_context_struct</span>*) context;
|
||
<span style="color: #a020f0;">return</span> pow(2.0,(<span style="color: #228b22;">double</span>) 1-ctx->precision);
|
||
}
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org69022de"></a>Fortran interface<br />
|
||
<div class="outline-text-6" id="text-2-3-3-7-2">
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #a020f0;">interface</span>
|
||
<span style="color: #228b22;">real</span> (<span style="color: #008b8b;">c_double</span>) <span style="color: #a020f0;">function</span> <span style="color: #0000ff;">qmckl_context_get_epsilon</span>(context) <span style="color: #a020f0;">bind</span>(C)
|
||
<span style="color: #a020f0;">use</span>, <span style="color: #a020f0;">intrinsic</span> :: <span style="color: #0000ff;">iso_c_binding</span>
|
||
<span style="color: #228b22;">integer</span> (<span style="color: #008b8b;">c_int64_t</span>), <span style="color: #a020f0;">intent</span>(in), <span style="color: #a020f0;">value</span> ::<span style="color: #a0522d;"> context</span>
|
||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_context_get_epsilon</span>
|
||
<span style="color: #a020f0;">end interface</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
</li>
|
||
</ol>
|
||
</div>
|
||
</div>
|
||
<div id="outline-container-org195ac19" class="outline-3">
|
||
<h3 id="org195ac19"><span class="section-number-3">2.4</span> Computation of distances</h3>
|
||
<div class="outline-text-3" id="text-2-4">
|
||
<p>
|
||
Function for the computation of distances between particles.
|
||
</p>
|
||
|
||
<p>
|
||
3 files are produced:
|
||
</p>
|
||
<ul class="org-ul">
|
||
<li>a source file : <code>qmckl_distance.f90</code></li>
|
||
<li>a C test file : <code>test_qmckl_distance.c</code></li>
|
||
<li>a Fortran test file : <code>test_qmckl_distance_f.f90</code></li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div id="outline-container-orga14880c" class="outline-4">
|
||
<h4 id="orga14880c"><span class="section-number-4">2.4.1</span> Squared distance</h4>
|
||
<div class="outline-text-4" id="text-2-4-1">
|
||
</div>
|
||
<ol class="org-ol">
|
||
<li><a id="orgcb80797"></a><code>qmckl_distance_sq</code><br />
|
||
<div class="outline-text-5" id="text-2-4-1-1">
|
||
<p>
|
||
Computes the matrix of the squared distances between all pairs of
|
||
points in two sets, one point within each set:
|
||
\[
|
||
C_{ij} = \sum_{k=1}^3 (A_{k,i}-B_{k,j})^2
|
||
\]
|
||
</p>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="org7a0dc02"></a>Arguments<br />
|
||
<div class="outline-text-6" id="text-2-4-1-1-1">
|
||
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||
|
||
|
||
<colgroup>
|
||
<col class="org-left" />
|
||
|
||
<col class="org-left" />
|
||
|
||
<col class="org-left" />
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="org-left"><code>context</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Global state</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>transa</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Array <code>A</code> is <code>N</code>: Normal, <code>T</code>: Transposed</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>transb</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Array <code>B</code> is <code>N</code>: Normal, <code>T</code>: Transposed</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>m</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Number of points in the first set</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>n</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Number of points in the second set</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>A(lda,3)</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Array containing the \(m \times 3\) matrix \(A\)</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>lda</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Leading dimension of array <code>A</code></td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>B(ldb,3)</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Array containing the \(n \times 3\) matrix \(B\)</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>ldb</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Leading dimension of array <code>B</code></td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>C(ldc,n)</code></td>
|
||
<td class="org-left">output</td>
|
||
<td class="org-left">Array containing the \(m \times n\) matrix \(C\)</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>ldc</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Leading dimension of array <code>C</code></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="orgb40efed"></a>Requirements<br />
|
||
<div class="outline-text-6" id="text-2-4-1-1-2">
|
||
<ul class="org-ul">
|
||
<li><code>context</code> is not 0</li>
|
||
<li><code>m</code> > 0</li>
|
||
<li><code>n</code> > 0</li>
|
||
<li><code>lda</code> >= 3 if <code>transa</code> is <code>N</code></li>
|
||
<li><code>lda</code> >= m if <code>transa</code> is <code>T</code></li>
|
||
<li><code>ldb</code> >= 3 if <code>transb</code> is <code>N</code></li>
|
||
<li><code>ldb</code> >= n if <code>transb</code> is <code>T</code></li>
|
||
<li><code>ldc</code> >= m</li>
|
||
<li><code>A</code> is allocated with at least \(3 \times m \times 8\) bytes</li>
|
||
<li><code>B</code> is allocated with at least \(3 \times n \times 8\) bytes</li>
|
||
<li><code>C</code> is allocated with at least \(m \times n \times 8\) bytes</li>
|
||
</ul>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org8d9b824"></a>Performance<br />
|
||
<div class="outline-text-6" id="text-2-4-1-1-3">
|
||
<p>
|
||
This function might be more efficient when <code>A</code> and <code>B</code> are
|
||
transposed.
|
||
</p>
|
||
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_distance_sq</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">char</span> <span style="color: #a0522d;">transa</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">char</span> <span style="color: #a0522d;">transb</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">m</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">n</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> *<span style="color: #a0522d;">A</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">lda</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> *<span style="color: #a0522d;">B</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">ldb</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> *<span style="color: #a0522d;">C</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">ldc</span>);
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org129298c"></a>Source<br />
|
||
<div class="outline-text-6" id="text-2-4-1-1-4">
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #228b22;">integer </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">qmckl_distance_sq_f</span><span style="color: #000000; background-color: #ffffff;">(context, transa, transb, m, n, A, LDA, B, LDB, C, LDC) result(info)</span>
|
||
<span style="color: #a020f0;">implicit</span> <span style="color: #228b22;">none</span>
|
||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> context</span>
|
||
<span style="color: #228b22;">character</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> transa, transb</span>
|
||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> m, n</span>
|
||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> lda</span>
|
||
<span style="color: #228b22;">real</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> A(lda,*)</span>
|
||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> ldb</span>
|
||
<span style="color: #228b22;">real</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> B(ldb,*)</span>
|
||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> ldc</span>
|
||
<span style="color: #228b22;">real</span>*8 , <span style="color: #a020f0;">intent</span>(out) ::<span style="color: #a0522d;"> C(ldc,*)</span>
|
||
|
||
<span style="color: #228b22;">integer</span>*8 ::<span style="color: #a0522d;"> i,j</span>
|
||
<span style="color: #228b22;">real</span>*8 ::<span style="color: #a0522d;"> x, y, z</span>
|
||
<span style="color: #228b22;">integer</span> ::<span style="color: #a0522d;"> transab</span>
|
||
|
||
info = 0
|
||
|
||
<span style="color: #a020f0;">if</span> (context == 0_8) <span style="color: #a020f0;">then</span>
|
||
info = -1
|
||
<span style="color: #a020f0;">return</span>
|
||
<span style="color: #a020f0;">endif</span>
|
||
|
||
<span style="color: #a020f0;">if</span> (m <= 0_8) <span style="color: #a020f0;">then</span>
|
||
info = -2
|
||
<span style="color: #a020f0;">return</span>
|
||
<span style="color: #a020f0;">endif</span>
|
||
|
||
<span style="color: #a020f0;">if</span> (n <= 0_8) <span style="color: #a020f0;">then</span>
|
||
info = -3
|
||
<span style="color: #a020f0;">return</span>
|
||
<span style="color: #a020f0;">endif</span>
|
||
|
||
<span style="color: #a020f0;">if</span> (transa == <span style="color: #8b2252;">'N'</span> <span style="color: #a020f0;">.or.</span> transa == <span style="color: #8b2252;">'n'</span>) <span style="color: #a020f0;">then</span>
|
||
transab = 0
|
||
<span style="color: #a020f0;">else if</span> (transa == <span style="color: #8b2252;">'T'</span> <span style="color: #a020f0;">.or.</span> transa == <span style="color: #8b2252;">'t'</span>) <span style="color: #a020f0;">then</span>
|
||
transab = 1
|
||
<span style="color: #a020f0;">else</span>
|
||
transab = -100
|
||
<span style="color: #a020f0;">endif</span>
|
||
|
||
<span style="color: #a020f0;">if</span> (transb == <span style="color: #8b2252;">'N'</span> <span style="color: #a020f0;">.or.</span> transb == <span style="color: #8b2252;">'n'</span>) <span style="color: #a020f0;">then</span>
|
||
<span style="color: #a020f0;">continue</span>
|
||
<span style="color: #a020f0;">else if</span> (transa == <span style="color: #8b2252;">'T'</span> <span style="color: #a020f0;">.or.</span> transa == <span style="color: #8b2252;">'t'</span>) <span style="color: #a020f0;">then</span>
|
||
transab = transab + 2
|
||
<span style="color: #a020f0;">else</span>
|
||
transab = -100
|
||
<span style="color: #a020f0;">endif</span>
|
||
|
||
<span style="color: #a020f0;">if</span> (transab < 0) <span style="color: #a020f0;">then</span>
|
||
info = -4
|
||
<span style="color: #a020f0;">return</span>
|
||
<span style="color: #a020f0;">endif</span>
|
||
|
||
<span style="color: #a020f0;">if</span> (<span style="color: #a020f0;">iand</span>(transab,1) == 0 <span style="color: #a020f0;">.and.</span> LDA < 3) <span style="color: #a020f0;">then</span>
|
||
info = -5
|
||
<span style="color: #a020f0;">return</span>
|
||
<span style="color: #a020f0;">endif</span>
|
||
|
||
<span style="color: #a020f0;">if</span> (<span style="color: #a020f0;">iand</span>(transab,1) == 1 <span style="color: #a020f0;">.and.</span> LDA < m) <span style="color: #a020f0;">then</span>
|
||
info = -6
|
||
<span style="color: #a020f0;">return</span>
|
||
<span style="color: #a020f0;">endif</span>
|
||
|
||
<span style="color: #a020f0;">if</span> (<span style="color: #a020f0;">iand</span>(transab,2) == 0 <span style="color: #a020f0;">.and.</span> LDA < 3) <span style="color: #a020f0;">then</span>
|
||
info = -6
|
||
<span style="color: #a020f0;">return</span>
|
||
<span style="color: #a020f0;">endif</span>
|
||
|
||
<span style="color: #a020f0;">if</span> (<span style="color: #a020f0;">iand</span>(transab,2) == 2 <span style="color: #a020f0;">.and.</span> LDA < m) <span style="color: #a020f0;">then</span>
|
||
info = -7
|
||
<span style="color: #a020f0;">return</span>
|
||
<span style="color: #a020f0;">endif</span>
|
||
|
||
|
||
<span style="color: #a020f0;">select case</span> (transab)
|
||
|
||
<span style="color: #a020f0;">case</span>(0)
|
||
|
||
<span style="color: #a020f0;">do</span> j=1,n
|
||
<span style="color: #a020f0;">do</span> i=1,m
|
||
x = A(1,i) - B(1,j)
|
||
y = A(2,i) - B(2,j)
|
||
z = A(3,i) - B(3,j)
|
||
C(i,j) = x*x + y*y + z*z
|
||
<span style="color: #a020f0;">end do</span>
|
||
<span style="color: #a020f0;">end do</span>
|
||
|
||
<span style="color: #a020f0;">case</span>(1)
|
||
|
||
<span style="color: #a020f0;">do</span> j=1,n
|
||
<span style="color: #a020f0;">do</span> i=1,m
|
||
x = A(i,1) - B(1,j)
|
||
y = A(i,2) - B(2,j)
|
||
z = A(i,3) - B(3,j)
|
||
C(i,j) = x*x + y*y + z*z
|
||
<span style="color: #a020f0;">end do</span>
|
||
<span style="color: #a020f0;">end do</span>
|
||
|
||
<span style="color: #a020f0;">case</span>(2)
|
||
|
||
<span style="color: #a020f0;">do</span> j=1,n
|
||
<span style="color: #a020f0;">do</span> i=1,m
|
||
x = A(1,i) - B(j,1)
|
||
y = A(2,i) - B(j,2)
|
||
z = A(3,i) - B(j,3)
|
||
C(i,j) = x*x + y*y + z*z
|
||
<span style="color: #a020f0;">end do</span>
|
||
<span style="color: #a020f0;">end do</span>
|
||
|
||
<span style="color: #a020f0;">case</span>(3)
|
||
|
||
<span style="color: #a020f0;">do</span> j=1,n
|
||
<span style="color: #a020f0;">do</span> i=1,m
|
||
x = A(i,1) - B(j,1)
|
||
y = A(i,2) - B(j,2)
|
||
z = A(i,3) - B(j,3)
|
||
C(i,j) = x*x + y*y + z*z
|
||
<span style="color: #a020f0;">end do</span>
|
||
<span style="color: #a020f0;">end do</span>
|
||
|
||
<span style="color: #a020f0;">end select</span>
|
||
|
||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_distance_sq_f</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
</li>
|
||
</ol>
|
||
</div>
|
||
</div>
|
||
<div id="outline-container-orgd6c92e4" class="outline-3">
|
||
<h3 id="orgd6c92e4"><span class="section-number-3">2.5</span> Atomic Orbitals</h3>
|
||
<div class="outline-text-3" id="text-2-5">
|
||
<p>
|
||
This files contains all the routines for the computation of the
|
||
values, gradients and Laplacian of the atomic basis functions.
|
||
</p>
|
||
|
||
<p>
|
||
3 files are produced:
|
||
</p>
|
||
<ul class="org-ul">
|
||
<li>a source file : <code>qmckl_ao.f90</code></li>
|
||
<li>a C test file : <code>test_qmckl_ao.c</code></li>
|
||
<li>a Fortran test file : <code>test_qmckl_ao_f.f90</code></li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div id="outline-container-org479343c" class="outline-4">
|
||
<h4 id="org479343c"><span class="section-number-4">2.5.1</span> Polynomials</h4>
|
||
<div class="outline-text-4" id="text-2-5-1">
|
||
<p>
|
||
\[
|
||
P_l(\mathbf{r},\mathbf{R}_i) = (x-X_i)^a (y-Y_i)^b (z-Z_i)^c
|
||
\]
|
||
</p>
|
||
|
||
\begin{eqnarray*}
|
||
\frac{\partial }{\partial x} P_l\left(\mathbf{r},\mathbf{R}_i \right) &
|
||
= & a (x-X_i)^{a-1} (y-Y_i)^b (z-Z_i)^c \\
|
||
\frac{\partial }{\partial y} P_l\left(\mathbf{r},\mathbf{R}_i \right) &
|
||
= & b (x-X_i)^a (y-Y_i)^{b-1} (z-Z_i)^c \\
|
||
\frac{\partial }{\partial z} P_l\left(\mathbf{r},\mathbf{R}_i \right) &
|
||
= & c (x-X_i)^a (y-Y_i)^b (z-Z_i)^{c-1} \\
|
||
\end{eqnarray*}
|
||
|
||
|
||
\begin{eqnarray*}
|
||
\left( \frac{\partial }{\partial x^2} +
|
||
\frac{\partial }{\partial y^2} +
|
||
\frac{\partial }{\partial z^2} \right) P_l
|
||
\left(\mathbf{r},\mathbf{R}_i \right) & = &
|
||
a(a-1) (x-X_i)^{a-2} (y-Y_i)^b (z-Z_i)^c + \\
|
||
&& b(b-1) (x-X_i)^a (y-Y_i)^{b-1} (z-Z_i)^c + \\
|
||
&& c(c-1) (x-X_i)^a (y-Y_i)^b (z-Z_i)^{c-1}
|
||
\end{eqnarray*}
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="orgc5fc31c"></a><code>qmckl_ao_power</code><br />
|
||
<div class="outline-text-5" id="text-2-5-1-1">
|
||
<p>
|
||
Computes all the powers of the <code>n</code> input data up to the given
|
||
maximum value given in input for each of the \(n\) points:
|
||
</p>
|
||
|
||
<p>
|
||
\[ P_{ij} = X_j^i \]
|
||
</p>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="org2e896b3"></a>Arguments<br />
|
||
<div class="outline-text-6" id="text-2-5-1-1-1">
|
||
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||
|
||
|
||
<colgroup>
|
||
<col class="org-left" />
|
||
|
||
<col class="org-left" />
|
||
|
||
<col class="org-left" />
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="org-left"><code>context</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Global state</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>n</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Number of values</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>X(n)</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Array containing the input values</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>LMAX(n)</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Array containing the maximum power for each value</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>P(LDP,n)</code></td>
|
||
<td class="org-left">output</td>
|
||
<td class="org-left">Array containing all the powers of <code>X</code></td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>LDP</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Leading dimension of array <code>P</code></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org0586aa5"></a>Requirements<br />
|
||
<div class="outline-text-6" id="text-2-5-1-1-2">
|
||
<ul class="org-ul">
|
||
<li><code>context</code> is not 0</li>
|
||
<li><code>n</code> > 0</li>
|
||
<li><code>X</code> is allocated with at least \(n \times 8\) bytes</li>
|
||
<li><code>LMAX</code> is allocated with at least \(n \times 4\) bytes</li>
|
||
<li><code>P</code> is allocated with at least \(n \times \max_i \text{LMAX}_i \times 8\) bytes</li>
|
||
<li><code>LDP</code> >= \(\max_i\) <code>LMAX[i]</code></li>
|
||
</ul>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org1daac39"></a>Header<br />
|
||
<div class="outline-text-6" id="text-2-5-1-1-3">
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_ao_power</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">n</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> *<span style="color: #a0522d;">X</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int32_t</span> *<span style="color: #a0522d;">LMAX</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> *<span style="color: #a0522d;">P</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">LDP</span>);
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org1a92260"></a>Source<br />
|
||
<div class="outline-text-6" id="text-2-5-1-1-4">
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #228b22;">integer </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">qmckl_ao_power_f</span><span style="color: #000000; background-color: #ffffff;">(context, n, X, LMAX, P, ldp) result(info)</span>
|
||
<span style="color: #a020f0;">implicit</span> <span style="color: #228b22;">none</span>
|
||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> context</span>
|
||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> n</span>
|
||
<span style="color: #228b22;">real</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> X(n)</span>
|
||
<span style="color: #228b22;">integer</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> LMAX(n)</span>
|
||
<span style="color: #228b22;">real</span>*8 , <span style="color: #a020f0;">intent</span>(out) ::<span style="color: #a0522d;"> P(ldp,n)</span>
|
||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> ldp</span>
|
||
|
||
<span style="color: #228b22;">integer</span>*8 ::<span style="color: #a0522d;"> i,j</span>
|
||
|
||
info = 0
|
||
|
||
<span style="color: #a020f0;">if</span> (context == 0_8) <span style="color: #a020f0;">then</span>
|
||
info = -1
|
||
<span style="color: #a020f0;">return</span>
|
||
<span style="color: #a020f0;">endif</span>
|
||
|
||
<span style="color: #a020f0;">if</span> (LDP < <span style="color: #a020f0;">MAXVAL</span>(LMAX)) <span style="color: #a020f0;">then</span>
|
||
info = -2
|
||
<span style="color: #a020f0;">return</span>
|
||
<span style="color: #a020f0;">endif</span>
|
||
|
||
<span style="color: #a020f0;">do</span> j=1,n
|
||
P(1,j) = X(j)
|
||
<span style="color: #a020f0;">do</span> i=2,LMAX(j)
|
||
P(i,j) = P(i-1,j) * X(j)
|
||
<span style="color: #a020f0;">end do</span>
|
||
<span style="color: #a020f0;">end do</span>
|
||
|
||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_ao_power_f</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
</li>
|
||
|
||
|
||
<li><a id="org7825b8f"></a><code>qmckl_ao_polynomial_vgl</code><br />
|
||
<div class="outline-text-5" id="text-2-5-1-2">
|
||
<p>
|
||
Computes the values, gradients and Laplacians at a given point of
|
||
all polynomials with an angular momentum up to <code>lmax</code>.
|
||
</p>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="org398f44a"></a>Arguments<br />
|
||
<div class="outline-text-6" id="text-2-5-1-2-1">
|
||
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||
|
||
|
||
<colgroup>
|
||
<col class="org-left" />
|
||
|
||
<col class="org-left" />
|
||
|
||
<col class="org-left" />
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="org-left"><code>context</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Global state</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>X(3)</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Array containing the coordinates of the points</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>R(3)</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Array containing the x,y,z coordinates of the center</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>lmax</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Maximum angular momentum</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>n</code></td>
|
||
<td class="org-left">output</td>
|
||
<td class="org-left">Number of computed polynomials</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>L(ldl,n)</code></td>
|
||
<td class="org-left">output</td>
|
||
<td class="org-left">Contains a,b,c for all <code>n</code> results</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>ldl</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Leading dimension of <code>L</code></td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>VGL(ldv,n)</code></td>
|
||
<td class="org-left">output</td>
|
||
<td class="org-left">Value, gradients and Laplacian of the polynomials</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>ldv</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Leading dimension of array <code>VGL</code></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org813dfd8"></a>Requirements<br />
|
||
<div class="outline-text-6" id="text-2-5-1-2-2">
|
||
<ul class="org-ul">
|
||
<li><code>context</code> is not 0</li>
|
||
<li><code>n</code> > 0</li>
|
||
<li><code>lmax</code> >= 0</li>
|
||
<li><code>ldl</code> >= 3</li>
|
||
<li><code>ldv</code> >= 5</li>
|
||
<li><code>X</code> is allocated with at least \(3 \times 8\) bytes</li>
|
||
<li><code>R</code> is allocated with at least \(3 \times 8\) bytes</li>
|
||
<li><code>n</code> >= <code>(lmax+1)(lmax+2)(lmax+3)/6</code></li>
|
||
<li><code>L</code> is allocated with at least \(3 \times n \times 4\) bytes</li>
|
||
<li><code>VGL</code> is allocated with at least \(5 \times n \times 8\) bytes</li>
|
||
<li>On output, <code>n</code> should be equal to <code>(lmax+1)(lmax+2)(lmax+3)/6</code></li>
|
||
<li>On output, the powers are given in the following order (l=a+b+c):
|
||
<ul class="org-ul">
|
||
<li>Increase values of <code>l</code></li>
|
||
<li>Within a given value of <code>l</code>, alphabetical order of the
|
||
string made by a*"x" + b*"y" + c*"z" (in Python notation).
|
||
For example, with a=0, b=2 and c=1 the string is "yyz"</li>
|
||
</ul></li>
|
||
</ul>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org7389e2e"></a>Error codes<br />
|
||
<div class="outline-text-6" id="text-2-5-1-2-3">
|
||
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||
|
||
|
||
<colgroup>
|
||
<col class="org-right" />
|
||
|
||
<col class="org-left" />
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="org-right">-1</td>
|
||
<td class="org-left">Null context</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-right">-2</td>
|
||
<td class="org-left">Inconsistent <code>ldl</code></td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-right">-3</td>
|
||
<td class="org-left">Inconsistent <code>ldv</code></td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-right">-4</td>
|
||
<td class="org-left">Inconsistent <code>lmax</code></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="orge59243e"></a>Header<br />
|
||
<div class="outline-text-6" id="text-2-5-1-2-4">
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_ao_polynomial_vgl</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> *<span style="color: #a0522d;">X</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> *<span style="color: #a0522d;">R</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int32_t</span> <span style="color: #a0522d;">lmax</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> *<span style="color: #a0522d;">n</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int32_t</span> *<span style="color: #a0522d;">L</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">ldl</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> *<span style="color: #a0522d;">VGL</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">ldv</span>);
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org3866693"></a>Source<br />
|
||
<div class="outline-text-6" id="text-2-5-1-2-5">
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #228b22;">integer </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">qmckl_ao_polynomial_vgl_f</span><span style="color: #000000; background-color: #ffffff;">(context, X, R, lmax, n, L, ldl, VGL, ldv) result(info)</span>
|
||
<span style="color: #a020f0;">implicit</span> <span style="color: #228b22;">none</span>
|
||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> context</span>
|
||
<span style="color: #228b22;">real</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> X(3), R(3)</span>
|
||
<span style="color: #228b22;">integer</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> lmax</span>
|
||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(out) ::<span style="color: #a0522d;"> n</span>
|
||
<span style="color: #228b22;">integer</span> , <span style="color: #a020f0;">intent</span>(out) ::<span style="color: #a0522d;"> L(ldl,(lmax+1)*(lmax+2)*(lmax+3)/6)</span>
|
||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> ldl</span>
|
||
<span style="color: #228b22;">real</span>*8 , <span style="color: #a020f0;">intent</span>(out) ::<span style="color: #a0522d;"> VGL(ldv,(lmax+1)*(lmax+2)*(lmax+3)/6)</span>
|
||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> ldv</span>
|
||
|
||
<span style="color: #228b22;">integer</span>*8 ::<span style="color: #a0522d;"> i,j</span>
|
||
<span style="color: #228b22;">integer</span> ::<span style="color: #a0522d;"> a,b,c,d</span>
|
||
<span style="color: #228b22;">real</span>*8 ::<span style="color: #a0522d;"> Y(3)</span>
|
||
<span style="color: #228b22;">integer</span> ::<span style="color: #a0522d;"> lmax_array(3)</span>
|
||
<span style="color: #228b22;">real</span>*8 ::<span style="color: #a0522d;"> pows(-2:lmax,3)</span>
|
||
<span style="color: #228b22;">integer</span>, <span style="color: #a020f0;">external</span> ::<span style="color: #a0522d;"> qmckl_ao_power_f</span>
|
||
<span style="color: #228b22;">double precision</span> ::<span style="color: #a0522d;"> xy, yz, xz</span>
|
||
<span style="color: #228b22;">double precision</span> ::<span style="color: #a0522d;"> da, db, dc, dd</span>
|
||
|
||
info = 0
|
||
|
||
<span style="color: #a020f0;">if</span> (context == 0_8) <span style="color: #a020f0;">then</span>
|
||
info = -1
|
||
<span style="color: #a020f0;">return</span>
|
||
<span style="color: #a020f0;">endif</span>
|
||
|
||
<span style="color: #a020f0;">if</span> (ldl < 3) <span style="color: #a020f0;">then</span>
|
||
info = -2
|
||
<span style="color: #a020f0;">return</span>
|
||
<span style="color: #a020f0;">endif</span>
|
||
|
||
<span style="color: #a020f0;">if</span> (ldv < 5) <span style="color: #a020f0;">then</span>
|
||
info = -3
|
||
<span style="color: #a020f0;">return</span>
|
||
<span style="color: #a020f0;">endif</span>
|
||
|
||
<span style="color: #a020f0;">if</span> (lmax <= 0) <span style="color: #a020f0;">then</span>
|
||
info = -4
|
||
<span style="color: #a020f0;">return</span>
|
||
<span style="color: #a020f0;">endif</span>
|
||
|
||
|
||
<span style="color: #a020f0;">do</span> i=1,3
|
||
Y(i) = X(i) - R(i)
|
||
<span style="color: #a020f0;">end do</span>
|
||
|
||
lmax_array(1:3) = lmax
|
||
<span style="color: #a020f0;">if</span> (lmax == 0) <span style="color: #a020f0;">then</span>
|
||
VGL(1,1) = 1.d0
|
||
vgL(2:5,1) = 0.d0
|
||
l(1:3,1) = 0
|
||
n=1
|
||
<span style="color: #a020f0;">else if</span> (lmax > 0) <span style="color: #a020f0;">then</span>
|
||
pows(-2:0,1:3) = 1.d0
|
||
<span style="color: #a020f0;">do</span> i=1,lmax
|
||
pows(i,1) = pows(i-1,1) * Y(1)
|
||
pows(i,2) = pows(i-1,2) * Y(2)
|
||
pows(i,3) = pows(i-1,3) * Y(3)
|
||
<span style="color: #a020f0;">end do</span>
|
||
|
||
VGL(1:5,1:4) = 0.d0
|
||
l(1:3,1:4) = 0
|
||
|
||
VGL(1,1) = 1.d0
|
||
vgl(1:5,2:4) = 0.d0
|
||
|
||
l(1,2) = 1
|
||
vgl(1,2) = pows(1,1)
|
||
vgL(2,2) = 1.d0
|
||
|
||
l(2,3) = 1
|
||
vgl(1,3) = pows(1,2)
|
||
vgL(3,3) = 1.d0
|
||
|
||
l(3,4) = 1
|
||
vgl(1,4) = pows(1,3)
|
||
vgL(4,4) = 1.d0
|
||
|
||
n=4
|
||
<span style="color: #a020f0;">endif</span>
|
||
|
||
! <span style="color: #b22222;">l>=2</span>
|
||
dd = 2.d0
|
||
<span style="color: #a020f0;">do</span> d=2,lmax
|
||
da = dd
|
||
<span style="color: #a020f0;">do</span> a=d,0,-1
|
||
db = dd-da
|
||
<span style="color: #a020f0;">do</span> b=d-a,0,-1
|
||
c = d - a - b
|
||
dc = dd - da - db
|
||
n = n+1
|
||
|
||
l(1,n) = a
|
||
l(2,n) = b
|
||
l(3,n) = c
|
||
|
||
xy = pows(a,1) * pows(b,2)
|
||
yz = pows(b,2) * pows(c,3)
|
||
xz = pows(a,1) * pows(c,3)
|
||
|
||
vgl(1,n) = xy * pows(c,3)
|
||
|
||
xy = dc * xy
|
||
xz = db * xz
|
||
yz = da * yz
|
||
|
||
vgl(2,n) = pows(a-1,1) * yz
|
||
vgl(3,n) = pows(b-1,2) * xz
|
||
vgl(4,n) = pows(c-1,3) * xy
|
||
|
||
vgl(5,n) = <span style="color: #a020f0;">&</span>
|
||
(da-1.d0) * pows(a-2,1) * yz + <span style="color: #a020f0;">&</span>
|
||
(db-1.d0) * pows(b-2,2) * xz + <span style="color: #a020f0;">&</span>
|
||
(dc-1.d0) * pows(c-2,3) * xy
|
||
|
||
db = db - 1.d0
|
||
<span style="color: #a020f0;">end do</span>
|
||
da = da - 1.d0
|
||
<span style="color: #a020f0;">end do</span>
|
||
dd = dd + 1.d0
|
||
<span style="color: #a020f0;">end do</span>
|
||
|
||
info = 0
|
||
|
||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_ao_polynomial_vgl_f</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
</li>
|
||
</ol>
|
||
</div>
|
||
|
||
<div id="outline-container-org6397a61" class="outline-4">
|
||
<h4 id="org6397a61"><span class="section-number-4">2.5.2</span> Gaussian basis functions</h4>
|
||
<div class="outline-text-4" id="text-2-5-2">
|
||
</div>
|
||
<ol class="org-ol">
|
||
<li><a id="orgf97ddb9"></a><code>qmckl_ao_gaussian_vgl</code><br />
|
||
<div class="outline-text-5" id="text-2-5-2-1">
|
||
<p>
|
||
Computes the values, gradients and Laplacians at a given point of
|
||
<code>n</code> Gaussian functions centered at the same point:
|
||
</p>
|
||
|
||
<p>
|
||
\[ v_i = \exp(-a_i |X-R|^2) \]
|
||
\[ \nabla_x v_i = -2 a_i (X_x - R_x) v_i \]
|
||
\[ \nabla_y v_i = -2 a_i (X_y - R_y) v_i \]
|
||
\[ \nabla_z v_i = -2 a_i (X_z - R_z) v_i \]
|
||
\[ \Delta v_i = a_i (4 |X-R|^2 a_i - 6) v_i \]
|
||
</p>
|
||
</div>
|
||
|
||
<ol class="org-ol">
|
||
<li><a id="orge60f52c"></a>Arguments<br />
|
||
<div class="outline-text-6" id="text-2-5-2-1-1">
|
||
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||
|
||
|
||
<colgroup>
|
||
<col class="org-left" />
|
||
|
||
<col class="org-left" />
|
||
|
||
<col class="org-left" />
|
||
</colgroup>
|
||
<tbody>
|
||
<tr>
|
||
<td class="org-left"><code>context</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Global state</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>X(3)</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Array containing the coordinates of the points</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>R(3)</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Array containing the x,y,z coordinates of the center</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>n</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Number of computed gaussians</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>A(n)</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Exponents of the Gaussians</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>VGL(ldv,5)</code></td>
|
||
<td class="org-left">output</td>
|
||
<td class="org-left">Value, gradients and Laplacian of the Gaussians</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="org-left"><code>ldv</code></td>
|
||
<td class="org-left">input</td>
|
||
<td class="org-left">Leading dimension of array <code>VGL</code></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="orge8e920f"></a>Requirements<br />
|
||
<div class="outline-text-6" id="text-2-5-2-1-2">
|
||
<ul class="org-ul">
|
||
<li><code>context</code> is not 0</li>
|
||
<li><code>n</code> > 0</li>
|
||
<li><code>ldv</code> >= 5</li>
|
||
<li><code>A(i)</code> > 0 for all <code>i</code></li>
|
||
<li><code>X</code> is allocated with at least \(3 \times 8\) bytes</li>
|
||
<li><code>R</code> is allocated with at least \(3 \times 8\) bytes</li>
|
||
<li><code>A</code> is allocated with at least \(n \times 8\) bytes</li>
|
||
<li><code>VGL</code> is allocated with at least \(n \times 5 \times 8\) bytes</li>
|
||
</ul>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="orgffae896"></a>Header<br />
|
||
<div class="outline-text-6" id="text-2-5-2-1-3">
|
||
<div class="org-src-container">
|
||
<pre class="src src-C"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_ao_gaussian_vgl</span>(<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> *<span style="color: #a0522d;">X</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> *<span style="color: #a0522d;">R</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> *<span style="color: #a0522d;">n</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> *<span style="color: #a0522d;">A</span>,
|
||
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> *<span style="color: #a0522d;">VGL</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">ldv</span>);
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
|
||
<li><a id="org0651d0b"></a>Source<br />
|
||
<div class="outline-text-6" id="text-2-5-2-1-4">
|
||
<div class="org-src-container">
|
||
<pre class="src src-f90"><span style="color: #228b22;">integer </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">qmckl_ao_gaussian_vgl_f</span><span style="color: #000000; background-color: #ffffff;">(context, X, R, n, A, VGL, ldv) result(info)</span>
|
||
<span style="color: #a020f0;">implicit</span> <span style="color: #228b22;">none</span>
|
||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> context</span>
|
||
<span style="color: #228b22;">real</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> X(3), R(3)</span>
|
||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> n</span>
|
||
<span style="color: #228b22;">real</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> A(n)</span>
|
||
<span style="color: #228b22;">real</span>*8 , <span style="color: #a020f0;">intent</span>(out) ::<span style="color: #a0522d;"> VGL(ldv,5)</span>
|
||
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> ldv</span>
|
||
|
||
<span style="color: #228b22;">integer</span>*8 ::<span style="color: #a0522d;"> i,j</span>
|
||
<span style="color: #228b22;">real</span>*8 ::<span style="color: #a0522d;"> Y(3), r2, t, u, v</span>
|
||
|
||
info = 0
|
||
|
||
<span style="color: #a020f0;">if</span> (context == 0_8) <span style="color: #a020f0;">then</span>
|
||
info = -1
|
||
<span style="color: #a020f0;">return</span>
|
||
<span style="color: #a020f0;">endif</span>
|
||
|
||
<span style="color: #a020f0;">if</span> (n <= 0) <span style="color: #a020f0;">then</span>
|
||
info = -2
|
||
<span style="color: #a020f0;">return</span>
|
||
<span style="color: #a020f0;">endif</span>
|
||
|
||
<span style="color: #a020f0;">if</span> (ldv < n) <span style="color: #a020f0;">then</span>
|
||
info = -3
|
||
<span style="color: #a020f0;">return</span>
|
||
<span style="color: #a020f0;">endif</span>
|
||
|
||
|
||
<span style="color: #a020f0;">do</span> i=1,3
|
||
Y(i) = X(i) - R(i)
|
||
<span style="color: #a020f0;">end do</span>
|
||
r2 = Y(1)*Y(1) + Y(2)*Y(2) + Y(3)*Y(3)
|
||
|
||
<span style="color: #a020f0;">do</span> i=1,n
|
||
VGL(i,1) = dexp(-A(i) * r2)
|
||
<span style="color: #a020f0;">end do</span>
|
||
|
||
<span style="color: #a020f0;">do</span> i=1,n
|
||
VGL(i,5) = A(i) * VGL(i,1)
|
||
<span style="color: #a020f0;">end do</span>
|
||
|
||
t = -2.d0 * ( X(1) - R(1) )
|
||
u = -2.d0 * ( X(2) - R(2) )
|
||
v = -2.d0 * ( X(3) - R(3) )
|
||
|
||
<span style="color: #a020f0;">do</span> i=1,n
|
||
VGL(i,2) = t * VGL(i,5)
|
||
VGL(i,3) = u * VGL(i,5)
|
||
VGL(i,4) = v * VGL(i,5)
|
||
<span style="color: #a020f0;">end do</span>
|
||
|
||
t = 4.d0 * r2
|
||
<span style="color: #a020f0;">do</span> i=1,n
|
||
VGL(i,5) = (t * A(i) - 6.d0) * VGL(i,5)
|
||
<span style="color: #a020f0;">end do</span>
|
||
|
||
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_ao_gaussian_vgl_f</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
</li>
|
||
</ol>
|
||
</div>
|
||
|
||
|
||
<div id="outline-container-org1f80bc0" class="outline-4">
|
||
<h4 id="org1f80bc0"><span class="section-number-4">2.5.3</span> <span class="todo TODO">TODO</span> Slater basis functions</h4>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="outline-container-org259b251" class="outline-2">
|
||
<h2 id="org259b251"><span class="section-number-2">3</span> Acknowledgments</h2>
|
||
<div class="outline-text-2" id="text-3">
|
||
<p>
|
||
<img src="https://trex-coe.eu/sites/default/files/inline-images/euflag.jpg" alt="euflag.jpg" />
|
||
<a href="https://trex-coe.eu">TREX: Targeting Real Chemical Accuracy at the Exascale</a> project has received funding from the European Union’s Horizon 2020 - Research and Innovation program - under grant agreement no. 952165. The content of this document does not represent the opinion of the European Union, and the European Union is not responsible for any use that might be made of such content.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div id="postamble" class="status">
|
||
<p class="date">Created: 2021-02-19 Fri 00:40</p>
|
||
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
|
||
</div>
|
||
</body>
|
||
</html>
|