ampsci
High-precision calculations for one- and two-valence atomic systems
InhomogenousGreens.hpp
1#pragma once
2#include <vector>
3class DiracSpinor;
4
5namespace DiracODE {
6
7//==============================================================================
8
9/*!
10 @brief Solves the inhomogeneous Dirac equation, returning the solution spinor.
11 @details
12 Solves \f$ (H_0 + v - \epsilon_a) F_a = S \f$ for \f$ \psi_\kappa \f$ using
13 Green's method (see Methods documentation). Note the sign convention for S.
14 @param kappa Angular momentum kappa of the solution.
15 @param en Orbital energy \f$ \epsilon \f$.
16 @param v Local potential v(r).
17 @param H_mag Off-diagonal (magnetic) potential.
18 @param alpha Fine-structure constant.
19 @param source Inhomogeneous source term S.
20 @param VxFa Optional exchange potential. If nullptr, ignored.
21 @param Fa0 Optional inhomogeneous source spinor. If nullptr, ignored.
22 @param zion Effective ionic charge (default 1).
23 @param mass Effective particle mass in atomic units (default 1 = m_e).
24 @return Solution spinor Fa.
25*/
26DiracSpinor solve_inhomog(const int kappa, const double en,
27 const std::vector<double> &v,
28 const std::vector<double> &H_mag, const double alpha,
29 const DiracSpinor &source,
30 const DiracSpinor *const VxFa = nullptr,
31 const DiracSpinor *const Fa0 = nullptr,
32 double zion = 1, double mass = 1.0);
33
34/*!
35 @brief Solves the inhomogeneous Dirac equation, overwriting Fa.
36 @details
37 As above; kappa is taken from Fa.
38*/
39void solve_inhomog(DiracSpinor &Fa, const double en,
40 const std::vector<double> &v,
41 const std::vector<double> &H_mag, const double alpha,
42 const DiracSpinor &source,
43 const DiracSpinor *const VxFa = nullptr,
44 const DiracSpinor *const Fa0 = nullptr, double zion = 1,
45 double mass = 1.0);
46
47/*!
48 @brief Solves the inhomogeneous Dirac equation, overwriting Fa and exposing the homogeneous solutions.
49 @details
50 As above, but also returns the homogeneous solutions Fzero (regular at origin)
51 and Finf (regular at infinity), which satisfy \f$ (H_0 + v - \epsilon)F = 0 \f$.
52 The first two overloads discard these; this one keeps them for potential reuse.
53 Fzero and Finf are out parameters -- they are overwritten internally and do not
54 need to be initialised before calling.
55*/
56void solve_inhomog(DiracSpinor &Fa, DiracSpinor &Fzero, DiracSpinor &Finf,
57 const double en, const std::vector<double> &v,
58 const std::vector<double> &H_mag, const double alpha,
59 const DiracSpinor &source,
60 const DiracSpinor *const VxFa = nullptr,
61 const DiracSpinor *const Fa0 = nullptr, double zion = 1,
62 double mass = 1.0);
63
64//==============================================================================
65
66namespace Internal {
67
68//! Constructs the particular solution Fa from homogeneous solutions Finf, Fzero and source Sr.
69void GreenSolution(DiracSpinor &Fa, const DiracSpinor &Finf,
70 const DiracSpinor &Fzero, const double alpha,
71 const DiracSpinor &Sr);
72
73} // namespace Internal
74} // namespace DiracODE
Stores radial Dirac spinor: F_nk = (f, g)
Definition DiracSpinor.hpp:42
Functions and classes used to solve the Dirac equation.
Definition AsymptoticSpinor.hpp:8
DiracSpinor solve_inhomog(const int kappa, const double en, const std::vector< double > &v, const std::vector< double > &H_mag, const double alpha, const DiracSpinor &source, const DiracSpinor *const VxFa, const DiracSpinor *const Fa0, double zion, double mass)
Solves the inhomogeneous Dirac equation, returning the solution spinor.
Definition InhomogenousGreens.cpp:21