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

Useful atomic data/functions. More...

Classes

struct  DiracConfig
 Stores relativistic single-electron state {n, kappa, energy}. More...
 
struct  Element
 Atomic element data: Z, symbol, A, name. More...
 
struct  NonRelConfig
 Stores non-relativistic single-electron config: {n, l, number}. More...
 

Functions

bool operator== (const NonRelConfig &lhs, const NonRelConfig &rhs)
 
bool operator< (const NonRelConfig &lhs, const NonRelConfig &rhs)
 
int defaultA (int Z)
 Looks up default A (most common) for given Z.
 
std::string atomicSymbol (int Z)
 e.g., 55 -> "Cs"
 
std::string atomicName (int Z)
 e.g., 55 -> "Cesium"
 
int atomic_Z (const std::string &at)
 Converts atomic symbol to integer Z (e.g., 'Cs' to 55 )
 
std::string l_symbol (int l)
 l (int) to symbol (e.g., 0->'s', 1->'p')
 
std::string L_symbol (int l)
 L (int) to symbol (e.g., 0->'S', 1->'P')
 
std::string kappa_symbol (int kappa)
 kappa (int) to symbol, e.g., -1 -> s_1/2
 
std::string shortSymbol (int n, int kappa)
 Returns shortSymbol, given n and kappa: (6,-1)->"6s+".
 
int symbol_to_l (std::string_view l_str)
 e.g., 'p' -> 1
 
std::pair< int, int > parse_symbol (std::string_view symbol)
 Parses electron 'symbol' or 'shortSymbol' to {n,kappa}, e.g., "6s+" -> {6,-1}; "6p-" -> {6,1}; "6p_1/2" -> {6,1}.
 
std::string coreConfig (const std::string &in_ng)
 Given a nobel-gas conifg (e.g., '[Xe]') returns full electron config.
 
std::string niceCoreOutput (const std::string &full_core)
 Given a full electron config., returns nicer format by recognising nobel gas.
 
std::string configs_to_string (const std::vector< NonRelConfig > &configs)
 Given a list of NonRelConfigs, returns full string.
 
double diracen (double z, double n, int k, double alpha=0.00729735256635)
 Exact H-like energy.
 
std::vector< NonRelConfigcore_parser (const std::string &str_core_in)
 Takes a "core string" in form "[X],nLm,nLm,..." converts to vector of NonRelConfig, after converting [X] to a state string. Allows negative and non-physical m's (to allow combining); responsability of whoever uses the list to check for validity.
 
NonRelConfig term_parser (std::string_view term)
 Given a term symbol 'nLm', returns corresponding NonRelConfig.
 
std::vector< NonRelConfigstate_parser (const std::string &str_states)
 Takes a string of states in form "nLm,nLm,..." converts to vector of NonRelConfig. Allows negative and non-physical m's (to allow combining)
 
void state_parser (std::vector< NonRelConfig > *states, const std::string &str_states)
 Overload; adds to existing states vector (may be empty)
 
std::string guessCoreConfigStr (const int total_core_electrons)
 Given a number of electrons, guesses the configuration, returns as string.
 
std::vector< NonRelConfigcore_guess (const int total_core_electrons)
 Given a number of electrons, guesses the configuration, returns list of NonRelConfigs.
 
std::vector< DiracConfiglistOfStates_nk (const std::string &in_list)
 Generates a list of DiracConfig from string: full list.
 
std::vector< DiracConfiglistOfStates_singlen (const std::string &in_list)
 Generates a list of DiracConfig from string: just max n for each kappa.
 
std::vector< std::pair< int, int > > n_kappa_list (const std::string &basis_string)
 Given a "basis string", returns list of {n, kappa}. e.g., 6sp5d ->{{6,-1}, {6,1}, {6,-2}, {5,2}, {5,-2}}.
 
std::string helper_s (const Element &el)
 
std::string helper_z (const Element &el)
 
void printTable ()
 Prints a periodic table to screen.
 
int atomic_Z (int z)
 Overload, to can call with int anyway.
 
void instructions ()
 
void printData (const Nuclear::Isotope &nuc)
 
int parse_A (const std::string &A_str, int z)
 
void printConstants ()
 Writes some physical constants to screen.
 
void periodicTable (std::string z_str, std::string a_str)
 Prints a basic periodic table, and write isotope info ro screen.
 
void convert_energies_au (double Eau)
 
void convert_length_au (double La0)
 
void conversions (double number, const std::string &unit)
 Performs basic unit conversions (writes to screen)
 

Detailed Description

Useful atomic data/functions.

Function Documentation

◆ defaultA()

int AtomData::defaultA ( int  Z)

Looks up default A (most common) for given Z.

