ampsci
High-precision calculations for one- and two-valence atomic systems
DiracODE Namespace Reference

Detailed Description

Functions and classes used to solve the Dirac equation.

Classes

class  AsymptoticSpinor
 Performs asymptotic expansion for f and g at large r, up to order Nx in (1/r). More...
 
struct  DiracContinuumDerivative
 H-like Dirac derivative matrix for continuum states at large r. More...
 

Functions

void boundState (DiracSpinor &Fa, const double en0, const std::vector< double > &v, const std::vector< double > &H_off_diag={}, const double alpha=PhysConst::alpha, double eps=1.0e-14, const DiracSpinor *const VxFa=nullptr, const DiracSpinor *const Fa0=nullptr, double zion=1, double mass=1.0)
 Solves bound-state problem for local potential (en < 0).
 
void regularAtOrigin (DiracSpinor &Fa, const double en, const std::vector< double > &v, const std::vector< double > &H_off_diag, const double alpha, const DiracSpinor *const VxFa=nullptr, const DiracSpinor *const Fa0=nullptr, double zion=1, double mass=1.0)
 For given energy en, solves DE with correct boundary conditions at the origin.
 
void regularAtInfinity (DiracSpinor &Fa, const double en, const std::vector< double > &v, const std::vector< double > &H_off_diag, const double alpha, const DiracSpinor *const VxFa=nullptr, const DiracSpinor *const Fa0=nullptr, double zion=1, double mass=1.0)
 For given energy en, solves (local) DE with correct boundary conditions at infinity.
 
DiracSpinor boundState (int n, int kappa, const double en0, const std::shared_ptr< const Grid > &gr, const std::vector< double > &v, const std::vector< double > &H_off_diag={}, const double alpha=PhysConst::alpha, double eps=1.0e-14, const DiracSpinor *const VxFa=nullptr, const DiracSpinor *const Fa0=nullptr, double zion=1, double mass=1.0)
 Factory overload: constructs a DiracSpinor(n, kappa, gr) and calls boundState().
 
void regularAtOrigin_C (DiracSpinor &FaR, DiracSpinor &FaI, const std::complex< double > en, const std::vector< double > &v, const std::vector< double > &H_off_diag, const double alpha)
 For given complex energy en, solves Dirac equation with correct boundary conditions at the origin.
 
void regularAtInfinity_C (DiracSpinor &FaR, DiracSpinor &FaI, const std::complex< double > en, const std::vector< double > &v, const std::vector< double > &H_off_diag, const double alpha)
 For given complex energy en, solves Dirac equation with correct boundary conditions at infinity.
 
void solveContinuum (DiracSpinor &Fa, double en, const std::vector< double > &v, double alpha, const DiracSpinor *const VxFa=nullptr, const DiracSpinor *const Fa0=nullptr)
 Solves Dirac equation for a continuum state (en > 0) with energy normalisation.
 
std::pair< double, double > numerical_f_amplitude (double en, int kappa, double alpha, double Zeff, double f_final, double g_final, double r_final, double dr)
 Finds the numerical amplitude and phase of f(r) for a continuum Dirac solution at large r.
 
double analytic_f_amplitude (double en, double alpha)
 Analytic amplitude of f(r) at very large r for an H-like Dirac continuum state.
 
double fitQuadratic (double x1, double x2, double x3, double y1, double y2, double y3)
 Fits a quadratic to three points and returns the interpolated maximum.
 
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=nullptr, const DiracSpinor *const Fa0=nullptr, double zion=1, double mass=1.0)
 Solves the inhomogeneous Dirac equation, returning the solution spinor.
 
void solve_inhomog (DiracSpinor &Fa, const double en, const std::vector< double > &v, const std::vector< double > &H_mag, const double alpha, const DiracSpinor &source, const DiracSpinor *const VxFa=nullptr, const DiracSpinor *const Fa0=nullptr, double zion=1, double mass=1.0)
 Solves the inhomogeneous Dirac equation, overwriting Fa.
 
