5 #include <boost/math/special_functions/legendre.hpp> 26 std::complex <double> resVal(0, absm * phi);
27 resVal = std::exp(resVal);
29 double sqrtFactor = sqrt((2*m_L + 1) * std::tgamma(m_L - absm + 1) / (4 * M_PI * std::tgamma(m_L + absm + 1)));
30 resVal *= sqrtFactor * boost::math::legendre_p(m_L,absm,cos(theta));
34 resVal = std::conj(resVal);
45 if ((m_M == 0)||(m_L < 1))
46 return std::complex<double> (0.0,0.0);
48 int absm = std::abs(m_M);
49 std::complex<double> retval(0.0,(
double)(absm*phi));
50 retval = std::exp(retval);
52 double factor = sqrt(((
double)(2*m_L+1) / (4.0*M_PI)) * (std::tgamma(m_L - absm + 1) / std::tgamma(m_L + absm + 1)));
53 if ((absm%2 != 0)&&(m_M < 0))
58 return factor * retval;
63 int absm = std::abs(m_M);
64 std::complex<double> retval(0.0,(
double)(absm*phi));
65 retval = std::exp(retval);
66 retval *= std::complex<double> (0.0,absm);
68 double factor = std::sqrt(((
double)(2*m_L+1) / (4.0*M_PI)) * (std::tgamma(m_L - absm + 1) / std::tgamma(m_L + absm + 1))) *
69 boost::math::legendre_p (m_L,absm,cos(theta));
71 if ((absm%2 != 0)&&(m_M < 0))
74 return factor * retval;
79 if ((m_M == 0)||(m_L < 2))
80 return std::complex<double> (0.0,0.0);
82 int absm = std::abs(m_M);
83 std::complex<double> retval(0.0,(
double)(absm*phi));
84 retval = std::exp(retval);
86 double factor = std::sqrt(((
double)(2*m_L+1) / (4.0*M_PI)) * (std::tgamma(m_L - absm + 1) / std::tgamma(m_L + absm + 1)));
87 if ((absm%2 != 0)&&(m_M < 0))
93 return factor * retval;
98 double factor = - m_M * m_M;
100 return factor * this->
Value(theta,phi);
105 if ((m_M == 0)||(m_L < 1))
106 return std::complex<double> (0.0,0.0);
108 int absm = std::abs(m_M);
109 std::complex<double> retval(0.0,(
double)(absm*phi));
110 retval = std::exp(retval);
111 retval *= std::complex<double> (0.0,absm);
113 double factor = sqrt(((
double)(2*m_L+1) / (4.0*M_PI)) * (std::tgamma(m_L - absm + 1) / std::tgamma(m_L + absm + 1)));
114 if ((absm%2 != 0)&&(m_M < 0))
119 return factor * retval;
double legendre_second_derivative(int L, int M, double value)
std::complex< double > getThetaPhiDerivative(const double &theta, const double &phi)
std::complex< double > getPhiSecondDerivative(const double &theta, const double &phi)
std::complex< double > getPhiFirstDerivative(const double &theta, const double &phi)
std::complex< double > getThetaSecondDerivative(const double &theta, const double &phi)
std::complex< double > getThetaFirstDerivative(const double &theta, const double &phi)
double legendre_first_derivative(int L, int M, double value)
std::complex< double > Value(const double &theta, const double &phi)