High-precision calculations for one- and two-valence atomic systems
ContinuumOrbitals.hpp
1#pragma once
2#include "Wavefunction/DiracSpinor.hpp"
3#include <memory>
4#include <vector>
5class Wavefunction;
6class Grid;
7namespace HF {
8class HartreeFock;
9}
10
11/*!
12 @brief Stores set of continuum orbitals, and solves using Hartree-Fock method.
13
14 @details
15 Solves in the Hartree-Fock potential (solveContinuumHF), or in a H-like
16 potential with effective charge (solveContinuumZeff, or analytically with
17 solveContinuumZeffAnalytic). Orbitals are energy-normalised (see
18 DiracODE::solveContinuum). Each solve appends to orbitals (see clear).
19*/
21
22public:
23 /*!
24 @brief Takes existing Wavefunction object to construct.
25
26 @details
27 Stores the grid, alpha, and a pointer to its HF object (may be nullptr if
28 HF not set; only the Zeff methods may then be used).
29
30 @warning The HF pointer is stored: @p wf must outlive this object.
31 */
33 /*!
34 @brief Construct with Hartree-Fock pointer.
35
36 @details
37 Pointer is stored: must outlive this object. Must not be nullptr.
38 */
40
41 ContinuumOrbitals &operator=(const ContinuumOrbitals &) = default;
42 ContinuumOrbitals(const ContinuumOrbitals &) = default;
43 ~ContinuumOrbitals() = default;
44
45 /*!
46 @brief Solves continuum states with energy ec between min/max l.
47
48 @details
49 Solves for each kappa with min_l <= l <= max_l, in the HF local potential
50 (vnuc + vdir + vrad). For non-local methods (HartreeFock, ApproxHF),
51 exchange with the full core is then included iteratively (damped; at most
52 50 iterations, until |dF|^2/|F|^2 < 1e-6; no warning if not converged).
53
54 @param ec Continuum energy (au, > 0)
55 @param min_l Minimum l
56 @param max_l Maximum l
57 @param psi Ionised (bound) state; optional (nullptr: none)
58 @param force_rescale Rescale large-r part of the local potential, so it
59 falls off no slower than -Zion/r:
60 V(r) -> min(V(r), -Zion/r), with
61 Zion = max(1, -r V(r)) at the last grid point
62 @param subtract_self Subtract the self-interaction of @p psi from the
63 direct potential, \f$ y^0_{\psi\psi}(r) \f$
64 (V^{N-1} potential of the ion)
65 @param force_orthog Orthogonalise to the core states of the same kappa,
66 and to @p psi (to @p psi also at each exchange
67 iteration)
68 @param average_tail Fill the (zeroed) unresolved high-r tail with a
69 local average (see DiracODE::averageTail); done
70 after exchange, before orthogonalisation
71
72 @return 0 on success; 1 if there is no Hartree-Fock object (constructed
73 from a Wavefunction with no HF): prints a warning, and no
74 orbitals are solved.
75
76 @note @p force_rescale and @p subtract_self only apply for the
77 HartreeFock, Hartree, and ApproxHF methods.
78 */
79 int solveContinuumHF(double ec, int min_l, int max_l,
80 const DiracSpinor *psi = nullptr,
81 bool force_rescale = false, bool subtract_self = true,
82 bool force_orthog = true, bool average_tail = false);
83
84 /*!
85 @brief Solves cntm states using simple H-like potential with Z_eff.
86
87 @details
88 Potential is \f$ -Z_{\rm eff}/r \f$ (point-like). Usually,
89 \f$ Z_{\rm eff} = n\sqrt{2 I_{njl}} \f$, with \f$ I_{njl} \f$ the
90 ionisation energy (au) and n the principal quantum number of the initial
91 state.
92
93 @param ec Continuum energy (au, > 0)
94 @param min_l Minimum l
95 @param max_l Maximum l
96 @param Z_eff Effective charge
97 @param Fi Ionised (bound) state; may be nullptr
98 @param force_orthog Orthogonalise to @p Fi (only; not the core)
99 @param average_tail Fill the (zeroed) unresolved high-r tail with a
100 local average (see DiracODE::averageTail)
101
102 @return 0 (always).
103 */
104 int solveContinuumZeff(double ec, int min_l, int max_l, double Z_eff,
105 const DiracSpinor *Fi, bool force_orthog,
106 bool average_tail = false);
107
108 /*!
109 @brief As solveContinuumZeff, but uses exact analytic Dirac-Coulomb states.
110
111 @details
112 Uses exact analytic Dirac-Coulomb functions rather than solving the ODE
113 numerically (see DiracSpinor::exactHlike_cntm). Evaluated pointwise over
114 the entire grid, so there is no tail cut-off (cf. solveContinuumZeff).
115
116 @return 0 (always).
117
118 @warning Relativistic case requires FLINT (see DiracContinuum::available):
119 otherwise prints a warning, and the orbitals are NaN (or an
120 assert fails, in debug builds).
121 */
122 int solveContinuumZeffAnalytic(double ec, int min_l, int max_l, double Z_eff,
123 const DiracSpinor *Fi, bool force_orthog);
124
125 /*!
126 @brief Checks orthogonality between cntm and core orbitals.
127
128 @details
129 Overlaps with core states of the same kappa; prints each if @p print.
130
131 @return Worst eps: the largest-magnitude overlap (signed); 0 if no HF.
132 */
133 double check_orthog(bool print = true) const;
134
135 //! Resets (deletes) all orbitals
136 void clear();
137
138 //! The continuum orbitals (each solve appends to this list)
139 std::vector<DiracSpinor> orbitals{};
140
141private:
142 void IncludeExchange(DiracSpinor &F_cntm, const DiracSpinor *F_i,
143 bool force_orthog, const std::vector<double> &vc);
144
145 std::shared_ptr<const Grid> p_rgrid;
146 const HF::HartreeFock *p_hf;
147 double m_alpha;
148};
Stores set of continuum orbitals, and solves using Hartree-Fock method.
Definition ContinuumOrbitals.hpp:20
void clear()
Resets (deletes) all orbitals.
Definition ContinuumOrbitals.cpp:264
int solveContinuumHF(double ec, int min_l, int max_l, const DiracSpinor *psi=nullptr, bool force_rescale=false, bool subtract_self=true, bool force_orthog=true, bool average_tail=false)
Solves continuum states with energy ec between min/max l.
Definition ContinuumOrbitals.cpp:44
std::vector< DiracSpinor > orbitals
The continuum orbitals (each solve appends to this list)
Definition ContinuumOrbitals.hpp:139
double check_orthog(bool print=true) const
Checks orthogonality between cntm and core orbitals.
Definition ContinuumOrbitals.cpp:22
int solveContinuumZeff(double ec, int min_l, int max_l, double Z_eff, const DiracSpinor *Fi, bool force_orthog, bool average_tail=false)
Solves cntm states using simple H-like potential with Z_eff.
Definition ContinuumOrbitals.cpp:185
int solveContinuumZeffAnalytic(double ec, int min_l, int max_l, double Z_eff, const DiracSpinor *Fi, bool force_orthog)
As solveContinuumZeff, but uses exact analytic Dirac-Coulomb states.
Definition ContinuumOrbitals.cpp:229
Stores radial Dirac spinor: F_nk = (f, g)
Definition DiracSpinor.hpp:55
Non-uniform radial grid with Jacobian, suitable for atomic structure calculations.
Definition Grid.hpp:85
Solves relativistic Hartree-Fock equations for core and valence. Optionally includes Breit and QED ef...
Definition HartreeFock.hpp:114
Stores Wavefunction (set of valence orbitals, grid, HF etc.)
Definition Wavefunction.hpp:48
Functions and classes for Hartree-Fock.
Definition CI_Integrals.hpp:16