void solve_inhomog (DiracSpinor &Fa, DiracSpinor &Fzero, DiracSpinor &Finf, const double en, const std::vector< double > &v, const std::vector< double > &H_mag, const double alpha, const DiracSpinor &source, const DiracSpinor *const VxFa=nullptr, const DiracSpinor *const Fa0=nullptr, double zion=1, double mass=1.0)
 Solves the inhomogeneous Dirac equation, overwriting Fa and exposing the homogeneous solutions.
 

Function Documentation

◆ boundState() [1/2]

void DiracODE::boundState ( DiracSpinor Fa,
const double  en0,
const std::vector< double > &  v,
const std::vector< double > &  H_off_diag = {},
const double  alpha = PhysConst::alpha,
double  eps = 1.0e-14,
const DiracSpinor *const  VxFa = nullptr,
const DiracSpinor *const  Fa0 = nullptr,
double  zion = 1,
double  mass = 1.0 
)

Solves bound-state problem for local potential (en < 0).

Solves \( (H_0 + v - \epsilon_a)F_a = 0 \) for the bound state. en0 is the initial energy guess (must be reasonably good). eps is the convergence target for the energy.

  • v is the local potential (e.g., v = v_dir + v_nuc)
  • H_off_diag is an optional off-diagonal potential
  • alpha: \( \alpha = \lambda\alpha_0 \) is the effective fine-structure constant

◆ regularAtOrigin()

void DiracODE::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.

◆ regularAtInfinity()

void DiracODE::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.

◆ boundState() [2/2]

DiracSpinor DiracODE::boundState ( int  n,
int  kappa,
const double  en0,
const std::shared_ptr< const Grid > &  gr,
const std::vector< double > &  v,
const std::vector< double > &  H_off_diag = {},
const double  alpha = PhysConst::alpha,
double  eps = 1.0e-14,
const DiracSpinor *const  VxFa = nullptr,
const DiracSpinor *const  Fa0 = nullptr,
double  zion = 1,
double  mass = 1.0 
)
inline

Factory overload: constructs a DiracSpinor(n, kappa, gr) and calls boundState().

◆ regularAtOrigin_C()

void DiracODE::regularAtOrigin_C ( DiracSpinor FaR,
DiracSpinor FaI,
const std::complex< double >  en,
const std::vector< double > &  v,
const std::vector< double > &  H_mag,
const double  alpha 
)

For given complex energy en, solves Dirac equation with correct boundary conditions at the origin.

◆ regularAtInfinity_C()

void DiracODE::regularAtInfinity_C ( DiracSpinor FaR,
DiracSpinor FaI,
const std::complex< double >  en,
const std::vector< double > &  v,
const std::vector< double > &  H_mag,
const double  alpha 
)

For given complex energy en, solves Dirac equation with correct boundary conditions at infinity.

◆ solveContinuum()

void DiracODE::solveContinuum ( DiracSpinor Fa,
double  en,
const std::vector< double > &  v,
double  alpha,
const DiracSpinor *const  VxFa = nullptr,
const DiracSpinor *const  Fa0 = nullptr 
)

Solves Dirac equation for a continuum state (en > 0) with energy normalisation.

Normalisation is achieved by continuing the ODE integration to very large r and comparing the asymptotic amplitude to that of the analytic solution. Only the solution on the regular grid is kept; the extended part is discarded.

Parameters
FaOutput spinor (result stored here).
enContinuum energy (must be > 0).
vLocal potential v(r).
alphaFine-structure constant.
VxFaOptional exchange potential. If nullptr, ignored.
Fa0Optional inhomogeneous source spinor. If nullptr, ignored.

◆ numerical_f_amplitude()

std::pair< double, double > DiracODE::numerical_f_amplitude ( double  en,
int  kappa,
double  alpha,
double  Zeff,
double  f_final,
double  g_final,
double  r_final,
double  dr 
)

