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

Detailed Description

Constructs spinor/orbital basis using B-splines.

Uses Bsplines to form a set of B-spline orbitals (using method from [1] "Derevianko", [2] "Johnson", or [3] "Fischer"). Diagonalises B-splines over Hamiltonian to produce a set of basis orbitals.

[1] K. Beloy, A. Derevianko, Comput. Phys. Commun. 179, 310 (2008). [2] W. Johnson, S. Blundell, J. Sapirstein, Phys. Rev. A 37, 307 (1988). [3] C. F. Fischer and F. A. Parpia, Phys. Lett. A 179, 198 (1993). See also: Bachau et al., Reports Prog. Phys. 64, 1815 (2001). V. M. Shabaev, I. I. Tupitsyn, V. A. Yerokhin, G. Plunien, and G. Soff, Phys. Rev. Lett. 93, 130405 (2004).

By default, uses the Derevianko Dual Kintetic Balance (DKB) basis.

If \(\{|i\rangle\}\) are the set of \(2N\) DKB spline orbitals (of a given angular symmetry), and

\[ H_{ij} = \langle{S_i}|\hat H_{\rm HF}|{S_j}\rangle \, , \qquad S_{ij} = \langle{S_i|S_j}\rangle. \]

The eigenvalue problem:

\[ H_{ij}p_i = \epsilon S_{ij}p_i, \]

is solved, yielding \(2N\) eigenvalues \(\epsilon\) with corresponding eigenvectors \(p\) (half of these are positive energy solutions, half are negative energy solutions).

Note: form_basis() does not store the eigenvectors, instead, it expands the basis orbitals and stores them on the regular grid (coordinate space). i.e., for each eigenvalue, n, the corresponding basis orbital is:

\[ |{n}\rangle = \sum_i^{2N} p_i |i\rangle\, \]

Classes

struct  Parameters
 Input parameters for B-spline basis construction. More...
 
struct  SplineParams
 Type-dependent spline grid parameters for a given kappa. More...
 

Enumerations

enum class  SplineType { Derevianko , Johnson , Fischer }
 B-spline construction method: Derevianko/Reno (DKB), Johnson/NotreDame, or Fischer. More...
 

Functions

std::vector< DiracSpinorform_basis (const Parameters &params, const Wavefunction &wf, const bool correlationsQ=false)
 Forms and returns the basis orbitals (expanded in terms of splines).
 
double check (const std::vector< DiracSpinor > &basis, const std::vector< DiracSpinor > &orbs, bool print_warning=true)
 Compares basis to reference orbitals; checks normality, orthogonality, and energies.
 
SplineParams spline_params (SplineType type, int kappa, std::size_t n_states)
 Returns SplineParams for the given type, kappa, and number of states.
 
std::pair< std::vector< DiracSpinor >, std::vector< DiracSpinor > > form_spline_basis (const int kappa, const std::size_t n_states, const std::size_t k_spl, const double r0_spl, const double rmax_spl, std::shared_ptr< const Grid > rgrid, const double alpha, SplineType itype=SplineType::Derevianko)
 Forms the underlying spline basis (which is not kept)
 
std::pair< LinAlg::Matrix< double >, LinAlg::Matrix< double > > fill_Hamiltonian_matrix (const std::vector< DiracSpinor > &spl_basis, const std::vector< DiracSpinor > &d_basis, const Wavefunction &wf, const bool correlationsQ=false, SplineType itype=SplineType::Derevianko)
 Calculates and returns the Hamiltonian matrix H_ij and overlap matrix S_ij.
 
void add_JohnsonBoundary (LinAlg::Matrix< double > *Aij, const int kappa, const double alpha)
 Applies Johnson/Notre-Dame boundary conditions to the Hamiltonian matrix.
 
void add_FischerBoundary (LinAlg::Matrix< double > *Aij, const double alpha)
 Applies Fischer/Vanderbilt rmax boundary: forces f(rmax)=g(rmax).
 