◆ atomicSymbol()

std::string AtomData::atomicSymbol ( int  Z)

e.g., 55 -> "Cs"

◆ atomicName()

std::string AtomData::atomicName ( int  Z)

e.g., 55 -> "Cesium"

◆ atomic_Z() [1/2]

int AtomData::atomic_Z ( const std::string &  at)

Converts atomic symbol to integer Z (e.g., 'Cs' to 55 )

◆ l_symbol()

std::string AtomData::l_symbol ( int  l)

l (int) to symbol (e.g., 0->'s', 1->'p')

◆ L_symbol()

std::string AtomData::L_symbol ( int  l)

L (int) to symbol (e.g., 0->'S', 1->'P')

◆ kappa_symbol()

std::string AtomData::kappa_symbol ( int  kappa)

kappa (int) to symbol, e.g., -1 -> s_1/2

◆ shortSymbol()

std::string AtomData::shortSymbol ( int  n,
int  kappa 
)

Returns shortSymbol, given n and kappa: (6,-1)->"6s+".

◆ symbol_to_l()

int AtomData::symbol_to_l ( std::string_view  l_str)

e.g., 'p' -> 1

◆ parse_symbol()

std::pair< int, int > AtomData::parse_symbol ( std::string_view  symbol)

Parses electron 'symbol' or 'shortSymbol' to {n,kappa}, e.g., "6s+" -> {6,-1}; "6p-" -> {6,1}; "6p_1/2" -> {6,1}.

◆ coreConfig()

std::string AtomData::coreConfig ( const std::string &  in_ng)

Given a nobel-gas conifg (e.g., '[Xe]') returns full electron config.

◆ niceCoreOutput()

std::string AtomData::niceCoreOutput ( const std::string &  full_core)

Given a full electron config., returns nicer format by recognising nobel gas.

◆ configs_to_string()

std::string AtomData::configs_to_string ( const std::vector< NonRelConfig > &  configs)

Given a list of NonRelConfigs, returns full string.

◆ diracen()

double AtomData::diracen ( double  z,
double  n,
int  k,
double  alpha 
)

Exact H-like energy.

◆ core_parser()

std::vector< NonRelConfig > AtomData::core_parser ( const std::string &  str_core_in)

Takes a "core string" in form "[X],nLm,nLm,..." converts to vector of NonRelConfig, after converting [X] to a state string. Allows negative and non-physical m's (to allow combining); responsability of whoever uses the list to check for validity.

◆ term_parser()

NonRelConfig AtomData::term_parser ( std::string_view  term)

Given a term symbol 'nLm', returns corresponding NonRelConfig.

◆ state_parser() [1/2]

std::vector< NonRelConfig > AtomData::state_parser ( const std::string &  str_states)

Takes a string of states in form "nLm,nLm,..." converts to vector of NonRelConfig. Allows negative and non-physical m's (to allow combining)

◆ state_parser() [2/2]

void AtomData::state_parser ( std::vector< NonRelConfig > *  states,
const std::string &  str_states 
)

Overload; adds to existing states vector (may be empty)

◆ guessCoreConfigStr()

std::string AtomData::guessCoreConfigStr ( const int  total_core_electrons)

Given a number of electrons, guesses the configuration, returns as string.

◆ core_guess()

std::vector< NonRelConfig > AtomData::core_guess ( const int  total_core_electrons)

Given a number of electrons, guesses the configuration, returns list of NonRelConfigs.

◆ listOfStates_nk()

std::vector< DiracConfig > AtomData::listOfStates_nk ( const std::string &  in_list)

Generates a list of DiracConfig from string: full list.

◆ listOfStates_singlen()

std::vector< DiracConfig > AtomData::listOfStates_singlen ( const std::string &  in_list)

Generates a list of DiracConfig from string: just max n for each kappa.

◆ n_kappa_list()

std::vector< std::pair< int, int > > AtomData::n_kappa_list ( const std::string &  basis_string)

Given a "basis string", returns list of {n, kappa}. e.g., 6sp5d ->{{6,-1}, {6,1}, {6,-2}, {5,2}, {5,-2}}.

◆ printTable()

void AtomData::printTable ( )

Prints a periodic table to screen.

◆ atomic_Z() [2/2]

int AtomData::atomic_Z ( int  z)
inline

Overload, to can call with int anyway.

◆ printConstants()

void AtomData::printConstants ( )

Writes some physical constants to screen.

◆ periodicTable()

void AtomData::periodicTable ( std::string  z_str,
std::string  a_str 
)

Prints a basic periodic table, and write isotope info ro screen.

◆ conversions()

void AtomData::conversions ( double  number,
const std::string &  unit 
)

Performs basic unit conversions (writes to screen)