ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
math_sphbes.h
Go to the documentation of this file.
1#ifndef MATH_SPHBES_H
2#define MATH_SPHBES_H
3
4#include <functional>
5
6//========================================================
7// Spherical Bessel functions, mohan 2021-05-06
8//========================================================
9namespace ModuleBase
10{
11
12class Sphbes
13{
14 public:
15
16 Sphbes();
17 ~Sphbes();
18
28 static void Spherical_Bessel
29 (
30 const int &msh,
31 const double *r,
32 const double &q,
33 const int &l,
34 double *jl
35 );
36
46 static void dSpherical_Bessel_dx
47 (
48 const int &msh,
49 const double *r,
50 const double &q,
51 const int &l,
52 double *jl
53 );
54
65 static void Spherical_Bessel
66 (
67 const int &msh,
68 const double *r,
69 const double &q,
70 const int &l,
71 double *sj,
72 double *sjp
73 );
74
84 static void Spherical_Bessel_Roots
85 (
86 const int &num,
87 const int &l,
88 const double &epsilon,
89 double* eigenvalue,
90 const double &rcut
91 );
92
94
98 static double sphbesj(const int l,
99 const double x
100 );
101
103 static double dsphbesj(const int l,
104 const double x
105 );
106
108 static void sphbesj(const int n,
109 const double* const r,
110 const double q,
111 const int l,
112 double* const jl
113 );
114
116 static void dsphbesj(const int n,
117 const double* const r,
118 const double q,
119 const int l,
120 double* const djl
121 );
122
137 static void sphbes_zeros(const int l,
138 const int n,
139 double* const zeros,
140 bool return_all = false
141 );
142
143private:
144
145 static double Spherical_Bessel_7(const int n, const double &x);
146
147 // Peize Lin change double to void 2019-05-01
148 static void BESSJY(double x, double xnu, double *rj, double *ry, double *rjp, double *ryp);
149
150 static void BESCHB(double x, double *gam1, double *gam2, double *gampl, double *gammi);
151
152 static double CHEBEV(double a, double b, double c[], int m, double x);
153
154 static int IMAX(int a, int b);
155
156 // utility functions for sphbesj
157 static double _sphbesj_ascending_recurrence(int l, double x);
158 static double _sphbesj_series(int l, double x);
159
160 // Regula falsi with Illinois anti-stalling variation
161 static double illinois(std::function<double(double)> func,
162 double x0,
163 double x1,
164 const double tol = 1e-12,
165 const int max_iter = 50);
166};
167
168}
169
170#endif
Definition math_sphbes.h:13
static void Spherical_Bessel(const int &msh, const double *r, const double &q, const int &l, double *jl)
spherical bessel jl(qr)
Definition math_sphbes.cpp:435
static double _sphbesj_ascending_recurrence(int l, double x)
Definition math_sphbes.cpp:699
static double illinois(std::function< double(double)> func, double x0, double x1, const double tol=1e-12, const int max_iter=50)
Definition math_sphbes.cpp:887
Sphbes()
Definition math_sphbes.cpp:11
static void BESCHB(double x, double *gam1, double *gam2, double *gampl, double *gammi)
Definition math_sphbes.cpp:265
static double sphbesj(const int l, const double x)
spherical Bessel function of the first kind
Definition math_sphbes.cpp:745
~Sphbes()
Definition math_sphbes.cpp:12
static int IMAX(int a, int b)
Definition math_sphbes.cpp:258
static double dsphbesj(const int l, const double x)
derivative of spherical Bessel function
Definition math_sphbes.cpp:790
static void Spherical_Bessel_Roots(const int &num, const int &l, const double &epsilon, double *eigenvalue, const double &rcut)
return num eigenvalues of spherical bessel function
Definition math_sphbes.cpp:342
static void sphbes_zeros(const int l, const int n, double *const zeros, bool return_all=false)
Zeros of spherical Bessel functions.
Definition math_sphbes.cpp:821
static double _sphbesj_series(int l, double x)
Definition math_sphbes.cpp:717
static double Spherical_Bessel_7(const int n, const double &x)
Definition math_sphbes.cpp:312
static double CHEBEV(double a, double b, double c[], int m, double x)
Definition math_sphbes.cpp:285
static void dSpherical_Bessel_dx(const int &msh, const double *r, const double &q, const int &l, double *jl)
derivative of spherical bessel djl(qr)/d(qr)
Definition math_sphbes.cpp:641
static void BESSJY(double x, double xnu, double *rj, double *ry, double *rjp, double *ryp)
Definition math_sphbes.cpp:14
Definition array_pool.h:6
void zeros(std::complex< T > *u, int n)
set elements of u as zero which u is 1_d std::complex array
Definition complexarray.h:141
double func(const Vec3 &r, const std::vector< Vec3 > &R, const std::vector< double > &a, const std::vector< double > &n)
Definition test_partition.cpp:50