ampsci
High-precision calculations for one- and two-valence atomic systems
TDHF.hpp
1#pragma once
2#include "CorePolarisation.hpp"
3#include <string>
4#include <vector>
5class DiracSpinor;
6namespace DiracOperator {
7class TensorOperator;
8}
9namespace MBPT {
10class CorrelationPotential;
11}
12
13namespace HF {
14class HartreeFock;
15class Breit;
16} // namespace HF
17
18namespace ExternalField {
19
20/*!
21 @brief Uses TDHF to include core-polarisation (RPA) corrections to matrix
22 elements of an external field operator.
23
24 @details
25 Solves the TDHF equations for each core orbital \f$ \phi_a \f$,
26 \f[
27 (h_{\rm HF} - \en_a \mp \omega)\varphi^a_\pm
28 = -(t_\pm + \delta V_\pm - \delta\en^a_\pm)\phi_a,
29 \f]
30 self-consistently to determine \f$ \delta V_\pm \f$.
31 See the @ref ExternalField namespace documentation for full physics description.
32
33 Each core orbital acquires both a forward (\f$ \varphi^a_+ \f$, stored as X)
34 and backward (\f$ \varphi^a_- \f$, stored as Y) correction. Both contribute
35 to \f$ \delta V_\pm \f$:
36 \f[
37 \delta V_\pm \phi_i =
38 \sum_a^{\rm core} \left[
39 \matel{\phi_a}{Q}{\varphi^a_+}\phi_i - \matel{\phi_a}{Q}{\phi_i}\varphi^a_+
40 + \matel{\varphi^a_-}{Q}{\phi_a}\phi_i - \matel{\varphi^a_-}{Q}{\phi_i}\phi_a
41 \right].
42 \f]
43 It is via \f$ \delta V_\pm \f$ that the \f$ e^{\pm i\omega t} \f$ terms are mixed.
44
45 \par Construction
46 Requires a pointer to an operator (h) and a const @ref HF::HartreeFock object.
47
48 \par Usage
49 @ref solve_core (omega) solves the TDHF equations for a given frequency.
50 @ref dV (Fa, Fb) then returns the RPA correction to the reduced matrix element
51 \f$ \redmatel{a}{\delta V}{b} \f$.
52
53 @warning Does not currently work for frequency-dependent operators
54 unless they depend only on the magnitude \f$ |\omega| \f$.
55 The method assumes \f$ t_- = t_+^\dag \f$, whereas the correct relation is
56 \f$ t_-(\omega) = t_+^\dag(-\omega) \f$.
57 This will be fixed in a future update.
58*/
59class TDHF : public CorePolarisation {
60
61protected:
62 // dPhi = X exp(-iwt) + Y exp(+iwt)
63 // (H - e - w)X = -(h + dV - de)Phi
64 // (H - e + w)Y = -(h* + dV* - de)Phi
65 // X_c = sum_x X_x,
66 // j(x)=j(c)-k,...,j(c)+k. And: pi(x) = pi(c)*pi(h)
67 std::vector<std::vector<DiracSpinor>> m_X{};
68 std::vector<std::vector<DiracSpinor>> m_Y{};
69 std::vector<std::vector<DiracSpinor>> m_hFcore{};
70 // can just write these to disk! Read them in, continue as per normal
71
72 const HF::HartreeFock *const p_hf;
73 const std::vector<DiracSpinor> m_core;
74 // const std::vector<double> m_Hmag;
75 const double m_alpha;
76 const HF::Breit *const p_VBr;
77
78public:
79 /*!
80 @brief Constructs TDHF for operator h.
81
82 @param h External field operator.
83 @param hf @ref HF::HartreeFock object defining the core.
84 */
86 const HF::HartreeFock *const hf);
87
88 /*!
89 @brief Solves TDHF equations self-consistently for core electrons at frequency omega.
90 @details
91 Iterates the TDHF equations until \f$ \delta V_\pm \f$ converges to within
92 eps_target(), or @p max_its iterations have been performed.
93 Can be re-run at a different frequency without restarting from scratch.
94
95 @param omega External-field frequency \f$ \omega \f$ in atomic units.
96 @param max_its Maximum number of iterations.
97 Set to 1 to get the first-order correction (no damping on
98 first iteration).
99 @param print If true, write convergence progress to screen.
100
101 @note Frequency should be positive; negative is allowed but use with care.
102 Unlike @ref DiagramRPA, TDHF solves for both \f$ \varphi^a_+ \f$ and
103 \f$ \varphi^a_- \f$ simultaneously (see class docs), so a single call
104 covers both contributions to \f$ \delta V_\pm \f$.
105
106 ---
107
108 @note Does not update the frequency of the operator itself; for frequency-dependent
109 operators, update the operator frequency externally before calling.
110 */
111 virtual void solve_core(double omega, int max_its = 100,
112 bool print = true) override;
113
114 virtual Method method() const override { return Method::TDHF; }
115
116 virtual void clear() override final;
117
118 //! Returns reduced matrix element \f$\redmatel{a}{\delta V}{b}\f$,
119 //! or the conjugate \f$\redmatel{a}{\delta V^\dagger}{b}\f$ if conj=true.
120 double dV(const DiracSpinor &Fa, const DiracSpinor &Fb, bool conj) const;
121
122 virtual double dV(const DiracSpinor &Fa,
123 const DiracSpinor &Fb) const override final;
124
125 DiracSpinor dV_rhs(int kappa_n, const DiracSpinor &Fm,
126 bool conj = false) const override;
127
128 //! Returns const ref to dPsi orbitals for given core orbital Fc.
129 const std::vector<DiracSpinor> &get_dPsis(const DiracSpinor &Fc,
130 dPsiType XorY) const;
131 //! Returns const ref to dPsi orbital of given kappa.
132 const DiracSpinor &get_dPsi_x(const DiracSpinor &Fc, dPsiType XorY,
133 const int kappa_x) const;
134
135 /*!
136 @brief Forms \f$\varphi^v_\pm\f$ for valence state Fv (including core pol.):
137 single kappa channel.
138 @details
139 Solves
140 \f[ (h_{\rm HF} + \Sigma - \en_v - \omega)\varphi^v_+
141 = -(t + \delta V - \delta\en^v)\phi_v \f]
142 or
143 \f[ (h_{\rm HF} + \Sigma - \en_v + \omega)\varphi^v_-
144 = -(t^\dagger + \delta V^\dagger - \delta\en^v)\phi_v \f]
145 Returns \f$ \chi_\beta \f$ for given kappa_beta, where
146 \f[ X_{j,m} = (-1)^{j_\beta-m}tjs(j,k,j;-m,0,m)\chi_j \f]
147
148 @param Fv Valence state \f$\phi_v\f$.
149 @param omega Perturbation frequency \f$\omega\f$.
150 @param XorY Selects X or Y solution; see @ref dPsiType.
151 @param kappa_beta Kappa quantum number of the target channel.
152 @param Sigma Optional correlation potential; see @ref MBPT::CorrelationPotential.
153 @param st Bra or ket convention; see @ref StateType.
154 @param incl_dV Include the induced potential \f$\delta V\f$ if true.
155 */
157 solve_dPsi(const DiracSpinor &Fv, const double omega, dPsiType XorY,
158 const int kappa_beta,
159 const MBPT::CorrelationPotential *const Sigma = nullptr,
160 StateType st = StateType::ket, bool incl_dV = true) const;
161
162 //! Forms \f$\varphi^v_\pm\f$ for all kappa channels; see @ref solve_dPsi.
163 std::vector<DiracSpinor>
164 solve_dPsis(const DiracSpinor &Fv, const double omega, dPsiType XorY,
165 const MBPT::CorrelationPotential *const Sigma = nullptr,
166 StateType st = StateType::ket, bool incl_dV = true) const;
167
168 // //! Writes dPsi (f-component) to textfile
169 // void print(const std::string &ofname = "dPsi.txt") const;
170
171private:
172 void initialise_dPsi();
173
174 // Single iteration of TDHF equations
175 std::pair<double, std::string> tdhf_core_it(double omega, double eta_damp);
176 // Forms set of h*Fc for all core orbitals and all projections
177 std::vector<std::vector<DiracSpinor>> form_hFcore() const;
178 // Solves the MS equations for all projections, single core state
179 void solve_ms_core(std::vector<DiracSpinor> &dFb, const DiracSpinor &Fb,
180 const std::vector<DiracSpinor> &hFbs, const double omega,
181 dPsiType XorY, double eps_ms = 1.0e-9) const;
182
183public:
184 TDHF &operator=(const TDHF &) = delete;
185 TDHF(const TDHF &) = default;
186 ~TDHF() = default;
187};
188
189} // namespace ExternalField
General tensor operator (virtual base class); all single-particle (one-body) tenosor operators derive...
Definition TensorOperator.hpp:198
Stores radial Dirac spinor: F_nk = (f, g)
Definition DiracSpinor.hpp:42
Virtual base class for core-polarisation (RPA); computes dV corrections.
Definition CorePolarisation.hpp:140
Uses TDHF to include core-polarisation (RPA) corrections to matrix elements of an external field oper...
Definition TDHF.hpp:59
virtual void clear() override final
Clears the internal state back to pre solve_core()
Definition TDHF.cpp:70
const DiracSpinor & get_dPsi_x(const DiracSpinor &Fc, dPsiType XorY, const int kappa_x) const
Returns const ref to dPsi orbital of given kappa.
Definition TDHF.cpp:87
double dV(const DiracSpinor &Fa, const DiracSpinor &Fb, bool conj) const
Returns reduced matrix element , or the conjugate if conj=true.
Definition TDHF.cpp:337
std::vector< DiracSpinor > solve_dPsis(const DiracSpinor &Fv, const double omega, dPsiType XorY, const MBPT::CorrelationPotential *const Sigma=nullptr, StateType st=StateType::ket, bool incl_dV=true) const
Forms for all kappa channels; see solve_dPsi.
Definition TDHF.cpp:96
const std::vector< DiracSpinor > & get_dPsis(const DiracSpinor &Fc, dPsiType XorY) const
Returns const ref to dPsi orbitals for given core orbital Fc.
Definition TDHF.cpp:77
virtual void solve_core(double omega, int max_its=100, bool print=true) override
Solves TDHF equations self-consistently for core electrons at frequency omega.
Definition TDHF.cpp:274
virtual Method method() const override
Returns RPA method.
Definition TDHF.hpp:114
DiracSpinor dV_rhs(int kappa_n, const DiracSpinor &Fm, bool conj=false) const override
Returns [dV_pm * phi_m]_kappa: RHS of TDHF eq., projected onto kappa (see namespace doc)
Definition TDHF.cpp:349
DiracSpinor solve_dPsi(const DiracSpinor &Fv, const double omega, dPsiType XorY, const int kappa_beta, const MBPT::CorrelationPotential *const Sigma=nullptr, StateType st=StateType::ket, bool incl_dV=true) const
Forms for valence state Fv (including core pol.): single kappa channel.
Definition TDHF.cpp:109
Breit potentials for one- (Hartree-Fock Breit) and two-body Breit integrals.
Definition Breit.hpp:87
Solves relativistic Hartree-Fock equations for core and valence. Optionally includes Breit and QED ef...
Definition HartreeFock.hpp:72
Dirac operators: TensorOperator base class and derived implementations for single-particle (one-body)...
Definition GenerateOperator.cpp:6
Core-polarisation (RPA) corrections to matrix elements of an external field.
Definition calcMatrixElements.cpp:14
StateType
Whether the state is a bra or ket.
Definition CorePolarisation.hpp:112
dPsiType
Selects the perturbed orbital: X = varphi_+, Y = varphi_-.
Definition CorePolarisation.hpp:110
Method
Available RPA/core-polarisation methods.
Definition CorePolarisation.hpp:82
Functions and classes for Hartree-Fock.
Definition CI_Integrals.hpp:13
Many-body perturbation theory.
Definition CI_Integrals.hpp:10
void Breit(const IO::InputBlock &input, const Wavefunction &wf)
Breit corrections to HF energies and matrix elements.
Definition Breit.cpp:38