""" This script decides p-rationality of a list of cyclic cubic fields as in Algorithm 4. """ # DATA ################################################################ E1=1 E2=2 ell=3 r=1 p=[5,7,11,13,17,19] fd=open("cubic-"+str(E1)+"-"+str(E2)+"-"+str(ell)+"-"+str(r)+".txt","r") gd=open("result-"+str(E1)+"-"+str(E2)+"-"+str(ell)+"-"+str(r)+"-"+str(p)+".txt","w") # TOOL SCRIPTS ####################################################### load algorithm1.sage load algorithm2.sage load PitounVarescon.sage ###################################################################### # Main enumeration. Qx.=QQ['x'] line=fd.readline() while line != "": if line[0] == "x": f=Qx(line.strip()) # read f in the file produced by ListCyclicCubic.sage if f.change_ring(GF(p)).discriminant() != 0: # if p is not ramified c_cl = criterion_p_not_divides_h(f,p) c_unit = criterium_p_not_divides_pRegulator(f,p) if c_cl == "True" and c_unit == "True": gd.write(str(f)+":True,True,True\n") # If both the class number and the p-adic regulator are # non-divisible by p then by Lemma 2.1 # we conclude that K is p-rational. gd.flush() continue prational = is_p_rational(f,p) gd.write(str(f)+":"+str(prational)+","+str(c_cl)+","+str(c_unit)+"\n") gd.flush() line=fd.readline()