Esempio n. 1
0
 def test_value0( self):
     k  = np.sqrt( 0.00)
     m  = mp.mfrom( k = k)
     K  = mp.ellipk( m)
     Kp = mp.ellipk( 1 - m)
     self.assertAlmostEqual( 0.00, m)
     self.assertAlmostEqual( mp.mpf( 1.570796326794), K)
     self.assertEqual( mp.mpf( '+inf'), Kp)
Esempio n. 2
0
 def test_value5( self):
     k  = np.sqrt( 0.99)
     m  = mp.mfrom( k = k)
     K  = mp.ellipk( m)
     Kp = mp.ellipk( 1 - m)
     self.assertEqual( 0.99, m)
     self.assertAlmostEqual( mp.mpf( 3.695637362989), K)
     self.assertAlmostEqual( mp.mpf( 1.574745561317), Kp)
Esempio n. 3
0
 def test_value4( self):
     k  = np.sqrt( 0.90)
     m  = mp.mfrom( k = k)
     K  = mp.ellipk( m)
     Kp = mp.ellipk( 1 - m)
     self.assertAlmostEqual( 0.90, m)
     self.assertAlmostEqual( mp.mpf( 2.578092113348), K)
     self.assertAlmostEqual( mp.mpf( 1.612441348720), Kp)
Esempio n. 4
0
 def test_value3( self):
     k  = np.sqrt( 0.50)
     m  = mp.mfrom( k = k)
     K  = mp.ellipk( m)
     Kp = mp.ellipk( 1 - m)
     self.assertAlmostEqual( 0.50, m)
     self.assertAlmostEqual( mp.mpf( 1.854074677301), K)
     self.assertAlmostEqual( mp.mpf( 1.854074677301), Kp)
Esempio n. 5
0
def calc_abel(k, zeta, eta):
    k1 = sqrt(1-k**2)

    a=k1+complex(0, 1)*k

    b=k1-complex(0, 1)*k

    abel_tmp = map(lambda zetai : \
                       complex(0, 1) * 1/(complex64(ellipk(k**2))*2*b) \
                       * complex64(ellipf( asin( (zetai )/a), mfrom(k=a/b))) \
                       - taufrom(k=k)/2,
                   zeta)

    abel = []
    for i in range(0, 4, 1):
        abel.append(abel_select(k, abel_tmp[i], eta[i]))

    return abel
Esempio n. 6
0
def calc_abel(k, zeta, eta):
    k1 = sqrt(1 - k**2)

    a = k1 + complex(0, 1) * k

    b = k1 - complex(0, 1) * k

    abel_tmp = map(lambda zetai : \
                       complex(0, 1) * 1/(complex64(ellipk(k**2))*2*b) \
                       * complex64(ellipf( asin( (zetai )/a), mfrom(k=a/b))) \
                       - taufrom(k=k)/2,
                   zeta)

    abel = []
    for i in range(0, 4, 1):
        abel.append(abel_select(k, abel_tmp[i], eta[i]))

    return abel
Esempio n. 7
0
def test_on_line(k, x0, x1, y, z, partition_size):

    k1 = sqrt(1 - k**2)
    a = k1 + complex(0, 1) * k
    b = k1 - complex(0, 1) * k

    x_step = (x1 - x0) / partition_size

    for i in range(0, partition_size):
        x = x0 + i * x_step
        zeta = calc_zeta(k, x, y, z)
        eta = calc_eta(k, x, y, z)
        abel = calc_abel(k, zeta, eta)
        mu = calc_mu(k, x, y, z, zeta, abel)

        print "zeta/a", zeta[0] / a, zeta[1] / a, zeta[2] / a, zeta[3] / a, '\n'
        print "eta", eta[0], eta[1], eta[2], eta[3], '\n'
        print "abel", abel[0], abel[1], abel[2], abel[3], '\n'

        abel_tmp= map(lambda zetai : \
                complex(0, 1) * 1/(complex64(ellipk(k**2))*2*b) \
                * complex64(ellipf( asin( (zetai )/a), mfrom(k=a/b))) \
                - taufrom(k=k)/2,
                zeta)
        print "abel_tmp", abel_tmp[0], abel_tmp[1], abel_tmp[2], abel_tmp[
            3], '\n'

        print abel[0] + conj(abel[2]), abel[1] + conj(abel[3]), '\n'
        print -taufrom(k=k) / 2, '\n'
        for l in range(0, 4):
            tmp = abs(complex64(calc_eta_by_theta(k, abel[l])) - eta[l])
            print tmp

        value = higgs_squared(k, x, y, z)
        print "higgs", higgs_squared(k, x, y, z)
        if (value > 1.0 or value < 0.0):
            print "Exception"

        print '\n'
        # print mu[0]+mu[2], mu[1]+mu[3], '\n'

    return
Esempio n. 8
0
def test_on_line(k, x0, x1, y, z, partition_size):

    k1 = sqrt(1-k**2)
    a=k1+complex(0, 1)*k
    b=k1-complex(0, 1)*k

    x_step = (x1 - x0) / partition_size

    for i in range(0, partition_size):
        x=x0+i*x_step
        zeta = calc_zeta(k ,x, y, z)
        eta = calc_eta(k, x, y, z)
        abel = calc_abel(k, zeta, eta)
        mu = calc_mu(k, x, y, z, zeta, abel)

        print "zeta/a", zeta[0]/a, zeta[1]/a, zeta[2]/a, zeta[3]/a, '\n'
        print "eta", eta[0], eta[1], eta[2], eta[3], '\n'
        print "abel",  abel[0], abel[1],abel[2],abel[3],'\n'

        abel_tmp= map(lambda zetai : \
                complex(0, 1) * 1/(complex64(ellipk(k**2))*2*b) \
                * complex64(ellipf( asin( (zetai )/a), mfrom(k=a/b))) \
                - taufrom(k=k)/2,
                zeta)
        print "abel_tmp",  abel_tmp[0], abel_tmp[1],abel_tmp[2],abel_tmp[3],'\n'

        print  abel[0]+conj(abel[2]), abel[1]+conj(abel[3]), '\n'
        print - taufrom(k=k)/2, '\n'
        for l in range(0,4):
            tmp= abs(complex64(calc_eta_by_theta(k, abel[l])) - eta[l])
            print tmp

        value = higgs_squared(k, x, y, z)
        print "higgs", higgs_squared(k,x,y,z)
        if (value > 1.0 or value <0.0):
            print "Exception"

        print '\n'
        # print mu[0]+mu[2], mu[1]+mu[3], '\n'

    return