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 set of TDHF equations
26 \f[
27 (H - \epsilon \pm \omega)\delta\psi_b = -(\delta V + \delta\epsilon_c)\psi_b
28 \f]
29 self-consistently for each electron in the core to determine \f$\delta V\f$.
30 See 'ampsci.pdf' for a detailed physics description.
31
32 \par Construction
33 Requires a pointer to an operator (h) and a const @ref HF::HartreeFock object.
34
35 \par Usage
36 @ref solve_core (omega) solves the TDHF equations for a given frequency.
37 Frequency should be positive (negative is allowed for testing only, with
38 care). Can be re-run with a different frequency without restarting from
39 scratch. @ref dV (Fa, Fb) then returns the correction to the matrix element:
40 \f[ \langle \phi_a || \delta V || \phi_b \rangle \f]
41*/
42class TDHF : public CorePolarisation {
43
44protected:
45 // dPhi = X exp(-iwt) + Y exp(+iwt)
46 // (H - e - w)X = -(h + dV - de)Phi
47 // (H - e + w)Y = -(h* + dV* - de)Phi
48 // X_c = sum_x X_x,
49 // j(x)=j(c)-k,...,j(c)+k. And: pi(x) = pi(c)*pi(h)
50 std::vector<std::vector<DiracSpinor>> m_X{};
51 std::vector<std::vector<DiracSpinor>> m_Y{};
52 std::vector<std::vector<DiracSpinor>> m_hFcore{};
53 // can just write these to disk! Read them in, continue as per normal
54
55 const HF::HartreeFock *const p_hf;
56 const std::vector<DiracSpinor> m_core;
57 // const std::vector<double> m_Hmag;
58 const double m_alpha;
59 const HF::Breit *const p_VBr;
60
61public:
62 /*!
63 @brief Constructs TDHF for operator h.
64
65 @param h External field operator.
66 @param hf @ref HF::HartreeFock object defining the core.
67 */
69 const HF::HartreeFock *const hf);
70
71 /*!
72 @brief Solves TDHF equations self-consistently for core electrons at
73 frequency omega.
74
75 @details Will iterate up to a maximum of max_its. Set max_its=1 to get
76 first-order correction [note: no damping is used for first iteration].
77 If print=true, will write progress to screen.
78 */
79 virtual void solve_core(double omega, int max_its = 100,
80 bool print = true) override;
81
82 virtual Method method() const override { return Method::TDHF; }
83
84 virtual void clear() override final;
85
86 //! Returns reduced matrix element \f$\langle a||\delta V||b\rangle\f$,
87 //! or the conjugate \f$\langle a||\delta V^\dagger||b\rangle\f$ if conj=true.
88 double dV(const DiracSpinor &Fa, const DiracSpinor &Fb, bool conj) const;
89
90 virtual double dV(const DiracSpinor &Fa,
91 const DiracSpinor &Fb) const override final;
92
93 DiracSpinor dV_rhs(int kappa_n, const DiracSpinor &Fm,
94 bool conj = false) const override;
95
96 //! Returns const ref to dPsi orbitals for given core orbital Fc.
97 const std::vector<DiracSpinor> &get_dPsis(const DiracSpinor &Fc,
98 dPsiType XorY) const;
99 //! Returns const ref to dPsi orbital of given kappa.
100 const DiracSpinor &get_dPsi_x(const DiracSpinor &Fc, dPsiType XorY,
101 const int kappa_x) const;
102
103 /*! @brief
104 Forms \f$\delta\psi_v\f$ for valence state Fv (including core pol.):
105 single kappa.
106
107 @details
108 Solves
109 \f[ (H + \Sigma - \epsilon - \omega)X
110 = -(h + \delta V - \delta\epsilon)\psi \f]
111 or
112 \f[ (H + \Sigma - \epsilon + \omega)Y
113 = -(h^\dagger + \delta V^\dagger - \delta\epsilon)\psi \f]
114 Returns \f$ \chi_\beta \f$ for given kappa_beta, where
115 \f[ X_{j,m} = (-1)^{j_\beta-m}tjs(j,k,j;-m,0,m)\chi_j \f]
116
117 @param Fv Valence state \f$\psi_v\f$.
118 @param omega Perturbation frequency \f$\omega\f$.
119 @param XorY Selects X or Y solution; see @ref dPsiType.
120 @param kappa_beta Kappa quantum number of the target channel.
121 @param Sigma Optional correlation potential; see @ref MBPT::CorrelationPotential.
122 @param st Bra or ket convention; see @ref StateType.
123 @param incl_dV Include the induced potential \f$\delta V\f$ if true.
124 */
126 solve_dPsi(const DiracSpinor &Fv, const double omega, dPsiType XorY,
127 const int kappa_beta,
128 const MBPT::CorrelationPotential *const Sigma = nullptr,
129 StateType st = StateType::ket, bool incl_dV = true) const;
130
131 //! Forms \f$\delta\psi_v\f$ for all kappa channels; see @ref solve_dPsi.
132 std::vector<DiracSpinor>
133 solve_dPsis(const DiracSpinor &Fv, const double omega, dPsiType XorY,
134 const MBPT::CorrelationPotential *const Sigma = nullptr,
135 StateType st = StateType::ket, bool incl_dV = true) const;
136
137 // //! Writes dPsi (f-component) to textfile
138 // void print(const std::string &ofname = "dPsi.txt") const;
139
140private:
141 void initialise_dPsi();
142
143 // Single iteration of TDHF equations
144 std::pair<double, std::string> tdhf_core_it(double omega, double eta_damp);
145 // Forms set of h*Fc for all core orbitals and all projections
146 std::vector<std::vector<DiracSpinor>> form_hFcore() const;
147 // Solves the MS equations for all projections, single core state
148 void solve_ms_core(std::vector<DiracSpinor> &dFb, const DiracSpinor &Fb,
149 const std::vector<DiracSpinor> &hFbs, const double omega,
150 dPsiType XorY, double eps_ms = 1.0e-9) const;
151
152public:
153 TDHF &operator=(const TDHF &) = delete;
154 TDHF(const TDHF &) = default;
155 ~TDHF() = default;
156};
157
158} // namespace ExternalField
General tensor operator (virtual base class); all single-particle (one-body) tenosor operators derive...
Definition TensorOperator.hpp:197
Stores radial Dirac spinor: F_nk = (f, g)
Definition DiracSpinor.hpp:42
Virtual Core Polarisation class, for <a||dV||b>. See TDHF, DiagramRPA, etc.
Definition CorePolarisation.hpp:38
Uses TDHF to include core-polarisation (RPA) corrections to matrix elements of an external field oper...
Definition TDHF.hpp:42
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:82
DiracSpinor dV_rhs(int kappa_n, const DiracSpinor &Fm, bool conj=false) const override
Calculates reduced right-hand-side, projected onto kappa: [dV|phi_m]_kappa.
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.
Definition TDHF.cpp:109
Breit (Hartree-Fock Breit) interaction potential.
Definition Breit.hpp:52
Solves relativistic Hartree-Fock equations for core and valence. Optionally includes Breit and QED ef...
Definition HartreeFock.hpp:71
Dirac operators: TensorOperator base class and derived implementations for single-particle (one-body)...
Definition GenerateOperator.cpp:3
Calculates many-body corrections (RPA) to matrix elements of external field.
Definition calcMatrixElements.cpp:14
Functions and classes for Hartree-Fock.
Definition CI_Integrals.hpp:13
Many-body perturbation theory.
Definition CI_Integrals.hpp:10