ampsci
High-precision calculations for one- and two-valence atomic systems
Wavefunction

Stores Wavefunction (set of valence orbitals, grid, HF etc.) More...

#include <Wavefunction.hpp>

Public Member Functions

 Wavefunction (std::shared_ptr< const Grid > grid, const Nuclear::Nucleus &nucleus, double var_alpha=1.0, const std::string &run_label="")
 Construct with a Grid [shared resource], a nucleus (isotope data etc.), and (optional) fractional variation in alpha [alpha = var_alpha * alpha_0, alpha_0=~1/137].
 
 Wavefunction (const GridParameters &gridparams, const Nuclear::Nucleus &nucleus, double var_alpha=1.0, const std::string &run_label="")
 As above, but Grid is constructed here using given parameters.
 
const Gridgrid () const
 Returns a const reference to the radial grid.
 
std::shared_ptr< const Gridgrid_sptr () const
 Copy of shared_ptr to grid [shared resource] - used when we want to construct a new object that shares this grid.
 
double alpha () const
 Local value of fine-structure constant.
 
double dalpha2 () const
 Variation in alpha^2 : x = (alpha/alpha_0)^2 - 1.
 
const Nuclear::Nucleusnucleus () const
 Returns Nuclear::nucleus object (contains nuc. parameters)
 
int Znuc () const
 Nuclear charge, Z.
 
int Anuc () const
 Nuclear mass number, A.
 
double get_rrms () const
 Nuclear rms charge radii, in fm (femptometres)
 
const std::vector< DiracSpinor > & core () const
 Core orbitals (frozen HF core)
 
const std::vector< DiracSpinor > & valence () const
 Valence orbitals (HF or Brueckner orbitals)
 
std::vector< DiracSpinor > & valence ()
 
const std::vector< DiracSpinor > & hf_valence () const
 
const std::vector< DiracSpinor > & basis () const
 Basis, eigenstates of HF potential. Used for MBPT. Includes Breit and QED (if they are included), but not correlations.
 
std::vector< DiracSpinor > & basis ()
 
const std::vector< DiracSpinor > & spectrum () const
 Sprectrum: like basis, but includes correlations.
 
std::vector< DiracSpinor > & spectrum ()
 
const std::vector< CI::PsiJPi > & CIwfs () const
 
const CI::PsiJPiCIwf (int J, int parity) const
 
const std::vector< double > & vnuc () const
 Nuclear potential. Only provide const version, since HF and WF version of vnuc must be kept in sync.
 
const HF::HartreeFockvHF () const
 Returns ptr to Hartree Fock (class)
 
HF::HartreeFockvHF ()
 
std::vector< double > vlocal (int l=0) const
 Local part of potential, e.g., Vl = Vnuc + Vdir + Vrad_el(l) - can be l-dependent. Returns a copy.
 
std::vector< double > Hmag (int l=0) const
 QED Magnetic form factor. May return empty vector. Not typically l-dependent, but may be in future. Returns a copy.
 
const QED::RadPotvrad () const
 Pointer to QED radiative potnential. May be nullptr.
 
QED::RadPotvrad ()
 
const MBPT::CorrelationPotential * Sigma () const
 Returns ptr to (const) Correlation Potential, Sigma.
 
MBPT::CorrelationPotential * Sigma ()
 
int Ncore () const
 Number of electrons in the core.
 
const DiracSpinorgetState (int n, int k) const
 Finds requested state; returns nullptr if not found.
 
const DiracSpinorgetState (std::string_view state) const
 As above, but takes 'short symbol' (e.g., 6s+, 6p-)
 
double FermiLevel () const
 Returns energy location of the "Fermi Level", - energy half way between core/valence. Defined: 0.5*( max(e_core) + min(e_valence)). Should be -ve.
 
double energy_gap () const
 Energy gap between lowest valence + highest core state: e(v) - e(c) [should be positive].
 
std::string coreConfiguration () const
 Returns full core configuration.
 
std::string coreConfiguration_nice () const
 Returns core configuration, in nice output notation.
 
std::string atom () const
 String of atom info (e.g., "Cs, Z=55, A=133")
 
std::string atomicSymbol () const
 e.g., "Cs"
 
std::string identity () const
 Atomic symbol, including core ionisation degree and run_label.
 
