コード例 #1
0
ファイル: test.py プロジェクト: alexdavies17/snappy-pull
def test_induced_sl4_representation():
    M = Manifold("m004")

    z_gl2 = ptolemy.CrossRatios.from_snappy_manifold(M)
    z_gl4 = z_gl2.induced_representation(4)

    G = M.fundamental_group()

    mat = z_gl4.evaluate_word(G.relators()[0], G)

    for i, row in enumerate(mat):
        for j, entry in enumerate(row):
            if i == j:
                assert abs(entry - 1) < 1e-9
            else:
                assert abs(entry) < 1e-9
コード例 #2
0
ファイル: printMatrices.py プロジェクト: esfrankel/SnapPy
def cross_ratios(M):
    return [ptolemys.cross_ratios() for ptolemys in ptolemy_coordinates(M)]


if __name__ == '__main__':
    from snappy import Manifold
    import sys

    if len(sys.argv) != 2:
        print("Usage: sage -python printMatrices.py CLOSED_MFD")
        print()
        print('Example: sage -python printMatrices.py "m004(2,3)"')
        sys.exit(1)

    M = Manifold(sys.argv[1])
    G = M.fundamental_group()
    list_z = cross_ratios(M)
    for i, z in enumerate(list_z):
        print("Solution %d:" % i)
        nf = z['z_0000_0'].parent()
        print("    Number field:", nf.defining_polynomial())
        print("    Exact values:")
        for g in G.generators():
            print("        Generator %s:" % g)
            print(z.evaluate_word(g, G))

        for z_numerical in evaluate_at_roots(nf, z, precision=100):
            print("    Numerical values:")
            d = CrossRatios(z_numerical, manifold_thunk=lambda: M)

            for g in G.generators():