예제 #1
0
파일: test_s04.py 프로젝트: daviddumas/cp1
def test_s04_compare_simp_adv():
    import cmath
    N = 20
    for i in range(N):
        t = float(i)/float(N-1)
        L = 0.3*(1.0-cmath.exp(2.0j*cmath.pi*(0.01 + 0.98*t)))
        C = 1.2+0.5j+cmath.exp(4.0j*cmath.pi*t)
        x1,y1,z1 = cp1.s04_lambda_hol(L,C,contours=3,tol=1e-8,
                                      fund_domain_contours=False)
        x2,y2,z2 = cp1.s04_lambda_hol(L,C,contours=3,tol=1e-8,
                                      fund_domain_contours=False)
        assert( abs(x1-x2) < TESTDELTA)
        assert( abs(y1-y2) < TESTDELTA)
        assert( abs(z1-z2) < TESTDELTA)
예제 #2
0
파일: test_s04.py 프로젝트: knut0815/cp1
def test_s04_compare_simp_adv():
    import cmath
    N = 20
    for i in range(N):
        t = float(i) / float(N - 1)
        L = 0.3 * (1.0 - cmath.exp(2.0j * cmath.pi * (0.01 + 0.98 * t)))
        C = 1.2 + 0.5j + cmath.exp(4.0j * cmath.pi * t)
        x1, y1, z1 = cp1.s04_lambda_hol(L,
                                        C,
                                        contours=3,
                                        tol=1e-8,
                                        fund_domain_contours=False)
        x2, y2, z2 = cp1.s04_lambda_hol(L,
                                        C,
                                        contours=3,
                                        tol=1e-8,
                                        fund_domain_contours=False)
        assert (abs(x1 - x2) < TESTDELTA)
        assert (abs(y1 - y2) < TESTDELTA)
        assert (abs(z1 - z2) < TESTDELTA)
예제 #3
0
파일: test_s04.py 프로젝트: daviddumas/cp1
def test_s04_hex(fund_domain_contours):
    L = 0.5 + 0.86602540378443864676j
    C = -0.57735026918962576451j
    xref = -7.0
    yref = -7.0
    zref = -7.0
    x,y,z = cp1.s04_lambda_hol(L,C,contours=3,tol=1e-8,
                               fund_domain_contours=fund_domain_contours)
    assert( abs(x-xref) < TESTDELTA)
    assert( abs(y-yref) < TESTDELTA)
    assert( abs(z-zref) < TESTDELTA)
예제 #4
0
파일: test_s04.py 프로젝트: daviddumas/cp1
def test_s04_extreme(fund_domain_contours):
    L = 0.00001 + 0.00001j
    C = 0.5 + 0.3j - L
    xref = 0.861380+5.348997j
    yref = -8013.211655-1721.651316j
    zref = 519.186599-1373.061159j
    x,y,z = cp1.s04_lambda_hol(L,C,contours=3,tol=1e-8,
                               fund_domain_contours=fund_domain_contours)
    assert( abs(x-xref) < TESTDELTA)
    assert( abs(y-yref) < TESTDELTA)
    assert( abs(z-zref) < TESTDELTA)
예제 #5
0
파일: test_s04.py 프로젝트: daviddumas/cp1
def test_s04_largeC(fund_domain_contours):
    L = 0.5 + 0.86602540378443864676j
    C = 2.0 + 3.0j - L
    xref = -222.533070-262.929905j
    yref = 1272.251270-2334.830978j
    zref = -2.848143-7.056932j
    x,y,z = cp1.s04_lambda_hol(L,C,contours=3,tol=1e-8,
                               fund_domain_contours=fund_domain_contours)
    assert( abs(x-xref) < TESTDELTA)
    assert( abs(y-yref) < TESTDELTA)
    assert( abs(z-zref) < TESTDELTA)
예제 #6
0
파일: test_s04.py 프로젝트: daviddumas/cp1
def test_s04_square(fund_domain_contours):
    L = 0.5
    C = 0.0
    xref = -6.0
    yref = -6.0
    zref = -14.0
    x,y,z = cp1.s04_lambda_hol(L,C,contours=3,tol=1e-8,
                               fund_domain_contours=fund_domain_contours)
    assert( abs(x-xref) < TESTDELTA)
    assert( abs(y-yref) < TESTDELTA)
    assert( abs(z-zref) < TESTDELTA)
예제 #7
0
파일: test_s04.py 프로젝트: knut0815/cp1
def test_s04_hex(fund_domain_contours):
    L = 0.5 + 0.86602540378443864676j
    C = -0.57735026918962576451j
    xref = -7.0
    yref = -7.0
    zref = -7.0
    x, y, z = cp1.s04_lambda_hol(L,
                                 C,
                                 contours=3,
                                 tol=1e-8,
                                 fund_domain_contours=fund_domain_contours)
    assert (abs(x - xref) < TESTDELTA)
    assert (abs(y - yref) < TESTDELTA)
    assert (abs(z - zref) < TESTDELTA)
