ampsci
c++ program for high-precision atomic structure calculations of single-valence systems
ComplexDirac.hpp
1 #pragma once
2 #include "AdamsMoulton.hpp"
3 #include "Physics/PhysConst_constants.hpp"
4 #include <complex>
5 #include <utility>
6 #include <vector>
7 class DiracSpinor;
8 class Grid;
9 
10 namespace DiracODE {
11 
14  const std::complex<double> en,
15  const std::vector<double> &v,
16  const std::vector<double> &H_off_diag,
17  const double alpha);
18 
21  const std::complex<double> en,
22  const std::vector<double> &v,
23  const std::vector<double> &H_off_diag,
24  const double alpha);
25 
26 namespace Internal {
27 //==============================================================================
30  : AdamsMoulton::DerivativeMatrix<std::size_t, std::complex<double>> {
31 
32  CDiracDerivative(const Grid &in_grid, const std::vector<double> &in_v,
33  const int in_k, const std::complex<double> in_en,
34  const double in_alpha,
35  const std::vector<double> &V_off_diag = {});
36  const Grid *const pgr;
37  const std::vector<double> *const v;
38  const std::vector<double> *const Hmag;
39  const double zion = 1.0;
40  const int k;
41  const std::complex<double> en;
42  const double alpha, cc;
43 
44  std::complex<double> a(std::size_t i) const final;
45  std::complex<double> b(std::size_t i) const final;
46  std::complex<double> c(std::size_t i) const final;
47  std::complex<double> d(std::size_t i) const final;
48 
49  CDiracDerivative(const CDiracDerivative &) = delete;
50  void operator=(const CDiracDerivative &) = delete;
51 };
52 
53 // Solves Dirac equation by integrating outwards from zero.
54 // Integrates only to 'final' (not inclusive). If final=0, goes to f.size()
55 // Solution has correct boundary condition at r=0, but not at large r.
56 void solve_Dirac_outwards_C(std::vector<std::complex<double>> &f,
57  std::vector<std::complex<double>> &g,
58  const CDiracDerivative &Hd, std::size_t final = 0);
59 
60 // Solves Dirac equation by integrating inwards from 'pinf' to 'ctp'
61 // Solution has correct boundary condition at large r, but not at small r.
62 void solve_Dirac_inwards_C(std::vector<std::complex<double>> &f,
63  std::vector<std::complex<double>> &g,
64  const CDiracDerivative &Hd, std::size_t ctp,
65  std::size_t pinf);
66 
67 } // namespace Internal
68 } // namespace DiracODE
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_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 (local) DE with correct boundary conditions at infinity.
Definition: ComplexDirac.cpp:55
void 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 DE with correct boundary conditions at the origin.
Definition: ComplexDirac.cpp:22
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: ComplexDirac.hpp:30
std::complex< double > a(std::size_t i) const final
a,b,c,d are derivative matrix functions; all must be user implemented
Definition: ComplexDirac.cpp:208