2022-09-28 18:04:21 +02:00
<?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 >
2024-02-23 11:17:59 +01:00
<!-- 2024 - 02 - 23 Fri 10:17 -->
2022-09-28 18:04:21 +02:00
< meta http-equiv = "Content-Type" content = "text/html;charset=utf-8" / >
< meta name = "viewport" content = "width=device-width, initial-scale=1" / >
2023-03-30 17:09:05 +02:00
< title > CHAMP Jastrow Factor< / title >
2022-09-28 18:04:21 +02:00
< meta name = "generator" content = "Org mode" / >
< meta name = "author" content = "TREX CoE" / >
< 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; }
2022-11-18 14:16:53 +01:00
.equation-container {
display: table;
text-align: center;
width: 100%;
}
.equation {
vertical-align: middle;
}
.equation-label {
display: table-cell;
text-align: right;
vertical-align: middle;
}
2022-09-28 18:04:21 +02:00
.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" title = "Standard" href = "qmckl.css" type = "text/css" / >
< script type = "text/javascript" src = "org-info.js" >
/**
*
* @source: org-info.js
*
* @licstart The following is the entire license notice for the
* JavaScript code in org-info.js.
*
2022-11-18 14:16:53 +01:00
* Copyright (C) 2012-2020 Free Software Foundation, Inc.
2022-09-28 18:04:21 +02:00
*
*
* 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 org-info.js.
*
*/
< / script >
< script type = "text/javascript" >
/*
@licstart The following is the entire license notice for the
JavaScript code in this tag.
2022-11-18 14:16:53 +01:00
Copyright (C) 2012-2020 Free Software Foundation, Inc.
2022-09-28 18:04:21 +02:00
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[/*> <!-- */
org_html_manager.set("TOC_DEPTH", "4");
org_html_manager.set("LINK_HOME", "index.html");
org_html_manager.set("LINK_UP", "");
org_html_manager.set("LOCAL_TOC", "1");
org_html_manager.set("VIEW_BUTTONS", "0");
org_html_manager.set("MOUSE_HINT", "underline");
org_html_manager.set("FIXED_TOC", "0");
org_html_manager.set("TOC", "1");
org_html_manager.set("VIEW", "info");
org_html_manager.setup(); // activate after the parameters are set
/*]]>*///-->
< / script >
< script type = "text/javascript" >
/*
@licstart The following is the entire license notice for the
JavaScript code in this tag.
2022-11-18 14:16:53 +01:00
Copyright (C) 2012-2020 Free Software Foundation, Inc.
2022-09-28 18:04:21 +02:00
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 = "org-div-home-and-up" >
< a accesskey = "h" href = "" > UP < / a >
|
< a accesskey = "H" href = "index.html" > HOME < / a >
< / div > < div id = "content" >
2023-03-30 17:09:05 +02:00
< h1 class = "title" > CHAMP Jastrow Factor< / h1 >
2022-09-28 18:04:21 +02:00
< div id = "table-of-contents" >
< h2 > Table of Contents< / h2 >
< div id = "text-table-of-contents" >
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#orgb8b88c0" > 1. Introduction< / a > < / li >
< li > < a href = "#org7ddda39" > 2. Context< / a >
2022-09-28 18:04:21 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org6cd022b" > 2.1. Data structure< / a > < / li >
< li > < a href = "#org7db09fe" > 2.2. Initialization functions< / a >
2022-11-14 14:59:00 +01:00
< ul >
< li >
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#orgfb1248b" > 2.2.0.1. Fortran interface< / a > < / li >
2022-11-14 14:59:00 +01:00
< / ul >
< / li >
2022-09-28 18:04:21 +02:00
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org1e5b0dd" > 2.3. Access functions< / a >
2022-11-16 18:00:51 +01:00
< ul >
< li >
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org2b6f457" > 2.3.0.1. Fortran interface< / a > < / li >
2022-11-16 18:00:51 +01:00
< / ul >
< / li >
2022-11-14 14:59:00 +01:00
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org0382e49" > 2.4. Test< / a > < / li >
2022-11-16 18:00:51 +01:00
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org7f98ff4" > 3. Computation< / a >
2022-09-28 18:04:21 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org17e5188" > 3.1. Electron-electron component< / a >
2022-09-28 18:04:21 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org5cdcc5f" > 3.1.1. Asymptotic component< / a >
2022-11-17 19:27:17 +01:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#orgddd3b6b" > 3.1.1.1. Get< / a > < / li >
< li > < a href = "#org956b264" > 3.1.1.2. Compute< / a > < / li >
< li > < a href = "#org2a94445" > 3.1.1.3. Test< / a > < / li >
2022-11-17 19:27:17 +01:00
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org2e0b18e" > 3.1.2. Electron-electron component< / a >
2022-09-28 18:04:21 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org83ea1fd" > 3.1.2.1. Get< / a > < / li >
< li > < a href = "#org48ec686" > 3.1.2.2. Compute< / a > < / li >
< li > < a href = "#orgbe1f162" > 3.1.2.3. Test< / a > < / li >
2022-11-17 19:27:17 +01:00
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org4c27848" > 3.1.3. Derivative< / a >
2023-03-30 12:35:59 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org48c9088" > 3.1.3.1. Get< / a > < / li >
< li > < a href = "#org85c9697" > 3.1.3.2. Compute< / a > < / li >
< li > < a href = "#orgb79b3bf" > 3.1.3.3. Test< / a > < / li >
2022-09-28 18:04:21 +02:00
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#orgf4e1bce" > 3.1.4. Electron-electron rescaled distances< / a >
2022-11-17 19:27:17 +01:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#orgc681bff" > 3.1.4.1. Get< / a > < / li >
< li > < a href = "#org0c6a96d" > 3.1.4.2. Compute< / a > < / li >
< li > < a href = "#org4f1a0a7" > 3.1.4.3. Test< / a > < / li >
2022-11-16 18:00:51 +01:00
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#orgdb5121c" > 3.1.5. Electron-electron rescaled distance gradients and Laplacian with respect to electron coordinates< / a >
2022-09-28 18:04:21 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#orgac94f7f" > 3.1.5.1. Get< / a > < / li >
< li > < a href = "#org17a4d69" > 3.1.5.2. Compute< / a > < / li >
< li > < a href = "#org1d3ce94" > 3.1.5.3. Test< / a > < / li >
2022-11-17 19:27:17 +01:00
< / ul >
< / li >
2022-09-28 18:04:21 +02:00
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#orgf83b20c" > 3.2. Electron-nucleus component< / a >
2022-11-16 18:00:51 +01:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org098092a" > 3.2.1. Asymptotic component for< / a >
2022-09-28 18:04:21 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org3772f05" > 3.2.1.1. Get< / a > < / li >
< li > < a href = "#orgcf8bd44" > 3.2.1.2. Compute< / a > < / li >
< li > < a href = "#orgbaeada9" > 3.2.1.3. Test< / a > < / li >
2022-09-28 18:04:21 +02:00
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org9f3c524" > 3.2.2. Electron-nucleus component< / a >
2022-09-28 18:04:21 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org9ab8579" > 3.2.2.1. Get< / a > < / li >
< li > < a href = "#org620e254" > 3.2.2.2. Compute< / a > < / li >
< li > < a href = "#org1744d8c" > 3.2.2.3. Test< / a > < / li >
2022-09-28 18:04:21 +02:00
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#orgd415f3b" > 3.2.3. Derivative< / a >
2022-09-28 18:04:21 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org0598461" > 3.2.3.1. Get< / a > < / li >
< li > < a href = "#org45f9dbc" > 3.2.3.2. Compute< / a > < / li >
< li > < a href = "#org32264bc" > 3.2.3.3. Test< / a > < / li >
2022-09-28 18:04:21 +02:00
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org59434c0" > 3.2.4. Electron-nucleus rescaled distances< / a >
2022-09-28 18:04:21 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org92607ec" > 3.2.4.1. Get< / a > < / li >
< li > < a href = "#org9afe12d" > 3.2.4.2. Compute< / a > < / li >
< li > < a href = "#orgc6cdb88" > 3.2.4.3. Test< / a > < / li >
2022-09-28 18:04:21 +02:00
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org50a9d9c" > 3.2.5. Electron-electron rescaled distance gradients and Laplacian with respect to electron coordinates< / a >
2022-09-28 18:04:21 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#orgeeb8d31" > 3.2.5.1. Get< / a > < / li >
< li > < a href = "#org96e6ec8" > 3.2.5.2. Compute< / a > < / li >
< li > < a href = "#org803fb75" > 3.2.5.3. Test< / a > < / li >
2022-09-28 18:04:21 +02:00
< / ul >
< / li >
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org1428d73" > 3.3. Electron-electron-nucleus component< / a >
2022-09-28 18:04:21 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#orgcb33582" > 3.3.1. Electron-electron rescaled distances in \(J_\text{eeN}\)< / a >
2023-03-30 12:35:59 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#orgfbb2f76" > 3.3.1.1. Get< / a > < / li >
< li > < a href = "#orgf77a739" > 3.3.1.2. Compute< / a > < / li >
< li > < a href = "#org30313f3" > 3.3.1.3. Test< / a > < / li >
2022-09-28 18:04:21 +02:00
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#orgd8db2ca" > 3.3.2. Electron-electron rescaled distances derivatives in \(J_\text{eeN}\)< / a >
2022-09-28 18:04:21 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org201a688" > 3.3.2.1. Get< / a > < / li >
< li > < a href = "#org01e001f" > 3.3.2.2. Compute< / a > < / li >
< li > < a href = "#orge82a4eb" > 3.3.2.3. Test< / a > < / li >
2022-09-28 18:04:21 +02:00
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org4ec93e7" > 3.3.3. Electron-nucleus rescaled distances in \(J_\text{eeN}\)< / a >
2022-09-28 18:04:21 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org6ad7501" > 3.3.3.1. Get< / a > < / li >
< li > < a href = "#org1cec5a1" > 3.3.3.2. Compute< / a > < / li >
< li > < a href = "#org7d6db7f" > 3.3.3.3. Test< / a > < / li >
2022-09-28 18:04:21 +02:00
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org7d382b6" > 3.3.4. Electron-nucleus rescaled distances derivatives in \(J_\text{eeN}\)< / a >
2022-09-28 18:04:21 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org8fb2979" > 3.3.4.1. Get< / a > < / li >
< li > < a href = "#org4d15228" > 3.3.4.2. Compute< / a > < / li >
< li > < a href = "#orge9c0e94" > 3.3.4.3. Test< / a > < / li >
2022-09-28 18:04:21 +02:00
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#orge63e5a7" > 3.3.5. Temporary arrays for electron-electron-nucleus Jastrow \(f_{een}\)< / a >
2022-09-28 18:04:21 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#orgc65e240" > 3.3.5.1. Compute dim< sub > c< / sub > < sub > vector< / sub > < / a > < / li >
< li > < a href = "#org07fa6a5" > 3.3.5.2. Get< / a > < / li >
< li > < a href = "#org16c9791" > 3.3.5.3. Compute c< sub > vector< / sub > < sub > full< / sub > < / a > < / li >
< li > < a href = "#orgb41c94a" > 3.3.5.4. Compute lkpm< sub > combined< / sub > < sub > index< / sub > < / a > < / li >
< li > < a href = "#orgfb959ad" > 3.3.5.5. Compute tmp< sub > c< / sub > < / a > < / li >
< li > < a href = "#orgcfeb440" > 3.3.5.6. Compute dtmp< sub > c< / sub > < / a > < / li >
< li > < a href = "#org29546b4" > 3.3.5.7. Test< / a > < / li >
2022-09-28 18:04:21 +02:00
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#orge98ac12" > 3.3.6. Electron-electron-nucleus Jastrow \(f_{een}\)< / a >
2022-11-16 18:00:51 +01:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org817710d" > 3.3.6.1. Get< / a > < / li >
< li > < a href = "#org965bf14" > 3.3.6.2. Compute naive< / a > < / li >
< li > < a href = "#orgb8b5386" > 3.3.6.3. Compute< / a > < / li >
< li > < a href = "#org7d82288" > 3.3.6.4. Test< / a > < / li >
2022-11-16 18:00:51 +01:00
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org514e5df" > 3.3.7. Electron-electron-nucleus Jastrow \(f_{een}\) derivative< / a >
2023-03-30 12:35:59 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org6ef7304" > 3.3.7.1. Get< / a > < / li >
< li > < a href = "#org994c10b" > 3.3.7.2. Compute Naive< / a > < / li >
< li > < a href = "#org30eb4a9" > 3.3.7.3. Compute< / a > < / li >
< li > < a href = "#org9906cc2" > 3.3.7.4. Test< / a > < / li >
2023-03-31 15:12:07 +02:00
< / ul >
< / li >
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#orgab44f4e" > 3.4. Total Jastrow< / a >
2023-03-31 15:12:07 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org31266fa" > 3.4.1. Value< / a >
2023-03-31 15:12:07 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#orgb93747b" > 3.4.1.1. Get< / a > < / li >
< li > < a href = "#org90ec58a" > 3.4.1.2. Compute< / a > < / li >
< li > < a href = "#org03323cd" > 3.4.1.3. Test< / a > < / li >
2023-03-31 15:12:07 +02:00
< / ul >
< / li >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org36a06b3" > 3.4.2. Derivatives< / a >
2023-03-31 15:12:07 +02:00
< ul >
2024-02-23 11:17:59 +01:00
< li > < a href = "#org646b2a6" > 3.4.2.1. Get< / a > < / li >
< li > < a href = "#orge8d10c4" > 3.4.2.2. Compute< / a > < / li >
< li > < a href = "#org344c4f8" > 3.4.2.3. Test< / a > < / li >
2022-09-28 18:04:21 +02:00
< / ul >
< / li >
< / ul >
< / li >
< / ul >
< / li >
< / ul >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgb8b88c0" class = "outline-2" >
< h2 id = "orgb8b88c0" > < span class = "section-number-2" > 1< / span > Introduction< / h2 >
2022-09-28 18:04:21 +02:00
< div class = "outline-text-2" id = "text-1" >
< p >
The Jastrow factor depends on the electronic (\(\mathbf{r}\)) and
nuclear (\(\mathbf{R}\)) coordinates. Its defined as \(\exp(J(\mathbf{r},\mathbf{R}))\), where
< / p >
< p >
\[
J(\mathbf{r},\mathbf{R}) = J_{\text{eN}}(\mathbf{r},\mathbf{R}) + J_{\text{ee}}(\mathbf{r}) + J_{\text{eeN}}(\mathbf{r},\mathbf{R})
\]
< / p >
< p >
In the following, we use the notations \(r_{ij} = |\mathbf{r}_i - \mathbf{r}_j|\) and
\(R_{i\alpha} = |\mathbf{r}_i - \mathbf{R}_\alpha|\).
< / p >
< p >
\(J_{\text{eN}}\) contains electron-nucleus terms:
< / p >
< p >
\[
2022-11-17 19:27:17 +01:00
J_{\text{eN}}(\mathbf{r},\mathbf{R}) =
2023-05-26 09:53:50 +02:00
\sum_{\alpha=1}^{N_\text{nucl}} \sum_{i=1}^{N_\text{elec}}
2023-03-30 12:35:59 +02:00
\frac{a_{1\,\alpha}\, f_\alpha(R_{i\alpha})}{1+a_{2\,\alpha}\, f_\alpha(R_{i\alpha})} +
2023-05-25 01:50:47 +02:00
\sum_{p=2}^{N_\text{ord}^a} a_{p+1\,\alpha}\, [f_\alpha(R_{i\alpha})]^p - J_{\text{eN}}^{\infty \alpha}
2022-09-28 18:04:21 +02:00
\]
< / p >
< p >
\(J_{\text{ee}}\) contains electron-electron terms:
\[
J_{\text{ee}}(\mathbf{r}) =
\sum_{i=1}^{N_\text{elec}} \sum_{j=1}^{i-1}
2023-03-02 11:13:03 +01:00
\frac{\frac{1}{2}(1+\delta^{\uparrow\downarrow}_{ij}) b_1\, f_{\text{ee}}(r_{ij})}{1+b_2\, f_{\text{ee}}(r_{ij})} +
\sum_{p=2}^{N_\text{ord}^b} b_{p+1}\, [f_{\text{ee}}(r_{ij})]^p - J_{ee}^\infty
2022-09-28 18:04:21 +02:00
\]
< / p >
< p >
and \(J_{\text{eeN}}\) contains electron-electron-Nucleus terms:
< / p >
< p >
\[
J_{\text{eeN}}(\mathbf{r},\mathbf{R}) =
\sum_{\alpha=1}^{N_{\text{nucl}}}
\sum_{i=1}^{N_{\text{elec}}}
\sum_{j=1}^{i-1}
\sum_{p=2}^{N_{\text{ord}}}
\sum_{k=0}^{p-1}
\sum_{l=0}^{p-k-2\delta_{k,0}}
2023-09-12 16:43:06 +02:00
c_{lkp\alpha} \left[ g_\text{e}({r}_{ij}) \right]^k
2022-09-28 18:04:21 +02:00
\left[ \left[ g_\alpha({R}_{i\alpha}) \right]^l + \left[ g_\alpha({R}_{j\alpha}) \right]^l \right]
\left[ g_\alpha({R}_{i\,\alpha}) \, g_\alpha({R}_{j\alpha}) \right]^{(p-k-l)/2}
\]
< / p >
< p >
\(c_{lkp\alpha}\) are non-zero only when \(p-k-l\) is even.
< / p >
< p >
\(f\) and \(g\) are scaling function defined as
< / p >
< p >
\[
2023-03-02 11:13:03 +01:00
f_\alpha(r) = \frac{1-e^{-\kappa_\alpha\, r}}{\kappa_\alpha} \text{ and }
2023-03-30 12:35:59 +02:00
g_\alpha(r) = e^{-\kappa_\alpha\, r} = 1-\kappa_\alpha f_\alpha(r).
2022-09-28 18:04:21 +02:00
\]
< / p >
< p >
The terms \(J_{\text{ee}}^\infty\) and \(J_{\text{eN}}^\infty\) are shifts to ensure that
\(J_{\text{ee}}\) and \(J_{\text{eN}}\) have an asymptotic value of zero.
< / p >
2023-05-19 19:03:54 +02:00
< p >
The eN and eeN parameters are the same of all identical nuclei.
2023-09-12 16:43:06 +02:00
Warning: The types of nuclei use zero-based indexing.
2023-05-19 19:03:54 +02:00
< / p >
2022-09-28 18:04:21 +02:00
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org7ddda39" class = "outline-2" >
< h2 id = "org7ddda39" > < span class = "section-number-2" > 2< / span > Context< / h2 >
2022-09-28 18:04:21 +02:00
< div class = "outline-text-2" id = "text-2" >
< p >
The following data stored in the context:
< / p >
2024-02-23 11:17:59 +01:00
< table id = "org4ecade0" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > uninitialized< / code > < / td >
< td class = "org-left" > < code > int32_t< / code > < / td >
< td class = "org-left" > Keeps bits set for uninitialized data< / td >
< / tr >
< tr >
< td class = "org-left" > < code > rescale_factor_ee< / code > < / td >
< td class = "org-left" > < code > double< / code > < / td >
< td class = "org-left" > The distance scaling factor< / td >
< / tr >
< tr >
< td class = "org-left" > < code > rescale_factor_en< / code > < / td >
2022-11-17 19:27:17 +01:00
< td class = "org-left" > < code > double[type_nucl_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > The distance scaling factor< / td >
< / tr >
< tr >
< td class = "org-left" > < code > aord_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > The number of a coeffecients< / td >
< / tr >
< tr >
< td class = "org-left" > < code > bord_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > The number of b coeffecients< / td >
< / tr >
< tr >
< td class = "org-left" > < code > cord_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > The number of c coeffecients< / td >
< / tr >
< tr >
< td class = "org-left" > < code > type_nucl_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
2022-11-17 19:27:17 +01:00
< td class = "org-left" > Number of Nuclei types< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
< td class = "org-left" > < code > type_nucl_vector< / code > < / td >
< td class = "org-left" > < code > int64_t[nucl_num]< / code > < / td >
2023-08-23 14:34:17 +02:00
< td class = "org-left" > IDs of types of Nuclei. These use 0-based indexing as in C.< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > a_vector< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > double[aord_num + 1][type_nucl_num]< / code > < / td >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > a polynomial coefficients< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > b_vector< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > double[bord_num + 1]< / code > < / td >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > b polynomial coefficients< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > c_vector< / code > < / td >
2023-05-26 09:53:50 +02:00
< td class = "org-left" > < code > double[dim_c_vector][type_nucl_num]< / code > < / td >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > c polynomial coefficients< / td >
2022-09-28 18:04:21 +02:00
< / tr >
2023-09-26 17:45:07 +02:00
< tr >
< td class = "org-left" > < code > c_vector< / code > < / td >
< td class = "org-left" > < code > double[dim_c_vector][type_nucl_num]< / code > < / td >
< td class = "org-left" > c polynomial coefficients< / td >
< / tr >
< tr >
< td class = "org-left" > < code > spin_independent< / code > < / td >
2023-09-27 16:01:32 +02:00
< td class = "org-left" > < code > int32_t< / code > < / td >
< td class = "org-left" > If 1, use same parameters for parallel and anti-parallel spins. Otherwise, 0.< / td >
2023-09-26 17:45:07 +02:00
< / tr >
2022-09-28 18:04:21 +02:00
< / tbody >
< / table >
< p >
2023-03-31 15:12:07 +02:00
Computed data:
2022-09-28 18:04:21 +02:00
< / p >
< 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 >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< / tr >
< / thead >
< tbody >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > dim_c_vector< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > Number of unique C coefficients< / td >
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > dim_c_vector_date< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > uint64_t< / code > < / td >
< td class = "org-left" > Number of unique C coefficients< / td >
< / tr >
2022-11-17 19:27:17 +01:00
< tr >
< td class = "org-left" > < code > asymp_jasa< / code > < / td >
< td class = "org-left" > < code > double[type_nucl_num]< / code > < / td >
< td class = "org-left" > Asymptotic component< / td >
< / tr >
< tr >
< td class = "org-left" > < code > asymp_jasa_date< / code > < / td >
< td class = "org-left" > < code > uint64_t< / code > < / td >
< td class = "org-left" > Ladt modification of the asymptotic component< / td >
< / tr >
2022-09-28 18:04:21 +02:00
< tr >
< td class = "org-left" > < code > asymp_jasb< / code > < / td >
< td class = "org-left" > < code > double[2]< / code > < / td >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > Asymptotic component (up- or down-spin)< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
< td class = "org-left" > < code > asymp_jasb_date< / code > < / td >
< td class = "org-left" > < code > uint64_t< / code > < / td >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > Ladt modification of the asymptotic component< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > c_vector_full< / code > < / td >
< td class = "org-left" > < code > double[dim_c_vector][nucl_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > vector of non-zero coefficients< / td >
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > c_vector_full_date< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > uint64_t< / code > < / td >
< td class = "org-left" > Keep track of changes here< / td >
< / tr >
< tr >
< td class = "org-left" > < code > lkpm_combined_index< / code > < / td >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > int64_t[4][dim_c_vector]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > Transform l,k,p, and m into consecutive indices< / td >
< / tr >
< tr >
< td class = "org-left" > < code > lkpm_combined_index_date< / code > < / td >
< td class = "org-left" > < code > uint64_t< / code > < / td >
< td class = "org-left" > Transform l,k,p, and m into consecutive indices< / td >
< / tr >
< tr >
< td class = "org-left" > < code > tmp_c< / code > < / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > < code > double[walk_num][cord_num][cord_num+1][nucl_num][elec_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > vector of non-zero coefficients< / td >
< / tr >
< tr >
< td class = "org-left" > < code > dtmp_c< / code > < / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > < code > double[walk_num][elec_num][4][nucl_num][cord_num+1][cord_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > vector of non-zero coefficients< / td >
< / tr >
< tr >
< td class = "org-left" > < code > ee_distance_rescaled< / code > < / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > < code > double[walk_num][num][num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > Electron-electron rescaled distances< / td >
< / tr >
< tr >
< td class = "org-left" > < code > ee_distance_rescaled_date< / code > < / td >
< td class = "org-left" > < code > uint64_t< / code > < / td >
< td class = "org-left" > Last modification date of the electron-electron distances< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > ee_distance_rescaled_gl< / code > < / td >
2023-09-21 13:04:54 +02:00
< td class = "org-left" > < code > double[walk_num][num][num][4]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > Electron-electron rescaled distances derivatives< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > ee_distance_rescaled_gl_date< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > uint64_t< / code > < / td >
< td class = "org-left" > Last modification date of the electron-electron distance derivatives< / td >
< / tr >
< tr >
< td class = "org-left" > < code > en_distance_rescaled< / code > < / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > < code > double[walk_num][nucl_num][num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > Electron-nucleus distances< / td >
< / tr >
< tr >
< td class = "org-left" > < code > en_distance_rescaled_date< / code > < / td >
< td class = "org-left" > < code > uint64_t< / code > < / td >
< td class = "org-left" > Last modification date of the electron-electron distances< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > en_distance_rescaled_gl< / code > < / td >
2023-09-21 13:04:54 +02:00
< td class = "org-left" > < code > double[walk_num][nucl_num][num][4]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > Electron-electron rescaled distances derivatives< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > en_distance_rescaled_gl_date< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > uint64_t< / code > < / td >
< td class = "org-left" > Last modification date of the electron-electron distance derivatives< / td >
< / tr >
< tr >
< td class = "org-left" > < code > een_rescaled_n< / code > < / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > < code > double[walk_num][cord_num+1][nucl_num][elec_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > The electron-electron rescaled distances raised to the powers defined by cord< / td >
< / tr >
< tr >
< td class = "org-left" > < code > een_rescaled_n_date< / code > < / td >
< td class = "org-left" > < code > uint64_t< / code > < / td >
< td class = "org-left" > Keep track of the date of creation< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > een_rescaled_e_gl< / code > < / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > < code > double[walk_num][cord_num+1][elec_num][4][elec_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > The electron-electron rescaled distances raised to the powers defined by cord derivatives wrt electrons< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > een_rescaled_e_gl_date< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > uint64_t< / code > < / td >
< td class = "org-left" > Keep track of the date of creation< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > een_rescaled_n_gl< / code > < / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > < code > double[walk_num][cord_num+1][nucl_num][4][elec_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > The electron-electron rescaled distances raised to the powers defined by cord derivatives wrt electrons< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > een_rescaled_n_gl_date< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > uint64_t< / code > < / td >
< td class = "org-left" > Keep track of the date of creation< / td >
2023-03-31 15:12:07 +02:00
< / tr >
< tr >
< td class = "org-left" > < code > factor_ee< / code > < / td >
< td class = "org-left" > < code > double[walk_num]< / code > < / td >
< td class = "org-left" > Jastrow factor: electron-electron part< / td >
< / tr >
< tr >
< td class = "org-left" > < code > factor_ee_date< / code > < / td >
< td class = "org-left" > < code > uint64_t< / code > < / td >
< td class = "org-left" > Jastrow factor: electron-electron part< / td >
< / tr >
< tr >
< td class = "org-left" > < code > factor_en< / code > < / td >
< td class = "org-left" > < code > double[walk_num]< / code > < / td >
< td class = "org-left" > Jastrow factor: electron-nucleus part< / td >
< / tr >
< tr >
< td class = "org-left" > < code > factor_en_date< / code > < / td >
< td class = "org-left" > < code > uint64_t< / code > < / td >
< td class = "org-left" > Jastrow factor: electron-nucleus part< / td >
< / tr >
< tr >
< td class = "org-left" > < code > factor_een< / code > < / td >
< td class = "org-left" > < code > double[walk_num]< / code > < / td >
< td class = "org-left" > Jastrow factor: electron-electron-nucleus part< / td >
< / tr >
< tr >
< td class = "org-left" > < code > factor_een_date< / code > < / td >
< td class = "org-left" > < code > uint64_t< / code > < / td >
< td class = "org-left" > Jastrow factor: electron-electron-nucleus part< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > factor_ee_gl< / code > < / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > < code > double[walk_num][4][elec_num]< / code > < / td >
< td class = "org-left" > Derivative of the Jastrow factor: electron-electron-nucleus part< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > factor_ee_gl_date< / code > < / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > < code > uint64_t< / code > < / td >
< td class = "org-left" > Keep track of the date for the derivative< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > factor_en_gl< / code > < / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > < code > double[walk_num][4][elec_num]< / code > < / td >
< td class = "org-left" > Derivative of the Jastrow factor: electron-electron-nucleus part< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > factor_en_gl_date< / code > < / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > < code > uint64_t< / code > < / td >
< td class = "org-left" > Keep track of the date for the en derivative< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > factor_een_gl< / code > < / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > < code > double[walk_num][4][elec_num]< / code > < / td >
< td class = "org-left" > Derivative of the Jastrow factor: electron-electron-nucleus part< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > factor_een_gl_date< / code > < / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > < code > uint64_t< / code > < / td >
< td class = "org-left" > Keep track of the date for the een derivative< / td >
< / tr >
< tr >
< td class = "org-left" > < code > value< / code > < / td >
< td class = "org-left" > < code > double[walk_num]< / code > < / td >
< td class = "org-left" > Value of the Jastrow factor< / td >
< / tr >
< tr >
< td class = "org-left" > < code > value_date< / code > < / td >
< td class = "org-left" > < code > uint64_t< / code > < / td >
< td class = "org-left" > Keep track of the date< / td >
< / tr >
< tr >
< td class = "org-left" > < code > gl< / code > < / td >
< td class = "org-left" > < code > double[walk_num][4][elec_num]< / code > < / td >
< td class = "org-left" > Gradient and Laplacian of the Jastrow factor< / td >
< / tr >
< tr >
< td class = "org-left" > < code > value_date< / code > < / td >
< td class = "org-left" > < code > uint64_t< / code > < / td >
< td class = "org-left" > Keep track of the date< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< / tbody >
< / table >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org6cd022b" class = "outline-3" >
< h3 id = "org6cd022b" > < span class = "section-number-3" > 2.1< / span > Data structure< / h3 >
2022-09-28 18:04:21 +02:00
< div class = "outline-text-3" id = "text-2-1" >
< div class = "org-src-container" >
2023-03-30 17:09:05 +02:00
< pre class = "src src-c" > < span style = "color: #a020f0;" > typedef< / span > < span style = "color: #a020f0;" > struct< / span > < span style = "color: #228b22;" > qmckl_jastrow_champ_struct< / span > {
< span style = "color: #228b22;" > int64_t< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > lkpm_combined_index< / span > ;
< span style = "color: #228b22;" > int64_t< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > type_nucl_vector< / span > ;
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > asymp_jasa< / span > ;
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > asymp_jasb< / span > [2];
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > a_vector< / span > ;
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > b_vector< / span > ;
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > c_vector< / span > ;
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > c_vector_full< / span > ;
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > dtmp_c< / span > ;
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > ee_distance_rescaled< / span > ;
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > ee_distance_rescaled_gl< / span > ;
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > een_rescaled_e< / span > ;
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > een_rescaled_e_gl< / span > ;
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > een_rescaled_n< / span > ;
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > een_rescaled_n_gl< / span > ;
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > en_distance_rescaled< / span > ;
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > en_distance_rescaled_gl< / span > ;
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > factor_ee< / span > ;
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > factor_ee_gl< / span > ;
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > factor_een< / span > ;
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > factor_een_gl< / span > ;
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > factor_en< / span > ;
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > factor_en_gl< / span > ;
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > rescale_factor_en< / span > ;
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > tmp_c< / span > ;
2023-03-31 15:12:07 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > value< / span > ;
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > gl< / span > ;
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > aord_num< / span > ;
< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > bord_num< / span > ;
< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > cord_num< / span > ;
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > dim_c_vector< / span > ;
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > type_nucl_num< / span > ;
2022-11-17 19:27:17 +01:00
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > asymp_jasa_date< / span > ;
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > asymp_jasb_date< / span > ;
2022-11-16 18:00:51 +01:00
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > c_vector_full_date< / span > ;
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > dim_c_vector_date< / span > ;
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > dtmp_c_date< / span > ;
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > ee_distance_rescaled_date< / span > ;
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > ee_distance_rescaled_gl_date< / span > ;
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > een_rescaled_e_date< / span > ;
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > een_rescaled_e_gl_date< / span > ;
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > een_rescaled_n_date< / span > ;
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > een_rescaled_n_gl_date< / span > ;
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > en_distance_rescaled_date< / span > ;
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > en_distance_rescaled_gl_date< / span > ;
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > factor_ee_date< / span > ;
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > factor_ee_gl_date< / span > ;
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > factor_een_date< / span > ;
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > factor_een_gl_date< / span > ;
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > factor_en_date< / span > ;
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > factor_en_gl_date< / span > ;
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > lkpm_combined_index_date< / span > ;
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > tmp_c_date< / span > ;
2023-03-31 15:12:07 +02:00
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > value_date< / span > ;
< span style = "color: #228b22;" > uint64_t< / span > < span style = "color: #a0522d;" > gl_date< / span > ;
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > rescale_factor_ee< / span > ;
< span style = "color: #228b22;" > int32_t< / span > < span style = "color: #a0522d;" > uninitialized< / span > ;
2023-09-27 16:01:32 +02:00
< span style = "color: #228b22;" > int32_t< / span > < span style = "color: #a0522d;" > spin_independent< / span > ;
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > bool< / span > < span style = "color: #a0522d;" > provided< / span > ;
2023-03-30 17:09:05 +02:00
} < span style = "color: #228b22;" > qmckl_jastrow_champ_struct< / span > ;
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< p >
The < code > uninitialized< / code > integer contains one bit set to one for each
initialization function which has not been called. It becomes equal
to zero after all initialization functions have been called. The
struct is then initialized and < code > provided == true< / code > .
Some values are initialized by default, and are not concerned by
this mechanism.
< / p >
< div class = "org-src-container" >
2023-03-30 17:09:05 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_init_jastrow_champ< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > );
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< div class = "org-src-container" >
2023-03-30 17:09:05 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_init_jastrow_champ< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > ) {
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > if< / span > (qmckl_context_check(context) == QMCKL_NULL_CONTEXT) {
< span style = "color: #a020f0;" > return< / span > < span style = "color: #008b8b;" > false< / span > ;
}
< span style = "color: #228b22;" > qmckl_context_struct< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > ctx< / span > = (< span style = "color: #228b22;" > qmckl_context_struct< / span > *) context;
assert (ctx != < span style = "color: #008b8b;" > NULL< / span > );
2023-09-26 17:45:07 +02:00
ctx-> jastrow_champ.uninitialized = (1 < < 11) - 1;
2022-09-28 18:04:21 +02:00
2022-11-18 14:16:53 +01:00
/* < span style = "color: #b22222;" > Default values< / span > */
2023-03-30 17:09:05 +02:00
ctx-> jastrow_champ.aord_num = -1;
ctx-> jastrow_champ.bord_num = -1;
ctx-> jastrow_champ.cord_num = -1;
2023-09-26 17:45:07 +02:00
ctx-> jastrow_champ.dim_c_vector = -1;
2023-03-30 17:09:05 +02:00
ctx-> jastrow_champ.type_nucl_num = -1;
2023-09-27 16:01:32 +02:00
ctx-> jastrow_champ.spin_independent = -1;
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > return< / span > QMCKL_SUCCESS;
}
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org7db09fe" class = "outline-3" >
< h3 id = "org7db09fe" > < span class = "section-number-3" > 2.2< / span > Initialization functions< / h3 >
2022-09-28 18:04:21 +02:00
< div class = "outline-text-3" id = "text-2-2" >
< p >
To prepare for the Jastrow and its derivative, all the following functions need to be
called.
< / p >
< div class = "org-src-container" >
2023-03-30 17:09:05 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_rescale_factor_ee< / 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;" > kappa_ee< / span > );
< span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_rescale_factor_en< / 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;" > kappa_en< / span > , < span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > size_max< / span > );
< span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_aord_num< / 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;" > aord_num< / span > );
< span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_bord_num< / 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;" > bord_num< / span > );
< span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_cord_num< / 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;" > cord_num< / span > );
< span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_type_nucl_num< / 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;" > type_nucl_num< / span > );
2023-09-13 16:23:56 +02:00
< span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_type_nucl_vector< / 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;" > type_nucl_vector< / span > , < span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > size_max< / span > );
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_a_vector< / 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;" > a_vector< / span > , < span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > size_max< / span > );
< span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_b_vector< / 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;" > b_vector< / span > , < span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > size_max< / span > );
< span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_c_vector< / 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;" > c_vector< / span > , < span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > size_max< / span > );
2023-09-27 16:01:32 +02:00
< span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_spin_independent< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > , < span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int32_t< / span > < span style = "color: #a0522d;" > spin_independent< / span > );
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< p >
When the required information is completely entered, other data structures are
computed to accelerate the calculations. The intermediates factors
2023-03-02 11:13:03 +01:00
are precontracted using BLAS LEVEL 3 operations.
2022-09-28 18:04:21 +02:00
< / p >
< / div >
2022-11-14 14:59:00 +01:00
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgfb1248b" class = "outline-5" >
< h5 id = "orgfb1248b" > < span class = "section-number-5" > 2.2.0.1< / span > Fortran interface< / h5 >
2022-11-14 14:59:00 +01:00
< div class = "outline-text-5" id = "text-2-2-0-1" >
< div class = "org-src-container" >
< pre class = "src src-f90" > < span style = "color: #a020f0;" > interface< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_set_jastrow_champ_rescale_factor_ee (context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-14 15:04:04 +01:00
kappa_ee) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < span style = "color: #a020f0;" > intent< / span > (in) , < span style = "color: #a020f0;" > value< / span > ::< span style = "color: #a0522d;" > context< / span >
2023-09-11 17:07:34 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ), < span style = "color: #a020f0;" > intent< / span > (in), < span style = "color: #a020f0;" > value< / span > ::< span style = "color: #a0522d;" > kappa_ee< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_rescale_factor_ee< / span >
2022-11-14 15:04:04 +01:00
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_set_jastrow_champ_rescale_factor_en (context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-14 15:04:04 +01:00
kappa_en, size_max) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < span style = "color: #a020f0;" > intent< / span > (in) , < span style = "color: #a020f0;" > value< / span > ::< span style = "color: #a0522d;" > context< / span >
2022-11-16 18:00:51 +01:00
< 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_max< / span >
2023-09-11 17:07:34 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ), < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > kappa_en(size_max)< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_rescale_factor_en< / span >
2022-11-14 15:04:04 +01:00
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_set_jastrow_champ_aord_num (context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-14 15:04:04 +01:00
aord_num) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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;" > aord_num< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_aord_num< / span >
2022-11-14 15:04:04 +01:00
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_set_jastrow_champ_bord_num (context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-14 15:09:26 +01:00
bord_num) < span style = "color: #a020f0;" > bind< / span > (C)
2022-11-14 15:04:04 +01:00
< span style = "color: #a020f0;" > use< / span > , < span style = "color: #a020f0;" > intrinsic< / span > :: < span style = "color: #0000ff;" > iso_c_binding< / span >
< span style = "color: #a020f0;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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;" > bord_num< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_bord_num< / span >
2022-11-14 15:04:04 +01:00
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_set_jastrow_champ_cord_num (context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-14 15:09:26 +01:00
cord_num) < span style = "color: #a020f0;" > bind< / span > (C)
2022-11-14 15:04:04 +01:00
< span style = "color: #a020f0;" > use< / span > , < span style = "color: #a020f0;" > intrinsic< / span > :: < span style = "color: #0000ff;" > iso_c_binding< / span >
< span style = "color: #a020f0;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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;" > cord_num< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_cord_num< / span >
2022-11-14 15:04:04 +01:00
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_set_jastrow_champ_type_nucl_num (context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-14 15:04:04 +01:00
type_nucl_num) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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;" > type_nucl_num< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_type_nucl_num< / span >
2022-11-14 15:04:04 +01:00
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_set_jastrow_champ_type_nucl_vector (context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-14 15:04:04 +01:00
type_nucl_vector, size_max) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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_max< / span >
2022-11-14 15:09:26 +01:00
< 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;" > type_nucl_vector(size_max)< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_type_nucl_vector< / span >
2022-11-14 15:04:04 +01:00
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_set_jastrow_champ_a_vector(context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
a_vector, size_max) < span style = "color: #a020f0;" > bind< / span > (C)
2022-11-14 15:04:04 +01:00
< span style = "color: #a020f0;" > use< / span > , < span style = "color: #a020f0;" > intrinsic< / span > :: < span style = "color: #0000ff;" > iso_c_binding< / span >
< span style = "color: #a020f0;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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_max< / span >
2023-09-11 17:07:34 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ), < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > a_vector(size_max)< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_a_vector< / span >
2022-11-14 15:04:04 +01:00
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_set_jastrow_champ_b_vector(context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
b_vector, size_max) < span style = "color: #a020f0;" > bind< / span > (C)
2022-11-14 15:04:04 +01:00
< span style = "color: #a020f0;" > use< / span > , < span style = "color: #a020f0;" > intrinsic< / span > :: < span style = "color: #0000ff;" > iso_c_binding< / span >
< span style = "color: #a020f0;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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_max< / span >
2023-09-11 17:07:34 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ), < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > b_vector(size_max)< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_b_vector< / span >
2022-11-14 15:04:04 +01:00
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_set_jastrow_champ_c_vector(context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
c_vector, size_max) < span style = "color: #a020f0;" > bind< / span > (C)
2022-11-14 15:04:04 +01:00
< span style = "color: #a020f0;" > use< / span > , < span style = "color: #a020f0;" > intrinsic< / span > :: < span style = "color: #0000ff;" > iso_c_binding< / span >
< span style = "color: #a020f0;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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_max< / span >
2023-09-11 17:07:34 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ), < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > c_vector(size_max)< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_c_vector< / span >
2022-11-14 14:59:00 +01:00
2023-09-26 17:45:07 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_set_jastrow_champ_spin_independent(context, < / span > < span style = "color: #a020f0;" > & < / span >
spin_independent) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
2023-09-27 16:01:32 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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;" > spin_independent< / span >
2023-09-26 17:45:07 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_set_jastrow_champ_spin_independent< / span >
2022-11-14 14:59:00 +01:00
< span style = "color: #a020f0;" > end interface< / span >
< / pre >
< / div >
< / div >
< / div >
2022-09-28 18:04:21 +02:00
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org1e5b0dd" class = "outline-3" >
< h3 id = "org1e5b0dd" > < span class = "section-number-3" > 2.3< / span > Access functions< / h3 >
2022-09-28 18:04:21 +02:00
< div class = "outline-text-3" id = "text-2-3" >
< p >
Along with these core functions, calculation of the jastrow factor
requires the following additional information to be set:
< / p >
< p >
When all the data for the AOs have been provided, the following
function returns < code > true< / code > .
< / p >
< div class = "org-src-container" >
2023-03-30 17:09:05 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > bool< / span > < span style = "color: #0000ff;" > qmckl_jastrow_champ_provided< / span > (< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > );
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
2022-11-16 18:00:51 +01:00
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org2b6f457" class = "outline-5" >
< h5 id = "org2b6f457" > < span class = "section-number-5" > 2.3.0.1< / span > Fortran interface< / h5 >
2022-11-16 18:00:51 +01:00
< div class = "outline-text-5" id = "text-2-3-0-1" >
< div class = "org-src-container" >
< pre class = "src src-f90" > < span style = "color: #a020f0;" > interface< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_rescale_factor_ee (context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
kappa_ee) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < span style = "color: #a020f0;" > intent< / span > (in) , < span style = "color: #a020f0;" > value< / span > ::< span style = "color: #a0522d;" > context< / span >
2023-09-11 17:07:34 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ), < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > kappa_ee< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_rescale_factor_ee< / span >
2022-11-16 18:00:51 +01:00
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_rescale_factor_en (context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
kappa_en, size_max) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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_max< / span >
2023-09-11 17:07:34 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ), < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > kappa_en(size_max)< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_rescale_factor_en< / span >
2022-11-16 18:00:51 +01:00
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_aord_num (context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
aord_num) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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 > (out) ::< span style = "color: #a0522d;" > aord_num< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_aord_num< / span >
2022-11-16 18:00:51 +01:00
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_bord_num (context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
bord_num) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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 > (out) ::< span style = "color: #a0522d;" > bord_num< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_bord_num< / span >
2022-11-16 18:00:51 +01:00
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_cord_num (context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
cord_num) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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 > (out) ::< span style = "color: #a0522d;" > cord_num< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_cord_num< / span >
2022-11-16 18:00:51 +01:00
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_type_nucl_num (context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
type_nucl_num) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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 > (out) ::< span style = "color: #a0522d;" > type_nucl_num< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_type_nucl_num< / span >
2022-11-16 18:00:51 +01:00
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_type_nucl_vector (context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
type_nucl_vector, size_max) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < 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_max< / span >
< span style = "color: #228b22;" > integer< / span > (< span style = "color: #008b8b;" > c_int64_t< / span > ), < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > type_nucl_vector(size_max)< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_type_nucl_vector< / span >
2022-11-16 18:00:51 +01:00
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_a_vector(context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
a_vector, size_max) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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_max< / span >
2023-09-11 17:07:34 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ), < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > a_vector(size_max)< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_a_vector< / span >
2022-11-16 18:00:51 +01:00
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_b_vector(context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
b_vector, size_max) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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_max< / span >
2023-09-11 17:07:34 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ), < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > b_vector(size_max)< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_b_vector< / span >
2022-11-16 18:00:51 +01:00
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_c_vector(context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
c_vector, size_max) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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_max< / span >
2023-09-11 17:07:34 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ), < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > c_vector(size_max)< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_c_vector< / span >
2022-11-16 18:00:51 +01:00
2023-09-26 17:45:07 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_spin_independent(context, < / span > < span style = "color: #a020f0;" > & < / span >
spin_independent) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
2023-09-27 16:01:32 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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 > (out) ::< span style = "color: #a0522d;" > spin_independent< / span >
2023-09-26 17:45:07 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_spin_independent< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > end interface< / span >
< / pre >
< / div >
< / div >
< / div >
2022-09-28 18:04:21 +02:00
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org0382e49" class = "outline-3" >
< h3 id = "org0382e49" > < span class = "section-number-3" > 2.4< / span > Test< / h3 >
2022-09-28 18:04:21 +02:00
< div class = "outline-text-3" id = "text-2-4" >
< div class = "org-src-container" >
2022-11-18 14:16:53 +01:00
< pre class = "src src-c" > /* < span style = "color: #b22222;" > Reference input data< / span > */
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > walk_num< / span > = n2_walk_num;
< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > = n2_elec_num;
< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_up_num< / span > = n2_elec_up_num;
< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_dn_num< / span > = n2_elec_dn_num;
< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > nucl_num< / span > = n2_nucl_num;
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > rescale_factor_ee< / span > = 0.6;
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > rescale_factor_en< / span > [2] = { 0.6, 0.6 };
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > elec_coord< / span > = & (n2_elec_coord[0][0][0]);
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > nucl_charge< / span > = n2_charge;
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > nucl_coord< / span > = & (n2_nucl_coord[0][0]);
< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > size_max< / span > ;
2022-11-18 14:16:53 +01:00
/* < span style = "color: #b22222;" > Provide Electron data< / span > */
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #a0522d;" > rc< / span > ;
assert(!qmckl_electron_provided(context));
rc = qmckl_check(context,
qmckl_set_electron_num (context, elec_up_num, elec_dn_num)
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
< span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_electron_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
rc = qmckl_check(context,
qmckl_set_electron_coord (context, < span style = "color: #8b2252;" > 'N'< / span > , walk_num, elec_coord, walk_num*3*elec_num)
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > elec_coord2< / span > [walk_num*3*elec_num];
rc = qmckl_check(context,
qmckl_get_electron_coord (context, < span style = "color: #8b2252;" > 'N'< / span > , elec_coord2, walk_num*3*elec_num)
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > i< / span > =0 ; i< 3*elec_num ; ++i) {
assert( elec_coord[i] == elec_coord2[i] );
}
2022-11-18 14:16:53 +01:00
/* < span style = "color: #b22222;" > Provide Nucleus data< / span > */
2022-09-28 18:04:21 +02:00
assert(!qmckl_nucleus_provided(context));
rc = qmckl_check(context,
qmckl_set_nucleus_num (context, nucl_num)
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
assert(!qmckl_nucleus_provided(context));
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > nucl_coord2< / span > [3*nucl_num];
rc = qmckl_get_nucleus_coord (context, < span style = "color: #8b2252;" > 'T'< / span > , nucl_coord2, 3*nucl_num);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_NOT_PROVIDED);
rc = qmckl_check(context,
qmckl_set_nucleus_coord (context, < span style = "color: #8b2252;" > 'T'< / span > , & (nucl_coord[0]), 3*nucl_num)
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
assert(!qmckl_nucleus_provided(context));
rc = qmckl_check(context,
qmckl_get_nucleus_coord (context, < span style = "color: #8b2252;" > 'N'< / span > , nucl_coord2, nucl_num*3)
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > k< / span > =0 ; k< 3 ; ++k) {
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > i< / span > =0 ; i< nucl_num ; ++i) {
assert( nucl_coord[nucl_num*k+i] == nucl_coord2[3*i+k] );
}
}
rc = qmckl_check(context,
qmckl_get_nucleus_coord (context, < span style = "color: #8b2252;" > 'T'< / span > , nucl_coord2, nucl_num*3)
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > i< / span > =0 ; i< 3*nucl_num ; ++i) {
assert( nucl_coord[i] == nucl_coord2[i] );
}
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > nucl_charge2< / span > [nucl_num];
rc = qmckl_get_nucleus_charge(context, nucl_charge2, nucl_num);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_NOT_PROVIDED);
rc = qmckl_check(context,
qmckl_set_nucleus_charge(context, nucl_charge, nucl_num)
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
rc = qmckl_check(context,
qmckl_get_nucleus_charge(context, nucl_charge2, nucl_num)
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > i< / span > =0 ; i< nucl_num ; ++i) {
assert( nucl_charge[i] == nucl_charge2[i] );
}
< span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_nucleus_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
< / pre >
< / div >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org7f98ff4" class = "outline-2" >
< h2 id = "org7f98ff4" > < span class = "section-number-2" > 3< / span > Computation< / h2 >
2022-09-28 18:04:21 +02:00
< div class = "outline-text-2" id = "text-3" >
< p >
The computed data is stored in the context so that it can be reused
by different kernels. To ensure that the data is valid, for each
computed data the date of the context is stored when it is computed.
To know if some data needs to be recomputed, we check if the date of
the dependencies are more recent than the date of the data to
compute. If it is the case, then the data is recomputed and the
current date is stored.
< / p >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org17e5188" class = "outline-3" >
< h3 id = "org17e5188" > < span class = "section-number-3" > 3.1< / span > Electron-electron component< / h3 >
2022-09-28 18:04:21 +02:00
< div class = "outline-text-3" id = "text-3-1" >
2023-03-30 12:35:59 +02:00
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org5cdcc5f" class = "outline-4" >
< h4 id = "org5cdcc5f" > < span class = "section-number-4" > 3.1.1< / span > Asymptotic component< / h4 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-4" id = "text-3-1-1" >
2022-09-28 18:04:21 +02:00
< p >
2023-09-26 17:45:07 +02:00
Calculate the asymptotic component < code > asymp_jasb< / code > to be subtracted from the
2023-03-02 11:13:03 +01:00
electron-electron jastrow factor \(J_{\text{ee}}\). Two values are
2023-05-25 01:14:47 +02:00
computed. The first one is for parallel spin pairs, and the
second one for antiparallel spin pairs.
2023-09-27 16:01:32 +02:00
If the < code > spin_independent< / code > variable is set to < code > 1< / code > , then
2023-09-26 17:45:07 +02:00
\(\delta^{\uparrow \downarrow}\) is always equal to one.
2022-09-28 18:04:21 +02:00
< / p >
< p >
\[
2023-03-30 12:35:59 +02:00
J_{\text{ee}}^{\infty} = \frac{\frac{1}{2}(1+\delta^{\uparrow \downarrow})\,b_1 \kappa_\text{ee}^{-1}}{1 + b_2\,
\kappa_\text{ee}^{-1}} + \sum_{p=2}^{N_\text{ord}^b} b_{p+1}\, \kappa_\text{ee}^{-p}
\]
2022-09-28 18:04:21 +02:00
< / p >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgddd3b6b" class = "outline-5" >
< h5 id = "orgddd3b6b" > < span class = "section-number-5" > 3.1.1.1< / span > Get< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-1-1-1" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #0000ff;" > qmckl_get_jastrow_champ_asymp_jasb< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > ,
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > asymp_jasb< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > size_max< / span > );
< / pre >
< / div >
< / div >
2022-11-17 19:27:17 +01:00
2023-03-30 12:35:59 +02:00
< ol class = "org-ol" >
2024-02-23 11:17:59 +01:00
< li > < a id = "org2bfd0b9" > < / a > Fortran interface< br / >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-6" id = "text-3-1-1-1-1" >
2022-11-17 19:27:17 +01:00
< div class = "org-src-container" >
< pre class = "src src-f90" > < span style = "color: #a020f0;" > interface< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_asymp_jasb(context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-17 19:27:17 +01:00
asymp_jasb, size_max) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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_max< / span >
2023-09-11 17:07:34 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ), < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > asymp_jasb(size_max)< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_asymp_jasb< / span >
2022-11-17 19:27:17 +01:00
< span style = "color: #a020f0;" > end interface< / span >
< / pre >
< / div >
< / div >
2023-03-30 12:35:59 +02:00
< / li >
< / ol >
2022-09-28 18:04:21 +02:00
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org956b264" class = "outline-5" >
< h5 id = "org956b264" > < span class = "section-number-5" > 3.1.1.2< / span > Compute< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-1-1-2" >
2024-02-23 11:17:59 +01:00
< table id = "org12863b1" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
< td class = "org-left" > < code > bord_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Order of the polynomial< / td >
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > b_vector< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > double[bord_num+1]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Values of b< / td >
< / tr >
< tr >
< td class = "org-left" > < code > rescale_factor_ee< / code > < / td >
< td class = "org-left" > < code > double< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron coordinates< / td >
< / tr >
2023-09-26 17:45:07 +02:00
< tr >
< td class = "org-left" > < code > spin_independent< / code > < / td >
2023-09-27 16:01:32 +02:00
< td class = "org-left" > < code > int32_t< / code > < / td >
2023-09-26 17:45:07 +02:00
< td class = "org-left" > in< / td >
2023-09-27 16:01:32 +02:00
< td class = "org-left" > If 1, same parameters for parallel and anti-parallel pairs< / td >
2023-09-26 17:45:07 +02:00
< / tr >
2022-09-28 18:04:21 +02:00
< tr >
< td class = "org-left" > < code > asymp_jasb< / code > < / td >
< td class = "org-left" > < code > double[2]< / code > < / td >
< td class = "org-left" > out< / td >
< td class = "org-left" > Asymptotic value< / td >
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
2023-09-21 13:04:54 +02:00
< pre class = "src src-f90" > < span style = "color: #a020f0;" > function< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_asymp_jasb_doc< / span > (context, < span style = "color: #a020f0;" > & < / span >
2023-09-26 17:45:07 +02:00
bord_num, b_vector, rescale_factor_ee, spin_independent, asymp_jasb) < span style = "color: #a020f0;" > & < / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > bind< / span > (C) < span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > , < span style = "color: #a020f0;" > intrinsic< / span > :: < span style = "color: #0000ff;" > iso_c_binding< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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;" > bord_num< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > b_vector(bord_num+1)< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) , < span style = "color: #a020f0;" > value< / span > ::< span style = "color: #a0522d;" > rescale_factor_ee< / span >
2023-09-27 16:01:32 +02:00
< 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;" > spin_independent< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > asymp_jasb(2)< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code) ::< span style = "color: #a0522d;" > info< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, p< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > kappa_inv, x, asym_one< / span >
kappa_inv = 1.0d0 / rescale_factor_ee
info = QMCKL_SUCCESS
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > if< / span > (bord_num < 0) < span style = "color: #a020f0;" > then< / span >
2022-09-28 18:04:21 +02:00
info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2022-11-16 18:00:51 +01:00
asym_one = b_vector(1) * kappa_inv / (1.0d0 + b_vector(2) * kappa_inv)
2023-09-27 16:01:32 +02:00
< span style = "color: #a020f0;" > if< / span > (spin_independent == 1) < span style = "color: #a020f0;" > then< / span >
2023-09-26 17:45:07 +02:00
asymp_jasb(:) = (/asym_one, asym_one/)
< span style = "color: #a020f0;" > else< / span >
asymp_jasb(:) = (/0.5d0*asym_one, asym_one/)
< span style = "color: #a020f0;" > end if< / span >
2022-09-28 18:04:21 +02:00
2023-05-25 01:14:47 +02:00
x = kappa_inv
< span style = "color: #a020f0;" > do< / span > p = 2, bord_num
2023-09-26 17:45:07 +02:00
x = x * kappa_inv
< span style = "color: #a020f0;" > do< / span > i = 1, 2
asymp_jasb(i) = asymp_jasb(i) + b_vector(p + 1) * x
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
2022-09-28 18:04:21 +02:00
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_asymp_jasb_doc< / span >
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< div class = "org-src-container" >
2023-03-02 11:13:03 +01:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_asymp_jasb_hpc< / span > (< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > ,
2023-09-26 17:45:07 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > bord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > b_vector< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > rescale_factor_ee< / span > ,
2023-09-27 16:01:32 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int32_t< / span > < span style = "color: #a0522d;" > spin_independent< / span > ,
2023-09-26 17:45:07 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > asymp_jasb< / span > )
2023-03-02 11:13:03 +01:00
{
2022-09-28 18:04:21 +02:00
2023-03-02 11:13:03 +01:00
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) {
< span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_CONTEXT;
}
2022-09-28 18:04:21 +02:00
2023-03-02 11:13:03 +01:00
< span style = "color: #a020f0;" > if< / span > (bord_num < 0) {
< span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_2;
}
2022-09-28 18:04:21 +02:00
2023-03-02 11:13:03 +01:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > kappa_inv< / span > = 1.0 / rescale_factor_ee;
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > asym_one< / span > = b_vector[0] * kappa_inv / (1.0 + b_vector[1] * kappa_inv);
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > f< / span > = 0.;
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > x< / span > = kappa_inv;
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > k< / span > = 2; k < = bord_num; ++k) {
x *= kappa_inv;
2024-01-30 11:32:49 +01:00
f = f + b_vector[k]*x;
2023-03-02 11:13:03 +01:00
}
2022-09-28 18:04:21 +02:00
2023-09-27 16:01:32 +02:00
asymp_jasb[0] = spin_independent == 1 ? asym_one + f : 0.5 * asym_one + f;
2023-05-25 01:14:47 +02:00
asymp_jasb[1] = asym_one + f;
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > return< / span > QMCKL_SUCCESS;
}
< / pre >
< / div >
2023-03-02 11:13:03 +01:00
< div class = "org-src-container" >
2023-09-26 17:45:07 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_asymp_jasb< / 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;" > bord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > b_vector< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > rescale_factor_ee< / span > ,
2023-09-27 16:01:32 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int32_t< / span > < span style = "color: #a0522d;" > spin_independent< / span > ,
2023-09-26 17:45:07 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > asymp_jasb< / span > )
2023-03-02 11:13:03 +01:00
{
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_HPC
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_jastrow_champ_asymp_jasb_hpc
2023-03-02 11:13:03 +01:00
< span style = "color: #483d8b;" > #else< / span >
2023-09-26 17:45:07 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_jastrow_champ_asymp_jasb_doc
2023-03-02 11:13:03 +01:00
< span style = "color: #483d8b;" > #endif< / span >
2023-09-26 17:45:07 +02:00
(context, bord_num, b_vector, rescale_factor_ee, spin_independent, asymp_jasb);
2023-03-02 11:13:03 +01:00
}
< / pre >
2022-09-28 18:04:21 +02:00
< / div >
< / div >
2023-03-02 11:13:03 +01:00
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org2a94445" class = "outline-5" >
< h5 id = "org2a94445" > < span class = "section-number-5" > 3.1.1.3< / span > Test< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-1-1-3" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_electron_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > type_nucl_num< / span > = n2_type_nucl_num;
< span style = "color: #228b22;" > int64_t< / span > * < span style = "color: #a0522d;" > type_nucl_vector< / span > = & (n2_type_nucl_vector[0]);
< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > aord_num< / span > = n2_aord_num;
< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > bord_num< / span > = n2_bord_num;
< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > cord_num< / span > = n2_cord_num;
2022-11-16 18:00:51 +01:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > a_vector< / span > = & (n2_a_vector[0][0]);
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > b_vector< / span > = & (n2_b_vector[0]);
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > c_vector< / span > = & (n2_c_vector[0][0]);
< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > dim_c_vector< / span > =0;
2022-09-28 18:04:21 +02:00
2023-03-30 17:09:05 +02:00
assert(!qmckl_jastrow_champ_provided(context));
2022-09-28 18:04:21 +02:00
2022-11-18 14:16:53 +01:00
/* < span style = "color: #b22222;" > Set the data< / span > */
2023-09-26 17:45:07 +02:00
rc = qmckl_check(context,
2023-09-27 16:01:32 +02:00
qmckl_set_jastrow_champ_spin_independent(context, 0)
2023-09-26 17:45:07 +02:00
);
2022-09-28 18:04:21 +02:00
rc = qmckl_check(context,
2023-03-30 17:09:05 +02:00
qmckl_set_jastrow_champ_aord_num(context, aord_num)
2022-11-14 14:59:00 +01:00
);
rc = qmckl_check(context,
2023-03-30 17:09:05 +02:00
qmckl_set_jastrow_champ_bord_num(context, bord_num)
2022-11-14 14:59:00 +01:00
);
rc = qmckl_check(context,
2023-03-30 17:09:05 +02:00
qmckl_set_jastrow_champ_cord_num(context, cord_num)
2022-09-28 18:04:21 +02:00
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
rc = qmckl_check(context,
2023-03-30 17:09:05 +02:00
qmckl_set_jastrow_champ_type_nucl_num(context, type_nucl_num)
2022-09-28 18:04:21 +02:00
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
rc = qmckl_check(context,
2023-03-30 17:09:05 +02:00
qmckl_set_jastrow_champ_type_nucl_vector(context, type_nucl_vector, nucl_num)
2022-09-28 18:04:21 +02:00
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
rc = qmckl_check(context,
2023-03-30 17:09:05 +02:00
qmckl_set_jastrow_champ_a_vector(context, a_vector,(aord_num+1)*type_nucl_num)
2022-09-28 18:04:21 +02:00
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
rc = qmckl_check(context,
2023-03-30 17:09:05 +02:00
qmckl_set_jastrow_champ_b_vector(context, b_vector,(bord_num+1))
2022-09-28 18:04:21 +02:00
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
rc = qmckl_check(context,
2023-03-30 17:09:05 +02:00
qmckl_get_jastrow_champ_dim_c_vector(context, & dim_c_vector)
2022-09-28 18:04:21 +02:00
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
rc = qmckl_check(context,
2023-09-12 16:43:06 +02:00
qmckl_set_jastrow_champ_c_vector(context, c_vector, dim_c_vector*type_nucl_num)
2022-09-28 18:04:21 +02:00
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > k_ee< / span > = 0.;
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > k_en< / span > [2] = { 0., 0. };
rc = qmckl_check(context,
2023-03-30 17:09:05 +02:00
qmckl_set_jastrow_champ_rescale_factor_en(context, rescale_factor_en, type_nucl_num)
2022-09-28 18:04:21 +02:00
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
rc = qmckl_check(context,
2023-03-30 17:09:05 +02:00
qmckl_set_jastrow_champ_rescale_factor_ee(context, rescale_factor_ee)
2022-09-28 18:04:21 +02:00
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
rc = qmckl_check(context,
2023-03-30 17:09:05 +02:00
qmckl_get_jastrow_champ_rescale_factor_ee (context, & k_ee)
2022-09-28 18:04:21 +02:00
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
< span style = "color: #0000ff;" > assert< / span > (k_ee == rescale_factor_ee);
rc = qmckl_check(context,
2023-03-30 17:09:05 +02:00
qmckl_get_jastrow_champ_rescale_factor_en (context, & (k_en[0]), type_nucl_num)
2022-09-28 18:04:21 +02:00
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
2022-11-17 19:27:17 +01:00
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > i< / span > =0 ; i< type_nucl_num ; ++i) {
2022-09-28 18:04:21 +02:00
assert(k_en[i] == rescale_factor_en[i]);
}
2022-11-18 14:16:53 +01:00
/* < span style = "color: #b22222;" > Check if Jastrow is properly initialized< / span > */
2023-03-30 17:09:05 +02:00
< span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_jastrow_champ_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > asymp_jasb< / span > [2];
2023-09-26 17:45:07 +02:00
rc = qmckl_check(context,
qmckl_get_jastrow_champ_asymp_jasb(context, asymp_jasb,2)
);
2022-09-28 18:04:21 +02:00
// < span style = "color: #b22222;" > calculate asymp_jasb< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > asymp_jasb< / span > [0]-0.7115733522582638) < 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > asymp_jasb< / span > [1]-1.043287918508297 ) < 1.e-12);
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org2e0b18e" class = "outline-4" >
< h4 id = "org2e0b18e" > < span class = "section-number-4" > 3.1.2< / span > Electron-electron component< / h4 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-4" id = "text-3-1-2" >
2022-09-28 18:04:21 +02:00
< p >
Calculate the electron-electron jastrow component < code > factor_ee< / code > using the < code > asymp_jasb< / code >
2023-03-02 11:13:03 +01:00
component and the electron-electron rescaled distances < code > ee_distance_rescaled< / code > .
2023-09-27 16:01:32 +02:00
If the < code > spin_independent< / code > variable is set to < code > 1< / code > , then
2023-09-26 17:45:07 +02:00
\(\delta^{\uparrow \downarrow}\) is always equal to one.
2022-09-28 18:04:21 +02:00
< / p >
< p >
\[
2023-03-30 12:35:59 +02:00
f_\text{ee} = \sum_{i,j< i } \ left [
2023-05-25 01:14:47 +02:00
\frac{\delta_{ij}^{\uparrow\downarrow} B_0\, C_{ij}}{1 + B_1\,
2023-03-30 12:35:59 +02:00
C_{ij}} + \sum_{k=2}^{n_\text{ord}} B_k\, C_{ij}^k - {J_{\text{ee}}^{\infty}}_{ij} \right]
\]
2022-09-28 18:04:21 +02:00
< / p >
2022-11-16 18:00:51 +01:00
< p >
2023-03-02 11:13:03 +01:00
\(\delta\) is the spin factor, \(B\) is the vector of \(b\) parameters,
2023-03-30 12:35:59 +02:00
\(C\) is the array of rescaled distances.
2022-11-16 18:00:51 +01:00
< / p >
2022-09-28 18:04:21 +02:00
2023-05-25 01:14:47 +02:00
< p >
\(f_{\text{ee}}\) can be rewritten as:
< / p >
< p >
\[
f_\text{ee} = \frac{1}{2} \left[ \sum_{i,j} \frac{\delta_{ij}^{\uparrow\downarrow} B_0\, C_{ij}}{1 + B_1\, C_{ij}} + \sum_{i,j} \sum_{k=2}^{n_\text{ord}} B_k\, C_{ij}^k \right] - \left[ \frac{n_\uparrow (n_\uparrow-1) + n_\downarrow (n_\downarrow-1)}{2}\, J_{\text{ee}}^{\infty}}_{\uparrow \uparrow} + n_\uparrow\,n_\downarrow\, J_{\text{ee}}^{\infty}}_{\uparrow \downarrow} \right]
\]
< / p >
< / div >
2022-09-28 18:04:21 +02:00
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org83ea1fd" class = "outline-5" >
< h5 id = "org83ea1fd" > < span class = "section-number-5" > 3.1.2.1< / span > Get< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-1-2-1" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #0000ff;" > qmckl_get_jastrow_champ_factor_ee< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > ,
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > factor_ee< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > size_max< / span > );
< / pre >
< / div >
< / div >
2022-11-16 18:00:51 +01:00
2023-03-30 12:35:59 +02:00
< ol class = "org-ol" >
2024-02-23 11:17:59 +01:00
< li > < a id = "orgd74e172" > < / a > Fortran interface< br / >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-6" id = "text-3-1-2-1-1" >
2022-11-16 18:00:51 +01:00
< div class = "org-src-container" >
< pre class = "src src-f90" > < span style = "color: #a020f0;" > interface< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_factor_ee (context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
factor_ee, size_max) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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_max< / span >
2023-09-11 17:07:34 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ), < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > factor_ee(size_max)< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_factor_ee< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > end interface< / span >
< / pre >
< / div >
< / div >
2023-03-30 12:35:59 +02:00
< / li >
< / ol >
2022-09-28 18:04:21 +02:00
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org48ec686" class = "outline-5" >
< h5 id = "org48ec686" > < span class = "section-number-5" > 3.1.2.2< / span > Compute< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-1-2-2" >
2024-02-23 11:17:59 +01:00
< table id = "org6b9d0da" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
< td class = "org-left" > < code > walk_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of walkers< / td >
< / tr >
< tr >
< td class = "org-left" > < code > elec_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of electrons< / td >
< / tr >
< tr >
< td class = "org-left" > < code > up_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of alpha electrons< / td >
< / tr >
< tr >
< td class = "org-left" > < code > bord_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of coefficients< / td >
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > b_vector< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > double[bord_num+1]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > List of coefficients< / td >
< / tr >
< tr >
< td class = "org-left" > < code > ee_distance_rescaled< / code > < / td >
< td class = "org-left" > < code > double[walk_num][elec_num][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron-electron distances< / td >
< / tr >
< tr >
< td class = "org-left" > < code > asymp_jasb< / code > < / td >
< td class = "org-left" > < code > double[2]< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > Asymptotic value of the Jastrow< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
< td class = "org-left" > < code > factor_ee< / code > < / td >
< td class = "org-left" > < code > double[walk_num]< / code > < / td >
< td class = "org-left" > out< / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > \(f_{ee}\)< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
2023-09-21 13:04:54 +02:00
< pre class = "src src-f90" > < span style = "color: #a020f0;" > function< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_ee_doc< / span > (context, < span style = "color: #a020f0;" > & < / span >
2023-09-26 17:45:07 +02:00
walk_num, elec_num, up_num, bord_num, b_vector, < span style = "color: #a020f0;" > & < / span >
ee_distance_rescaled, asymp_jasb, spin_independent, factor_ee) < span style = "color: #a020f0;" > & < / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > bind< / span > (C) < span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > , < span style = "color: #a020f0;" > intrinsic< / span > :: < span style = "color: #0000ff;" > iso_c_binding< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < 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;" > walk_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;" > elec_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;" > up_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;" > bord_num< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > b_vector(bord_num+1)< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > ee_distance_rescaled(elec_num,elec_num,walk_num)< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > asymp_jasb(2)< / span >
2023-09-27 16:01:32 +02:00
< 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;" > spin_independent< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > factor_ee(walk_num)< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code) ::< span style = "color: #a0522d;" > info< / span >
2022-09-28 18:04:21 +02:00
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, j, k, nw< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > x, xk< / span >
2022-09-28 18:04:21 +02:00
info = QMCKL_SUCCESS
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_3
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > if< / span > (bord_num < 0) < span style = "color: #a020f0;" > then< / span >
2022-09-28 18:04:21 +02:00
info = QMCKL_INVALID_ARG_4
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2023-09-26 17:45:07 +02:00
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > do< / span > nw =1, walk_num
2022-11-16 18:00:51 +01:00
2023-05-25 01:14:47 +02:00
factor_ee(nw) = 0.0d0
< span style = "color: #a020f0;" > do< / span > j=1,elec_num
< span style = "color: #a020f0;" > do< / span > i=1,j-1
x = ee_distance_rescaled(i,j,nw)
2023-09-27 16:01:32 +02:00
< span style = "color: #a020f0;" > if< / span > (spin_independent == 1) < span style = "color: #a020f0;" > then< / span >
2023-05-25 01:14:47 +02:00
factor_ee(nw) = factor_ee(nw) + b_vector(1) * x / (1.d0 + b_vector(2) * x) - asymp_jasb(2)
2023-09-26 17:45:07 +02:00
< span style = "color: #a020f0;" > else< / span >
< span style = "color: #a020f0;" > if< / span > ( (j < = up_num)< span style = "color: #a020f0;" > .or.< / span > (i > up_num) ) < span style = "color: #a020f0;" > then< / span >
factor_ee(nw) = factor_ee(nw) + 0.5d0 * b_vector(1) * x / (1.d0 + b_vector(2) * x) - asymp_jasb(1)
< span style = "color: #a020f0;" > else< / span >
factor_ee(nw) = factor_ee(nw) + b_vector(1) * x / (1.d0 + b_vector(2) * x) - asymp_jasb(2)
< span style = "color: #a020f0;" > endif< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > endif< / span >
2023-05-25 01:14:47 +02:00
xk = x
< span style = "color: #a020f0;" > do< / span > k=2,bord_num
xk = xk * x
factor_ee(nw) = factor_ee(nw) + b_vector(k+1)* xk
< span style = "color: #a020f0;" > end do< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
2023-05-25 01:14:47 +02:00
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > end do< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_ee_doc< / span >
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< div class = "org-src-container" >
2023-09-26 17:45:07 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span >
< span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_ee_hpc< / 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > up_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > bord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > b_vector< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > ee_distance_rescaled< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > asymp_jasb< / span > ,
2023-09-27 16:01:32 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int32_t< / span > < span style = "color: #a0522d;" > spin_independent< / span > ,
2023-09-26 17:45:07 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > factor_ee< / span > )
{
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) {
2023-09-26 17:45:07 +02:00
< span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_CONTEXT;
2022-09-28 18:04:21 +02:00
}
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) {
2023-09-26 17:45:07 +02:00
< span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_2;
2022-09-28 18:04:21 +02:00
}
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) {
2023-09-26 17:45:07 +02:00
< span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_3;
2022-09-28 18:04:21 +02:00
}
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > if< / span > (bord_num < 0) {
2023-09-26 17:45:07 +02:00
< span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_4;
2022-09-28 18:04:21 +02:00
}
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > dn_num< / span > = elec_num - up_num;
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > fshift< / span > = 0.5 * (< span style = "color: #228b22;" > double< / span > ) ((dn_num-1)*dn_num + (up_num-1)*up_num) * asymp_jasb[0] +
2023-09-26 17:45:07 +02:00
(< span style = "color: #228b22;" > float< / span > ) (up_num*dn_num) * asymp_jasb[1];
2024-02-13 17:23:15 +01:00
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_OPENMP
< span style = "color: #483d8b;" > #pragma< / span > omp parallel
< span style = "color: #483d8b;" > #endif< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > nw< / span > = 0; nw < walk_num; ++nw) {
2024-02-13 17:23:15 +01:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > result< / span > = 0.;
2023-05-25 01:14:47 +02:00
2023-03-09 11:03:34 +01:00
< span style = "color: #228b22;" > size_t< / span > < span style = "color: #a0522d;" > ishift< / span > = nw * elec_num * elec_num;
2022-09-28 18:04:21 +02:00
2023-09-27 16:01:32 +02:00
< span style = "color: #a020f0;" > if< / span > (spin_independent == 1) {
2023-09-26 17:45:07 +02:00
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > j< / span > = 0; j < elec_num; ++j ) {
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > xj< / span > = & (ee_distance_rescaled[j * elec_num + ishift]);
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > i< / span > = 0; i < j ; ++i) {
2024-02-13 17:23:15 +01:00
result = result + b_vector[0]*xj[i] / (1. + b_vector[1]*xj[i]);
2023-09-26 17:45:07 +02:00
}
2023-05-25 01:14:47 +02:00
}
2023-09-26 17:45:07 +02:00
} < span style = "color: #a020f0;" > else< / span > {
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > j< / span > = 0; j < up_num; ++j ) {
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > xj< / span > = & (ee_distance_rescaled[j * elec_num + ishift]);
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > i< / span > = 0; i < j ; ++i) {
2024-02-13 17:23:15 +01:00
result = result + 0.5 * b_vector[0]*xj[i] / (1. + b_vector[1]*xj[i]);
2023-09-26 17:45:07 +02:00
}
2023-05-25 01:14:47 +02:00
}
2023-09-26 17:45:07 +02:00
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > j< / span > = up_num ; j < elec_num; ++j ) {
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > xj< / span > = & (ee_distance_rescaled[j * elec_num + ishift]);
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > i< / span > = 0; i < up_num; ++i) {
2024-02-13 17:23:15 +01:00
result = result + b_vector[0]*xj[i] / (1. + b_vector[1]*xj[i]);
2023-09-26 17:45:07 +02:00
}
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > i< / span > = up_num ; i < j ; ++i) {
2024-02-13 17:23:15 +01:00
result = result + 0.5 * b_vector[0]*xj[i] / (1. + b_vector[1]*xj[i]);
2023-09-26 17:45:07 +02:00
}
}
2023-05-25 01:14:47 +02:00
}
2024-02-13 17:23:15 +01:00
result = result - fshift;
2022-09-28 18:04:21 +02:00
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > j< / span > =0; j < elec_num; ++j ) {
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > xj< / span > = & (ee_distance_rescaled[j * elec_num + ishift]);
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > i< / span > =0; i < j ; ++i) {
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > x< / span > = xj[i];
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > xk< / span > = x;
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > k< / span > = 2; k < = bord_num; ++k) {
xk *= x;
2024-02-13 17:23:15 +01:00
result = result + b_vector[k] * xk;
2023-05-25 01:14:47 +02:00
}
2022-09-28 18:04:21 +02:00
}
}
2024-02-13 17:23:15 +01:00
factor_ee[nw] = result;
2022-09-28 18:04:21 +02:00
}
< span style = "color: #a020f0;" > return< / span > QMCKL_SUCCESS;
}
< / pre >
< / div >
2023-03-02 11:13:03 +01:00
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span >
2023-03-31 15:12:07 +02:00
< span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_ee< / span > (< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > ,
2023-09-26 17:45:07 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > up_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > bord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > b_vector< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > ee_distance_rescaled< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > asymp_jasb< / span > ,
2023-09-27 16:01:32 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int32_t< / span > < span style = "color: #a0522d;" > spin_independent< / span > ,
2023-09-26 17:45:07 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > factor_ee< / span > )
2023-03-02 11:13:03 +01:00
{
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_HPC
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_jastrow_champ_factor_ee_hpc
2023-03-02 11:13:03 +01:00
< span style = "color: #483d8b;" > #else< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_jastrow_champ_factor_ee_doc
2023-03-02 11:13:03 +01:00
< span style = "color: #483d8b;" > #endif< / span >
2023-09-21 13:04:54 +02:00
(context, walk_num, elec_num, up_num, bord_num, b_vector,
2023-09-26 17:45:07 +02:00
ee_distance_rescaled, asymp_jasb, spin_independent, factor_ee);
2023-03-02 11:13:03 +01:00
}
< / pre >
2022-09-28 18:04:21 +02:00
< / div >
< / div >
2023-03-02 11:13:03 +01:00
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgbe1f162" class = "outline-5" >
< h5 id = "orgbe1f162" > < span class = "section-number-5" > 3.1.2.3< / span > Test< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-1-2-3" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
2022-11-18 14:16:53 +01:00
< pre class = "src src-c" > /* < span style = "color: #b22222;" > Check if Jastrow is properly initialized< / span > */
2023-03-30 17:09:05 +02:00
< span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_jastrow_champ_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > factor_ee< / span > [walk_num];
rc = qmckl_check(context,
2023-03-30 17:09:05 +02:00
qmckl_get_jastrow_champ_factor_ee(context, factor_ee, walk_num)
2022-09-28 18:04:21 +02:00
);
// < span style = "color: #b22222;" > calculate factor_ee< / span >
2023-05-25 01:14:47 +02:00
printf(< span style = "color: #8b2252;" > "%e\n%e\n\n"< / span > ,factor_ee[0],-16.83886184243964);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > factor_ee< / span > [0]+16.83886184243964) < 1.e-12);
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org4c27848" class = "outline-4" >
< h4 id = "org4c27848" > < span class = "section-number-4" > 3.1.3< / span > Derivative< / h4 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-4" id = "text-3-1-3" >
2022-09-28 18:04:21 +02:00
< p >
2023-03-09 11:03:34 +01:00
The derivative of < code > factor_ee< / code > is computed using the < code > ee_distance_rescaled< / code > and
2023-05-25 01:14:47 +02:00
the electron-electron rescaled distances derivatives
< code > ee_distance_rescaled_gl< / code > .
2022-09-28 18:04:21 +02:00
There are four components, the gradient which has 3 components in the \(x, y, z\)
directions and the laplacian as the last component.
< / p >
2023-03-09 11:03:34 +01:00
< p >
2023-05-25 01:14:47 +02:00
\[ \nabla_i f_\text{ee} = \sum_{j\ne i}
2023-03-30 12:35:59 +02:00
\left[\frac{\delta_{ij}^{\uparrow\downarrow} B_0\, \nabla_i
2023-05-25 01:14:47 +02:00
C_{ij}}{(1 + B_1\, C_{ij})^2} + \sum^{n_\text{ord}}_{k=2}
2023-03-30 12:35:59 +02:00
B_k\, k\, C_{ij}^{k-1} \nabla C_{ij} \right] \]
2023-03-09 11:03:34 +01:00
< / p >
2023-05-25 01:14:47 +02:00
< p >
\[ \Delta_i f_\text{ee} = \sum_{j \ne i}
\left[ \delta_{ij}^{\uparrow\downarrow} B_0
\left(\frac{ \Delta_i C_{ij}}{(1 + B_1\, C_{ij})^2} -\frac{2\,B_1
\left(\nabla_i C_{ij}\right)^2 }{(1 + B_1\, C_{ij})^3} \right) + \sum^{n_\text{ord}}_{k=2}
B_k\, k\, \left((k-1)\, C_{ij}^{k-2} \left(\nabla_i C_{ij}\right)^2 + C_{ij}^{k-1} \Delta_i C_{ij} \right) \right] \]
< / p >
2023-03-09 11:03:34 +01:00
< / div >
2023-05-25 01:14:47 +02:00
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org48c9088" class = "outline-5" >
< h5 id = "org48c9088" > < span class = "section-number-5" > 3.1.3.1< / span > Get< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-1-3-1" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > qmckl_get_jastrow_champ_factor_ee_gl< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > factor_ee_gl< / span > ,
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > size_max< / span > );
< / pre >
< / div >
< / div >
2023-05-25 01:14:47 +02:00
< ol class = "org-ol" >
2024-02-23 11:17:59 +01:00
< li > < a id = "orgf3d7b00" > < / a > Fortran interface< br / >
2023-05-25 01:14:47 +02:00
< div class = "outline-text-6" id = "text-3-1-3-1-1" >
< div class = "org-src-container" >
< pre class = "src src-f90" > < span style = "color: #a020f0;" > interface< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_factor_ee_gl (context, < / span > < span style = "color: #a020f0;" > & < / span >
factor_ee_gl, size_max) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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_max< / span >
2023-09-11 17:07:34 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ), < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > factor_ee_gl(size_max)< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_factor_ee_gl< / span >
< span style = "color: #a020f0;" > end interface< / span >
< / pre >
< / div >
< / div >
< / li >
< / ol >
2022-09-28 18:04:21 +02:00
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org85c9697" class = "outline-5" >
< h5 id = "org85c9697" > < span class = "section-number-5" > 3.1.3.2< / span > Compute< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-1-3-2" >
2024-02-23 11:17:59 +01:00
< table id = "org74d5d3f" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
< td class = "org-left" > < code > walk_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of walkers< / td >
< / tr >
< tr >
< td class = "org-left" > < code > elec_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of electrons< / td >
< / tr >
< tr >
< td class = "org-left" > < code > up_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of alpha electrons< / td >
< / tr >
< tr >
< td class = "org-left" > < code > bord_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of coefficients< / td >
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > b_vector< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > double[bord_num+1]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > List of coefficients< / td >
< / tr >
< tr >
< td class = "org-left" > < code > ee_distance_rescaled< / code > < / td >
< td class = "org-left" > < code > double[walk_num][elec_num][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron-electron distances< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > ee_distance_rescaled_gl< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > double[walk_num][4][elec_num][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron-electron distances< / td >
< / tr >
2023-09-27 16:01:32 +02:00
< tr >
< td class = "org-left" > < code > spin_independent< / code > < / td >
< td class = "org-left" > < code > int32_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > If 1, same parameters for parallel and antiparallel spins< / td >
< / tr >
2022-09-28 18:04:21 +02:00
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > factor_ee_gl< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > double[walk_num][4][elec_num]< / code > < / td >
< td class = "org-left" > out< / td >
< td class = "org-left" > Electron-electron distances< / td >
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
2023-09-21 13:04:54 +02:00
< pre class = "src src-f90" > < span style = "color: #a020f0;" > function< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_ee_gl_doc< / span > ( < span style = "color: #a020f0;" > & < / span >
2022-09-28 18:04:21 +02:00
context, walk_num, elec_num, up_num, bord_num, < span style = "color: #a020f0;" > & < / span >
2023-05-25 01:14:47 +02:00
b_vector, ee_distance_rescaled, ee_distance_rescaled_gl, < span style = "color: #a020f0;" > & < / span >
2023-09-27 16:01:32 +02:00
spin_independent, factor_ee_gl) < span style = "color: #a020f0;" > & < / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > bind< / span > (C) < span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > , < span style = "color: #a020f0;" > intrinsic< / span > :: < span style = "color: #0000ff;" > iso_c_binding< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < 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;" > walk_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;" > elec_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;" > up_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;" > bord_num< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > b_vector(bord_num+1)< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > ee_distance_rescaled(elec_num,elec_num,walk_num)< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > ee_distance_rescaled_gl(4,elec_num,elec_num,walk_num)< / span >
2023-09-27 16:01:32 +02:00
< 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;" > spin_independent< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > factor_ee_gl(elec_num,4,walk_num)< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code) ::< span style = "color: #a0522d;" > info< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, j, k, nw, ii< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > x, x1, kf< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > denom, invdenom, invdenom2, f< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > grad_c2< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > dx(4)< / span >
2022-09-28 18:04:21 +02:00
info = QMCKL_SUCCESS
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_3
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > if< / span > (bord_num < 0) < span style = "color: #a020f0;" > then< / span >
2022-09-28 18:04:21 +02:00
info = QMCKL_INVALID_ARG_4
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2023-09-27 16:01:32 +02:00
< span style = "color: #a020f0;" > if< / span > ((spin_independent < 0)< span style = "color: #a020f0;" > .or.< / span > (spin_independent > 1)) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_8
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > do< / span > nw =1, walk_num
2023-05-25 01:14:47 +02:00
factor_ee_gl(:,:,nw) = 0.0d0
2022-09-28 18:04:21 +02:00
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > do< / span > j = 1, elec_num
< span style = "color: #a020f0;" > do< / span > i = 1, elec_num
< span style = "color: #a020f0;" > if< / span > (i == j) < span style = "color: #a020f0;" > cycle< / span >
2022-09-28 18:04:21 +02:00
2023-05-25 01:14:47 +02:00
x = ee_distance_rescaled(i,j,nw)
2022-09-28 18:04:21 +02:00
2023-05-25 01:14:47 +02:00
denom = 1.0d0 + b_vector(2) * x
invdenom = 1.0d0 / denom
invdenom2 = invdenom * invdenom
dx(1) = ee_distance_rescaled_gl(1, i, j, nw)
dx(2) = ee_distance_rescaled_gl(2, i, j, nw)
dx(3) = ee_distance_rescaled_gl(3, i, j, nw)
dx(4) = ee_distance_rescaled_gl(4, i, j, nw)
grad_c2 = dx(1)*dx(1) + dx(2)*dx(2) + dx(3)*dx(3)
2023-09-27 16:01:32 +02:00
< span style = "color: #a020f0;" > if< / span > (spin_independent == 1) < span style = "color: #a020f0;" > then< / span >
2023-05-25 01:14:47 +02:00
f = b_vector(1) * invdenom2
2023-09-27 16:01:32 +02:00
< span style = "color: #a020f0;" > else< / span >
< span style = "color: #a020f0;" > if< / span > ((i < = up_num < span style = "color: #a020f0;" > .and.< / span > j < = up_num ) < span style = "color: #a020f0;" > .or.< / span > (i > up_num < span style = "color: #a020f0;" > .and.< / span > j > up_num)) < span style = "color: #a020f0;" > then< / span >
f = 0.5d0 * b_vector(1) * invdenom2
< span style = "color: #a020f0;" > else< / span >
f = b_vector(1) * invdenom2
< span style = "color: #a020f0;" > end if< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > end if< / span >
factor_ee_gl(i,1,nw) = factor_ee_gl(i,1,nw) + f * dx(1)
factor_ee_gl(i,2,nw) = factor_ee_gl(i,2,nw) + f * dx(2)
factor_ee_gl(i,3,nw) = factor_ee_gl(i,3,nw) + f * dx(3)
factor_ee_gl(i,4,nw) = factor_ee_gl(i,4,nw) < span style = "color: #a020f0;" > & < / span >
+ f * (dx(4) - 2.d0 * b_vector(2) * grad_c2 * invdenom)
kf = 2.d0
x1 = x
x = 1.d0
< span style = "color: #a020f0;" > do< / span > k=2, bord_num
f = b_vector(k+1) * kf * x
factor_ee_gl(i,1,nw) = factor_ee_gl(i,1,nw) + f * x1 * dx(1)
factor_ee_gl(i,2,nw) = factor_ee_gl(i,2,nw) + f * x1 * dx(2)
factor_ee_gl(i,3,nw) = factor_ee_gl(i,3,nw) + f * x1 * dx(3)
factor_ee_gl(i,4,nw) = factor_ee_gl(i,4,nw) < span style = "color: #a020f0;" > & < / span >
+ f * (x1 * dx(4) + (kf-1.d0) * grad_c2)
x = x*x1
kf = kf + 1.d0
< span style = "color: #a020f0;" > end do< / span >
2022-09-28 18:04:21 +02:00
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > end do< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > end do< / span >
2023-05-25 01:14:47 +02:00
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > end do< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_ee_gl_doc< / span >
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< div class = "org-src-container" >
2023-09-27 16:01:32 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span >
< span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_ee_gl_hpc< / 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > up_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > bord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > b_vector< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > ee_distance_rescaled< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > ee_distance_rescaled_gl< / span > ,
2024-02-14 11:00:41 +01:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int32_t< / span > < span style = "color: #a0522d;" > spin_independent< / span > ,
2023-09-27 16:01:32 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > factor_ee_gl< / span > )
{
2022-09-28 18:04:21 +02:00
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_CONTEXT;
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_2;
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_3;
< span style = "color: #a020f0;" > if< / span > (up_num < = 0) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_4;
< span style = "color: #a020f0;" > if< / span > (bord_num < 0) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_5;
< span style = "color: #a020f0;" > if< / span > (b_vector == < span style = "color: #008b8b;" > NULL< / span > ) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_6;
< span style = "color: #a020f0;" > if< / span > (ee_distance_rescaled == < span style = "color: #008b8b;" > NULL< / span > ) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_7;
< span style = "color: #a020f0;" > if< / span > (ee_distance_rescaled_gl == < span style = "color: #008b8b;" > NULL< / span > ) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_8;
2023-09-27 16:01:32 +02:00
< span style = "color: #a020f0;" > if< / span > (spin_independent & (< span style = "color: #228b22;" > int32_t< / span > ) (-2)) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_8;
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > if< / span > (factor_ee_gl == < span style = "color: #008b8b;" > NULL< / span > ) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_9;
2023-05-25 01:14:47 +02:00
2023-05-26 09:53:50 +02:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > kf< / span > [bord_num+1];
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > k< / span > =0 ; k< =bord_num ; ++k) {
2023-09-27 16:01:32 +02:00
kf[k] = (< span style = "color: #228b22;" > double< / span > ) k;
2023-05-26 09:53:50 +02:00
}
2024-02-13 17:23:15 +01:00
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_OPENMP
2023-09-27 16:01:32 +02:00
< span style = "color: #483d8b;" > #pragma< / span > omp parallel < span style = "color: #a020f0;" > for< / span >
2024-02-13 17:23:15 +01:00
< span style = "color: #483d8b;" > #endif< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > nw< / span > = 0; nw < walk_num; ++nw) {
2024-02-13 17:23:15 +01:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > xk< / span > [bord_num+1];
2024-02-21 00:02:22 +01:00
< span style = "color: #228b22;" > bool< / span > < span style = "color: #a0522d;" > touched< / span > = < span style = "color: #008b8b;" > false< / span > ;
2023-09-21 13:04:54 +02:00
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > j< / span > = 0; j < elec_num; ++j) {
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > dxj< / span > = & ee_distance_rescaled_gl[4*elec_num*(j+nw*elec_num)];
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > xj< / span > = & ee_distance_rescaled [ elec_num*(j+nw*elec_num)];
2022-09-28 18:04:21 +02:00
2023-05-26 09:53:50 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > factor_ee_gl_0< / span > = & (factor_ee_gl[nw*elec_num*4]);
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > factor_ee_gl_1< / span > = factor_ee_gl_0 + elec_num;
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > factor_ee_gl_2< / span > = factor_ee_gl_1 + elec_num;
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > factor_ee_gl_3< / span > = factor_ee_gl_2 + elec_num;
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > i< / span > = 0; i < elec_num; ++i) {
< span style = "color: #a020f0;" > if< / span > (j == i) < span style = "color: #a020f0;" > continue< / span > ;
2022-09-28 18:04:21 +02:00
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > x< / span > = xj[i];
2022-09-28 18:04:21 +02:00
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > denom< / span > = 1.0 + b_vector[1]*x;
2023-05-26 09:53:50 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > invdenom< / span > = 1.0 / denom;
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > invdenom2< / span > = invdenom * invdenom;
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > dx< / span > = dxj + 4*i;
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > grad_c2< / span > = dx[0]*dx[0] + dx[1]*dx[1] + dx[2]*dx[2];
2023-09-27 16:01:32 +02:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > f< / span > = b_vector[0] * invdenom2;
< span style = "color: #a020f0;" > if< / span > ((spin_independent == 0) & & (
((i < up_num) & & (j < up_num)) ||
((i > = up_num) & & (j > = up_num))) ) {
f *= 0.5;
}
2023-05-25 01:14:47 +02:00
2024-02-21 00:02:22 +01:00
< span style = "color: #a020f0;" > if< / span > (touched) {
factor_ee_gl_0[i] = factor_ee_gl_0[i] + f*dx[0];
factor_ee_gl_1[i] = factor_ee_gl_1[i] + f*dx[1];
factor_ee_gl_2[i] = factor_ee_gl_2[i] + f*dx[2];
factor_ee_gl_3[i] = factor_ee_gl_3[i] + f*dx[3];
} < span style = "color: #a020f0;" > else< / span > {
touched = < span style = "color: #008b8b;" > true< / span > ;
factor_ee_gl_0[i] = f*dx[0];
factor_ee_gl_1[i] = f*dx[1];
factor_ee_gl_2[i] = f*dx[2];
factor_ee_gl_3[i] = f*dx[3];
}
2024-01-30 11:32:49 +01:00
factor_ee_gl_3[i] = factor_ee_gl_3[i] - f*grad_c2*invdenom*2.0 * b_vector[1];
2022-09-28 18:04:21 +02:00
2023-05-26 09:53:50 +02:00
xk[0] = 1.0;
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > k< / span > =1 ; k< = bord_num ; ++k) {
xk[k] = xk[k-1]*x;
}
2022-09-28 18:04:21 +02:00
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > k< / span > =2 ; k< = bord_num ; ++k) {
2023-05-26 09:53:50 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > f1< / span > = b_vector[k] * kf[k] * xk[k-2];
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > f2< / span > = f1*xk[1];
2024-01-30 11:32:49 +01:00
factor_ee_gl_0[i] = factor_ee_gl_0[i] + f2*dx[0];
factor_ee_gl_1[i] = factor_ee_gl_1[i] + f2*dx[1];
factor_ee_gl_2[i] = factor_ee_gl_2[i] + f2*dx[2];
factor_ee_gl_3[i] = factor_ee_gl_3[i] + f2*dx[3];
factor_ee_gl_3[i] = factor_ee_gl_3[i] + f1*kf[k-1]*grad_c2;
2023-05-25 01:14:47 +02:00
}
2022-09-28 18:04:21 +02:00
}
}
2024-02-21 00:02:22 +01:00
< span style = "color: #a020f0;" > if< / span > (!touched) {
memset(& (factor_ee_gl[nw*4*elec_num]), 0, elec_num*4*< span style = "color: #a020f0;" > sizeof< / span > (< span style = "color: #228b22;" > double< / span > ));
}
2022-09-28 18:04:21 +02:00
}
< span style = "color: #a020f0;" > return< / span > QMCKL_SUCCESS;
}
< / pre >
< / div >
< div class = "org-src-container" >
2023-09-27 16:01:32 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span >
< span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_ee_gl_hpc< / 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > up_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > bord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > b_vector< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > ee_distance_rescaled< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > ee_distance_rescaled_gl< / span > ,
2024-02-14 11:00:41 +01:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int32_t< / span > < span style = "color: #a0522d;" > spin_independent< / span > ,
2023-09-27 16:01:32 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > factor_ee_gl< / span > );
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< div class = "org-src-container" >
2023-09-27 16:01:32 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span >
< span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_ee_gl_doc< / 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > up_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > bord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > b_vector< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > ee_distance_rescaled< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > ee_distance_rescaled_gl< / span > ,
2024-02-14 11:00:41 +01:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int32_t< / span > < span style = "color: #a0522d;" > spin_independent< / span > ,
2023-09-27 16:01:32 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > factor_ee_gl< / span > );
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< div class = "org-src-container" >
2023-09-27 16:01:32 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span >
< span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_ee_gl< / 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > up_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > bord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > b_vector< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > ee_distance_rescaled< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > ee_distance_rescaled_gl< / span > ,
2024-02-14 11:00:41 +01:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int32_t< / span > < span style = "color: #a0522d;" > spin_independent< / span > ,
2023-09-27 16:01:32 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > factor_ee_gl< / span > )
{
2023-09-21 13:04:54 +02:00
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_HPC
2023-09-27 16:01:32 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_jastrow_champ_factor_ee_gl_hpc
2023-09-21 13:04:54 +02:00
< span style = "color: #483d8b;" > #else< / span >
2023-09-27 16:01:32 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_jastrow_champ_factor_ee_gl_doc
2023-09-21 13:04:54 +02:00
< span style = "color: #483d8b;" > #endif< / span >
(context, walk_num, elec_num, up_num, bord_num, b_vector,
2023-09-27 16:01:32 +02:00
ee_distance_rescaled, ee_distance_rescaled_gl, spin_independent, factor_ee_gl );
2022-09-28 18:04:21 +02:00
}
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgb79b3bf" class = "outline-5" >
< h5 id = "orgb79b3bf" > < span class = "section-number-5" > 3.1.3.3< / span > Test< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-1-3-3" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
2022-11-18 14:16:53 +01:00
< pre class = "src src-c" > /* < span style = "color: #b22222;" > Check if Jastrow is properly initialized< / span > */
2023-03-30 17:09:05 +02:00
< span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_jastrow_champ_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
2022-09-28 18:04:21 +02:00
2023-05-25 01:14:47 +02:00
// < span style = "color: #b22222;" > calculate factor_ee_gl< / span >
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > factor_ee_gl< / span > [walk_num][4][elec_num];
rc = qmckl_get_jastrow_champ_factor_ee_gl(context, & (factor_ee_gl[0][0][0]),walk_num*4*elec_num);
// < span style = "color: #b22222;" > check factor_ee_gl< / span >
printf(< span style = "color: #8b2252;" > "%f %f\n"< / span > , factor_ee_gl[0][0][0], -0.39319353942687446);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > factor_ee_gl< / span > [0][0][0]+0.39319353942687446) < 1.e-12);
2022-09-28 18:04:21 +02:00
2023-05-25 01:14:47 +02:00
printf(< span style = "color: #8b2252;" > "%f %f\n"< / span > , factor_ee_gl[0][1][0], 1.0535615450668214);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > factor_ee_gl< / span > [0][1][0]-1.0535615450668214) < 1.e-12);
printf(< span style = "color: #8b2252;" > "%f %f\n"< / span > , factor_ee_gl[0][2][0],-0.39098406960784515);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > factor_ee_gl< / span > [0][2][0]+0.39098406960784515) < 1.e-12);
printf(< span style = "color: #8b2252;" > "%f %f\n"< / span > , factor_ee_gl[0][3][0],2.8650469630854483);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > factor_ee_gl< / span > [0][3][0]-2.8650469630854483) < 1.e-12);
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgf4e1bce" class = "outline-4" >
< h4 id = "orgf4e1bce" > < span class = "section-number-4" > 3.1.4< / span > Electron-electron rescaled distances< / h4 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-4" id = "text-3-1-4" >
2022-09-28 18:04:21 +02:00
< p >
2023-03-30 12:35:59 +02:00
< code > ee_distance_rescaled< / code > stores the matrix of the rescaled distances between all
pairs of electrons:
2022-11-17 19:27:17 +01:00
< / p >
< p >
\[
2023-03-30 12:35:59 +02:00
C_{ij} = \frac{ 1 - e^{-\kappa r_{ij}}}{\kappa}
\]
2022-11-17 19:27:17 +01:00
< / p >
2023-03-30 12:35:59 +02:00
< p >
where \(r_{ij}\) is the matrix of electron-electron distances.
< / p >
2022-11-17 19:27:17 +01:00
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgc681bff" class = "outline-5" >
< h5 id = "orgc681bff" > < span class = "section-number-5" > 3.1.4.1< / span > Get< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-1-4-1" >
2022-11-17 19:27:17 +01:00
< div class = "org-src-container" >
2023-03-30 17:09:05 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_ee_distance_rescaled< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > , < span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > distance_rescaled< / span > );
2022-11-17 19:27:17 +01:00
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org0c6a96d" class = "outline-5" >
< h5 id = "org0c6a96d" > < span class = "section-number-5" > 3.1.4.2< / span > Compute< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-1-4-2" >
2024-02-23 11:17:59 +01:00
< table id = "org0572fba" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-11-17 19:27:17 +01:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > elec_num< / code > < / td >
2022-11-17 19:27:17 +01:00
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Number of electrons< / td >
2022-11-17 19:27:17 +01:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > rescale_factor_ee< / code > < / td >
< td class = "org-left" > < code > double< / code > < / td >
2022-11-17 19:27:17 +01:00
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Factor to rescale ee distances< / td >
2022-11-17 19:27:17 +01:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > walk_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
2022-11-17 19:27:17 +01:00
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Number of walkers< / td >
2022-11-17 19:27:17 +01:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > coord< / code > < / td >
< td class = "org-left" > < code > double[3][walk_num][elec_num]< / code > < / td >
2022-11-17 19:27:17 +01:00
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Electron coordinates< / td >
2022-11-17 19:27:17 +01:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > ee_distance< / code > < / td >
< td class = "org-left" > < code > double[walk_num][elec_num][elec_num]< / code > < / td >
2022-11-17 19:27:17 +01:00
< td class = "org-left" > out< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Electron-electron rescaled distances< / td >
2022-11-17 19:27:17 +01:00
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
2023-09-21 13:04:54 +02:00
< pre class = "src src-f90" > < span style = "color: #a020f0;" > function< / span > < span style = "color: #0000ff;" > qmckl_compute_ee_distance_rescaled_doc< / span > (context, < span style = "color: #a020f0;" > & < / span >
elec_num, rescale_factor_ee, walk_num, < span style = "color: #a020f0;" > & < / span >
2023-03-30 12:35:59 +02:00
coord, ee_distance_rescaled) < span style = "color: #a020f0;" > & < / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > bind< / span > (C) < span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > , < span style = "color: #a020f0;" > intrinsic< / span > :: < span style = "color: #0000ff;" > iso_c_binding< / span >
2022-11-17 19:27:17 +01:00
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < 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;" > elec_num< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) , < span style = "color: #a020f0;" > value< / span > ::< span style = "color: #a0522d;" > rescale_factor_ee< / 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;" > walk_num< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > coord(elec_num,walk_num,3)< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > ee_distance_rescaled(elec_num,elec_num,walk_num)< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code) ::< span style = "color: #a0522d;" > info< / span >
2022-11-17 19:27:17 +01:00
2023-03-30 12:35:59 +02:00
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > k< / span >
2022-11-17 19:27:17 +01:00
info = QMCKL_SUCCESS
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) < span style = "color: #a020f0;" > then< / span >
2022-11-17 19:27:17 +01:00
info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_3
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2022-11-17 19:27:17 +01:00
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > do< / span > k=1,walk_num
info = qmckl_distance_rescaled(context, < span style = "color: #8b2252;" > 'T'< / span > , < span style = "color: #8b2252;" > 'T'< / span > , elec_num, elec_num, < span style = "color: #a020f0;" > & < / span >
coord(1,k,1), elec_num * walk_num, < span style = "color: #a020f0;" > & < / span >
coord(1,k,1), elec_num * walk_num, < span style = "color: #a020f0;" > & < / span >
ee_distance_rescaled(1,1,k), elec_num, rescale_factor_ee)
< span style = "color: #a020f0;" > if< / span > (info /= QMCKL_SUCCESS) < span style = "color: #a020f0;" > then< / span >
< span style = "color: #a020f0;" > exit< / span >
< span style = "color: #a020f0;" > endif< / span >
2022-11-17 19:27:17 +01:00
< span style = "color: #a020f0;" > end do< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_ee_distance_rescaled_doc< / span >
2022-11-17 19:27:17 +01:00
< / pre >
< / div >
2023-03-30 12:35:59 +02:00
< / div >
< / div >
2022-11-17 19:27:17 +01:00
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org4f1a0a7" class = "outline-5" >
< h5 id = "org4f1a0a7" > < span class = "section-number-5" > 3.1.4.3< / span > Test< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-1-4-3" >
2022-11-17 19:27:17 +01:00
< div class = "org-src-container" >
2023-03-30 12:35:59 +02:00
< pre class = "src src-c" > < span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_electron_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
2022-11-17 19:27:17 +01:00
2023-03-30 12:35:59 +02:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > ee_distance_rescaled< / span > [walk_num * elec_num * elec_num];
2023-03-30 17:09:05 +02:00
rc = qmckl_get_jastrow_champ_ee_distance_rescaled(context, ee_distance_rescaled);
2022-11-17 19:27:17 +01:00
2023-03-30 12:35:59 +02:00
// < span style = "color: #b22222;" > (e1,e2,w)< / span >
// < span style = "color: #b22222;" > (0,0,0) == 0.< / span >
< span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > ee_distance_rescaled< / span > [0] == 0.);
2022-11-17 19:27:17 +01:00
2023-03-30 12:35:59 +02:00
// < span style = "color: #b22222;" > (1,0,0) == (0,1,0)< / span >
< span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > ee_distance_rescaled< / span > [1] == ee_distance_rescaled[elec_num]);
2022-11-17 19:27:17 +01:00
2023-03-30 12:35:59 +02:00
// < span style = "color: #b22222;" > value of (1,0,0)< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > ee_distance_rescaled< / span > [1]-0.6347507420688708) < 1.e-12);
2022-11-17 19:27:17 +01:00
2023-03-30 12:35:59 +02:00
// < span style = "color: #b22222;" > (0,0,1) == 0.< / span >
< span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > ee_distance_rescaled< / span > [5*elec_num + 5] == 0.);
2022-11-17 19:27:17 +01:00
2023-03-30 12:35:59 +02:00
// < span style = "color: #b22222;" > (1,0,1) == (0,1,1)< / span >
< span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > ee_distance_rescaled< / span > [5*elec_num+6] == ee_distance_rescaled[6*elec_num+5]);
2022-11-17 19:27:17 +01:00
2023-03-30 12:35:59 +02:00
// < span style = "color: #b22222;" > value of (1,0,1)< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > ee_distance_rescaled< / span > [5*elec_num+6]-0.3941735387855409) < 1.e-12);
2022-11-17 19:27:17 +01:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgdb5121c" class = "outline-4" >
< h4 id = "orgdb5121c" > < span class = "section-number-4" > 3.1.5< / span > Electron-electron rescaled distance gradients and Laplacian with respect to electron coordinates< / h4 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-4" id = "text-3-1-5" >
2022-09-28 18:04:21 +02:00
< p >
2023-03-30 12:35:59 +02:00
The rescaled distances, represented by \(C_{ij} = (1 - e^{-\kappa_\text{e} r_{ij}})/\kappa_\text{e}\)
are differentiated with respect to the electron coordinates.
This information is stored in the tensor
2023-05-25 01:14:47 +02:00
< code > ee_distance_rescaled_gl< / code > . The initial three sequential
2023-03-30 12:35:59 +02:00
elements of this three-dimensional tensor provide the \(x\), \(y\), and \(z\)
direction derivatives, while the fourth index corresponds to the Laplacian.
2022-09-28 18:04:21 +02:00
< / p >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgac94f7f" class = "outline-5" >
< h5 id = "orgac94f7f" > < span class = "section-number-5" > 3.1.5.1< / span > Get< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-1-5-1" >
2022-11-16 18:00:51 +01:00
< div class = "org-src-container" >
2023-05-25 01:14:47 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_ee_distance_rescaled_gl< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > , < span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > distance_rescaled_gl< / span > );
2022-11-16 18:00:51 +01:00
< / pre >
< / div >
< / div >
< / div >
2022-09-28 18:04:21 +02:00
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org17a4d69" class = "outline-5" >
< h5 id = "org17a4d69" > < span class = "section-number-5" > 3.1.5.2< / span > Compute< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-1-5-2" >
2024-02-23 11:17:59 +01:00
< table id = "org379e06d" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > elec_num< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Number of electrons< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > rescale_factor_ee< / code > < / td >
< td class = "org-left" > < code > double< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Factor to rescale ee distances< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > walk_num< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Number of walkers< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > coord< / code > < / td >
< td class = "org-left" > < code > double[3][walk_num][elec_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Electron coordinates< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2023-09-21 13:04:54 +02:00
< td class = "org-left" > < code > ee_distance_rescaled_gl< / code > < / td >
< td class = "org-left" > < code > double[walk_num][elec_num][elec_num][4]< / code > < / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > out< / td >
< td class = "org-left" > Electron-electron rescaled distance derivatives< / td >
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
2023-09-21 13:04:54 +02:00
< pre class = "src src-f90" > < span style = "color: #a020f0;" > function< / span > < span style = "color: #0000ff;" > qmckl_compute_ee_distance_rescaled_gl_doc< / span > (context, < span style = "color: #a020f0;" > & < / span >
elec_num, rescale_factor_ee, walk_num, coord, ee_distance_rescaled_gl) < span style = "color: #a020f0;" > & < / span >
< span style = "color: #a020f0;" > bind< / span > (C) < span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > , < span style = "color: #a020f0;" > intrinsic< / span > :: < span style = "color: #0000ff;" > iso_c_binding< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < 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;" > elec_num< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) , < span style = "color: #a020f0;" > value< / span > ::< span style = "color: #a0522d;" > rescale_factor_ee< / 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;" > walk_num< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > coord(elec_num,walk_num,3)< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > ee_distance_rescaled_gl(4,elec_num,elec_num,walk_num)< / span >
2023-09-27 16:01:32 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code) ::< span style = "color: #a0522d;" > info< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > k< / span >
info = QMCKL_SUCCESS
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_3
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > do< / span > k=1,walk_num
2023-05-25 01:14:47 +02:00
info = qmckl_distance_rescaled_gl(context, < span style = "color: #8b2252;" > 'T'< / span > , < span style = "color: #8b2252;" > 'T'< / span > , elec_num, elec_num, < span style = "color: #a020f0;" > & < / span >
2023-03-30 12:35:59 +02:00
coord(1,k,1), elec_num*walk_num, < span style = "color: #a020f0;" > & < / span >
coord(1,k,1), elec_num*walk_num, < span style = "color: #a020f0;" > & < / span >
2023-05-25 01:14:47 +02:00
ee_distance_rescaled_gl(1,1,1,k), elec_num, rescale_factor_ee)
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > if< / span > (info /= QMCKL_SUCCESS) < span style = "color: #a020f0;" > then< / span >
< span style = "color: #a020f0;" > exit< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > end do< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_ee_distance_rescaled_gl_doc< / span >
2023-03-30 12:35:59 +02:00
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org1d3ce94" class = "outline-5" >
< h5 id = "org1d3ce94" > < span class = "section-number-5" > 3.1.5.3< / span > Test< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-1-5-3" >
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_electron_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > ee_distance_rescaled_gl< / span > [4 * walk_num * elec_num * elec_num];
rc = qmckl_get_jastrow_champ_ee_distance_rescaled_gl(context, ee_distance_rescaled_gl);
2023-03-30 12:35:59 +02:00
// < span style = "color: #b22222;" > TODO: Get exact values< / span >
//// < span style = "color: #b22222;" > (e1,e2,w)< / span >
//// < span style = "color: #b22222;" > (0,0,0) == 0.< / span >
//< span style = "color: #b22222;" > assert(ee_distance[0] == 0.);< / span >
//
//// < span style = "color: #b22222;" > (1,0,0) == (0,1,0)< / span >
//< span style = "color: #b22222;" > assert(ee_distance[1] == ee_distance[elec_num]);< / span >
//
//// < span style = "color: #b22222;" > value of (1,0,0)< / span >
//< span style = "color: #b22222;" > assert(fabs(ee_distance[1]-7.152322512964209) < 1.e-12);< / span >
//
//// < span style = "color: #b22222;" > (0,0,1) == 0.< / span >
//< span style = "color: #b22222;" > assert(ee_distance[elec_num*elec_num] == 0.);< / span >
//
//// < span style = "color: #b22222;" > (1,0,1) == (0,1,1)< / span >
//< span style = "color: #b22222;" > assert(ee_distance[elec_num*elec_num+1] == ee_distance[elec_num*elec_num+elec_num]);< / span >
//
//// < span style = "color: #b22222;" > value of (1,0,1)< / span >
//< span style = "color: #b22222;" > assert(fabs(ee_distance[elec_num*elec_num+1]-6.5517646321055665) < 1.e-12);< / span >
< / pre >
< / div >
< / div >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgf83b20c" class = "outline-3" >
< h3 id = "orgf83b20c" > < span class = "section-number-3" > 3.2< / span > Electron-nucleus component< / h3 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-3" id = "text-3-2" >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org098092a" class = "outline-4" >
< h4 id = "org098092a" > < span class = "section-number-4" > 3.2.1< / span > Asymptotic component for< / h4 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-4" id = "text-3-2-1" >
< p >
2023-09-26 17:45:07 +02:00
Calculate the asymptotic component < code > asymp_jasa< / code > to be subtracted from the final
2023-03-30 12:35:59 +02:00
electron-nucleus jastrow factor \(J_{\text{eN}}\). The asymptotic component is calculated
via the < code > a_vector< / code > and the electron-nucleus rescale factors < code > rescale_factor_en< / code > .
< / p >
< p >
\[
2023-05-25 01:14:47 +02:00
J_{\text{en}}^{\infty \alpha} = -\frac{a_1 \kappa_\alpha^{-1}}{1 + a_2 \kappa_\alpha^{-1}}
2023-03-30 12:35:59 +02:00
\]
< / p >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org3772f05" class = "outline-5" >
< h5 id = "org3772f05" > < span class = "section-number-5" > 3.2.1.1< / span > Get< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-2-1-1" >
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #0000ff;" > qmckl_get_jastrow_champ_asymp_jasa< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > ,
2023-03-30 12:35:59 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > asymp_jasa< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > size_max< / span > );
< / pre >
< / div >
< / div >
< ol class = "org-ol" >
2024-02-23 11:17:59 +01:00
< li > < a id = "orgb9c99dc" > < / a > Fortran interface< br / >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-6" id = "text-3-2-1-1-1" >
< div class = "org-src-container" >
< pre class = "src src-f90" > < span style = "color: #a020f0;" > interface< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_asymp_jasa(context, < / span > < span style = "color: #a020f0;" > & < / span >
2023-03-30 12:35:59 +02:00
asymp_jasa, size_max) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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_max< / span >
2023-09-11 17:07:34 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ), < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > asymp_jasa(size_max)< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_asymp_jasa< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > end interface< / span >
< / pre >
< / div >
< / div >
< / li >
< / ol >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgcf8bd44" class = "outline-5" >
< h5 id = "orgcf8bd44" > < span class = "section-number-5" > 3.2.1.2< / span > Compute< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-2-1-2" >
2024-02-23 11:17:59 +01:00
< table id = "org7d33d2b" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2023-03-30 12:35:59 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Global state< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
< td class = "org-left" > < code > aord_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Order of the polynomial< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > type_nucl_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Number of nucleus types< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > a_vector< / code > < / td >
< td class = "org-left" > < code > double[type_nucl_num][aord_num+1]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Values of a< / td >
2022-09-28 18:04:21 +02:00
< / tr >
2022-11-17 19:27:17 +01:00
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > rescale_factor_en< / code > < / td >
2022-11-17 19:27:17 +01:00
< td class = "org-left" > < code > double[type_nucl_num]< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Electron nucleus distances< / td >
2022-11-17 19:27:17 +01:00
< / tr >
2022-09-28 18:04:21 +02:00
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > asymp_jasa< / code > < / td >
< td class = "org-left" > < code > double[type_nucl_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > out< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Asymptotic value< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
2023-03-30 17:09:05 +02:00
< pre class = "src src-f90" > < span style = "color: #228b22;" > integer< / span > < span style = "color: #a0522d;" > function qmckl_compute_jastrow_champ_asymp_jasa_f(context, aord_num, type_nucl_num, a_vector, < / span > < span style = "color: #a020f0;" > & < / span >
2023-03-30 12:35:59 +02:00
rescale_factor_en, asymp_jasa) < span style = "color: #a020f0;" > & < / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > context< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > aord_num< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > type_nucl_num< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > a_vector(aord_num + 1, type_nucl_num)< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > rescale_factor_en(type_nucl_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > asymp_jasa(type_nucl_num)< / span >
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, j, p< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > kappa_inv, x, asym_one< / span >
2022-09-28 18:04:21 +02:00
info = QMCKL_SUCCESS
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > if< / span > (aord_num < 0) < span style = "color: #a020f0;" > then< / span >
2023-03-30 12:35:59 +02:00
info = QMCKL_INVALID_ARG_2
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > do< / span > i=1,type_nucl_num
2022-09-28 18:04:21 +02:00
2023-03-30 12:35:59 +02:00
kappa_inv = 1.0d0 / rescale_factor_en(i)
2022-09-28 18:04:21 +02:00
2023-05-25 01:50:47 +02:00
asymp_jasa(i) = a_vector(1,i) * kappa_inv / (1.0d0 + a_vector(2,i) * kappa_inv)
2022-09-28 18:04:21 +02:00
2023-03-30 12:35:59 +02:00
x = kappa_inv
< span style = "color: #a020f0;" > do< / span > p = 2, aord_num
x = x * kappa_inv
2023-05-25 01:50:47 +02:00
asymp_jasa(i) = asymp_jasa(i) + a_vector(p+1, i) * x
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > end do< / span >
2023-03-30 12:35:59 +02:00
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > end do< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_asymp_jasa_f< / span >
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
2022-11-17 19:27:17 +01:00
< div class = "org-src-container" >
2023-03-30 17:09:05 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_asymp_jasa< / span > (
2022-11-17 19:27:17 +01:00
< 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;" > aord_num< / span > ,
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > type_nucl_num< / span > ,
2022-11-17 19:27:17 +01:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > a_vector< / span > ,
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > rescale_factor_en< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > asymp_jasa< / span > );
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgbaeada9" class = "outline-5" >
< h5 id = "orgbaeada9" > < span class = "section-number-5" > 3.2.1.3< / span > Test< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-2-1-3" >
2023-05-25 01:50:47 +02:00
< p >
double asymp< sub > jasa< / sub > [2];
rc = qmckl< sub > get< / sub > < sub > jastrow< / sub > < sub > champ< / sub > < sub > asymp< / sub > < sub > jasa< / sub > (context, asymp< sub > jasa< / sub > , type< sub > nucl< / sub > < sub > num< / sub > );
< / p >
2022-09-28 18:04:21 +02:00
2023-05-25 01:50:47 +02:00
< p >
// calculate asymp< sub > jasb< / sub >
printf("%e %e\n", asymp< sub > jasa< / sub > [0], -1.75529774);
assert(fabs(-1.75529774 - asymp< sub > jasa< / sub > [0]) < 1.e-8);
< / p >
2022-09-28 18:04:21 +02:00
2023-05-25 01:50:47 +02:00
< p >
#+end< sub > src< / sub >
< / p >
2022-09-28 18:04:21 +02:00
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org9f3c524" class = "outline-4" >
< h4 id = "org9f3c524" > < span class = "section-number-4" > 3.2.2< / span > Electron-nucleus component< / h4 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-4" id = "text-3-2-2" >
2022-09-28 18:04:21 +02:00
< p >
2023-03-30 12:35:59 +02:00
Calculate the electron-electron jastrow component < code > factor_en< / code > using the < code > a_vector< / code >
coeffecients and the electron-nucleus rescaled distances < code > en_distance_rescaled< / code > .
2022-09-28 18:04:21 +02:00
< / p >
< p >
2023-03-30 12:35:59 +02:00
\[
2023-05-25 01:14:47 +02:00
f_{\alpha}(R_{i\alpha}) = - \sum_{i,j< i } \ left [ \ frac { A_0 C_ { ij } } { 1 - A_1 C_ { ij } } + \ sum ^ { N ^ \ alpha_ { \ text { ord } } } _ { k } A_k C_ { ij } ^ k \ right ]
2023-03-30 12:35:59 +02:00
\]
2022-09-28 18:04:21 +02:00
< / p >
< / div >
2023-03-30 12:35:59 +02:00
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org9ab8579" class = "outline-5" >
< h5 id = "org9ab8579" > < span class = "section-number-5" > 3.2.2.1< / span > Get< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-2-2-1" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #0000ff;" > qmckl_get_jastrow_champ_factor_en< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > ,
2023-03-30 12:35:59 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > factor_en< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > size_max< / span > );
< / pre >
< / div >
< / div >
< ol class = "org-ol" >
2024-02-23 11:17:59 +01:00
< li > < a id = "orgcd0cedc" > < / a > Fortran interface< br / >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-6" id = "text-3-2-2-1-1" >
< div class = "org-src-container" >
< pre class = "src src-f90" > < span style = "color: #a020f0;" > interface< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_factor_en (context, < / span > < span style = "color: #a020f0;" > & < / span >
2023-03-30 12:35:59 +02:00
factor_en, size_max) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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_max< / span >
2023-09-11 17:07:34 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ), < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > factor_en(size_max)< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_factor_en< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > end interface< / span >
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
2023-03-30 12:35:59 +02:00
< / li >
< / ol >
2022-09-28 18:04:21 +02:00
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org620e254" class = "outline-5" >
< h5 id = "org620e254" > < span class = "section-number-5" > 3.2.2.2< / span > Compute< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-2-2-2" >
2024-02-23 11:17:59 +01:00
< table id = "orgfb98ab9" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
< td class = "org-left" > < code > walk_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of walkers< / td >
< / tr >
< tr >
< td class = "org-left" > < code > elec_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of electrons< / td >
< / tr >
< tr >
< td class = "org-left" > < code > nucl_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > Number of nuclei< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
< td class = "org-left" > < code > type_nucl_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of unique nuclei< / td >
< / tr >
< tr >
< td class = "org-left" > < code > type_nucl_vector< / code > < / td >
< td class = "org-left" > < code > int64_t[nucl_num]< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > IDs of unique nuclei< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
< td class = "org-left" > < code > aord_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of coefficients< / td >
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > a_vector< / code > < / td >
2023-09-25 18:04:55 +02:00
< td class = "org-left" > < code > double[type_nucl_num][aord_num+1]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
< td class = "org-left" > List of coefficients< / td >
< / tr >
< tr >
< td class = "org-left" > < code > en_distance_rescaled< / code > < / td >
< td class = "org-left" > < code > double[walk_num][nucl_num][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron-nucleus distances< / td >
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > asymp_jasa< / code > < / td >
< td class = "org-left" > < code > double[type_nucl_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Type of nuclei< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > factor_en< / code > < / td >
< td class = "org-left" > < code > double[walk_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > out< / td >
< td class = "org-left" > Electron-nucleus jastrow< / td >
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
2023-09-25 18:04:55 +02:00
< pre class = "src src-f90" > < span style = "color: #a020f0;" > function< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_en_doc< / span > ( < span style = "color: #a020f0;" > & < / span >
2022-09-28 18:04:21 +02:00
context, walk_num, elec_num, nucl_num, type_nucl_num, < span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
type_nucl_vector, aord_num, a_vector, < span style = "color: #a020f0;" > & < / span >
2023-03-30 12:35:59 +02:00
en_distance_rescaled, asymp_jasa, factor_en) < span style = "color: #a020f0;" > & < / span >
2023-09-25 18:04:55 +02:00
< span style = "color: #a020f0;" > bind< / span > (C) < span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > , < span style = "color: #a020f0;" > intrinsic< / span > :: < span style = "color: #0000ff;" > iso_c_binding< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
2023-09-25 18:04:55 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < 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;" > walk_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;" > elec_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;" > nucl_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;" > type_nucl_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;" > type_nucl_vector(nucl_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;" > aord_num< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > a_vector(aord_num+1,type_nucl_num)< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > en_distance_rescaled(elec_num,nucl_num,walk_num)< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > asymp_jasa(type_nucl_num)< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > factor_en(walk_num)< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code) ::< span style = "color: #a0522d;" > info< / span >
2022-09-28 18:04:21 +02:00
2023-03-30 12:35:59 +02:00
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, a, p, nw< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > x, power_ser< / span >
2022-09-28 18:04:21 +02:00
info = QMCKL_SUCCESS
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_3
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (nucl_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_4
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2023-03-31 19:23:08 +02:00
< span style = "color: #a020f0;" > if< / span > (type_nucl_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_4
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > if< / span > (aord_num < 0) < span style = "color: #a020f0;" > then< / span >
2022-09-28 18:04:21 +02:00
info = QMCKL_INVALID_ARG_7
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > do< / span > nw =1, walk_num
2023-03-30 12:35:59 +02:00
factor_en(nw) = 0.0d0
< span style = "color: #a020f0;" > do< / span > a = 1, nucl_num
< span style = "color: #a020f0;" > do< / span > i = 1, elec_num
x = en_distance_rescaled(i, a, nw)
2022-09-28 18:04:21 +02:00
2023-05-25 01:50:47 +02:00
factor_en(nw) = factor_en(nw) + a_vector(1, type_nucl_vector(a)+1) * x / < span style = "color: #a020f0;" > & < / span >
2023-05-25 01:14:47 +02:00
(1.0d0 + a_vector(2, type_nucl_vector(a)+1) * x) - asymp_jasa(type_nucl_vector(a)+1)
2022-09-28 18:04:21 +02:00
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > do< / span > p = 2, aord_num
x = x * en_distance_rescaled(i, a, nw)
2023-05-25 01:50:47 +02:00
factor_en(nw) = factor_en(nw) + a_vector(p + 1, type_nucl_vector(a)+1) * x
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > end do< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
2023-09-25 18:04:55 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_en_doc< / span >
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
2023-03-30 12:35:59 +02:00
< div class = "org-src-container" >
2023-03-31 15:12:07 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_en_doc< / span > (
2023-03-30 12:35:59 +02:00
< 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > nucl_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > type_nucl_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > * < span style = "color: #a0522d;" > type_nucl_vector< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > aord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > a_vector< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > en_distance_rescaled< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > asymp_jasa< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > factor_en< / span > );
< / pre >
< / div >
< div class = "org-src-container" >
2023-03-31 15:12:07 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_en< / 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > nucl_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > type_nucl_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > * < span style = "color: #a0522d;" > type_nucl_vector< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > aord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > a_vector< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > en_distance_rescaled< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > asymp_jasa< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > factor_en< / span > )
{
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_HPC
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_jastrow_champ_factor_en_hpc
2023-03-31 15:12:07 +02:00
< span style = "color: #483d8b;" > #else< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_jastrow_champ_factor_en_doc
2023-03-31 15:12:07 +02:00
< span style = "color: #483d8b;" > #endif< / span >
2023-09-21 13:04:54 +02:00
(context, walk_num, elec_num, nucl_num, type_nucl_num,
type_nucl_vector, aord_num, a_vector, en_distance_rescaled,
asymp_jasa, factor_en );
2023-03-31 15:12:07 +02:00
}
< / pre >
< / div >
< / div >
< / div >
2023-09-21 13:04:54 +02:00
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org1744d8c" class = "outline-5" >
< h5 id = "org1744d8c" > < span class = "section-number-5" > 3.2.2.3< / span > Test< / h5 >
2023-03-31 15:12:07 +02:00
< div class = "outline-text-5" id = "text-3-2-2-3" >
< div class = "org-src-container" >
< pre class = "src src-c" > /* < span style = "color: #b22222;" > Check if Jastrow is properly initialized< / span > */
< span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_jastrow_champ_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
2023-03-30 12:35:59 +02:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > factor_en< / span > [walk_num];
2023-03-30 17:09:05 +02:00
rc = qmckl_get_jastrow_champ_factor_en(context, factor_en,walk_num);
2023-03-30 12:35:59 +02:00
// < span style = "color: #b22222;" > calculate factor_en< / span >
2023-09-25 18:04:55 +02:00
printf(< span style = "color: #8b2252;" > "%f %f\n"< / span > , factor_en[0], 22.781375792083587);
2023-05-25 01:50:47 +02:00
< span style = "color: #0000ff;" > assert< / span > (fabs(22.781375792083587 - factor_en[0]) < 1.e-12);
2023-03-30 12:35:59 +02:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2022-09-28 18:04:21 +02:00
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgd415f3b" class = "outline-4" >
< h4 id = "orgd415f3b" > < span class = "section-number-4" > 3.2.3< / span > Derivative< / h4 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-4" id = "text-3-2-3" >
2022-09-28 18:04:21 +02:00
< p >
2023-05-25 01:14:47 +02:00
Calculate the electron-electron jastrow component < code > factor_en_gl< / code > derivative
2023-03-30 12:35:59 +02:00
with respect to the electron coordinates using the < code > en_distance_rescaled< / code > and
2023-05-25 01:14:47 +02:00
< code > en_distance_rescaled_gl< / code > which are already calculated previously.
2022-09-28 18:04:21 +02:00
< / p >
< p >
2023-03-30 12:35:59 +02:00
TODO: write equations.
2022-09-28 18:04:21 +02:00
< / p >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org0598461" class = "outline-5" >
< h5 id = "org0598461" > < span class = "section-number-5" > 3.2.3.1< / span > Get< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-2-3-1" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
2023-03-30 12:35:59 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > qmckl_get_jastrow_champ_factor_en_gl< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > factor_en_gl< / span > ,
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > size_max< / span > );
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
2023-05-25 01:14:47 +02:00
< ol class = "org-ol" >
2024-02-23 11:17:59 +01:00
< li > < a id = "org230f70c" > < / a > Fortran interface< br / >
2023-05-25 01:14:47 +02:00
< div class = "outline-text-6" id = "text-3-2-3-1-1" >
< div class = "org-src-container" >
< pre class = "src src-f90" > < span style = "color: #a020f0;" > interface< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_factor_en_gl (context, < / span > < span style = "color: #a020f0;" > & < / span >
factor_en_gl, size_max) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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_max< / span >
2023-09-11 17:07:34 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ), < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > factor_en_gl(size_max)< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_factor_en_gl< / span >
< span style = "color: #a020f0;" > end interface< / span >
< / pre >
< / div >
< / div >
< / li >
< / ol >
2022-09-28 18:04:21 +02:00
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org45f9dbc" class = "outline-5" >
< h5 id = "org45f9dbc" > < span class = "section-number-5" > 3.2.3.2< / span > Compute< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-2-3-2" >
2024-02-23 11:17:59 +01:00
< table id = "org21d9314" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
2023-03-30 12:35:59 +02:00
< tr >
< td class = "org-left" > < code > walk_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of walkers< / td >
< / tr >
2022-09-28 18:04:21 +02:00
< tr >
< td class = "org-left" > < code > elec_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of electrons< / td >
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > nucl_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > Number of nuclei< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > type_nucl_num< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Number of unique nuclei< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > type_nucl_vector< / code > < / td >
< td class = "org-left" > < code > int64_t[nucl_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > IDs of unique nuclei< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > aord_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of coefficients< / td >
< / tr >
< tr >
< td class = "org-left" > < code > a_vector< / code > < / td >
2023-09-25 18:04:55 +02:00
< td class = "org-left" > < code > double[type_nucl_num][aord_num+1]< / code > < / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > in< / td >
< td class = "org-left" > List of coefficients< / td >
< / tr >
< tr >
< td class = "org-left" > < code > en_distance_rescaled< / code > < / td >
< td class = "org-left" > < code > double[walk_num][nucl_num][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron-nucleus distances< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > en_distance_rescaled_gl< / code > < / td >
2023-09-25 18:04:55 +02:00
< td class = "org-left" > < code > double[walk_num][nucl_num][elec_num][4]< / code > < / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron-nucleus distance derivatives< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > factor_en_gl< / code > < / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > double[walk_num][4][elec_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > out< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Electron-nucleus jastrow< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
2023-09-25 18:04:55 +02:00
< pre class = "src src-f90" > < span style = "color: #a020f0;" > function< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_en_gl_doc< / span > ( < span style = "color: #a020f0;" > & < / span >
2023-03-30 12:35:59 +02:00
context, walk_num, elec_num, nucl_num, type_nucl_num, < span style = "color: #a020f0;" > & < / span >
type_nucl_vector, aord_num, a_vector, < span style = "color: #a020f0;" > & < / span >
2023-05-25 01:14:47 +02:00
en_distance_rescaled, en_distance_rescaled_gl, factor_en_gl) < span style = "color: #a020f0;" > & < / span >
2023-09-25 18:04:55 +02:00
< span style = "color: #a020f0;" > bind< / span > (C) < span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > , < span style = "color: #a020f0;" > intrinsic< / span > :: < span style = "color: #0000ff;" > iso_c_binding< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
2023-09-25 18:04:55 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < 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;" > walk_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;" > elec_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;" > nucl_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;" > type_nucl_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;" > type_nucl_vector(nucl_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;" > aord_num< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > a_vector(aord_num+1,type_nucl_num)< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > en_distance_rescaled(elec_num,nucl_num,walk_num)< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > en_distance_rescaled_gl(4, elec_num,nucl_num,walk_num)< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > factor_en_gl(elec_num,4,walk_num)< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code) ::< span style = "color: #a0522d;" > info< / span >
2022-09-28 18:04:21 +02:00
2023-09-21 13:04:54 +02:00
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, a, k, nw, ii< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > x, x1, kf< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > denom, invdenom, invdenom2, f< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > grad_c2< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > dx(4)< / span >
2022-09-28 18:04:21 +02:00
info = QMCKL_SUCCESS
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) < span style = "color: #a020f0;" > then< / span >
2022-09-28 18:04:21 +02:00
info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) < span style = "color: #a020f0;" > then< / span >
2022-09-28 18:04:21 +02:00
info = QMCKL_INVALID_ARG_3
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > if< / span > (nucl_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_4
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2022-09-28 18:04:21 +02:00
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > if< / span > (aord_num < 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_7
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2022-09-28 18:04:21 +02:00
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > do< / span > nw =1, walk_num
2023-09-21 13:04:54 +02:00
factor_en_gl(:,:,nw) = 0.0d0
< span style = "color: #a020f0;" > do< / span > a = 1, nucl_num
< span style = "color: #a020f0;" > do< / span > i = 1, elec_num
2022-09-28 18:04:21 +02:00
2023-09-21 13:04:54 +02:00
x = en_distance_rescaled(i,a,nw)
< span style = "color: #a020f0;" > if< / span > (< span style = "color: #a020f0;" > abs< / span > (x) < 1.d-12) < span style = "color: #a020f0;" > continue< / span >
2022-09-28 18:04:21 +02:00
2023-09-21 13:04:54 +02:00
denom = 1.0d0 + a_vector(2, type_nucl_vector(a)+1) * x
invdenom = 1.0d0 / denom
invdenom2 = invdenom*invdenom
2022-09-28 18:04:21 +02:00
2023-09-21 13:04:54 +02:00
dx(1) = en_distance_rescaled_gl(1,i,a,nw)
dx(2) = en_distance_rescaled_gl(2,i,a,nw)
dx(3) = en_distance_rescaled_gl(3,i,a,nw)
dx(4) = en_distance_rescaled_gl(4,i,a,nw)
2022-09-28 18:04:21 +02:00
2023-09-21 13:04:54 +02:00
f = a_vector(1, type_nucl_vector(a)+1) * invdenom2
grad_c2 = dx(1)*dx(1) + dx(2)*dx(2) + dx(3)*dx(3)
2022-09-28 18:04:21 +02:00
2023-09-21 13:04:54 +02:00
factor_en_gl(i,1,nw) = factor_en_gl(i,1,nw) + f * dx(1)
factor_en_gl(i,2,nw) = factor_en_gl(i,2,nw) + f * dx(2)
factor_en_gl(i,3,nw) = factor_en_gl(i,3,nw) + f * dx(3)
factor_en_gl(i,4,nw) = factor_en_gl(i,4,nw) < span style = "color: #a020f0;" > & < / span >
+ f * (dx(4) - 2.d0 * a_vector(2, type_nucl_vector(a)+1) * grad_c2 * invdenom)
2022-09-28 18:04:21 +02:00
2023-09-21 13:04:54 +02:00
kf = 2.d0
x1 = x
x = 1.d0
< span style = "color: #a020f0;" > do< / span > k=2, aord_num
f = a_vector(k+1,type_nucl_vector(a)+1) * kf * x
factor_en_gl(i,1,nw) = factor_en_gl(i,1,nw) + f * x1 * dx(1)
factor_en_gl(i,2,nw) = factor_en_gl(i,2,nw) + f * x1 * dx(2)
factor_en_gl(i,3,nw) = factor_en_gl(i,3,nw) + f * x1 * dx(3)
factor_en_gl(i,4,nw) = factor_en_gl(i,4,nw) < span style = "color: #a020f0;" > & < / span >
+ f * (x1 * dx(4) + (kf-1.d0) * grad_c2)
x = x*x1
kf = kf + 1.d0
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
2023-09-25 18:04:55 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_en_gl_doc< / span >
2023-03-30 12:35:59 +02:00
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org32264bc" class = "outline-5" >
< h5 id = "org32264bc" > < span class = "section-number-5" > 3.2.3.3< / span > Test< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-2-3-3" >
< div class = "org-src-container" >
< pre class = "src src-c" > /* < span style = "color: #b22222;" > Check if Jastrow is properly initialized< / span > */
2023-03-30 17:09:05 +02:00
< span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_jastrow_champ_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
2023-03-30 12:35:59 +02:00
2023-05-25 01:14:47 +02:00
// < span style = "color: #b22222;" > calculate factor_en_gl< / span >
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > factor_en_gl< / span > [walk_num][4][elec_num];
rc = qmckl_get_jastrow_champ_factor_en_gl(context, & (factor_en_gl[0][0][0]),walk_num*4*elec_num);
2023-03-30 12:35:59 +02:00
2023-05-25 01:14:47 +02:00
// < span style = "color: #b22222;" > check factor_en_gl< / span >
2023-05-25 01:50:47 +02:00
< span style = "color: #0000ff;" > assert< / span > (fabs( 0.19656663796630847 - factor_en_gl[0][0][0]) < 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs( -0.3945140890522283 - factor_en_gl[0][1][0]) < 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs( 0.5082964671286118 - factor_en_gl[0][2][0]) < 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs( -1.8409460670666289 - factor_en_gl[0][3][0]) < 1.e-12);
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org59434c0" class = "outline-4" >
< h4 id = "org59434c0" > < span class = "section-number-4" > 3.2.4< / span > Electron-nucleus rescaled distances< / h4 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-4" id = "text-3-2-4" >
< p >
< code > en_distance_rescaled< / code > stores the matrix of the rescaled distances between
electrons and nuclei.
< / p >
< p >
\[
C_{i\alpha} = \frac{ 1 - e^{-\kappa_\alpha R_{i\alpha}}}{\kappa_\alpha}
\]
< / p >
2022-09-28 18:04:21 +02:00
< p >
2023-03-30 12:35:59 +02:00
where \(R_{i\alpha}\) is the matrix of electron-nucleus distances.
2022-09-28 18:04:21 +02:00
< / p >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org92607ec" class = "outline-5" >
< h5 id = "org92607ec" > < span class = "section-number-5" > 3.2.4.1< / span > Get< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-2-4-1" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
2023-03-30 12:35:59 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_get_electron_en_distance_rescaled< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > , < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > distance_rescaled< / span > );
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
2023-03-30 12:35:59 +02:00
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org9afe12d" class = "outline-5" >
< h5 id = "org9afe12d" > < span class = "section-number-5" > 3.2.4.2< / span > Compute< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-2-4-2" >
2024-02-23 11:17:59 +01:00
< table id = "orge0196db" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
< td class = "org-left" > < code > elec_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of electrons< / td >
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > nucl_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Number of nuclei< / td >
< / tr >
< tr >
< td class = "org-left" > < code > type_nucl_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of types of nuclei< / td >
< / tr >
< tr >
< td class = "org-left" > < code > type_nucl_vector< / code > < / td >
< td class = "org-left" > < code > int64_t[nucl_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of types of nuclei< / td >
< / tr >
< tr >
< td class = "org-left" > < code > rescale_factor_en< / code > < / td >
< td class = "org-left" > < code > double[type_nucl_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > The factor for rescaled distances< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
< td class = "org-left" > < code > walk_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of walkers< / td >
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > elec_coord< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > double[3][walk_num][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron coordinates< / td >
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > nucl_coord< / code > < / td >
< td class = "org-left" > < code > double[3][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Nuclear coordinates< / td >
< / tr >
< tr >
< td class = "org-left" > < code > en_distance_rescaled< / code > < / td >
< td class = "org-left" > < code > double[walk_num][nucl_num][elec_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > out< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Electron-nucleus distances< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
2023-09-25 18:04:55 +02:00
< pre class = "src src-f90" > < span style = "color: #a020f0;" > function< / span > < span style = "color: #0000ff;" > qmckl_compute_en_distance_rescaled_doc< / span > (context, < span style = "color: #a020f0;" > & < / span >
elec_num, nucl_num, type_nucl_num, < span style = "color: #a020f0;" > & < / span >
2023-03-30 12:35:59 +02:00
type_nucl_vector, rescale_factor_en, walk_num, elec_coord, < span style = "color: #a020f0;" > & < / span >
nucl_coord, en_distance_rescaled) < span style = "color: #a020f0;" > & < / span >
2023-09-25 18:04:55 +02:00
< span style = "color: #a020f0;" > bind< / span > (C) < span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > , < span style = "color: #a020f0;" > intrinsic< / span > :: < span style = "color: #0000ff;" > iso_c_binding< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
2023-09-25 18:04:55 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < 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;" > elec_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;" > nucl_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;" > type_nucl_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;" > type_nucl_vector(nucl_num)< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > rescale_factor_en(type_nucl_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;" > walk_num< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > elec_coord(elec_num,walk_num,3)< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > nucl_coord(nucl_num,3)< / span >
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ) , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > en_distance_rescaled(elec_num,nucl_num,walk_num)< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code) ::< span style = "color: #a0522d;" > info< / span >
2022-09-28 18:04:21 +02:00
2023-03-30 12:35:59 +02:00
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, k< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > coord(3)< / span >
2022-09-28 18:04:21 +02:00
info = QMCKL_SUCCESS
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > if< / span > (nucl_num < = 0) < span style = "color: #a020f0;" > then< / span >
2022-09-28 18:04:21 +02:00
info = QMCKL_INVALID_ARG_3
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_5
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > do< / span > i=1, nucl_num
coord(1:3) = nucl_coord(i,1:3)
< span style = "color: #a020f0;" > do< / span > k=1,walk_num
2023-05-25 01:14:47 +02:00
info = qmckl_distance_rescaled(context, < span style = "color: #8b2252;" > 'T'< / span > , < span style = "color: #8b2252;" > 'N'< / span > , elec_num, 1_8, < span style = "color: #a020f0;" > & < / span >
elec_coord(1,k,1), elec_num*walk_num, coord, 3_8, < span style = "color: #a020f0;" > & < / span >
en_distance_rescaled(1,i,k), elec_num, rescale_factor_en(type_nucl_vector(i)+1))
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > if< / span > (info /= QMCKL_SUCCESS) < span style = "color: #a020f0;" > then< / span >
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > end do< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > end do< / span >
2023-09-25 18:04:55 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_en_distance_rescaled_doc< / span >
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgc6cdb88" class = "outline-5" >
< h5 id = "orgc6cdb88" > < span class = "section-number-5" > 3.2.4.3< / span > Test< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-2-4-3" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
2023-03-30 12:35:59 +02:00
< pre class = "src src-c" >
< span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_electron_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
< span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_nucleus_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
2022-09-28 18:04:21 +02:00
2023-03-30 12:35:59 +02:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > en_distance_rescaled< / span > [walk_num][nucl_num][elec_num];
2022-09-28 18:04:21 +02:00
2023-03-30 12:35:59 +02:00
rc = qmckl_check(context,
qmckl_get_electron_en_distance_rescaled(context, & (en_distance_rescaled[0][0][0]))
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
2022-09-28 18:04:21 +02:00
2023-03-30 12:35:59 +02:00
// < span style = "color: #b22222;" > (e,n,w) in Fortran notation< / span >
// < span style = "color: #b22222;" > (1,1,1)< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > en_distance_rescaled< / span > [0][0][0] - 0.4942158656729477) < 1.e-12);
2023-03-30 12:35:59 +02:00
// < span style = "color: #b22222;" > (1,2,1)< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > en_distance_rescaled< / span > [0][1][0] - 1.2464137498005765) < 1.e-12);
2023-03-30 12:35:59 +02:00
// < span style = "color: #b22222;" > (2,1,1)< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > en_distance_rescaled< / span > [0][0][1] - 0.5248654474756858) < 1.e-12);
2023-03-30 12:35:59 +02:00
// < span style = "color: #b22222;" > (1,1,2)< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > en_distance_rescaled< / span > [0][0][5] - 0.19529459944794733) < 1.e-12);
2023-03-30 12:35:59 +02:00
// < span style = "color: #b22222;" > (1,2,2)< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > en_distance_rescaled< / span > [0][1][5] - 1.2091967687767369) < 1.e-12);
2023-03-30 12:35:59 +02:00
// < span style = "color: #b22222;" > (2,1,2)< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > en_distance_rescaled< / span > [0][0][6] - 0.4726452953409436) < 1.e-12);
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org50a9d9c" class = "outline-4" >
< h4 id = "org50a9d9c" > < span class = "section-number-4" > 3.2.5< / span > Electron-electron rescaled distance gradients and Laplacian with respect to electron coordinates< / h4 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-4" id = "text-3-2-5" >
2022-09-28 18:04:21 +02:00
< p >
2023-03-30 12:35:59 +02:00
The rescaled distances, represented by \(C_{i\alpha} = (1 - e^{-\kappa_\alpha R_{i\alpha}})/\kappa\)
are differentiated with respect to the electron coordinates.
This information is stored in the tensor
2023-05-25 01:14:47 +02:00
< code > en_distance_rescaled_gl< / code > . The initial three sequential
2023-03-30 12:35:59 +02:00
elements of this three-index tensor provide the \(x\), \(y\), and \(z\)
direction derivatives, while the fourth index corresponds to the Laplacian.
2022-09-28 18:04:21 +02:00
< / p >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgeeb8d31" class = "outline-5" >
< h5 id = "orgeeb8d31" > < span class = "section-number-5" > 3.2.5.1< / span > Get< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-2-5-1" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
2023-05-25 01:14:47 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_get_electron_en_distance_rescaled_gl< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > , < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > distance_rescaled_gl< / span > );
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org96e6ec8" class = "outline-5" >
< h5 id = "org96e6ec8" > < span class = "section-number-5" > 3.2.5.2< / span > Compute< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-2-5-2" >
2024-02-23 11:17:59 +01:00
< table id = "orge974b4c" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > elec_num< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Number of electrons< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > nucl_num< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Number of nuclei< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > type_nucl_num< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Number of nucleus types< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > type_nucl_vector< / code > < / td >
< td class = "org-left" > < code > int64_t[nucl_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Array of nucleus types< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > rescale_factor_en< / code > < / td >
< td class = "org-left" > < code > double[nucl_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > The factors for rescaled distances< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > walk_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of walkers< / td >
< / tr >
< tr >
< td class = "org-left" > < code > elec_coord< / code > < / td >
< td class = "org-left" > < code > double[3][walk_num][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron coordinates< / td >
< / tr >
< tr >
< td class = "org-left" > < code > nucl_coord< / code > < / td >
< td class = "org-left" > < code > double[3][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Nuclear coordinates< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > en_distance_rescaled_gl< / code > < / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > double[walk_num][nucl_num][elec_num][4]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > out< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Electron-nucleus distance derivatives< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
2023-09-21 13:04:54 +02:00
< pre class = "src src-f90" > < span style = "color: #228b22;" > integer< / span > < span style = "color: #a0522d;" > function qmckl_compute_en_distance_rescaled_gl_doc_f(context, elec_num, nucl_num, < / span > < span style = "color: #a020f0;" > & < / span >
2023-03-30 12:35:59 +02:00
type_nucl_num, type_nucl_vector, rescale_factor_en, walk_num, elec_coord, < span style = "color: #a020f0;" > & < / span >
2023-05-25 01:14:47 +02:00
nucl_coord, en_distance_rescaled_gl) < span style = "color: #a020f0;" > & < / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < 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;" > elec_num< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > nucl_num< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > type_nucl_num< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > type_nucl_vector(nucl_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > rescale_factor_en(nucl_num)< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > walk_num< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > elec_coord(elec_num,walk_num,3)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > nucl_coord(nucl_num,3)< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > en_distance_rescaled_gl(4,elec_num,nucl_num,walk_num)< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, k< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > coord(3)< / span >
info = QMCKL_SUCCESS
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (nucl_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_3
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_5
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > do< / span > i=1, nucl_num
coord(1:3) = nucl_coord(i,1:3)
< span style = "color: #a020f0;" > do< / span > k=1,walk_num
2023-05-25 01:14:47 +02:00
info = qmckl_distance_rescaled_gl(context, < span style = "color: #8b2252;" > 'T'< / span > , < span style = "color: #8b2252;" > 'T'< / span > , elec_num, 1_8, < span style = "color: #a020f0;" > & < / span >
2023-03-30 12:35:59 +02:00
elec_coord(1,k,1), elec_num*walk_num, coord, 1_8, < span style = "color: #a020f0;" > & < / span >
2023-05-25 01:14:47 +02:00
en_distance_rescaled_gl(1,1,i,k), elec_num, rescale_factor_en(type_nucl_vector(i)+1))
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > if< / span > (info /= QMCKL_SUCCESS) < span style = "color: #a020f0;" > then< / span >
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_en_distance_rescaled_gl_doc_f< / span >
2023-03-30 12:35:59 +02:00
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org803fb75" class = "outline-5" >
< h5 id = "org803fb75" > < span class = "section-number-5" > 3.2.5.3< / span > Test< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-2-5-3" >
< div class = "org-src-container" >
< pre class = "src src-c" >
< span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_electron_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
< span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_nucleus_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > en_distance_rescaled_gl< / span > [walk_num][4][nucl_num][elec_num];
2023-03-30 12:35:59 +02:00
rc = qmckl_check(context,
2023-05-25 01:14:47 +02:00
qmckl_get_electron_en_distance_rescaled_gl(context, & (en_distance_rescaled_gl[0][0][0][0]))
2023-03-30 12:35:59 +02:00
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
// < span style = "color: #b22222;" > TODO: check exact values< / span >
//// < span style = "color: #b22222;" > (e,n,w) in Fortran notation< / span >
//// < span style = "color: #b22222;" > (1,1,1)< / span >
//< span style = "color: #b22222;" > assert(fabs(en_distance_rescaled[0][0][0] - 7.546738741619978) < 1.e-12);< / span >
//
//// < span style = "color: #b22222;" > (1,2,1)< / span >
//< span style = "color: #b22222;" > assert(fabs(en_distance_rescaled[0][1][0] - 8.77102435246984) < 1.e-12);< / span >
//
//// < span style = "color: #b22222;" > (2,1,1)< / span >
//< span style = "color: #b22222;" > assert(fabs(en_distance_rescaled[0][0][1] - 3.698922010513608) < 1.e-12);< / span >
//
//// < span style = "color: #b22222;" > (1,1,2)< / span >
//< span style = "color: #b22222;" > assert(fabs(en_distance_rescaled[1][0][0] - 5.824059436060509) < 1.e-12);< / span >
//
//// < span style = "color: #b22222;" > (1,2,2)< / span >
//< span style = "color: #b22222;" > assert(fabs(en_distance_rescaled[1][1][0] - 7.080482110317645) < 1.e-12);< / span >
//
//// < span style = "color: #b22222;" > (2,1,2)< / span >
//< span style = "color: #b22222;" > assert(fabs(en_distance_rescaled[1][0][1] - 3.1804527583077356) < 1.e-12);< / span >
< / pre >
< / div >
< / div >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org1428d73" class = "outline-3" >
< h3 id = "org1428d73" > < span class = "section-number-3" > 3.3< / span > Electron-electron-nucleus component< / h3 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-3" id = "text-3-3" >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgcb33582" class = "outline-4" >
< h4 id = "orgcb33582" > < span class = "section-number-4" > 3.3.1< / span > Electron-electron rescaled distances in \(J_\text{eeN}\)< / h4 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-4" id = "text-3-3-1" >
< p >
< code > een_rescaled_e< / code > stores the table of the rescaled distances between all
pairs of electrons and raised to the power \(p\) defined by < code > cord_num< / code > :
< / p >
< p >
\[
C_{ij,p} = \left[ \exp\left(-\kappa_\text{e}\, r_{ij}\right) \right]^p
\]
< / p >
< p >
where \(r_{ij}\) is the matrix of electron-electron distances.
< / p >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgfbb2f76" class = "outline-5" >
< h5 id = "orgfbb2f76" > < span class = "section-number-5" > 3.3.1.1< / span > Get< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-1-1" >
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #0000ff;" > qmckl_get_jastrow_champ_een_rescaled_e< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > ,
2023-03-30 12:35:59 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > distance_rescaled< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > size_max< / span > );
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgf77a739" class = "outline-5" >
< h5 id = "orgf77a739" > < span class = "section-number-5" > 3.3.1.2< / span > Compute< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-1-2" >
2024-02-23 11:17:59 +01:00
< table id = "orgc64c1d1" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2023-03-30 12:35:59 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
< td class = "org-left" > < code > walk_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of walkers< / td >
< / tr >
< tr >
< td class = "org-left" > < code > elec_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of electrons< / td >
< / tr >
< tr >
< td class = "org-left" > < code > cord_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Order of polynomials< / td >
< / tr >
< tr >
< td class = "org-left" > < code > rescale_factor_ee< / code > < / td >
< td class = "org-left" > < code > double< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Factor to rescale ee distances< / td >
< / tr >
< tr >
< td class = "org-left" > < code > ee_distance< / code > < / td >
< td class = "org-left" > < code > double[walk_num][elec_num][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-30 17:09:05 +02:00
< td class = "org-left" > Electron-electron distances for each walker< / td >
2023-03-30 12:35:59 +02:00
< / tr >
< tr >
< td class = "org-left" > < code > een_rescaled_e< / code > < / td >
< td class = "org-left" > < code > double[walk_num][0:cord_num][elec_num][elec_num]< / code > < / td >
< td class = "org-left" > out< / td >
2023-03-30 17:09:05 +02:00
< td class = "org-left" > Electron-electron rescaled distances for each walker< / td >
2023-03-30 12:35:59 +02:00
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
< pre class = "src src-f90" > < span style = "color: #228b22;" > integer< / span > < span style = "color: #a0522d;" > function qmckl_compute_een_rescaled_e_doc_f( < / span > < span style = "color: #a020f0;" > & < / span >
context, walk_num, elec_num, cord_num, rescale_factor_ee, < span style = "color: #a020f0;" > & < / span >
2022-09-28 18:04:21 +02:00
ee_distance, een_rescaled_e) < span style = "color: #a020f0;" > & < / span >
< span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < 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;" > walk_num< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > elec_num< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > cord_num< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > rescale_factor_ee< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > ee_distance(elec_num,elec_num,walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > een_rescaled_e(elec_num,elec_num,0:cord_num,walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > ,< span style = "color: #a020f0;" > dimension< / span > (:,:),< span style = "color: #a020f0;" > allocatable< / span > ::< span style = "color: #a0522d;" > een_rescaled_e_ij< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > x< / span >
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, j, k, l, nw< / span >
info = QMCKL_SUCCESS
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_3
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > if< / span > (cord_num < 0) < span style = "color: #a020f0;" > then< / span >
2022-09-28 18:04:21 +02:00
info = QMCKL_INVALID_ARG_4
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2023-01-26 18:46:39 +01:00
< span style = "color: #a020f0;" > allocate< / span > (een_rescaled_e_ij(elec_num * (elec_num - 1) / 2, cord_num + 1))
2022-09-28 18:04:21 +02:00
! < span style = "color: #b22222;" > Prepare table of exponentiated distances raised to appropriate power< / span >
< span style = "color: #a020f0;" > do< / span > nw = 1, walk_num
2023-04-11 19:18:24 +02:00
een_rescaled_e_ij(:, 1) = 1.0d0
2022-09-28 18:04:21 +02:00
2023-04-11 19:18:24 +02:00
k = 0
< span style = "color: #a020f0;" > do< / span > j = 1, elec_num
< span style = "color: #a020f0;" > do< / span > i = 1, j - 1
k = k + 1
een_rescaled_e_ij(k, 2) = dexp(-rescale_factor_ee * ee_distance(i, j, nw))
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
2022-09-28 18:04:21 +02:00
2023-04-11 19:18:24 +02:00
< span style = "color: #a020f0;" > do< / span > l = 2, cord_num
< span style = "color: #a020f0;" > do< / span > k = 1, elec_num * (elec_num - 1)/2
een_rescaled_e_ij(k, l + 1) = een_rescaled_e_ij(k, l) * een_rescaled_e_ij(k, 2)
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
2022-09-28 18:04:21 +02:00
2023-04-11 19:18:24 +02:00
! < span style = "color: #b22222;" > prepare the actual een table< / span >
een_rescaled_e(:, :, 0, nw) = 1.0d0
2022-09-28 18:04:21 +02:00
2023-04-11 19:18:24 +02:00
< span style = "color: #a020f0;" > do< / span > l = 1, cord_num
k = 0
< span style = "color: #a020f0;" > do< / span > j = 1, elec_num
< span style = "color: #a020f0;" > do< / span > i = 1, j - 1
k = k + 1
x = een_rescaled_e_ij(k, l + 1)
een_rescaled_e(i, j, l, nw) = x
een_rescaled_e(j, i, l, nw) = x
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
2022-09-28 18:04:21 +02:00
2023-04-11 19:18:24 +02:00
< span style = "color: #a020f0;" > do< / span > l = 0, cord_num
< span style = "color: #a020f0;" > do< / span > j = 1, elec_num
een_rescaled_e(j, j, l, nw) = 0.0d0
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_een_rescaled_e_doc_f< / span >
< / pre >
< / div >
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_een_rescaled_e_hpc< / span > (
2023-03-31 20:00:06 +02:00
< 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > cord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > rescale_factor_ee< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > ee_distance< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > een_rescaled_e< / span > ) {
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) {
2023-03-31 20:00:06 +02:00
< span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_CONTEXT;
2022-09-28 18:04:21 +02:00
}
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) {
2023-03-31 20:00:06 +02:00
< span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_2;
2022-09-28 18:04:21 +02:00
}
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) {
2023-03-31 20:00:06 +02:00
< span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_3;
2022-09-28 18:04:21 +02:00
}
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > if< / span > (cord_num < 0) {
2023-03-31 20:00:06 +02:00
< span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_4;
2022-09-28 18:04:21 +02:00
}
// < span style = "color: #b22222;" > Prepare table of exponentiated distances raised to appropriate power< / span >
// < span style = "color: #b22222;" > init< / span >
2023-04-11 19:18:24 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > size_t< / span > < span style = "color: #a0522d;" > elec_pairs< / span > = (< span style = "color: #228b22;" > size_t< / span > ) (elec_num * (elec_num - 1)) / 2;
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > size_t< / span > < span style = "color: #a0522d;" > len_een_ij< / span > = (< span style = "color: #228b22;" > size_t< / span > ) elec_pairs * (cord_num + 1);
2023-01-26 18:46:39 +01:00
// < span style = "color: #b22222;" > number of elements for the een_rescaled_e_ij[N_e*(N_e-1)/2][cord+1]< / span >
// < span style = "color: #b22222;" > probably in C is better [cord+1, Ne*(Ne-1)/2]< / span >
// < span style = "color: #b22222;" > elec_pairs = (elec_num * (elec_num - 1)) / 2;< / span >
// < span style = "color: #b22222;" > len_een_ij = elec_pairs * (cord_num + 1);< / span >
2023-04-11 19:18:24 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > size_t< / span > < span style = "color: #a0522d;" > e2< / span > = elec_num*elec_num;
2022-09-28 18:04:21 +02:00
2023-03-31 20:00:06 +02:00
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_OPENMP
2024-02-14 11:27:26 +01:00
< span style = "color: #483d8b;" > #pragma< / span > omp parallel
2023-03-31 20:00:06 +02:00
< span style = "color: #483d8b;" > #endif< / span >
2024-02-14 11:27:26 +01:00
{
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > een_rescaled_e_ij< / span > = calloc(len_een_ij,< span style = "color: #a020f0;" > sizeof< / span > (< span style = "color: #228b22;" > double< / span > ));
2022-09-28 18:04:21 +02:00
2023-04-11 19:18:24 +02:00
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > size_t< / span > < span style = "color: #a0522d;" > kk< / span > = 0; kk < elec_pairs ; ++kk) {
een_rescaled_e_ij[kk]= 1.0;
2022-09-28 18:04:21 +02:00
}
2024-02-14 11:27:26 +01:00
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_OPENMP
< span style = "color: #483d8b;" > #pragma< / span > omp < span style = "color: #a020f0;" > for< / span >
< span style = "color: #483d8b;" > #endif< / span >
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > size_t< / span > < span style = "color: #a0522d;" > nw< / span > = 0; nw < (< span style = "color: #228b22;" > size_t< / span > ) walk_num; ++nw) {
2023-04-11 19:18:24 +02:00
< span style = "color: #228b22;" > size_t< / span > < span style = "color: #a0522d;" > kk< / span > = 0;
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > size_t< / span > < span style = "color: #a0522d;" > i< / span > = 0; i < (< span style = "color: #228b22;" > size_t< / span > ) elec_num; ++i) {
2024-02-13 17:23:15 +01:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > ee1< / span > = & een_rescaled_e_ij[kk + elec_pairs];
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > ee2< / span > = & ee_distance[i*elec_num + nw*e2];
2023-04-11 19:18:24 +02:00
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_OPENMP
< span style = "color: #483d8b;" > #pragma< / span > omp simd
< span style = "color: #483d8b;" > #endif< / span >
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > size_t< / span > < span style = "color: #a0522d;" > j< / span > = 0; j < i; ++j) {
2024-02-13 17:23:15 +01:00
// < span style = "color: #b22222;" > een_rescaled_e_ij[j + kk + elec_pairs] = -rescale_factor_ee * ee_distance[j + i*elec_num + nw*e2];< / span >
ee1[j] = -rescale_factor_ee * ee2[j];
2022-09-28 18:04:21 +02:00
}
2023-04-11 19:18:24 +02:00
kk += i;
}
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_OPENMP
< span style = "color: #483d8b;" > #pragma< / span > omp simd
< span style = "color: #483d8b;" > #endif< / span >
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > size_t< / span > < span style = "color: #a0522d;" > k< / span > = elec_pairs; k < 2*elec_pairs; ++k) {
een_rescaled_e_ij[k] = exp(een_rescaled_e_ij[k]);
2022-09-28 18:04:21 +02:00
}
2024-02-13 17:23:15 +01:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > ee3< / span > = & een_rescaled_e_ij[elec_pairs];
2023-04-11 19:18:24 +02:00
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > size_t< / span > < span style = "color: #a0522d;" > l< / span > = 2; l < (< span style = "color: #228b22;" > size_t< / span > ) (cord_num+1); ++l) {
2024-02-13 17:23:15 +01:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > ee1< / span > = & een_rescaled_e_ij[l*elec_pairs];
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > ee2< / span > = & een_rescaled_e_ij[(l-1)*elec_pairs];
2024-02-21 00:02:22 +01:00
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_OPENMP
< span style = "color: #483d8b;" > #pragma< / span > omp simd
< span style = "color: #483d8b;" > #endif< / span >
2023-04-11 19:18:24 +02:00
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > size_t< / span > < span style = "color: #a0522d;" > k< / span > = 0; k < elec_pairs; ++k) {
2023-03-31 20:00:06 +02:00
// < span style = "color: #b22222;" > een_rescaled_e_ij(k, l + 1) = een_rescaled_e_ij(k, l + 1 - 1) * een_rescaled_e_ij(k, 2)< / span >
2024-02-13 17:23:15 +01:00
2024-02-14 11:00:41 +01:00
// < span style = "color: #b22222;" > een_rescaled_e_ij[k+l*elec_pairs] = een_rescaled_e_ij[k + (l - 1)*elec_pairs] *< / span >
2024-02-13 17:23:15 +01:00
// < span style = "color: #b22222;" > een_rescaled_e_ij[k + elec_pairs];< / span >
ee1[k] = ee2[k] * ee3[k];
2022-09-28 18:04:21 +02:00
}
}
2024-02-21 00:02:22 +01:00
2024-02-13 17:23:15 +01:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > een_rescaled_e_< / span > = & (een_rescaled_e[nw*(cord_num+1)*e2]);
2024-02-21 00:02:22 +01:00
2023-03-31 20:00:06 +02:00
// < span style = "color: #b22222;" > prepare the actual een table< / span >
2023-04-11 19:18:24 +02:00
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_OPENMP
2023-05-26 09:53:50 +02:00
< span style = "color: #483d8b;" > #pragma< / span > omp simd
2023-04-11 19:18:24 +02:00
< span style = "color: #483d8b;" > #endif< / span >
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > size_t< / span > < span style = "color: #a0522d;" > i< / span > = 0; i < e2; ++i){
een_rescaled_e_[i] = 1.0;
2022-09-28 18:04:21 +02:00
}
2023-04-11 19:18:24 +02:00
< span style = "color: #a020f0;" > for< / span > ( < span style = "color: #228b22;" > size_t< / span > < span style = "color: #a0522d;" > l< / span > = 1; l < (< span style = "color: #228b22;" > size_t< / span > ) (cord_num+1); ++l) {
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > x< / span > = een_rescaled_e_ij + l*elec_pairs;
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > een_rescaled_e__< / span > = & (een_rescaled_e_[l*e2]);
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > een_rescaled_e_i< / span > = een_rescaled_e__;
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > size_t< / span > < span style = "color: #a0522d;" > i< / span > = 0; i < (< span style = "color: #228b22;" > size_t< / span > ) elec_num; ++i) {
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > size_t< / span > < span style = "color: #a0522d;" > j< / span > = 0; j < i; ++j) {
een_rescaled_e_i[j] = *x;
een_rescaled_e__[i + j*elec_num] = *x;
x += 1;
2023-03-31 20:00:06 +02:00
}
2023-04-11 19:18:24 +02:00
een_rescaled_e_i += elec_num;
2022-09-28 18:04:21 +02:00
}
}
2023-04-11 19:18:24 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > x0< / span > = & (een_rescaled_e[nw*e2*(cord_num+1)]);
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > size_t< / span > < span style = "color: #a0522d;" > l< / span > = 0; l < (< span style = "color: #228b22;" > size_t< / span > ) (cord_num + 1); ++l) {
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > x1< / span > = & (x0[l*e2]);
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > size_t< / span > < span style = "color: #a0522d;" > j< / span > = 0; j < (< span style = "color: #228b22;" > size_t< / span > ) elec_num; ++j) {
*x1 = 0.0;
x1 += 1+elec_num;
2023-03-31 20:00:06 +02:00
}
2022-09-28 18:04:21 +02:00
}
}
2024-02-14 11:27:26 +01:00
free(een_rescaled_e_ij);
} // < span style = "color: #b22222;" > OpenMP< / span >
2022-09-28 18:04:21 +02:00
2023-04-11 19:18:24 +02:00
< span style = "color: #a020f0;" > return< / span > QMCKL_SUCCESS;
2022-09-28 18:04:21 +02:00
}
< / pre >
< / div >
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_een_rescaled_e_doc< / 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > cord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > rescale_factor_ee< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > ee_distance< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > een_rescaled_e< / span > );
< / pre >
< / div >
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_een_rescaled_e_hpc< / 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > cord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > rescale_factor_ee< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > ee_distance< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > een_rescaled_e< / span > );
< / pre >
< / div >
< div class = "org-src-container" >
2023-09-21 13:04:54 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_een_rescaled_e< / 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > cord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > rescale_factor_ee< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > ee_distance< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > een_rescaled_e< / span > ) {
2022-09-28 18:04:21 +02:00
2023-03-30 12:35:59 +02:00
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_HPC
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_een_rescaled_e_hpc
2023-03-30 12:35:59 +02:00
< span style = "color: #483d8b;" > #else< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_een_rescaled_e_doc
2023-03-30 12:35:59 +02:00
< span style = "color: #483d8b;" > #endif< / span >
2023-09-21 13:04:54 +02:00
(context, walk_num, elec_num, cord_num, rescale_factor_ee, ee_distance, een_rescaled_e);
}
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org30313f3" class = "outline-5" >
< h5 id = "org30313f3" > < span class = "section-number-5" > 3.3.1.3< / span > Test< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-1-3" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
2023-03-30 12:35:59 +02:00
< pre class = "src src-c" > < span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_electron_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
2022-09-28 18:04:21 +02:00
2023-03-30 12:35:59 +02:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > een_rescaled_e< / span > [walk_num][(cord_num + 1)][elec_num][elec_num];
2023-03-30 17:09:05 +02:00
rc = qmckl_get_jastrow_champ_een_rescaled_e(context, & (een_rescaled_e[0][0][0][0]),elec_num*elec_num*(cord_num+1)*walk_num);
2022-09-28 18:04:21 +02:00
2023-03-30 12:35:59 +02:00
// < span style = "color: #b22222;" > value of (0,2,1)< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > een_rescaled_e< / span > [0][1][0][2]- 0.2211015082992776 ) < 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > een_rescaled_e< / span > [0][1][0][3]- 0.2611178387068169 ) < 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > een_rescaled_e< / span > [0][1][0][4]- 0.0884012350763747 ) < 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > een_rescaled_e< / span > [0][2][1][3]- 0.1016685507354656 ) < 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > een_rescaled_e< / span > [0][2][1][4]- 0.0113118073246869 ) < 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > een_rescaled_e< / span > [0][2][1][5]- 0.5257156022077619 ) < 1.e-12);
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgd8db2ca" class = "outline-4" >
< h4 id = "orgd8db2ca" > < span class = "section-number-4" > 3.3.2< / span > Electron-electron rescaled distances derivatives in \(J_\text{eeN}\)< / h4 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-4" id = "text-3-3-2" >
< p >
2023-05-25 01:14:47 +02:00
< code > een_rescaled_e_gl< / code > stores the table of the derivatives of the
2023-03-30 12:35:59 +02:00
rescaled distances between all pairs of electrons and raised to the
power \(p\) defined by < code > cord_num< / code > . Here we take its derivatives
2023-03-30 17:09:05 +02:00
required for the een jastrow< sub > champ< / sub > .
2023-03-30 12:35:59 +02:00
< / p >
2022-09-28 18:04:21 +02:00
< p >
2023-03-30 12:35:59 +02:00
\[ \frac{\partial}{\partial x} \left[ {g_\text{e}(r)}\right]^p =
-\frac{x}{r} \kappa_\text{e}\, p\,\left[ {g_\text{e}(r)}\right]^p \]
\[ \Delta \left[ {g_\text{e}(r)}\right]^p = \frac{2}{r} \kappa_\text{e}\, p\,\left[ {g_\text{e}(r)}\right]^p \right] + \left(\frac{\partial}{\partial x}\left[ {g_\text{e}(r)}\right]^p \right)^2 + \left(\frac{\partial}{\partial y}\left[ {g_\text{e}(r)}\right]^p \right)^2 + \left(\frac{\partial}{\partial z}\left[ {g_\text{e}(r)}\right]^p \right)^2 \]
2022-09-28 18:04:21 +02:00
< / p >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org201a688" class = "outline-5" >
< h5 id = "org201a688" > < span class = "section-number-5" > 3.3.2.1< / span > Get< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-2-1" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
2023-03-30 12:35:59 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > qmckl_get_jastrow_champ_een_rescaled_e_gl< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > ,
2023-03-30 12:35:59 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > distance_rescaled< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > size_max< / span > );
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org01e001f" class = "outline-5" >
< h5 id = "org01e001f" > < span class = "section-number-5" > 3.3.2.2< / span > Compute< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-2-2" >
2024-02-23 11:17:59 +01:00
< table id = "orgba78112" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > walk_num< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Number of walkers< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > elec_num< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Number of electrons< / td >
2022-09-28 18:04:21 +02:00
< / tr >
2022-11-17 19:27:17 +01:00
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > cord_num< / code > < / td >
2022-11-17 19:27:17 +01:00
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Order of polynomials< / td >
2022-11-17 19:27:17 +01:00
< / tr >
2022-09-28 18:04:21 +02:00
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > rescale_factor_ee< / code > < / td >
< td class = "org-left" > < code > double< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Factor to rescale ee distances< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > coord_ee< / code > < / td >
< td class = "org-left" > < code > double[walk_num][3][elec_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Electron coordinates< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > ee_distance< / code > < / td >
< td class = "org-left" > < code > double[walk_num][elec_num][elec_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Electron-electron distances< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > een_rescaled_e< / code > < / td >
< td class = "org-left" > < code > double[walk_num][0:cord_num][elec_num][elec_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Electron-electron distances< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > een_rescaled_e_gl< / code > < / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > < code > double[walk_num][0:cord_num][elec_num][4][elec_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > out< / td >
2023-03-30 12:35:59 +02:00
< td class = "org-left" > Electron-electron rescaled distances< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
2023-05-25 01:14:47 +02:00
< pre class = "src src-f90" > < span style = "color: #228b22;" > integer< / span > < span style = "color: #a0522d;" > function qmckl_compute_jastrow_champ_factor_een_rescaled_e_gl_f( < / span > < span style = "color: #a020f0;" > & < / span >
2023-03-30 12:35:59 +02:00
context, walk_num, elec_num, cord_num, rescale_factor_ee, < span style = "color: #a020f0;" > & < / span >
2023-05-25 01:14:47 +02:00
coord_ee, ee_distance, een_rescaled_e, een_rescaled_e_gl) < span style = "color: #a020f0;" > & < / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < 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;" > walk_num< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > elec_num< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > cord_num< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > rescale_factor_ee< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > coord_ee(elec_num,3,walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > ee_distance(elec_num,elec_num,walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > een_rescaled_e(elec_num,elec_num,0:cord_num,walk_num)< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > een_rescaled_e_gl(elec_num,4,elec_num,0:cord_num,walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > ,< span style = "color: #a020f0;" > dimension< / span > (:,:,:),< span style = "color: #a020f0;" > allocatable< / span > ::< span style = "color: #a0522d;" > elec_dist_gl< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > x, rij_inv, kappa_l< / span >
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, j, k, l, nw, ii< / span >
2022-09-28 18:04:21 +02:00
2023-09-12 17:52:42 +02:00
< span style = "color: #a020f0;" > allocate< / span > (elec_dist_gl(elec_num, 4, elec_num))
2022-09-28 18:04:21 +02:00
info = QMCKL_SUCCESS
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) < span style = "color: #a020f0;" > then< / span >
2022-09-28 18:04:21 +02:00
info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) < span style = "color: #a020f0;" > then< / span >
2022-09-28 18:04:21 +02:00
info = QMCKL_INVALID_ARG_3
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > if< / span > (cord_num < 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_4
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2023-03-30 12:35:59 +02:00
! < span style = "color: #b22222;" > Prepare table of exponentiated distances raised to appropriate power< / span >
< span style = "color: #a020f0;" > do< / span > nw = 1, walk_num
< span style = "color: #a020f0;" > do< / span > j = 1, elec_num
2023-08-23 14:34:17 +02:00
< span style = "color: #a020f0;" > do< / span > i = 1, j-1
2023-03-30 12:35:59 +02:00
rij_inv = 1.0d0 / ee_distance(i, j, nw)
< span style = "color: #a020f0;" > do< / span > ii = 1, 3
2023-09-12 17:52:42 +02:00
elec_dist_gl(i, ii, j) = (coord_ee(i, ii, nw) - coord_ee(j, ii, nw)) * rij_inv
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > end do< / span >
2023-09-12 17:52:42 +02:00
elec_dist_gl(i, 4, j) = 2.0d0 * rij_inv
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > end do< / span >
2023-08-23 14:34:17 +02:00
2023-09-12 17:52:42 +02:00
elec_dist_gl(j, :, j) = 0.0d0
2023-08-23 14:34:17 +02:00
< span style = "color: #a020f0;" > do< / span > i = j+1, elec_num
rij_inv = 1.0d0 / ee_distance(i, j, nw)
< span style = "color: #a020f0;" > do< / span > ii = 1, 3
2023-09-12 17:52:42 +02:00
elec_dist_gl(i, ii, j) = (coord_ee(i, ii, nw) - coord_ee(j, ii, nw)) * rij_inv
2023-08-23 14:34:17 +02:00
< span style = "color: #a020f0;" > end do< / span >
2023-09-12 17:52:42 +02:00
elec_dist_gl(i, 4, j) = 2.0d0 * rij_inv
2023-08-23 14:34:17 +02:00
< span style = "color: #a020f0;" > end do< / span >
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > end do< / span >
! < span style = "color: #b22222;" > prepare the actual een table< / span >
2024-02-23 11:17:59 +01:00
een_rescaled_e_gl(:,:,:,0,nw) = 0.d0
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > do< / span > l = 1, cord_num
kappa_l = - < span style = "color: #a020f0;" > dble< / span > (l) * rescale_factor_ee
< span style = "color: #a020f0;" > do< / span > j = 1, elec_num
< span style = "color: #a020f0;" > do< / span > i = 1, elec_num
2023-09-12 17:52:42 +02:00
een_rescaled_e_gl(i, 1, j, l, nw) = kappa_l * elec_dist_gl(i, 1, j)
een_rescaled_e_gl(i, 2, j, l, nw) = kappa_l * elec_dist_gl(i, 2, j)
een_rescaled_e_gl(i, 3, j, l, nw) = kappa_l * elec_dist_gl(i, 3, j)
een_rescaled_e_gl(i, 4, j, l, nw) = kappa_l * elec_dist_gl(i, 4, j)
2023-03-30 12:35:59 +02:00
2023-05-25 01:14:47 +02:00
een_rescaled_e_gl(i, 4, j, l, nw) = een_rescaled_e_gl(i, 4, j, l, nw) < span style = "color: #a020f0;" > & < / span >
+ een_rescaled_e_gl(i, 1, j, l, nw) * een_rescaled_e_gl(i, 1, j, l, nw) < span style = "color: #a020f0;" > & < / span >
+ een_rescaled_e_gl(i, 2, j, l, nw) * een_rescaled_e_gl(i, 2, j, l, nw) < span style = "color: #a020f0;" > & < / span >
+ een_rescaled_e_gl(i, 3, j, l, nw) * een_rescaled_e_gl(i, 3, j, l, nw)
2023-03-30 12:35:59 +02:00
2023-09-12 17:52:42 +02:00
een_rescaled_e_gl(i,1,j,l,nw) = een_rescaled_e_gl(i,1,j,l,nw) * een_rescaled_e(i,j,l,nw)
een_rescaled_e_gl(i,2,j,l,nw) = een_rescaled_e_gl(i,2,j,l,nw) * een_rescaled_e(i,j,l,nw)
een_rescaled_e_gl(i,3,j,l,nw) = een_rescaled_e_gl(i,3,j,l,nw) * een_rescaled_e(i,j,l,nw)
een_rescaled_e_gl(i,4,j,l,nw) = een_rescaled_e_gl(i,4,j,l,nw) * een_rescaled_e(i,j,l,nw)
2023-03-30 12:35:59 +02:00
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > end do< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_een_rescaled_e_gl_f< / span >
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
2024-02-14 11:00:41 +01:00
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_een_rescaled_e_gl_hpc< / 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > cord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > rescale_factor_ee< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > coord_ee< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > ee_distance< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > een_rescaled_e< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > een_rescaled_e_gl< / span > )
{
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_CONTEXT;
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_2;
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_3;
< span style = "color: #a020f0;" > if< / span > (cord_num < 0) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_4;
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > elec_dist_gl0< / span > = (< span style = "color: #228b22;" > double< / span > *) calloc(elec_num * elec_num, < span style = "color: #a020f0;" > sizeof< / span > (< span style = "color: #228b22;" > double< / span > ));
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > elec_dist_gl1< / span > = (< span style = "color: #228b22;" > double< / span > *) calloc(elec_num * elec_num, < span style = "color: #a020f0;" > sizeof< / span > (< span style = "color: #228b22;" > double< / span > ));
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > elec_dist_gl2< / span > = (< span style = "color: #228b22;" > double< / span > *) calloc(elec_num * elec_num, < span style = "color: #a020f0;" > sizeof< / span > (< span style = "color: #228b22;" > double< / span > ));
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > elec_dist_gl3< / span > = (< span style = "color: #228b22;" > double< / span > *) calloc(elec_num * elec_num, < span style = "color: #a020f0;" > sizeof< / span > (< span style = "color: #228b22;" > double< / span > ));
assert (elec_dist_gl0 != < span style = "color: #008b8b;" > NULL< / span > );
assert (elec_dist_gl1 != < span style = "color: #008b8b;" > NULL< / span > );
assert (elec_dist_gl2 != < span style = "color: #008b8b;" > NULL< / span > );
assert (elec_dist_gl3 != < span style = "color: #008b8b;" > NULL< / span > );
< span style = "color: #483d8b;" > #pragma< / span > omp parallel < span style = "color: #a020f0;" > for< / span >
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > nw< / span > = 0; nw < walk_num; ++nw) {
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > rij_inv< / span > [elec_num];
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > j< / span > = 0; j < elec_num; ++j) {
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_OPENMP
< span style = "color: #483d8b;" > #pragma< / span > omp simd
< span style = "color: #483d8b;" > #endif< / span >
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > i< / span > = 0; i < elec_num ; ++i) {
rij_inv[i] = ee_distance[i + j * elec_num + nw * elec_num * elec_num] + 1.e-30;
}
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_OPENMP
< span style = "color: #483d8b;" > #pragma< / span > omp simd
< span style = "color: #483d8b;" > #endif< / span >
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > i< / span > = 0; i < elec_num ; ++i) {
rij_inv[i] = 1.0/rij_inv[i];
}
rij_inv[j] = 0.;
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > xj< / span > = coord_ee[j + nw * elec_num * 3];
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > yj< / span > = coord_ee[j + elec_num + nw * elec_num * 3];
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > zj< / span > = coord_ee[j + 2 * elec_num + nw * elec_num * 3];
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_OPENMP
< span style = "color: #483d8b;" > #pragma< / span > omp simd
< span style = "color: #483d8b;" > #endif< / span >
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > i< / span > = 0; i < elec_num ; ++i) {
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > xi< / span > = coord_ee[i + nw * elec_num * 3];
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > yi< / span > = coord_ee[i + elec_num + nw * elec_num * 3];
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > zi< / span > = coord_ee[i + 2 * elec_num + nw * elec_num * 3];
elec_dist_gl0[i + j * elec_num] = rij_inv[i] * (xi-xj);
elec_dist_gl1[i + j * elec_num] = rij_inv[i] * (yi-yj);
elec_dist_gl2[i + j * elec_num] = rij_inv[i] * (zi-zj);
elec_dist_gl3[i + j * elec_num] = rij_inv[i] + rij_inv[i];
}
}
2024-02-23 11:17:59 +01:00
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > j< / span > = 0; j < elec_num; ++j) {
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > eegl< / span > = & een_rescaled_e_gl[ elec_num * 4 * (j + elec_num * (cord_num + 1) * nw)];
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_OPENMP
< span style = "color: #483d8b;" > #pragma< / span > omp simd
< span style = "color: #483d8b;" > #endif< / span >
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > i< / span > = 0; i < 4*elec_num; ++i) {
eegl[i] = 0.0;
}
}
2024-02-14 11:00:41 +01:00
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > l< / span > = 1; l < = cord_num; ++l) {
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > kappa_l< / span > = - (< span style = "color: #228b22;" > double< / span > )< span style = "color: #228b22;" > l< / span > * < span style = "color: #a0522d;" > rescale_factor_ee< / span > ;
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > j< / span > = 0; j < elec_num; ++j) {
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > eegl< / span > = & een_rescaled_e_gl[ elec_num * 4 * (j + elec_num * (l + (cord_num + 1) * nw))];
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > restrict< / span > < span style = "color: #a0522d;" > ee< / span > = & een_rescaled_e [ elec_num * (j + elec_num * (l + (cord_num + 1) * nw))];
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_OPENMP
< span style = "color: #483d8b;" > #pragma< / span > omp simd
< span style = "color: #483d8b;" > #endif< / span >
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > i< / span > = 0; i < elec_num; ++i) {
eegl[i ] = kappa_l * elec_dist_gl0[i + j * elec_num];
eegl[i + elec_num ] = kappa_l * elec_dist_gl1[i + j * elec_num];
eegl[i + elec_num * 2] = kappa_l * elec_dist_gl2[i + j * elec_num];
eegl[i + elec_num * 3] = kappa_l * elec_dist_gl3[i + j * elec_num];
}
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_OPENMP
< span style = "color: #483d8b;" > #pragma< / span > omp simd
< span style = "color: #483d8b;" > #endif< / span >
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > i< / span > = 0; i < elec_num; ++i) {
eegl[i + elec_num*3] = eegl[i + elec_num*3] +
eegl[i] * eegl[i] +
eegl[i + elec_num*1] * eegl[i + elec_num*1] +
eegl[i + elec_num*2] * eegl[i + elec_num*2];
}
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_OPENMP
< span style = "color: #483d8b;" > #pragma< / span > omp simd
< span style = "color: #483d8b;" > #endif< / span >
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > i< / span > = 0; i < elec_num; ++i) {
eegl[i ] *= ee[i];
eegl[i + elec_num * 1] *= ee[i];
eegl[i + elec_num * 2] *= ee[i];
eegl[i + elec_num * 3] *= ee[i];
}
}
}
}
free(elec_dist_gl0);
free(elec_dist_gl1);
free(elec_dist_gl2);
free(elec_dist_gl3);
< span style = "color: #a020f0;" > return< / span > QMCKL_SUCCESS;
}
< / pre >
2022-09-28 18:04:21 +02:00
< / div >
2024-02-14 11:00:41 +01:00
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_een_rescaled_e_gl< / 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > cord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > rescale_factor_ee< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > coord_ee< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > ee_distance< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > een_rescaled_e< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > een_rescaled_e_gl< / span > )
{
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_HPC
< span style = "color: #a020f0;" > return< / span > qmckl_compute_jastrow_champ_factor_een_rescaled_e_gl_hpc
< span style = "color: #483d8b;" > #else< / span >
< span style = "color: #a020f0;" > return< / span > qmckl_compute_jastrow_champ_factor_een_rescaled_e_gl_doc
< span style = "color: #483d8b;" > #endif< / span >
(context, walk_num, elec_num, cord_num, rescale_factor_ee,
coord_ee, ee_distance, een_rescaled_e, een_rescaled_e_gl );
}
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orge82a4eb" class = "outline-5" >
< h5 id = "orge82a4eb" > < span class = "section-number-5" > 3.3.2.3< / span > Test< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-2-3" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
2023-05-25 01:14:47 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > een_rescaled_e_gl< / span > [walk_num][(cord_num + 1)][elec_num][4][elec_num];
2023-03-30 12:35:59 +02:00
size_max=walk_num*(cord_num + 1)*elec_num*4*elec_num;
2023-05-25 01:14:47 +02:00
rc = qmckl_get_jastrow_champ_een_rescaled_e_gl(context,
& (een_rescaled_e_gl[0][0][0][0][0]),size_max);
2022-09-28 18:04:21 +02:00
2023-03-30 12:35:59 +02:00
// < span style = "color: #b22222;" > value of (0,0,0,2,1)< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > een_rescaled_e_gl< / span > [0][1][0][0][2] + 0.09831391870751387 ) < 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > een_rescaled_e_gl< / span > [0][1][0][0][3] + 0.017204157459682526 ) < 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > een_rescaled_e_gl< / span > [0][1][0][0][4] + 0.013345768421098641 ) < 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > een_rescaled_e_gl< / span > [0][2][1][0][3] + 0.03733086358273962 ) < 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > een_rescaled_e_gl< / span > [0][2][1][0][4] + 0.004922634822943517 ) < 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > een_rescaled_e_gl< / span > [0][2][1][0][5] + 0.5416751547830984 ) < 1.e-12);
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org4ec93e7" class = "outline-4" >
< h4 id = "org4ec93e7" > < span class = "section-number-4" > 3.3.3< / span > Electron-nucleus rescaled distances in \(J_\text{eeN}\)< / h4 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-4" id = "text-3-3-3" >
2022-09-28 18:04:21 +02:00
< p >
< code > een_rescaled_n< / code > stores the table of the rescaled distances between
2023-03-30 12:35:59 +02:00
electrons and nuclei raised to the power \(p\) defined by < code > cord_num< / code > :
2022-09-28 18:04:21 +02:00
< / p >
< p >
\[
2023-03-30 12:35:59 +02:00
C_{i\alpha,p} = \left[ \exp\left(-\kappa_\alpha\, R_{i\alpha}\right) \right]^p
\]
2022-09-28 18:04:21 +02:00
< / p >
< p >
2023-03-30 12:35:59 +02:00
where \(R_{i\alpha}\) is the matrix of electron-nucleus distances.
2022-09-28 18:04:21 +02:00
< / p >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org6ad7501" class = "outline-5" >
< h5 id = "org6ad7501" > < span class = "section-number-5" > 3.3.3.1< / span > Get< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-3-1" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #0000ff;" > qmckl_get_jastrow_champ_een_rescaled_n< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > ,
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > distance_rescaled< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > size_max< / span > );
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org1cec5a1" class = "outline-5" >
< h5 id = "org1cec5a1" > < span class = "section-number-5" > 3.3.3.2< / span > Compute< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-3-2" >
2024-02-23 11:17:59 +01:00
< table id = "orga19f3f0" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
< td class = "org-left" > < code > walk_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of walkers< / td >
< / tr >
< tr >
< td class = "org-left" > < code > elec_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of electrons< / td >
< / tr >
< tr >
< td class = "org-left" > < code > nucl_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of atoms< / td >
< / tr >
2022-11-17 19:27:17 +01:00
< tr >
< td class = "org-left" > < code > type_nucl_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of atom types< / td >
< / tr >
< tr >
< td class = "org-left" > < code > type_nucl_vector< / code > < / td >
2022-11-18 14:16:53 +01:00
< td class = "org-left" > < code > int64_t[nucl_num]< / code > < / td >
2022-11-17 19:27:17 +01:00
< td class = "org-left" > in< / td >
< td class = "org-left" > Types of atoms< / td >
< / tr >
2022-09-28 18:04:21 +02:00
< tr >
< td class = "org-left" > < code > cord_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Order of polynomials< / td >
< / tr >
< tr >
< td class = "org-left" > < code > rescale_factor_en< / code > < / td >
< td class = "org-left" > < code > double[nucl_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Factor to rescale ee distances< / td >
< / tr >
< tr >
< td class = "org-left" > < code > en_distance< / code > < / td >
< td class = "org-left" > < code > double[walk_num][elec_num][nucl_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron-nucleus distances< / td >
< / tr >
< tr >
< td class = "org-left" > < code > een_rescaled_n< / code > < / td >
< td class = "org-left" > < code > double[walk_num][0:cord_num][nucl_num][elec_num]< / code > < / td >
< td class = "org-left" > out< / td >
< td class = "org-left" > Electron-nucleus rescaled distances< / td >
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
< pre class = "src src-f90" > < span style = "color: #228b22;" > integer< / span > < span style = "color: #a0522d;" > function qmckl_compute_een_rescaled_n_f( < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-17 19:27:17 +01:00
context, walk_num, elec_num, nucl_num, < span style = "color: #a020f0;" > & < / span >
type_nucl_num, type_nucl_vector, cord_num, rescale_factor_en, < span style = "color: #a020f0;" > & < / span >
2022-09-28 18:04:21 +02:00
en_distance, een_rescaled_n) < span style = "color: #a020f0;" > & < / span >
< span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < 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;" > walk_num< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > elec_num< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > nucl_num< / span >
2022-11-17 19:27:17 +01:00
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > type_nucl_num< / span >
2022-11-18 14:16:53 +01:00
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > type_nucl_vector(nucl_num)< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > cord_num< / span >
2022-11-17 19:27:17 +01:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > rescale_factor_en(type_nucl_num)< / span >
2023-03-17 14:57:01 +01:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > en_distance(nucl_num,elec_num,walk_num)< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > een_rescaled_n(elec_num,nucl_num,0:cord_num,walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > x< / span >
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, a, k, l, nw< / span >
info = QMCKL_SUCCESS
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_3
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (nucl_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_4
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > if< / span > (cord_num < 0) < span style = "color: #a020f0;" > then< / span >
2022-09-28 18:04:21 +02:00
info = QMCKL_INVALID_ARG_5
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
! < span style = "color: #b22222;" > Prepare table of exponentiated distances raised to appropriate power< / span >
een_rescaled_n = 0.0d0
< span style = "color: #a020f0;" > do< / span > nw = 1, walk_num
2022-11-17 19:27:17 +01:00
! < span style = "color: #b22222;" > prepare the actual een table< / span >
een_rescaled_n(:, :, 0, nw) = 1.0d0
2022-09-28 18:04:21 +02:00
2022-11-17 19:27:17 +01:00
< span style = "color: #a020f0;" > do< / span > a = 1, nucl_num
< span style = "color: #a020f0;" > do< / span > i = 1, elec_num
2023-05-25 01:14:47 +02:00
een_rescaled_n(i, a, 1, nw) = dexp(-rescale_factor_en(type_nucl_vector(a)+1) * en_distance(a, i, nw))
2022-11-17 19:27:17 +01:00
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > do< / span > l = 2, cord_num
< span style = "color: #a020f0;" > do< / span > a = 1, nucl_num
< span style = "color: #a020f0;" > do< / span > i = 1, elec_num
een_rescaled_n(i, a, l, nw) = een_rescaled_n(i, a, l - 1, nw) * een_rescaled_n(i, a, 1, nw)
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_een_rescaled_n_f< / span >
< / pre >
< / div >
< div class = "org-src-container" >
2022-11-17 19:27:17 +01:00
< pre class = "src src-c" > /*
< span style = "color: #b22222;" > qmckl_exit_code qmckl_compute_een_rescaled_n (< / span >
< span style = "color: #b22222;" > const qmckl_context context,< / span >
< span style = "color: #b22222;" > const int64_t walk_num,< / span >
< span style = "color: #b22222;" > const int64_t elec_num,< / span >
< span style = "color: #b22222;" > const int64_t nucl_num,< / span >
< span style = "color: #b22222;" > const int64_t type_nucl_num,< / span >
< span style = "color: #b22222;" > int64_t* const type_nucl_vector,< / span >
< span style = "color: #b22222;" > const int64_t cord_num,< / span >
< span style = "color: #b22222;" > const double* rescale_factor_en,< / span >
< span style = "color: #b22222;" > const double* en_distance,< / span >
< span style = "color: #b22222;" > double* const een_rescaled_n ) {< / span >
< span style = "color: #b22222;" > if (context == QMCKL_NULL_CONTEXT) {< / span >
< span style = "color: #b22222;" > return QMCKL_INVALID_CONTEXT;< / span >
< span style = "color: #b22222;" > }< / span >
2022-09-28 18:04:21 +02:00
2022-11-17 19:27:17 +01:00
< span style = "color: #b22222;" > if (walk_num < = 0) {< / span >
< span style = "color: #b22222;" > return QMCKL_INVALID_ARG_2;< / span >
< span style = "color: #b22222;" > }< / span >
2022-09-28 18:04:21 +02:00
2022-11-17 19:27:17 +01:00
< span style = "color: #b22222;" > if (elec_num < = 0) {< / span >
< span style = "color: #b22222;" > return QMCKL_INVALID_ARG_3;< / span >
< span style = "color: #b22222;" > }< / span >
2022-09-28 18:04:21 +02:00
2022-11-17 19:27:17 +01:00
< span style = "color: #b22222;" > if (nucl_num < = 0) {< / span >
< span style = "color: #b22222;" > return QMCKL_INVALID_ARG_4;< / span >
< span style = "color: #b22222;" > }< / span >
2022-09-28 18:04:21 +02:00
2022-11-17 19:27:17 +01:00
< span style = "color: #b22222;" > if (cord_num < 0) {< / span >
< span style = "color: #b22222;" > return QMCKL_INVALID_ARG_5;< / span >
< span style = "color: #b22222;" > }< / span >
2022-09-28 18:04:21 +02:00
2022-11-17 19:27:17 +01:00
< span style = "color: #b22222;" > // Prepare table of exponentiated distances raised to appropriate power< / span >
< span style = "color: #b22222;" > for (int i = 0; i < (walk_num*(cord_num+1)*nucl_num*elec_num); ++i) {< / span >
< span style = "color: #b22222;" > een_rescaled_n[i] = 1.0;< / span >
< span style = "color: #b22222;" > }< / span >
2022-09-28 18:04:21 +02:00
2022-11-17 19:27:17 +01:00
< span style = "color: #b22222;" > for (int nw = 0; nw < walk_num; ++nw) {< / span >
< span style = "color: #b22222;" > for (int a = 0; a < nucl_num; ++a) {< / span >
< span style = "color: #b22222;" > for (int i = 0; i < elec_num; ++i) {< / span >
< span style = "color: #b22222;" > een_rescaled_n[i + a*elec_num + nw * elec_num*nucl_num*(cord_num+1)] = 1.0;< / span >
< span style = "color: #b22222;" > een_rescaled_n[i + a*elec_num + elec_num*nucl_num + nw*elec_num*nucl_num*(cord_num+1)] =< / span >
2023-03-17 14:57:01 +01:00
< span style = "color: #b22222;" > exp(-rescale_factor_en[type_nucl_vector[a]] * en_distance[a + i*nucl_num + nw*elec_num*nucl_num]);< / span >
2022-11-17 19:27:17 +01:00
< span style = "color: #b22222;" > }< / span >
< span style = "color: #b22222;" > }< / span >
2022-09-28 18:04:21 +02:00
2022-11-17 19:27:17 +01:00
< span style = "color: #b22222;" > for (int l = 2; l < (cord_num+1); ++l){< / span >
< span style = "color: #b22222;" > for (int a = 0; a < nucl_num; ++a) {< / span >
< span style = "color: #b22222;" > for (int i = 0; i < elec_num; ++i) {< / span >
< span style = "color: #b22222;" > een_rescaled_n[i + a*elec_num + l*elec_num*nucl_num + nw*elec_num*nucl_num*(cord_num+1)] =< / span >
2023-03-17 14:57:01 +01:00
< span style = "color: #b22222;" > een_rescaled_n[i + a*elec_num + (l-1)*elec_num*nucl_num + nw*elec_num*nucl_num*(cord_num+1)] *< / span >
2022-11-17 19:27:17 +01:00
< span style = "color: #b22222;" > een_rescaled_n[i + a*elec_num + elec_num*nucl_num + nw*elec_num*nucl_num*(cord_num+1)];< / span >
< span style = "color: #b22222;" > }< / span >
< span style = "color: #b22222;" > }< / span >
< span style = "color: #b22222;" > }< / span >
2022-09-28 18:04:21 +02:00
2022-11-17 19:27:17 +01:00
< span style = "color: #b22222;" > }< / span >
2022-09-28 18:04:21 +02:00
2022-11-17 19:27:17 +01:00
< span style = "color: #b22222;" > return QMCKL_SUCCESS;< / span >
< span style = "color: #b22222;" > }< / span >
*/
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org7d6db7f" class = "outline-5" >
< h5 id = "org7d6db7f" > < span class = "section-number-5" > 3.3.3.3< / span > Test< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-3-3" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_electron_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > een_rescaled_n< / span > [walk_num][(cord_num + 1)][nucl_num][elec_num];
size_max=walk_num*(cord_num + 1)*nucl_num*elec_num;
2023-03-30 17:09:05 +02:00
rc = qmckl_get_jastrow_champ_een_rescaled_n(context, & (een_rescaled_n[0][0][0][0]),size_max);
2022-09-28 18:04:21 +02:00
// < span style = "color: #b22222;" > value of (0,2,1)< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > een_rescaled_n< / span > [0][1][0][2]-0.2603169838750542 )< 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > een_rescaled_n< / span > [0][1][0][3]-0.3016180139679065 )< 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > een_rescaled_n< / span > [0][1][0][4]-0.10506023826192266)< 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > een_rescaled_n< / span > [0][2][1][3]-0.9267719759374164 )< 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > een_rescaled_n< / span > [0][2][1][4]-0.11497585238132658)< 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > een_rescaled_n< / span > [0][2][1][5]-0.07534033469115217)< 1.e-12);
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org7d382b6" class = "outline-4" >
< h4 id = "org7d382b6" > < span class = "section-number-4" > 3.3.4< / span > Electron-nucleus rescaled distances derivatives in \(J_\text{eeN}\)< / h4 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-4" id = "text-3-3-4" >
2022-09-28 18:04:21 +02:00
< p >
2023-05-25 01:14:47 +02:00
< code > een_rescaled_n_gl< / code > stores the table of the derivatives of the
2023-03-30 12:35:59 +02:00
rescaled distances between all electron-nucleus pairs and raised to the
power \(p\) defined by < code > cord_num< / code > . Here we take its derivatives
2023-03-30 17:09:05 +02:00
required for the een jastrow< sub > champ< / sub > .
2022-09-28 18:04:21 +02:00
< / p >
2023-03-30 12:35:59 +02:00
< p >
\[ \frac{\partial}{\partial x} \left[ {g_\alpha(R_{i\alpha})}\right]^p =
-\frac{x}{R_{i\alpha}} \kappa_\alpha\, p\,\left[ {g_\alpha(R_{i\alpha})}\right]^p \]
\[ \Delta \left[ {g_\alpha(R_{i\alpha})}\right]^p = \frac{2}{R_{i\alpha}}
\kappa_\alpha\, p\,\left[ {g_\alpha(R_{i\alpha})}\right]^p \right] +
\left(\frac{\partial}{\partial x}\left[ {g_\alpha(R_{i\alpha})}\right]^p
\right)^2 + \left(\frac{\partial}{\partial y}\left[
{g_\alpha(R_{i\alpha})}\right]^p \right)^2 + \left(\frac{\partial}{\partial
z}\left[ {g_\alpha(R_{i\alpha})}\right]^p \right)^2 \]
< / p >
< / div >
2022-09-28 18:04:21 +02:00
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org8fb2979" class = "outline-5" >
< h5 id = "org8fb2979" > < span class = "section-number-5" > 3.3.4.1< / span > Get< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-4-1" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > qmckl_get_jastrow_champ_een_rescaled_n_gl< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > ,
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > distance_rescaled< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > size_max< / span > );
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org4d15228" class = "outline-5" >
< h5 id = "org4d15228" > < span class = "section-number-5" > 3.3.4.2< / span > Compute< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-4-2" >
2024-02-23 11:17:59 +01:00
< table id = "org6589cc9" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
< td class = "org-left" > < code > walk_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of walkers< / td >
< / tr >
< tr >
< td class = "org-left" > < code > elec_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of electrons< / td >
< / tr >
< tr >
< td class = "org-left" > < code > nucl_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of atoms< / td >
< / tr >
2022-11-17 19:27:17 +01:00
< tr >
< td class = "org-left" > < code > type_nucl_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of atom types< / td >
< / tr >
< tr >
< td class = "org-left" > < code > type_nucl_vector< / code > < / td >
2022-11-18 14:16:53 +01:00
< td class = "org-left" > < code > int64_t[nucl_num]< / code > < / td >
2022-11-17 19:27:17 +01:00
< td class = "org-left" > in< / td >
< td class = "org-left" > Types of atoms< / td >
< / tr >
2022-09-28 18:04:21 +02:00
< tr >
< td class = "org-left" > < code > cord_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Order of polynomials< / td >
< / tr >
< tr >
< td class = "org-left" > < code > rescale_factor_en< / code > < / td >
< td class = "org-left" > < code > double[nucl_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Factor to rescale ee distances< / td >
< / tr >
< tr >
< td class = "org-left" > < code > coord_ee< / code > < / td >
< td class = "org-left" > < code > double[walk_num][3][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron coordinates< / td >
< / tr >
< tr >
2023-09-12 17:52:42 +02:00
< td class = "org-left" > < code > coord_n< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > double[3][nucl_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Nuclear coordinates< / td >
< / tr >
< tr >
< td class = "org-left" > < code > en_distance< / code > < / td >
< td class = "org-left" > < code > double[walk_num][elec_num][nucl_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron-nucleus distances< / td >
< / tr >
< tr >
< td class = "org-left" > < code > een_rescaled_n< / code > < / td >
< td class = "org-left" > < code > double[walk_num][0:cord_num][nucl_num][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron-nucleus distances< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > een_rescaled_n_gl< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > double[walk_num][0:cord_num][nucl_num][4][elec_num]< / code > < / td >
< td class = "org-left" > out< / td >
< td class = "org-left" > Electron-nucleus rescaled distances< / td >
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
2023-05-25 01:14:47 +02:00
< pre class = "src src-f90" > < span style = "color: #228b22;" > integer< / span > < span style = "color: #a0522d;" > function qmckl_compute_jastrow_champ_factor_een_rescaled_n_gl_f( < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-17 19:27:17 +01:00
context, walk_num, elec_num, nucl_num, type_nucl_num, type_nucl_vector, < span style = "color: #a020f0;" > & < / span >
2022-09-28 18:04:21 +02:00
cord_num, rescale_factor_en, < span style = "color: #a020f0;" > & < / span >
2023-09-12 17:52:42 +02:00
coord_ee, coord_n, en_distance, een_rescaled_n, een_rescaled_n_gl) < span style = "color: #a020f0;" > & < / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < 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;" > walk_num< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > elec_num< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > nucl_num< / span >
2022-11-17 19:27:17 +01:00
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > type_nucl_num< / span >
2022-11-18 14:16:53 +01:00
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > type_nucl_vector(nucl_num)< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > cord_num< / span >
2022-11-17 19:27:17 +01:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > rescale_factor_en(type_nucl_num)< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > coord_ee(elec_num,3,walk_num)< / span >
2023-09-12 17:52:42 +02:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > coord_n(nucl_num,3)< / span >
2023-03-17 14:57:01 +01:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > en_distance(nucl_num,elec_num,walk_num)< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > een_rescaled_n(elec_num,nucl_num,0:cord_num,walk_num)< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > een_rescaled_n_gl(elec_num,4,nucl_num,0:cord_num,walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > ,< span style = "color: #a020f0;" > dimension< / span > (:,:,:),< span style = "color: #a020f0;" > allocatable< / span > ::< span style = "color: #a0522d;" > elnuc_dist_gl< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > x, ria_inv, kappa_l< / span >
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, a, k, l, nw, ii< / span >
2023-09-12 17:52:42 +02:00
< span style = "color: #a020f0;" > allocate< / span > (elnuc_dist_gl(elec_num, 4, nucl_num))
2022-09-28 18:04:21 +02:00
info = QMCKL_SUCCESS
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_3
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (nucl_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_4
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > if< / span > (cord_num < 0) < span style = "color: #a020f0;" > then< / span >
2022-09-28 18:04:21 +02:00
info = QMCKL_INVALID_ARG_5
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
! < span style = "color: #b22222;" > Prepare table of exponentiated distances raised to appropriate power< / span >
2023-05-25 01:14:47 +02:00
een_rescaled_n_gl = 0.0d0
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > do< / span > nw = 1, walk_num
2023-09-12 17:52:42 +02:00
! < span style = "color: #b22222;" > prepare the actual een table< / span >
< span style = "color: #a020f0;" > do< / span > a = 1, nucl_num
< span style = "color: #a020f0;" > do< / span > i = 1, elec_num
ria_inv = 1.0d0 / en_distance(a, i, nw)
< span style = "color: #a020f0;" > do< / span > ii = 1, 3
elnuc_dist_gl(i, ii, a) = (coord_ee(i, ii, nw) - coord_n(a, ii)) * ria_inv
< span style = "color: #a020f0;" > end do< / span >
elnuc_dist_gl(i, 4, a) = 2.0d0 * ria_inv
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
2022-09-28 18:04:21 +02:00
2023-09-12 17:52:42 +02:00
< span style = "color: #a020f0;" > do< / span > l = 0, cord_num
< span style = "color: #a020f0;" > do< / span > a = 1, nucl_num
kappa_l = - < span style = "color: #a020f0;" > dble< / span > (l) * rescale_factor_en(type_nucl_vector(a)+1)
< span style = "color: #a020f0;" > do< / span > i = 1, elec_num
een_rescaled_n_gl(i, 1, a, l, nw) = kappa_l * elnuc_dist_gl(i, 1, a)
een_rescaled_n_gl(i, 2, a, l, nw) = kappa_l * elnuc_dist_gl(i, 2, a)
een_rescaled_n_gl(i, 3, a, l, nw) = kappa_l * elnuc_dist_gl(i, 3, a)
een_rescaled_n_gl(i, 4, a, l, nw) = kappa_l * elnuc_dist_gl(i, 4, a)
een_rescaled_n_gl(i, 4, a, l, nw) = een_rescaled_n_gl(i, 4, a, l, nw) < span style = "color: #a020f0;" > & < / span >
+ een_rescaled_n_gl(i, 1, a, l, nw) * een_rescaled_n_gl(i, 1, a, l, nw) < span style = "color: #a020f0;" > & < / span >
+ een_rescaled_n_gl(i, 2, a, l, nw) * een_rescaled_n_gl(i, 2, a, l, nw) < span style = "color: #a020f0;" > & < / span >
+ een_rescaled_n_gl(i, 3, a, l, nw) * een_rescaled_n_gl(i, 3, a, l, nw)
een_rescaled_n_gl(i, 1, a, l, nw) = een_rescaled_n_gl(i, 1, a, l, nw) * < span style = "color: #a020f0;" > & < / span >
een_rescaled_n(i, a, l, nw)
een_rescaled_n_gl(i, 2, a, l, nw) = een_rescaled_n_gl(i, 2, a, l, nw) * < span style = "color: #a020f0;" > & < / span >
een_rescaled_n(i, a, l, nw)
een_rescaled_n_gl(i, 3, a, l, nw) = een_rescaled_n_gl(i, 3, a, l, nw) * < span style = "color: #a020f0;" > & < / span >
een_rescaled_n(i, a, l, nw)
een_rescaled_n_gl(i, 4, a, l, nw) = een_rescaled_n_gl(i, 4, a, l, nw) * < span style = "color: #a020f0;" > & < / span >
een_rescaled_n(i, a, l, nw)
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > end do< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_een_rescaled_n_gl_f< / span >
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orge9c0e94" class = "outline-5" >
< h5 id = "orge9c0e94" > < span class = "section-number-5" > 3.3.4.3< / span > Test< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-4-3" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_electron_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > een_rescaled_n_gl< / span > [walk_num][(cord_num + 1)][nucl_num][4][elec_num];
2022-09-28 18:04:21 +02:00
size_max=walk_num*(cord_num + 1)*nucl_num*4*elec_num;
2023-05-25 01:14:47 +02:00
rc = qmckl_get_jastrow_champ_een_rescaled_n_gl(context, & (een_rescaled_n_gl[0][0][0][0][0]),size_max);
2022-09-28 18:04:21 +02:00
// < span style = "color: #b22222;" > value of (0,2,1)< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > assert< / span > (fabs( -0.11234061209936878 - een_rescaled_n_gl[0][1][0][0][2]) < 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs( 0.0004440109367151707 - een_rescaled_n_gl[0][1][0][0][3]) < 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs( -0.012868642597346566 - een_rescaled_n_gl[0][1][0][0][4]) < 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs( 0.08601122289922644 - een_rescaled_n_gl[0][2][1][0][3]) < 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs( -0.058681563677207206 - een_rescaled_n_gl[0][2][1][0][4]) < 1.e-12);
< span style = "color: #0000ff;" > assert< / span > (fabs( 0.005359281880312882 - een_rescaled_n_gl[0][2][1][0][5]) < 1.e-12);
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orge63e5a7" class = "outline-4" >
< h4 id = "orge63e5a7" > < span class = "section-number-4" > 3.3.5< / span > Temporary arrays for electron-electron-nucleus Jastrow \(f_{een}\)< / h4 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-4" id = "text-3-3-5" >
2022-09-28 18:04:21 +02:00
< p >
2022-11-16 18:00:51 +01:00
Prepare < code > c_vector_full< / code > and < code > lkpm_combined_index< / code > tables required for the
2022-09-28 18:04:21 +02:00
calculation of the three-body jastrow < code > factor_een< / code > and its derivative
2023-05-25 01:14:47 +02:00
< code > factor_een_gl< / code > .
2022-09-28 18:04:21 +02:00
< / p >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgc65e240" class = "outline-5" >
< h5 id = "orgc65e240" > < span class = "section-number-5" > 3.3.5.1< / span > Compute dim< sub > c< / sub > < sub > vector< / sub > < / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-5-1" >
2023-05-26 09:53:50 +02:00
< p >
Computes the dimension of the vector of parameters.
< / p >
2022-09-28 18:04:21 +02:00
2023-05-26 09:53:50 +02:00
< table border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
< colgroup >
< col class = "org-right" / >
< col class = "org-right" / >
< / colgroup >
< tbody >
< tr >
< td class = "org-right" > \(N_{ord}\)< / td >
< td class = "org-right" > Number of parameters< / td >
< / tr >
< tr >
< td class = "org-right" >   < / td >
< td class = "org-right" >   < / td >
< / tr >
2023-09-26 16:04:35 +02:00
< tr >
< td class = "org-right" > 1< / td >
< td class = "org-right" > 0< / td >
< / tr >
2023-05-26 09:53:50 +02:00
< tr >
< td class = "org-right" > 2< / td >
< td class = "org-right" > 2< / td >
< / tr >
< tr >
< td class = "org-right" > 3< / td >
< td class = "org-right" > 6< / td >
< / tr >
< tr >
< td class = "org-right" > 4< / td >
< td class = "org-right" > 13< / td >
< / tr >
< tr >
< td class = "org-right" > 5< / td >
< td class = "org-right" > 23< / td >
< / tr >
< tr >
< td class = "org-right" > 6< / td >
< td class = "org-right" > 37< / td >
< / tr >
< tr >
< td class = "org-right" > 7< / td >
< td class = "org-right" > 55< / td >
< / tr >
< tr >
< td class = "org-right" > 8< / td >
< td class = "org-right" > 78< / td >
< / tr >
< tr >
< td class = "org-right" > 9< / td >
< td class = "org-right" > 106< / td >
< / tr >
< tr >
< td class = "org-right" > 10< / td >
< td class = "org-right" > 140< / td >
< / tr >
< / tbody >
< / table >
2024-02-23 11:17:59 +01:00
< table id = "orgea568be" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
< td class = "org-left" > < code > cord_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Order of polynomials< / td >
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > dim_c_vector< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > out< / td >
2023-05-26 09:53:50 +02:00
< td class = "org-left" > Number of parameters per atom type< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
2022-11-16 18:00:51 +01:00
< pre class = "src src-f90" > < span style = "color: #228b22;" > integer< / span > < span style = "color: #a0522d;" > function qmckl_compute_dim_c_vector_f( < / span > < span style = "color: #a020f0;" > & < / span >
context, cord_num, dim_c_vector) < span style = "color: #a020f0;" > & < / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < 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;" > cord_num< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > dim_c_vector< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > x< / span >
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, a, k, l, p, lmax< / span >
info = QMCKL_SUCCESS
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > if< / span > (cord_num < 0) < span style = "color: #a020f0;" > then< / span >
2022-09-28 18:04:21 +02:00
info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
2022-11-16 18:00:51 +01:00
dim_c_vector = 0
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > do< / span > p = 2, cord_num
< span style = "color: #a020f0;" > do< / span > k = p - 1, 0, -1
< span style = "color: #a020f0;" > if< / span > (k < span style = "color: #a020f0;" > .ne.< / span > 0) < span style = "color: #a020f0;" > then< / span >
lmax = p - k
< span style = "color: #a020f0;" > else< / span >
lmax = p - k - 2
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > do< / span > l = lmax, 0, -1
< span style = "color: #a020f0;" > if< / span > (< span style = "color: #a020f0;" > iand< / span > (p - k - l, 1_8) == 1) < span style = "color: #a020f0;" > cycle< / span >
2022-11-16 18:00:51 +01:00
dim_c_vector = dim_c_vector + 1
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_dim_c_vector_f< / span >
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
2023-05-26 09:53:50 +02:00
< / div >
< / div >
2022-09-28 18:04:21 +02:00
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org07fa6a5" class = "outline-5" >
< h5 id = "org07fa6a5" > < span class = "section-number-5" > 3.3.5.2< / span > Get< / h5 >
2023-05-26 09:53:50 +02:00
< div class = "outline-text-5" id = "text-3-3-5-2" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
2023-05-26 09:53:50 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_tmp_c< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > , < span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > tmp_c< / span > );
< span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_dtmp_c< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > , < span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > dtmp_c< / span > );
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org16c9791" class = "outline-5" >
< h5 id = "org16c9791" > < span class = "section-number-5" > 3.3.5.3< / span > Compute c< sub > vector< / sub > < sub > full< / sub > < / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-5-3" >
2024-02-23 11:17:59 +01:00
< table id = "org4c61272" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
< td class = "org-left" > < code > nucl_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of atoms< / td >
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > dim_c_vector< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > dimension of cord full table< / td >
< / tr >
< tr >
< td class = "org-left" > < code > type_nucl_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > dimension of cord full table< / td >
< / tr >
< tr >
< td class = "org-left" > < code > type_nucl_vector< / code > < / td >
< td class = "org-left" > < code > int64_t[nucl_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > dimension of cord full table< / td >
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > c_vector< / code > < / td >
< td class = "org-left" > < code > double[dim_c_vector][type_nucl_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
< td class = "org-left" > dimension of cord full table< / td >
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > c_vector_full< / code > < / td >
2023-09-12 16:43:06 +02:00
< td class = "org-left" > < code > double[nucl_num][dim_c_vector]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > out< / td >
< td class = "org-left" > Full list of coefficients< / td >
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
2022-11-16 18:00:51 +01:00
< pre class = "src src-f90" > < span style = "color: #228b22;" > integer< / span > < span style = "color: #a0522d;" > function qmckl_compute_c_vector_full_doc_f( < / span > < span style = "color: #a020f0;" > & < / span >
context, nucl_num, dim_c_vector, type_nucl_num, < span style = "color: #a020f0;" > & < / span >
type_nucl_vector, c_vector, c_vector_full) < span style = "color: #a020f0;" > & < / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < 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;" > nucl_num< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > dim_c_vector< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > type_nucl_num< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > type_nucl_vector(nucl_num)< / span >
2023-09-12 16:43:06 +02:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > c_vector(dim_c_vector, type_nucl_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > c_vector_full(nucl_num, dim_c_vector)< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > x< / span >
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, a, k, l, nw< / span >
info = QMCKL_SUCCESS
2023-05-26 09:53:50 +02:00
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > if< / span > (nucl_num < = 0) info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > if< / span > (dim_c_vector < 0) info = QMCKL_INVALID_ARG_3
< span style = "color: #a020f0;" > if< / span > (type_nucl_num < = 0) info = QMCKL_INVALID_ARG_4
< span style = "color: #a020f0;" > if< / span > (info /= QMCKL_SUCCESS) < span style = "color: #a020f0;" > return< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > do< / span > a = 1, nucl_num
2023-09-12 16:43:06 +02:00
c_vector_full(a,1:dim_c_vector) = c_vector(1:dim_c_vector, type_nucl_vector(a)+1)
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > end do< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_c_vector_full_doc_f< / span >
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< div class = "org-src-container" >
2022-11-16 18:00:51 +01:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_c_vector_full_hpc< / span > (
2022-09-28 18:04:21 +02:00
< 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;" > nucl_num< / span > ,
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > dim_c_vector< / span > ,
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > type_nucl_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > * < span style = "color: #a0522d;" > type_nucl_vector< / span > ,
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > c_vector< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > c_vector_full< / span > ) {
2022-09-28 18:04:21 +02:00
2023-05-26 09:53:50 +02:00
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_CONTEXT;
< span style = "color: #a020f0;" > if< / span > (nucl_num < = 0) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_2;
< span style = "color: #a020f0;" > if< / span > (dim_c_vector < 0) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_3;
< span style = "color: #a020f0;" > if< / span > (type_nucl_num < = 0) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_4;
< span style = "color: #a020f0;" > if< / span > (type_nucl_vector == < span style = "color: #008b8b;" > NULL< / span > ) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_5;
< span style = "color: #a020f0;" > if< / span > (c_vector == < span style = "color: #008b8b;" > NULL< / span > ) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_6;
< span style = "color: #a020f0;" > if< / span > (c_vector_full == < span style = "color: #008b8b;" > NULL< / span > ) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_7;
2022-09-28 18:04:21 +02:00
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > i< / span > =0; i < dim_c_vector; ++i) {
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > a< / span > =0; a < nucl_num; ++a){
2023-09-12 16:43:06 +02:00
c_vector_full[a + i*nucl_num] = c_vector[i + type_nucl_vector[a]*dim_c_vector];
2022-09-28 18:04:21 +02:00
}
}
< span style = "color: #a020f0;" > return< / span > QMCKL_SUCCESS;
2023-05-26 09:53:50 +02:00
}
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< div class = "org-src-container" >
2022-11-16 18:00:51 +01:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_c_vector_full_doc< / span > (
2022-09-28 18:04:21 +02:00
< 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;" > nucl_num< / span > ,
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > dim_c_vector< / span > ,
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > type_nucl_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > * < span style = "color: #a0522d;" > type_nucl_vector< / span > ,
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > c_vector< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > c_vector_full< / span > );
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< div class = "org-src-container" >
2022-11-16 18:00:51 +01:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_c_vector_full_hpc< / span > (
2022-09-28 18:04:21 +02:00
< 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;" > nucl_num< / span > ,
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > dim_c_vector< / span > ,
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > type_nucl_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > * < span style = "color: #a0522d;" > type_nucl_vector< / span > ,
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > c_vector< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > c_vector_full< / span > );
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< div class = "org-src-container" >
2022-11-16 18:00:51 +01:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_c_vector_full< / span > (
2022-09-28 18:04:21 +02:00
< 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;" > nucl_num< / span > ,
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > dim_c_vector< / span > ,
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > type_nucl_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > * < span style = "color: #a0522d;" > type_nucl_vector< / span > ,
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > c_vector< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > c_vector_full< / span > ) {
2022-09-28 18:04:21 +02:00
2023-09-21 13:04:54 +02:00
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_HPC
< span style = "color: #a020f0;" > return< / span > qmckl_compute_c_vector_full_hpc
< span style = "color: #483d8b;" > #else< / span >
< span style = "color: #a020f0;" > return< / span > qmckl_compute_c_vector_full_doc
< span style = "color: #483d8b;" > #endif< / span >
(context, nucl_num, dim_c_vector, type_nucl_num, type_nucl_vector, c_vector, c_vector_full);
2022-09-28 18:04:21 +02:00
}
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgb41c94a" class = "outline-5" >
< h5 id = "orgb41c94a" > < span class = "section-number-5" > 3.3.5.4< / span > Compute lkpm< sub > combined< / sub > < sub > index< / sub > < / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-5-4" >
2024-02-23 11:17:59 +01:00
< table id = "org88951e3" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
< td class = "org-left" > < code > cord_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Order of polynomials< / td >
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > dim_c_vector< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > dimension of cord full table< / td >
< / tr >
< tr >
< td class = "org-left" > < code > lkpm_combined_index< / code > < / td >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > int64_t[4][dim_c_vector]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > out< / td >
< td class = "org-left" > Full list of combined indices< / td >
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
2023-09-12 16:43:06 +02:00
< pre class = "src src-f90" > < span style = "color: #228b22;" > integer< / span > < span style = "color: #a0522d;" > function qmckl_compute_lkpm_combined_index_doc_f( < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
context, cord_num, dim_c_vector, lkpm_combined_index) < span style = "color: #a020f0;" > & < / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < 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;" > cord_num< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > dim_c_vector< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > lkpm_combined_index(dim_c_vector, 4)< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > x< / span >
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, a, k, l, kk, p, lmax, m< / span >
info = QMCKL_SUCCESS
2023-05-26 09:53:50 +02:00
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > if< / span > (cord_num < 0) info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > if< / span > (dim_c_vector < 0) info = QMCKL_INVALID_ARG_3
< span style = "color: #a020f0;" > if< / span > (info /= QMCKL_SUCCESS) < span style = "color: #a020f0;" > return< / span >
2022-09-28 18:04:21 +02:00
kk = 0
< span style = "color: #a020f0;" > do< / span > p = 2, cord_num
< span style = "color: #a020f0;" > do< / span > k = p - 1, 0, -1
2023-09-12 16:43:06 +02:00
< span style = "color: #a020f0;" > if< / span > (k /= 0) < span style = "color: #a020f0;" > then< / span >
2022-09-28 18:04:21 +02:00
lmax = p - k
< span style = "color: #a020f0;" > else< / span >
lmax = p - k - 2
< span style = "color: #a020f0;" > end if< / span >
< span style = "color: #a020f0;" > do< / span > l = lmax, 0, -1
2023-09-12 16:43:06 +02:00
< span style = "color: #a020f0;" > if< / span > (< span style = "color: #a020f0;" > iand< / span > (p - k - l, 1_8) < span style = "color: #a020f0;" > .eq.< / span > 1_8) < span style = "color: #a020f0;" > cycle< / span >
2022-09-28 18:04:21 +02:00
m = (p - k - l)/2
kk = kk + 1
lkpm_combined_index(kk, 1) = l
lkpm_combined_index(kk, 2) = k
lkpm_combined_index(kk, 3) = p
lkpm_combined_index(kk, 4) = m
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
2023-09-12 16:43:06 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_lkpm_combined_index_doc_f< / span >
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< div class = "org-src-container" >
2023-09-12 16:43:06 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_lkpm_combined_index_hpc< / span > (
2022-09-28 18:04:21 +02:00
< 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;" > cord_num< / span > ,
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > dim_c_vector< / span > ,
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > int64_t< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > lkpm_combined_index< / span > ) {
< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > kk< / span > , < span style = "color: #a0522d;" > lmax< / span > , < span style = "color: #a0522d;" > m< / span > ;
2023-05-26 09:53:50 +02:00
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_CONTEXT;
< span style = "color: #a020f0;" > if< / span > (cord_num < 0) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_2;
< span style = "color: #a020f0;" > if< / span > (dim_c_vector < 0) < span style = "color: #a020f0;" > return< / span > QMCKL_INVALID_ARG_3;
2022-09-28 18:04:21 +02:00
kk = 0;
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > p< / span > = 2; p < = cord_num; ++p) {
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > k< / span > =(p-1); k > = 0; --k) {
< span style = "color: #a020f0;" > if< / span > (k != 0) {
lmax = p - k;
} < span style = "color: #a020f0;" > else< / span > {
lmax = p - k - 2;
}
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int< / span > < span style = "color: #a0522d;" > l< / span > =lmax; l > = 0; --l) {
< span style = "color: #a020f0;" > if< / span > (((p - k - l) & 1) == 1) < span style = "color: #a020f0;" > continue< / span > ;
m = (p - k - l)/2;
2023-05-26 09:53:50 +02:00
lkpm_combined_index[kk ] = l;
2022-11-16 18:00:51 +01:00
lkpm_combined_index[kk + dim_c_vector] = k;
lkpm_combined_index[kk + 2*dim_c_vector] = p;
lkpm_combined_index[kk + 3*dim_c_vector] = m;
2022-09-28 18:04:21 +02:00
kk = kk + 1;
}
}
}
< span style = "color: #a020f0;" > return< / span > QMCKL_SUCCESS;
}
< / pre >
< / div >
2023-09-12 16:43:06 +02:00
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_lkpm_combined_index< / 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;" > cord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > dim_c_vector< / span > ,
< span style = "color: #228b22;" > int64_t< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > lkpm_combined_index< / span > ) {
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_HPC
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_lkpm_combined_index_hpc
2023-09-12 16:43:06 +02:00
< span style = "color: #483d8b;" > #else< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_lkpm_combined_index_doc
2023-09-12 16:43:06 +02:00
< span style = "color: #483d8b;" > #endif< / span >
2023-09-21 13:04:54 +02:00
(context, cord_num, dim_c_vector, lkpm_combined_index);
2023-09-12 16:43:06 +02:00
}
< / pre >
< / div >
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_lkpm_combined_index< / 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;" > cord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > dim_c_vector< / span > ,
< span style = "color: #228b22;" > int64_t< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > lkpm_combined_index< / span > );
< / pre >
< / div >
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_lkpm_combined_index_doc< / 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;" > cord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > dim_c_vector< / span > ,
< span style = "color: #228b22;" > int64_t< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > lkpm_combined_index< / span > );
< / pre >
2022-09-28 18:04:21 +02:00
< / div >
2023-09-12 16:43:06 +02:00
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_lkpm_combined_index_hpc< / 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;" > cord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > dim_c_vector< / span > ,
< span style = "color: #228b22;" > int64_t< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > lkpm_combined_index< / span > );
< / pre >
2022-09-28 18:04:21 +02:00
< / div >
2023-09-12 16:43:06 +02:00
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_lkpm_combined_index< / 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;" > cord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > dim_c_vector< / span > ,
< span style = "color: #228b22;" > int64_t< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > lkpm_combined_index< / span > );
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgfb959ad" class = "outline-5" >
< h5 id = "orgfb959ad" > < span class = "section-number-5" > 3.3.5.5< / span > Compute tmp< sub > c< / sub > < / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-5-5" >
2024-02-23 11:17:59 +01:00
< table id = "org270bbee" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
< td class = "org-left" > < code > cord_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Order of polynomials< / td >
< / tr >
< tr >
< td class = "org-left" > < code > elec_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of electrons< / td >
< / tr >
< tr >
< td class = "org-left" > < code > nucl_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > Number of nuclei< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
< td class = "org-left" > < code > walk_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of walkers< / td >
< / tr >
< tr >
< td class = "org-left" > < code > een_rescaled_e< / code > < / td >
< td class = "org-left" > < code > double[walk_num][0:cord_num][elec_num][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron-electron rescaled factor< / td >
< / tr >
< tr >
< td class = "org-left" > < code > een_rescaled_n< / code > < / td >
< td class = "org-left" > < code > double[walk_num][0:cord_num][nucl_num][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron-nucleus rescaled factor< / td >
< / tr >
< tr >
< td class = "org-left" > < code > tmp_c< / code > < / td >
< td class = "org-left" > < code > double[walk_num][0:cord_num-1][0:cord_num][nucl_num][elec_num]< / code > < / td >
< td class = "org-left" > out< / td >
< td class = "org-left" > vector of non-zero 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_compute_tmp_c< / 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;" > cord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > nucl_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > een_rescaled_e< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > een_rescaled_n< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > tmp_c< / span > )
{
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_HPC
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_tmp_c_hpc
2022-09-28 18:04:21 +02:00
< span style = "color: #483d8b;" > #else< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_tmp_c_doc
2022-09-28 18:04:21 +02:00
< span style = "color: #483d8b;" > #endif< / span >
2023-09-21 13:04:54 +02:00
(context, cord_num, elec_num, nucl_num, walk_num,
een_rescaled_e, een_rescaled_n, tmp_c);
2022-09-28 18:04:21 +02:00
}
< / pre >
< / div >
< div class = "org-src-container" >
< pre class = "src src-f90" > < span style = "color: #228b22;" > integer< / span > < span style = "color: #a0522d;" > function qmckl_compute_tmp_c_doc_f( < / span > < span style = "color: #a020f0;" > & < / span >
context, cord_num, elec_num, nucl_num, < span style = "color: #a020f0;" > & < / span >
walk_num, een_rescaled_e, een_rescaled_n, tmp_c) < span style = "color: #a020f0;" > & < / span >
< span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < 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;" > cord_num< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > elec_num< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > nucl_num< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > walk_num< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > een_rescaled_e(elec_num, elec_num, 0:cord_num, walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > een_rescaled_n(elec_num, nucl_num, 0:cord_num, walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > tmp_c(elec_num, nucl_num,0:cord_num, 0:cord_num-1, walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > x< / span >
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, j, a, l, kk, p, lmax, nw< / span >
< span style = "color: #228b22;" > character< / span > ::< span style = "color: #a0522d;" > TransA, TransB< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > alpha, beta< / span >
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > M, N, K, LDA, LDB, LDC< / span >
TransA = < span style = "color: #8b2252;" > 'N'< / span >
TransB = < span style = "color: #8b2252;" > 'N'< / span >
alpha = 1.0d0
beta = 0.0d0
info = QMCKL_SUCCESS
2023-05-26 09:53:50 +02:00
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > if< / span > (cord_num < 0) info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) info = QMCKL_INVALID_ARG_3
< span style = "color: #a020f0;" > if< / span > (nucl_num < = 0) info = QMCKL_INVALID_ARG_4
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) info = QMCKL_INVALID_ARG_5
< span style = "color: #a020f0;" > if< / span > (info /= QMCKL_SUCCESS) < span style = "color: #a020f0;" > return< / span >
2022-09-28 18:04:21 +02:00
M = elec_num
N = nucl_num*(cord_num + 1)
K = elec_num
LDA = < span style = "color: #a020f0;" > size< / span > (een_rescaled_e,1)
LDB = < span style = "color: #a020f0;" > size< / span > (een_rescaled_n,1)
LDC = < span style = "color: #a020f0;" > size< / span > (tmp_c,1)
< span style = "color: #a020f0;" > do< / span > nw=1, walk_num
< span style = "color: #a020f0;" > do< / span > i=0, cord_num-1
info = qmckl_dgemm(context, TransA, TransB, M, N, K, alpha, < span style = "color: #a020f0;" > & < / span >
een_rescaled_e(1,1,i,nw),LDA*1_8, < span style = "color: #a020f0;" > & < / span >
een_rescaled_n(1,1,0,nw),LDB*1_8, < span style = "color: #a020f0;" > & < / span >
beta, < span style = "color: #a020f0;" > & < / span >
tmp_c(1,1,0,i,nw),LDC)
< 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_compute_tmp_c_doc_f< / span >
< / pre >
< / div >
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_tmp_c_doc< / 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;" > cord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > nucl_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > een_rescaled_e< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > een_rescaled_n< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > tmp_c< / span > );
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgcfeb440" class = "outline-5" >
< h5 id = "orgcfeb440" > < span class = "section-number-5" > 3.3.5.6< / span > Compute dtmp< sub > c< / sub > < / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-5-6" >
2024-02-23 11:17:59 +01:00
< table id = "orgdd45e84" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
< td class = "org-left" > < code > cord_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Order of polynomials< / td >
< / tr >
< tr >
< td class = "org-left" > < code > elec_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of electrons< / td >
< / tr >
< tr >
< td class = "org-left" > < code > nucl_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > Number of nuclei< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
< td class = "org-left" > < code > walk_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of walkers< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > een_rescaled_e_gl< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > double[walk_num][0:cord_num][elec_num][4][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron-electron rescaled factor derivatives< / td >
< / tr >
< tr >
< td class = "org-left" > < code > een_rescaled_n< / code > < / td >
< td class = "org-left" > < code > double[walk_num][0:cord_num][nucl_num][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron-nucleus rescaled factor< / td >
< / tr >
< tr >
< td class = "org-left" > < code > dtmp_c< / code > < / td >
< td class = "org-left" > < code > double[walk_num][0:cord_num-1][0:cord_num][nucl_num][elec_num]< / code > < / td >
< td class = "org-left" > out< / td >
< td class = "org-left" > vector of non-zero 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_compute_dtmp_c< / 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;" > cord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > nucl_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > walk_num< / span > ,
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > een_rescaled_e_gl< / span > ,
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > een_rescaled_n< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > dtmp_c< / span > )
{
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_HPC
2023-09-27 16:01:32 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_dtmp_c_hpc
2022-09-28 18:04:21 +02:00
< span style = "color: #483d8b;" > #else< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_dtmp_c_doc
2022-09-28 18:04:21 +02:00
< span style = "color: #483d8b;" > #endif< / span >
2023-09-21 13:04:54 +02:00
(context, cord_num, elec_num, nucl_num, walk_num, een_rescaled_e_gl,
een_rescaled_n, dtmp_c );
2022-09-28 18:04:21 +02:00
}
< / pre >
< / div >
< div class = "org-src-container" >
< pre class = "src src-f90" > < span style = "color: #228b22;" > integer< / span > < span style = "color: #a0522d;" > function qmckl_compute_dtmp_c_doc_f( < / span > < span style = "color: #a020f0;" > & < / span >
context, cord_num, elec_num, nucl_num, < span style = "color: #a020f0;" > & < / span >
2023-05-25 01:14:47 +02:00
walk_num, een_rescaled_e_gl, een_rescaled_n, dtmp_c) < span style = "color: #a020f0;" > & < / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < 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;" > cord_num< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > elec_num< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > nucl_num< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > walk_num< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > een_rescaled_e_gl(elec_num, 4, elec_num, 0:cord_num, walk_num)< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > een_rescaled_n(elec_num, nucl_num, 0:cord_num, walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > dtmp_c(elec_num, 4, nucl_num,0:cord_num, 0:cord_num-1, walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > x< / span >
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, j, a, l, kk, p, lmax, nw, ii< / span >
< span style = "color: #228b22;" > character< / span > ::< span style = "color: #a0522d;" > TransA, TransB< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > alpha, beta< / span >
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > M, N, K, LDA, LDB, LDC< / span >
2023-05-26 09:53:50 +02:00
info = QMCKL_SUCCESS
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > if< / span > (cord_num < 0) info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) info = QMCKL_INVALID_ARG_3
< span style = "color: #a020f0;" > if< / span > (nucl_num < = 0) info = QMCKL_INVALID_ARG_4
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) info = QMCKL_INVALID_ARG_5
< span style = "color: #a020f0;" > if< / span > (info /= QMCKL_SUCCESS) < span style = "color: #a020f0;" > return< / span >
2022-09-28 18:04:21 +02:00
TransA = < span style = "color: #8b2252;" > 'N'< / span >
TransB = < span style = "color: #8b2252;" > 'N'< / span >
alpha = 1.0d0
beta = 0.0d0
M = 4*elec_num
N = nucl_num*(cord_num + 1)
K = elec_num
2023-05-25 01:14:47 +02:00
LDA = 4*< span style = "color: #a020f0;" > size< / span > (een_rescaled_e_gl,1)
2022-09-28 18:04:21 +02:00
LDB = < span style = "color: #a020f0;" > size< / span > (een_rescaled_n,1)
LDC = 4*< span style = "color: #a020f0;" > size< / span > (dtmp_c,1)
< span style = "color: #a020f0;" > do< / span > nw=1, walk_num
< span style = "color: #a020f0;" > do< / span > i=0, cord_num-1
info = qmckl_dgemm(context,TransA, TransB, M, N, K, alpha, < span style = "color: #a020f0;" > & < / span >
2023-05-25 01:14:47 +02:00
een_rescaled_e_gl(1,1,1,i,nw),LDA*1_8, < span style = "color: #a020f0;" > & < / span >
2022-09-28 18:04:21 +02:00
een_rescaled_n(1,1,0,nw),LDB*1_8, < span style = "color: #a020f0;" > & < / span >
beta, < span style = "color: #a020f0;" > & < / span >
dtmp_c(1,1,1,0,i,nw),LDC)
< 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_compute_dtmp_c_doc_f< / span >
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org29546b4" class = "outline-5" >
< h5 id = "org29546b4" > < span class = "section-number-5" > 3.3.5.7< / span > Test< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-5-7" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_electron_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > tmp_c< / span > [walk_num][cord_num][cord_num+1][nucl_num][elec_num];
2023-03-30 17:09:05 +02:00
rc = qmckl_get_jastrow_champ_tmp_c(context, & (tmp_c[0][0][0][0][0]));
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > dtmp_c< / span > [walk_num][cord_num][cord_num+1][nucl_num][4][elec_num];
2023-03-30 17:09:05 +02:00
rc = qmckl_get_jastrow_champ_dtmp_c(context, & (dtmp_c[0][0][0][0][0][0]));
2022-09-28 18:04:21 +02:00
2023-05-25 01:14:47 +02:00
printf(< span style = "color: #8b2252;" > "%e\n%e\n"< / span > , tmp_c[0][0][1][0][0], 3.954384);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > tmp_c< / span > [0][0][1][0][0] - 3.954384) < 1e-6);
2022-09-28 18:04:21 +02:00
2023-05-25 01:14:47 +02:00
printf(< span style = "color: #8b2252;" > "%e\n%e\n"< / span > , dtmp_c[0][1][0][0][0][0],3.278657e-01);
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > dtmp_c< / span > [0][1][0][0][0][0] - 3.278657e-01 ) < 1e-6);
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orge98ac12" class = "outline-4" >
< h4 id = "orge98ac12" > < span class = "section-number-4" > 3.3.6< / span > Electron-electron-nucleus Jastrow \(f_{een}\)< / h4 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-4" id = "text-3-3-6" >
2022-09-28 18:04:21 +02:00
< p >
Calculate the electron-electron-nuclear three-body jastrow component < code > factor_een< / code >
using the above prepared tables.
< / p >
< p >
TODO: write equations.
< / p >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org817710d" class = "outline-5" >
< h5 id = "org817710d" > < span class = "section-number-5" > 3.3.6.1< / span > Get< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-6-1" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #0000ff;" > qmckl_get_jastrow_champ_factor_een< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > ,
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > factor_een< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > size_max< / span > );
< / pre >
< / div >
< / div >
2022-11-16 18:00:51 +01:00
2023-03-30 12:35:59 +02:00
< ol class = "org-ol" >
2024-02-23 11:17:59 +01:00
< li > < a id = "orgf40536b" > < / a > Fortran interface< br / >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-6" id = "text-3-3-6-1-1" >
2022-11-16 18:00:51 +01:00
< div class = "org-src-container" >
< pre class = "src src-f90" > < span style = "color: #a020f0;" > interface< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_factor_een (context, < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
factor_een, size_max) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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_max< / span >
2023-09-11 17:07:34 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ), < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > factor_een(size_max)< / span >
2023-03-30 17:09:05 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_factor_een< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #a020f0;" > end interface< / span >
< / pre >
< / div >
< / div >
2023-03-30 12:35:59 +02:00
< / li >
< / ol >
2022-09-28 18:04:21 +02:00
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org965bf14" class = "outline-5" >
< h5 id = "org965bf14" > < span class = "section-number-5" > 3.3.6.2< / span > Compute naive< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-6-2" >
2024-02-23 11:17:59 +01:00
< table id = "org25f960e" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
< td class = "org-left" > < code > walk_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of walkers< / td >
< / tr >
< tr >
< td class = "org-left" > < code > elec_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of electrons< / td >
< / tr >
< tr >
< td class = "org-left" > < code > nucl_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > Number of nuclei< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
< td class = "org-left" > < code > cord_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > order of polynomials< / td >
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > dim_c_vector< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > dimension of full coefficient vector< / td >
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > c_vector_full< / code > < / td >
< td class = "org-left" > < code > double[dim_c_vector][nucl_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
< td class = "org-left" > full coefficient vector< / td >
< / tr >
< tr >
< td class = "org-left" > < code > lkpm_combined_index< / code > < / td >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > int64_t[4][dim_c_vector]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
< td class = "org-left" > combined indices< / td >
< / tr >
< tr >
< td class = "org-left" > < code > een_rescaled_e< / code > < / td >
2023-09-12 16:43:06 +02:00
< td class = "org-left" > < code > double[walk_num][0:cord_num][elec_num][elec_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron-nucleus rescaled< / td >
< / tr >
< tr >
< td class = "org-left" > < code > een_rescaled_n< / code > < / td >
2023-09-12 16:43:06 +02:00
< td class = "org-left" > < code > double[walk_num][0:cord_num][nucl_num][elec_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron-nucleus rescaled factor< / td >
< / tr >
< tr >
< td class = "org-left" > < code > factor_een< / code > < / td >
< td class = "org-left" > < code > double[walk_num]< / code > < / td >
< td class = "org-left" > out< / td >
< td class = "org-left" > Electron-nucleus jastrow< / td >
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
2023-03-31 15:12:07 +02:00
< pre class = "src src-f90" > < span style = "color: #228b22;" > integer< / span > < span style = "color: #a0522d;" > function qmckl_compute_jastrow_champ_factor_een_naive_f( < / span > < span style = "color: #a020f0;" > & < / span >
2022-09-28 18:04:21 +02:00
context, walk_num, elec_num, nucl_num, cord_num,< span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
dim_c_vector, c_vector_full, lkpm_combined_index, < span style = "color: #a020f0;" > & < / span >
2022-09-28 18:04:21 +02:00
een_rescaled_e, een_rescaled_n, factor_een) < span style = "color: #a020f0;" > & < / span >
< span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > context< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > walk_num, elec_num, cord_num, nucl_num, dim_c_vector< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > lkpm_combined_index(dim_c_vector,4)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > c_vector_full(nucl_num, dim_c_vector)< / span >
2023-09-12 16:43:06 +02:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > een_rescaled_e(elec_num, elec_num, 0:cord_num, walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > een_rescaled_n(elec_num, nucl_num, 0:cord_num, walk_num)< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > factor_een(walk_num)< / span >
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, a, j, l, k, p, m, n, nw< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > accu, accu2, cn< / span >
info = QMCKL_SUCCESS
2023-05-26 09:53:50 +02:00
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) info = QMCKL_INVALID_ARG_3
< span style = "color: #a020f0;" > if< / span > (nucl_num < = 0) info = QMCKL_INVALID_ARG_4
< span style = "color: #a020f0;" > if< / span > (cord_num < 0) info = QMCKL_INVALID_ARG_5
< span style = "color: #a020f0;" > if< / span > (info /= QMCKL_SUCCESS) < span style = "color: #a020f0;" > return< / span >
2022-09-28 18:04:21 +02:00
2023-09-12 16:43:06 +02:00
! < span style = "color: #b22222;" > do nw =1, walk_num< / span >
! < span style = "color: #b22222;" > factor_een(nw) = 0.0d0< / span >
! < span style = "color: #b22222;" > do n = 1, dim_c_vector< / span >
! < span style = "color: #b22222;" > l = lkpm_combined_index(n, 1)< / span >
! < span style = "color: #b22222;" > k = lkpm_combined_index(n, 2)< / span >
! < span style = "color: #b22222;" > p = lkpm_combined_index(n, 3)< / span >
! < span style = "color: #b22222;" > m = lkpm_combined_index(n, 4)< / span >
! < span style = "color: #b22222;" > do a = 1, nucl_num< / span >
! < span style = "color: #b22222;" > accu2 = 0.0d0< / span >
! < span style = "color: #b22222;" > cn = c_vector_full(a, n)< / span >
! < span style = "color: #b22222;" > do j = 1, elec_num< / span >
! < span style = "color: #b22222;" > accu = 0.0d0< / span >
! < span style = "color: #b22222;" > do i = 1, elec_num< / span >
! < span style = "color: #b22222;" > accu = accu + een_rescaled_e(i,j,k,nw) * & < / span >
! < span style = "color: #b22222;" > een_rescaled_n(i,a,m,nw)< / span >
! < span style = "color: #b22222;" > end do< / span >
! < span style = "color: #b22222;" > accu2 = accu2 + accu * een_rescaled_n(j,a,m + l,nw)< / span >
! < span style = "color: #b22222;" > end do< / span >
! < span style = "color: #b22222;" > factor_een(nw) = factor_een(nw) + accu2 * cn< / span >
! < span style = "color: #b22222;" > end do< / span >
! < span style = "color: #b22222;" > end do< / span >
! < span style = "color: #b22222;" > end do< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > do< / span > nw =1, walk_num
2023-09-12 16:43:06 +02:00
factor_een(nw) = 0.d0
< span style = "color: #a020f0;" > do< / span > n = 1, dim_c_vector
l = lkpm_combined_index(n, 1)
k = lkpm_combined_index(n, 2)
p = lkpm_combined_index(n, 3)
m = lkpm_combined_index(n, 4)
2022-09-28 18:04:21 +02:00
2023-09-12 16:43:06 +02:00
< span style = "color: #a020f0;" > do< / span > a = 1, nucl_num
accu2 = 0.0d0
cn = c_vector_full(a, n)
< span style = "color: #a020f0;" > print< / span > *, a, l, k, p, cn
< span style = "color: #a020f0;" > do< / span > j = 1, elec_num
accu = 0.0d0
< span style = "color: #a020f0;" > do< / span > i = 1, j-1
accu = accu + een_rescaled_e(i,j,k,nw) * < span style = "color: #a020f0;" > & < / span >
(een_rescaled_n(i,a,l,nw) + een_rescaled_n(j,a,l,nw)) * < span style = "color: #a020f0;" > & < / span >
(een_rescaled_n(i,a,m,nw) * een_rescaled_n(j,a,m,nw))
< span style = "color: #a020f0;" > end do< / span >
2023-09-27 16:01:32 +02:00
accu2 = accu2 + accu
2023-09-12 16:43:06 +02:00
< span style = "color: #a020f0;" > end do< / span >
factor_een(nw) = factor_een(nw) + accu2 * cn
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > end do< / span >
2023-09-12 16:43:06 +02:00
< span style = "color: #a020f0;" > end do< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > end do< / span >
2023-03-31 15:12:07 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_een_naive_f< / span >
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgb8b5386" class = "outline-5" >
< h5 id = "orgb8b5386" > < span class = "section-number-5" > 3.3.6.3< / span > Compute< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-6-3" >
2024-02-23 11:17:59 +01:00
< table id = "org9b3e1fc" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
< td class = "org-left" > < code > walk_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of walkers< / td >
< / tr >
< tr >
< td class = "org-left" > < code > elec_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of electrons< / td >
< / tr >
< tr >
< td class = "org-left" > < code > nucl_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > Number of nuclei< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
< td class = "org-left" > < code > cord_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > order of polynomials< / td >
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > dim_c_vector< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > dimension of full coefficient vector< / td >
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > c_vector_full< / code > < / td >
< td class = "org-left" > < code > double[dim_c_vector][nucl_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
< td class = "org-left" > full coefficient vector< / td >
< / tr >
< tr >
< td class = "org-left" > < code > lkpm_combined_index< / code > < / td >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > int64_t[4][dim_c_vector]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
< td class = "org-left" > combined indices< / td >
< / tr >
< tr >
< td class = "org-left" > < code > tmp_c< / code > < / td >
< td class = "org-left" > < code > double[walk_num][0:cord_num-1][0:cord_num][nucl_num][elec_num]< / code > < / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > in< / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > vector of non-zero coefficients< / td >
< / tr >
< tr >
< td class = "org-left" > < code > een_rescaled_n< / code > < / td >
< td class = "org-left" > < code > double[walk_num][0:cord_num][nucl_num][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > Electron-nucleus rescaled distances< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
< td class = "org-left" > < code > factor_een< / code > < / td >
< td class = "org-left" > < code > double[walk_num]< / code > < / td >
< td class = "org-left" > out< / td >
< td class = "org-left" > Electron-nucleus jastrow< / td >
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
2023-03-31 15:12:07 +02:00
< pre class = "src src-f90" > < span style = "color: #228b22;" > integer< / span > < span style = "color: #a0522d;" > function qmckl_compute_jastrow_champ_factor_een_doc_f( < / span > < span style = "color: #a020f0;" > & < / span >
2022-09-28 18:04:21 +02:00
context, walk_num, elec_num, nucl_num, cord_num, < span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
dim_c_vector, c_vector_full, lkpm_combined_index, < span style = "color: #a020f0;" > & < / span >
2022-09-28 18:04:21 +02:00
tmp_c, een_rescaled_n, factor_een) < span style = "color: #a020f0;" > & < / span >
< span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > context< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > walk_num, elec_num, cord_num, nucl_num, dim_c_vector< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > lkpm_combined_index(dim_c_vector,4)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > c_vector_full(nucl_num, dim_c_vector)< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > tmp_c(elec_num, nucl_num,0:cord_num, 0:cord_num-1, walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > een_rescaled_n(elec_num, nucl_num, 0:cord_num, walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > factor_een(walk_num)< / span >
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, a, j, l, k, p, m, n, nw< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > accu, accu2, cn< / span >
info = QMCKL_SUCCESS
2023-05-26 09:53:50 +02:00
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) info = QMCKL_INVALID_ARG_3
< span style = "color: #a020f0;" > if< / span > (nucl_num < = 0) info = QMCKL_INVALID_ARG_4
< span style = "color: #a020f0;" > if< / span > (cord_num < 0) info = QMCKL_INVALID_ARG_5
< span style = "color: #a020f0;" > if< / span > (info /= QMCKL_SUCCESS) < span style = "color: #a020f0;" > return< / span >
2022-09-28 18:04:21 +02:00
factor_een = 0.0d0
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > if< / span > (cord_num == 0) < span style = "color: #a020f0;" > return< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > do< / span > nw =1, walk_num
2023-03-31 15:12:07 +02:00
< span style = "color: #a020f0;" > do< / span > n = 1, dim_c_vector
l = lkpm_combined_index(n, 1)
k = lkpm_combined_index(n, 2)
p = lkpm_combined_index(n, 3)
m = lkpm_combined_index(n, 4)
2022-09-28 18:04:21 +02:00
2023-03-31 15:12:07 +02:00
< span style = "color: #a020f0;" > do< / span > a = 1, nucl_num
cn = c_vector_full(a, n)
< span style = "color: #a020f0;" > if< / span > (cn == 0.d0) < span style = "color: #a020f0;" > cycle< / span >
2022-09-28 18:04:21 +02:00
2023-03-31 15:12:07 +02:00
accu = 0.0d0
< span style = "color: #a020f0;" > do< / span > j = 1, elec_num
accu = accu + een_rescaled_n(j,a,m,nw) * tmp_c(j,a,m+l,k,nw)
< span style = "color: #a020f0;" > end do< / span >
factor_een(nw) = factor_een(nw) + accu * cn
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > end do< / span >
2023-03-31 15:12:07 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_een_doc_f< / span >
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org7d82288" class = "outline-5" >
< h5 id = "org7d82288" > < span class = "section-number-5" > 3.3.6.4< / span > Test< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-6-4" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
2022-11-18 14:16:53 +01:00
< pre class = "src src-c" > /* < span style = "color: #b22222;" > Check if Jastrow is properly initialized< / span > */
2023-03-30 17:09:05 +02:00
< span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_jastrow_champ_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > factor_een< / span > [walk_num];
2023-03-30 17:09:05 +02:00
rc = qmckl_get_jastrow_champ_factor_een(context, & (factor_een[0]),walk_num);
2022-09-28 18:04:21 +02:00
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > assert< / span > (fabs(< span style = "color: #228b22;" > factor_een< / span > [0] + 0.382580260174321) < 1e-12);
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org514e5df" class = "outline-4" >
< h4 id = "org514e5df" > < span class = "section-number-4" > 3.3.7< / span > Electron-electron-nucleus Jastrow \(f_{een}\) derivative< / h4 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-4" id = "text-3-3-7" >
2022-09-28 18:04:21 +02:00
< p >
2023-05-25 01:14:47 +02:00
Calculate the electron-electron-nuclear three-body jastrow component < code > factor_een_gl< / code >
2022-09-28 18:04:21 +02:00
using the above prepared tables.
< / p >
< p >
TODO: write equations.
< / p >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org6ef7304" class = "outline-5" >
< h5 id = "org6ef7304" > < span class = "section-number-5" > 3.3.7.1< / span > Get< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-7-1" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > qmckl_get_jastrow_champ_factor_een_gl< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > factor_een_gl< / span > ,
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > size_max< / span > );
< / pre >
< / div >
< / div >
2023-05-26 09:53:50 +02:00
< ol class = "org-ol" >
2024-02-23 11:17:59 +01:00
< li > < a id = "org76345ac" > < / a > Fortran interface< br / >
2023-05-26 09:53:50 +02:00
< div class = "outline-text-6" id = "text-3-3-7-1-1" >
< div class = "org-src-container" >
< pre class = "src src-f90" > < span style = "color: #a020f0;" > interface< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_factor_een_gl (context, < / span > < span style = "color: #a020f0;" > & < / span >
factor_een_gl, size_max) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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_max< / span >
2023-09-11 17:07:34 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ), < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > factor_een_gl(size_max)< / span >
2023-05-26 09:53:50 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_factor_een_gl< / span >
< span style = "color: #a020f0;" > end interface< / span >
< / pre >
< / div >
< / div >
< / li >
< / ol >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org994c10b" class = "outline-5" >
< h5 id = "org994c10b" > < span class = "section-number-5" > 3.3.7.2< / span > Compute Naive< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-7-2" >
2024-02-23 11:17:59 +01:00
< table id = "orga3d226d" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
< td class = "org-left" > < code > walk_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of walkers< / td >
< / tr >
< tr >
< td class = "org-left" > < code > elec_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of electrons< / td >
< / tr >
< tr >
< td class = "org-left" > < code > nucl_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > Number of nuclei< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
< td class = "org-left" > < code > cord_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > order of polynomials< / td >
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > dim_c_vector< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > dimension of full coefficient vector< / td >
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > c_vector_full< / code > < / td >
< td class = "org-left" > < code > double[dim_c_vector][nucl_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
< td class = "org-left" > full coefficient vector< / td >
< / tr >
< tr >
< td class = "org-left" > < code > lkpm_combined_index< / code > < / td >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > int64_t[4][dim_c_vector]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
< td class = "org-left" > combined indices< / td >
< / tr >
< tr >
< td class = "org-left" > < code > een_rescaled_e< / code > < / td >
2023-09-12 17:52:42 +02:00
< td class = "org-left" > < code > double[walk_num][0:cord_num][elec_num][elec_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron-nucleus rescaled< / td >
< / tr >
< tr >
< td class = "org-left" > < code > een_rescaled_n< / code > < / td >
2023-09-12 17:52:42 +02:00
< td class = "org-left" > < code > double[walk_num][0:cord_num][nucl_num][elec_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron-nucleus rescaled factor< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > een_rescaled_e_gl< / code > < / td >
2023-09-12 17:52:42 +02:00
< td class = "org-left" > < code > double[walk_num][0:cord_num][elec_num][4][elec_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron-nucleus rescaled< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > een_rescaled_n_gl< / code > < / td >
2023-09-12 17:52:42 +02:00
< td class = "org-left" > < code > double[walk_num][0:cord_num][nucl_num][4][elec_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron-nucleus rescaled factor< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > factor_een_gl< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > double[walk_num][4][elec_num]< / code > < / td >
< td class = "org-left" > out< / td >
< td class = "org-left" > Electron-nucleus jastrow< / td >
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
2023-05-25 01:14:47 +02:00
< pre class = "src src-f90" > < span style = "color: #228b22;" > integer< / span > < span style = "color: #a0522d;" > function qmckl_compute_jastrow_champ_factor_een_gl_naive_f( < / span > < span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
context, walk_num, elec_num, nucl_num, cord_num, dim_c_vector, < span style = "color: #a020f0;" > & < / span >
c_vector_full, lkpm_combined_index, een_rescaled_e, een_rescaled_n, < span style = "color: #a020f0;" > & < / span >
2023-05-25 01:14:47 +02:00
een_rescaled_e_gl, een_rescaled_n_gl, factor_een_gl)< span style = "color: #a020f0;" > & < / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > context< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > walk_num, elec_num, cord_num, nucl_num, dim_c_vector< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > lkpm_combined_index(dim_c_vector, 4)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > c_vector_full(nucl_num, dim_c_vector)< / span >
2023-09-12 17:52:42 +02:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > een_rescaled_e(elec_num, elec_num, 0:cord_num, walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > een_rescaled_n(elec_num, nucl_num, 0:cord_num, walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > een_rescaled_e_gl(elec_num, 4, elec_num, 0:cord_num, walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > een_rescaled_n_gl(elec_num, 4, nucl_num, 0:cord_num, walk_num)< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > factor_een_gl(elec_num, 4, walk_num)< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, a, j, l, k, p, m, n, nw< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > accu, accu2, cn< / span >
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > daccu(1:4), daccu2(1:4)< / span >
info = QMCKL_SUCCESS
2023-05-26 09:53:50 +02:00
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) info = QMCKL_INVALID_ARG_3
< span style = "color: #a020f0;" > if< / span > (nucl_num < = 0) info = QMCKL_INVALID_ARG_4
< span style = "color: #a020f0;" > if< / span > (cord_num < 0) info = QMCKL_INVALID_ARG_5
< span style = "color: #a020f0;" > if< / span > (info /= QMCKL_SUCCESS) < span style = "color: #a020f0;" > return< / span >
2022-09-28 18:04:21 +02:00
2023-05-25 01:14:47 +02:00
factor_een_gl = 0.0d0
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > do< / span > nw =1, walk_num
2023-09-12 17:52:42 +02:00
< span style = "color: #a020f0;" > do< / span > n = 1, dim_c_vector
l = lkpm_combined_index(n, 1)
k = lkpm_combined_index(n, 2)
p = lkpm_combined_index(n, 3)
m = lkpm_combined_index(n, 4)
2022-09-28 18:04:21 +02:00
2023-09-12 17:52:42 +02:00
< span style = "color: #a020f0;" > do< / span > a = 1, nucl_num
cn = c_vector_full(a, n)
< span style = "color: #a020f0;" > do< / span > j = 1, elec_num
accu = 0.0d0
accu2 = 0.0d0
daccu = 0.0d0
daccu2 = 0.0d0
< span style = "color: #a020f0;" > do< / span > i = 1, elec_num
accu = accu + een_rescaled_e(i, j, k, nw) * een_rescaled_n(i, a, m, nw)
accu2 = accu2 + een_rescaled_e(i, j, k, nw) * een_rescaled_n(i, a, m + l, nw)
daccu(1:4) = daccu(1:4) + een_rescaled_e_gl(j, 1:4, i, k, nw) * < span style = "color: #a020f0;" > & < / span >
een_rescaled_n(i, a, m, nw)
daccu2(1:4) = daccu2(1:4) + een_rescaled_e_gl(j, 1:4, i, k, nw) * < span style = "color: #a020f0;" > & < / span >
een_rescaled_n(i, a, m + l, nw)
< span style = "color: #a020f0;" > end do< / span >
factor_een_gl(j, 1:4, nw) = factor_een_gl(j, 1:4, nw) + < span style = "color: #a020f0;" > & < / span >
(accu * een_rescaled_n_gl(j, 1:4, a, m + l, nw) < span style = "color: #a020f0;" > & < / span >
+ daccu(1:4) * een_rescaled_n(j, a, m + l, nw) < span style = "color: #a020f0;" > & < / span >
+ daccu2(1:4) * een_rescaled_n(j, a, m, nw) < span style = "color: #a020f0;" > & < / span >
+ accu2 * een_rescaled_n_gl(j, 1:4, a, m, nw)) * cn
factor_een_gl(j, 4, nw) = factor_een_gl(j, 4, nw) + 2.0d0 * ( < span style = "color: #a020f0;" > & < / span >
daccu (1) * een_rescaled_n_gl(j, 1, a, m + l, nw) + < span style = "color: #a020f0;" > & < / span >
daccu (2) * een_rescaled_n_gl(j, 2, a, m + l, nw) + < span style = "color: #a020f0;" > & < / span >
daccu (3) * een_rescaled_n_gl(j, 3, a, m + l, nw) + < span style = "color: #a020f0;" > & < / span >
daccu2(1) * een_rescaled_n_gl(j, 1, a, m, nw ) + < span style = "color: #a020f0;" > & < / span >
daccu2(2) * een_rescaled_n_gl(j, 2, a, m, nw ) + < span style = "color: #a020f0;" > & < / span >
daccu2(3) * een_rescaled_n_gl(j, 3, a, m, nw ) ) * cn
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > end do< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_een_gl_naive_f< / span >
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org30eb4a9" class = "outline-5" >
< h5 id = "org30eb4a9" > < span class = "section-number-5" > 3.3.7.3< / span > Compute< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-7-3" >
2024-02-23 11:17:59 +01:00
< table id = "orgf59398a" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2022-09-28 18:04:21 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
< td class = "org-left" > < code > walk_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of walkers< / td >
< / tr >
< tr >
< td class = "org-left" > < code > elec_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of electrons< / td >
< / tr >
< tr >
< td class = "org-left" > < code > nucl_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
2023-03-31 15:12:07 +02:00
< td class = "org-left" > Number of nuclei< / td >
2022-09-28 18:04:21 +02:00
< / tr >
< tr >
< td class = "org-left" > < code > cord_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > order of polynomials< / td >
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > dim_c_vector< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > dimension of full coefficient vector< / td >
< / tr >
< tr >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > c_vector_full< / code > < / td >
< td class = "org-left" > < code > double[dim_c_vector][nucl_num]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
< td class = "org-left" > full coefficient vector< / td >
< / tr >
< tr >
< td class = "org-left" > < code > lkpm_combined_index< / code > < / td >
2022-11-16 18:00:51 +01:00
< td class = "org-left" > < code > int64_t[4][dim_c_vector]< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > in< / td >
< td class = "org-left" > combined indices< / td >
< / tr >
< tr >
< td class = "org-left" > < code > tmp_c< / code > < / td >
< td class = "org-left" > < code > double[walk_num][0:cord_num-1][0:cord_num][nucl_num][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Temporary intermediate tensor< / td >
< / tr >
< tr >
< td class = "org-left" > < code > dtmp_c< / code > < / td >
< td class = "org-left" > < code > double[walk_num][0:cord_num-1][0:cord_num][nucl_num][4][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > vector of non-zero coefficients< / td >
< / tr >
< tr >
< td class = "org-left" > < code > een_rescaled_n< / code > < / td >
< td class = "org-left" > < code > double[walk_num][0:cord_num][nucl_num][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Electron-nucleus rescaled factor< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > een_rescaled_n_gl< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > double[walk_num][0:cord_num][nucl_num][4][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Derivative of Electron-nucleus rescaled factor< / td >
< / tr >
< tr >
2023-05-25 01:14:47 +02:00
< td class = "org-left" > < code > factor_een_gl< / code > < / td >
2022-09-28 18:04:21 +02:00
< td class = "org-left" > < code > double[walk_num][4][elec_num]< / code > < / td >
< td class = "org-left" > out< / td >
< td class = "org-left" > Derivative of Electron-nucleus jastrow< / td >
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
2023-05-25 01:14:47 +02:00
< pre class = "src src-f90" > < span style = "color: #228b22;" > integer< / span > < span style = "color: #a0522d;" > function qmckl_compute_jastrow_champ_factor_een_gl_doc_f( < / span > < span style = "color: #a020f0;" > & < / span >
2022-09-28 18:04:21 +02:00
context, walk_num, elec_num, nucl_num, < span style = "color: #a020f0;" > & < / span >
2022-11-16 18:00:51 +01:00
cord_num, dim_c_vector, c_vector_full, lkpm_combined_index, < span style = "color: #a020f0;" > & < / span >
2023-05-25 01:14:47 +02:00
tmp_c, dtmp_c, een_rescaled_n, een_rescaled_n_gl, factor_een_gl)< span style = "color: #a020f0;" > & < / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > context< / span >
2022-11-16 18:00:51 +01:00
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > walk_num, elec_num, cord_num, nucl_num, dim_c_vector< / span >
< span style = "color: #228b22;" > integer< / span > *8 , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > lkpm_combined_index(dim_c_vector,4)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > c_vector_full(nucl_num, dim_c_vector)< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > tmp_c(elec_num, nucl_num,0:cord_num, 0:cord_num-1, walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > dtmp_c(elec_num, 4, nucl_num,0:cord_num, 0:cord_num-1, walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > een_rescaled_n(elec_num, nucl_num, 0:cord_num, walk_num)< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > een_rescaled_n_gl(elec_num, 4, nucl_num, 0:cord_num, walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > factor_een_gl(elec_num,4,walk_num)< / span >
2022-09-28 18:04:21 +02:00
2023-04-11 19:18:24 +02:00
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, a, j, l, k, m, n, nw, ii< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #228b22;" > double precision< / span > ::< span style = "color: #a0522d;" > accu, accu2, cn< / span >
info = QMCKL_SUCCESS
2023-05-26 09:53:50 +02:00
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > if< / span > (elec_num < = 0) info = QMCKL_INVALID_ARG_3
< span style = "color: #a020f0;" > if< / span > (nucl_num < = 0) info = QMCKL_INVALID_ARG_4
< span style = "color: #a020f0;" > if< / span > (cord_num < 0) info = QMCKL_INVALID_ARG_5
< span style = "color: #a020f0;" > if< / span > (info /= QMCKL_SUCCESS) < span style = "color: #a020f0;" > return< / span >
2022-09-28 18:04:21 +02:00
2023-05-25 01:14:47 +02:00
factor_een_gl = 0.0d0
< span style = "color: #a020f0;" > if< / span > (cord_num == 0) < span style = "color: #a020f0;" > return< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > do< / span > nw =1, walk_num
2023-04-11 19:18:24 +02:00
< span style = "color: #a020f0;" > do< / span > n = 1, dim_c_vector
l = lkpm_combined_index(n, 1)
k = lkpm_combined_index(n, 2)
m = lkpm_combined_index(n, 4)
2022-09-28 18:04:21 +02:00
2023-04-11 19:18:24 +02:00
< span style = "color: #a020f0;" > do< / span > a = 1, nucl_num
cn = c_vector_full(a, n)
< span style = "color: #a020f0;" > if< / span > (cn == 0.d0) < span style = "color: #a020f0;" > cycle< / span >
2022-09-28 18:04:21 +02:00
2023-04-11 19:18:24 +02:00
< span style = "color: #a020f0;" > do< / span > ii = 1, 4
< span style = "color: #a020f0;" > do< / span > j = 1, elec_num
2023-05-25 01:14:47 +02:00
factor_een_gl(j,ii,nw) = factor_een_gl(j,ii,nw) + ( < span style = "color: #a020f0;" > & < / span >
tmp_c(j,a,m,k,nw) * een_rescaled_n_gl(j,ii,a,m+l,nw) + < span style = "color: #a020f0;" > & < / span >
2023-04-11 19:18:24 +02:00
(dtmp_c(j,ii,a,m,k,nw)) * een_rescaled_n(j,a,m+l,nw) + < span style = "color: #a020f0;" > & < / span >
(dtmp_c(j,ii,a,m+l,k,nw)) * een_rescaled_n(j,a,m ,nw) + < span style = "color: #a020f0;" > & < / span >
2023-05-25 01:14:47 +02:00
tmp_c(j,a,m+l,k,nw) * een_rescaled_n_gl(j,ii,a,m,nw) < span style = "color: #a020f0;" > & < / span >
2023-04-11 19:18:24 +02:00
) * cn
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
2022-09-28 18:04:21 +02:00
2023-04-11 19:18:24 +02:00
cn = cn + cn
< span style = "color: #a020f0;" > do< / span > j = 1, elec_num
2023-05-26 09:53:50 +02:00
factor_een_gl(j,4,nw) = factor_een_gl(j,4,nw) + ( < span style = "color: #a020f0;" > & < / span >
2023-05-25 01:14:47 +02:00
(dtmp_c(j,1,a,m ,k,nw)) * een_rescaled_n_gl(j,1,a,m+l,nw) + < span style = "color: #a020f0;" > & < / span >
(dtmp_c(j,2,a,m ,k,nw)) * een_rescaled_n_gl(j,2,a,m+l,nw) + < span style = "color: #a020f0;" > & < / span >
(dtmp_c(j,3,a,m ,k,nw)) * een_rescaled_n_gl(j,3,a,m+l,nw) + < span style = "color: #a020f0;" > & < / span >
(dtmp_c(j,1,a,m+l,k,nw)) * een_rescaled_n_gl(j,1,a,m ,nw) + < span style = "color: #a020f0;" > & < / span >
(dtmp_c(j,2,a,m+l,k,nw)) * een_rescaled_n_gl(j,2,a,m ,nw) + < span style = "color: #a020f0;" > & < / span >
(dtmp_c(j,3,a,m+l,k,nw)) * een_rescaled_n_gl(j,3,a,m ,nw) < span style = "color: #a020f0;" > & < / span >
2023-04-11 19:18:24 +02:00
) * cn
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
2022-09-28 18:04:21 +02:00
< span style = "color: #a020f0;" > end do< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_een_gl_doc_f< / span >
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
2023-04-11 19:18:24 +02:00
< div class = "org-src-container" >
2023-05-25 01:14:47 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_een_gl_doc< / span > (
2023-04-11 19:18:24 +02:00
< 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > nucl_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > cord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > dim_c_vector< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > c_vector_full< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > * < span style = "color: #a0522d;" > lkpm_combined_index< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > tmp_c< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > dtmp_c< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > een_rescaled_n< / span > ,
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > een_rescaled_n_gl< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > factor_een_gl< / span > );
2023-04-11 19:18:24 +02:00
< / pre >
2022-09-28 18:04:21 +02:00
< / div >
2023-04-11 19:18:24 +02:00
< div class = "org-src-container" >
2023-05-25 01:14:47 +02:00
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_een_gl< / span > (
2023-04-11 19:18:24 +02:00
< 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > nucl_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > cord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > dim_c_vector< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > c_vector_full< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > * < span style = "color: #a0522d;" > lkpm_combined_index< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > tmp_c< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > dtmp_c< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > een_rescaled_n< / span > ,
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > een_rescaled_n_gl< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > factor_een_gl< / span > );
2023-04-11 19:18:24 +02:00
< / pre >
2022-09-28 18:04:21 +02:00
< / div >
2023-04-11 19:18:24 +02:00
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span >
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_factor_een_gl< / span > (< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > ,
2023-04-11 19:18:24 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > nucl_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > cord_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > dim_c_vector< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > *< span style = "color: #a0522d;" > c_vector_full< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > *< span style = "color: #a0522d;" > lkpm_combined_index< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > *< span style = "color: #a0522d;" > tmp_c< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > *< span style = "color: #a0522d;" > dtmp_c< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > *< span style = "color: #a0522d;" > een_rescaled_n< / span > ,
2023-05-25 01:14:47 +02:00
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > *< span style = "color: #a0522d;" > een_rescaled_n_gl< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > factor_een_gl< / span > )
2023-04-11 19:18:24 +02:00
{
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_HPC
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_jastrow_champ_factor_een_gl_hpc
2023-04-11 19:18:24 +02:00
< span style = "color: #483d8b;" > #else< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_jastrow_champ_factor_een_gl_doc
2023-04-11 19:18:24 +02:00
< span style = "color: #483d8b;" > #endif< / span >
2023-09-21 13:04:54 +02:00
(context, walk_num, elec_num, nucl_num,
cord_num, dim_c_vector, c_vector_full,
lkpm_combined_index, tmp_c, dtmp_c,
een_rescaled_n, een_rescaled_n_gl,
factor_een_gl);
2023-04-11 19:18:24 +02:00
}
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org9906cc2" class = "outline-5" >
< h5 id = "org9906cc2" > < span class = "section-number-5" > 3.3.7.4< / span > Test< / h5 >
2023-03-30 12:35:59 +02:00
< div class = "outline-text-5" id = "text-3-3-7-4" >
2022-09-28 18:04:21 +02:00
< div class = "org-src-container" >
2022-11-18 14:16:53 +01:00
< pre class = "src src-c" > /* < span style = "color: #b22222;" > Check if Jastrow is properly initialized< / span > */
2023-03-30 17:09:05 +02:00
< span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_jastrow_champ_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
2022-09-28 18:04:21 +02:00
2023-05-25 01:14:47 +02:00
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > factor_een_gl< / span > [4][walk_num][elec_num];
rc = qmckl_get_jastrow_champ_factor_een_gl(context, & (factor_een_gl[0][0][0]),4*walk_num*elec_num);
2022-09-28 18:04:21 +02:00
2023-05-26 09:53:50 +02:00
printf(< span style = "color: #8b2252;" > "%20.15e\n"< / span > , factor_een_gl[0][0][0]);
2023-05-25 01:14:47 +02:00
< span style = "color: #0000ff;" > assert< / span > (fabs(8.967809309100624e-02 - factor_een_gl[0][0][0]) < 1e-12);
2023-04-11 19:18:24 +02:00
2023-05-26 09:53:50 +02:00
printf(< span style = "color: #8b2252;" > "%20.15e\n"< / span > , factor_een_gl[1][0][1]);
2023-09-12 17:52:42 +02:00
< span style = "color: #0000ff;" > assert< / span > (fabs(3.543090132452453e-02 - factor_een_gl[1][0][1]) < 1e-12);
2023-04-11 19:18:24 +02:00
2023-05-26 09:53:50 +02:00
printf(< span style = "color: #8b2252;" > "%20.15e\n"< / span > , factor_een_gl[2][0][2]);
2023-09-12 17:52:42 +02:00
< span style = "color: #0000ff;" > assert< / span > (fabs(8.996044894431991e-04 - factor_een_gl[2][0][2]) < 1e-12);
2023-04-11 19:18:24 +02:00
2023-05-26 09:53:50 +02:00
printf(< span style = "color: #8b2252;" > "%20.15e\n"< / span > , factor_een_gl[3][0][3]);
2023-09-12 17:52:42 +02:00
< span style = "color: #0000ff;" > assert< / span > (fabs(-1.175028308456619e+00 - factor_een_gl[3][0][3]) < 1e-12);
2022-09-28 18:04:21 +02:00
< / pre >
< / div >
< / div >
< / div >
< / div >
2023-03-30 12:35:59 +02:00
< / div >
2022-11-16 18:00:51 +01:00
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgab44f4e" class = "outline-3" >
< h3 id = "orgab44f4e" > < span class = "section-number-3" > 3.4< / span > Total Jastrow< / h3 >
2023-03-30 17:09:05 +02:00
< div class = "outline-text-3" id = "text-3-4" >
2023-03-31 15:12:07 +02:00
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org31266fa" class = "outline-4" >
< h4 id = "org31266fa" > < span class = "section-number-4" > 3.4.1< / span > Value< / h4 >
2023-03-31 15:12:07 +02:00
< div class = "outline-text-4" id = "text-3-4-1" >
2023-03-30 17:09:05 +02:00
< p >
2023-03-31 15:12:07 +02:00
Value of the total Jastrow factor: \(\exp(J)\)
2023-03-30 17:09:05 +02:00
< / p >
< / div >
2023-03-31 15:12:07 +02:00
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orgb93747b" class = "outline-5" >
< h5 id = "orgb93747b" > < span class = "section-number-5" > 3.4.1.1< / span > Get< / h5 >
2023-03-31 15:12:07 +02:00
< div class = "outline-text-5" id = "text-3-4-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_get_jastrow_champ_value< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > value< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > size_max< / span > );
< / pre >
< / div >
< / div >
< ol class = "org-ol" >
2024-02-23 11:17:59 +01:00
< li > < a id = "org8639102" > < / a > Fortran interface< br / >
2023-03-31 15:12:07 +02:00
< div class = "outline-text-6" id = "text-3-4-1-1-1" >
< div class = "org-src-container" >
< pre class = "src src-f90" > < span style = "color: #a020f0;" > interface< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_value (context, < / span > < span style = "color: #a020f0;" > & < / span >
< span style = "color: #a020f0;" > value< / span > , size_max) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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_max< / span >
2023-09-11 17:07:34 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ), < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > value(size_max)< / span >
2023-03-31 15:12:07 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_value< / span >
< span style = "color: #a020f0;" > end interface< / span >
< / pre >
< / div >
< / div >
< / li >
< / ol >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org90ec58a" class = "outline-5" >
< h5 id = "org90ec58a" > < span class = "section-number-5" > 3.4.1.2< / span > Compute< / h5 >
2023-03-31 15:12:07 +02:00
< div class = "outline-text-5" id = "text-3-4-1-2" >
2024-02-23 11:17:59 +01:00
< table id = "org9375726" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2023-03-31 15:12:07 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
< td class = "org-left" > < code > walk_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of walkers< / td >
< / tr >
< tr >
< td class = "org-left" > < code > f_ee< / code > < / td >
< td class = "org-left" > < code > double[walk_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > ee component< / td >
< / tr >
< tr >
< td class = "org-left" > < code > f_en< / code > < / td >
< td class = "org-left" > < code > double[walk_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > eN component< / td >
< / tr >
< tr >
< td class = "org-left" > < code > f_een< / code > < / td >
< td class = "org-left" > < code > double[walk_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > eeN component< / td >
< / tr >
< tr >
< td class = "org-left" > < code > value< / code > < / td >
< td class = "org-left" > < code > double[walk_num]< / code > < / td >
< td class = "org-left" > out< / td >
< td class = "org-left" > Total Jastrow factor< / td >
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
< pre class = "src src-f90" > < span style = "color: #228b22;" > integer< / span > < span style = "color: #a0522d;" > function qmckl_compute_jastrow_champ_value_doc_f(context, < / span > < span style = "color: #a020f0;" > & < / span >
walk_num, f_ee, f_en, f_een, < span style = "color: #a020f0;" > value< / span > ) < span style = "color: #a020f0;" > & < / span >
< span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < 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;" > walk_num< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > f_ee(walk_num), f_en(walk_num), f_een(walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > value(walk_num)< / span >
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i< / span >
info = QMCKL_SUCCESS
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > do< / span > i = 1, walk_num
< span style = "color: #a020f0;" > value< / span > (i) = f_ee(i) + f_en(i) + f_een(i)
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > do< / span > i = 1, walk_num
2023-08-23 14:34:17 +02:00
! < span style = "color: #b22222;" > Flush to zero to avoid floating-point exception< / span >
< span style = "color: #a020f0;" > if< / span > (< span style = "color: #a020f0;" > value< / span > (i) < -100.d0) < span style = "color: #a020f0;" > then< / span >
< span style = "color: #a020f0;" > value< / span > (i) = 0.d0
< span style = "color: #a020f0;" > else< / span >
< span style = "color: #a020f0;" > value< / span > (i) = dexp(< span style = "color: #a020f0;" > value< / span > (i))
< span style = "color: #a020f0;" > endif< / span >
2023-03-31 15:12:07 +02:00
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_value_doc_f< / span >
< / pre >
< / div >
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_value< / 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > f_ee< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > f_en< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > f_een< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > value< / span > );
< / pre >
< / div >
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_value_doc< / 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > f_ee< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > f_en< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > f_een< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > value< / span > );
< / pre >
< / div >
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_value_hpc< / 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > f_ee< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > f_en< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > f_een< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > value< / span > );
< / pre >
< / div >
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_value< / 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > factor_ee< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > factor_en< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > factor_een< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > value< / span > )
{
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_HPC
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_jastrow_champ_value_hpc
2023-03-31 15:12:07 +02:00
< span style = "color: #483d8b;" > #else< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_jastrow_champ_value_doc
2023-03-31 15:12:07 +02:00
< span style = "color: #483d8b;" > #endif< / span >
2023-09-21 13:04:54 +02:00
(context, walk_num, factor_ee, factor_en, factor_een, value);
2023-03-31 15:12:07 +02:00
}
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org03323cd" class = "outline-5" >
< h5 id = "org03323cd" > < span class = "section-number-5" > 3.4.1.3< / span > Test< / h5 >
2023-03-31 15:12:07 +02:00
< div class = "outline-text-5" id = "text-3-4-1-3" >
< div class = "org-src-container" >
< pre class = "src src-c" > printf(< span style = "color: #8b2252;" > "Total Jastrow value\n"< / span > );
/* < span style = "color: #b22222;" > Check if Jastrow is properly initialized< / span > */
< span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_jastrow_champ_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
rc = qmckl_check(context,
qmckl_get_jastrow_champ_factor_ee(context, & (factor_ee[0]), walk_num)
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
rc = qmckl_check(context,
qmckl_get_jastrow_champ_factor_en(context, & (factor_en[0]), walk_num)
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
rc = qmckl_check(context,
qmckl_get_jastrow_champ_factor_een(context, & (factor_een[0]), walk_num)
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > total_j< / span > [walk_num];
rc = qmckl_check(context,
qmckl_get_jastrow_champ_value(context, & (total_j[0]), walk_num)
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > i< / span > =0 ; i< walk_num ; ++i) {
assert (total_j[i] - exp(factor_ee[i] + factor_en[i] + factor_een[i]) < 1.e-12);
}
< / pre >
< / div >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org36a06b3" class = "outline-4" >
< h4 id = "org36a06b3" > < span class = "section-number-4" > 3.4.2< / span > Derivatives< / h4 >
2023-03-31 15:12:07 +02:00
< div class = "outline-text-4" id = "text-3-4-2" >
< p >
Gradients and Laplacian of the total Jastrow factor:
\[
\nabla \left[ e^{J(\mathbf{r})} \right] = e^{J(\mathbf{r})} \nabla J(\mathbf{r})
\]
\[
\Delta \left[ e^{J(\mathbf{r})} \right] = e^{J(\mathbf{r})}
\left[ \Delta J(\mathbf{r}) + \nabla J(\mathbf{r}) \cdot \nabla J(\mathbf{r}) \right]
\]
< / p >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org646b2a6" class = "outline-5" >
< h5 id = "org646b2a6" > < span class = "section-number-5" > 3.4.2.1< / span > Get< / h5 >
2023-03-31 15:12:07 +02:00
< div class = "outline-text-5" id = "text-3-4-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_get_jastrow_champ_gl< / span > (< span style = "color: #228b22;" > qmckl_context< / span > < span style = "color: #a0522d;" > context< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > gl< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > size_max< / span > );
< / pre >
< / div >
< / div >
< ol class = "org-ol" >
2024-02-23 11:17:59 +01:00
< li > < a id = "org2efd178" > < / a > Fortran interface< br / >
2023-03-31 15:12:07 +02:00
< div class = "outline-text-6" id = "text-3-4-2-1-1" >
< div class = "org-src-container" >
< pre class = "src src-f90" > < span style = "color: #a020f0;" > interface< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_exit_code)< span style = "color: #a0522d;" > function qmckl_get_jastrow_champ_gl (context, < / span > < span style = "color: #a020f0;" > & < / span >
gl, size_max) < 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;" > import< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context) , < 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_max< / span >
2023-09-11 17:07:34 +02:00
< span style = "color: #228b22;" > real< / span > (< span style = "color: #008b8b;" > c_double< / span > ), < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > gl(size_max)< / span >
2023-03-31 15:12:07 +02:00
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_get_jastrow_champ_gl< / span >
< span style = "color: #a020f0;" > end interface< / span >
< / pre >
< / div >
< / div >
< / li >
< / ol >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-orge8d10c4" class = "outline-5" >
< h5 id = "orge8d10c4" > < span class = "section-number-5" > 3.4.2.2< / span > Compute< / h5 >
2023-03-31 15:12:07 +02:00
< div class = "outline-text-5" id = "text-3-4-2-2" >
2024-02-23 11:17:59 +01:00
< table id = "org96b5f89" border = "2" cellspacing = "0" cellpadding = "6" rules = "groups" frame = "hsides" >
2023-03-31 15:12:07 +02:00
< colgroup >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< col class = "org-left" / >
< / colgroup >
< thead >
< tr >
< th scope = "col" class = "org-left" > Variable< / th >
< th scope = "col" class = "org-left" > Type< / th >
< th scope = "col" class = "org-left" > In/Out< / th >
< th scope = "col" class = "org-left" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "org-left" > < code > context< / code > < / td >
< td class = "org-left" > < code > qmckl_context< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Global state< / td >
< / tr >
< tr >
< td class = "org-left" > < code > walk_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of walkers< / td >
< / tr >
< tr >
< td class = "org-left" > < code > elec_num< / code > < / td >
< td class = "org-left" > < code > int64_t< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Number of electrons< / td >
< / tr >
< tr >
< td class = "org-left" > < code > value< / code > < / td >
< td class = "org-left" > < code > double[walk_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > Total Jastrow< / td >
< / tr >
< tr >
< td class = "org-left" > < code > gl_ee< / code > < / td >
< td class = "org-left" > < code > double[walk_num][4][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > ee component< / td >
< / tr >
< tr >
< td class = "org-left" > < code > gl_en< / code > < / td >
< td class = "org-left" > < code > double[walk_num][4][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > eN component< / td >
< / tr >
< tr >
< td class = "org-left" > < code > gl_een< / code > < / td >
< td class = "org-left" > < code > double[walk_num][4][elec_num]< / code > < / td >
< td class = "org-left" > in< / td >
< td class = "org-left" > eeN component< / td >
< / tr >
< tr >
< td class = "org-left" > < code > gl< / code > < / td >
< td class = "org-left" > < code > double[walk_num][4][elec_num]< / code > < / td >
< td class = "org-left" > out< / td >
< td class = "org-left" > Total Jastrow factor< / td >
< / tr >
< / tbody >
< / table >
< div class = "org-src-container" >
< pre class = "src src-f90" > < span style = "color: #228b22;" > integer< / span > < span style = "color: #a0522d;" > function qmckl_compute_jastrow_champ_gl_doc_f(context, < / span > < span style = "color: #a020f0;" > & < / span >
walk_num, elec_num, < span style = "color: #a020f0;" > value< / span > , gl_ee, gl_en, gl_een, gl) < span style = "color: #a020f0;" > & < / span >
< span style = "color: #a020f0;" > result< / span > (info)
< span style = "color: #a020f0;" > use< / span > < span style = "color: #0000ff;" > qmckl< / span >
< span style = "color: #a020f0;" > implicit< / span > < span style = "color: #228b22;" > none< / span >
< span style = "color: #228b22;" > integer< / span > (qmckl_context), < 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;" > walk_num, elec_num< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > value (walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > gl_ee (elec_num,4,walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > gl_en (elec_num,4,walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (in) ::< span style = "color: #a0522d;" > gl_een(elec_num,4,walk_num)< / span >
< span style = "color: #228b22;" > double precision< / span > , < span style = "color: #a020f0;" > intent< / span > (out) ::< span style = "color: #a0522d;" > gl (elec_num,4,walk_num)< / span >
< span style = "color: #228b22;" > integer< / span > *8 ::< span style = "color: #a0522d;" > i, j, k< / span >
info = QMCKL_SUCCESS
< span style = "color: #a020f0;" > if< / span > (context == QMCKL_NULL_CONTEXT) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_CONTEXT
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > if< / span > (walk_num < = 0) < span style = "color: #a020f0;" > then< / span >
info = QMCKL_INVALID_ARG_2
< span style = "color: #a020f0;" > return< / span >
< span style = "color: #a020f0;" > endif< / span >
< span style = "color: #a020f0;" > do< / span > k = 1, walk_num
< span style = "color: #a020f0;" > do< / span > j=1,4
< span style = "color: #a020f0;" > do< / span > i = 1, elec_num
gl(i,j,k) = gl_ee(i,j,k) + gl_en(i,j,k) + gl_een(i,j,k)
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > do< / span > i = 1, elec_num
gl(i,4,k) = gl(i,4,k) + < span style = "color: #a020f0;" > & < / span >
gl(i,1,k) * gl(i,1,k) + < span style = "color: #a020f0;" > & < / span >
gl(i,2,k) * gl(i,2,k) + < span style = "color: #a020f0;" > & < / span >
gl(i,3,k) * gl(i,3,k)
< span style = "color: #a020f0;" > end do< / span >
gl(:,:,k) = gl(:,:,k) * < span style = "color: #a020f0;" > value< / span > (k)
< span style = "color: #a020f0;" > end do< / span >
< span style = "color: #a020f0;" > end function< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_gl_doc_f< / span >
< / pre >
< / div >
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_gl< / 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > value< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > gl_ee< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > gl_en< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > gl_een< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > gl< / span > );
< / pre >
< / div >
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_gl_doc< / 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > value< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > gl_ee< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > gl_en< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > gl_een< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > gl< / span > );
< / pre >
< / div >
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_gl_hpc< / 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > value< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > gl_ee< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > gl_en< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > gl_een< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > gl< / span > );
< / pre >
< / div >
< div class = "org-src-container" >
< pre class = "src src-c" > < span style = "color: #228b22;" > qmckl_exit_code< / span > < span style = "color: #0000ff;" > qmckl_compute_jastrow_champ_gl< / 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;" > walk_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > elec_num< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > value< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > gl_ee< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > gl_en< / span > ,
< span style = "color: #a020f0;" > const< / span > < span style = "color: #228b22;" > double< / span > * < span style = "color: #a0522d;" > gl_een< / span > ,
< span style = "color: #228b22;" > double< / span > * < span style = "color: #a020f0;" > const< / span > < span style = "color: #a0522d;" > gl< / span > )
{
< span style = "color: #483d8b;" > #ifdef< / span > HAVE_HPC
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_jastrow_champ_gl_hpc
2023-03-31 15:12:07 +02:00
< span style = "color: #483d8b;" > #else< / span >
2023-09-21 13:04:54 +02:00
< span style = "color: #a020f0;" > return< / span > qmckl_compute_jastrow_champ_gl_doc
2023-03-31 15:12:07 +02:00
< span style = "color: #483d8b;" > #endif< / span >
2023-09-21 13:04:54 +02:00
(context, walk_num, elec_num, value, gl_ee, gl_en, gl_een, gl);
2023-03-31 15:12:07 +02:00
}
< / pre >
< / div >
< / div >
< / div >
2024-02-23 11:17:59 +01:00
< div id = "outline-container-org344c4f8" class = "outline-5" >
< h5 id = "org344c4f8" > < span class = "section-number-5" > 3.4.2.3< / span > Test< / h5 >
2023-03-31 15:12:07 +02:00
< div class = "outline-text-5" id = "text-3-4-2-3" >
< div class = "org-src-container" >
< pre class = "src src-c" > printf(< span style = "color: #8b2252;" > "Total Jastrow derivatives\n"< / span > );
/* < span style = "color: #b22222;" > Check if Jastrow is properly initialized< / span > */
< span style = "color: #0000ff;" > assert< / span > (< span style = "color: #228b22;" > qmckl_jastrow_champ_provided< / span > (< span style = "color: #a0522d;" > context< / span > ));
rc = qmckl_check(context,
2023-05-25 01:14:47 +02:00
qmckl_get_jastrow_champ_factor_ee_gl(context, & (factor_ee_gl[0][0][0]), walk_num*elec_num*4)
2023-03-31 15:12:07 +02:00
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
rc = qmckl_check(context,
2023-05-25 01:14:47 +02:00
qmckl_get_jastrow_champ_factor_en_gl(context, & (factor_en_gl[0][0][0]), walk_num*elec_num*4)
2023-03-31 15:12:07 +02:00
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
rc = qmckl_check(context,
2023-05-25 01:14:47 +02:00
qmckl_get_jastrow_champ_factor_een_gl(context, & (factor_een_gl[0][0][0]), walk_num*elec_num*4)
2023-03-31 15:12:07 +02:00
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
< span style = "color: #228b22;" > double< / span > < span style = "color: #a0522d;" > total_j_deriv< / span > [walk_num][4][elec_num];
rc = qmckl_check(context,
qmckl_get_jastrow_champ_gl(context, & (total_j_deriv[0][0][0]), walk_num*elec_num*4)
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
rc = qmckl_check(context,
qmckl_get_jastrow_champ_value(context, & (total_j[0]), walk_num)
);
< span style = "color: #0000ff;" > assert< / span > (rc == QMCKL_SUCCESS);
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > k< / span > =0 ; k< walk_num ; ++k) {
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > m< / span > =0 ; m< 4; ++m) {
< span style = "color: #a020f0;" > for< / span > (< span style = "color: #228b22;" > int64_t< / span > < span style = "color: #a0522d;" > e< / span > =0 ; e< elec_num; ++e) {
< span style = "color: #a020f0;" > if< / span > (m < 3) { /* < span style = "color: #b22222;" > test only gradients< / span > */
2023-05-25 01:14:47 +02:00
assert (total_j_deriv[k][m][e]/total_j[k] - (factor_ee_gl[k][m][e] + factor_en_gl[k][m][e] + factor_een_gl[k][m][e]) < 1.e-12);
2023-03-31 15:12:07 +02:00
}
}
}
}
< / pre >
< / div >
< / div >
< / div >
< / div >
2022-11-16 18:00:51 +01:00
< / div >
2022-09-28 18:04:21 +02:00
< / div >
< / div >
< div id = "postamble" class = "status" >
< p class = "author" > Author: TREX CoE< / p >
2024-02-23 11:17:59 +01:00
< p class = "date" > Created: 2024-02-23 Fri 10:17< / p >
2022-09-28 18:04:21 +02:00
< p class = "validation" > < a href = "http://validator.w3.org/check?uri=referer" > Validate< / a > < / p >
< / div >
< / body >
< / html >