const std::string & run_label () const
 Atomic symbol, including core ionisation degree and run_label.
 
int ion_degree (int num_val) const
 0 for neutral, 1 for singly-ionised etc.
 
std::string ion_symbol (int num_val) const
 I for neutral, II for singly-ionised etc.
 
int Zion () const
 Effective charge (for core) = Z-N_core.
 
void printCore () const
 Prints table of core orbitals + energies etc.
 
void printValence (const std::vector< DiracSpinor > &tmp_orbitals={}) const
 Prints table of valence orbitals + energies etc.
 
void printBasis (const std::vector< DiracSpinor > &the_basis) const
 Prints table of Basis/Spectrum orbitals, compares to HF orbitals.
 
bool isInCore (int n, int k) const
 Check if a state is in the core (or valence) list.
 
bool isInValence (int n, int k) const
 
std::vector< double > coreDensity () const
 Calculates rho(r) = sum_c psi^2(r) for core states, c={n,k,m}.
 
double coreEnergyHF () const
 Calculates HF core energy (doesn't include magnetic QED?)
 
void set_HF (const std::string &method="HartreeFock", const double x_Breit=0.0, const std::string &in_core="", double eps_HF=1.0e-13, bool print=true)
 Initialises HF object and populates core orbitals (does not solve HF equations)
 
void solve_core (bool print=true)
 Performs hartree-Fock procedure for core.
 
void solve_core (const std::string &method, const double x_Breit=0.0, const std::string &in_core="", double eps_HF=1.0e-13, bool print=true)
 This version will first set_HF(), then solve_core()
 
void solve_valence (const std::string &in_valence_str="", const bool print=true)
 Performs hartree-Fock procedure for valence: note: poplulates valnece.
 
void solve_exotic (const std::string &in_exotic_str, double mass=PhysConst::m_muon, bool print=true)
 Solves for exotic atoms (e.g., muonic), including screening. Resulting states are included in valence; the screening also updates core.
 
void hartreeFockBrueckner (const bool print=true)
 Forms Bruckner valence orbitals: (H_hf + Sigma)|nk> = e|nk>. Replaces existing valence states.
 
void fitSigma_hfBrueckner (const std::string &valence_list, const std::vector< double > &fit_energies)
 First, fits Sigma to energies, then forms fitted Brueckner orbitals.
 
void radiativePotential (QED::RadPot::Scale s, double rcut, double scale_rN, const std::vector< double > &x_spd, bool do_readwrite=true, bool print=true)
 OLD: deprecated.
 
void radiativePotential (const IO::InputBlock &qed_input, bool do_readwrite, bool print)
 Calculates radiative potential, adds to HF potential.
 
void formBasis (const SplineBasis::Parameters &params)
 Calculates + populates basis [see BSplineBasis].
 
void formSpectrum (const SplineBasis::Parameters &params)
 Calculates + populates Spectrum [see BSplineBasis].
 
void formSigma (int nmin_core=1, double r0=1.0e-4, double rmax=30.0, int stride=4, bool each_valence=false, bool include_G=false, bool include_Breit=false, int n_max_breit=0, const std::vector< double > &lambdas={}, const std::vector< double > &fk={}, const std::vector< double > &etak={}, bool read_write=true, const std::string &fname="", bool FeynmanQ=false, bool ScreeningQ=false, bool hole_particleQ=false, int lmax=6, double omre=-0.2, double w0=0.01, double wratio=1.5, const std::optional< IO::InputBlock > &ek=std::nullopt)
 Forms + stores correlation potential Sigma.
 
void copySigma (const MBPT::CorrelationPotential *const Sigma)
 
void update_Vnuc (const std::vector< double > &v_new)
 Allows extra potential to be added to Vnuc (updates both in Wavefunction.
 
std::tuple< double, double > lminmax_core_range (int l, double eps=0.0) const
 Returns [min,max] r values for which the core density (given l) is larger than cutoff (= eps*max_value)
 
double H0ab (const DiracSpinor &Fa, const DiracSpinor &Fb) const
 Returns <a|H|b> for Hamiltonian H (inludes Rad.pot, NOT sigma, Breit, or exchange!)
 
double H0ab (const DiracSpinor &Fa, const DiracSpinor &dFa, const DiracSpinor &Fb, const DiracSpinor &dFb) const
 Returns <a|H|b> for Hamiltonian H (inludes Rad.pot, NOT sigma, Breit, or exchange!)
 
double Hab (const DiracSpinor &Fa, const DiracSpinor &Fb) const
 
void ConfigurationInteraction (const IO::InputBlock &input)
 Runs the CI+MBPT routines; stores wavefunctions.
 
nlohmann::json output_to_json (const std::string &out_name="ampsci_output.json")
 Writes wavefunction information to json file; if out_name given, will print to that file.
 

Detailed Description

Stores Wavefunction (set of valence orbitals, grid, HF etc.)

Construction:
  • Set of GridParameters [see Maths/Grid]
  • Set of Nuclear::Nucleus [see Physics/NuclearPotentials]
  • var_alpha = \(\lambda\), \(\alpha = \lambda\alpha_0\)
  • run_label: Optional label for output identity - for distinguishing outputs with different parameters

Constructor & Destructor Documentation

◆ Wavefunction() [1/2]

Wavefunction::Wavefunction ( std::shared_ptr< const Grid grid,
const Nuclear::Nucleus nucleus,
double  var_alpha = 1.0,
const std::string &  run_label = "" 
)

Construct with a Grid [shared resource], a nucleus (isotope data etc.), and (optional) fractional variation in alpha [alpha = var_alpha * alpha_0, alpha_0=~1/137].

◆ Wavefunction() [2/2]

Wavefunction::Wavefunction ( const GridParameters gridparams,
const Nuclear::Nucleus nucleus,
double  var_alpha = 1.0,
const std::string &  run_label = "" 
)

As above, but Grid is constructed here using given parameters.

Member Function Documentation

◆ grid()

const Grid & Wavefunction::grid ( ) const
inline

Returns a const reference to the radial grid.

◆ grid_sptr()

std::shared_ptr< const Grid > Wavefunction::grid_sptr ( ) const
inline

Copy of shared_ptr to grid [shared resource] - used when we want to construct a new object that shares this grid.

◆ alpha()

double Wavefunction::alpha ( ) const
inline

Local value of fine-structure constant.

◆ dalpha2()

double Wavefunction::dalpha2 ( ) const
inline

Variation in alpha^2 : x = (alpha/alpha_0)^2 - 1.

◆ nucleus()

const Nuclear::Nucleus & Wavefunction::nucleus ( ) const
inline

Returns Nuclear::nucleus object (contains nuc. parameters)

◆ Znuc()

int Wavefunction::Znuc ( ) const
inline

Nuclear charge, Z.

◆ Anuc()

int Wavefunction::Anuc ( ) const
inline

Nuclear mass number, A.

◆ get_rrms()

double Wavefunction::get_rrms ( ) const
inline

Nuclear rms charge radii, in fm (femptometres)

◆ core()

const std::vector< DiracSpinor > & Wavefunction::core ( ) const
inline

Core orbitals (frozen HF core)

◆ valence()

const std::vector< DiracSpinor > & Wavefunction::valence ( ) const
inline

Valence orbitals (HF or Brueckner orbitals)

◆ basis()

const std::vector< DiracSpinor > & Wavefunction::basis ( ) const
inline

Basis, eigenstates of HF potential. Used for MBPT. Includes Breit and QED (if they are included), but not correlations.

◆ spectrum()

const std::vector< DiracSpinor > & Wavefunction::spectrum ( ) const
inline

Sprectrum: like basis, but includes correlations.

◆ vnuc()

const std::vector< double > & Wavefunction::vnuc ( ) const
inline

Nuclear potential. Only provide const version, since HF and WF version of vnuc must be kept in sync.

◆ vHF()

const HF::HartreeFock * Wavefunction::vHF ( ) const
inline

Returns ptr to Hartree Fock (class)

◆ vlocal()

std::vector< double > Wavefunction::vlocal ( int  l = 0) const

Local part of potential, e.g., Vl = Vnuc + Vdir + Vrad_el(l) - can be l-dependent. Returns a copy.

◆ Hmag()

std::vector< double > Wavefunction::Hmag ( int  l = 0) const

QED Magnetic form factor. May return empty vector. Not typically l-dependent, but may be in future. Returns a copy.

◆ vrad()

const QED::RadPot * Wavefunction::vrad ( ) const
inline

Pointer to QED radiative potnential. May be nullptr.

◆ Sigma()

const MBPT::CorrelationPotential * Wavefunction::Sigma ( ) const
inline

Returns ptr to (const) Correlation Potential, Sigma.

◆ Ncore()

int Wavefunction::Ncore ( ) const

Number of electrons in the core.

◆ getState() [1/2]

const DiracSpinor * Wavefunction::getState ( int  n,
int  k 
) const

Finds requested state; returns nullptr if not found.

is_valence is optional out-parameter; tells you where orb was found

◆ getState() [2/2]

const DiracSpinor * Wavefunction::getState ( std::string_view  state) const

As above, but takes 'short symbol' (e.g., 6s+, 6p-)

◆ FermiLevel()

double Wavefunction::FermiLevel ( ) const

Returns energy location of the "Fermi Level", - energy half way between core/valence. Defined: 0.5*( max(e_core) + min(e_valence)). Should be -ve.

◆ energy_gap()

double Wavefunction::energy_gap ( ) const

Energy gap between lowest valence + highest core state: e(v) - e(c) [should be positive].

◆ coreConfiguration()

std::string Wavefunction::coreConfiguration ( ) const
inline

Returns full core configuration.

◆ coreConfiguration_nice()

std::string Wavefunction::coreConfiguration_nice ( ) const
inline

Returns core configuration, in nice output notation.

◆ atom()

std::string Wavefunction::atom ( ) const
inline

String of atom info (e.g., "Cs, Z=55, A=133")

◆ atomicSymbol()

std::string Wavefunction::atomicSymbol ( ) const
inline

e.g., "Cs"

◆ identity()

std::string Wavefunction::identity ( ) const

Atomic symbol, including core ionisation degree and run_label.

◆ run_label()

const std::string & Wavefunction::run_label ( ) const
inline

Atomic symbol, including core ionisation degree and run_label.

◆ ion_degree()

int Wavefunction::ion_degree ( int  num_val) const
inline

0 for neutral, 1 for singly-ionised etc.

◆ ion_symbol()

std::string Wavefunction::ion_symbol ( int  num_val) const
inline

I for neutral, II for singly-ionised etc.

◆ Zion()

int Wavefunction::Zion ( ) const
inline

Effective charge (for core) = Z-N_core.

◆ printCore()

void Wavefunction::printCore ( ) const

Prints table of core orbitals + energies etc.

◆ printValence()

void Wavefunction::printValence ( const std::vector< DiracSpinor > &  tmp_orbitals = {}) const

Prints table of valence orbitals + energies etc.

Can optionally give it any list of orbitals to print

◆ printBasis()

void Wavefunction::printBasis ( const std::vector< DiracSpinor > &  the_basis) const

Prints table of Basis/Spectrum orbitals, compares to HF orbitals.

◆ isInCore()

bool Wavefunction::isInCore ( int  n,
int  k 
) const

Check if a state is in the core (or valence) list.

◆ coreDensity()

std::vector< double > Wavefunction::coreDensity ( ) const

Calculates rho(r) = sum_c psi^2(r) for core states, c={n,k,m}.

◆ coreEnergyHF()

double Wavefunction::coreEnergyHF ( ) const

Calculates HF core energy (doesn't include magnetic QED?)

◆ set_HF()

void Wavefunction::set_HF ( const std::string &  method = "HartreeFock",
const double  x_Breit = 0.0,
const std::string &  in_core = "",
double  eps_HF = 1.0e-13,
bool  print = true 
)

Initialises HF object and populates core orbitals (does not solve HF equations)

◆ solve_core() [1/2]

void Wavefunction::solve_core ( bool  print = true)

Performs hartree-Fock procedure for core.

◆ solve_core() [2/2]

void Wavefunction::solve_core ( const std::string &  method,
const double  x_Breit = 0.0,
const std::string &  in_core = "",
double  eps_HF = 1.0e-13,
bool  print = true 
)

This version will first set_HF(), then solve_core()

◆ solve_valence()

void Wavefunction::solve_valence ( const std::string &  in_valence_str = "",
const bool  print = true 
)

Performs hartree-Fock procedure for valence: note: poplulates valnece.

◆ solve_exotic()

void Wavefunction::solve_exotic ( const std::string &  in_exotic_str,
double  mass = PhysConst::m_muon,
bool  print = true 
)

Solves for exotic atoms (e.g., muonic), including screening. Resulting states are included in valence; the screening also updates core.

Note: The exotic states are just added to the valence list, so they can be used more simply with all the modules. However, be careful; for example, RPA will now be meaningless!

◆ hartreeFockBrueckner()

void Wavefunction::hartreeFockBrueckner ( const bool  print = true)

Forms Bruckner valence orbitals: (H_hf + Sigma)|nk> = e|nk>. Replaces existing valence states.

◆ fitSigma_hfBrueckner()

void Wavefunction::fitSigma_hfBrueckner ( const std::string &  valence_list,
const std::vector< double > &  fit_energies 
)

First, fits Sigma to energies, then forms fitted Brueckner orbitals.

◆ radiativePotential() [1/2]

void Wavefunction::radiativePotential ( QED::RadPot::Scale  s,
double  rcut,
double  scale_rN,
const std::vector< double > &  x_spd,
bool  do_readwrite = true,
bool  print = true 
)

OLD: deprecated.

◆ radiativePotential() [2/2]

void Wavefunction::radiativePotential ( const IO::InputBlock qed_input,
bool  do_readwrite,
bool  print 
)

Calculates radiative potential, adds to HF potential.

◆ formBasis()

void Wavefunction::formBasis ( const SplineBasis::Parameters &  params)

Calculates + populates basis [see BSplineBasis].

◆ formSpectrum()

void Wavefunction::formSpectrum ( const SplineBasis::Parameters &  params)

Calculates + populates Spectrum [see BSplineBasis].

◆ formSigma()

void Wavefunction::formSigma ( int  nmin_core = 1,
double  r0 = 1.0e-4,
double  rmax = 30.0,
int  stride = 4,
bool  each_valence = false,
bool  include_G = false,
bool  include_Breit = false,
int  n_max_breit = 0,
const std::vector< double > &  lambdas = {},
const std::vector< double > &  fk = {},
const std::vector< double > &  etak = {},
bool  read_write = true,
const std::string &  fname = "",
bool  FeynmanQ = false,
bool  ScreeningQ = false,
bool  hole_particleQ = false,
int  lmax = 6,
double  omre = -0.2,
double  w0 = 0.01,
double  wratio = 1.5,
const std::optional< IO::InputBlock > &  ek = std::nullopt 
)

Forms + stores correlation potential Sigma.

◆ update_Vnuc()

void Wavefunction::update_Vnuc ( const std::vector< double > &  v_new)
inline

Allows extra potential to be added to Vnuc (updates both in Wavefunction.

nb: two versions of Vnuc...

◆ lminmax_core_range()

std::tuple< double, double > Wavefunction::lminmax_core_range ( int  l,
double  eps = 0.0 
) const

Returns [min,max] r values for which the core density (given l) is larger than cutoff (= eps*max_value)

Returns the r values (au) for which the value of rho = \sum|psi^2|(r) drops below cutoff. Sum goes over all m for given l. Cut-off defined as eps*max, where max is maximum value for rho(r). Set l<0 to get for all l (entire core)

◆ H0ab() [1/2]

double Wavefunction::H0ab ( const DiracSpinor Fa,
const DiracSpinor Fb 
) const

Returns <a|H|b> for Hamiltonian H (inludes Rad.pot, NOT sigma, Breit, or exchange!)

◆ H0ab() [2/2]

double Wavefunction::H0ab ( const DiracSpinor Fa,
const DiracSpinor dFa,
const DiracSpinor Fb,
const DiracSpinor dFb 
) const

Returns <a|H|b> for Hamiltonian H (inludes Rad.pot, NOT sigma, Breit, or exchange!)

◆ ConfigurationInteraction()

void Wavefunction::ConfigurationInteraction ( const IO::InputBlock input)

Runs the CI+MBPT routines; stores wavefunctions.

◆ output_to_json()

nlohmann::json Wavefunction::output_to_json ( const std::string &  out_name = "ampsci_output.json")

Writes wavefunction information to json file; if out_name given, will print to that file.


The documentation for this class was generated from the following files: