High-precision calculations for one- and two-valence atomic systems
ConfigurationInteraction.hpp
1#pragma once
2#include "CI_Integrals.hpp"
3#include "CSF.hpp"
4#include "Coulomb/QkTable.hpp"
5#include "Coulomb/meTable.hpp"
6#include "IO/InputBlock.hpp"
7#include "Wavefunction/DiracSpinor.hpp"
8#include "Wavefunction/Wavefunction.hpp"
9#include <iostream>
10#include <string>
11#include <vector>
12
13/*!
14 @brief Functions and classes for Configuration Interaction calculations
15
16 @details
17 Main functions are:
18 - @ref configuration_interaction
19 - @ref run_CI
20
21 Main Classes are:
22 - @ref CSF2
23 - @ref PsiJPi
24*/
25namespace CI {
26
27/*!
28 @brief Runs Configuration Interation: returns CI solutions for all
29 requested J and parity values.
30
31 @details
32 Reads options from @p input, the CI Input Block, and constructs the CI basis
33 from @p wf, computes the required Coulomb (and optionally Breit and two-body
34 MBPT) integrals, then calls run_CI() for each requested (J, parity) pair.
35
36 The returned vector contains one @ref PsiJPi per {J, parity} combination, each
37 holding the eigenvalues and CI expansion coefficients for the requested number
38 of solutions.
39
40 }
41 @endcode
42 * Always check for up-to-date options from command line: `$ ampsci -i CI`
43 * See also @ref run_CI, which this function calls
44
45 @param input Input block containing CI options.
46 @param wf Fully initialised Wavefunction object supplying the orbital
47 basis and radial grid.
48 @return @ref Solutions: one PsiJPi per (J, parity) combination requested,
49 together with the integral tables used to build the CI Hamiltonians.
50
51 @note If run with `read_only`, no integrals are calculated, and the returned
52 integral tables are empty (see Integrals::availableQ()).
53*/
54Solutions configuration_interaction(const IO::InputBlock &input,
55 const Wavefunction &wf);
56
57/*!
58 @brief Constructs and solves the CI eigenvalue problem for a single J,pi
59 @details
60 Builds the CI+MBPT Hamiltonian matrix in the basis of two-electron
61 configuration state functions (CSFs) with total angular momentum
62 @p twoJ /2 and parity @p parity,
63 then solves the eigenvalue problem to obtain CI energies and
64 expansion coefficients.
65
66 The Hamiltonian includes:
67 - one-body terms from @p h1
68 - two-body Coulomb interaction via the \f$ Q^k \f$ integrals in @p qk
69 - optionally, two-body Breit corrections via \f$ B^k \f$ integrals in @p Bk
70 (used if @p Bk is non-empty)
71 - optionally, two-body MBPT \f$ \Sigma_2 \f$ corrections via \f$ S^k \f$
72 integrals in @p Sk (used if @p include_Sigma2 is true, and @p Sk is non-empty)
73
74 The number of solutions returned is controlled by @p num_solutions and
75 @p all_below: if @p all_below is set it takes precedence and all eigenstates
76 with total energy below the threshold are found.
77
78 @param ci_sp_basis Single-particle basis states spanning the CI space.
79 @param twoJ Twice the total angular momentum, 2J (must be a
80 non-negative even integer for two-electron systems).
81 @param parity Parity of the block: +1 (even) or -1 (odd).
82 @param num_solutions Number of lowest eigenstates to find. Ignored if
83 @p all_below_cm is set. Pass 0 to find all solutions.
84 @param all_below_cm If set, find all eigenstates with total energy below this
85 value (in cm^-1). Overrides @p num_solutions.
86 @param h1 Table of one-body Hamiltonian matrix elements between
87 single-particle basis states.
88 @param qk Table of two-body Coulomb \f$ Q^k \f$ integrals.
89 @param Bk Table of two-body Breit \f$ B^k \f$ integrals. Ignored
90 (treated as absent) if the table is empty.
91 @param Sk Table of two-body MBPT \f$ \Sigma_2 \f$ (\f$ S^k \f$)
92 integrals. Only used when @p include_Sigma2 is true.
93 @param include_Sigma2 If true, add two-body MBPT corrections from @p Sk to
94 the CI Hamiltonian.
95 @param print_details If true, print a breakdown of the leading configurations
96 for each solution. Leads to very large output if
97 @p num_solutions is large
98 @param read_only If true, only the solutions already in the file are read;
99 the eigenvalue problem is not solved, and nothing is
100 written [default: false].
101 @param outstream Output stream for progress and results [default: stdout].
102 @param ci_fname Filename for reading/writing CI solutions ("" disables).
103 @param s1c Pointer to derivative (dSigma/dE) correction for
104 Sigma_1; ignored if nullptr. See @ref Sigma1Correction.
105 Its reference energy E0 is the lowest energy of this
106 (J, parity), so is found self-consistently: see
107 @ref iterate_E0.
108 @param hk Average S^k/Q^k ratios, for extrapolating Sigma_2 beyond
109 the cis2 basis; empty for no extrapolation.
110 See @ref MBPT::average_hk.
111 @param dSk Pointer to the dS^k/dE0 table (Brillouin-Wigner Sigma_2);
112 ignored if nullptr. See @ref CI::corrected_Sk.
113 @param E0_sigma2 Reference E0 that Sk and dSk were tabulated at.
114
115 @return PsiJPi (@ref PsiJPi) containing the CI eigenvalues and expansion
116 coefficients for the requested solutions.
117*/
118PsiJPi run_CI(const std::vector<DiracSpinor> &ci_sp_basis, int twoJ, int parity,
119 int num_solutions, std::optional<double> all_below_cm,
120 const Coulomb::meTable<double> &h1, const Coulomb::QkTable &qk,
121 const Coulomb::WkTable &Bk, const Coulomb::LkTable &Sk,
122 bool include_Sigma2, bool print_details, bool read_only = false,
123 std::ostream &outstream = std::cout,
124 const std::string &ci_fname = "",
125 const Sigma1Correction *s1c = nullptr,
126 const std::vector<double> &hk = {},
127 const Coulomb::LkTable *dSk = nullptr, double E0_sigma2 = 0.0);
128
129} // namespace CI
Base class template to store Coulomb integrals, and similar. 3 specific cases (by template instantiat...
Definition QkTable.hpp:118
Look-up table for matrix elements. Note: does not assume any symmetry: (a,b) is stored independantly ...
Definition meTable.hpp:17
Holds a named list of key=value options and nested InputBlocks.
Definition InputBlock.hpp:154
Stores Wavefunction (set of valence orbitals, grid, HF etc.)
Definition Wavefunction.hpp:38
Functions and classes for Configuration Interaction calculations.
Definition CI_Integrals.cpp:22
PsiJPi run_CI(const std::vector< DiracSpinor > &ci_sp_basis, int twoJ, int parity, int num_solutions, std::optional< double > all_below_cm, const Coulomb::meTable< double > &h1, const Coulomb::QkTable &qk, const Coulomb::WkTable &Bk, const Coulomb::LkTable &Sk, bool include_Sigma2, bool print_details, bool read_only, std::ostream &outstream, const std::string &ci_fname, const Sigma1Correction *s1c, const std::vector< double > &hk, const Coulomb::LkTable *dSk, double E0_sigma2)
Constructs and solves the CI eigenvalue problem for a single J,pi.
Definition ConfigurationInteraction.cpp:845
Solutions configuration_interaction(const IO::InputBlock &input, const Wavefunction &wf)
Runs Configuration Interation: returns CI solutions for all requested J and parity values.
Definition ConfigurationInteraction.cpp:26