2021-07-08 08:58:56 +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>
|
2022-08-07 15:32:06 +02:00
|
|
|
<!-- 2022-08-07 Sun 13:31 -->
|
2021-07-08 08:58:56 +02:00
|
|
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
|
|
<title>Jastrow Factor</title>
|
|
|
|
<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; }
|
|
|
|
.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.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012-2019 Free Software Foundation, Inc.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* The JavaScript code in this tag is free software: you can
|
|
|
|
* redistribute it and/or modify it under the terms of the GNU
|
|
|
|
* General Public License (GNU GPL) as published by the Free Software
|
|
|
|
* Foundation, either version 3 of the License, or (at your option)
|
|
|
|
* any later version. The code is distributed WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
|
|
|
|
*
|
|
|
|
* As additional permission under GNU GPL version 3 section 7, you
|
|
|
|
* may distribute non-source (e.g., minimized or compacted) forms of
|
|
|
|
* that code without the copy of the GNU GPL normally required by
|
|
|
|
* section 4, provided you include this license notice and a URL
|
|
|
|
* through which recipients can access the Corresponding Source.
|
|
|
|
*
|
|
|
|
* @licend The above is the entire license notice
|
|
|
|
* for the JavaScript code in org-info.js.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
/*
|
|
|
|
@licstart The following is the entire license notice for the
|
|
|
|
JavaScript code in this tag.
|
|
|
|
|
|
|
|
Copyright (C) 2012-2019 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
The JavaScript code in this tag is free software: you can
|
|
|
|
redistribute it and/or modify it under the terms of the GNU
|
|
|
|
General Public License (GNU GPL) as published by the Free Software
|
|
|
|
Foundation, either version 3 of the License, or (at your option)
|
|
|
|
any later version. The code is distributed WITHOUT ANY WARRANTY;
|
|
|
|
without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
|
|
|
|
|
|
|
|
As additional permission under GNU GPL version 3 section 7, you
|
|
|
|
may distribute non-source (e.g., minimized or compacted) forms of
|
|
|
|
that code without the copy of the GNU GPL normally required by
|
|
|
|
section 4, provided you include this license notice and a URL
|
|
|
|
through which recipients can access the Corresponding Source.
|
|
|
|
|
|
|
|
|
|
|
|
@licend The above is the entire license notice
|
|
|
|
for the JavaScript code in this tag.
|
|
|
|
*/
|
|
|
|
|
|
|
|
<!--/*--><![CDATA[/*><!--*/
|
|
|
|
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.
|
|
|
|
|
|
|
|
Copyright (C) 2012-2019 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
The JavaScript code in this tag is free software: you can
|
|
|
|
redistribute it and/or modify it under the terms of the GNU
|
|
|
|
General Public License (GNU GPL) as published by the Free Software
|
|
|
|
Foundation, either version 3 of the License, or (at your option)
|
|
|
|
any later version. The code is distributed WITHOUT ANY WARRANTY;
|
|
|
|
without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
|
|
|
|
|
|
|
|
As additional permission under GNU GPL version 3 section 7, you
|
|
|
|
may distribute non-source (e.g., minimized or compacted) forms of
|
|
|
|
that code without the copy of the GNU GPL normally required by
|
|
|
|
section 4, provided you include this license notice and a URL
|
|
|
|
through which recipients can access the Corresponding Source.
|
|
|
|
|
|
|
|
|
|
|
|
@licend The above is the entire license notice
|
|
|
|
for the JavaScript code in this tag.
|
|
|
|
*/
|
|
|
|
<!--/*--><![CDATA[/*><!--*/
|
|
|
|
function CodeHighlightOn(elem, id)
|
|
|
|
{
|
|
|
|
var target = document.getElementById(id);
|
|
|
|
if(null != target) {
|
|
|
|
elem.cacheClassElem = elem.className;
|
|
|
|
elem.cacheClassTarget = target.className;
|
|
|
|
target.className = "code-highlighted";
|
|
|
|
elem.className = "code-highlighted";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function CodeHighlightOff(elem, id)
|
|
|
|
{
|
|
|
|
var target = document.getElementById(id);
|
|
|
|
if(elem.cacheClassElem)
|
|
|
|
elem.className = elem.cacheClassElem;
|
|
|
|
if(elem.cacheClassTarget)
|
|
|
|
target.className = elem.cacheClassTarget;
|
|
|
|
}
|
|
|
|
/*]]>*///-->
|
|
|
|
</script>
|
|
|
|
<script type="text/x-mathjax-config">
|
|
|
|
MathJax.Hub.Config({
|
|
|
|
displayAlign: "center",
|
|
|
|
displayIndent: "0em",
|
|
|
|
|
|
|
|
"HTML-CSS": { scale: 100,
|
|
|
|
linebreaks: { automatic: "false" },
|
|
|
|
webFont: "TeX"
|
|
|
|
},
|
|
|
|
SVG: {scale: 100,
|
|
|
|
linebreaks: { automatic: "false" },
|
|
|
|
font: "TeX"},
|
|
|
|
NativeMML: {scale: 100},
|
|
|
|
TeX: { equationNumbers: {autoNumber: "AMS"},
|
|
|
|
MultLineWidth: "85%",
|
|
|
|
TagSide: "right",
|
|
|
|
TagIndent: ".8em"
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
<script type="text/javascript"
|
|
|
|
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML"></script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="org-div-home-and-up">
|
|
|
|
<a accesskey="h" href=""> UP </a>
|
|
|
|
|
|
|
|
|
<a accesskey="H" href="index.html"> HOME </a>
|
|
|
|
</div><div id="content">
|
|
|
|
<h1 class="title">Jastrow Factor</h1>
|
|
|
|
<div id="table-of-contents">
|
|
|
|
<h2>Table of Contents</h2>
|
|
|
|
<div id="text-table-of-contents">
|
|
|
|
<ul>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org5b16385">1. Introduction</a></li>
|
|
|
|
<li><a href="#orgf41d098">2. Context</a>
|
2021-07-08 08:58:56 +02:00
|
|
|
<ul>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org14bb8c7">2.1. Data structure</a></li>
|
|
|
|
<li><a href="#orgec6bc6c">2.2. Access functions</a></li>
|
|
|
|
<li><a href="#org2645009">2.3. Initialization functions</a></li>
|
|
|
|
<li><a href="#orge078794">2.4. Test</a></li>
|
2021-07-08 08:58:56 +02:00
|
|
|
</ul>
|
|
|
|
</li>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org210ab61">3. Computation</a>
|
2021-07-08 08:58:56 +02:00
|
|
|
<ul>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org420b0d6">3.1. Asymptotic component for \(J_{ee}\)</a>
|
2021-07-08 08:58:56 +02:00
|
|
|
<ul>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org394c07f">3.1.1. Get</a></li>
|
|
|
|
<li><a href="#orgec807c2">3.1.2. Compute</a></li>
|
|
|
|
<li><a href="#org1ae33a7">3.1.3. Test</a></li>
|
2021-07-08 08:58:56 +02:00
|
|
|
</ul>
|
|
|
|
</li>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org8392c7e">3.2. Electron-electron component \(f_{ee}\)</a>
|
2021-07-08 08:58:56 +02:00
|
|
|
<ul>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org24119ed">3.2.1. Get</a></li>
|
|
|
|
<li><a href="#orgd19579c">3.2.2. Compute</a></li>
|
|
|
|
<li><a href="#orgbe63954">3.2.3. Test</a></li>
|
2021-07-08 08:58:56 +02:00
|
|
|
</ul>
|
|
|
|
</li>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org140ce01">3.3. Electron-electron component derivative \(f'_{ee}\)</a>
|
2021-07-08 08:58:56 +02:00
|
|
|
<ul>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#orge83f3ac">3.3.1. Get</a></li>
|
|
|
|
<li><a href="#org1713dec">3.3.2. Compute</a></li>
|
|
|
|
<li><a href="#org472ebce">3.3.3. Test</a></li>
|
2021-07-08 08:58:56 +02:00
|
|
|
</ul>
|
|
|
|
</li>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org5dbb7de">3.4. Electron-nucleus component \(f_{en}\)</a>
|
2021-07-08 08:58:56 +02:00
|
|
|
<ul>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org785da5d">3.4.1. Get</a></li>
|
|
|
|
<li><a href="#org6824485">3.4.2. Compute</a></li>
|
|
|
|
<li><a href="#orgcbfe8dc">3.4.3. Test</a></li>
|
2021-07-08 08:58:56 +02:00
|
|
|
</ul>
|
|
|
|
</li>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org7eb8d8e">3.5. Electron-nucleus component derivative \(f'_{en}\)</a>
|
2021-07-08 08:58:56 +02:00
|
|
|
<ul>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org7983207">3.5.1. Get</a></li>
|
|
|
|
<li><a href="#org40d44b0">3.5.2. Compute</a></li>
|
|
|
|
<li><a href="#orge840786">3.5.3. Test</a></li>
|
2021-07-08 08:58:56 +02:00
|
|
|
</ul>
|
|
|
|
</li>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org857e640">3.6. Electron-electron rescaled distances for each order</a>
|
2021-07-08 08:58:56 +02:00
|
|
|
<ul>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org34c3450">3.6.1. Get</a></li>
|
|
|
|
<li><a href="#org934d603">3.6.2. Compute</a></li>
|
|
|
|
<li><a href="#org0aec18e">3.6.3. Test</a></li>
|
2021-07-08 08:58:56 +02:00
|
|
|
</ul>
|
|
|
|
</li>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#orgd1bb0bc">3.7. Electron-electron rescaled distances for each order and derivatives</a>
|
2021-07-08 08:58:56 +02:00
|
|
|
<ul>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org95a750b">3.7.1. Get</a></li>
|
|
|
|
<li><a href="#orga927e8c">3.7.2. Compute</a></li>
|
|
|
|
<li><a href="#orgddeac19">3.7.3. Test</a></li>
|
2021-07-08 08:58:56 +02:00
|
|
|
</ul>
|
|
|
|
</li>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org52cfd6f">3.8. Electron-nucleus rescaled distances for each order</a>
|
2021-07-08 08:58:56 +02:00
|
|
|
<ul>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org2ad7096">3.8.1. Get</a></li>
|
|
|
|
<li><a href="#orge4e6f88">3.8.2. Compute</a></li>
|
|
|
|
<li><a href="#org608d6c9">3.8.3. Test</a></li>
|
2021-07-08 08:58:56 +02:00
|
|
|
</ul>
|
|
|
|
</li>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org973cbe9">3.9. Electron-nucleus rescaled distances for each order and derivatives</a>
|
2021-07-08 08:58:56 +02:00
|
|
|
<ul>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#orgf494d42">3.9.1. Get</a></li>
|
|
|
|
<li><a href="#org0a362d4">3.9.2. Compute</a></li>
|
|
|
|
<li><a href="#org4b40bbd">3.9.3. Test</a></li>
|
2021-07-08 08:58:56 +02:00
|
|
|
</ul>
|
|
|
|
</li>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#orge323870">3.10. Prepare for electron-electron-nucleus Jastrow \(f_{een}\)</a>
|
2021-07-08 08:58:56 +02:00
|
|
|
<ul>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org23ba4b3">3.10.1. Get</a></li>
|
|
|
|
<li><a href="#org7e2918e">3.10.2. Compute dim<sub>cord</sub><sub>vect</sub></a></li>
|
|
|
|
<li><a href="#org8182ca5">3.10.3. Compute cord<sub>vect</sub><sub>full</sub></a></li>
|
|
|
|
<li><a href="#orgd8d9fa3">3.10.4. Compute lkpm<sub>combined</sub><sub>index</sub></a></li>
|
|
|
|
<li><a href="#orgf03a4a9">3.10.5. Compute tmp<sub>c</sub></a></li>
|
|
|
|
<li><a href="#org1a3f048">3.10.6. Compute dtmp<sub>c</sub></a></li>
|
|
|
|
<li><a href="#org68ade7b">3.10.7. Test</a></li>
|
2021-07-08 08:58:56 +02:00
|
|
|
</ul>
|
|
|
|
</li>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org9701237">3.11. Electron-electron-nucleus Jastrow \(f_{een}\)</a>
|
2021-07-08 08:58:56 +02:00
|
|
|
<ul>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#orgd2ea189">3.11.1. Get</a></li>
|
|
|
|
<li><a href="#org5ec8946">3.11.2. Compute naive</a></li>
|
|
|
|
<li><a href="#org40baf6c">3.11.3. Compute</a></li>
|
|
|
|
<li><a href="#org8d308b8">3.11.4. Test</a></li>
|
2021-07-08 08:58:56 +02:00
|
|
|
</ul>
|
|
|
|
</li>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org7c50d49">3.12. Electron-electron-nucleus Jastrow \(f_{een}\) derivative</a>
|
2021-07-08 08:58:56 +02:00
|
|
|
<ul>
|
2022-08-07 15:32:06 +02:00
|
|
|
<li><a href="#org3d34419">3.12.1. Get</a></li>
|
|
|
|
<li><a href="#org5d7a97d">3.12.2. Compute Naive</a></li>
|
|
|
|
<li><a href="#orge175a91">3.12.3. Compute</a></li>
|
|
|
|
<li><a href="#orgcfdfa67">3.12.4. Test</a></li>
|
2021-07-08 08:58:56 +02:00
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org5b16385" class="outline-2">
|
|
|
|
<h2 id="org5b16385"><span class="section-number-2">1</span> Introduction</h2>
|
2021-07-08 08:58:56 +02:00
|
|
|
<div class="outline-text-2" id="text-1">
|
|
|
|
<p>
|
2022-02-09 14:39:28 +01:00
|
|
|
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>
|
|
|
|
\[
|
2022-02-15 00:46:38 +01:00
|
|
|
J(\mathbf{r},\mathbf{R}) = J_{\text{eN}}(\mathbf{r},\mathbf{R}) + J_{\text{ee}}(\mathbf{r}) + J_{\text{eeN}}(\mathbf{r},\mathbf{R})
|
2022-02-09 14:39:28 +01:00
|
|
|
\]
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
2022-02-15 00:46:38 +01:00
|
|
|
In the following, we us the notations \(r_{ij} = |\mathbf{r}_i - \mathbf{r}_j|\) and
|
2022-02-09 14:39:28 +01:00
|
|
|
\(R_{i\alpha} = |\mathbf{r}_i - \mathbf{R}_\alpha|\).
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
\(J_{\text{eN}}\) contains electron-nucleus terms:
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
\[
|
|
|
|
J_{\text{eN}}(\mathbf{r},\mathbf{R}) = \sum_{i=1}^{N_\text{elec}} \sum_{\alpha=1}^{N_\text{nucl}}
|
|
|
|
\frac{a_1\, f(R_{i\alpha})}{1+a_2\, f(R_{i\alpha})} +
|
|
|
|
\sum_{p=2}^{N_\text{ord}^a} a_{p+1}\, [f(R_{i\alpha})]^p - J_{eN}^\infty
|
|
|
|
\]
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
2022-02-15 00:46:38 +01:00
|
|
|
\(J_{\text{ee}}\) contains electron-electron terms:
|
2022-02-09 14:39:28 +01:00
|
|
|
\[
|
2022-02-15 00:46:38 +01:00
|
|
|
J_{\text{ee}}(\mathbf{r}) =
|
2022-02-09 14:39:28 +01:00
|
|
|
\sum_{i=1}^{N_\text{elec}} \sum_{j=1}^{i-1}
|
|
|
|
\frac{b_1\, f(r_{ij})}{1+b_2\, f(r_{ij})} +
|
|
|
|
\sum_{p=2}^{N_\text{ord}^b} a_{p+1}\, [f(r_{ij})]^p - J_{ee}^\infty
|
|
|
|
\]
|
|
|
|
</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}}
|
|
|
|
c_{lkp\alpha} \left[ g({r}_{ij}) \right]^k
|
|
|
|
\left[ \left[ g({R}_{i\alpha}) \right]^l + \left[ g({R}_{j\alpha}) \right]^l \right]
|
2022-02-15 00:46:38 +01:00
|
|
|
\left[ g({R}_{i\,\alpha}) \, g({R}_{j\alpha}) \right]^{(p-k-l)/2}
|
2022-02-09 14:39:28 +01:00
|
|
|
\]
|
|
|
|
</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>
|
|
|
|
\[
|
|
|
|
f(r) = \frac{1-e^{-\kappa\, r}}{\kappa} \text{ and }
|
|
|
|
g(r) = e^{-\kappa\, r}.
|
|
|
|
\]
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
2022-02-15 00:46:38 +01:00
|
|
|
The terms \(J_{\text{ee}}^\infty\) and \(J_{\text{eN}}^\infty\) are shifts to ensure that
|
2022-02-09 14:39:28 +01:00
|
|
|
\(J_{\text{ee}}\) and \(J_{\text{eN}}\) have an asymptotic value of zero.
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-orgf41d098" class="outline-2">
|
|
|
|
<h2 id="orgf41d098"><span class="section-number-2">2</span> Context</h2>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-2" id="text-2">
|
|
|
|
<p>
|
2021-07-08 08:58:56 +02:00
|
|
|
The following data stored in the context:
|
|
|
|
</p>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<table id="org50f0238" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
<colgroup>
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
</colgroup>
|
2022-01-06 02:30:32 +01:00
|
|
|
<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>
|
2021-07-08 08:58:56 +02:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>uninitialized</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>int32_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
2022-02-09 14:39:28 +01:00
|
|
|
<td class="org-left">Keeps bits set for uninitialized data</td>
|
2021-07-08 08:58:56 +02:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>aord_num</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">The number of a coeffecients</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>bord_num</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">The number of b coeffecients</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>cord_num</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">The number of c coeffecients</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>type_nucl_num</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of Nucleii types</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>type_nucl_vector</code></td>
|
|
|
|
<td class="org-left"><code>int64_t[nucl_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
2022-06-11 10:59:32 +02:00
|
|
|
<td class="org-left">IDs of types of Nuclei</td>
|
2021-07-08 08:58:56 +02:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>aord_vector</code></td>
|
|
|
|
<td class="org-left"><code>double[aord_num + 1][type_nucl_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Order of a polynomial coefficients</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>bord_vector</code></td>
|
|
|
|
<td class="org-left"><code>double[bord_num + 1]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Order of b polynomial coefficients</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>cord_vector</code></td>
|
|
|
|
<td class="org-left"><code>double[cord_num][type_nucl_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Order of c polynomial coefficients</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>factor_ee</code></td>
|
2022-08-07 15:32:06 +02:00
|
|
|
<td class="org-left"><code>double[walker.num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">Jastrow factor: electron-electron part</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>factor_ee_date</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>uint64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">Jastrow factor: electron-electron part</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>factor_en</code></td>
|
2022-08-07 15:32:06 +02:00
|
|
|
<td class="org-left"><code>double[walker.num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">Jastrow factor: electron-nucleus part</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>factor_en_date</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>uint64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">Jastrow factor: electron-nucleus part</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>factor_een</code></td>
|
2022-08-07 15:32:06 +02:00
|
|
|
<td class="org-left"><code>double[walker.num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">Jastrow factor: electron-electron-nucleus part</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>factor_een_date</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>uint64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">Jastrow factor: electron-electron-nucleus part</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>factor_ee_deriv_e</code></td>
|
2022-08-07 15:32:06 +02:00
|
|
|
<td class="org-left"><code>double[4][nelec][walker.num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">Derivative of the Jastrow factor: electron-electron-nucleus part</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>factor_ee_deriv_e_date</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>uint64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">Keep track of the date for the derivative</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>factor_en_deriv_e</code></td>
|
2022-08-07 15:32:06 +02:00
|
|
|
<td class="org-left"><code>double[4][nelec][walker.num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">Derivative of the Jastrow factor: electron-electron-nucleus part</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>factor_en_deriv_e_date</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>uint64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">Keep track of the date for the en derivative</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>factor_een_deriv_e</code></td>
|
2022-08-07 15:32:06 +02:00
|
|
|
<td class="org-left"><code>double[4][nelec][walker.num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">Derivative of the Jastrow factor: electron-electron-nucleus part</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>factor_een_deriv_e_date</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>uint64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">Keep track of the date for the een derivative</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
computed data:
|
|
|
|
</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>
|
2022-01-06 02:30:32 +01:00
|
|
|
<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>
|
2021-07-08 08:58:56 +02:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>dim_cord_vect</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">Number of unique C coefficients</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>dim_cord_vect_date</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>uint64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">Number of unique C coefficients</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>asymp_jasb</code></td>
|
|
|
|
<td class="org-left"><code>double[2]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">Asymptotic component</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>asymp_jasb_date</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>uint64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">Asymptotic component</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>cord_vect_full</code></td>
|
|
|
|
<td class="org-left"><code>double[dim_cord_vect][nucl_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">vector of non-zero coefficients</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>cord_vect_full_date</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>uint64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">Keep track of changes here</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>lkpm_combined_index</code></td>
|
|
|
|
<td class="org-left"><code>int64_t[4][dim_cord_vect]</code></td>
|
2021-07-08 08:58:56 +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>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>uint64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">Transform l,k,p, and m into consecutive indices</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>tmp_c</code></td>
|
2022-08-07 15:32:06 +02:00
|
|
|
<td class="org-left"><code>double[walker.num][cord_num][cord_num+1][nucl_num][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">vector of non-zero coefficients</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>dtmp_c</code></td>
|
2022-08-07 15:32:06 +02:00
|
|
|
<td class="org-left"><code>double[walker.num][elec_num][4][nucl_num][cord_num+1][cord_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">vector of non-zero coefficients</td>
|
|
|
|
</tr>
|
2022-01-23 19:09:13 +01:00
|
|
|
|
2021-07-08 08:58:56 +02:00
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>een_rescaled_n</code></td>
|
2022-08-07 15:32:06 +02:00
|
|
|
<td class="org-left"><code>double[walker.num][cord_num+1][nucl_num][elec_num]</code></td>
|
2021-07-08 08:58:56 +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>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>uint64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">Keep track of the date of creation</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>een_rescaled_e_deriv_e</code></td>
|
2022-08-07 15:32:06 +02:00
|
|
|
<td class="org-left"><code>double[walker.num][cord_num+1][elec_num][4][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">The electron-electron rescaled distances raised to the powers defined by cord derivatives wrt electrons</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>een_rescaled_e_deriv_e_date</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>uint64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">Keep track of the date of creation</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>een_rescaled_n_deriv_e</code></td>
|
2022-08-07 15:32:06 +02:00
|
|
|
<td class="org-left"><code>double[walker.num][cord_num+1][nucl_num][4][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">The electron-electron rescaled distances raised to the powers defined by cord derivatives wrt electrons</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>een_rescaled_n_deriv_e_date</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>uint64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">Keep track of the date of creation</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org14bb8c7" class="outline-3">
|
|
|
|
<h3 id="org14bb8c7"><span class="section-number-3">2.1</span> Data structure</h3>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-3" id="text-2-1">
|
2021-07-08 08:58:56 +02:00
|
|
|
<div class="org-src-container">
|
|
|
|
<pre class="src src-c"><span style="color: #a020f0;">typedef</span> <span style="color: #a020f0;">struct</span> <span style="color: #228b22;">qmckl_jastrow_struct</span>{
|
|
|
|
<span style="color: #228b22;">int32_t</span> <span style="color: #a0522d;">uninitialized</span>;
|
|
|
|
<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>;
|
|
|
|
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">type_nucl_num</span>;
|
|
|
|
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">asymp_jasb_date</span>;
|
|
|
|
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">tmp_c_date</span>;
|
|
|
|
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">dtmp_c_date</span>;
|
|
|
|
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">factor_ee_date</span>;
|
|
|
|
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">factor_en_date</span>;
|
|
|
|
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">factor_een_date</span>;
|
|
|
|
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">factor_ee_deriv_e_date</span>;
|
|
|
|
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">factor_en_deriv_e_date</span>;
|
|
|
|
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">factor_een_deriv_e_date</span>;
|
|
|
|
<span style="color: #228b22;">int64_t</span>* <span style="color: #a0522d;">type_nucl_vector</span>;
|
|
|
|
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">aord_vector</span>;
|
|
|
|
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">bord_vector</span>;
|
|
|
|
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">cord_vector</span>;
|
|
|
|
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">asymp_jasb</span>;
|
|
|
|
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">factor_ee</span>;
|
|
|
|
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">factor_en</span>;
|
|
|
|
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">factor_een</span>;
|
|
|
|
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">factor_ee_deriv_e</span>;
|
|
|
|
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">factor_en_deriv_e</span>;
|
|
|
|
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">factor_een_deriv_e</span>;
|
|
|
|
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">dim_cord_vect</span>;
|
|
|
|
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">dim_cord_vect_date</span>;
|
|
|
|
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">cord_vect_full</span>;
|
|
|
|
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">cord_vect_full_date</span>;
|
|
|
|
<span style="color: #228b22;">int64_t</span>* <span style="color: #a0522d;">lkpm_combined_index</span>;
|
|
|
|
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">lkpm_combined_index_date</span>;
|
|
|
|
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">tmp_c</span>;
|
|
|
|
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">dtmp_c</span>;
|
|
|
|
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">een_rescaled_e</span>;
|
|
|
|
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">een_rescaled_n</span>;
|
|
|
|
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">een_rescaled_e_date</span>;
|
|
|
|
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">een_rescaled_n_date</span>;
|
|
|
|
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">een_rescaled_e_deriv_e</span>;
|
|
|
|
<span style="color: #228b22;">double</span> * <span style="color: #a0522d;">een_rescaled_n_deriv_e</span>;
|
|
|
|
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">een_rescaled_e_deriv_e_date</span>;
|
|
|
|
<span style="color: #228b22;">uint64_t</span> <span style="color: #a0522d;">een_rescaled_n_deriv_e_date</span>;
|
|
|
|
<span style="color: #228b22;">bool</span> <span style="color: #a0522d;">provided</span>;
|
|
|
|
<span style="color: #228b22;">char</span> * <span style="color: #a0522d;">type</span>;
|
2022-05-10 15:51:37 +02:00
|
|
|
|
|
|
|
<span style="color: #483d8b;"> #ifdef</span> HAVE_HPC
|
|
|
|
<span style="color: #228b22;">bool</span> <span style="color: #a0522d;">gpu_offload</span>;
|
|
|
|
<span style="color: #483d8b;"> #endif</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
} <span style="color: #228b22;">qmckl_jastrow_struct</span>;
|
|
|
|
</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">
|
|
|
|
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_init_jastrow</span>(<span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</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_init_jastrow</span>(<span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>) {
|
|
|
|
|
|
|
|
<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>;
|
|
|
|
}
|
|
|
|
|
2022-05-10 15:51:37 +02:00
|
|
|
<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;
|
2021-07-08 08:58:56 +02:00
|
|
|
assert (ctx != <span style="color: #008b8b;">NULL</span>);
|
|
|
|
|
2022-07-11 09:47:10 +02:00
|
|
|
ctx->jastrow.uninitialized = (1 << 6) - 1;
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
/* <span style="color: #b22222;">Default values </span>*/
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
|
|
|
|
}
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-orgec6bc6c" class="outline-3">
|
|
|
|
<h3 id="orgec6bc6c"><span class="section-number-3">2.2</span> Access functions</h3>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-3" id="text-2-2">
|
2021-07-08 08:58:56 +02:00
|
|
|
<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">
|
|
|
|
<pre class="src src-c"><span style="color: #228b22;">bool</span> <span style="color: #0000ff;">qmckl_jastrow_provided</span> (<span style="color: #a020f0;">const</span> <span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>);
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org2645009" class="outline-3">
|
|
|
|
<h3 id="org2645009"><span class="section-number-3">2.3</span> Initialization functions</h3>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-3" id="text-2-3">
|
2021-07-08 08:58:56 +02:00
|
|
|
<p>
|
|
|
|
To prepare for the Jastrow and its derivative, all the following functions need to be
|
|
|
|
called.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
|
|
|
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_set_jastrow_ord_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: #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;">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_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>);
|
|
|
|
<span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_set_jastrow_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;">nucl_num</span>);
|
2022-02-15 00:46:38 +01:00
|
|
|
<span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_set_jastrow_aord_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;">aord_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_bord_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;">bord_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_cord_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;">cord_vector</span>, <span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">size_max</span>);
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
When the required information is completely entered, other data structures are
|
|
|
|
computed to accelerate the calculations. The intermediates factors
|
2022-02-09 14:39:28 +01:00
|
|
|
are precontracted using BLAS LEVEL 3 operations for an optimal flop count.
|
2021-07-08 08:58:56 +02:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-orge078794" class="outline-3">
|
|
|
|
<h3 id="orge078794"><span class="section-number-3">2.4</span> Test</h3>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-3" id="text-2-4">
|
2021-07-08 08:58:56 +02:00
|
|
|
<div class="org-src-container">
|
|
|
|
<pre class="src src-c">/* <span style="color: #b22222;">Reference input data </span>*/
|
|
|
|
<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;">double</span> <span style="color: #a0522d;">rescale_factor_kappa_ee</span> = 1.0;
|
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">rescale_factor_kappa_en</span> = 1.0;
|
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">nucl_rescale_factor_kappa</span> = 1.0;
|
|
|
|
<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;">int64_t</span> <span style="color: #a0522d;">nucl_num</span> = n2_nucl_num;
|
|
|
|
<span style="color: #228b22;">double</span>* <span style="color: #a0522d;">nucl_coord</span> = &(n2_nucl_coord[0][0]);
|
2022-02-15 00:46:38 +01:00
|
|
|
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">size_max</span>;
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
/* <span style="color: #b22222;">Provide Electron data </span>*/
|
|
|
|
|
|
|
|
<span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #a0522d;">rc</span>;
|
|
|
|
|
|
|
|
assert(!qmckl_electron_provided(context));
|
|
|
|
|
|
|
|
rc = qmckl_set_electron_num (context, elec_up_num, elec_dn_num);
|
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<span style="color: #0000ff;">assert</span>(<span style="color: #228b22;">qmckl_electron_provided</span>(<span style="color: #a0522d;">context</span>));
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
<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> = 0.;
|
|
|
|
rc = qmckl_get_electron_rescale_factor_ee (context, &k_ee);
|
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
|
|
|
<span style="color: #0000ff;">assert</span>(k_ee == 1.0);
|
|
|
|
|
|
|
|
rc = qmckl_get_electron_rescale_factor_en (context, &k_en);
|
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
|
|
|
<span style="color: #0000ff;">assert</span>(k_en == 1.0);
|
|
|
|
|
|
|
|
rc = qmckl_set_electron_rescale_factor_en(context, rescale_factor_kappa_en);
|
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
|
|
|
|
|
|
|
rc = qmckl_set_electron_rescale_factor_ee(context, rescale_factor_kappa_ee);
|
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
|
|
|
|
|
|
|
rc = qmckl_get_electron_rescale_factor_ee (context, &k_ee);
|
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
|
|
|
<span style="color: #0000ff;">assert</span>(k_ee == rescale_factor_kappa_ee);
|
|
|
|
|
|
|
|
rc = qmckl_get_electron_rescale_factor_en (context, &k_en);
|
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
|
|
|
<span style="color: #0000ff;">assert</span>(k_en == rescale_factor_kappa_en);
|
|
|
|
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
rc = qmckl_set_electron_coord (context, <span style="color: #8b2252;">'N'</span>, walk_num, elec_coord, walk_num*3*elec_num);
|
2021-07-08 08:58:56 +02:00
|
|
|
<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];
|
|
|
|
|
2022-01-23 19:09:13 +01:00
|
|
|
rc = qmckl_get_electron_coord (context, <span style="color: #8b2252;">'N'</span>, elec_coord2, walk_num*3*elec_num);
|
2021-07-08 08:58:56 +02:00
|
|
|
<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] );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* <span style="color: #b22222;">Provide Nucleus data </span>*/
|
|
|
|
|
|
|
|
assert(!qmckl_nucleus_provided(context));
|
|
|
|
|
|
|
|
rc = 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;">k</span>;
|
|
|
|
rc = qmckl_get_nucleus_rescale_factor (context, &k);
|
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
|
|
|
<span style="color: #0000ff;">assert</span>(k == 1.0);
|
|
|
|
|
|
|
|
|
|
|
|
rc = qmckl_set_nucleus_rescale_factor (context, nucl_rescale_factor_kappa);
|
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
|
|
|
|
|
|
|
rc = qmckl_get_nucleus_rescale_factor (context, &k);
|
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
|
|
|
<span style="color: #0000ff;">assert</span>(k == nucl_rescale_factor_kappa);
|
|
|
|
|
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">nucl_coord2</span>[3*nucl_num];
|
|
|
|
|
2022-01-23 19:09:13 +01:00
|
|
|
rc = qmckl_get_nucleus_coord (context, <span style="color: #8b2252;">'T'</span>, nucl_coord2, 3*nucl_num);
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_NOT_PROVIDED);
|
|
|
|
|
2022-01-23 19:09:13 +01:00
|
|
|
rc = qmckl_set_nucleus_coord (context, <span style="color: #8b2252;">'T'</span>, &(nucl_coord[0]), 3*nucl_num);
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
|
|
|
|
|
|
|
assert(!qmckl_nucleus_provided(context));
|
|
|
|
|
2022-01-23 19:09:13 +01:00
|
|
|
rc = qmckl_get_nucleus_coord (context, <span style="color: #8b2252;">'N'</span>, nucl_coord2, nucl_num*3);
|
2021-07-08 08:58:56 +02:00
|
|
|
<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] );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-23 19:09:13 +01:00
|
|
|
rc = qmckl_get_nucleus_coord (context, <span style="color: #8b2252;">'T'</span>, nucl_coord2, nucl_num*3);
|
2021-07-08 08:58:56 +02:00
|
|
|
<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];
|
|
|
|
|
2022-01-23 19:09:13 +01:00
|
|
|
rc = qmckl_get_nucleus_charge(context, nucl_charge2, nucl_num);
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_NOT_PROVIDED);
|
|
|
|
|
2022-01-23 19:09:13 +01:00
|
|
|
rc = qmckl_set_nucleus_charge(context, nucl_charge, nucl_num);
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
|
|
|
|
2022-01-23 19:09:13 +01:00
|
|
|
rc = qmckl_get_nucleus_charge(context, nucl_charge2, nucl_num);
|
2021-07-08 08:58:56 +02:00
|
|
|
<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>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org210ab61" class="outline-2">
|
|
|
|
<h2 id="org210ab61"><span class="section-number-2">3</span> Computation</h2>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-2" id="text-3">
|
2021-07-08 08:58:56 +02:00
|
|
|
<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>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org420b0d6" class="outline-3">
|
|
|
|
<h3 id="org420b0d6"><span class="section-number-3">3.1</span> Asymptotic component for \(J_{ee}\)</h3>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-3" id="text-3-1">
|
2021-07-08 08:58:56 +02:00
|
|
|
<p>
|
|
|
|
Calculate the asymptotic component <code>asymp_jasb</code> to be substracted from the final
|
2022-02-09 14:39:28 +01:00
|
|
|
electron-electron jastrow factor \(J_{\text{ee}}\). The asymptotic component is calculated
|
2021-07-08 08:58:56 +02:00
|
|
|
via the <code>bord_vector</code> and the electron-electron rescale factor <code>rescale_factor_kappa</code>.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
\[
|
2022-02-09 14:39:28 +01:00
|
|
|
J_{\text{ee}}^{\infty} = \frac{b_1 \kappa^{-1}}{1 + b_2 \kappa^{-1}}
|
2021-07-08 08:58:56 +02:00
|
|
|
\]
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org394c07f" class="outline-4">
|
|
|
|
<h4 id="org394c07f"><span class="section-number-4">3.1.1</span> Get</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-1-1">
|
2021-07-08 08:58:56 +02:00
|
|
|
<div class="org-src-container">
|
2022-02-15 00:46:38 +01:00
|
|
|
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span>
|
|
|
|
<span style="color: #0000ff;">qmckl_get_jastrow_asymp_jasb</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;">asymp_jasb</span>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">size_max</span>);
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-orgec807c2" class="outline-4">
|
|
|
|
<h4 id="orgec807c2"><span class="section-number-4">3.1.2</span> Compute</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-1-2">
|
2022-08-07 15:32:06 +02:00
|
|
|
<table id="org9e8c02b" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
<colgroup>
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
</colgroup>
|
2022-01-06 02:30:32 +01:00
|
|
|
<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>
|
2021-07-08 08:58:56 +02:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>context</code></td>
|
|
|
|
<td class="org-left"><code>qmckl_context</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Global state</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>bord_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
2022-02-09 14:39:28 +01:00
|
|
|
<td class="org-left">Order of the polynomial</td>
|
2021-07-08 08:58:56 +02:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>bord_vector</code></td>
|
|
|
|
<td class="org-left"><code>double[bord_num+1]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
2022-02-09 14:39:28 +01:00
|
|
|
<td class="org-left">Values of b</td>
|
2021-07-08 08:58:56 +02:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>rescale_factor_kappa_ee</code></td>
|
|
|
|
<td class="org-left"><code>double</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Electron coordinates</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>asymp_jasb</code></td>
|
|
|
|
<td class="org-left"><code>double[2]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
2022-02-09 14:39:28 +01:00
|
|
|
<td class="org-left">Asymptotic value</td>
|
2021-07-08 08:58:56 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
|
|
|
<pre class="src src-f90"><span style="color: #228b22;">integer </span><span style="color: #a020f0;">function</span><span style="color: #a0522d;"> </span><span style="color: #0000ff;">qmckl_compute_asymp_jasb_f</span><span style="color: #000000; background-color: #ffffff;">(context, bord_num, bord_vector, rescale_factor_kappa_ee, asymp_jasb)</span><span style="color: #a0522d;"> </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;"> bord_num</span>
|
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> bord_vector(bord_num + 1)</span>
|
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> rescale_factor_kappa_ee</span>
|
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(out) ::<span style="color: #a0522d;"> asymp_jasb(2)</span>
|
|
|
|
|
|
|
|
<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_kappa_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>
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">if</span> (bord_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>
|
|
|
|
|
|
|
|
asym_one = bord_vector(1) * kappa_inv / (1.0d0 + bord_vector(2) * kappa_inv)
|
|
|
|
asymp_jasb(:) = (/asym_one, 0.5d0 * asym_one/)
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> i = 1, 2
|
|
|
|
x = kappa_inv
|
|
|
|
<span style="color: #a020f0;">do</span> p = 2, bord_num
|
|
|
|
x = x * kappa_inv
|
2022-01-31 16:49:13 +01:00
|
|
|
asymp_jasb(i) = asymp_jasb(i) + bord_vector(p + 1) * x
|
2021-07-08 08:58:56 +02:00
|
|
|
<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_asymp_jasb_f</span>
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
|
2022-02-04 10:24:19 +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_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;">bord_vector</span>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> <span style="color: #a0522d;">rescale_factor_kappa_ee</span>,
|
|
|
|
<span style="color: #228b22;">double</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">asymp_jasb</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> (bord_num <= 0) {
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_INVALID_ARG_2;
|
|
|
|
}
|
|
|
|
|
2022-05-10 15:51:37 +02:00
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> <span style="color: #a0522d;">kappa_inv</span> = 1.0 / rescale_factor_kappa_ee;
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span> <span style="color: #a0522d;">asym_one</span> = bord_vector[0] * kappa_inv / (1.0 + bord_vector[1] * kappa_inv);
|
2022-02-15 00:46:38 +01:00
|
|
|
asymp_jasb[0] = asym_one;
|
2022-02-04 10:24:19 +01:00
|
|
|
asymp_jasb[1] = 0.5 * asym_one;
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">i</span> = 0 ; i <= 1; ++i) {
|
2022-05-10 15:51:37 +02:00
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">x</span> = kappa_inv;
|
2022-02-04 10:24:19 +01:00
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">p</span> = 1; p < bord_num; ++p){
|
2022-05-10 15:51:37 +02:00
|
|
|
x *= kappa_inv;
|
2022-02-04 10:24:19 +01:00
|
|
|
asymp_jasb[i] = asymp_jasb[i] + bord_vector[p + 1] * x;
|
|
|
|
}
|
2022-02-15 00:46:38 +01:00
|
|
|
}
|
2022-02-04 10:24:19 +01:00
|
|
|
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
|
|
|
|
}
|
|
|
|
</pre>
|
|
|
|
</div>
|
2021-07-08 08:58:56 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org1ae33a7" class="outline-4">
|
|
|
|
<h4 id="org1ae33a7"><span class="section-number-4">3.1.3</span> Test</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-1-3">
|
2021-07-08 08:58:56 +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;
|
|
|
|
<span style="color: #228b22;">double</span>* <span style="color: #a0522d;">aord_vector</span> = &(n2_aord_vector[0][0]);
|
|
|
|
<span style="color: #228b22;">double</span>* <span style="color: #a0522d;">bord_vector</span> = &(n2_bord_vector[0]);
|
|
|
|
<span style="color: #228b22;">double</span>* <span style="color: #a0522d;">cord_vector</span> = &(n2_cord_vector[0][0]);
|
2022-02-14 10:30:59 +01:00
|
|
|
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">dim_cord_vect</span>=0;
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
/* <span style="color: #b22222;">Initialize the Jastrow data </span>*/
|
|
|
|
rc = qmckl_init_jastrow(context);
|
|
|
|
assert(!qmckl_jastrow_provided(context));
|
|
|
|
|
|
|
|
/* <span style="color: #b22222;">Set the data </span>*/
|
|
|
|
rc = qmckl_set_jastrow_ord_num(context, aord_num, bord_num, cord_num);
|
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
|
|
|
rc = qmckl_set_jastrow_type_nucl_num(context, type_nucl_num);
|
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
|
|
|
rc = qmckl_set_jastrow_type_nucl_vector(context, type_nucl_vector, nucl_num);
|
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
2022-02-14 10:30:59 +01:00
|
|
|
rc = qmckl_set_jastrow_aord_vector(context, aord_vector,(aord_num+1)*type_nucl_num);
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
2022-02-14 10:30:59 +01:00
|
|
|
rc = qmckl_set_jastrow_bord_vector(context, bord_vector,(bord_num+1));
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
2022-02-14 10:30:59 +01:00
|
|
|
rc = qmckl_get_jastrow_dim_cord_vect(context, &dim_cord_vect);
|
2021-09-27 11:32:31 +02:00
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
2022-02-14 10:30:59 +01:00
|
|
|
rc = qmckl_set_jastrow_cord_vector(context, cord_vector,dim_cord_vect*type_nucl_num);
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #0000ff;">assert</span>(rc == QMCKL_SUCCESS);
|
|
|
|
|
|
|
|
/* <span style="color: #b22222;">Check if Jastrow is properly initialized </span>*/
|
|
|
|
<span style="color: #0000ff;">assert</span>(<span style="color: #228b22;">qmckl_jastrow_provided</span>(<span style="color: #a0522d;">context</span>));
|
|
|
|
|
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">asymp_jasb</span>[2];
|
2022-02-15 00:46:38 +01:00
|
|
|
rc = qmckl_get_jastrow_asymp_jasb(context, asymp_jasb,2);
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
// <span style="color: #b22222;">calculate asymp_jasb</span>
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">asymp_jasb</span>[0]-0.5323750557252571) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">asymp_jasb</span>[1]-0.31567342786262853) < 1.e-12);
|
|
|
|
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org8392c7e" class="outline-3">
|
|
|
|
<h3 id="org8392c7e"><span class="section-number-3">3.2</span> Electron-electron component \(f_{ee}\)</h3>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-3" id="text-3-2">
|
2021-07-08 08:58:56 +02:00
|
|
|
<p>
|
|
|
|
Calculate the electron-electron jastrow component <code>factor_ee</code> using the <code>asymp_jasb</code>
|
2022-01-31 16:49:13 +01:00
|
|
|
componenet and the electron-electron rescaled distances <code>ee_distance_rescaled</code>.
|
2021-07-08 08:58:56 +02:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
\[
|
|
|
|
f_{ee} = \sum_{i,j<i} \left\{ \frac{ \eta B_0 C_{ij}}{1 - B_1 C_{ij}} - J_{asymp} + \sum^{nord}_{k}B_k C_{ij}^k \right\}
|
|
|
|
\]
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org24119ed" class="outline-4">
|
|
|
|
<h4 id="org24119ed"><span class="section-number-4">3.2.1</span> Get</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-2-1">
|
2021-07-08 08:58:56 +02:00
|
|
|
<div class="org-src-container">
|
2022-02-15 00:46:38 +01:00
|
|
|
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span>
|
|
|
|
<span style="color: #0000ff;">qmckl_get_jastrow_factor_ee</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</span>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">size_max</span>);
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-orgd19579c" class="outline-4">
|
|
|
|
<h4 id="orgd19579c"><span class="section-number-4">3.2.2</span> Compute</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-2-2">
|
2022-08-07 15:32:06 +02:00
|
|
|
<table id="orge92b91e" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
<colgroup>
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
</colgroup>
|
2022-01-06 02:30:32 +01:00
|
|
|
<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>
|
2021-07-08 08:58:56 +02:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>context</code></td>
|
|
|
|
<td class="org-left"><code>qmckl_context</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Global state</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>walk_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of walkers</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>elec_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of electrons</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>up_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of alpha electrons</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>bord_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of coefficients</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>bord_vector</code></td>
|
|
|
|
<td class="org-left"><code>double[bord_num+1]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">List of coefficients</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>ee_distance_rescaled</code></td>
|
|
|
|
<td class="org-left"><code>double[walk_num][elec_num][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Electron-electron distances</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>asymp_jasb</code></td>
|
|
|
|
<td class="org-left"><code>double[2]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Electron-electron distances</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>factor_ee</code></td>
|
|
|
|
<td class="org-left"><code>double[walk_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">Electron-electron 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_factor_ee_f(context, walk_num, elec_num, up_num, bord_num, </span><span style="color: #a020f0;">&</span>
|
|
|
|
bord_vector, ee_distance_rescaled, asymp_jasb, factor_ee) <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, bord_num, up_num</span>
|
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> bord_vector(bord_num + 1)</span>
|
2022-02-14 10:30:59 +01:00
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> ee_distance_rescaled(elec_num, elec_num, walk_num)</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> asymp_jasb(2)</span>
|
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(out) ::<span style="color: #a0522d;"> factor_ee(walk_num)</span>
|
|
|
|
|
|
|
|
<span style="color: #228b22;">integer</span>*8 ::<span style="color: #a0522d;"> i, j, p, ipar, nw</span>
|
2022-05-10 15:51:37 +02:00
|
|
|
<span style="color: #228b22;">double precision</span> ::<span style="color: #a0522d;"> x, power_ser, spin_fact</span>
|
2021-07-08 08:58:56 +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> (bord_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>
|
|
|
|
|
|
|
|
factor_ee = 0.0d0
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> nw =1, walk_num
|
|
|
|
<span style="color: #a020f0;">do</span> j = 1, elec_num
|
|
|
|
<span style="color: #a020f0;">do</span> i = 1, j - 1
|
2022-02-14 10:30:59 +01:00
|
|
|
x = ee_distance_rescaled(i,j,nw)
|
2021-07-08 08:58:56 +02:00
|
|
|
power_ser = 0.0d0
|
|
|
|
spin_fact = 1.0d0
|
|
|
|
ipar = 1
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> p = 2, bord_num
|
2022-02-14 10:30:59 +01:00
|
|
|
x = x * ee_distance_rescaled(i,j,nw)
|
2021-07-08 08:58:56 +02:00
|
|
|
power_ser = power_ser + bord_vector(p + 1) * x
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
|
2022-05-10 15:51:37 +02:00
|
|
|
<span style="color: #a020f0;">if</span>(j <= up_num <span style="color: #a020f0;">.OR.</span> i > up_num) <span style="color: #a020f0;">then</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
spin_fact = 0.5d0
|
|
|
|
ipar = 2
|
|
|
|
<span style="color: #a020f0;">endif</span>
|
|
|
|
|
|
|
|
factor_ee(nw) = factor_ee(nw) + spin_fact * bord_vector(1) * <span style="color: #a020f0;">&</span>
|
2022-02-14 10:30:59 +01:00
|
|
|
ee_distance_rescaled(i,j,nw) / <span style="color: #a020f0;">&</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
(1.0d0 + bord_vector(2) * <span style="color: #a020f0;">&</span>
|
2022-02-14 10:30:59 +01:00
|
|
|
ee_distance_rescaled(i,j,nw)) <span style="color: #a020f0;">&</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
-asymp_jasb(ipar) + power_ser
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<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_factor_ee_f</span>
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
2021-09-14 10:01:20 +02:00
|
|
|
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_compute_factor_ee</span> (
|
2021-07-08 08:58:56 +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;">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;">bord_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>,
|
2022-05-10 15:51:37 +02:00
|
|
|
<span style="color: #228b22;">double</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">factor_ee</span> ) {
|
|
|
|
|
|
|
|
<span style="color: #228b22;">int</span> <span style="color: #a0522d;">ipar</span>; // <span style="color: #b22222;">can we use a smaller integer?</span>
|
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">x</span>, <span style="color: #a0522d;">x1</span>, <span style="color: #a0522d;">spin_fact</span>, <span style="color: #a0522d;">power_ser</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> (bord_num <= 0) {
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_INVALID_ARG_4;
|
|
|
|
}
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">nw</span> = 0; nw < walk_num; ++nw) {
|
|
|
|
factor_ee[nw] = 0.0; // <span style="color: #b22222;">put init array here.</span>
|
|
|
|
<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;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">j</span> = 0; j < i; ++j) {
|
|
|
|
//<span style="color: #b22222;">x = ee_distance_rescaled[j * (walk_num * elec_num) + i * (walk_num) + nw];</span>
|
|
|
|
x = ee_distance_rescaled[j + i * elec_num + nw*(elec_num * elec_num)];
|
|
|
|
x1 = x;
|
|
|
|
power_ser = 0.0;
|
|
|
|
spin_fact = 1.0;
|
|
|
|
ipar = 0; // <span style="color: #b22222;">index of asymp_jasb</span>
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">p</span> = 1; p < bord_num; ++p) {
|
|
|
|
x = x * x1;
|
|
|
|
power_ser = power_ser + bord_vector[p + 1] * x;
|
|
|
|
}
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">if</span>(i < up_num || j >= up_num) {
|
|
|
|
spin_fact = 0.5;
|
|
|
|
ipar = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
factor_ee[nw] = factor_ee[nw] + spin_fact * bord_vector[0] * \
|
|
|
|
x1 / \
|
|
|
|
(1.0 + bord_vector[1] * \
|
|
|
|
x1) \
|
|
|
|
-asymp_jasb[ipar] + power_ser;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
|
|
|
|
}
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-orgbe63954" class="outline-4">
|
|
|
|
<h4 id="orgbe63954"><span class="section-number-4">3.2.3</span> Test</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-2-3">
|
2021-07-08 08:58:56 +02:00
|
|
|
<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_provided</span>(<span style="color: #a0522d;">context</span>));
|
|
|
|
|
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">factor_ee</span>[walk_num];
|
2022-02-15 00:46:38 +01:00
|
|
|
rc = qmckl_get_jastrow_factor_ee(context, factor_ee, walk_num);
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
// <span style="color: #b22222;">calculate factor_ee</span>
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">factor_ee</span>[0]+4.282760865958113) < 1.e-12);
|
|
|
|
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org140ce01" class="outline-3">
|
|
|
|
<h3 id="org140ce01"><span class="section-number-3">3.3</span> Electron-electron component derivative \(f'_{ee}\)</h3>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-3" id="text-3-3">
|
2021-07-08 08:58:56 +02:00
|
|
|
<p>
|
|
|
|
Calculate the derivative of the <code>factor_ee</code> using the <code>ee_distance_rescaled</code> and
|
|
|
|
the electron-electron rescaled distances derivatives <code>ee_distance_rescaled_deriv_e</code>.
|
2022-01-31 16:49:13 +01:00
|
|
|
There are four components, the gradient which has 3 components in the \(x, y, z\)
|
2021-07-08 08:58:56 +02:00
|
|
|
directions and the laplacian as the last component.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
TODO: Add equation
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-orge83f3ac" class="outline-4">
|
|
|
|
<h4 id="orge83f3ac"><span class="section-number-4">3.3.1</span> Get</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-3-1">
|
2021-07-08 08:58:56 +02:00
|
|
|
<div class="org-src-container">
|
2022-02-15 00:46:38 +01:00
|
|
|
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span>
|
|
|
|
<span style="color: #0000ff;">qmckl_get_jastrow_factor_ee_deriv_e</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_deriv_e</span>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">size_max</span>);
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org1713dec" class="outline-4">
|
|
|
|
<h4 id="org1713dec"><span class="section-number-4">3.3.2</span> Compute</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-3-2">
|
2022-08-07 15:32:06 +02:00
|
|
|
<table id="org61df7db" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
<colgroup>
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
</colgroup>
|
2022-01-06 02:30:32 +01:00
|
|
|
<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>
|
2021-07-08 08:58:56 +02:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>context</code></td>
|
|
|
|
<td class="org-left"><code>qmckl_context</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Global state</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>walk_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of walkers</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>elec_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of electrons</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>up_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of alpha electrons</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>bord_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of coefficients</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>bord_vector</code></td>
|
|
|
|
<td class="org-left"><code>double[bord_num+1]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">List of coefficients</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>ee_distance_rescaled</code></td>
|
|
|
|
<td class="org-left"><code>double[walk_num][elec_num][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Electron-electron distances</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>ee_distance_rescaled_deriv_e</code></td>
|
|
|
|
<td class="org-left"><code>double[walk_num][4][elec_num][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Electron-electron distances</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>factor_ee_deriv_e</code></td>
|
|
|
|
<td class="org-left"><code>double[walk_num][4][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">Electron-electron distances</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
2022-05-10 15:51:37 +02:00
|
|
|
<pre class="src src-f90"><span style="color: #228b22;">integer</span><span style="color: #a0522d;"> function qmckl_compute_factor_ee_deriv_e_doc_f( </span><span style="color: #a020f0;">&</span>
|
|
|
|
context, walk_num, elec_num, up_num, bord_num, <span style="color: #a020f0;">&</span>
|
|
|
|
bord_vector, ee_distance_rescaled, ee_distance_rescaled_deriv_e, <span style="color: #a020f0;">&</span>
|
|
|
|
factor_ee_deriv_e) <span style="color: #a020f0;">&</span>
|
2021-07-08 08:58:56 +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, elec_num, bord_num, up_num</span>
|
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> bord_vector(bord_num + 1)</span>
|
2022-02-14 10:30:59 +01:00
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> ee_distance_rescaled(elec_num, elec_num,walk_num)</span>
|
2022-05-10 15:51:37 +02:00
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> ee_distance_rescaled_deriv_e(4,elec_num, elec_num,walk_num) </span>!<span style="color: #b22222;">TODO</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(out) ::<span style="color: #a0522d;"> factor_ee_deriv_e(elec_num,4,walk_num)</span>
|
|
|
|
|
2022-05-10 15:51:37 +02:00
|
|
|
<span style="color: #228b22;">integer</span>*8 ::<span style="color: #a0522d;"> i, j, p, nw, ii</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #228b22;">double precision</span> ::<span style="color: #a0522d;"> x, spin_fact, y</span>
|
|
|
|
<span style="color: #228b22;">double precision</span> ::<span style="color: #a0522d;"> den, invden, invden2, invden3, xinv</span>
|
|
|
|
<span style="color: #228b22;">double precision</span> ::<span style="color: #a0522d;"> lap1, lap2, lap3, third</span>
|
|
|
|
<span style="color: #228b22;">double precision</span>, <span style="color: #a020f0;">dimension</span>(3) ::<span style="color: #a0522d;"> pow_ser_g</span>
|
|
|
|
<span style="color: #228b22;">double precision</span>, <span style="color: #a020f0;">dimension</span>(4) ::<span style="color: #a0522d;"> dx</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> (bord_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>
|
|
|
|
|
|
|
|
factor_ee_deriv_e = 0.0d0
|
|
|
|
third = 1.0d0 / 3.0d0
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> nw =1, walk_num
|
|
|
|
<span style="color: #a020f0;">do</span> j = 1, elec_num
|
|
|
|
<span style="color: #a020f0;">do</span> i = 1, elec_num
|
2022-02-14 10:30:59 +01:00
|
|
|
x = ee_distance_rescaled(i,j,nw)
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #a020f0;">if</span>(<span style="color: #a020f0;">abs</span>(x) < 1.0d-18) <span style="color: #a020f0;">cycle</span>
|
|
|
|
pow_ser_g = 0.0d0
|
|
|
|
spin_fact = 1.0d0
|
|
|
|
den = 1.0d0 + bord_vector(2) * x
|
|
|
|
invden = 1.0d0 / den
|
|
|
|
invden2 = invden * invden
|
|
|
|
invden3 = invden2 * invden
|
|
|
|
xinv = 1.0d0 / (x + 1.0d-18)
|
|
|
|
|
2022-02-14 10:30:59 +01:00
|
|
|
dx(1) = ee_distance_rescaled_deriv_e(1, i, j, nw)
|
|
|
|
dx(2) = ee_distance_rescaled_deriv_e(2, i, j, nw)
|
|
|
|
dx(3) = ee_distance_rescaled_deriv_e(3, i, j, nw)
|
2022-02-15 00:46:38 +01:00
|
|
|
dx(4) = ee_distance_rescaled_deriv_e(4, i, j, nw)
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
<span style="color: #a020f0;">if</span>((i <span style="color: #a020f0;">.LE.</span> up_num <span style="color: #a020f0;">.AND.</span> j <span style="color: #a020f0;">.LE.</span> up_num ) <span style="color: #a020f0;">.OR.</span> <span style="color: #a020f0;">&</span>
|
|
|
|
(i <span style="color: #a020f0;">.GT.</span> up_num <span style="color: #a020f0;">.AND.</span> j <span style="color: #a020f0;">.GT.</span> up_num)) <span style="color: #a020f0;">then</span>
|
|
|
|
spin_fact = 0.5d0
|
|
|
|
<span style="color: #a020f0;">endif</span>
|
|
|
|
|
|
|
|
lap1 = 0.0d0
|
|
|
|
lap2 = 0.0d0
|
|
|
|
lap3 = 0.0d0
|
|
|
|
<span style="color: #a020f0;">do</span> ii = 1, 3
|
2022-02-14 10:30:59 +01:00
|
|
|
x = ee_distance_rescaled(i, j, nw)
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #a020f0;">if</span>(<span style="color: #a020f0;">abs</span>(x) < 1.0d-18) <span style="color: #a020f0;">cycle</span>
|
|
|
|
<span style="color: #a020f0;">do</span> p = 2, bord_num
|
|
|
|
y = p * bord_vector(p + 1) * x
|
|
|
|
pow_ser_g(ii) = pow_ser_g(ii) + y * dx(ii)
|
|
|
|
lap1 = lap1 + (p - 1) * y * xinv * dx(ii) * dx(ii)
|
|
|
|
lap2 = lap2 + y
|
2022-02-14 10:30:59 +01:00
|
|
|
x = x * ee_distance_rescaled(i, j, nw)
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
|
|
|
|
lap3 = lap3 - 2.0d0 * bord_vector(2) * dx(ii) * dx(ii)
|
|
|
|
|
|
|
|
factor_ee_deriv_e( j, ii, nw) = factor_ee_deriv_e( j, ii, nw) + spin_fact * bord_vector(1) * <span style="color: #a020f0;">&</span>
|
|
|
|
dx(ii) * invden2 + pow_ser_g(ii)
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
|
|
|
|
ii = 4
|
|
|
|
lap2 = lap2 * dx(ii) * third
|
|
|
|
lap3 = lap3 + den * dx(ii)
|
|
|
|
lap3 = lap3 * (spin_fact * bord_vector(1) * invden3)
|
|
|
|
factor_ee_deriv_e( j, ii, nw) = factor_ee_deriv_e( j, ii, nw) + lap1 + lap2 + lap3
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
|
2022-05-10 15:51:37 +02:00
|
|
|
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_compute_factor_ee_deriv_e_doc_f</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
2022-05-10 15:51:37 +02:00
|
|
|
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_compute_factor_ee_deriv_e_hpc</span>(
|
2021-07-08 08:58:56 +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;">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;">bord_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_deriv_e</span>,
|
2022-05-10 15:51:37 +02:00
|
|
|
<span style="color: #228b22;">double</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">factor_ee_deriv_e</span> ) {
|
|
|
|
|
|
|
|
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">ii</span>;
|
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">pow_ser_g</span>[3];
|
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">dx</span>[4];
|
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">x</span>, <span style="color: #a0522d;">spin_fact</span>, <span style="color: #a0522d;">y</span>;
|
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">den</span>, <span style="color: #a0522d;">invden</span>, <span style="color: #a0522d;">invden2</span>, <span style="color: #a0522d;">invden3</span>, <span style="color: #a0522d;">xinv</span>;
|
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">lap1</span>, <span style="color: #a0522d;">lap2</span>, <span style="color: #a0522d;">lap3</span>, <span style="color: #a0522d;">third</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> (bord_num <= 0) {
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_INVALID_ARG_4;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">nw</span> = 0; nw < walk_num; ++nw) {
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">ii</span> = 0; ii < 4; ++ii) {
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">j</span> = 0; j < elec_num; ++j) {
|
|
|
|
factor_ee_deriv_e[j + ii * elec_num + nw * elec_num * 4] = 0.0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
third = 1.0 / 3.0;
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">nw</span> = 0; nw < walk_num; ++nw) {
|
|
|
|
<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;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">j</span> = 0; j < elec_num; ++j) {
|
|
|
|
x = ee_distance_rescaled[j + i * elec_num + nw * elec_num * elec_num];
|
|
|
|
<span style="color: #a020f0;">if</span> (fabs(x) < 1.0e-18) <span style="color: #a020f0;">continue</span>;
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">ii</span> = 0; ii < 3; ++ii){
|
|
|
|
pow_ser_g[ii] = 0.0;
|
|
|
|
}
|
|
|
|
spin_fact = 1.0;
|
|
|
|
den = 1.0 + bord_vector[1] * x;
|
|
|
|
invden = 1.0 / den;
|
|
|
|
invden2 = invden * invden;
|
|
|
|
invden3 = invden2 * invden;
|
|
|
|
xinv = 1.0 / (x + 1.0e-18);
|
|
|
|
|
|
|
|
dx[0] = ee_distance_rescaled_deriv_e[0 \
|
|
|
|
+ j * 4 + i * 4 * elec_num \
|
|
|
|
+ nw * 4 * elec_num * elec_num];
|
|
|
|
dx[1] = ee_distance_rescaled_deriv_e[1 \
|
|
|
|
+ j * 4 + i * 4 * elec_num \
|
|
|
|
+ nw * 4 * elec_num * elec_num];
|
|
|
|
dx[2] = ee_distance_rescaled_deriv_e[2 \
|
|
|
|
+ j * 4 + i * 4 * elec_num \
|
|
|
|
+ nw * 4 * elec_num * elec_num];
|
|
|
|
dx[3] = ee_distance_rescaled_deriv_e[3 \
|
|
|
|
+ j * 4 + i * 4 * elec_num \
|
|
|
|
+ nw * 4 * elec_num * elec_num];
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">if</span>((i <= (up_num-1) && j <= (up_num-1) ) || (i > (up_num-1) && j > (up_num-1))) {
|
|
|
|
spin_fact = 0.5;
|
|
|
|
}
|
|
|
|
|
|
|
|
lap1 = 0.0;
|
|
|
|
lap2 = 0.0;
|
|
|
|
lap3 = 0.0;
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">ii</span> = 0; ii < 3; ++ii) {
|
|
|
|
x = ee_distance_rescaled[j + i * elec_num + nw * elec_num * elec_num];
|
|
|
|
<span style="color: #a020f0;">if</span> (fabs(x) < 1.0e-18) <span style="color: #a020f0;">continue</span>;
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">p</span> = 2; p < bord_num+1; ++p) {
|
|
|
|
y = p * bord_vector[(p-1) + 1] * x;
|
|
|
|
pow_ser_g[ii] = pow_ser_g[ii] + y * dx[ii];
|
|
|
|
lap1 = lap1 + (p - 1) * y * xinv * dx[ii] * dx[ii];
|
|
|
|
lap2 = lap2 + y;
|
|
|
|
x = x * ee_distance_rescaled[j + i * elec_num + nw * elec_num * elec_num];
|
|
|
|
}
|
|
|
|
|
|
|
|
lap3 = lap3 - 2.0 * bord_vector[1] * dx[ii] * dx[ii];
|
|
|
|
|
|
|
|
factor_ee_deriv_e[i + ii * elec_num + nw * elec_num * 4 ] += \
|
|
|
|
+ spin_fact * bord_vector[0] * dx[ii] * invden2 \
|
|
|
|
+ pow_ser_g[ii] ;
|
|
|
|
}
|
|
|
|
|
|
|
|
ii = 3;
|
|
|
|
lap2 = lap2 * dx[ii] * third;
|
|
|
|
lap3 = lap3 + den * dx[ii];
|
|
|
|
lap3 = lap3 * (spin_fact * bord_vector[0] * invden3);
|
|
|
|
factor_ee_deriv_e[i + ii*elec_num + nw * elec_num * 4] += lap1 + lap2 + lap3;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
|
|
|
|
}
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
2022-05-10 15:51:37 +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_factor_ee_deriv_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;">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;">bord_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_deriv_e</span>,
|
|
|
|
<span style="color: #228b22;">double</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">factor_ee_deriv_e</span> );
|
|
|
|
|
|
|
|
</pre>
|
2021-07-08 08:58:56 +02:00
|
|
|
</div>
|
2022-05-10 15:51:37 +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_factor_ee_deriv_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;">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;">bord_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_deriv_e</span>,
|
|
|
|
<span style="color: #228b22;">double</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">factor_ee_deriv_e</span> );
|
|
|
|
</pre>
|
2021-07-08 08:58:56 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2022-05-10 15:51:37 +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_factor_ee_deriv_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;">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;">bord_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_deriv_e</span>,
|
|
|
|
<span style="color: #228b22;">double</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">factor_ee_deriv_e</span> ) {
|
|
|
|
|
|
|
|
<span style="color: #483d8b;"> #ifdef</span> HAVE_HPC
|
|
|
|
<span style="color: #a020f0;">return</span> qmckl_compute_factor_ee_deriv_e_hpc(context, walk_num, elec_num, up_num, bord_num, bord_vector, ee_distance_rescaled, ee_distance_rescaled_deriv_e, factor_ee_deriv_e );
|
|
|
|
<span style="color: #483d8b;"> #else</span>
|
|
|
|
<span style="color: #a020f0;">return</span> qmckl_compute_factor_ee_deriv_e_doc(context, walk_num, elec_num, up_num, bord_num, bord_vector, ee_distance_rescaled, ee_distance_rescaled_deriv_e, factor_ee_deriv_e );
|
|
|
|
<span style="color: #483d8b;"> #endif</span>
|
|
|
|
}
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org472ebce" class="outline-4">
|
|
|
|
<h4 id="org472ebce"><span class="section-number-4">3.3.3</span> Test</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-3-3">
|
2021-07-08 08:58:56 +02:00
|
|
|
<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_provided</span>(<span style="color: #a0522d;">context</span>));
|
|
|
|
|
|
|
|
// <span style="color: #b22222;">calculate factor_ee_deriv_e</span>
|
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">factor_ee_deriv_e</span>[walk_num][4][elec_num];
|
2022-02-15 00:46:38 +01:00
|
|
|
rc = qmckl_get_jastrow_factor_ee_deriv_e(context, &(factor_ee_deriv_e[0][0][0]),walk_num*4*elec_num);
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
// <span style="color: #b22222;">check factor_ee_deriv_e</span>
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">factor_ee_deriv_e</span>[0][0][0]-0.16364894652107934) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">factor_ee_deriv_e</span>[0][1][0]+0.6927548119830084 ) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">factor_ee_deriv_e</span>[0][2][0]-0.073267755223968 ) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">factor_ee_deriv_e</span>[0][3][0]-1.5111672803213185 ) < 1.e-12);
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org5dbb7de" class="outline-3">
|
|
|
|
<h3 id="org5dbb7de"><span class="section-number-3">3.4</span> Electron-nucleus component \(f_{en}\)</h3>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-3" id="text-3-4">
|
2021-07-08 08:58:56 +02:00
|
|
|
<p>
|
|
|
|
Calculate the electron-electron jastrow component <code>factor_en</code> using the <code>aord_vector</code>
|
2022-01-31 16:49:13 +01:00
|
|
|
coeffecients and the electron-nucleus rescaled distances <code>en_distance_rescaled</code>.
|
2021-07-08 08:58:56 +02:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
\[
|
|
|
|
f_{en} = \sum_{i,j<i} \left\{ \frac{ A_0 C_{ij}}{1 - A_1 C_{ij}} + \sum^{nord}_{k}A_k C_{ij}^k \right\}
|
|
|
|
\]
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org785da5d" class="outline-4">
|
|
|
|
<h4 id="org785da5d"><span class="section-number-4">3.4.1</span> Get</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-4-1">
|
2021-07-08 08:58:56 +02:00
|
|
|
<div class="org-src-container">
|
2022-02-15 00:46:38 +01:00
|
|
|
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span>
|
|
|
|
<span style="color: #0000ff;">qmckl_get_jastrow_factor_en</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</span>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">size_max</span>);
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org6824485" class="outline-4">
|
|
|
|
<h4 id="org6824485"><span class="section-number-4">3.4.2</span> Compute</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-4-2">
|
2022-08-07 15:32:06 +02:00
|
|
|
<table id="org921e2f3" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
<colgroup>
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
</colgroup>
|
2022-01-06 02:30:32 +01:00
|
|
|
<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>
|
2021-07-08 08:58:56 +02:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>context</code></td>
|
|
|
|
<td class="org-left"><code>qmckl_context</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Global state</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>walk_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of walkers</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>elec_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of electrons</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>nucl_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of nucleii</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>type_nucl_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of unique nuclei</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>type_nucl_vector</code></td>
|
|
|
|
<td class="org-left"><code>int64_t[nucl_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">IDs of unique nucleii</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>aord_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of coefficients</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>aord_vector</code></td>
|
|
|
|
<td class="org-left"><code>double[aord_num+1][type_nucl_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">List of coefficients</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>en_distance_rescaled</code></td>
|
|
|
|
<td class="org-left"><code>double[walk_num][nucl_num][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Electron-nucleus distances</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>factor_en</code></td>
|
|
|
|
<td class="org-left"><code>double[walk_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">Electron-nucleus jastrow</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
2022-05-10 15:51:37 +02:00
|
|
|
<pre class="src src-f90"><span style="color: #228b22;">integer</span><span style="color: #a0522d;"> function qmckl_compute_factor_en_f( </span><span style="color: #a020f0;">&</span>
|
|
|
|
context, walk_num, elec_num, nucl_num, type_nucl_num, <span style="color: #a020f0;">&</span>
|
|
|
|
type_nucl_vector, aord_num, aord_vector, <span style="color: #a020f0;">&</span>
|
|
|
|
en_distance_rescaled, factor_en) <span style="color: #a020f0;">&</span>
|
2021-07-08 08:58:56 +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, elec_num, aord_num, nucl_num, 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;"> aord_vector(aord_num + 1, type_nucl_num)</span>
|
2022-02-14 10:30:59 +01:00
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> en_distance_rescaled(elec_num, nucl_num, walk_num)</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(out) ::<span style="color: #a0522d;"> factor_en(walk_num)</span>
|
|
|
|
|
2022-05-10 15:51:37 +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>
|
2021-07-08 08:58:56 +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>
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
factor_en = 0.0d0
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> nw =1, walk_num
|
|
|
|
<span style="color: #a020f0;">do</span> a = 1, nucl_num
|
|
|
|
<span style="color: #a020f0;">do</span> i = 1, elec_num
|
2022-02-14 10:30:59 +01:00
|
|
|
x = en_distance_rescaled(i, a, nw)
|
2021-07-08 08:58:56 +02:00
|
|
|
power_ser = 0.0d0
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> p = 2, aord_num
|
2022-02-14 10:30:59 +01:00
|
|
|
x = x * en_distance_rescaled(i, a, nw)
|
2021-07-08 08:58:56 +02:00
|
|
|
power_ser = power_ser + aord_vector(p + 1, type_nucl_vector(a)) * x
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
|
|
|
|
factor_en(nw) = factor_en(nw) + aord_vector(1, type_nucl_vector(a)) * <span style="color: #a020f0;">&</span>
|
2022-02-14 10:30:59 +01:00
|
|
|
en_distance_rescaled(i, a, nw) / <span style="color: #a020f0;">&</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
(1.0d0 + aord_vector(2, type_nucl_vector(a)) * <span style="color: #a020f0;">&</span>
|
2022-02-14 10:30:59 +01:00
|
|
|
en_distance_rescaled(i, a, nw)) <span style="color: #a020f0;">&</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
+ power_ser
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<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_factor_en_f</span>
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
|
2022-05-10 15:51:37 +02:00
|
|
|
|
2021-07-08 08:58:56 +02:00
|
|
|
<div class="org-src-container">
|
2021-09-14 10:01:20 +02:00
|
|
|
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_compute_factor_en</span> (
|
2021-07-08 08:58:56 +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;">aord_vector</span>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span>* <span style="color: #a0522d;">en_distance_rescaled</span>,
|
2022-05-10 15:51:37 +02:00
|
|
|
<span style="color: #228b22;">double</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">factor_en</span> ) {
|
|
|
|
|
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">x</span>, <span style="color: #a0522d;">x1</span>, <span style="color: #a0522d;">power_ser</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> (nucl_num <= 0) {
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_INVALID_ARG_4;
|
|
|
|
}
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">if</span> (type_nucl_num <= 0) {
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_INVALID_ARG_5;
|
|
|
|
}
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">if</span> (type_nucl_vector == <span style="color: #008b8b;">NULL</span>) {
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_INVALID_ARG_6;
|
|
|
|
}
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">if</span> (aord_num <= 0) {
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_INVALID_ARG_7;
|
|
|
|
}
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">if</span> (aord_vector == <span style="color: #008b8b;">NULL</span>) {
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_INVALID_ARG_8;
|
|
|
|
}
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">if</span> (en_distance_rescaled == <span style="color: #008b8b;">NULL</span>) {
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_INVALID_ARG_9;
|
|
|
|
}
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">if</span> (factor_en == <span style="color: #008b8b;">NULL</span>) {
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_INVALID_ARG_10;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">nw</span> = 0; nw < walk_num; ++nw ) {
|
|
|
|
// <span style="color: #b22222;">init array</span>
|
|
|
|
factor_en[nw] = 0.0;
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">a</span> = 0; a < nucl_num; ++a ) {
|
|
|
|
<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: #b22222;">x = ee_distance_rescaled[j * (walk_num * elec_num) + i * (walk_num) + nw];</span>
|
|
|
|
x = en_distance_rescaled[i + a * elec_num + nw * (elec_num * nucl_num)];
|
|
|
|
x1 = x;
|
|
|
|
power_ser = 0.0;
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">p</span> = 2; p < aord_num+1; ++p) {
|
|
|
|
x = x * x1;
|
|
|
|
power_ser = power_ser + aord_vector[(p+1)-1 + (type_nucl_vector[a]-1) * aord_num] * x;
|
|
|
|
}
|
|
|
|
|
|
|
|
factor_en[nw] = factor_en[nw] + aord_vector[0 + (type_nucl_vector[a]-1)*aord_num] * x1 / \
|
|
|
|
(1.0 + aord_vector[1 + (type_nucl_vector[a]-1) * aord_num] * x1) + \
|
|
|
|
power_ser;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
|
|
|
|
}
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-orgcbfe8dc" class="outline-4">
|
|
|
|
<h4 id="orgcbfe8dc"><span class="section-number-4">3.4.3</span> Test</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-4-3">
|
2021-07-08 08:58:56 +02:00
|
|
|
<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_provided</span>(<span style="color: #a0522d;">context</span>));
|
|
|
|
|
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">factor_en</span>[walk_num];
|
2022-02-15 00:46:38 +01:00
|
|
|
rc = qmckl_get_jastrow_factor_en(context, factor_en,walk_num);
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
// <span style="color: #b22222;">calculate factor_en</span>
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">factor_en</span>[0]+5.865822569188727) < 1.e-12);
|
|
|
|
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org7eb8d8e" class="outline-3">
|
|
|
|
<h3 id="org7eb8d8e"><span class="section-number-3">3.5</span> Electron-nucleus component derivative \(f'_{en}\)</h3>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-3" id="text-3-5">
|
2021-07-08 08:58:56 +02:00
|
|
|
<p>
|
|
|
|
Calculate the electron-electron jastrow component <code>factor_en_deriv_e</code> derivative
|
|
|
|
with respect to the electron coordinates using the <code>en_distance_rescaled</code> and
|
|
|
|
<code>en_distance_rescaled_deriv_e</code> which are already calculated previously.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
TODO: write equations.
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org7983207" class="outline-4">
|
|
|
|
<h4 id="org7983207"><span class="section-number-4">3.5.1</span> Get</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-5-1">
|
2021-07-08 08:58:56 +02:00
|
|
|
<div class="org-src-container">
|
2022-02-15 00:46:38 +01:00
|
|
|
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span>
|
|
|
|
<span style="color: #0000ff;">qmckl_get_jastrow_factor_en_deriv_e</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_deriv_e</span>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">size_max</span>);
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org40d44b0" class="outline-4">
|
|
|
|
<h4 id="org40d44b0"><span class="section-number-4">3.5.2</span> Compute</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-5-2">
|
2022-08-07 15:32:06 +02:00
|
|
|
<table id="org2de55e8" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
<colgroup>
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
</colgroup>
|
2022-01-06 02:30:32 +01:00
|
|
|
<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>
|
2021-07-08 08:58:56 +02:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>context</code></td>
|
|
|
|
<td class="org-left"><code>qmckl_context</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Global state</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>walk_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of walkers</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>elec_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of electrons</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>nucl_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of nucleii</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>type_nucl_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of unique nuclei</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>type_nucl_vector</code></td>
|
|
|
|
<td class="org-left"><code>int64_t[nucl_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">IDs of unique nucleii</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>aord_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of coefficients</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>aord_vector</code></td>
|
|
|
|
<td class="org-left"><code>double[aord_num+1][type_nucl_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">List of coefficients</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>en_distance_rescaled</code></td>
|
|
|
|
<td class="org-left"><code>double[walk_num][nucl_num][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Electron-nucleus distances</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>en_distance_rescaled_deriv_e</code></td>
|
|
|
|
<td class="org-left"><code>double[walk_num][4][nucl_num][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Electron-nucleus distance derivatives</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>factor_en_deriv_e</code></td>
|
|
|
|
<td class="org-left"><code>double[walk_num][4][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">Electron-nucleus jastrow</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
2022-05-10 15:51:37 +02:00
|
|
|
<pre class="src src-f90"><span style="color: #228b22;">integer</span><span style="color: #a0522d;"> function qmckl_compute_factor_en_deriv_e_f( </span><span style="color: #a020f0;">&</span>
|
|
|
|
context, walk_num, elec_num, nucl_num, type_nucl_num, <span style="color: #a020f0;">&</span>
|
|
|
|
type_nucl_vector, aord_num, aord_vector, <span style="color: #a020f0;">&</span>
|
|
|
|
en_distance_rescaled, en_distance_rescaled_deriv_e, factor_en_deriv_e) <span style="color: #a020f0;">&</span>
|
2021-07-08 08:58:56 +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, elec_num, aord_num, nucl_num, 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;"> aord_vector(aord_num + 1, type_nucl_num)</span>
|
2022-02-14 10:30:59 +01:00
|
|
|
<span style="color: #228b22;">double precision</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;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> en_distance_rescaled_deriv_e(4, elec_num, nucl_num, walk_num)</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(out) ::<span style="color: #a0522d;"> factor_en_deriv_e(elec_num,4,walk_num)</span>
|
|
|
|
|
|
|
|
<span style="color: #228b22;">integer</span>*8 ::<span style="color: #a0522d;"> i, a, p, ipar, nw, ii</span>
|
2022-05-10 15:51:37 +02:00
|
|
|
<span style="color: #228b22;">double precision</span> ::<span style="color: #a0522d;"> x, den, invden, invden2, invden3, xinv</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #228b22;">double precision</span> ::<span style="color: #a0522d;"> y, lap1, lap2, lap3, third</span>
|
|
|
|
<span style="color: #228b22;">double precision</span>, <span style="color: #a020f0;">dimension</span>(3) ::<span style="color: #a0522d;"> power_ser_g</span>
|
|
|
|
<span style="color: #228b22;">double precision</span>, <span style="color: #a020f0;">dimension</span>(4) ::<span style="color: #a0522d;"> dx</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>
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
factor_en_deriv_e = 0.0d0
|
|
|
|
third = 1.0d0 / 3.0d0
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> nw =1, walk_num
|
|
|
|
<span style="color: #a020f0;">do</span> a = 1, nucl_num
|
|
|
|
<span style="color: #a020f0;">do</span> i = 1, elec_num
|
2022-02-14 10:30:59 +01:00
|
|
|
x = en_distance_rescaled(i,a,nw)
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #a020f0;">if</span>(<span style="color: #a020f0;">abs</span>(x) < 1.0d-18) <span style="color: #a020f0;">continue</span>
|
|
|
|
power_ser_g = 0.0d0
|
|
|
|
den = 1.0d0 + aord_vector(2, type_nucl_vector(a)) * x
|
|
|
|
invden = 1.0d0 / den
|
|
|
|
invden2 = invden * invden
|
|
|
|
invden3 = invden2 * invden
|
|
|
|
xinv = 1.0d0 / x
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> ii = 1, 4
|
2022-02-14 10:30:59 +01:00
|
|
|
dx(ii) = en_distance_rescaled_deriv_e(ii,i,a,nw)
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
|
|
|
|
lap1 = 0.0d0
|
|
|
|
lap2 = 0.0d0
|
|
|
|
lap3 = 0.0d0
|
|
|
|
<span style="color: #a020f0;">do</span> ii = 1, 3
|
2022-02-14 10:30:59 +01:00
|
|
|
x = en_distance_rescaled(i, a, nw)
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #a020f0;">do</span> p = 2, aord_num
|
|
|
|
y = p * aord_vector(p + 1, type_nucl_vector(a)) * x
|
|
|
|
power_ser_g(ii) = power_ser_g(ii) + y * dx(ii)
|
|
|
|
lap1 = lap1 + (p - 1) * y * xinv * dx(ii) * dx(ii)
|
|
|
|
lap2 = lap2 + y
|
2022-02-14 10:30:59 +01:00
|
|
|
x = x * en_distance_rescaled(i, a, nw)
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
|
|
|
|
lap3 = lap3 - 2.0d0 * aord_vector(2, type_nucl_vector(a)) * dx(ii) * dx(ii)
|
|
|
|
|
|
|
|
factor_en_deriv_e(i, ii, nw) = factor_en_deriv_e(i, ii, nw) + aord_vector(1, type_nucl_vector(a)) <span style="color: #a020f0;">&</span>
|
|
|
|
* dx(ii) * invden2 <span style="color: #a020f0;">&</span>
|
|
|
|
+ power_ser_g(ii)
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
|
|
|
|
ii = 4
|
|
|
|
lap2 = lap2 * dx(ii) * third
|
|
|
|
lap3 = lap3 + den * dx(ii)
|
|
|
|
lap3 = lap3 * aord_vector(1, type_nucl_vector(a)) * invden3
|
|
|
|
factor_en_deriv_e(i, ii, nw) = factor_en_deriv_e(i, ii, nw) + lap1 + lap2 + lap3
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<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_factor_en_deriv_e_f</span>
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-orge840786" class="outline-4">
|
|
|
|
<h4 id="orge840786"><span class="section-number-4">3.5.3</span> Test</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-5-3">
|
2021-07-08 08:58:56 +02:00
|
|
|
<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_provided</span>(<span style="color: #a0522d;">context</span>));
|
|
|
|
|
|
|
|
// <span style="color: #b22222;">calculate factor_en_deriv_e</span>
|
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">factor_en_deriv_e</span>[walk_num][4][elec_num];
|
2022-02-15 00:46:38 +01:00
|
|
|
rc = qmckl_get_jastrow_factor_en_deriv_e(context, &(factor_en_deriv_e[0][0][0]),walk_num*4*elec_num);
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
// <span style="color: #b22222;">check factor_en_deriv_e</span>
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">factor_en_deriv_e</span>[0][0][0]-0.11609919541763383) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">factor_en_deriv_e</span>[0][1][0]+0.23301394780804574) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">factor_en_deriv_e</span>[0][2][0]-0.17548337641865783) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">factor_en_deriv_e</span>[0][3][0]+0.9667363412285741 ) < 1.e-12);
|
|
|
|
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org857e640" class="outline-3">
|
|
|
|
<h3 id="org857e640"><span class="section-number-3">3.6</span> Electron-electron rescaled distances for each order</h3>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-3" id="text-3-6">
|
2021-07-08 08:58:56 +02:00
|
|
|
<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( 1 - \exp{-\kappa C_{ij}} \right)^p
|
|
|
|
\]
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
where \(C_{ij}\) is the matrix of electron-electron distances.
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org34c3450" class="outline-4">
|
|
|
|
<h4 id="org34c3450"><span class="section-number-4">3.6.1</span> Get</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-6-1">
|
2021-07-08 08:58:56 +02:00
|
|
|
<div class="org-src-container">
|
2022-02-15 00:46:38 +01:00
|
|
|
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span>
|
|
|
|
<span style="color: #0000ff;">qmckl_get_jastrow_een_rescaled_e</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>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">size_max</span>);
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org934d603" class="outline-4">
|
|
|
|
<h4 id="org934d603"><span class="section-number-4">3.6.2</span> Compute</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-6-2">
|
2022-08-07 15:32:06 +02:00
|
|
|
<table id="orgd51f3bc" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
<colgroup>
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
</colgroup>
|
2022-01-06 02:30:32 +01:00
|
|
|
<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>
|
2021-07-08 08:58:56 +02:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>context</code></td>
|
|
|
|
<td class="org-left"><code>qmckl_context</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Global state</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>walk_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of walkers</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>elec_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of electrons</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>cord_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Order of polynomials</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>rescale_factor_kappa_ee</code></td>
|
|
|
|
<td class="org-left"><code>double</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Factor to rescale ee distances</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>ee_distance</code></td>
|
|
|
|
<td class="org-left"><code>double[walk_num][elec_num][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Electron-electron distances</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>een_rescaled_e</code></td>
|
2022-02-14 10:30:59 +01:00
|
|
|
<td class="org-left"><code>double[walk_num][0:cord_num][elec_num][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">Electron-electron rescaled distances</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
2022-05-10 15:51:37 +02:00
|
|
|
<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_kappa_ee, <span style="color: #a020f0;">&</span>
|
2021-07-08 08:58:56 +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_kappa_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>
|
2022-02-14 10:30:59 +01:00
|
|
|
<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>
|
2021-07-08 08:58:56 +02:00
|
|
|
<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>
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">allocate</span>(een_rescaled_e_ij(elec_num * (elec_num - 1) / 2, cord_num + 1))
|
|
|
|
|
|
|
|
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> (cord_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>
|
|
|
|
|
|
|
|
! <span style="color: #b22222;">Prepare table of exponentiated distances raised to appropriate power</span>
|
|
|
|
een_rescaled_e = 0.0d0
|
|
|
|
<span style="color: #a020f0;">do</span> nw = 1, walk_num
|
|
|
|
een_rescaled_e_ij = 0.0d0
|
|
|
|
een_rescaled_e_ij(:, 1) = 1.0d0
|
|
|
|
|
2022-05-10 15:51:37 +02:00
|
|
|
|
2021-07-08 08:58:56 +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_kappa_ee * ee_distance(i, j, nw))
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
|
2022-05-10 15:51:37 +02:00
|
|
|
|
2021-07-08 08:58:56 +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 + 1 - 1) * een_rescaled_e_ij(k, 2)
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
|
|
|
|
! <span style="color: #b22222;">prepare the actual een table</span>
|
2022-02-14 10:30:59 +01:00
|
|
|
een_rescaled_e(:, :, 0, nw) = 1.0d0
|
2022-05-10 15:51:37 +02:00
|
|
|
|
2021-07-08 08:58:56 +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)
|
2022-02-14 10:30:59 +01:00
|
|
|
een_rescaled_e(i, j, l, nw) = x
|
|
|
|
een_rescaled_e(j, i, l, nw) = x
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
2021-09-27 11:32:31 +02:00
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> l = 0, cord_num
|
|
|
|
<span style="color: #a020f0;">do</span> j = 1, elec_num
|
2022-02-14 10:30:59 +01:00
|
|
|
een_rescaled_e(j, j, l, nw) = 0.0d0
|
2022-01-31 16:49:13 +01:00
|
|
|
<span style="color: #a020f0;">end do</span>
|
2021-09-27 11:32:31 +02:00
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
|
2022-05-10 15:51:37 +02:00
|
|
|
<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> (
|
|
|
|
<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_kappa_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> ) {
|
|
|
|
|
|
|
|
<span style="color: #228b22;">double</span> *<span style="color: #a0522d;">een_rescaled_e_ij</span>;
|
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">x</span>;
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">elec_pairs</span> = (elec_num * (elec_num - 1)) / 2;
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">len_een_ij</span> = elec_pairs * (cord_num + 1);
|
|
|
|
<span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">k</span>;
|
|
|
|
|
|
|
|
// <span style="color: #b22222;">number of element 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>
|
|
|
|
een_rescaled_e_ij = (<span style="color: #228b22;">double</span> *) malloc (<span style="color: #228b22;">len_een_ij</span> * <span style="color: #a020f0;">sizeof</span>(<span style="color: #228b22;">double</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: #b22222;">Prepare table of exponentiated distances raised to appropriate power</span>
|
|
|
|
// <span style="color: #b22222;">init</span>
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">kk</span> = 0; kk < walk_num*(cord_num+1)*elec_num*elec_num; ++kk) {
|
|
|
|
een_rescaled_e[kk]= 0.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
<span style="color: #b22222;"> for (int nw = 0; nw < walk_num; ++nw) {</span>
|
|
|
|
<span style="color: #b22222;"> for (int l = 0; l < (cord_num + 1); ++l) {</span>
|
|
|
|
<span style="color: #b22222;"> for (int i = 0; i < elec_num; ++i) {</span>
|
|
|
|
<span style="color: #b22222;"> for (int j = 0; j < elec_num; ++j) {</span>
|
|
|
|
<span style="color: #b22222;"> een_rescaled_e[j + i*elec_num + l*elec_num*elec_num + nw*(cord_num+1)*elec_num*elec_num]= 0.0;</span>
|
|
|
|
<span style="color: #b22222;"> }</span>
|
|
|
|
<span style="color: #b22222;"> }</span>
|
|
|
|
<span style="color: #b22222;"> }</span>
|
|
|
|
<span style="color: #b22222;"> }</span>
|
|
|
|
<span style="color: #b22222;"> </span>*/
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">nw</span> = 0; nw < walk_num; ++nw) {
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">kk</span> = 0; kk < len_een_ij; ++kk) {
|
|
|
|
// <span style="color: #b22222;">this array initialized at 0 except een_rescaled_e_ij(:, 1) = 1.0d0</span>
|
|
|
|
// <span style="color: #b22222;">and the arrangement of indices is [cord_num+1, ne*(ne-1)/2]</span>
|
|
|
|
een_rescaled_e_ij[kk]= ( kk < (elec_pairs) ? 1.0 : 0.0 );
|
|
|
|
}
|
|
|
|
|
|
|
|
k = 0;
|
|
|
|
<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;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">j</span> = 0; j < i; ++j) {
|
|
|
|
// <span style="color: #b22222;">een_rescaled_e_ij(k, 2) = dexp(-rescale_factor_kappa_ee * ee_distance(i, j, nw));</span>
|
|
|
|
een_rescaled_e_ij[k + elec_pairs] = exp(-rescale_factor_kappa_ee * \
|
|
|
|
ee_distance[j + i*elec_num + nw*(elec_num*elec_num)]);
|
|
|
|
k = k + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">l</span> = 2; l < (cord_num+1); ++l) {
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">k</span> = 0; k < elec_pairs; ++k) {
|
|
|
|
// <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>
|
|
|
|
een_rescaled_e_ij[k+l*elec_pairs] = een_rescaled_e_ij[k + (l - 1)*elec_pairs] * \
|
|
|
|
een_rescaled_e_ij[k + elec_pairs];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// <span style="color: #b22222;">prepare the actual een table</span>
|
|
|
|
<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;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">j</span> = 0; j < elec_num; ++j) {
|
|
|
|
een_rescaled_e[j + i*elec_num + 0 + nw*(cord_num+1)*elec_num*elec_num] = 1.0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// <span style="color: #b22222;">Up to here it should work.</span>
|
|
|
|
<span style="color: #a020f0;">for</span> ( <span style="color: #228b22;">int</span> <span style="color: #a0522d;">l</span> = 1; l < (cord_num+1); ++l) {
|
|
|
|
k = 0;
|
|
|
|
<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;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">j</span> = 0; j < i; ++j) {
|
|
|
|
x = een_rescaled_e_ij[k + l*elec_pairs];
|
|
|
|
een_rescaled_e[j + i*elec_num + l*elec_num*elec_num + nw*elec_num*elec_num*(cord_num+1)] = x;
|
|
|
|
een_rescaled_e[i + j*elec_num + l*elec_num*elec_num + nw*elec_num*elec_num*(cord_num+1)] = x;
|
|
|
|
k = k + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">l</span> = 0; l < (cord_num + 1); ++l) {
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">j</span> = 0; j < elec_num; ++j) {
|
|
|
|
een_rescaled_e[j + j*elec_num + l*elec_num*elec_num + nw*elec_num*elec_num*(cord_num+1)] = 0.0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
free(een_rescaled_e_ij);
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
|
|
|
|
}
|
|
|
|
</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_kappa_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_kappa_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> );
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
2021-09-14 10:01:20 +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> (
|
2021-07-08 08:58:56 +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_kappa_ee</span>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span>* <span style="color: #a0522d;">ee_distance</span>,
|
2022-05-10 15:51:37 +02:00
|
|
|
<span style="color: #228b22;">double</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">een_rescaled_e</span> ) {
|
|
|
|
|
|
|
|
<span style="color: #483d8b;">#ifdef</span> HAVE_HPC
|
|
|
|
<span style="color: #a020f0;">return</span> qmckl_compute_een_rescaled_e_hpc(context, walk_num, elec_num, cord_num, rescale_factor_kappa_ee, ee_distance, een_rescaled_e);
|
|
|
|
<span style="color: #483d8b;">#else</span>
|
|
|
|
<span style="color: #a020f0;">return</span> qmckl_compute_een_rescaled_e_doc(context, walk_num, elec_num, cord_num, rescale_factor_kappa_ee, ee_distance, een_rescaled_e);
|
|
|
|
<span style="color: #483d8b;">#endif</span>
|
|
|
|
}
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-05-10 15:51:37 +02:00
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org0aec18e" class="outline-4">
|
|
|
|
<h4 id="org0aec18e"><span class="section-number-4">3.6.3</span> Test</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-6-3">
|
2021-07-08 08:58:56 +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>));
|
|
|
|
|
|
|
|
|
2022-02-14 10:30:59 +01:00
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">een_rescaled_e</span>[walk_num][(cord_num + 1)][elec_num][elec_num];
|
2022-02-15 00:46:38 +01:00
|
|
|
rc = qmckl_get_jastrow_een_rescaled_e(context, &(een_rescaled_e[0][0][0][0]),elec_num*elec_num*(cord_num+1)*walk_num);
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
// <span style="color: #b22222;">value of (0,2,1)</span>
|
2022-02-14 10:30:59 +01:00
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_e</span>[0][1][0][2]-0.08084493981483197) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_e</span>[0][1][0][3]-0.1066745707571846) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_e</span>[0][1][0][4]-0.01754273169464735) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_e</span>[0][2][1][3]-0.02214680362033448) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_e</span>[0][2][1][4]-0.0005700154999202759) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_e</span>[0][2][1][5]-0.3424402276009091) < 1.e-12);
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-orgd1bb0bc" class="outline-3">
|
|
|
|
<h3 id="orgd1bb0bc"><span class="section-number-3">3.7</span> Electron-electron rescaled distances for each order and derivatives</h3>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-3" id="text-3-7">
|
2021-07-08 08:58:56 +02:00
|
|
|
<p>
|
2021-09-27 11:32:31 +02:00
|
|
|
<code>een_rescaled_e_deriv_e</code> stores the table of the derivatives of the
|
|
|
|
rescaled distances between all pairs of electrons and raised to the
|
|
|
|
power \(p\) defined by <code>cord_num</code>. Here we take its derivatives
|
|
|
|
required for the een jastrow.
|
2021-07-08 08:58:56 +02:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
TODO: write formulae
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org95a750b" class="outline-4">
|
|
|
|
<h4 id="org95a750b"><span class="section-number-4">3.7.1</span> Get</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-7-1">
|
2021-07-08 08:58:56 +02:00
|
|
|
<div class="org-src-container">
|
2022-02-15 00:46:38 +01:00
|
|
|
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span>
|
|
|
|
<span style="color: #0000ff;">qmckl_get_jastrow_een_rescaled_e_deriv_e</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>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">size_max</span>);
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-orga927e8c" class="outline-4">
|
|
|
|
<h4 id="orga927e8c"><span class="section-number-4">3.7.2</span> Compute</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-7-2">
|
2022-08-07 15:32:06 +02:00
|
|
|
<table id="org1a50d33" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
<colgroup>
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
</colgroup>
|
2022-01-06 02:30:32 +01:00
|
|
|
<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>
|
2021-07-08 08:58:56 +02:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>context</code></td>
|
|
|
|
<td class="org-left"><code>qmckl_context</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Global state</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>walk_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of walkers</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>elec_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of electrons</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>cord_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Order of polynomials</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>rescale_factor_kappa_ee</code></td>
|
|
|
|
<td class="org-left"><code>double</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Factor to rescale ee distances</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-08-07 15:32:06 +02:00
|
|
|
<td class="org-left"><code>coord_ee</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>double[walk_num][3][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Electron coordinates</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>ee_distance</code></td>
|
|
|
|
<td class="org-left"><code>double[walk_num][elec_num][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Electron-electron distances</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>een_rescaled_e</code></td>
|
2022-02-14 10:30:59 +01:00
|
|
|
<td class="org-left"><code>double[walk_num][0:cord_num][elec_num][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Electron-electron distances</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>een_rescaled_e_deriv_e</code></td>
|
2022-02-14 10:30:59 +01:00
|
|
|
<td class="org-left"><code>double[walk_num][0:cord_num][elec_num][4][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">Electron-electron rescaled distances</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
2022-05-10 15:51:37 +02:00
|
|
|
<pre class="src src-f90"><span style="color: #228b22;">integer</span><span style="color: #a0522d;"> function qmckl_compute_factor_een_rescaled_e_deriv_e_f( </span><span style="color: #a020f0;">&</span>
|
|
|
|
context, walk_num, elec_num, cord_num, rescale_factor_kappa_ee, <span style="color: #a020f0;">&</span>
|
2022-08-07 15:32:06 +02:00
|
|
|
coord_ee, ee_distance, een_rescaled_e, een_rescaled_e_deriv_e) <span style="color: #a020f0;">&</span>
|
2021-07-08 08:58:56 +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;"> cord_num</span>
|
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> rescale_factor_kappa_ee</span>
|
2022-08-07 15:32:06 +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>
|
2021-07-08 08:58:56 +02:00
|
|
|
<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>
|
2022-02-14 10:30:59 +01: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>(out) ::<span style="color: #a0522d;"> een_rescaled_e_deriv_e(elec_num,4,elec_num,0:cord_num,walk_num)</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
<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_deriv_e</span>
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">allocate</span>(elec_dist_deriv_e(4,elec_num,elec_num))
|
|
|
|
|
|
|
|
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> (cord_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>
|
|
|
|
|
|
|
|
! <span style="color: #b22222;">Prepare table of exponentiated distances raised to appropriate power</span>
|
|
|
|
een_rescaled_e_deriv_e = 0.0d0
|
|
|
|
<span style="color: #a020f0;">do</span> nw = 1, walk_num
|
|
|
|
<span style="color: #a020f0;">do</span> j = 1, elec_num
|
|
|
|
<span style="color: #a020f0;">do</span> i = 1, elec_num
|
|
|
|
rij_inv = 1.0d0 / ee_distance(i, j, nw)
|
|
|
|
<span style="color: #a020f0;">do</span> ii = 1, 3
|
2022-08-07 15:32:06 +02:00
|
|
|
elec_dist_deriv_e(ii, i, j) = (coord_ee(i, ii, nw) - coord_ee(j, ii, nw)) * rij_inv
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
elec_dist_deriv_e(4, i, j) = 2.0d0 * rij_inv
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
elec_dist_deriv_e(:, j, j) = 0.0d0
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
|
|
|
|
! <span style="color: #b22222;">prepare the actual een table</span>
|
|
|
|
<span style="color: #a020f0;">do</span> l = 1, cord_num
|
|
|
|
kappa_l = - <span style="color: #a020f0;">dble</span>(l) * rescale_factor_kappa_ee
|
|
|
|
<span style="color: #a020f0;">do</span> j = 1, elec_num
|
|
|
|
<span style="color: #a020f0;">do</span> i = 1, elec_num
|
2022-02-14 10:30:59 +01:00
|
|
|
een_rescaled_e_deriv_e(i, 1, j, l, nw) = kappa_l * elec_dist_deriv_e(1, i, j)
|
|
|
|
een_rescaled_e_deriv_e(i, 2, j, l, nw) = kappa_l * elec_dist_deriv_e(2, i, j)
|
|
|
|
een_rescaled_e_deriv_e(i, 3, j, l, nw) = kappa_l * elec_dist_deriv_e(3, i, j)
|
|
|
|
een_rescaled_e_deriv_e(i, 4, j, l, nw) = kappa_l * elec_dist_deriv_e(4, i, j)
|
|
|
|
|
|
|
|
een_rescaled_e_deriv_e(i, 4, j, l, nw) = een_rescaled_e_deriv_e(i, 4, j, l, nw) <span style="color: #a020f0;">&</span>
|
|
|
|
+ een_rescaled_e_deriv_e(i, 1, j, l, nw) * een_rescaled_e_deriv_e(i, 1, j, l, nw) <span style="color: #a020f0;">&</span>
|
|
|
|
+ een_rescaled_e_deriv_e(i, 2, j, l, nw) * een_rescaled_e_deriv_e(i, 2, j, l, nw) <span style="color: #a020f0;">&</span>
|
|
|
|
+ een_rescaled_e_deriv_e(i, 3, j, l, nw) * een_rescaled_e_deriv_e(i, 3, j, l, nw)
|
|
|
|
|
|
|
|
een_rescaled_e_deriv_e(i, 1, j, l, nw) = een_rescaled_e_deriv_e(i, 1, j, l, nw) * <span style="color: #a020f0;">&</span>
|
|
|
|
een_rescaled_e(i, j, l, nw)
|
|
|
|
een_rescaled_e_deriv_e(i, 3, j, l, nw) = een_rescaled_e_deriv_e(i, 2, j, l, nw) * <span style="color: #a020f0;">&</span>
|
|
|
|
een_rescaled_e(i, j, l, nw)
|
|
|
|
een_rescaled_e_deriv_e(i, 3, j, l, nw) = een_rescaled_e_deriv_e(i, 3, j, l, nw) * <span style="color: #a020f0;">&</span>
|
|
|
|
een_rescaled_e(i, j, l, nw)
|
|
|
|
een_rescaled_e_deriv_e(i, 4, j, l, nw) = een_rescaled_e_deriv_e(i, 4, j, l, nw) * <span style="color: #a020f0;">&</span>
|
|
|
|
een_rescaled_e(i, j, l, nw)
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<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_factor_een_rescaled_e_deriv_e_f</span>
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-orgddeac19" class="outline-4">
|
|
|
|
<h4 id="orgddeac19"><span class="section-number-4">3.7.3</span> Test</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-7-3">
|
2021-07-08 08:58:56 +02:00
|
|
|
<div class="org-src-container">
|
|
|
|
<pre class="src src-c">//<span style="color: #b22222;">assert(qmckl_electron_provided(context));</span>
|
2022-02-14 10:30:59 +01:00
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">een_rescaled_e_deriv_e</span>[walk_num][(cord_num + 1)][elec_num][4][elec_num];
|
2022-02-15 00:46:38 +01:00
|
|
|
size_max=walk_num*(cord_num + 1)*elec_num*4*elec_num;
|
|
|
|
rc = qmckl_get_jastrow_een_rescaled_e_deriv_e(context,
|
|
|
|
&(een_rescaled_e_deriv_e[0][0][0][0][0]),size_max);
|
2021-09-27 11:32:31 +02:00
|
|
|
|
|
|
|
// <span style="color: #b22222;">value of (0,0,0,2,1)</span>
|
2022-02-14 10:30:59 +01:00
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_e_deriv_e</span>[0][1][0][0][2] + 0.05991352796887283 ) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_e_deriv_e</span>[0][1][0][0][3] + 0.011714035071545248 ) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_e_deriv_e</span>[0][1][0][0][4] + 0.00441398875758468 ) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_e_deriv_e</span>[0][2][1][0][3] + 0.013553180060167595 ) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_e_deriv_e</span>[0][2][1][0][4] + 0.00041342909359870457) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_e_deriv_e</span>[0][2][1][0][5] + 0.5880599146214673 ) < 1.e-12);
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org52cfd6f" class="outline-3">
|
|
|
|
<h3 id="org52cfd6f"><span class="section-number-3">3.8</span> Electron-nucleus rescaled distances for each order</h3>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-3" id="text-3-8">
|
2021-07-08 08:58:56 +02:00
|
|
|
<p>
|
2022-01-31 16:49:13 +01:00
|
|
|
<code>een_rescaled_n</code> stores the table of the rescaled distances between
|
2021-07-08 08:58:56 +02:00
|
|
|
electrons and nucleii raised to the power \(p\) defined by <code>cord_num</code>:
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
\[
|
|
|
|
C_{ia,p} = \left( 1 - \exp{-\kappa C_{ia}} \right)^p
|
|
|
|
\]
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
where \(C_{ia}\) is the matrix of electron-nucleus distances.
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org2ad7096" class="outline-4">
|
|
|
|
<h4 id="org2ad7096"><span class="section-number-4">3.8.1</span> Get</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-8-1">
|
2021-07-08 08:58:56 +02:00
|
|
|
<div class="org-src-container">
|
2022-02-15 00:46:38 +01:00
|
|
|
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span>
|
|
|
|
<span style="color: #0000ff;">qmckl_get_jastrow_een_rescaled_n</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>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">size_max</span>);
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-orge4e6f88" class="outline-4">
|
|
|
|
<h4 id="orge4e6f88"><span class="section-number-4">3.8.2</span> Compute</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-8-2">
|
2022-08-07 15:32:06 +02:00
|
|
|
<table id="org400650f" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
<colgroup>
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
</colgroup>
|
2022-01-06 02:30:32 +01:00
|
|
|
<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>
|
2021-07-08 08:58:56 +02:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>context</code></td>
|
|
|
|
<td class="org-left"><code>qmckl_context</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Global state</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>walk_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of walkers</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>elec_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of electrons</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>nucl_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of atoms</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>cord_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Order of polynomials</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>rescale_factor_kappa_en</code></td>
|
|
|
|
<td class="org-left"><code>double</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Factor to rescale ee distances</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>en_distance</code></td>
|
|
|
|
<td class="org-left"><code>double[walk_num][elec_num][nucl_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Electron-nucleus distances</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>een_rescaled_n</code></td>
|
2022-02-14 10:30:59 +01:00
|
|
|
<td class="org-left"><code>double[walk_num][0:cord_num][nucl_num][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">Electron-nucleus rescaled distances</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
2022-05-10 15:51:37 +02:00
|
|
|
<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>
|
|
|
|
context, walk_num, elec_num, nucl_num, cord_num, rescale_factor_kappa_en, <span style="color: #a020f0;">&</span>
|
2021-07-08 08:58:56 +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>
|
|
|
|
<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_kappa_en</span>
|
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> en_distance(elec_num,nucl_num,walk_num)</span>
|
2022-02-14 10:30:59 +01: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>
|
2021-07-08 08:58:56 +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
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">if</span> (cord_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: #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
|
|
|
|
|
|
|
|
! <span style="color: #b22222;">prepare the actual een table</span>
|
2022-02-14 10:30:59 +01:00
|
|
|
een_rescaled_n(:, :, 0, nw) = 1.0d0
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> a = 1, nucl_num
|
|
|
|
<span style="color: #a020f0;">do</span> i = 1, elec_num
|
2022-02-14 10:30:59 +01:00
|
|
|
een_rescaled_n(i, a, 1, nw) = dexp(-rescale_factor_kappa_en * en_distance(i, a, nw))
|
2021-07-08 08:58:56 +02: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
|
2022-02-14 10:30:59 +01:00
|
|
|
een_rescaled_n(i, a, l, nw) = een_rescaled_n(i, a, l - 1, nw) * een_rescaled_n(i, a, 1, nw)
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<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_een_rescaled_n_f</span>
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
2021-09-14 10:01:20 +02:00
|
|
|
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_compute_een_rescaled_n</span> (
|
2021-07-08 08:58:56 +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;">double</span> <span style="color: #a0522d;">rescale_factor_kappa_en</span>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span>* <span style="color: #a0522d;">en_distance</span>,
|
2022-05-10 15:51:37 +02:00
|
|
|
<span style="color: #228b22;">double</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">een_rescaled_n</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> (nucl_num <= 0) {
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_INVALID_ARG_4;
|
|
|
|
}
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">if</span> (cord_num <= 0) {
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_INVALID_ARG_5;
|
|
|
|
}
|
|
|
|
|
|
|
|
// <span style="color: #b22222;">Prepare table of exponentiated distances raised to appropriate power</span>
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">i</span> = 0; i < (walk_num*(cord_num+1)*nucl_num*elec_num); ++i) {
|
|
|
|
een_rescaled_n[i] = 17.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">nw</span> = 0; nw < walk_num; ++nw) {
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">a</span> = 0; a < nucl_num; ++a) {
|
|
|
|
<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: #b22222;">prepare the actual een table</span>
|
|
|
|
//<span style="color: #b22222;">een_rescaled_n(:, :, 0, nw) = 1.0d0</span>
|
|
|
|
een_rescaled_n[i + a * elec_num + 0 + nw * elec_num*nucl_num*(cord_num+1)] = 1.0;
|
|
|
|
//<span style="color: #b22222;">een_rescaled_n(i, a, 1, nw) = dexp(-rescale_factor_kappa_en * en_distance(i, a, nw))</span>
|
|
|
|
een_rescaled_n[i + a*elec_num + elec_num*nucl_num + nw*elec_num*nucl_num*(cord_num+1)] = exp(-rescale_factor_kappa_en * \
|
|
|
|
en_distance[i + a*elec_num + nw*elec_num*nucl_num]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">l</span> = 2; l < (cord_num+1); ++l){
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">a</span> = 0; a < nucl_num; ++a) {
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">i</span> = 0; i < elec_num; ++i) {
|
|
|
|
een_rescaled_n[i + a*elec_num + l*elec_num*nucl_num + nw*elec_num*nucl_num*(cord_num+1)] = een_rescaled_n[i + a*elec_num + (l-1)*elec_num*nucl_num + nw*elec_num*nucl_num*(cord_num+1)] *\
|
|
|
|
een_rescaled_n[i + a*elec_num + elec_num*nucl_num + nw*elec_num*nucl_num*(cord_num+1)];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
|
|
|
|
}
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org608d6c9" class="outline-4">
|
|
|
|
<h4 id="org608d6c9"><span class="section-number-4">3.8.3</span> Test</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-8-3">
|
2021-07-08 08:58:56 +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>));
|
|
|
|
|
2022-02-14 10:30:59 +01:00
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">een_rescaled_n</span>[walk_num][(cord_num + 1)][nucl_num][elec_num];
|
2022-02-15 00:46:38 +01:00
|
|
|
size_max=walk_num*(cord_num + 1)*nucl_num*elec_num;
|
|
|
|
rc = qmckl_get_jastrow_een_rescaled_n(context, &(een_rescaled_n[0][0][0][0]),size_max);
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
// <span style="color: #b22222;">value of (0,2,1)</span>
|
2022-02-14 10:30:59 +01:00
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_n</span>[0][1][0][2]-0.10612983920006765) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_n</span>[0][1][0][3]-0.135652809635553) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_n</span>[0][1][0][4]-0.023391817607642338) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_n</span>[0][2][1][3]-0.880957224822116) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_n</span>[0][2][1][4]-0.027185942659395074) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_n</span>[0][2][1][5]-0.01343938025140174) < 1.e-12);
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org973cbe9" class="outline-3">
|
|
|
|
<h3 id="org973cbe9"><span class="section-number-3">3.9</span> Electron-nucleus rescaled distances for each order and derivatives</h3>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-3" id="text-3-9">
|
2021-07-08 08:58:56 +02:00
|
|
|
<p>
|
2022-01-31 16:49:13 +01:00
|
|
|
<code>een_rescaled_n_deriv_e</code> stores the table of the rescaled distances between
|
2021-07-08 08:58:56 +02:00
|
|
|
electrons and nucleii raised to the power \(p\) defined by <code>cord_num</code>:
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-orgf494d42" class="outline-4">
|
|
|
|
<h4 id="orgf494d42"><span class="section-number-4">3.9.1</span> Get</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-9-1">
|
2021-07-08 08:58:56 +02:00
|
|
|
<div class="org-src-container">
|
2022-02-15 00:46:38 +01:00
|
|
|
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span>
|
|
|
|
<span style="color: #0000ff;">qmckl_get_jastrow_een_rescaled_n_deriv_e</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>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">size_max</span>);
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org0a362d4" class="outline-4">
|
|
|
|
<h4 id="org0a362d4"><span class="section-number-4">3.9.2</span> Compute</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-9-2">
|
2022-08-07 15:32:06 +02:00
|
|
|
<table id="org75eb167" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
<colgroup>
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
</colgroup>
|
2022-01-06 02:30:32 +01:00
|
|
|
<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>
|
2021-07-08 08:58:56 +02:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>context</code></td>
|
|
|
|
<td class="org-left"><code>qmckl_context</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Global state</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>walk_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of walkers</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>elec_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of electrons</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>nucl_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of atoms</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>cord_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Order of polynomials</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>rescale_factor_kappa_en</code></td>
|
|
|
|
<td class="org-left"><code>double</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Factor to rescale ee distances</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-08-07 15:32:06 +02:00
|
|
|
<td class="org-left"><code>coord_ee</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>double[walk_num][3][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Electron coordinates</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-08-07 15:32:06 +02:00
|
|
|
<td class="org-left"><code>coord_en</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>double[3][nucl_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Nuclear coordinates</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>en_distance</code></td>
|
|
|
|
<td class="org-left"><code>double[walk_num][elec_num][nucl_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Electron-nucleus distances</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>een_rescaled_n</code></td>
|
2022-02-14 10:30:59 +01:00
|
|
|
<td class="org-left"><code>double[walk_num][0:cord_num][nucl_num][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Electron-nucleus distances</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>een_rescaled_n_deriv_e</code></td>
|
2022-02-14 10:30:59 +01:00
|
|
|
<td class="org-left"><code>double[walk_num][0:cord_num][nucl_num][4][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">Electron-nucleus rescaled distances</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
2022-05-10 15:51:37 +02:00
|
|
|
<pre class="src src-f90"><span style="color: #228b22;">integer</span><span style="color: #a0522d;"> function qmckl_compute_factor_een_rescaled_n_deriv_e_f( </span><span style="color: #a020f0;">&</span>
|
|
|
|
context, walk_num, elec_num, nucl_num, <span style="color: #a020f0;">&</span>
|
|
|
|
cord_num, rescale_factor_kappa_en, <span style="color: #a020f0;">&</span>
|
2022-08-07 15:32:06 +02:00
|
|
|
coord_ee, coord_en, en_distance, een_rescaled_n, een_rescaled_n_deriv_e) <span style="color: #a020f0;">&</span>
|
2021-07-08 08:58:56 +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>
|
|
|
|
<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_kappa_en</span>
|
2022-08-07 15:32:06 +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>
|
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> coord_en(nucl_num,3)</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> en_distance(elec_num,nucl_num,walk_num)</span>
|
2022-02-14 10:30:59 +01: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;"> een_rescaled_n_deriv_e(elec_num,4,nucl_num,0:cord_num,walk_num)</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
<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_deriv_e</span>
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">allocate</span>(elnuc_dist_deriv_e(4, elec_num, nucl_num))
|
|
|
|
|
|
|
|
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>
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">if</span> (cord_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: #b22222;">Prepare table of exponentiated distances raised to appropriate power</span>
|
|
|
|
een_rescaled_n_deriv_e = 0.0d0
|
|
|
|
<span style="color: #a020f0;">do</span> nw = 1, walk_num
|
|
|
|
|
|
|
|
! <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(i, a, nw)
|
|
|
|
<span style="color: #a020f0;">do</span> ii = 1, 3
|
2022-08-07 15:32:06 +02:00
|
|
|
elnuc_dist_deriv_e(ii, i, a) = (coord_ee(i, ii, nw) - coord_en(a, ii)) * ria_inv
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
elnuc_dist_deriv_e(4, i, a) = 2.0d0 * ria_inv
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> l = 0, cord_num
|
|
|
|
kappa_l = - <span style="color: #a020f0;">dble</span>(l) * rescale_factor_kappa_en
|
|
|
|
<span style="color: #a020f0;">do</span> a = 1, nucl_num
|
|
|
|
<span style="color: #a020f0;">do</span> i = 1, elec_num
|
2022-02-14 10:30:59 +01:00
|
|
|
een_rescaled_n_deriv_e(i, 1, a, l, nw) = kappa_l * elnuc_dist_deriv_e(1, i, a)
|
|
|
|
een_rescaled_n_deriv_e(i, 2, a, l, nw) = kappa_l * elnuc_dist_deriv_e(2, i, a)
|
|
|
|
een_rescaled_n_deriv_e(i, 3, a, l, nw) = kappa_l * elnuc_dist_deriv_e(3, i, a)
|
|
|
|
een_rescaled_n_deriv_e(i, 4, a, l, nw) = kappa_l * elnuc_dist_deriv_e(4, i, a)
|
|
|
|
|
|
|
|
een_rescaled_n_deriv_e(i, 4, a, l, nw) = een_rescaled_n_deriv_e(i, 4, a, l, nw) <span style="color: #a020f0;">&</span>
|
|
|
|
+ een_rescaled_n_deriv_e(i, 1, a, l, nw) * een_rescaled_n_deriv_e(i, 1, a, l, nw) <span style="color: #a020f0;">&</span>
|
|
|
|
+ een_rescaled_n_deriv_e(i, 2, a, l, nw) * een_rescaled_n_deriv_e(i, 2, a, l, nw) <span style="color: #a020f0;">&</span>
|
|
|
|
+ een_rescaled_n_deriv_e(i, 3, a, l, nw) * een_rescaled_n_deriv_e(i, 3, a, l, nw)
|
|
|
|
|
|
|
|
een_rescaled_n_deriv_e(i, 1, a, l, nw) = een_rescaled_n_deriv_e(i, 1, a, l, nw) * <span style="color: #a020f0;">&</span>
|
|
|
|
een_rescaled_n(i, a, l, nw)
|
|
|
|
een_rescaled_n_deriv_e(i, 2, a, l, nw) = een_rescaled_n_deriv_e(i, 2, a, l, nw) * <span style="color: #a020f0;">&</span>
|
|
|
|
een_rescaled_n(i, a, l, nw)
|
|
|
|
een_rescaled_n_deriv_e(i, 3, a, l, nw) = een_rescaled_n_deriv_e(i, 3, a, l, nw) * <span style="color: #a020f0;">&</span>
|
|
|
|
een_rescaled_n(i, a, l, nw)
|
|
|
|
een_rescaled_n_deriv_e(i, 4, a, l, nw) = een_rescaled_n_deriv_e(i, 4, a, l, nw) * <span style="color: #a020f0;">&</span>
|
|
|
|
een_rescaled_n(i, a, l, nw)
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<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_factor_een_rescaled_n_deriv_e_f</span>
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org4b40bbd" class="outline-4">
|
|
|
|
<h4 id="org4b40bbd"><span class="section-number-4">3.9.3</span> Test</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-9-3">
|
2021-07-08 08:58:56 +02:00
|
|
|
<div class="org-src-container">
|
2021-09-27 11:32:31 +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-02-14 10:30:59 +01:00
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">een_rescaled_n_deriv_e</span>[walk_num][(cord_num + 1)][nucl_num][4][elec_num];
|
2022-02-15 00:46:38 +01:00
|
|
|
size_max=walk_num*(cord_num + 1)*nucl_num*4*elec_num;
|
|
|
|
rc = qmckl_get_jastrow_een_rescaled_n_deriv_e(context, &(een_rescaled_n_deriv_e[0][0][0][0][0]),size_max);
|
2021-09-27 11:32:31 +02:00
|
|
|
|
|
|
|
// <span style="color: #b22222;">value of (0,2,1)</span>
|
2022-02-14 10:30:59 +01:00
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_n_deriv_e</span>[0][1][0][0][2]+0.07633444246999128 ) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_n_deriv_e</span>[0][1][0][0][3]-0.00033282346259738276) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_n_deriv_e</span>[0][1][0][0][4]+0.004775370547333061 ) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_n_deriv_e</span>[0][2][1][0][3]-0.1362654644223866 ) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_n_deriv_e</span>[0][2][1][0][4]+0.0231253431662794 ) < 1.e-12);
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">een_rescaled_n_deriv_e</span>[0][2][1][0][5]-0.001593334817691633 ) < 1.e-12);
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-orge323870" class="outline-3">
|
|
|
|
<h3 id="orge323870"><span class="section-number-3">3.10</span> Prepare for electron-electron-nucleus Jastrow \(f_{een}\)</h3>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-3" id="text-3-10">
|
2021-07-08 08:58:56 +02:00
|
|
|
<p>
|
|
|
|
Prepare <code>cord_vect_full</code> and <code>lkpm_combined_index</code> tables required for the
|
|
|
|
calculation of the three-body jastrow <code>factor_een</code> and its derivative
|
2022-01-31 16:49:13 +01:00
|
|
|
<code>factor_een_deriv_e</code>.
|
2021-07-08 08:58:56 +02:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org23ba4b3" class="outline-4">
|
|
|
|
<h4 id="org23ba4b3"><span class="section-number-4">3.10.1</span> Get</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-10-1">
|
2021-07-08 08:58:56 +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_get_jastrow_dim_cord_vect</span>(<span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>, <span style="color: #228b22;">int64_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">dim_cord_vect</span>);
|
|
|
|
<span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_get_jastrow_cord_vect_full</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;">cord_vect_full</span>);
|
|
|
|
<span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_get_jastrow_lkpm_combined_index</span>(<span style="color: #228b22;">qmckl_context</span> <span style="color: #a0522d;">context</span>, <span style="color: #228b22;">int64_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">lkpm_combined_index</span>);
|
2022-01-21 08:53:49 +01:00
|
|
|
<span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_get_jastrow_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_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>);
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org7e2918e" class="outline-4">
|
|
|
|
<h4 id="org7e2918e"><span class="section-number-4">3.10.2</span> Compute dim<sub>cord</sub><sub>vect</sub></h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-10-2">
|
2022-08-07 15:32:06 +02:00
|
|
|
<table id="org99de0d0" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
<colgroup>
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
</colgroup>
|
2022-01-06 02:30:32 +01:00
|
|
|
<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>
|
2021-07-08 08:58:56 +02:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>context</code></td>
|
|
|
|
<td class="org-left"><code>qmckl_context</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Global state</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>cord_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Order of polynomials</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>dim_cord_vect</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
|
|
|
<td class="org-left">dimension of cord<sub>vect</sub><sub>full</sub> table</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
2022-05-10 15:51:37 +02:00
|
|
|
<pre class="src src-f90"><span style="color: #228b22;">integer</span><span style="color: #a0522d;"> function qmckl_compute_dim_cord_vect_f( </span><span style="color: #a020f0;">&</span>
|
|
|
|
context, cord_num, dim_cord_vect) <span style="color: #a020f0;">&</span>
|
2021-07-08 08:58:56 +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>(out) ::<span style="color: #a0522d;"> dim_cord_vect</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, 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>
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">if</span> (cord_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>
|
|
|
|
|
|
|
|
dim_cord_vect = 0
|
|
|
|
|
|
|
|
<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>
|
|
|
|
dim_cord_vect = dim_cord_vect + 1
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<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_dim_cord_vect_f</span>
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
2021-09-14 10:01:20 +02:00
|
|
|
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_compute_dim_cord_vect</span> (
|
2021-07-08 08:58:56 +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-05-10 15:51:37 +02:00
|
|
|
<span style="color: #228b22;">int64_t</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">dim_cord_vect</span>){
|
|
|
|
|
|
|
|
<span style="color: #228b22;">int</span> <span style="color: #a0522d;">lmax</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> (cord_num <= 0) {
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_INVALID_ARG_2;
|
|
|
|
}
|
|
|
|
|
|
|
|
*dim_cord_vect = 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>;
|
|
|
|
*dim_cord_vect=*dim_cord_vect+1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
|
|
|
|
}
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org8182ca5" class="outline-4">
|
|
|
|
<h4 id="org8182ca5"><span class="section-number-4">3.10.3</span> Compute cord<sub>vect</sub><sub>full</sub></h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-10-3">
|
2022-08-07 15:32:06 +02:00
|
|
|
<table id="org15e6e87" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
<colgroup>
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
</colgroup>
|
2022-01-06 02:30:32 +01:00
|
|
|
<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>
|
2021-07-08 08:58:56 +02:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>context</code></td>
|
|
|
|
<td class="org-left"><code>qmckl_context</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Global state</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>nucl_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of atoms</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>dim_cord_vect</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">dimension of cord full table</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>type_nucl_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">dimension of cord full table</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>type_nucl_vector</code></td>
|
|
|
|
<td class="org-left"><code>int64_t[nucl_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">dimension of cord full table</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>cord_vector</code></td>
|
|
|
|
<td class="org-left"><code>double[dim_cord_vect][type_nucl_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">dimension of cord full table</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>cord_vect_full</code></td>
|
|
|
|
<td class="org-left"><code>double[dim_cord_vect][nucl_num]</code></td>
|
2021-07-08 08:58:56 +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-05-10 15:51:37 +02:00
|
|
|
<pre class="src src-f90"><span style="color: #228b22;">integer</span><span style="color: #a0522d;"> function qmckl_compute_cord_vect_full_doc_f( </span><span style="color: #a020f0;">&</span>
|
|
|
|
context, nucl_num, dim_cord_vect, type_nucl_num, <span style="color: #a020f0;">&</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
type_nucl_vector, cord_vector, cord_vect_full) <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;"> nucl_num</span>
|
|
|
|
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> dim_cord_vect</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>
|
2021-09-27 11:32:31 +02:00
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> cord_vector(type_nucl_num, dim_cord_vect)</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(out) ::<span style="color: #a0522d;"> cord_vect_full(nucl_num,dim_cord_vect)</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> (nucl_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> (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>
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">if</span> (dim_cord_vect <= 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> a = 1, nucl_num
|
2021-09-27 11:32:31 +02:00
|
|
|
cord_vect_full(a,1:dim_cord_vect) = cord_vector(type_nucl_vector(a),1:dim_cord_vect)
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
|
2022-05-10 15:51:37 +02:00
|
|
|
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_compute_cord_vect_full_doc_f</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
2022-05-10 15:51:37 +02:00
|
|
|
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_compute_cord_vect_full_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;">nucl_num</span>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">dim_cord_vect</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;">double</span>* <span style="color: #a0522d;">cord_vector</span>,
|
|
|
|
<span style="color: #228b22;">double</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">cord_vect_full</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> (nucl_num <= 0) {
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_INVALID_ARG_2;
|
|
|
|
}
|
|
|
|
|
|
|
|
<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> (dim_cord_vect <= 0) {
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_INVALID_ARG_5;
|
|
|
|
}
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">i</span>=0; i < dim_cord_vect; ++i) {
|
|
|
|
<span style="color: #a020f0;">for</span> (<span style="color: #228b22;">int</span> <span style="color: #a0522d;">a</span>=0; a < nucl_num; ++a){
|
|
|
|
cord_vect_full[a + i*nucl_num] = cord_vector[(type_nucl_vector[a]-1)+i*type_nucl_num];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
|
|
|
|
}
|
|
|
|
</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_cord_vect_full_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;">nucl_num</span>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">dim_cord_vect</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;">double</span>* <span style="color: #a0522d;">cord_vector</span>,
|
|
|
|
<span style="color: #228b22;">double</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">cord_vect_full</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_cord_vect_full_hpc</span> (
|
2021-07-08 08:58:56 +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>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">dim_cord_vect</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;">double</span>* <span style="color: #a0522d;">cord_vector</span>,
|
2022-05-10 15:51:37 +02:00
|
|
|
<span style="color: #228b22;">double</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">cord_vect_full</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_cord_vect_full</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;">nucl_num</span>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">dim_cord_vect</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;">double</span>* <span style="color: #a0522d;">cord_vector</span>,
|
|
|
|
<span style="color: #228b22;">double</span>* <span style="color: #a020f0;">const</span> <span style="color: #a0522d;">cord_vect_full</span> ) {
|
|
|
|
|
|
|
|
<span style="color: #483d8b;"> #ifdef</span> HAVE_HPC
|
|
|
|
<span style="color: #a020f0;">return</span> qmckl_compute_cord_vect_full_hpc(context, nucl_num, dim_cord_vect, type_nucl_num, type_nucl_vector, cord_vector, cord_vect_full);
|
|
|
|
<span style="color: #483d8b;"> #else</span>
|
|
|
|
<span style="color: #a020f0;">return</span> qmckl_compute_cord_vect_full_doc(context, nucl_num, dim_cord_vect, type_nucl_num, type_nucl_vector, cord_vector, cord_vect_full);
|
|
|
|
<span style="color: #483d8b;"> #endif</span>
|
|
|
|
}
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2022-05-10 15:51:37 +02:00
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-orgd8d9fa3" class="outline-4">
|
|
|
|
<h4 id="orgd8d9fa3"><span class="section-number-4">3.10.4</span> Compute lkpm<sub>combined</sub><sub>index</sub></h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-10-4">
|
2022-08-07 15:32:06 +02:00
|
|
|
<table id="org506a205" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
<colgroup>
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
</colgroup>
|
2022-01-06 02:30:32 +01:00
|
|
|
<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>
|
2021-07-08 08:58:56 +02:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>context</code></td>
|
|
|
|
<td class="org-left"><code>qmckl_context</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Global state</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>cord_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Order of polynomials</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>dim_cord_vect</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">dimension of cord full table</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-05-10 15:51:37 +02:00
|
|
|
<td class="org-left"><code>lkpm_combined_index</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>int64_t[4][dim_cord_vect]</code></td>
|
2021-07-08 08:58:56 +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">
|
2022-05-10 15:51:37 +02:00
|
|
|
<pre class="src src-f90"><span style="color: #228b22;">integer</span><span style="color: #a0522d;"> function qmckl_compute_lkpm_combined_index_f( </span><span style="color: #a020f0;">&</span>
|
|
|
|
context, cord_num, dim_cord_vect, lkpm_combined_index) <span style="color: #a020f0;">&</span>
|
2021-07-08 08:58:56 +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;"> dim_cord_vect</span>
|
|
|
|
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(out) ::<span style="color: #a0522d;"> lkpm_combined_index(dim_cord_vect, 4)</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, kk, p, lmax, m</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> (cord_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> (dim_cord_vect <= 0) <span style="color: #a020f0;">then</span>
|
|
|
|
info = QMCKL_INVALID_ARG_3
|
|
|
|
<span style="color: #a020f0;">return</span>
|
|
|
|
<span style="color: #a020f0;">endif</span>
|
|
|
|
|
|
|
|
|
|
|
|
kk = 0
|
|
|
|
<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;">end if</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) <span style="color: #a020f0;">.eq.</span> 1) <span style="color: #a020f0;">cycle</span>
|
|
|
|
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>
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_compute_lkpm_combined_index_f</span>
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
2021-09-14 10:01:20 +02:00
|
|
|
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span> <span style="color: #0000ff;">qmckl_compute_lkpm_combined_index</span> (
|
2021-07-08 08:58:56 +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>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">dim_cord_vect</span>,
|
2022-05-10 15:51:37 +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>;
|
|
|
|
|
|
|
|
<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_cord_vect <= 0) {
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_INVALID_ARG_3;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
*/
|
|
|
|
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;
|
|
|
|
lkpm_combined_index[kk ] = l;
|
|
|
|
lkpm_combined_index[kk + dim_cord_vect] = k;
|
|
|
|
lkpm_combined_index[kk + 2*dim_cord_vect] = p;
|
|
|
|
lkpm_combined_index[kk + 3*dim_cord_vect] = m;
|
|
|
|
kk = kk + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">return</span> QMCKL_SUCCESS;
|
|
|
|
}
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-orgf03a4a9" class="outline-4">
|
|
|
|
<h4 id="orgf03a4a9"><span class="section-number-4">3.10.5</span> Compute tmp<sub>c</sub></h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-10-5">
|
2022-08-07 15:32:06 +02:00
|
|
|
<table id="org51983be" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
<colgroup>
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
</colgroup>
|
2022-01-06 02:30:32 +01:00
|
|
|
<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>
|
2021-07-08 08:58:56 +02:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>context</code></td>
|
|
|
|
<td class="org-left"><code>qmckl_context</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Global state</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-21 08:53:49 +01:00
|
|
|
<td class="org-left"><code>cord_num</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
2022-01-21 08:53:49 +01:00
|
|
|
<td class="org-left">Order of polynomials</td>
|
2021-07-08 08:58:56 +02:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>elec_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of electrons</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>nucl_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of nucleii</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-21 08:53:49 +01:00
|
|
|
<td class="org-left"><code>walk_num</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
2022-01-21 08:53:49 +01:00
|
|
|
<td class="org-left">Number of walkers</td>
|
2021-07-08 08:58:56 +02:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>een_rescaled_e</code></td>
|
2022-02-14 10:30:59 +01:00
|
|
|
<td class="org-left"><code>double[walk_num][0:cord_num][elec_num][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
2022-01-21 08:53:49 +01:00
|
|
|
<td class="org-left">Electron-electron rescaled factor</td>
|
2021-07-08 08:58:56 +02:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>een_rescaled_n</code></td>
|
2022-02-14 10:30:59 +01:00
|
|
|
<td class="org-left"><code>double[walk_num][0:cord_num][nucl_num][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Electron-nucleus rescaled factor</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-21 08:53:49 +01:00
|
|
|
<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>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
2022-01-21 08:53:49 +01:00
|
|
|
<td class="org-left">vector of non-zero coefficients</td>
|
2021-07-08 08:58:56 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
2022-05-10 15:51:37 +02:00
|
|
|
<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
|
|
|
|
<span style="color: #a020f0;">return</span> qmckl_compute_tmp_c_hpc(context, cord_num, elec_num, nucl_num, walk_num, een_rescaled_e, een_rescaled_n, tmp_c);
|
|
|
|
<span style="color: #483d8b;">#else</span>
|
|
|
|
<span style="color: #a020f0;">return</span> qmckl_compute_tmp_c_doc(context, cord_num, elec_num, nucl_num, walk_num, een_rescaled_e, een_rescaled_n, tmp_c);
|
|
|
|
<span style="color: #483d8b;">#endif</span>
|
|
|
|
}
|
|
|
|
</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>
|
2022-01-21 08:53:49 +01:00
|
|
|
walk_num, een_rescaled_e, een_rescaled_n, tmp_c) <span style="color: #a020f0;">&</span>
|
2021-07-08 08:58:56 +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-01-21 08:53:49 +01:00
|
|
|
<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>
|
2022-02-14 10:30:59 +01: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-01-21 08:53:49 +01:00
|
|
|
<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
|
|
|
|
|
2021-07-08 08:58:56 +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-01-21 08:53:49 +01:00
|
|
|
<span style="color: #a020f0;">if</span> (cord_num <= 0) <span style="color: #a020f0;">then</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
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-01-21 08:53:49 +01:00
|
|
|
M = elec_num
|
|
|
|
N = nucl_num*(cord_num + 1)
|
|
|
|
K = elec_num
|
2022-02-14 10:30:59 +01:00
|
|
|
LDA = <span style="color: #a020f0;">size</span>(een_rescaled_e,1)
|
|
|
|
LDB = <span style="color: #a020f0;">size</span>(een_rescaled_n,1)
|
2022-01-21 08:53:49 +01:00
|
|
|
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
|
2022-05-10 15:51:37 +02:00
|
|
|
info = qmckl_dgemm(context, TransA, TransB, M, N, K, alpha, <span style="color: #a020f0;">&</span>
|
2022-02-14 10:30:59 +01:00
|
|
|
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>
|
2022-01-21 08:53:49 +01:00
|
|
|
beta, <span style="color: #a020f0;">&</span>
|
|
|
|
tmp_c(1,1,0,i,nw),LDC)
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
2022-02-14 10:30:59 +01:00
|
|
|
|
2022-05-10 15:51:37 +02:00
|
|
|
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_compute_tmp_c_doc_f</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
2022-05-10 15:51:37 +02:00
|
|
|
<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> );
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org1a3f048" class="outline-4">
|
|
|
|
<h4 id="org1a3f048"><span class="section-number-4">3.10.6</span> Compute dtmp<sub>c</sub></h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-10-6">
|
2022-08-07 15:32:06 +02:00
|
|
|
<table id="orgf97c731" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
<colgroup>
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
|
|
|
|
<col class="org-left" />
|
|
|
|
</colgroup>
|
2022-01-06 02:30:32 +01:00
|
|
|
<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>
|
2021-07-08 08:58:56 +02:00
|
|
|
<tbody>
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>context</code></td>
|
|
|
|
<td class="org-left"><code>qmckl_context</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Global state</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-21 08:53:49 +01:00
|
|
|
<td class="org-left"><code>cord_num</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
2022-01-21 08:53:49 +01:00
|
|
|
<td class="org-left">Order of polynomials</td>
|
2021-07-08 08:58:56 +02:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>elec_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of electrons</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>nucl_num</code></td>
|
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Number of nucleii</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-21 08:53:49 +01:00
|
|
|
<td class="org-left"><code>walk_num</code></td>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>int64_t</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
2022-01-21 08:53:49 +01:00
|
|
|
<td class="org-left">Number of walkers</td>
|
2021-07-08 08:58:56 +02:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-06 02:30:32 +01:00
|
|
|
<td class="org-left"><code>een_rescaled_e_deriv_e</code></td>
|
2022-02-14 10:30:59 +01:00
|
|
|
<td class="org-left"><code>double[walk_num][0:cord_num][elec_num][4][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
2022-01-21 08:53:49 +01:00
|
|
|
<td class="org-left">Electron-electron rescaled factor derivatives</td>
|
2021-07-08 08:58:56 +02:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-21 08:53:49 +01:00
|
|
|
<td class="org-left"><code>een_rescaled_n</code></td>
|
2022-02-14 10:30:59 +01:00
|
|
|
<td class="org-left"><code>double[walk_num][0:cord_num][nucl_num][elec_num]</code></td>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Electron-nucleus rescaled factor</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2022-01-21 08:53:49 +01:00
|
|
|
<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>
|
2021-07-08 08:58:56 +02:00
|
|
|
<td class="org-left">out</td>
|
2022-01-21 08:53:49 +01:00
|
|
|
<td class="org-left">vector of non-zero coefficients</td>
|
2021-07-08 08:58:56 +02:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
2022-05-10 15:51:37 +02:00
|
|
|
|
2021-07-08 08:58:56 +02:00
|
|
|
<div class="org-src-container">
|
2022-05-10 15:51:37 +02:00
|
|
|
<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>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">double</span>* <span style="color: #a0522d;">een_rescaled_e_deriv_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;">dtmp_c</span> )
|
|
|
|
{
|
|
|
|
<span style="color: #483d8b;">#ifdef</span> HAVE_HPC
|
|
|
|
<span style="color: #a020f0;">return</span> qmckl_compute_dtmp_c_hpc (context, cord_num, elec_num, nucl_num, walk_num, een_rescaled_e_deriv_e,
|
|
|
|
een_rescaled_n, dtmp_c );
|
|
|
|
<span style="color: #483d8b;">#else</span>
|
|
|
|
<span style="color: #a020f0;">return</span> qmckl_compute_dtmp_c_doc (context, cord_num, elec_num, nucl_num, walk_num, een_rescaled_e_deriv_e,
|
|
|
|
een_rescaled_n, dtmp_c );
|
|
|
|
<span style="color: #483d8b;">#endif</span>
|
|
|
|
}
|
|
|
|
</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>
|
2022-01-21 08:53:49 +01:00
|
|
|
walk_num, een_rescaled_e_deriv_e, een_rescaled_n, dtmp_c) <span style="color: #a020f0;">&</span>
|
2021-07-08 08:58:56 +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-01-21 08:53:49 +01:00
|
|
|
<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>
|
2022-02-14 10:30:59 +01:00
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> een_rescaled_e_deriv_e(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(elec_num, nucl_num, 0:cord_num, walk_num)</span>
|
2022-01-21 08:53:49 +01:00
|
|
|
<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>
|
|
|
|
|
|
|
|
TransA = <span style="color: #8b2252;">'N'</span>
|
|
|
|
TransB = <span style="color: #8b2252;">'N'</span>
|
|
|
|
alpha = 1.0d0
|
|
|
|
beta = 0.0d0
|
2021-07-08 08:58:56 +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-01-21 08:53:49 +01:00
|
|
|
<span style="color: #a020f0;">if</span> (cord_num <= 0) <span style="color: #a020f0;">then</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
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-01-21 08:53:49 +01:00
|
|
|
M = 4*elec_num
|
|
|
|
N = nucl_num*(cord_num + 1)
|
|
|
|
K = elec_num
|
2022-02-14 10:30:59 +01:00
|
|
|
LDA = 4*<span style="color: #a020f0;">size</span>(een_rescaled_e_deriv_e,1)
|
|
|
|
LDB = <span style="color: #a020f0;">size</span>(een_rescaled_n,1)
|
2022-01-21 08:53:49 +01:00
|
|
|
LDC = 4*<span style="color: #a020f0;">size</span>(dtmp_c,1)
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> nw=1, walk_num
|
2022-05-10 15:51:37 +02:00
|
|
|
<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_deriv_e(1,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>
|
|
|
|
dtmp_c(1,1,1,0,i,nw),LDC)
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
2022-01-21 08:53:49 +01:00
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
|
2022-05-10 15:51:37 +02:00
|
|
|
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_compute_dtmp_c_doc_f</span>
|
2022-01-21 08:53:49 +01:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org68ade7b" class="outline-4">
|
|
|
|
<h4 id="org68ade7b"><span class="section-number-4">3.10.7</span> Test</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-10-7">
|
2022-01-21 08:53:49 +01: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];
|
|
|
|
rc = qmckl_get_jastrow_tmp_c(context, &(tmp_c[0][0][0][0][0]));
|
|
|
|
|
|
|
|
<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];
|
|
|
|
rc = qmckl_get_jastrow_dtmp_c(context, &(dtmp_c[0][0][0][0][0][0]));
|
|
|
|
|
2022-05-10 15:51:37 +02:00
|
|
|
printf(<span style="color: #8b2252;">"%e\n%e\n"</span>, tmp_c[0][0][1][0][0], 2.7083473948352403);
|
2022-01-21 08:53:49 +01:00
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">tmp_c</span>[0][0][1][0][0] - 2.7083473948352403) < 1e-12);
|
|
|
|
|
2022-05-10 15:51:37 +02:00
|
|
|
printf(<span style="color: #8b2252;">"%e\n%e\n"</span>, tmp_c[0][1][0][0][0],0.237440520852232);
|
2022-02-14 10:30:59 +01:00
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">dtmp_c</span>[0][1][0][0][0][0] - 0.237440520852232) < 1e-12);
|
2022-01-21 08:53:49 +01:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org9701237" class="outline-3">
|
|
|
|
<h3 id="org9701237"><span class="section-number-3">3.11</span> Electron-electron-nucleus Jastrow \(f_{een}\)</h3>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-3" id="text-3-11">
|
2022-01-21 08:53:49 +01:00
|
|
|
<p>
|
2022-01-31 16:49:13 +01:00
|
|
|
Calculate the electron-electron-nuclear three-body jastrow component <code>factor_een</code>
|
2022-01-21 08:53:49 +01:00
|
|
|
using the above prepared tables.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
TODO: write equations.
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-orgd2ea189" class="outline-4">
|
|
|
|
<h4 id="orgd2ea189"><span class="section-number-4">3.11.1</span> Get</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-11-1">
|
2022-01-21 08:53:49 +01:00
|
|
|
<div class="org-src-container">
|
2022-02-15 00:46:38 +01:00
|
|
|
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span>
|
|
|
|
<span style="color: #0000ff;">qmckl_get_jastrow_factor_een</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</span>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">size_max</span>);
|
2022-01-21 08:53:49 +01:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org5ec8946" class="outline-4">
|
|
|
|
<h4 id="org5ec8946"><span class="section-number-4">3.11.2</span> Compute naive</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-11-2">
|
2022-08-07 15:32:06 +02:00
|
|
|
<table id="orgf7f4f55" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
2022-01-21 08:53:49 +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>
|
|
|
|
<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 nucleii</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>dim_cord_vect</code></td>
|
|
|
|
<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>
|
|
|
|
<td class="org-left"><code>cord_vect_full</code></td>
|
|
|
|
<td class="org-left"><code>double[dim_cord_vect][nucl_num]</code></td>
|
|
|
|
<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>
|
|
|
|
<td class="org-left"><code>int64_t[4][dim_cord_vect]</code></td>
|
|
|
|
<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>
|
|
|
|
<td class="org-left"><code>double[walk_num][elec_num][elec_num][0:cord_num]</code></td>
|
|
|
|
<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>
|
|
|
|
<td class="org-left"><code>double[walk_num][elec_num][nucl_num][0:cord_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>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">
|
2022-05-10 15:51:37 +02:00
|
|
|
<pre class="src src-f90"><span style="color: #228b22;">integer</span><span style="color: #a0522d;"> function qmckl_compute_factor_een_naive_f( </span><span style="color: #a020f0;">&</span>
|
|
|
|
context, walk_num, elec_num, nucl_num, cord_num,<span style="color: #a020f0;">&</span>
|
|
|
|
dim_cord_vect, cord_vect_full, lkpm_combined_index, <span style="color: #a020f0;">&</span>
|
|
|
|
een_rescaled_e, een_rescaled_n, factor_een) <span style="color: #a020f0;">&</span>
|
2022-01-21 08:53:49 +01: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, elec_num, cord_num, nucl_num, dim_cord_vect</span>
|
|
|
|
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> lkpm_combined_index(dim_cord_vect,4)</span>
|
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> cord_vect_full(nucl_num, dim_cord_vect)</span>
|
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> een_rescaled_e(0:cord_num, 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_n(0:cord_num, nucl_num, elec_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
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">if</span> (cord_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>
|
|
|
|
|
|
|
|
factor_een = 0.0d0
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> nw =1, walk_num
|
|
|
|
<span style="color: #a020f0;">do</span> n = 1, dim_cord_vect
|
|
|
|
l = lkpm_combined_index(n, 1)
|
|
|
|
k = lkpm_combined_index(n, 2)
|
|
|
|
p = lkpm_combined_index(n, 3)
|
|
|
|
m = lkpm_combined_index(n, 4)
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> a = 1, nucl_num
|
|
|
|
accu2 = 0.0d0
|
|
|
|
cn = cord_vect_full(a, n)
|
|
|
|
<span style="color: #a020f0;">do</span> j = 1, elec_num
|
|
|
|
accu = 0.0d0
|
|
|
|
<span style="color: #a020f0;">do</span> i = 1, elec_num
|
|
|
|
accu = accu + een_rescaled_e(k,i,j,nw) * <span style="color: #a020f0;">&</span>
|
|
|
|
een_rescaled_n(m,a,i,nw)
|
|
|
|
!<span style="color: #b22222;">if(nw .eq. 1) then</span>
|
|
|
|
! <span style="color: #b22222;">print *,l,k,p,m,j,i,een_rescaled_e(k,i,j,nw), een_rescaled_n(m,a,i,nw), accu</span>
|
|
|
|
!<span style="color: #b22222;">endif</span>
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
accu2 = accu2 + accu * een_rescaled_n(m + l,a,j,nw)
|
|
|
|
!<span style="color: #b22222;">print *, l,m,nw,accu, accu2, een_rescaled_n(m + l, a, j, nw), cn, factor_een(nw)</span>
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
factor_een(nw) = factor_een(nw) + accu2 * cn
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<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_factor_een_naive_f</span>
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org40baf6c" class="outline-4">
|
|
|
|
<h4 id="org40baf6c"><span class="section-number-4">3.11.3</span> Compute</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-11-3">
|
2022-08-07 15:32:06 +02:00
|
|
|
<table id="org04b43cc" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
2022-01-21 08:53:49 +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>
|
|
|
|
<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 nucleii</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>dim_cord_vect</code></td>
|
|
|
|
<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>
|
|
|
|
<td class="org-left"><code>cord_vect_full</code></td>
|
|
|
|
<td class="org-left"><code>double[dim_cord_vect][nucl_num]</code></td>
|
|
|
|
<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>
|
|
|
|
<td class="org-left"><code>int64_t[4][dim_cord_vect]</code></td>
|
|
|
|
<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">vector of non-zero coefficients</td>
|
|
|
|
<td class="org-left"> </td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>een_rescaled_n</code></td>
|
2022-02-14 10:30:59 +01:00
|
|
|
<td class="org-left"><code>double[walk_num][0:cord_num][nucl_num][elec_num]</code></td>
|
2022-01-21 08:53:49 +01: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">
|
2022-05-10 15:51:37 +02:00
|
|
|
<pre class="src src-f90"><span style="color: #228b22;">integer</span><span style="color: #a0522d;"> function qmckl_compute_factor_een_f( </span><span style="color: #a020f0;">&</span>
|
|
|
|
context, walk_num, elec_num, nucl_num, cord_num, <span style="color: #a020f0;">&</span>
|
|
|
|
dim_cord_vect, cord_vect_full, lkpm_combined_index, <span style="color: #a020f0;">&</span>
|
|
|
|
tmp_c, een_rescaled_n, factor_een) <span style="color: #a020f0;">&</span>
|
2022-01-21 08:53:49 +01: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, elec_num, cord_num, nucl_num, dim_cord_vect</span>
|
|
|
|
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> lkpm_combined_index(dim_cord_vect,4)</span>
|
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> cord_vect_full(nucl_num, dim_cord_vect)</span>
|
|
|
|
<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>
|
2022-02-14 10:30:59 +01: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>
|
2022-01-21 08:53:49 +01: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
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">if</span> (cord_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>
|
|
|
|
|
|
|
|
factor_een = 0.0d0
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> nw =1, walk_num
|
|
|
|
<span style="color: #a020f0;">do</span> n = 1, dim_cord_vect
|
|
|
|
l = lkpm_combined_index(n, 1)
|
|
|
|
k = lkpm_combined_index(n, 2)
|
|
|
|
p = lkpm_combined_index(n, 3)
|
|
|
|
m = lkpm_combined_index(n, 4)
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> a = 1, nucl_num
|
|
|
|
cn = cord_vect_full(a, n)
|
|
|
|
<span style="color: #a020f0;">if</span>(cn == 0.d0) <span style="color: #a020f0;">cycle</span>
|
|
|
|
|
|
|
|
accu = 0.0d0
|
|
|
|
<span style="color: #a020f0;">do</span> j = 1, elec_num
|
2022-02-14 10:30:59 +01:00
|
|
|
accu = accu + een_rescaled_n(j,a,m,nw) * tmp_c(j,a,m+l,k,nw)
|
2022-01-21 08:53:49 +01:00
|
|
|
<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>
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_compute_factor_een_f</span>
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org8d308b8" class="outline-4">
|
|
|
|
<h4 id="org8d308b8"><span class="section-number-4">3.11.4</span> Test</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-11-4">
|
2022-01-21 08:53:49 +01:00
|
|
|
<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_provided</span>(<span style="color: #a0522d;">context</span>));
|
|
|
|
|
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">factor_een</span>[walk_num];
|
2022-02-15 00:46:38 +01:00
|
|
|
rc = qmckl_get_jastrow_factor_een(context, &(factor_een[0]),walk_num);
|
2022-01-21 08:53:49 +01:00
|
|
|
|
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">factor_een</span>[0] + 0.37407972141304213) < 1e-12);
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org7c50d49" class="outline-3">
|
|
|
|
<h3 id="org7c50d49"><span class="section-number-3">3.12</span> Electron-electron-nucleus Jastrow \(f_{een}\) derivative</h3>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-3" id="text-3-12">
|
2022-01-21 08:53:49 +01:00
|
|
|
<p>
|
2022-01-31 16:49:13 +01:00
|
|
|
Calculate the electron-electron-nuclear three-body jastrow component <code>factor_een_deriv_e</code>
|
2022-01-21 08:53:49 +01:00
|
|
|
using the above prepared tables.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
TODO: write equations.
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org3d34419" class="outline-4">
|
|
|
|
<h4 id="org3d34419"><span class="section-number-4">3.12.1</span> Get</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-12-1">
|
2022-01-21 08:53:49 +01:00
|
|
|
<div class="org-src-container">
|
2022-02-15 00:46:38 +01:00
|
|
|
<pre class="src src-c"><span style="color: #228b22;">qmckl_exit_code</span>
|
|
|
|
<span style="color: #0000ff;">qmckl_get_jastrow_factor_een_deriv_e</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_deriv_e</span>,
|
|
|
|
<span style="color: #a020f0;">const</span> <span style="color: #228b22;">int64_t</span> <span style="color: #a0522d;">size_max</span>);
|
2022-01-21 08:53:49 +01:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-org5d7a97d" class="outline-4">
|
|
|
|
<h4 id="org5d7a97d"><span class="section-number-4">3.12.2</span> Compute Naive</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-12-2">
|
2022-08-07 15:32:06 +02:00
|
|
|
<table id="orge19801c" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
2022-01-21 08:53:49 +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>
|
|
|
|
<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 nucleii</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>dim_cord_vect</code></td>
|
|
|
|
<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>
|
|
|
|
<td class="org-left"><code>cord_vect_full</code></td>
|
|
|
|
<td class="org-left"><code>double[dim_cord_vect][nucl_num]</code></td>
|
|
|
|
<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>
|
|
|
|
<td class="org-left"><code>int64_t[4][dim_cord_vect]</code></td>
|
|
|
|
<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>
|
|
|
|
<td class="org-left"><code>double[walk_num][elec_num][elec_num][0:cord_num]</code></td>
|
|
|
|
<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>
|
|
|
|
<td class="org-left"><code>double[walk_num][elec_num][nucl_num][0:cord_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>een_rescaled_e_deriv_e</code></td>
|
|
|
|
<td class="org-left"><code>double[walk_num][elec_num][4][elec_num][0:cord_num]</code></td>
|
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Electron-nucleus rescaled</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>een_rescaled_n_deriv_e</code></td>
|
|
|
|
<td class="org-left"><code>double[walk_num][elec_num][4][nucl_num][0:cord_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>factor_een_deriv_e</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">Electron-nucleus jastrow</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
2022-05-10 15:51:37 +02:00
|
|
|
<pre class="src src-f90"><span style="color: #228b22;">integer</span><span style="color: #a0522d;"> function qmckl_compute_factor_een_deriv_e_naive_f( </span><span style="color: #a020f0;">&</span>
|
|
|
|
context, walk_num, elec_num, nucl_num, cord_num, dim_cord_vect, <span style="color: #a020f0;">&</span>
|
|
|
|
cord_vect_full, lkpm_combined_index, een_rescaled_e, een_rescaled_n, <span style="color: #a020f0;">&</span>
|
|
|
|
een_rescaled_e_deriv_e, een_rescaled_n_deriv_e, factor_een_deriv_e)<span style="color: #a020f0;">&</span>
|
2022-01-21 08:53:49 +01: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, elec_num, cord_num, nucl_num, dim_cord_vect</span>
|
|
|
|
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> lkpm_combined_index(dim_cord_vect, 4)</span>
|
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> cord_vect_full(nucl_num, dim_cord_vect)</span>
|
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> een_rescaled_e(0:cord_num, 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_n(0:cord_num, nucl_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_deriv_e(0:cord_num, elec_num, 4, 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_n_deriv_e(0:cord_num, nucl_num, 4, elec_num, walk_num)</span>
|
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(out) ::<span style="color: #a0522d;"> factor_een_deriv_e(elec_num, 4, 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>
|
|
|
|
<span style="color: #228b22;">double precision</span> ::<span style="color: #a0522d;"> daccu(1:4), daccu2(1:4)</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>
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">if</span> (cord_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>
|
|
|
|
|
2021-07-08 08:58:56 +02:00
|
|
|
factor_een_deriv_e = 0.0d0
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> nw =1, walk_num
|
|
|
|
<span style="color: #a020f0;">do</span> n = 1, dim_cord_vect
|
2022-01-31 16:49:13 +01:00
|
|
|
l = lkpm_combined_index(n, 1)
|
|
|
|
k = lkpm_combined_index(n, 2)
|
|
|
|
p = lkpm_combined_index(n, 3)
|
|
|
|
m = lkpm_combined_index(n, 4)
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> a = 1, nucl_num
|
2021-09-27 11:32:31 +02:00
|
|
|
cn = cord_vect_full(a, n)
|
2021-07-08 08:58:56 +02:00
|
|
|
<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
|
2021-09-27 11:32:31 +02:00
|
|
|
accu = accu + een_rescaled_e(k, i, j, nw) * <span style="color: #a020f0;">&</span>
|
|
|
|
een_rescaled_n(m, a, i, nw)
|
|
|
|
accu2 = accu2 + een_rescaled_e(k, i, j, nw) * <span style="color: #a020f0;">&</span>
|
|
|
|
een_rescaled_n(m + l, a, i, nw)
|
|
|
|
daccu(1:4) = daccu(1:4) + een_rescaled_e_deriv_e(k, j, 1:4, i, nw) * <span style="color: #a020f0;">&</span>
|
|
|
|
een_rescaled_n(m, a, i, nw)
|
|
|
|
daccu2(1:4) = daccu2(1:4) + een_rescaled_e_deriv_e(k, j, 1:4, i, nw) * <span style="color: #a020f0;">&</span>
|
|
|
|
een_rescaled_n(m + l, a, i, nw)
|
2021-07-08 08:58:56 +02:00
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
factor_een_deriv_e(j, 1:4, nw) = factor_een_deriv_e(j, 1:4, nw) + <span style="color: #a020f0;">&</span>
|
2021-09-27 11:32:31 +02:00
|
|
|
(accu * een_rescaled_n_deriv_e(m + l, a, 1:4, j, nw) <span style="color: #a020f0;">&</span>
|
|
|
|
+ daccu(1:4) * een_rescaled_n(m + l, a, j, nw) <span style="color: #a020f0;">&</span>
|
|
|
|
+ daccu2(1:4) * een_rescaled_n(m, a, j, nw) <span style="color: #a020f0;">&</span>
|
|
|
|
+ accu2 * een_rescaled_n_deriv_e(m, a, 1:4, j, nw)) * cn
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
factor_een_deriv_e(j, 4, nw) = factor_een_deriv_e(j, 4, nw) + 2.0d0 * ( <span style="color: #a020f0;">&</span>
|
2021-09-27 11:32:31 +02:00
|
|
|
daccu (1) * een_rescaled_n_deriv_e(m + l, a, 1, j, nw) + <span style="color: #a020f0;">&</span>
|
|
|
|
daccu (2) * een_rescaled_n_deriv_e(m + l, a, 2, j, nw) + <span style="color: #a020f0;">&</span>
|
|
|
|
daccu (3) * een_rescaled_n_deriv_e(m + l, a, 3, j, nw) + <span style="color: #a020f0;">&</span>
|
|
|
|
daccu2(1) * een_rescaled_n_deriv_e(m, a, 1, j, nw ) + <span style="color: #a020f0;">&</span>
|
|
|
|
daccu2(2) * een_rescaled_n_deriv_e(m, a, 2, j, nw ) + <span style="color: #a020f0;">&</span>
|
|
|
|
daccu2(3) * een_rescaled_n_deriv_e(m, a, 3, j, nw ) ) * cn
|
2021-07-08 08:58:56 +02:00
|
|
|
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
|
2022-01-21 08:53:49 +01:00
|
|
|
<span style="color: #a020f0;">end function</span> <span style="color: #0000ff;">qmckl_compute_factor_een_deriv_e_naive_f</span>
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-orge175a91" class="outline-4">
|
|
|
|
<h4 id="orge175a91"><span class="section-number-4">3.12.3</span> Compute</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-12-3">
|
2022-08-07 15:32:06 +02:00
|
|
|
<table id="org7bcb3db" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
2022-01-21 08:53:49 +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>
|
|
|
|
<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 nucleii</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>dim_cord_vect</code></td>
|
|
|
|
<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>
|
|
|
|
<td class="org-left"><code>cord_vect_full</code></td>
|
|
|
|
<td class="org-left"><code>double[dim_cord_vect][nucl_num]</code></td>
|
|
|
|
<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>
|
|
|
|
<td class="org-left"><code>int64_t[4][dim_cord_vect]</code></td>
|
|
|
|
<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>
|
2022-02-14 10:30:59 +01:00
|
|
|
<td class="org-left"><code>double[walk_num][0:cord_num][nucl_num][elec_num]</code></td>
|
2022-01-21 08:53:49 +01:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Electron-nucleus rescaled factor</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>een_rescaled_n_deriv_e</code></td>
|
2022-02-14 10:30:59 +01:00
|
|
|
<td class="org-left"><code>double[walk_num][0:cord_num][nucl_num][4][elec_num]</code></td>
|
2022-01-21 08:53:49 +01:00
|
|
|
<td class="org-left">in</td>
|
|
|
|
<td class="org-left">Derivative of Electron-nucleus rescaled factor</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td class="org-left"><code>factor_een_deriv_e</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">Derivative of Electron-nucleus jastrow</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="org-src-container">
|
2022-05-10 15:51:37 +02:00
|
|
|
<pre class="src src-f90"><span style="color: #228b22;">integer</span><span style="color: #a0522d;"> function qmckl_compute_factor_een_deriv_e_f( </span><span style="color: #a020f0;">&</span>
|
|
|
|
context, walk_num, elec_num, nucl_num, <span style="color: #a020f0;">&</span>
|
|
|
|
cord_num, dim_cord_vect, cord_vect_full, lkpm_combined_index, <span style="color: #a020f0;">&</span>
|
|
|
|
tmp_c, dtmp_c, een_rescaled_n, een_rescaled_n_deriv_e, factor_een_deriv_e)<span style="color: #a020f0;">&</span>
|
2022-01-21 08:53:49 +01: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, elec_num, cord_num, nucl_num, dim_cord_vect</span>
|
|
|
|
<span style="color: #228b22;">integer</span>*8 , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> lkpm_combined_index(dim_cord_vect,4)</span>
|
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(in) ::<span style="color: #a0522d;"> cord_vect_full(nucl_num, dim_cord_vect)</span>
|
|
|
|
<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>
|
2022-02-14 10:30:59 +01: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>(in) ::<span style="color: #a0522d;"> een_rescaled_n_deriv_e(elec_num, 4, nucl_num, 0:cord_num, walk_num)</span>
|
2022-01-21 08:53:49 +01:00
|
|
|
<span style="color: #228b22;">double precision</span> , <span style="color: #a020f0;">intent</span>(out) ::<span style="color: #a0522d;"> factor_een_deriv_e(elec_num,4,walk_num)</span>
|
|
|
|
|
|
|
|
<span style="color: #228b22;">integer</span>*8 ::<span style="color: #a0522d;"> i, a, j, l, k, p, m, n, nw, ii</span>
|
|
|
|
<span style="color: #228b22;">double precision</span> ::<span style="color: #a0522d;"> accu, accu2, cn</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>
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">if</span> (cord_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>
|
|
|
|
|
|
|
|
factor_een_deriv_e = 0.0d0
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> nw =1, walk_num
|
|
|
|
<span style="color: #a020f0;">do</span> n = 1, dim_cord_vect
|
|
|
|
l = lkpm_combined_index(n, 1)
|
|
|
|
k = lkpm_combined_index(n, 2)
|
|
|
|
p = lkpm_combined_index(n, 3)
|
|
|
|
m = lkpm_combined_index(n, 4)
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> a = 1, nucl_num
|
|
|
|
cn = cord_vect_full(a, n)
|
|
|
|
<span style="color: #a020f0;">if</span>(cn == 0.d0) <span style="color: #a020f0;">cycle</span>
|
|
|
|
|
|
|
|
<span style="color: #a020f0;">do</span> ii = 1, 4
|
|
|
|
<span style="color: #a020f0;">do</span> j = 1, elec_num
|
|
|
|
factor_een_deriv_e(j,ii,nw) = factor_een_deriv_e(j,ii,nw) + (<span style="color: #a020f0;">&</span>
|
2022-02-14 10:30:59 +01:00
|
|
|
tmp_c(j,a,m,k,nw) * een_rescaled_n_deriv_e(j,ii,a,m+l,nw) + <span style="color: #a020f0;">&</span>
|
|
|
|
(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>
|
|
|
|
tmp_c(j,a,m+l,k,nw) * een_rescaled_n_deriv_e(j,ii,a,m,nw) <span style="color: #a020f0;">&</span>
|
2022-01-21 08:53:49 +01:00
|
|
|
) * cn
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
|
|
|
|
cn = cn + cn
|
|
|
|
<span style="color: #a020f0;">do</span> j = 1, elec_num
|
|
|
|
factor_een_deriv_e(j,4,nw) = factor_een_deriv_e(j,4,nw) + (<span style="color: #a020f0;">&</span>
|
2022-02-14 10:30:59 +01:00
|
|
|
(dtmp_c(j,1,a,m ,k,nw)) * een_rescaled_n_deriv_e(j,1,a,m+l,nw) + <span style="color: #a020f0;">&</span>
|
|
|
|
(dtmp_c(j,2,a,m ,k,nw)) * een_rescaled_n_deriv_e(j,2,a,m+l,nw) + <span style="color: #a020f0;">&</span>
|
|
|
|
(dtmp_c(j,3,a,m ,k,nw)) * een_rescaled_n_deriv_e(j,3,a,m+l,nw) + <span style="color: #a020f0;">&</span>
|
|
|
|
(dtmp_c(j,1,a,m+l,k,nw)) * een_rescaled_n_deriv_e(j,1,a,m ,nw) + <span style="color: #a020f0;">&</span>
|
|
|
|
(dtmp_c(j,2,a,m+l,k,nw)) * een_rescaled_n_deriv_e(j,2,a,m ,nw) + <span style="color: #a020f0;">&</span>
|
|
|
|
(dtmp_c(j,3,a,m+l,k,nw)) * een_rescaled_n_deriv_e(j,3,a,m ,nw) <span style="color: #a020f0;">&</span>
|
2022-01-21 08:53:49 +01:00
|
|
|
) * cn
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<span style="color: #a020f0;">end do</span>
|
|
|
|
<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_factor_een_deriv_e_f</span>
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-08-07 15:32:06 +02:00
|
|
|
<div id="outline-container-orgcfdfa67" class="outline-4">
|
|
|
|
<h4 id="orgcfdfa67"><span class="section-number-4">3.12.4</span> Test</h4>
|
2022-02-09 14:39:28 +01:00
|
|
|
<div class="outline-text-4" id="text-3-12-4">
|
2021-07-08 08:58:56 +02:00
|
|
|
<div class="org-src-container">
|
2021-09-27 11:32:31 +02:00
|
|
|
<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_provided</span>(<span style="color: #a0522d;">context</span>));
|
|
|
|
|
2022-02-15 00:46:38 +01:00
|
|
|
<span style="color: #228b22;">double</span> <span style="color: #a0522d;">factor_een_deriv_e</span>[4][walk_num][elec_num];
|
|
|
|
rc = qmckl_get_jastrow_factor_een_deriv_e(context, &(factor_een_deriv_e[0][0][0]),4*walk_num*elec_num);
|
2021-07-08 08:58:56 +02:00
|
|
|
|
2022-02-15 00:46:38 +01:00
|
|
|
<span style="color: #0000ff;">assert</span>(fabs(<span style="color: #228b22;">factor_een_deriv_e</span>[0][0][0] + 0.0005481671107226865) < 1e-12);
|
2021-07-08 08:58:56 +02:00
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="postamble" class="status">
|
|
|
|
<p class="author">Author: TREX CoE</p>
|
2022-08-07 15:32:06 +02:00
|
|
|
<p class="date">Created: 2022-08-07 Sun 13:31</p>
|
2021-07-08 08:58:56 +02:00
|
|
|
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|