ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
hydrogen_radials.h
Go to the documentation of this file.
1#ifndef HYDROGEN_RADIALS_H_
2#define HYDROGEN_RADIALS_H_
3
6// include pair container
7#include <utility>
8// include map container
9#include <map>
10
11/*
12 Hydrogen-like radial functions generator
13
14 This class is a derived class of RadialSet, the key function to call is build().
15 With build(), the hydrogen-like radial functions will be generated and stored in data member NumericalRadials.
16 The workflow is like:
17
18 1. build() calls hydrogen() to start the hydrogen-like radial functions generation task.
19 2. hydrogen() calls generate_orb() to generate the radial functions for each n, l pair.
20 3. generate_orb() calls generate_hydrogen_radial_toconv() to generate the radial function for set of n, l pairs.
21 4. with more details, unzip_strategy() is called to parse the strategy string to get the n, l pairs.
22 5. for each n, l pair, generate_hydrogen_radial_toconv() is called to generate the radial function for a given n, l pair.
23 6. note that the "toconv" means each radial function should have a norm converged to 1 at a certain radius, this is
24 also controlled by a convergence threshold (conv_thr), now set to 1e-6. Therefore each radial function will have different
25 rmax.
26 7. if the norm of radial function is not converged to 1 at the given radius, the radius will be increased by dr, and the
27 radial function will be recalculated until the norm is converged to 1.
28 8. the radial function is calculated by generate_hydrogen_radial_segment(), which is a wrapper of assoc_laguerre_.
29 9. assoc_laguerre_ is a class that can calculate the radial function of hydrogen-like atom, with the help of associated
30 Laguerre polynomials.
31 10. the radial function is calculated from 0.0 to a radius where the norm of radial function is converged, and the radial
32 function is stored in a pair of vectors, first vector is the radial grid, second vector is the radial function.
33 11. after the first generation step, all radial functions are zero-padded to the same length, and stored in a map, with
34 the key being the n, l pair, and the value being the pair of vectors.
35 12. to store the radial functions, they must indiced by the l, zeta pairs, so mapping_nl_lzeta() is called to map the n, l
36 pairs to the l, zeta pairs.
37 13. finally, the radial functions are stored in NumericalRadials, with the key being the l, zeta pairs, and the value being
38 the pair of vectors.
39
40 User capable settings:
41 1. charge of the nucleus charge according to pseudopotential, it is also a rescale of radius. Higher charge result in smaller
42 radius.
43 2. generation strategy. minimal will only generate 1 orbital per angular momentum, double will generate 2 orbitals per angular
44 momentum, full will generate all orbitals per angular momentum up to nmax. Note: nmax is read from atom_database.
45 3. conv_thr, the convergence threshold of the norm of radial function, if not reached, will continue to increase the radius.
46 user use this to control the accuracy of radial function. Too large conv_thr will result in inaccurate spherical Bessel
47 transformation results (in FFT-two_center_integrator)
48*/
50{
51 public:
60 HydrogenRadials* clone() const { return new HydrogenRadials(*this); } // covariant return type
63
74 void build(const int itype = 0,
75 const double charge = 1.0,
76 const bool with_slater_screening = false,
77 const int nmax = 0,
78 const double rcut = 10.0,
79 const double dr = 0.01,
80 const double conv_thr = 1e-6,
81 const int rank = 0,
82 const std::string symbol = "",
83 const std::string strategy = "minimal-valence",
84 std::ofstream* ptr_log = nullptr
85 );
86
91 std::vector<std::pair<int, int>> unzip_strategy(const int nmax = 0,
92 const std::string strategy = "minimal-valence");
97 void smooth(std::vector<double>& rgrid,
98 std::vector<double>& rvalue,
99 const double sigma = 0.1);
110 double generate_hydrogen_radial_toconv(const double charge,
111 const bool with_slater_screening,
112 const int n,
113 const int l,
114 const double conv_thr,
115 const int rank,
116 std::vector<double>& rgrid,
117 std::vector<double>& rvalue,
118 std::ofstream* ptr_log = nullptr);
123 double radial_norm(const std::vector<double> rgrid,
124 const std::vector<double> rvalue);
125
133 std::map<std::pair<int, int>, std::pair<std::vector<double>, std::vector<double>>>
134 generate_orb(const double charge = 1.0,
135 const bool with_slater_screening = false,
136 const int nmax = 0,
137 const double dr = 0.01,
138 const double conv_thr = 1e-6,
139 const int rank = 0,
140 const std::string strategy = "minimal-valence",
141 std::ofstream* ptr_log = nullptr);
146 std::map<std::pair<int, int>, std::pair<int, int>>
147 mapping_nl_lzeta(const int nmax = 0,
148 const std::string strategy = "minimal-valence");
157 void hydrogen(const double charge = 1.0,
158 const bool with_slater_screening = false,
159 const int nmax = 0,
160 const double dr = 0.01,
161 const double conv_thr = 1e-6,
162 const int rank = 0,
163 const std::string strategy = "minimal-valence",
164 std::ofstream* ptr_log = nullptr);
170 double slater_screening(const std::string symbol,
171 const int n,
172 const int l);
173 private:
184 std::vector<double> generate_hydrogen_radial_segment(const double charge = 1.0,
185 const bool with_slater_screening = false,
186 const int n = 0,
187 const int l = 0,
188 const double rmin = 0.0,
189 const double rmax = 10.0,
190 const double dr = 0.01,
191 const int rank = 0,
192 std::ofstream* ptr_log = nullptr);
195};
196#endif // HYDROGEN_RADIALS_H_
Definition assoc_laguerre.h:8
Definition hydrogen_radials.h:50
std::vector< double > generate_hydrogen_radial_segment(const double charge=1.0, const bool with_slater_screening=false, const int n=0, const int l=0, const double rmin=0.0, const double rmax=10.0, const double dr=0.01, const int rank=0, std::ofstream *ptr_log=nullptr)
generate hydrogen-like radial functions for a given n, l, in a given range [rmin, rmax]
Definition hydrogen_radials.cpp:37
std::map< std::pair< int, int >, std::pair< int, int > > mapping_nl_lzeta(const int nmax=0, const std::string strategy="minimal-valence")
mapping the n, l pairs to the l, zeta pairs
Definition hydrogen_radials.cpp:349
double slater_screening(const std::string symbol, const int n, const int l)
return the Slater screening constant for calculating effective nuclear charge
Definition hydrogen_radials.cpp:413
void smooth(std::vector< double > &rgrid, std::vector< double > &rvalue, const double sigma=0.1)
smooth the radial function to avoid high frequency noise in FFT-spherical bessel transform
Definition hydrogen_radials.cpp:270
HydrogenRadials * clone() const
copy constructor
Definition hydrogen_radials.h:60
void build(const int itype=0, const double charge=1.0, const bool with_slater_screening=false, const int nmax=0, const double rcut=10.0, const double dr=0.01, const double conv_thr=1e-6, const int rank=0, const std::string symbol="", const std::string strategy="minimal-valence", std::ofstream *ptr_log=nullptr)
build the hydrogen-like radial functions and push into NumericalRadials
Definition hydrogen_radials.cpp:15
std::map< std::pair< int, int >, std::pair< std::vector< double >, std::vector< double > > > generate_orb(const double charge=1.0, const bool with_slater_screening=false, const int nmax=0, const double dr=0.01, const double conv_thr=1e-6, const int rank=0, const std::string strategy="minimal-valence", std::ofstream *ptr_log=nullptr)
generate set of hydrogen-like radial functions for a given charge, nmax, dr, rank,...
Definition hydrogen_radials.cpp:285
~HydrogenRadials()
destructor
Definition hydrogen_radials.h:62
HydrogenRadials & operator=(const HydrogenRadials &rhs)
overloaded assignment operator
Definition hydrogen_radials.cpp:9
double generate_hydrogen_radial_toconv(const double charge, const bool with_slater_screening, const int n, const int l, const double conv_thr, const int rank, std::vector< double > &rgrid, std::vector< double > &rvalue, std::ofstream *ptr_log=nullptr)
generate hydrogen-like radial functions for a given n, l, from 0.0 to a radius where the norm of radi...
Definition hydrogen_radials.cpp:98
double radial_norm(const std::vector< double > rgrid, const std::vector< double > rvalue)
returns the norm of the radial function
Definition hydrogen_radials.cpp:84
HydrogenRadials()
default constructor
Definition hydrogen_radials.h:53
void hydrogen(const double charge=1.0, const bool with_slater_screening=false, const int nmax=0, const double dr=0.01, const double conv_thr=1e-6, const int rank=0, const std::string strategy="minimal-valence", std::ofstream *ptr_log=nullptr)
kernel function of hydrogen-like radial functions
Definition hydrogen_radials.cpp:382
Assoc_Laguerre assoc_laguerre_
Associated Laguerre polynomials generator.
Definition hydrogen_radials.h:194
std::vector< std::pair< int, int > > unzip_strategy(const int nmax=0, const std::string strategy="minimal-valence")
parse the strategy string to get the n, l pairs
Definition hydrogen_radials.cpp:165
An abstract class representing the set of all numerical radial functions (of the same kind) from a si...
Definition radial_set.h:26
int itype() const
Definition radial_set.h:154
const std::string & symbol() const
Definition radial_set.h:153