2 #include "AdamsMoulton.hpp"
3 #include "Physics/PhysConst_constants.hpp"
4 #include "Wavefunction/DiracSpinor.hpp"
24 const std::vector<double> &H_off_diag = {},
27 const DiracSpinor *
const Fa0 =
nullptr,
double zion = 1,
31 const std::shared_ptr<const Grid> &gr,
32 const std::vector<double> &v,
33 const std::vector<double> &H_off_diag = {},
38 double zion = 1,
double mass = 1.0) {
40 boundState(Fnk, en0, v, H_off_diag, alpha, eps, VxFa, Fa0, zion, mass);
46 const std::vector<double> &v,
47 const std::vector<double> &H_off_diag,
const double alpha,
49 const DiracSpinor *
const Fa0 =
nullptr,
double zion = 1,
54 const std::vector<double> &v,
55 const std::vector<double> &H_off_diag,
58 const DiracSpinor *
const Fa0 =
nullptr,
double zion = 1,
68 constexpr std::size_t K_Adams = 7;
70 constexpr
double cALR = 550.0;
72 constexpr
int max_its = 99;
74 constexpr
double lfrac_de = 0.12;
76 constexpr
int d_ctp = 4;
79 constexpr
int nx = 15;
81 constexpr
double nx_eps = 1.e-12;
85 constexpr
auto weight = [](std::size_t i) {
86 return 1.0 /
static_cast<double>(i * i + 1);
90 Param::K_Adams >= 1 && Param::K_Adams <= AdamsMoulton::K_max,
91 "\nFAIL in DiracODE: parameter K_Adams must be between 5 and 8\n");
100 const int in_k,
const double in_en,
const double in_alpha,
101 const std::vector<double> &V_off_diag = {},
103 const DiracSpinor *
const iFa0 =
nullptr,
double zion = 1,
104 double in_mass = 1.0);
105 const Grid *
const pgr;
106 const std::vector<double> *
const v;
107 const std::vector<double> *
const Hmag;
110 const double zion = 1.0;
112 const double en, alpha, cc;
115 double a(std::size_t i)
const final;
116 double b(std::size_t i)
const final;
117 double c(std::size_t i)
const final;
118 double d(std::size_t i)
const final;
119 double Sf(std::size_t i)
const final;
120 double Sg(std::size_t i)
const final;
128 struct TrackEnGuess {
130 int count_toomany = 0;
131 int count_toofew = 0;
133 double high_en = 0.0;
139 std::size_t findPracticalInfinity(
const double en,
const std::vector<double> &v,
140 const std::vector<double> &r,
144 std::size_t findClassicalTurningPoint(
const double en,
145 const std::vector<double> &v,
146 std::size_t pinf, std::size_t d_ctp);
155 void trialDiracSolution(std::vector<double> &f, std::vector<double> &g,
156 std::vector<double> &dg,
const double en,
const int ka,
157 const std::vector<double> &v,
158 const std::vector<double> &H_off_diag,
const Grid &gr,
159 std::size_t ctp, std::size_t d_ctp, std::size_t pinf,
162 const DiracSpinor *
const Fa0 =
nullptr,
double zion = 1,
166 int countNodes(
const std::vector<double> &f,
const std::size_t maxi);
169 void largeEnergyChange(
double *en, TrackEnGuess *sofar,
double frac_de,
173 double smallEnergyChangePT(
const double en,
const double anorm,
174 const std::vector<double> &f,
175 const std::vector<double> &dg, std::size_t ctp,
176 std::size_t d_ctp,
const double alpha,
177 const TrackEnGuess &sofar);
182 void solve_Dirac_outwards(std::vector<double> &f, std::vector<double> &g,
187 void solve_Dirac_inwards(std::vector<double> &f, std::vector<double> &g,
189 std::size_t pinf,
double mass = 1.0);
194 void joinInOutSolutions(std::vector<double> &f, std::vector<double> &g,
195 std::vector<double> &dg,
196 const std::vector<double> &f_in,
197 const std::vector<double> &g_in, std::size_t ctp,
198 std::size_t d_ctp, std::size_t pinf);
Stores radial Dirac spinor: F_nk = (f, g)
Definition: DiracSpinor.hpp:41
Holds grid, including type + Jacobian (dr/du)
Definition: Grid.hpp:31
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
Definition: PhysConst_constants.hpp:13
Pure-virtual struct, holds the derivative matrix for 2x2 system of ODEs. Derive from this,...
Definition: AdamsMoulton.hpp:79
Matrix which defines Dirac derivative: (dF/dr) = D*F.
Definition: BoundState.hpp:97
double a(std::size_t i) const final
a,b,c,d are derivative matrix functions; all must be user implemented
Definition: BoundState.cpp:501
double Sf(std::size_t i) const final
Sf and Sg are optional inhomogenous terms.
Definition: BoundState.cpp:513