9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-07 14:03:37 +01:00
qp2/doc/users_guide/quickstart.html

371 lines
19 KiB
HTML
Raw Normal View History

2019-01-25 14:17:34 +01:00
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Quick-start guide &mdash; Quantum Package 2.0 documentation</title>
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Interfaces" href="interfaces.html" />
<link rel="prev" title="Selected Configuration Interaction" href="../intro/selected_ci.html" />
<script src="../_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="../index.html" class="icon icon-home"> Quantum Package
</a>
<div class="version">
2.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Introduction</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../intro/install.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../intro/selected_ci.html">Selected Configuration Interaction</a></li>
</ul>
<p class="caption"><span class="caption-text">User's guide</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Quick-start guide</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#demo-video">Demo video</a></li>
<li class="toctree-l2"><a class="reference internal" href="#hands-on">Hands on</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#create-the-ezfio-database">Create the EZFIO database</a></li>
<li class="toctree-l3"><a class="reference internal" href="#run-a-hartree-fock-calculation">Run a Hartree-Fock calculation</a></li>
<li class="toctree-l3"><a class="reference internal" href="#choose-the-target-mo-space">Choose the target <abbr title="Molecular Orbital">MO</abbr> space</a></li>
<li class="toctree-l3"><a class="reference internal" href="#run-the-cipsi-calculation">Run the <abbr title="Configuration Interaction using a Perturbative Selection">CIPSI</abbr> calculation</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="interfaces.html">Interfaces</a></li>
<li class="toctree-l1"><a class="reference internal" href="excited_states.html">Excited states</a></li>
<li class="toctree-l1"><a class="reference internal" href="natural_orbitals.html">Natural orbitals</a></li>
<li class="toctree-l1"><a class="reference internal" href="printing.html">Printing the near-<abbr title="Full Configuration Interaction">FCI</abbr> wave function</a></li>
<li class="toctree-l1"><a class="reference internal" href="plugins.html">Working with external plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="qp_plugins.html">qp_plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html">Index of commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="index.html#index-of-programs">Index of programs</a></li>
</ul>
<p class="caption"><span class="caption-text">Programmer's guide</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../programmers_guide/programming.html">Programming in the <em>Quantum Package</em></a></li>
<li class="toctree-l1"><a class="reference internal" href="../programmers_guide/ezfio.html">EZFIO</a></li>
<li class="toctree-l1"><a class="reference internal" href="../programmers_guide/plugins.html">Developing plugins</a></li>
<li class="toctree-l1"><a class="reference internal" href="../programmers_guide/index.html">Index for programmers</a></li>
<li class="toctree-l1"><a class="reference internal" href="../programmers_guide/plugins.html">Developing plugins</a></li>
</ul>
<p class="caption"><span class="caption-text">Appendix</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../appendix/benchmarks.html">Benchmarks</a></li>
<li class="toctree-l1"><a class="reference internal" href="../appendix/research.html">Some research made with the <em>Quantum Package</em></a></li>
<li class="toctree-l1"><a class="reference internal" href="../appendix/license.html">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="../appendix/contributors.html">Contributors</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">Quantum Package</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html">Docs</a> &raquo;</li>
<li>Quick-start guide</li>
<li class="wy-breadcrumbs-aside">
<a href="../_sources/users_guide/quickstart.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="quick-start-guide">
<h1>Quick-start guide<a class="headerlink" href="#quick-start-guide" title="Permalink to this headline"></a></h1>
<p>This tutorial should teach you everything you need to get started with
the the basics of the <em>Quantum Package</em>. As an example, we will run a frozen core
<abbr title="Configuration Interaction using a Perturbative Selection">CIPSI</abbr> calculation on the HCN molecule in the 631-G basis set.</p>
<div class="section" id="demo-video">
<h2>Demo video<a class="headerlink" href="#demo-video" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="hands-on">
<h2>Hands on<a class="headerlink" href="#hands-on" title="Permalink to this headline"></a></h2>
<div class="admonition important">
<p class="first admonition-title">Important</p>
<p class="last">Before using the <em>Quantum Package</em>, it is required to source the file
<code class="file docutils literal notranslate"><span class="pre">quantum_package.rc</span></code> if it has not been done already in the
current shell.</p>
</div>
<div class="section" id="create-the-ezfio-database">
<h3>Create the EZFIO database<a class="headerlink" href="#create-the-ezfio-database" title="Permalink to this headline"></a></h3>
<p>The data relative to calculations are stored in an <a class="reference external" href="http://gitlab.com/scemama/EZFIO">EZFIO</a> database.
<a class="reference external" href="http://gitlab.com/scemama/EZFIO">EZFIO</a> is a hierarchical data format which uses the hierarchy of the
file system to organize the data, as files stored in a directory. The
data in the <a class="reference external" href="http://gitlab.com/scemama/EZFIO">EZFIO</a> directory are stored as plain text files, so it can
be opened with any text editor.
To access the data of the <a class="reference external" href="http://gitlab.com/scemama/EZFIO">EZFIO</a> database, the APIs (Fortran, <a class="reference external" href="http://www.python.org">Python</a>,
<a class="reference external" href="http://ocaml.org/">OCaml</a> or Bash) provided by <a class="reference external" href="http://gitlab.com/scemama/EZFIO">EZFIO</a> should be used, or tools using
these APIs such as <a class="reference internal" href="qp_edit.html#qp-edit"><span class="std std-ref">qp_edit</span></a> provided with the <em>Quantum Package</em>.</p>
<p>First, create an <cite>xyz</cite> file containing the coordinates of the molecule.
The file <code class="file docutils literal notranslate"><span class="pre">hcn.xyz</span></code> contains:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">3</span>
<span class="n">HCN</span> <span class="n">molecule</span>
<span class="n">C</span> <span class="mf">0.0</span> <span class="mf">0.0</span> <span class="mf">0.0</span>
<span class="n">H</span> <span class="mf">0.0</span> <span class="mf">0.0</span> <span class="mf">1.064</span>
<span class="n">N</span> <span class="mf">0.0</span> <span class="mf">0.0</span> <span class="o">-</span><span class="mf">1.156</span>
</pre></div>
</div>
<p>This xyz file is now used with the <a class="reference internal" href="qp_create_ezfio_from_xyz.html#qp-create-ezfio"><span class="std std-ref">qp_create_ezfio</span></a> command to
create an <a class="reference external" href="http://gitlab.com/scemama/EZFIO">EZFIO</a> database with the 6-31G basis set:</p>
<div class="code bash highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">qp_create_ezfio</span> <span class="o">-</span><span class="n">b</span> <span class="s2">&quot;6-31G&quot;</span> <span class="n">hcn</span><span class="o">.</span><span class="n">xyz</span> <span class="o">-</span><span class="n">o</span> <span class="n">hcn</span>
</pre></div>
</div>
<p>The EZFIO database now contains data relative to the nuclear coordinates
and the atomic basis set:</p>
<div class="code bash highlight-default notranslate"><div class="highlight"><pre><span></span>$ ls hcn
ao_basis/ electrons/ ezfio/ nuclei/ pseudo/
</pre></div>
</div>
</div>
<div class="section" id="run-a-hartree-fock-calculation">
<h3>Run a Hartree-Fock calculation<a class="headerlink" href="#run-a-hartree-fock-calculation" title="Permalink to this headline"></a></h3>
<p>The program <a class="reference internal" href="qp_run.html#qp-run"><span class="std std-ref">qp_run</span></a> is the driver program of the <em>Quantum Package</em>. To run a
<abbr title="Self Consistent Field">SCF</abbr> calculation, just run</p>
<div class="code bash highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">qp_run</span> <span class="n">scf</span> <span class="n">hcn</span>
</pre></div>
</div>
<p>The expected energy is <code class="docutils literal notranslate"><span class="pre">-92.827856698</span></code> au.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">The documentation of the <span class="xref std std-ref">hartree_fock</span> module and that of the <code class="xref c c-func docutils literal notranslate"><span class="pre">scf()</span></code> program.</p>
</div>
<p>This creates the <abbr title="Molecular Orbitals">MOs</abbr> in the <a class="reference external" href="http://gitlab.com/scemama/EZFIO">EZFIO</a> database that will be used to
perform any other post-SCF method. The <em>Quantum Package</em> does not handle symmetry and
the <abbr title="Molecular Orbitals">MOs</abbr> are stored by increasing order of Fock energies.</p>
</div>
<div class="section" id="choose-the-target-mo-space">
<h3>Choose the target <abbr title="Molecular Orbital">MO</abbr> space<a class="headerlink" href="#choose-the-target-mo-space" title="Permalink to this headline"></a></h3>
<p>Now, modify to <a class="reference external" href="http://gitlab.com/scemama/EZFIO">EZFIO</a> database to make <abbr title="Configuration Interaction using a Perturbative Selection">CIPSI</abbr> calculation in the
full set of valence <abbr title="Molecular Orbitals">MOs</abbr>, keeping the core <abbr title="Molecular Orbitals">MOs</abbr> frozen. The simple
command <a class="reference internal" href="qp_set_frozen_core.html#qp-set-frozen-core"><span class="std std-ref">qp_set_frozen_core</span></a> does this automatically:</p>
<div class="code bash highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">qp_set_frozen_core</span> <span class="n">hcn</span>
</pre></div>
</div>
<p>The general command to specify core and active orbitals is <a class="reference internal" href="qp_set_mo_class.html#qp-set-mo-class"><span class="std std-ref">qp_set_mo_class</span></a>.
In the case of HCN molecule in the 631G basis, one has 20 <abbr title="Molecular Orbitals">MOs</abbr> in total and the two first orbitals are frozen:</p>
<div class="code highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">qp_set_mo_class</span> <span class="o">-</span><span class="n">core</span> <span class="s2">&quot;[1-2]&quot;</span> <span class="o">-</span><span class="n">act</span> <span class="s2">&quot;[3-20]&quot;</span> <span class="n">hcn</span>
</pre></div>
</div>
</div>
<div class="section" id="run-the-cipsi-calculation">
<h3>Run the <abbr title="Configuration Interaction using a Perturbative Selection">CIPSI</abbr> calculation<a class="headerlink" href="#run-the-cipsi-calculation" title="Permalink to this headline"></a></h3>
<p>We will now use the <abbr title="Configuration Interaction using a Perturbative Selection">CIPSI</abbr> algorithm to estimate the <abbr title="Full Configuration Interaction">FCI</abbr> energy.</p>
<div class="code highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">qp_run</span> <span class="n">fci</span> <span class="n">hcn</span> <span class="o">|</span> <span class="n">tee</span> <span class="n">hcn</span><span class="o">.</span><span class="n">fci</span><span class="o">.</span><span class="n">out</span>
</pre></div>
</div>
<p>The program will start with a single determinant and will iteratively:</p>
<ul class="simple">
<li>Select the most important determinants from the external space and add them to the
internal space</li>
<li>Add all the necessary determinants to allow the eigenvector of <span class="math notranslate nohighlight">\(\hat H\)</span> to be
also an eigenstate of <span class="math notranslate nohighlight">\(\widehat{S^2}\)</span></li>
<li>Diagonalize <span class="math notranslate nohighlight">\(\hat H\)</span> in the enlarged internal space</li>
<li>Compute (stochastically) the second-order perturbative contribution to the energy</li>
<li>Extrapolate the variational energy by fitting
<span class="math notranslate nohighlight">\(E=E_\text{FCI} - \alpha\, E_\text{PT2}\)</span></li>
</ul>
<p>By default, the program will stop when more than one million determinants have
entered in the internal space, or when the <abbr title="Second order perturbative correction">PT2</abbr> energy is below <span class="math notranslate nohighlight">\(10^{-4}\)</span>.</p>
<p>To have a pictural illustration of the convergence of the <abbr title="Configuration Interaction using a Perturbative Selection">CIPSI</abbr> algorithm, just run</p>
<div class="code highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">qp_e_conv_fci</span> <span class="n">hcn</span><span class="o">.</span><span class="n">fci</span><span class="o">.</span><span class="n">out</span>
</pre></div>
</div>
<p>This will create the files “hcn.fci.out.conv” containing the data of the convergence of the energy that can be plotted, together with the file “hcn.fci.out.conv.1.eps” which is obtained from the gnuplot plot file “hcn.fci.out.conv.plt”.</p>
<p>The estimated <abbr title="Full Configuration Interaction">FCI</abbr> energy of HCN is <code class="docutils literal notranslate"><span class="pre">-93.0501</span></code> au.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last">The documentation of the <a class="reference internal" href="../programs/fci.html#fci"><span class="std std-ref">fci</span></a> module and that of the <code class="xref c c-func docutils literal notranslate"><span class="pre">fci()</span></code> program.</p>
</div>
<hr class="docutils" />
<p>TODO</p>
<div class="admonition important">
<p class="first admonition-title">Important</p>
<p>TODO</p>
<img alt="http://craniointernational.com/wp-content/uploads/2018/01/work-in-progress.jpg" src="http://craniointernational.com/wp-content/uploads/2018/01/work-in-progress.jpg" />
<ul class="last simple">
<li>Parameters for Hartree-Fock</li>
<li>Parameters for Davidson</li>
<li>Running in parallel</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="interfaces.html" class="btn btn-neutral float-right" title="Interfaces" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="../intro/selected_ci.html" class="btn btn-neutral" title="Selected Configuration Interaction" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018, A. Scemama, E. Giner
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>