2#include "AdamsMoulton.hpp"
3#include "Physics/PhysConst_constants.hpp"
4#include "Wavefunction/DiracSpinor.hpp"
31 const std::vector<double> &H_off_diag = {},
34 const DiracSpinor *
const Fa0 =
nullptr,
double zion = 1,
39 int n,
int kappa,
const double en0,
const std::shared_ptr<const Grid> &gr,
40 const std::vector<double> &v,
const std::vector<double> &H_off_diag = {},
43 const DiracSpinor *
const Fa0 =
nullptr,
double zion = 1,
double mass = 1.0) {
45 boundState(Fnk, en0, v, H_off_diag, alpha, eps, VxFa, Fa0, zion, mass);
51 const std::vector<double> &v,
52 const std::vector<double> &H_off_diag,
const double alpha,
54 const DiracSpinor *
const Fa0 =
nullptr,
double zion = 1,
60 const std::vector<double> &v,
61 const std::vector<double> &H_off_diag,
64 const DiracSpinor *
const Fa0 =
nullptr,
double zion = 1,
76constexpr double cALR = 550.0;
95constexpr auto weight = [](std::size_t i) {
96 return 1.0 /
static_cast<double>(i * i + 1);
101 "\nFAIL in DiracODE: parameter K_Adams must be between 5 and 8\n");
155 const int in_k,
const double in_en,
const double in_alpha,
156 const std::vector<double> &V_off_diag = {},
158 const DiracSpinor *
const iFa0 =
nullptr,
double zion = 1,
159 double in_mass = 1.0);
161 const Grid *
const pgr;
162 const std::vector<double> *
const v;
163 const std::vector<double> *
const Hmag;
166 const double zion = 1.0;
168 const double en, alpha, cc;
172 double a(std::size_t i)
const final;
173 double b(std::size_t i)
const final;
174 double c(std::size_t i)
const final;
175 double d(std::size_t i)
const final;
177 double Sf(std::size_t i)
const final;
178 double Sg(std::size_t i)
const final;
190 int count_toomany = 0;
191 int count_toofew = 0;
192 double high_en = 0.0;
198 std::size_t pinf = 0;
201 bool correct_nodes =
false;
202 std::vector<double> dg{};
208TrackEnGuess trialSolution(
DiracSpinor *Fn,
const std::vector<double> &v,
209 const std::vector<double> &H_off_diag,
double alpha,
211 double zion,
double mass, std::vector<double> &f_in,
212 std::vector<double> &g_in, std::vector<double> &f_p,
213 std::vector<double> &g_p, TrackEnGuess sofar);
217TrackEnGuess adjustEnergy(
DiracSpinor *Fn,
int required_nodes,
double alpha,
222void adjustTail(
DiracSpinor *Fn,
const std::vector<double> &v,
223 const std::vector<double> &H_off_diag,
double alpha,
224 double zion,
double mass,
const TrackEnGuess &sofar);
228std::size_t findPracticalInfinity(
const double en,
const std::vector<double> &v,
229 const std::vector<double> &r,
230 const double alr,
const double mass = 1.0);
233std::size_t findClassicalTurningPoint(
const double en,
234 const std::vector<double> &v,
235 std::size_t pinf, std::size_t d_ctp);
251void trialDiracSolution(std::vector<double> &f, std::vector<double> &g,
252 std::vector<double> &dg, std::vector<double> &f_in,
253 std::vector<double> &g_in, std::vector<double> &f_p,
254 std::vector<double> &g_p,
const double en,
const int ka,
255 const std::vector<double> &v,
256 const std::vector<double> &H_off_diag,
const Grid &gr,
257 std::size_t ctp, std::size_t d_ctp, std::size_t pinf,
260 const DiracSpinor *
const Fa0 =
nullptr,
double zion = 1,
264int countNodes(
const std::vector<double> &f,
const std::size_t maxi);
267void largeEnergyChange(
double *en, TrackEnGuess *sofar,
double frac_de,
273double smallEnergyChangePT(
const double en,
const double anorm,
274 const std::vector<double> &f,
275 const std::vector<double> &dg, std::size_t ctp,
276 std::size_t d_ctp,
const double alpha,
277 TrackEnGuess *sofar);
285void solve_Dirac_outwards(std::vector<double> &f, std::vector<double> &g,
286 const DiracDerivative &Hd, std::size_t
final = 0);
295void solve_Dirac_inwards(std::vector<double> &f, std::vector<double> &g,
296 const DiracDerivative &Hd, std::size_t ctp,
297 std::size_t pinf,
double mass = 1.0);
307void solve_Dirac_inwards_particular(std::vector<double> &f,
308 std::vector<double> &g,
309 const DiracDerivative &Hd, std::size_t nf,
358std::size_t extendTail(std::vector<double> &f, std::vector<double> &g,
359 const DiracDerivative &Hd, std::size_t pinf,
370void joinInOutSolutions(std::vector<double> &f, std::vector<double> &g,
371 std::vector<double> &dg,
372 const std::vector<double> &f_in,
373 const std::vector<double> &g_in, std::size_t ctp,
374 std::size_t d_ctp, std::size_t pinf);
Stores radial Dirac spinor: F_nk = (f, g)
Definition DiracSpinor.hpp:55
Non-uniform radial grid with Jacobian, suitable for atomic structure calculations.
Definition Grid.hpp:85
constexpr double lfrac_de
Fractional size of 'large' energy update steps (~12%).
Definition BoundState.hpp:80
constexpr int max_its
Max # attempts at converging bound-state energy.
Definition BoundState.hpp:78
constexpr double tail_cut
Relative cutoff for the large-r tail: extend outwards until |f| drops below tail_cut * max|f|....
Definition BoundState.hpp:91
constexpr double cALR
Parameter to determine 'asymptotically large r'.
Definition BoundState.hpp:76
constexpr std::size_t K_Adams
K (# steps) for Adams-Moulton method (between 1 and 12).
Definition BoundState.hpp:74
constexpr int nx
Order of coefficients in the large-r asymptotic expansion.
Definition BoundState.hpp:85
constexpr auto weight
Weighting function for meshing inward/outward solutions at the turning point. Must be positive; index...
Definition BoundState.hpp:95
constexpr double nx_eps
Convergence threshold for the asymptotic expansion.
Definition BoundState.hpp:87
constexpr int d_ctp
Number of grid points either side of the classical turning point.
Definition BoundState.hpp:82
Functions and classes used to solve the Dirac equation.
Definition AsymptoticSpinor.hpp:10
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:109
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:88
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:138
double a(std::size_t i) const final
D matrix elements (see DiracDerivative for definitions); index i is grid point.
Definition BoundState.cpp:693
double Sf(std::size_t i) const final
Inhomogeneous source terms from exchange potential VxFa.
Definition BoundState.cpp:705