예제 #8
0
파일: test_s04.py 프로젝트: knut0815/cp1
def test_s04_extreme(fund_domain_contours):
    L = 0.00001 + 0.00001j
    C = 0.5 + 0.3j - L
    xref = 0.861380 + 5.348997j
    yref = -8013.211655 - 1721.651316j
    zref = 519.186599 - 1373.061159j
    x, y, z = cp1.s04_lambda_hol(L,
                                 C,
                                 contours=3,
                                 tol=1e-8,
                                 fund_domain_contours=fund_domain_contours)
    assert (abs(x - xref) < TESTDELTA)
    assert (abs(y - yref) < TESTDELTA)
    assert (abs(z - zref) < TESTDELTA)
예제 #9
0
파일: test_s04.py 프로젝트: knut0815/cp1
def test_s04_largeC(fund_domain_contours):
    L = 0.5 + 0.86602540378443864676j
    C = 2.0 + 3.0j - L
    xref = -222.533070 - 262.929905j
    yref = 1272.251270 - 2334.830978j
    zref = -2.848143 - 7.056932j
    x, y, z = cp1.s04_lambda_hol(L,
                                 C,
                                 contours=3,
                                 tol=1e-8,
                                 fund_domain_contours=fund_domain_contours)
    assert (abs(x - xref) < TESTDELTA)
    assert (abs(y - yref) < TESTDELTA)
    assert (abs(z - zref) < TESTDELTA)
예제 #10
0
파일: test_s04.py 프로젝트: knut0815/cp1
def test_s04_square(fund_domain_contours):
    L = 0.5
    C = 0.0
    xref = -6.0
    yref = -6.0
    zref = -14.0
    x, y, z = cp1.s04_lambda_hol(L,
                                 C,
                                 contours=3,
                                 tol=1e-8,
                                 fund_domain_contours=fund_domain_contours)
    assert (abs(x - xref) < TESTDELTA)
    assert (abs(y - yref) < TESTDELTA)
    assert (abs(z - zref) < TESTDELTA)
예제 #11
0
파일: holonomy.py 프로젝트: knut0815/cp1
if not args.s04 and not args.t11:
    print('Warning: Topological type not specified. Using four-punctured sphere (S04).\n')
    args.s04 = True

if args.tau == None and args.L == None:
    print('Warning: Riemann surface not specified.  Using tau = lambda = exp(pi*i/3).\n')
    args.L = 0.5+0.866025j

if args.C == None:
    print('Warning: Coefficient not specified.  Using C = -i/sqrt(3).\n')
    args.C = -0.57735j


if args.s04:
    if args.L:
        m = cp1.s04_lambda_hol(L=args.L,C=args.C,contours=3)
    else:
        m = cp1.s04_tau_hol(tau=args.tau,C=args.C,contours=3)
    m_t11 = cp1.s04_to_t11(m)
    d,n = cp1.classify(m_t11)
else:
    if args.L:
        m = cp1.t11_lambda_hol(L=args.L,C=args.C,contours=3)
    else:
        m = cp1.t11_tau_hol(tau=args.tau,C=args.C,contours=3)
    d,n = cp1.classify(m)


if args.s04:
    print('Projective structure on S04:')
else:
예제 #12
0
import sys

# Support module built in-place (in ../cp1) or system-wide
try:
    from cp1 import s04_lambda_hol
except ImportError:
    sys.path.insert(0, '..')
    from cp1 import s04_lambda_hol

# Input filename can be specified; must be last command line argument
if len(sys.argv)>1 and not sys.argv[-1].startswith('-'):
    infile = open(sys.argv[-1],'rt')
else:
    infile = sys.stdin

if '--quiet' in sys.argv:
    quiet = True
else:
    quiet = False

for line in infile:
    fields = [float(x) for x in line[:-1].split()]
    L = fields[0] + 1j*fields[1]
    C = fields[2] + 1j*fields[3]
    t = s04_lambda_hol(L,C)
    if not quiet:
        print('lambda = %f + I %f' % (L.real,L.imag))
        print('C = %f + I %f' % (C.real + L.real,C.imag + L.imag))
        print('pre_mt[0] = %f + I %f' % (t[0].real,t[0].imag))
        print('pre_mt[1] = %f + I %f' % (t[1].real,t[1].imag))
예제 #13
0
import sys

# Support module built in-place (in ../cp1) or system-wide
try:
    from cp1 import s04_lambda_hol
except ImportError:
    sys.path.insert(0, '..')
    from cp1 import s04_lambda_hol

# Input filename can be specified; must be last command line argument
if len(sys.argv) > 1 and not sys.argv[-1].startswith('-'):
    infile = open(sys.argv[-1], 'rt')
else:
    infile = sys.stdin

if '--quiet' in sys.argv:
    quiet = True
else:
    quiet = False

for line in infile:
    fields = [float(x) for x in line[:-1].split()]
    L = fields[0] + 1j * fields[1]
    C = fields[2] + 1j * fields[3]
    t = s04_lambda_hol(L, C)
    if not quiet:
        print('lambda = %f + I %f' % (L.real, L.imag))
        print('C = %f + I %f' % (C.real + L.real, C.imag + L.imag))
        print('pre_mt[0] = %f + I %f' % (t[0].real, t[0].imag))
        print('pre_mt[1] = %f + I %f' % (t[1].real, t[1].imag))