Exemplo n.º 1
0
def orbiplex(G, k=4):

    #import numpy
    #from gelim import zeros, dotx, rank, nullity

    print("orbiplex: |G|=%d" % len(G))
    items = G.items

    k = argv.get("k", k)
    for n in range(k):

        write("|C_%d| ="%n)
        #if n > len(items):
        #    break

        tpls = list(uniqtuples(items, n))

        perms = []
        for perm in G:
            _perm = {}
            for key in tpls:
                value = tuple(perm[i] for i in key)
                _perm[key] = value
            _perm = Perm(_perm, tpls)
            perms.append(_perm)

        G2 = Group(perms, tpls)

        orbits = list(G2.orbits())
        d = len(orbits)
        write("%d,"%d)
Exemplo n.º 2
0
def hecke(self):

    bag0 = self.get_bag()
    bag1 = self.get_bag()

    points = [p for p in bag0 if p.desc == '0']
    lines = [p for p in bag0 if p.desc == '1']
    print(points)
    print(lines)
    flags = []
    for p in points:
        ls = [l for l in p.nbd if l != p]
        print(p, ls)
        for l in ls:
            flags.append((p, l))

    print("flags:", len(flags))

    #    for point in bag0:
    #        print point, repr(point.desc)

    #items = [(point.idx, line.idx) for point in points for line in lines]
    #items = [(a.idx, b.idx) for a in points for b in points]
    items = [(a, b) for a in flags for b in flags]

    # fixing two points gives the Klein four group, Z_2 x Z_2:
    #for f in isomorph.search(bag0, bag1):
    #    if f[0]==0 and f[1]==1:
    #        print f

    perms = []
    for f in isomorph.search(bag0, bag1):
        #print f
        g = dict((bag0[idx], bag0[f[idx]]) for idx in list(f.keys()))
        perm = {}
        for a, b in items:
            a1 = (g[a[0]], g[a[1]])
            b1 = (g[b[0]], g[b[1]])
            assert (a1, b1) in items
            perm[a, b] = a1, b1
        perm = Perm(perm, items)
        perms.append(perm)
        write('.')
    print()

    g = Group(perms, items)
    print("group:", len(g))

    orbits = g.orbits()
    #print orbits
    print("orbits:", len(orbits))

    eq = numpy.allclose
    dot = numpy.dot

    n = len(flags)
    basis = []
    gen = []
    I = identity2(n)
    for orbit in orbits:
        A = zeros2(n, n)
        #print orbits
        for a, b in orbit:
            A[flags.index(a), flags.index(b)] = 1
        print(shortstr(A))
        print(A.sum())
        #print

        basis.append(A)
        if A.sum() == 42:
            gen.append(A)

    assert len(gen) == 2
    L = gen[0]
    P = gen[1]
    q = 2

    assert eq(dot(L, L), L + q * I)
    assert eq(dot(P, P), P + q * I)
    assert eq(dot(L, dot(P, L)), dot(P, dot(L, P)))