/usr/share/doc/libchemps2/html/matrixelements.html is in chemps2-doc 1.6-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>5. CheMPS2::Hamiltonian — CheMPS2 1.6 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="/usr/share/javascript/jquery/jquery.js"></script>
<script type="text/javascript" src="/usr/share/javascript/underscore/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="/usr/share/javascript/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="CheMPS2 1.6 documentation" href="index.html" />
<link rel="next" title="6. DMRG calculations" href="inoutput.html" />
<link rel="prev" title="4. Symmetries" href="symmetry.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="inoutput.html" title="6. DMRG calculations"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="symmetry.html" title="4. Symmetries"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">CheMPS2 1.6 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<span class="target" id="index-0"></span><span class="target" id="index-1"></span><div class="section" id="chemps2-hamiltonian">
<span id="index-2"></span><h1>5. <code class="docutils literal"><span class="pre">CheMPS2::Hamiltonian</span></code><a class="headerlink" href="#chemps2-hamiltonian" title="Permalink to this headline">¶</a></h1>
<p>There are several ways to feed matrix elements to CheMPS2. They are explained below in detail. Because CheMPS2 is a spin-adapted code, it can only handle spatial orbitals. It is hence not possible to use different orbitals for <span class="math">\(\uparrow\)</span> and <span class="math">\(\downarrow\)</span> electrons.</p>
<ol class="arabic simple">
<li>The <code class="docutils literal"><span class="pre">CheMPS2::Hamiltonian</span></code> object is able to read in FCIDUMP files.</li>
<li>The <code class="docutils literal"><span class="pre">savehdf</span></code> plugin to <a class="reference external" href="http://www.psicode.org/">psi4</a> fills a <code class="docutils literal"><span class="pre">CheMPS2::Hamiltonian</span></code> object, and saves the matrix elements to disk in HDF5 format, taking into account their eightfold permutation symmetry.</li>
<li>Users can also generate matrix elements themselves, and feed them to the <code class="docutils literal"><span class="pre">CheMPS2::Hamiltonian</span></code> object.</li>
</ol>
<div class="section" id="psi4-fcidump-plugin">
<h2>5.1. psi4 <code class="docutils literal"><span class="pre">fcidump</span></code> plugin<a class="headerlink" href="#psi4-fcidump-plugin" title="Permalink to this headline">¶</a></h2>
<p>The <code class="docutils literal"><span class="pre">CheMPS2::Hamiltonian</span></code> object is able to read in FCIDUMP files:</p>
<div class="highlight-c++"><div class="highlight"><pre><span class="n">CheMPS2</span><span class="o">::</span><span class="n">Hamiltonian</span><span class="o">::</span><span class="n">Hamiltonian</span><span class="p">(</span> <span class="k">const</span> <span class="n">string</span> <span class="n">filename</span><span class="p">,</span> <span class="k">const</span> <span class="kt">int</span> <span class="n">psi4groupnumber</span> <span class="p">)</span>
</pre></div>
</div>
<p>The variable <code class="docutils literal"><span class="pre">filename</span></code> should contain the path to the FCIDUMP file, and the variable <code class="docutils literal"><span class="pre">psi4groupnumber</span></code> should be the group number of the abelian point group with real-valued character table as defined in <a class="reference external" href="http://www.psicode.org/">psi4</a>. The conversion table is provided here:</p>
<blockquote>
<div><table border="1" class="docutils">
<colgroup>
<col width="29%" />
<col width="8%" />
<col width="8%" />
<col width="8%" />
<col width="8%" />
<col width="8%" />
<col width="10%" />
<col width="10%" />
<col width="10%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td>Group name</td>
<td>c1</td>
<td>ci</td>
<td>c2</td>
<td>cs</td>
<td>d2</td>
<td>c2v</td>
<td>c2h</td>
<td>d2h</td>
</tr>
<tr class="row-even"><td>Group number</td>
<td>0</td>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>FCIDUMP files can for example be generated by a plugin to <a class="reference external" href="http://www.psicode.org/">psi4</a>. The plugin has been tested on commit <code class="docutils literal"><span class="pre">14c78eabdca86f8e094576890518d93d300d2500</span></code> (February 27, 2015) on <a class="reference external" href="https://github.com/psi4/psi4public">https://github.com/psi4/psi4public</a>, and should work on later versions as well.</p>
<p>To make use of this feature, build <a class="reference external" href="http://www.psicode.org/">psi4</a> with the plugin option, and then run:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span><span class="nb">cd</span> /mypsi4plugins
<span class="nv">$ </span>psi4 --new-plugin fcidump
<span class="nv">$ </span><span class="nb">cd </span>fcidump
</pre></div>
</div>
<p>Now, replace the file <code class="docutils literal"><span class="pre">fcidump.cc</span></code> with <code class="docutils literal"><span class="pre">/sourcefolder/chemps2/integrals/psi4plugins/fcidump.cc</span></code>. To compile the plugin, run:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>make
</pre></div>
</div>
<p>An example input file to generate a FCIDUMP file:</p>
<div class="highlight-python"><div class="highlight"><pre>molecule N2 {
N 0.0000 0.0000 0.0000
N 0.0000 0.0000 2.1180
units au
}
plugin_load("fcidump/fcidump.so")
set basis cc-pVDZ
set reference rhf
set e_convergence 1e-12
set d_convergence 1e-12
set ints_tolerance 0.0
set fcidump dumpfilename N2.ccpvdz.fcidump
scf()
plugin("fcidump.so")
</pre></div>
</div>
<p>This file (<code class="docutils literal"><span class="pre">N2.fcidump.in</span></code>) should be placed in the folder <code class="docutils literal"><span class="pre">/mypsi4plugins</span></code>. The FCIDUMP file can then be generated with:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span><span class="nb">cd</span> /mypsi4plugins
<span class="nv">$ </span>psi4 N2.fcidump.in N2.fcidump.out
</pre></div>
</div>
<p>Examples of output generated with this plugin can be found in <code class="docutils literal"><span class="pre">/sourcefolder/chemps2/tests/matrixelements</span></code>.</p>
</div>
<div class="section" id="psi4-savehdf-plugin">
<h2>5.2. psi4 <code class="docutils literal"><span class="pre">savehdf</span></code> plugin<a class="headerlink" href="#psi4-savehdf-plugin" title="Permalink to this headline">¶</a></h2>
<p>The <code class="docutils literal"><span class="pre">CheMPS2::Hamiltonian</span></code> object is able to read in HDF5 files generated by a plugin to <a class="reference external" href="http://www.psicode.org/">psi4</a>. The plugin has been tested on commit <code class="docutils literal"><span class="pre">14c78eabdca86f8e094576890518d93d300d2500</span></code> (February 27, 2015) on <a class="reference external" href="https://github.com/psi4/psi4public">https://github.com/psi4/psi4public</a>, and should work on later versions as well. It stores all unique matrix elements (remember that there is eightfold permutation symmetry) in binary form with HDF5.</p>
<p>To make use of this feature, build <a class="reference external" href="http://www.psicode.org/">psi4</a> with the plugin option, and then run:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span><span class="nb">cd</span> /mypsi4plugins
<span class="nv">$ </span>psi4 --new-plugin savehdf
<span class="nv">$ </span><span class="nb">cd </span>savehdf
</pre></div>
</div>
<p>Now, replace the file <code class="docutils literal"><span class="pre">savehdf.cc</span></code> with <code class="docutils literal"><span class="pre">/sourcefolder/chemps2/integrals/psi4plugins/savehdf.cc</span></code>. To compile the plugin, the Makefile should be adjusted. Change the line</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">PSIPLUGIN</span> <span class="o">=</span> -L<span class="k">$(</span>OBJDIR<span class="k">)</span>/lib -lplugin
</pre></div>
</div>
<p>to</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">PSIPLUGIN</span> <span class="o">=</span> -L<span class="k">$(</span>OBJDIR<span class="k">)</span>/lib -lplugin -lchemps2
</pre></div>
</div>
<p>Remember to add the library and include paths to the Makefile as well, if <code class="docutils literal"><span class="pre">libchemps2</span></code> is not installed in a standard location.
To compile the plugin, run:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>make
</pre></div>
</div>
<p>An example input file to use the <code class="docutils literal"><span class="pre">savehdf</span></code> plugin:</p>
<div class="highlight-python"><div class="highlight"><pre>molecule N2 {
N 0.0000 0.0000 0.0000
N 0.0000 0.0000 2.1180
units au
}
plugin_load("savehdf/savehdf.so")
set basis cc-pVDZ
set reference rhf
set e_convergence 1e-12
set d_convergence 1e-12
set ints_tolerance 0.0
scf()
plugin("savehdf.so")
</pre></div>
</div>
<p>This file (<code class="docutils literal"><span class="pre">N2.savehdf.in</span></code>) should be placed in the folder <code class="docutils literal"><span class="pre">/mypsi4plugins</span></code>. The matrix elements can then be saved to disk in binary form with HDF5 by running:</p>
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span><span class="nb">cd</span> /mypsi4plugins
<span class="nv">$ </span>psi4 N2.savehdf.in N2.savehdf.out
</pre></div>
</div>
<p>The plugin generates three files:</p>
<div class="highlight-bash"><div class="highlight"><pre>/mypsi4plugins/CheMPS2_Ham_parent.h5
/mypsi4plugins/CheMPS2_Ham_Tmat.h5
/mypsi4plugins/CheMPS2_Ham_Vmat.h5
</pre></div>
</div>
<p>which allow to create an instance of the <code class="docutils literal"><span class="pre">CheMPS2::Hamiltonian</span></code> object:</p>
<div class="highlight-c++"><div class="highlight"><pre><span class="n">CheMPS2</span><span class="o">::</span><span class="n">Hamiltonian</span><span class="o">::</span><span class="n">Hamiltonian</span><span class="p">(</span> <span class="k">const</span> <span class="kt">bool</span> <span class="n">fileh5</span><span class="p">,</span> <span class="k">const</span> <span class="n">string</span> <span class="n">main_file</span><span class="p">,</span> <span class="k">const</span> <span class="n">string</span> <span class="n">file_tmat</span><span class="p">,</span> <span class="k">const</span> <span class="n">string</span> <span class="n">file_vmat</span> <span class="p">)</span>
</pre></div>
</div>
<p>The variable <code class="docutils literal"><span class="pre">fileh5</span></code> should be <code class="docutils literal"><span class="pre">true</span></code>, and the three strings should contain the paths to the three files listed above, in the same respective order.</p>
</div>
<div class="section" id="custom-matrix-elements">
<span id="chemps2-psi4irrepconventions"></span><h2>5.3. Custom matrix elements<a class="headerlink" href="#custom-matrix-elements" title="Permalink to this headline">¶</a></h2>
<p>It is also possible to create a <code class="docutils literal"><span class="pre">CheMPS2::Hamiltonian</span></code> object with your own matrix elements. Please consult the <code class="docutils literal"><span class="pre">CheMPS2::Hamiltonian</span></code> class in the <a class="reference external" href="http://sebwouters.github.io/CheMPS2/doxygen/index.html">doxygen html output</a>, and more specifically the functions:</p>
<div class="highlight-c++"><div class="highlight"><pre><span class="n">CheMPS2</span><span class="o">::</span><span class="n">Hamiltonian</span><span class="o">::</span><span class="n">Hamiltonian</span><span class="p">(</span> <span class="k">const</span> <span class="kt">int</span> <span class="n">Norbitals</span><span class="p">,</span> <span class="k">const</span> <span class="kt">int</span> <span class="n">nGroup</span><span class="p">,</span> <span class="k">const</span> <span class="kt">int</span> <span class="o">*</span> <span class="n">OrbIrreps</span> <span class="p">)</span>
<span class="kt">void</span> <span class="n">CheMPS2</span><span class="o">::</span><span class="n">Hamiltonian</span><span class="o">::</span><span class="n">setEconst</span><span class="p">(</span> <span class="k">const</span> <span class="kt">double</span> <span class="n">val</span> <span class="p">)</span>
<span class="kt">void</span> <span class="n">CheMPS2</span><span class="o">::</span><span class="n">Hamiltonian</span><span class="o">::</span><span class="n">setTmat</span><span class="p">(</span> <span class="k">const</span> <span class="kt">int</span> <span class="n">index1</span><span class="p">,</span> <span class="k">const</span> <span class="kt">int</span> <span class="n">index2</span><span class="p">,</span> <span class="k">const</span> <span class="kt">double</span> <span class="n">val</span> <span class="p">)</span>
<span class="kt">void</span> <span class="n">CheMPS2</span><span class="o">::</span><span class="n">Hamiltonian</span><span class="o">::</span><span class="n">setVmat</span><span class="p">(</span> <span class="k">const</span> <span class="kt">int</span> <span class="n">index1</span><span class="p">,</span> <span class="k">const</span> <span class="kt">int</span> <span class="n">index2</span><span class="p">,</span> <span class="k">const</span> <span class="kt">int</span> <span class="n">index3</span><span class="p">,</span> <span class="k">const</span> <span class="kt">int</span> <span class="n">index4</span><span class="p">,</span> <span class="k">const</span> <span class="kt">double</span> <span class="n">val</span> <span class="p">)</span>
</pre></div>
</div>
<p>The variable <code class="docutils literal"><span class="pre">Norbitals</span></code> should be the total number of orbitals in the active space. The variable <code class="docutils literal"><span class="pre">nGroup</span></code> should be the group number of the abelian point group with real-valued character table as defined in <a class="reference external" href="http://www.psicode.org/">psi4</a>. The array <code class="docutils literal"><span class="pre">OrbIrreps</span></code> of length <code class="docutils literal"><span class="pre">Norbitals</span></code> contains for each orbital its irreducible representation number as defined in <a class="reference external" href="http://www.psicode.org/">psi4</a>. The conversion table is provided here:</p>
<blockquote>
<div><table border="1" class="docutils">
<colgroup>
<col width="29%" />
<col width="9%" />
<col width="9%" />
<col width="9%" />
<col width="9%" />
<col width="9%" />
<col width="9%" />
<col width="9%" />
<col width="9%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Group / Irreps</th>
<th class="head">0</th>
<th class="head">1</th>
<th class="head">2</th>
<th class="head">3</th>
<th class="head">4</th>
<th class="head">5</th>
<th class="head">6</th>
<th class="head">7</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>0: c1</td>
<td>A</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr class="row-odd"><td>1: ci</td>
<td>Ag</td>
<td>Au</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr class="row-even"><td>2: c2</td>
<td>A</td>
<td>B</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr class="row-odd"><td>3: cs</td>
<td>A’</td>
<td>A’‘</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr class="row-even"><td>4: d2</td>
<td>A</td>
<td>B1</td>
<td>B2</td>
<td>B3</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr class="row-odd"><td>5: c2v</td>
<td>A1</td>
<td>A2</td>
<td>B1</td>
<td>B2</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr class="row-even"><td>6: c2h</td>
<td>Ag</td>
<td>Bg</td>
<td>Au</td>
<td>Bu</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr class="row-odd"><td>7: d2h</td>
<td>Ag</td>
<td>B1g</td>
<td>B2g</td>
<td>B3g</td>
<td>Au</td>
<td>B1u</td>
<td>B2u</td>
<td>B3u</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>Two important remarks:</p>
<ol class="arabic simple">
<li>On creation of the <code class="docutils literal"><span class="pre">CheMPS2::Hamiltonian</span></code> object, every matrix element is set to zero.</li>
<li>Physics notation is used for the two-electron integrals in CheMPS2: <span class="math">\(V_{ij;kl} = ( ik \mid jl )\)</span> or <code class="docutils literal"><span class="pre">CheMPS2::Hamiltonian::setVmat(</span> <span class="pre">i,</span> <span class="pre">j,</span> <span class="pre">k,</span> <span class="pre">l,</span> <span class="pre">(ik|jl)</span> <span class="pre">)</span></code>.</li>
</ol>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="index.html">
<img class="logo" src="_static/CheMPS2logo.png" alt="Logo"/>
</a></p>
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">5. <code class="docutils literal"><span class="pre">CheMPS2::Hamiltonian</span></code></a><ul>
<li><a class="reference internal" href="#psi4-fcidump-plugin">5.1. psi4 <code class="docutils literal"><span class="pre">fcidump</span></code> plugin</a></li>
<li><a class="reference internal" href="#psi4-savehdf-plugin">5.2. psi4 <code class="docutils literal"><span class="pre">savehdf</span></code> plugin</a></li>
<li><a class="reference internal" href="#custom-matrix-elements">5.3. Custom matrix elements</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="symmetry.html"
title="previous chapter">4. Symmetries</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="inoutput.html"
title="next chapter">6. DMRG calculations</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/matrixelements.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="inoutput.html" title="6. DMRG calculations"
>next</a> |</li>
<li class="right" >
<a href="symmetry.html" title="4. Symmetries"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">CheMPS2 1.6 documentation</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2013-2015, Sebastian Wouters.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
</div>
</body>
</html>
|