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//! @brief Solves inhomogeneous Dirac equation
10/*! @details
11\f[ (H_0 + v -\epsilon_a)F_a = S \f]
12with `source' term, S. Solves for \f$\psi_\kappa\f$ with angular momentum kappa.
13en = \f$\epsilon\f$ is given. Note sign of S.
14Uses Green's method (see Method documentation).
15*/
16DiracSpinor solve_inhomog(const int kappa, const double en,
17 const std::vector<double> &v,
18 const std::vector<double> &H_mag, const double alpha,
19 const DiracSpinor &source,
20 const DiracSpinor *const VxFa = nullptr,
21 const DiracSpinor *const Fa0 = nullptr,
22 double zion = 1, double mass = 1.0);
23
24//! @brief Solves inhomogeneous Dirac equation
25/*! @details
26As above. Overload to accept/overwrite solution to Fa. kappa is taken from Fa.
27*/
28void solve_inhomog(DiracSpinor &Fa, const double en,
29 const std::vector<double> &v,
30 const std::vector<double> &H_mag, const double alpha,
31 const DiracSpinor &source,
32 const DiracSpinor *const VxFa = nullptr,
33 const DiracSpinor *const Fa0 = nullptr, double zion = 1,
34 double mass = 1.0);
35
36//! @brief Solves inhomogeneous Dirac equation
37/*! @details
38As above. Overload to accept/overwrite solution to Fa.
39All these routines solve also for Fzero, Finf, which are solutions to
40homogeneous equation (H-en)Fa = 0 [reg @ origin, and infinity, respectively].
41 - The first two throw these solutions away, the third keeps them (in some
42cases they can be re-used)
43 - These Spinors are solved internally and over-written, they don't need to be
44solved first (i.e., they are out parameters, not in/out parameters)
45*/
46void solve_inhomog(DiracSpinor &Fa, DiracSpinor &Fzero, DiracSpinor &Finf,
47 const double en, const std::vector<double> &v,
48 const std::vector<double> &H_mag, const double alpha,
49 const DiracSpinor &source,
50 const DiracSpinor *const VxFa = nullptr,
51 const DiracSpinor *const Fa0 = nullptr, double zion = 1,
52 double mass = 1.0);
53
54//==============================================================================
55
56namespace Internal {
57
58// Takes solution regular at infinity (Finf), and that regular at zero (Fzero),
59// and the inhomogenous source term, Sr, to find particular solution, Fa.
60void GreenSolution(DiracSpinor &Fa, const DiracSpinor &Finf,
61 const DiracSpinor &Fzero, const double alpha,
62 const DiracSpinor &Sr);
63
64} // namespace Internal
65} // namespace DiracODE
Stores radial Dirac spinor: F_nk = (f, g)
Definition DiracSpinor.hpp:41
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 inhomogeneous Dirac equation.
Definition InhomogenousGreens.cpp:21