Finds the numerical amplitude and phase of f(r) for a continuum Dirac solution at large r.

Continues ODE integration beyond the regular grid until both the wavelength and amplitude become constant. Assumes an H-like potential (-Zeff/r) and a linearly-spaced extension grid with step dr.

Parameters
enContinuum energy.
kappaOrbital kappa quantum number.
alphaFine-structure constant.
ZeffEffective nuclear charge.
f_finalValue of f at the end of the regular grid.
g_finalValue of g at the end of the regular grid.
r_finalRadial position at the end of the regular grid.
drStep size for the extended linear grid.
Returns
{amplitude, phase} of the asymptotic f(r) oscillation.

◆ analytic_f_amplitude()

double DiracODE::analytic_f_amplitude ( double  en,
double  alpha 
)

Analytic amplitude of f(r) at very large r for an H-like Dirac continuum state.

Parameters
enContinuum energy.
alphaFine-structure constant.
Returns
Analytic asymptotic amplitude.

◆ fitQuadratic()

double DiracODE::fitQuadratic ( double  x1,
double  x2,
double  x3,
double  y1,
double  y2,
double  y3 
)

Fits a quadratic to three points and returns the interpolated maximum.

Assumes |y2| = max(|y1|, |y2|, |y3|); used to find the amplitude of a sinusoidal oscillation. The three points must be close to the maximum.

Parameters
x1,x2,x3x-coordinates of the three points.
y1,y2,y3y-coordinates of the three points.
Returns
Interpolated maximum value.

◆ solve_inhomog() [1/3]

DiracSpinor DiracODE::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 = nullptr,
const DiracSpinor *const  Fa0 = nullptr,
double  zion = 1,
double  mass = 1.0 
)

Solves the inhomogeneous Dirac equation, returning the solution spinor.

Solves \( (H_0 + v - \epsilon_a) F_a = S \) for \( \psi_\kappa \) using Green's method (see Methods documentation). Note the sign convention for S.

Parameters
kappaAngular momentum kappa of the solution.
enOrbital energy \( \epsilon \).
vLocal potential v(r).
H_magOff-diagonal (magnetic) potential.
alphaFine-structure constant.
sourceInhomogeneous source term S.
VxFaOptional exchange potential. If nullptr, ignored.
Fa0Optional inhomogeneous source spinor. If nullptr, ignored.
zionEffective ionic charge (default 1).
massEffective particle mass in atomic units (default 1 = m_e).
Returns
Solution spinor Fa.

◆ solve_inhomog() [2/3]

void DiracODE::solve_inhomog ( DiracSpinor Fa,
const double  en,
const std::vector< double > &  v,
const std::vector< double > &  H_mag,
const double  alpha,
const DiracSpinor source,
const DiracSpinor *const  VxFa = nullptr,
const DiracSpinor *const  Fa0 = nullptr,
double  zion = 1,
double  mass = 1.0 
)

Solves the inhomogeneous Dirac equation, overwriting Fa.

As above; kappa is taken from Fa.

◆ solve_inhomog() [3/3]

void DiracODE::solve_inhomog ( DiracSpinor Fa,
DiracSpinor Fzero,
DiracSpinor Finf,
const double  en,
const std::vector< double > &  v,
const std::vector< double > &  H_mag,
const double  alpha,
const DiracSpinor source,
const DiracSpinor *const  VxFa = nullptr,
const DiracSpinor *const  Fa0 = nullptr,
double  zion = 1,
double  mass = 1.0 
)

Solves the inhomogeneous Dirac equation, overwriting Fa and exposing the homogeneous solutions.

As above, but also returns the homogeneous solutions Fzero (regular at origin) and Finf (regular at infinity), which satisfy \( (H_0 + v - \epsilon)F = 0 \). The first two overloads discard these; this one keeps them for potential reuse. Fzero and Finf are out parameters – they are overwritten internally and do not need to be initialised before calling.