ampsci
c++ program for high-precision atomic structure calculations of single-valence systems
Classes | Functions
DiracODE Namespace Reference

Functions and classes used to solve the Dirac equation. More...

Classes

class  AsymptoticSpinor
 Performs asymptotic expansion for f and g at large r, up to order Nx in (1/r) More...
 
struct  DiracContinuumDerivative
 Derivative function for H-like; valid 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) More...
 
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)
 
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 DE 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 (local) DE 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)
 For given energy en (en > 0), solves Dirac eq. for continuum state (with energy normalisation). More...
 
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 of f(r) continuum Dirac solution at large r. More...
 
double analytic_f_amplitude (double en, double alpha)
 Analytic amplitude of f(r) at very large r, for H-like Dirac continuum.
 
double fitQuadratic (double x1, double x2, double x3, double y1, double y2, double y3)
 Fits a quadratic to three points {x,y}, assuming |y2| = max(|y1|,|y2|,|y3|). More...
 
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 inhomogeneous Dirac equation. More...
 
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 inhomogeneous Dirac equation. More...
 
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 inhomogeneous Dirac equation. More...
 

Detailed Description

Functions and classes used to solve the Dirac equation.

Function Documentation

◆ boundState()

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)

\[ (H_0 + v - \epsilon_a)F_a = 0\]

en0 is initial energy guess (must be reasonably good). log_eps: log10(eps); eps is convergence target for energy.

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

◆ fitQuadratic()

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

Fits a quadratic to three points {x,y}, assuming |y2| = max(|y1|,|y2|,|y3|).

Used to find amplitude of sin(x); points must be close to max

◆ 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 of f(r) continuum Dirac solution at large r.

It does this by continuing ODE integration to large r until:
(a) wavelength and,
(b) amplitude
become constant. It starts from a solution hat has been already integrated out to rmax of regular radial grid. It uses linearly-spaced grid (dr), and assumes H-like potential (-Z/r).

◆ 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 inhomogeneous Dirac equation.

\[ (H_0 + v -\epsilon_a)F_a = S \]

with ‘source’ term, S. Solves for \(\psi_\kappa\) with angular momentum kappa. en = \(\epsilon\) is given. Note sign of S. Uses Green's method (see Method documentation).

◆ 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 inhomogeneous Dirac equation.

As above. Overload to accept/overwrite solution to Fa. 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 inhomogeneous Dirac equation.

As above. Overload to accept/overwrite solution to Fa. All these routines solve also for Fzero, Finf, which are solutions to homogeneous equation (H-en)Fa = 0 [reg @ origin, and infinity, respectively].

  • The first two throw these solutions away, the third keeps them (in some cases they can be re-used)
  • These Spinors are solved internally and over-written, they don't need to be solved first (i.e., they are out parameters, not in/out parameters)

◆ 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 
)

For given energy en (en > 0), solves Dirac eq. for continuum state (with energy normalisation).

Normalisation is achieved by continuuing solving ODE to very large r, and comparing asymptotic amplitude to that of analytic solution. We only keep solution on regular grid; extended part is not kept.