예제 #1
0
 def testIdentity1(self):
     """eta(t) = 1/sqrt(3) * theta_2(pi/6, q(t/3))"""
     # eta at omega, a third root of unity
     omega = (-1 + mpmath.sqrt(3) * 1j) / 2
     eta3 = ecpp.dedekind(omega, 18)
     theta3 = mpmath.jtheta(2, mpmath.pi / 6, q(
         omega / 3)) / mpmath.sqrt(3)
     self.assertTrue(mpmath.almosteq(theta3, eta3), eta3 - theta3)
예제 #2
0
 def testIdentity2(self):
     """eta(t)**3 = theta_2(0,q(t))theta_3(0,q(t))theta_4(0,q(t))/2"""
     # eta at omega, a third root of unity
     omega = (-1 + mpmath.sqrt(3) * 1j) / 2
     eta3cubed = ecpp.dedekind(omega, 15)**3
     triple = (mpmath.jtheta(2, 0, q(omega)) *
               mpmath.jtheta(3, 0, q(omega)) *
               mpmath.jtheta(4, 0, q(omega)) / 2)
     self.assertTrue(mpmath.almosteq(triple, eta3cubed),
                     triple - eta3cubed)
예제 #3
0
 def testSpecialValue(self):
     # eta at i
     self.assertAlmostEqual(0.7682254, abs(ecpp.dedekind(1j, 10)))