Пример #1
0
 def test_jacobi(self):
     assert_mpmath_equal(sc.eval_jacobi,
                         _exception_to_nan(lambda a, b, c, x: mpmath.jacobi(a, b, c, x, **HYPERKW)),
                         [Arg(), Arg(), Arg(), Arg()])
     assert_mpmath_equal(lambda n, b, c, x: sc.eval_jacobi(int(n), b, c, x),
                         _exception_to_nan(lambda a, b, c, x: mpmath.jacobi(a, b, c, x, **HYPERKW)),
                         [IntArg(), Arg(), Arg(), Arg()])
Пример #2
0
 def test_jacobi(self):
     assert_mpmath_equal(
         sc.eval_jacobi,
         _exception_to_nan(
             lambda a, b, c, x: mpmath.jacobi(a, b, c, x, **HYPERKW)),
         [Arg(), Arg(), Arg(), Arg()])
     assert_mpmath_equal(
         lambda n, b, c, x: sc.eval_jacobi(int(n), b, c, x),
         _exception_to_nan(
             lambda a, b, c, x: mpmath.jacobi(a, b, c, x, **HYPERKW)),
         [IntArg(), Arg(), Arg(), Arg()])
Пример #3
0
def swaL(spin:int,m_ang:int,l_ang:int,x:float)->mp.mpf:
   al= mp.mpf(abs(m_ang-spin))
   be= mp.mpf(abs(m_ang+spin))
   assert((al+be)%2==0)
   n= mp.mpf(l_ang - (al+be)/2)

   if n<0:
      return mp.mpf(0)

   norm= mp.sqrt(
       (2*n+al+be+1)*mp.power(2,-al-be-1)
   *	mp.fdiv(mp.fac(n+al+be),mp.fac(n+al))
   *	mp.fdiv(mp.fac(n)      ,mp.fac(n+be))
   )
   norm*= mp.power(-1,max(m_ang,-spin))

   return norm*mp.power(1-x,al/2.)*mp.power(1+x,be/2.)*mp.jacobi(n,al,be,x)