# Checks conjecture on the coefficients of the # modular polynomial using M. Rubinstein's files: # # phi_.gz # # # (reads from the (new) gzipped ASCII files) import struct, sys, gzip, glob out = open("/tmp/check_phi.out","w") # chage to where you want to save # the output # out=sys.stdout fail=[] ## OLD!! ## for p in prime_range(5,354): ## f = gzip.open("/scratch/mod_pol/gz/phi_" + str(p) + ".gz", "rb") ## # change to the location of the stored gzipped ASCII files # need to rename files to 'phi_XXX.gz' format (e.g., 'phi_007.gz' instead of # 'phi_7.gz') # needs to be in the directory with the 'phi_XXX.gz' or add path to argument! files=(glob.glob('mp/gz/phi_*.gz')) files.sort() for sfile in files: f = gzip.open(sfile) lines=f.readlines() # put lines in a list p=sageobj(int(sfile[-6:-3])) # get the prime from file name # needs to be phi_XXX.gz res=[p] # list with p and the valuations out.write("p = " + str(p) + "\n") s=2*floor((p-1)/6)+1 i=0 # i is the line from the file that has a_{j,0} for j in range(s+2): # j is the index as in a_{j,0} i+=j aj0= sageobj(int(lines[i])) # a_{j,0} vaj0 = valuation(aj0,p) # valuation res+=[vaj0] # add to result if ((j == 0) or (j == 1)) and (p.mod(6)==1): # coef should be zero if (vaj0 != +Infinity): fail+=[[p, j, vaj0]] out.write("Fail: " + str([p,j,vaj0]) + "\n") elif (j