ampsci
High-precision calculations for one- and two-valence atomic systems
ContinuumState.hpp
1#pragma once
2#include "AdamsMoulton.hpp"
3#include <utility>
4#include <vector>
5class DiracSpinor;
6class Grid;
7
8namespace DiracODE {
9
10/*!
11 @brief Solves Dirac equation for a continuum state (en > 0) with energy normalisation.
12 @details
13 Normalisation is achieved by continuing the ODE integration to very large r and
14 comparing the asymptotic amplitude to that of the analytic solution.
15 Only the solution on the regular grid is kept; the extended part is discarded.
16 @param Fa Output spinor (result stored here).
17 @param en Continuum energy (must be > 0).
18 @param v Local potential v(r).
19 @param alpha Fine-structure constant.
20 @param VxFa Optional exchange potential. If nullptr, ignored.
21 @param Fa0 Optional inhomogeneous source spinor. If nullptr, ignored.
22*/
23void solveContinuum(DiracSpinor &Fa, double en, const std::vector<double> &v,
24 double alpha, const DiracSpinor *const VxFa = nullptr,
25 const DiracSpinor *const Fa0 = nullptr);
26
27/*!
28 @brief Analytic amplitude of f(r) at very large r for an H-like Dirac continuum state.
29 @param en Continuum energy.
30 @param alpha Fine-structure constant.
31 @return Analytic asymptotic amplitude.
32*/
33double analytic_f_amplitude(double en, double alpha);
34
35/*!
36 @brief Finds the numerical amplitude and phase of f(r) for a continuum Dirac solution at large r.
37 @details
38 Continues ODE integration beyond the regular grid until both the wavelength
39 and amplitude become constant. Assumes an H-like potential (-Zeff/r) and a
40 linearly-spaced extension grid with step dr.
41 @param en Continuum energy.
42 @param kappa Orbital kappa quantum number.
43 @param alpha Fine-structure constant.
44 @param Zeff Effective nuclear charge.
45 @param f_final Value of f at the end of the regular grid.
46 @param g_final Value of g at the end of the regular grid.
47 @param r_final Radial position at the end of the regular grid.
48 @param dr Step size for the extended linear grid.
49 @return {amplitude, phase} of the asymptotic f(r) oscillation.
50*/
51std::pair<double, double> numerical_f_amplitude(double en, int kappa,
52 double alpha, double Zeff,
53 double f_final, double g_final,
54 double r_final, double dr);
55
56/*!
57 @brief H-like Dirac derivative matrix for continuum states at large r.
58 @details
59 Implements AdamsMoulton::DerivativeMatrix<double, double>, using r directly
60 as the argument type. Valid for H-like potential (-Zeff/r); used to extend
61 continuum integration beyond the regular grid for normalisation.
62 @note Non-copyable.
63*/
65 : AdamsMoulton::DerivativeMatrix<double, double> {
66
67 /*!
68 @brief Constructs the H-like continuum derivative matrix.
69 @param in_Zeff Effective nuclear charge.
70 @param in_kappa Orbital kappa quantum number.
71 @param in_en Continuum energy.
72 @param in_alpha Fine-structure constant.
73 */
74 DiracContinuumDerivative(double in_Zeff, const int in_kappa,
75 const double in_en, const double in_alpha)
76 : Zeff(in_Zeff),
77 kappa(in_kappa),
78 en(in_en),
79 alpha(in_alpha),
80 cc(1.0 / alpha) {}
81
82 double Zeff = 1.0;
83 int kappa;
84 double en, alpha, cc;
85
86 double a(double r) const final { return double(-kappa) / r; }
87 double b(double r) const final {
88 return (alpha * en + 2.0 * cc + Zeff * alpha / r);
89 }
90 double c(double r) const final { return -alpha * (Zeff / r + en); }
91 double d(double r) const final { return -a(r); }
92};
93
94/*!
95 @brief Fits a quadratic to three points and returns the interpolated maximum.
96 @details
97 Assumes |y2| = max(|y1|, |y2|, |y3|); used to find the amplitude of a
98 sinusoidal oscillation. The three points must be close to the maximum.
99 @param x1, x2, x3 x-coordinates of the three points.
100 @param y1, y2, y3 y-coordinates of the three points.
101 @return Interpolated maximum value.
102*/
103double fitQuadratic(double x1, double x2, double x3, double y1, double y2,
104 double y3);
105
106} // namespace DiracODE
Stores radial Dirac spinor: F_nk = (f, g)
Definition DiracSpinor.hpp:42
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 solveContinuum(DiracSpinor &Fa, double en, const std::vector< double > &v, double alpha, const DiracSpinor *const VxFa, const DiracSpinor *const Fa0)
Solves Dirac equation for a continuum state (en > 0) with energy normalisation.
Definition ContinuumState.cpp:14
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.
Definition ContinuumState.cpp:189
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.
Definition ContinuumState.cpp:83
double analytic_f_amplitude(double en, double alpha)
Analytic amplitude of f(r) at very large r for an H-like Dirac continuum state.
Definition ContinuumState.cpp:179
Pure-virtual struct defining the derivative matrix for a 2x2 ODE system.
Definition AdamsMoulton.hpp:47
H-like Dirac derivative matrix for continuum states at large r.
Definition ContinuumState.hpp:65
DiracContinuumDerivative(double in_Zeff, const int in_kappa, const double in_en, const double in_alpha)
Constructs the H-like continuum derivative matrix.
Definition ContinuumState.hpp:74
double a(double r) const final
a,b,c,d are derivative matrix functions; all must be user implemented
Definition ContinuumState.hpp:86