2#include "AdamsMoulton.hpp"
3#include "Physics/PhysConst_constants.hpp"
4#include "Wavefunction/DiracSpinor.hpp"
25 const std::vector<double> &H_off_diag = {},
28 const DiracSpinor *
const Fa0 =
nullptr,
double zion = 1,
33 int n,
int kappa,
const double en0,
const std::shared_ptr<const Grid> &gr,
34 const std::vector<double> &v,
const std::vector<double> &H_off_diag = {},
37 const DiracSpinor *
const Fa0 =
nullptr,
double zion = 1,
double mass = 1.0) {
39 boundState(Fnk, en0, v, H_off_diag, alpha, eps, VxFa, Fa0, zion, mass);
45 const std::vector<double> &v,
46 const std::vector<double> &H_off_diag,
const double alpha,
48 const DiracSpinor *
const Fa0 =
nullptr,
double zion = 1,
53 const std::vector<double> &v,
54 const std::vector<double> &H_off_diag,
57 const DiracSpinor *
const Fa0 =
nullptr,
double zion = 1,
69constexpr double cALR = 550.0;
84constexpr auto weight = [](std::size_t i) {
85 return 1.0 /
static_cast<double>(i * i + 1);
90 "\nFAIL in DiracODE: parameter K_Adams must be between 5 and 8\n");
144 const int in_k,
const double in_en,
const double in_alpha,
145 const std::vector<double> &V_off_diag = {},
147 const DiracSpinor *
const iFa0 =
nullptr,
double zion = 1,
148 double in_mass = 1.0);
150 const Grid *
const pgr;
151 const std::vector<double> *
const v;
152 const std::vector<double> *
const Hmag;
155 const double zion = 1.0;
157 const double en, alpha, cc;
161 double a(std::size_t i)
const final;
162 double b(std::size_t i)
const final;
163 double c(std::size_t i)
const final;
164 double d(std::size_t i)
const final;
166 double Sf(std::size_t i)
const final;
167 double Sg(std::size_t i)
const final;
176 int count_toomany = 0;
177 int count_toofew = 0;
178 double high_en = 0.0;
184std::size_t findPracticalInfinity(
const double en,
const std::vector<double> &v,
185 const std::vector<double> &r,
189std::size_t findClassicalTurningPoint(
const double en,
190 const std::vector<double> &v,
191 std::size_t pinf, std::size_t d_ctp);
202void trialDiracSolution(std::vector<double> &f, std::vector<double> &g,
203 std::vector<double> &dg,
const double en,
const int ka,
204 const std::vector<double> &v,
205 const std::vector<double> &H_off_diag,
const Grid &gr,
206 std::size_t ctp, std::size_t d_ctp, std::size_t pinf,
209 const DiracSpinor *
const Fa0 =
nullptr,
double zion = 1,
213int countNodes(
const std::vector<double> &f,
const std::size_t maxi);
216void largeEnergyChange(
double *en, TrackEnGuess *sofar,
double frac_de,
220double smallEnergyChangePT(
const double en,
const double anorm,
221 const std::vector<double> &f,
222 const std::vector<double> &dg, std::size_t ctp,
223 std::size_t d_ctp,
const double alpha,
224 const TrackEnGuess &sofar);
232void solve_Dirac_outwards(std::vector<double> &f, std::vector<double> &g,
241void solve_Dirac_inwards(std::vector<double> &f, std::vector<double> &g,
243 std::size_t pinf,
double mass = 1.0);
253void joinInOutSolutions(std::vector<double> &f, std::vector<double> &g,
254 std::vector<double> &dg,
255 const std::vector<double> &f_in,
256 const std::vector<double> &g_in, std::size_t ctp,
257 std::size_t d_ctp, std::size_t pinf);
Stores radial Dirac spinor: F_nk = (f, g)
Definition DiracSpinor.hpp:42
Holds grid, including type + Jacobian (dr/du)
Definition Grid.hpp:31
constexpr double lfrac_de
Fractional size of 'large' energy update steps (~12%).
Definition BoundState.hpp:73
constexpr int max_its
Max # attempts at converging bound-state energy.
Definition BoundState.hpp:71
constexpr double cALR
Parameter to determine 'asymptotically large r'.
Definition BoundState.hpp:69
constexpr std::size_t K_Adams
K (# steps) for Adams-Moulton method (between 1 and 12).
Definition BoundState.hpp:67
constexpr int nx
Order of coefficients in the large-r asymptotic expansion.
Definition BoundState.hpp:78
constexpr auto weight
Weighting function for meshing inward/outward solutions at the turning point. Must be positive; index...
Definition BoundState.hpp:84
constexpr double nx_eps
Convergence threshold for the asymptotic expansion.
Definition BoundState.hpp:80
constexpr int d_ctp
Number of grid points either side of the classical turning point.
Definition BoundState.hpp:75
Functions and classes used to solve the Dirac equation.
Definition AsymptoticSpinor.hpp:8
void regularAtInfinity(DiracSpinor &Fa, const double en, const std::vector< double > &v, const std::vector< double > &H_mag, const double alpha, const DiracSpinor *const VxFa, const DiracSpinor *const Fa0, double zion, double mass)
For given energy en, solves (local) DE with correct boundary conditions at infinity.
Definition BoundState.cpp:170
void regularAtOrigin(DiracSpinor &Fa, const double en, const std::vector< double > &v, const std::vector< double > &H_mag, const double alpha, const DiracSpinor *const VxFa, const DiracSpinor *const Fa0, double zion, double mass)
For given energy en, solves DE with correct boundary conditions at the origin.
Definition BoundState.cpp:149
void boundState(DiracSpinor &Fn, const double en0, const std::vector< double > &v, const std::vector< double > &H_mag, const double alpha, double eps_goal, const DiracSpinor *const VxFa, const DiracSpinor *const Fa0, double zion, double mass)
Solves bound-state problem for local potential (en < 0).
Definition BoundState.cpp:23
constexpr double alpha
Fine-structure constant: alpha = 1/137.035 999 177(21) [CODATA 2022].
Definition PhysConst_constants.hpp:24
Pure-virtual struct defining the derivative matrix for a 2x2 ODE system.
Definition AdamsMoulton.hpp:47
Derivative matrix for the radial Dirac equation, dF/du = D(u)*F(u) + S(u).
Definition BoundState.hpp:127
double a(std::size_t i) const final
D matrix elements (see DiracDerivative for definitions); index i is grid point.
Definition BoundState.cpp:501
double Sf(std::size_t i) const final
Inhomogeneous source terms from exchange potential VxFa.
Definition BoundState.cpp:513