3 #include "HF/HartreeFock.hpp"
4 #include "MBPT/CorrelationPotential.hpp"
5 #include "Maths/Grid.hpp"
6 #include "Physics/AtomData.hpp"
7 #include "Physics/NuclearPotentials.hpp"
8 #include "Physics/PhysConst_constants.hpp"
9 #include "Physics/RadPot.hpp"
10 #include "Wavefunction/BSplineBasis.hpp"
11 #include "Wavefunction/DiracSpinor.hpp"
44 const std::string &run_label =
"");
48 const std::string &run_label =
"");
54 std::shared_ptr<const Grid> rgrid;
57 std::string m_run_label;
61 std::vector<DiracSpinor> m_valence{};
62 std::vector<DiracSpinor> m_hf_valence{};
64 std::vector<DiracSpinor> m_basis{};
66 std::vector<DiracSpinor> m_spectrum{};
68 std::vector<double> m_vnuc{};
70 std::optional<HF::HartreeFock> m_HF{std::nullopt};
72 std::optional<MBPT::CorrelationPotential> m_Sigma{};
74 std::string m_core_string =
"";
75 std::string m_aboveFermi_core_string =
"";
77 std::vector<CI::PsiJPi> m_CIwfs{};
84 std::shared_ptr<const Grid>
grid_sptr()
const {
return rgrid; };
87 double alpha()
const {
return m_alpha; }
92 return (m_alpha * m_alpha / PhysConst::alpha2) - 1.0;
98 int Znuc()
const {
return m_nucleus.z(); }
100 int Anuc()
const {
return m_nucleus.a(); }
102 double get_rrms()
const {
return m_nucleus.r_rms(); }
105 const std::vector<DiracSpinor> &
core()
const {
106 static const auto empty = std::vector<DiracSpinor>{};
107 return m_HF ? m_HF->core() : empty;
111 const std::vector<DiracSpinor> &
valence()
const {
return m_valence; }
112 std::vector<DiracSpinor> &
valence() {
return m_valence; }
114 const std::vector<DiracSpinor> &hf_valence()
const {
return m_hf_valence; }
118 const std::vector<DiracSpinor> &
basis()
const {
return m_basis; }
119 std::vector<DiracSpinor> &
basis() {
return m_basis; }
122 const std::vector<DiracSpinor> &
spectrum()
const {
return m_spectrum; }
123 std::vector<DiracSpinor> &
spectrum() {
return m_spectrum; }
125 const std::vector<CI::PsiJPi> &CIwfs()
const {
return m_CIwfs; }
127 const CI::PsiJPi *CIwf(
int J,
int parity)
const {
128 for (
const auto &ci_wf : m_CIwfs) {
129 if (ci_wf.twoJ() == 2 * J && ci_wf.parity() == parity)
137 const std::vector<double> &
vnuc()
const {
return m_vnuc; }
145 std::vector<double>
vlocal(
int l = 0)
const;
149 std::vector<double>
Hmag(
int l = 0)
const;
156 const MBPT::CorrelationPotential *
Sigma()
const {
157 return m_Sigma ? &*m_Sigma :
nullptr;
159 MBPT::CorrelationPotential *
Sigma() {
return m_Sigma ? &*m_Sigma :
nullptr; }
191 ", Z=" + std::to_string(m_nucleus.z()) +
192 " A=" + std::to_string(m_nucleus.a());
218 void printValence(
const std::vector<DiracSpinor> &tmp_orbitals = {})
const;
221 void printBasis(
const std::vector<DiracSpinor> &the_basis)
const;
225 bool isInValence(
int n,
int k)
const;
237 void set_HF(
const std::string &method =
"HartreeFock",
238 const double x_Breit = 0.0,
const std::string &in_core =
"",
239 double eps_HF = 1.0e-13,
bool print =
true);
245 void solve_core(
const std::string &method,
const double x_Breit = 0.0,
246 const std::string &in_core =
"",
double eps_HF = 1.0e-13,
251 const bool print =
true);
259 const std::vector<double> &fit_energies);
263 const std::vector<double> &x_spd,
264 bool do_readwrite =
true,
bool print =
true);
271 void formBasis(
const SplineBasis::Parameters ¶ms);
274 void formSpectrum(
const SplineBasis::Parameters ¶ms);
277 void formSigma(
int nmin_core = 1,
int nmin_core_F = 1,
double r0 = 1.0e-4,
278 double rmax = 30.0,
int stride = 4,
bool each_valence =
false,
279 bool include_G =
false,
bool include_Breit =
false,
280 int n_max_breit = 0,
const std::vector<double> &lambdas = {},
281 const std::vector<double> &fk = {},
282 const std::vector<double> &etak = {},
283 const std::string &in_fname =
"",
284 const std::string &out_fname =
"",
bool FeynmanQ =
false,
285 bool ScreeningQ =
false,
bool holeParticleQ =
false,
286 int lmax = 6,
double omre = -0.2,
double w0 = 0.01,
288 const std::optional<IO::InputBlock> &ek = std::nullopt);
292 void copySigma(
const MBPT::CorrelationPotential *
const Sigma) {
293 if (
Sigma !=
nullptr)
303 m_HF->vnuc() = v_new;
326 double H0ab_impl(
const DiracSpinor &Fa, std::vector<double> dga,
327 const DiracSpinor &Fb, std::vector<double> dgb)
const;
330 std::vector<DiracSpinor> determineCore(
const std::string &str_core_in);
331 bool isInAboveFermiCore(
int n,
int k)
const;
Stores the CI Solutions for given J and parity (only two-electron).
Definition: CSF.hpp:62
Stores radial Dirac spinor: F_nk = (f, g)
Definition: DiracSpinor.hpp:41
Holds grid, including type + Jacobian (dr/du)
Definition: Grid.hpp:31
Solves relativistic Hartree-Fock equations for core and valence. Optionally includes Breit and QED ef...
Definition: HartreeFock.hpp:70
Stores set of nuclear parameters (all radii in fm)
Definition: NuclearPotentials.hpp:20
Class holds Flambaum-Ginges QED Radiative Potential.
Definition: RadPot.hpp:15
Stores Wavefunction (set of valence orbitals, grid, HF etc.)
Definition: Wavefunction.hpp:36
void fitSigma_hfBrueckner(const std::string &valence_list, const std::vector< double > &fit_energies)
First, fits Sigma to energies, then forms fitted Brueckner orbitals.
Definition: Wavefunction.cpp:615
void solve_valence(const std::string &in_valence_str="", const bool print=true)
Performs hartree-Fock procedure for valence: note: poplulates valnece.
Definition: Wavefunction.cpp:185
void formBasis(const SplineBasis::Parameters ¶ms)
Calculates + populates basis [see BSplineBasis].
Definition: Wavefunction.cpp:468
void solve_core(bool print=true)
Performs hartree-Fock procedure for core.
Definition: Wavefunction.cpp:164
void printValence(const std::vector< DiracSpinor > &tmp_orbitals={}) const
Prints table of valence orbitals + energies etc.
Definition: Wavefunction.cpp:407
const std::vector< double > & vnuc() const
Nuclear potential. Only provide const version, since HF and WF version of vnuc must be kept in sync.
Definition: Wavefunction.hpp:137
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 share...
Definition: Wavefunction.hpp:84
double coreEnergyHF() const
Calculates HF core energy (doesn't include magnetic QED?)
Definition: Wavefunction.cpp:177
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_valu...
Definition: Wavefunction.cpp:349
const DiracSpinor * getState(int n, int k) const
Finds requested state; returns nullptr if not found.
Definition: Wavefunction.cpp:290
int Znuc() const
Nuclear charge, Z.
Definition: Wavefunction.hpp:98
double energy_gap() const
Energy gap between lowest valence + highest core state: e(v) - e(c) [should be positive].
Definition: Wavefunction.cpp:336
const std::vector< DiracSpinor > & spectrum() const
Sprectrum: like basis, but includes correlations.
Definition: Wavefunction.hpp:122
const std::vector< DiracSpinor > & valence() const
Valence orbitals (HF or Brueckner orbitals)
Definition: Wavefunction.hpp:111
std::string identity() const
Atomic symbol, including core ionisation degree and run_label.
Definition: Wavefunction.cpp:687
std::string coreConfiguration() const
Returns full core configuration.
Definition: Wavefunction.hpp:181
int Zion() const
Effective charge (for core) = Z-N_core.
Definition: Wavefunction.hpp:212
std::vector< double > vlocal(int l=0) const
Local part of potential, e.g., Vl = Vnuc + Vdir + Vrad_el(l) - can be l-dependent....
Definition: Wavefunction.cpp:668
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....
Definition: Wavefunction.cpp:673
std::vector< double > coreDensity() const
Calculates rho(r) = sum_c psi^2(r) for core states, c={n,k,m}.
Definition: Wavefunction.cpp:456
int ion_degree(int num_val) const
0 for neutral, 1 for singly-ionised etc.
Definition: Wavefunction.hpp:204
int Anuc() const
Nuclear mass number, A.
Definition: Wavefunction.hpp:100
const Grid & grid() const
Returns a const reference to the radial grid.
Definition: Wavefunction.hpp:81
std::string atomicSymbol() const
e.g., "Cs"
Definition: Wavefunction.hpp:196
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.
Definition: Wavefunction.cpp:220
std::string ion_symbol(int num_val) const
I for neutral, II for singly-ionised etc.
Definition: Wavefunction.hpp:207
double get_rrms() const
Nuclear rms charge radii, in fm (femptometres)
Definition: Wavefunction.hpp:102
const std::vector< DiracSpinor > & basis() const
Basis, eigenstates of HF potential. Used for MBPT. Includes Breit and QED (if they are included),...
Definition: Wavefunction.hpp:118
std::string coreConfiguration_nice() const
Returns core configuration, in nice output notation.
Definition: Wavefunction.hpp:184
void formSpectrum(const SplineBasis::Parameters ¶ms)
Calculates + populates Spectrum [see BSplineBasis].
Definition: Wavefunction.cpp:487
void formSigma(int nmin_core=1, int nmin_core_F=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={}, const std::string &in_fname="", const std::string &out_fname="", bool FeynmanQ=false, bool ScreeningQ=false, bool holeParticleQ=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.
Definition: Wavefunction.cpp:507
const QED::RadPot * vrad() const
Pointer to QED radiative potnential. May be nullptr.
Definition: Wavefunction.hpp:152
void printCore() const
Prints table of core orbitals + energies etc.
Definition: Wavefunction.cpp:375
bool isInCore(int n, int k) const
Check if a state is in the core (or valence) list.
Definition: Wavefunction.cpp:261
std::string atom() const
String of atom info (e.g., "Cs, Z=55, A=133")
Definition: Wavefunction.hpp:189
const std::vector< DiracSpinor > & core() const
Core orbitals (frozen HF core)
Definition: Wavefunction.hpp:105
double alpha() const
Local value of fine-structure constant.
Definition: Wavefunction.hpp:87
double H0ab(const DiracSpinor &Fa, const DiracSpinor &Fb) const
Returns <a|H|b> for Hamiltonian H (inludes Rad.pot, NOT sigma, Breit, or exchange!...
Definition: Wavefunction.cpp:718
const Nuclear::Nucleus & nucleus() const
Returns Nuclear::nucleus object (contains nuc. parameters)
Definition: Wavefunction.hpp:96
void update_Vnuc(const std::vector< double > &v_new)
Allows extra potential to be added to Vnuc (updates both in Wavefunction.
Definition: Wavefunction.hpp:299
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)
Definition: Wavefunction.cpp:122
const MBPT::CorrelationPotential * Sigma() const
Returns ptr to (const) Correlation Potential, Sigma.
Definition: Wavefunction.hpp:156
void hartreeFockBrueckner(const bool print=true)
Forms Bruckner valence orbitals: (H_hf + Sigma)|nk> = e|nk>. Replaces existing valence states.
Definition: Wavefunction.cpp:605
int Ncore() const
Number of electrons in the core.
Definition: Wavefunction.cpp:679
double FermiLevel() const
Returns energy location of the "Fermi Level", - energy half way between core/valence....
Definition: Wavefunction.cpp:317
void printBasis(const std::vector< DiracSpinor > &the_basis) const
Prints table of Basis/Spectrum orbitals, compares to HF orbitals.
Definition: Wavefunction.cpp:433
const HF::HartreeFock * vHF() const
Returns ptr to Hartree Fock (class)
Definition: Wavefunction.hpp:140
double dalpha2() const
Variation in alpha^2 : x = (alpha/alpha_0)^2 - 1.
Definition: Wavefunction.hpp:90
std::string niceCoreOutput(const std::string &full_core)
Given a full electron config., returns nicer format by recognising nobel gas.
Definition: AtomData.cpp:198
std::string atomicSymbol(int Z)
e.g., 55 -> "Cs"
Definition: AtomData.cpp:64
Constucts of spinor/orbital basis using B-splines (DKB/Reno/Derevianko-Beloy method)
Definition: BSplineBasis.cpp:20
std::string int_to_roman(int a)
Converts integer, a, to Roman Numerals. Assumed that |a|<=4000.
Definition: String.hpp:282
Parmaters used to create Grid.
Definition: Grid.hpp:9
Scale factors for Uehling, high, low, magnetic, Wickman-Kroll.
Definition: RadPot.hpp:20