Example #1
0
def cplx_test(length):
    C = CobarComplex(length)
    C.generate_modules()
    for i in range(C.length):
        print "module", i
        for deg in C.cplx[i]._dict:
            print "deg", deg
            for thing in C.cplx[i]._dict[deg]:
                print thing
Example #2
0
def cplx_test(length):
    C = CobarComplex(length)
    C.generate_modules()
    for i in range(C.length):
        print "module", i
        for deg in C.cplx[i]._dict:
            print "deg", deg
            for thing in C.cplx[i]._dict[deg]:
                print thing
Example #3
0
def vfe_test(x, f, n):
    C = CobarComplex(7)
    print "calculating complex"
    cplx = C.get_cplx()
    for i in range(n):
        xx = CobarMonomial.random(x, f)
        print "finding good xx"
        while xx.get_degree()[0] > opts.bounds:
            xx = CobarMonomial.random(x, f)
        yy = xx._map()
        vect = C.vector_from_element(yy)
        deg = yy.get_degree()[0]
        wt = yy.get_degree()[1]
        for thing in C.get_cplx()[f + 1]._dict[(deg, wt)]:
            print thing
        print "\n"
        print xx
        print yy
        print vect
Example #4
0
def vfe_test(x,f,n):
    C= CobarComplex(7)
    print "calculating complex"
    cplx = C.get_cplx()
    for i in range(n):
        xx = CobarMonomial.random(x,f)
        print "finding good xx"
        while xx.get_degree()[0] > opts.bounds:
            xx = CobarMonomial.random(x,f)
        yy = xx._map()
        vect = C.vector_from_element(yy)
        deg = yy.get_degree()[0]
        wt = yy.get_degree()[1]
        for thing in C.get_cplx()[f+1]._dict[(deg,wt)]:
            print thing
        print "\n"
        print xx
        print yy
        print vect
Example #5
0
def cohom_test(f):
        out = open("cohom"+str(opts.prime)+"-"+str(opts.bounds)+".txt", "a")
        C = CobarComplex(f+2)
        C.get_pickled_cplx()
        #C.make_maps()
        for i in range(1,f+1):
            for bideg in C.get_cplx()[i]._dict.keys():
                d = bideg[0]
                w = bideg[1]
                cohom = C.get_cohomology(i,d,w)
                out.write("Filt, deg, wt"+str(i)+" "+str(d)+" "+str(w)+"\n")
                cc = cohom.get_cohomology()
                out.write(str(cc)+"\n")
                if cc.get_basis():
                    for vect in cc.get_basis():
                        out.write(str(C.element_from_vector(vect, i,d,w))+"\n")
        C.compute_product_structure()
        for thing in C.product_generators:
            out.write(str(thing.get_degree()) + " " + str(thing) + "\n")
        out.close()
        C.pickle_cplx()
Example #6
0
def cohom_test(f):
    out = open("cohom" + str(opts.prime) + "-" + str(opts.bounds) + ".txt",
               "a")
    C = CobarComplex(f + 2)
    C.get_pickled_cplx()
    #C.make_maps()
    for i in range(1, f + 1):
        for bideg in C.get_cplx()[i]._dict.keys():
            d = bideg[0]
            w = bideg[1]
            cohom = C.get_cohomology(i, d, w)
            out.write("Filt, deg, wt" + str(i) + " " + str(d) + " " + str(w) +
                      "\n")
            cc = cohom.get_cohomology()
            out.write(str(cc) + "\n")
            if cc.get_basis():
                for vect in cc.get_basis():
                    out.write(str(C.element_from_vector(vect, i, d, w)) + "\n")
    C.compute_product_structure()
    for thing in C.product_generators:
        out.write(str(thing.get_degree()) + " " + str(thing) + "\n")
    out.close()
    C.pickle_cplx()