|
ampsci
High-precision calculations for one- and two-valence atomic systems
|
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 Grid & | grid () const |
| Returns a const reference to the radial grid. | |
| std::shared_ptr< const Grid > | grid_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::Nucleus & | nucleus () 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::PsiJPi * | CIwf (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::HartreeFock * | vHF () const |
| Returns ptr to Hartree Fock (class) | |
| HF::HartreeFock * | vHF () |
| 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::RadPot * | vrad () const |
| Pointer to QED radiative potnential. May be nullptr. | |
| QED::RadPot * | vrad () |
| 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 DiracSpinor * | getState (int n, int k) const |
| Finds requested state; returns nullptr if not found. | |
| const DiracSpinor * | getState (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 ¶ms) |
| Calculates + populates basis [see BSplineBasis]. | |
| void | formSpectrum (const SplineBasis::Parameters ¶ms) |
| 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. | |
Stores Wavefunction (set of valence orbitals, grid, HF etc.)
| 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::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.
|
inline |
Returns a const reference to the radial grid.
|
inline |
Copy of shared_ptr to grid [shared resource] - used when we want to construct a new object that shares this grid.
|
inline |
Local value of fine-structure constant.
|
inline |
Variation in alpha^2 : x = (alpha/alpha_0)^2 - 1.
|
inline |
Returns Nuclear::nucleus object (contains nuc. parameters)
|
inline |
Nuclear charge, Z.
|
inline |
Nuclear mass number, A.
|
inline |
Nuclear rms charge radii, in fm (femptometres)
|
inline |
Core orbitals (frozen HF core)
|
inline |
Valence orbitals (HF or Brueckner orbitals)
|
inline |
Basis, eigenstates of HF potential. Used for MBPT. Includes Breit and QED (if they are included), but not correlations.
|
inline |
Sprectrum: like basis, but includes correlations.
|
inline |
Nuclear potential. Only provide const version, since HF and WF version of vnuc must be kept in sync.
|
inline |
Returns ptr to Hartree Fock (class)
| 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.
| 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.
|
inline |
Pointer to QED radiative potnential. May be nullptr.
|
inline |
Returns ptr to (const) Correlation Potential, Sigma.
| int Wavefunction::Ncore | ( | ) | const |
Number of electrons in the core.
| 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
| const DiracSpinor * Wavefunction::getState | ( | std::string_view | state | ) | const |
As above, but takes 'short symbol' (e.g., 6s+, 6p-)
| 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.
| double Wavefunction::energy_gap | ( | ) | const |
Energy gap between lowest valence + highest core state: e(v) - e(c) [should be positive].
|
inline |
Returns full core configuration.
|
inline |
Returns core configuration, in nice output notation.
|
inline |
String of atom info (e.g., "Cs, Z=55, A=133")
|
inline |
e.g., "Cs"
| std::string Wavefunction::identity | ( | ) | const |
Atomic symbol, including core ionisation degree and run_label.
|
inline |
Atomic symbol, including core ionisation degree and run_label.
|
inline |
0 for neutral, 1 for singly-ionised etc.
|
inline |
I for neutral, II for singly-ionised etc.
|
inline |
Effective charge (for core) = Z-N_core.
| void Wavefunction::printCore | ( | ) | const |
Prints table of core orbitals + energies etc.
| 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
| void Wavefunction::printBasis | ( | const std::vector< DiracSpinor > & | the_basis | ) | const |
Prints table of Basis/Spectrum orbitals, compares to HF orbitals.
| bool Wavefunction::isInCore | ( | int | n, |
| int | k | ||
| ) | const |
Check if a state is in the core (or valence) list.
| std::vector< double > Wavefunction::coreDensity | ( | ) | const |
Calculates rho(r) = sum_c psi^2(r) for core states, c={n,k,m}.
| double Wavefunction::coreEnergyHF | ( | ) | const |
Calculates HF core energy (doesn't include magnetic QED?)
| 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)
| void Wavefunction::solve_core | ( | bool | print = true | ) |
Performs hartree-Fock procedure for core.
| 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()
| void Wavefunction::solve_valence | ( | const std::string & | in_valence_str = "", |
| const bool | print = true |
||
| ) |
Performs hartree-Fock procedure for valence: note: poplulates valnece.
| 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!
| void Wavefunction::hartreeFockBrueckner | ( | const bool | print = true | ) |
Forms Bruckner valence orbitals: (H_hf + Sigma)|nk> = e|nk>. Replaces existing valence states.
| 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.
| 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.
| void Wavefunction::radiativePotential | ( | const IO::InputBlock & | qed_input, |
| bool | do_readwrite, | ||
| bool | |||
| ) |
Calculates radiative potential, adds to HF potential.
| void Wavefunction::formBasis | ( | const SplineBasis::Parameters & | params | ) |
Calculates + populates basis [see BSplineBasis].
| void Wavefunction::formSpectrum | ( | const SplineBasis::Parameters & | params | ) |
Calculates + populates Spectrum [see BSplineBasis].
| 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.
|
inline |
Allows extra potential to be added to Vnuc (updates both in Wavefunction.
nb: two versions of Vnuc...
| 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)
| 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!)
| 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!)
| void Wavefunction::ConfigurationInteraction | ( | const IO::InputBlock & | input | ) |
Runs the CI+MBPT routines; stores wavefunctions.
| 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.