void expand_basis_orbitals (std::vector< DiracSpinor > *basis, std::vector< DiracSpinor > *basis_positron, const std::vector< DiracSpinor > &spl_basis, const int kappa, const int max_n, int max_n_positron, const LinAlg::Vector< double > &e_values, const LinAlg::Matrix< double > &e_vectors, const Wavefunction &wf)
 Expands basis orbitals in terms of spline orbitals by diagonalising Hamiltonian.
 
std::vector< double > sumrule_TKR (const std::vector< DiracSpinor > &basis, const std::vector< double > &r, bool print=false)
 TKR sum rule (basis test); should =0 (must include -ve energy states)
 
std::vector< double > sumrule_DG (int nDG, const std::vector< DiracSpinor > &basis, const Grid &gr, double alpha, bool print)
 Drake-Gordon sum rule (basis test); should =0 (must incl -ve energy states)
 
std::pair< double, double > r_completeness (const DiracSpinor &Fv, const std::vector< DiracSpinor > &basis, const Grid &gr, bool print=false)
 Measures radial completeness of the basis for orbital Fv.
 
std::string_view parseSplineType (SplineType type)
 Returns the canonical name string for a SplineType.
 
auto parseSplineType (std::string_view type)
 Parses a string to SplineType (case-insensitive).
 
void r_completeness_header ()
 Prints the title and column headers for r_completeness output.
 

Class Documentation

◆ SplineBasis::SplineParams

struct SplineBasis::SplineParams
Class Members
size_t imin first included spline index
size_t n_spl total number of splines (n_spl >= N, number of basis functions)
size_t imax one-past-last included spline index (exclusive upper bound)
double lambda_DKB kinetic balance prefactor (1 for DKB, 0 for Johnson)

Enumeration Type Documentation

◆ SplineType

enum class SplineBasis::SplineType
strong

B-spline construction method: Derevianko/Reno (DKB), Johnson/NotreDame, or Fischer.

W. R. Johnson, S. A. Blundell, J. Sapirstein, Phys. Rev. A 37, 307 (1988).

Function Documentation

◆ form_basis()

std::vector< DiracSpinor > SplineBasis::form_basis ( const Parameters params,
const Wavefunction wf,
const bool  correlationsQ = false 
)

Forms and returns the basis orbitals (expanded in terms of splines).

  • states_str = which states to keep e.g., "25spd10f" (up to n=25 for s,p,d-states, and up to n=10 for f states)
  • n_spl: Number of splines (nb: underlying spline set is larger, see [1])
  • k_spl: k order of the B-splines. NB: must have \(k\geq l_{\rm max}+3\) [1]
  • r0_spl: first internal knot
  • r0_eps: sets r0_spl as r where relative core density larger than r0_eps (updates r0 for each l). Typically ~1.0e-8. Set to zero to use r0_spl.
  • rmax_spl: last internal knot (basis orbitals only non-zero before this point)
  • wf: Wavefunction object: needed to form Hartree-Fock Hamiltonian
  • positronQ: =true will keep negative energy states (have -ve principal quantum number, are appended to end of the basis std::vector). If false, discards them.

Note: This function calls the below functions, they rarely need to be called explicitely, unless you are trying to do something different to usual.

◆ check()

double SplineBasis::check ( const std::vector< DiracSpinor > &  basis,
const std::vector< DiracSpinor > &  orbs,
bool  print_warning 
)

Compares basis to reference orbitals; checks normality, orthogonality, and energies.

◆ spline_params()

SplineParams SplineBasis::spline_params ( SplineType  type,
int  kappa,
std::size_t  N_states 
)

Returns SplineParams for the given type, kappa, and number of states.

◆ form_spline_basis()

std::pair< std::vector< DiracSpinor >, std::vector< DiracSpinor > > SplineBasis::form_spline_basis ( const int  kappa,
const std::size_t  N_states,
const std::size_t  k_spl,
const double  r0_spl,
const double  rmax_spl,
std::shared_ptr< const Grid rgrid,
const double  alpha,
SplineType  type 
)

Forms the underlying spline basis (which is not kept)

◆ fill_Hamiltonian_matrix()

std::pair< LinAlg::Matrix< double >, LinAlg::Matrix< double > > SplineBasis::fill_Hamiltonian_matrix ( const std::vector< DiracSpinor > &  spl_basis,
const std::vector< DiracSpinor > &  d_basis,
const Wavefunction wf,
const bool  correlationsQ,
SplineType  type 
)

Calculates and returns the Hamiltonian matrix H_ij and overlap matrix S_ij.

◆ add_JohnsonBoundary()

void SplineBasis::add_JohnsonBoundary ( LinAlg::Matrix< double > *  Aij,
const int  kappa,
const double  alpha 
)

Applies Johnson/Notre-Dame boundary conditions to the Hamiltonian matrix.

Adds r=0 and r=rmax boundary terms to enforce correct asymptotic behaviour. W. R. Johnson, S. A. Blundell, J. Sapirstein, Phys. Rev. A 37, 307 (1988).

◆ add_FischerBoundary()

void SplineBasis::add_FischerBoundary ( LinAlg::Matrix< double > *  Aij,
const double  alpha 
)

Applies Fischer/Vanderbilt rmax boundary: forces f(rmax)=g(rmax).

Subset of add_JohnsonBoundary (rmax terms only; no r=0 conditions).

◆ expand_basis_orbitals()

void SplineBasis::expand_basis_orbitals ( std::vector< DiracSpinor > *  basis,
std::vector< DiracSpinor > *  basis_positron,
const std::vector< DiracSpinor > &  spl_basis,
const int  kappa,
const int  max_n,
int  max_n_positron,
const LinAlg::Vector< double > &  e_values,
const LinAlg::Matrix< double > &  e_vectors,
const Wavefunction wf 
)

Expands basis orbitals in terms of spline orbitals by diagonalising Hamiltonian.

◆ sumrule_TKR()

std::vector< double > SplineBasis::sumrule_TKR ( const std::vector< DiracSpinor > &  basis,
const std::vector< double > &  r,
bool  print 
)

TKR sum rule (basis test); should =0 (must include -ve energy states)

◆ sumrule_DG()

std::vector< double > SplineBasis::sumrule_DG ( int  nDG,
const std::vector< DiracSpinor > &  basis,
const Grid gr,
double  alpha,
bool  print 
)

Drake-Gordon sum rule (basis test); should =0 (must incl -ve energy states)

◆ r_completeness()

std::pair< double, double > SplineBasis::r_completeness ( const DiracSpinor Fa,
const std::vector< DiracSpinor > &  basis,
const Grid gr,
bool  print 
)

Measures radial completeness of the basis for orbital Fv.

◆ parseSplineType() [1/2]

std::string_view SplineBasis::parseSplineType ( SplineType  type)
inline

Returns the canonical name string for a SplineType.

◆ parseSplineType() [2/2]

auto SplineBasis::parseSplineType ( std::string_view  type)
inline

Parses a string to SplineType (case-insensitive).

  • Derevianko (default, aliases: reno): Dual Kinetic Balance method; K. Beloy, A. Derevianko, Comput. Phys. Commun. 179, 310 (2008).
  • Johnson (aliases: nd, notredame, notre-dame): Notre-Dame method with explicit boundary conditions; W. R. Johnson, S. A. Blundell, J. Sapirstein, Phys. Rev. A 37, 307 (1988).
  • Fischer (aliases: vanderbilt): rmax boundary only (no r=0 conditions); C. F. Fischer and F. A. Parpia, Phys. Lett. A 179, 198 (1993).

◆ r_completeness_header()

void SplineBasis::r_completeness_header ( )
inline

Prints the title and column headers for r_completeness output.