This worksheet will do al computations pertaining to table 1(isogenous curves, rank, labels, etc.), table 3( ap list to a bound of choice), and table 4( values pertaining to the Birch Swinnerton-Dyer Conjecture).

In the next table, it will set the Number field to that of what is wanted, and creates local database, simply for storage. 

Lastly, there is a label , where one should input his/her method of finding the curves before continuing, as this is beefical to know how the curve was initially discovered.

One only has to evaluate all after setting what text file to open. The  file must have is the Norm of the conductor, the conductor, and the weierstrass equation, in that order.

{{{id=1| x = var('x') K.=NumberField(x^2-x-1) import psage.modform.hilbert.sqrt5.tables as sqrt5 import nosqlite db=nosqlite.Client(DATA+'localdb').db from psage.ellcurve.minmodel.sqrt5 import canonical_model label='MJ' g=open('/home/psharaba/mjfound_3.txt') /// }}}

This is simply the list of all commands needed to compute the various isogenous curves. 

{{{id=2| def ap(E,p): return E.change_ring(p.residue_field()).trace_of_frobenius() R. = GF(2)[] def frob(E,p): t = ap(E,p) return ch^2 - ap(E, p)*ch + int(p.norm()) def disc(E, p): t = ap(E, p) return t^2 - 4*p.norm() def isogeny_primes(E, norm_bound, isog_degree_bound): #Returns prime for which E has an isogeny P = [p for p in sqrt5.ideals_of_bounded_norm(norm_bound) if p.is_prime() and E.has_good_reduction(p)] w = set(primes(isog_degree_bound+1)) i = 0 w.remove(2) while len(w) > 0 and i < len(P): d = disc(E, P[i]) w = [ell for ell in w if not (legendre_symbol(d,ell) == -1)] i = i +1 i = 0 while i < len(P): if frob(E,P[i]).is_irreducible(): break i = i+1 if i == len(P): w.insert(0,2) return w def closed_under_multiplication_by_m(E, f, m): """ INPUT: - E -- elliptic curve in *short* Weierstrass form - f -- a polynomial that defines a finite subset S of E[p] that is closed under [-1] - m -- integer m >= 2 coprime to p. We assume that p is odd. OUTPUT: - True if [m]*S = S, and False otherwise. """ K = E.base_field() h = E.multiplication_by_m(m, x_only=True) n = h.numerator(); d = h.denominator() S. = K[] psi = n.parent().hom([x,0]) tau = f.parent().hom([x]) r = tau(f).resultant(psi(n)-Z*psi(d), x) r0 = S.hom([0,f.parent().gen()])(r) return r0.monic() == f.monic() def is_subgroup(E, f, p): """ INPUT: - E -- elliptic curve in *short* Weierstrass form - f -- a polynomial that defines a finite subset S of E[p] that is closed under [-1] - p -- an odd prime OUTPUT: - True exactly if S union {0} is a group. """ m = primitive_root(p) return closed_under_multiplication_by_m(E, f, m) def isogeny_class_computation(E, p): if p != 2: E = E.short_weierstrass_model() F = E.division_polynomial(p).change_ring(K) candidates = [f for f in divisors(F) if f.degree() == (p-1)/2 and is_subgroup(E,f,p)] v = [] w = [] for f in candidates: try: v.append(E.change_ring(K).isogeny(f).codomain()) w.append(f) except ValueError: pass v = [F.change_ring(K).global_minimal_model() for F in v] return v else: w = [Q for Q in E.torsion_subgroup() if order(Q)==2] v = [E.isogeny(E(Q)).codomain() for Q in w] return v def curve_isogeny_vector(E): #Returns isogeny class and adjacency matrix curve_list = [E] i = 0 Adj = matrix(50) ins = 1 norm_bound, isog_degree_bound = 500,500 while i < len(curve_list): isolist = isogeny_primes(curve_list[i],norm_bound, isog_degree_bound) for p in isolist: for F in isogeny_class_computation(curve_list[i],p): bool = True for G in curve_list: if F.is_isomorphic(G): bool = False Adj[i,curve_list.index(G)]=p #if a curve in the isogeny class computation is isom Adj[curve_list.index(G),i]=p #to a curve already in the list, we want a line if bool: curve_list.append(F.global_minimal_model()) Adj[i,ins]=p Adj[ins,i]=p ins += 1 i+=1 Adj = Adj.submatrix(nrows=len(curve_list),ncols=len(curve_list)) return {'curve_list':curve_list, 'adjacency_matrix':Adj, 'norm_bound':norm_bound, 'isog_degree_bound':isog_degree_bound, 'subgroup_checked':True} /// }}}

This function simply reads in the text file(opened from the beginning, please make sure you specify the file to be opened above). This function will insert the Norm(N), conductor(cond), the weierstrass equation(weq), and the way the curve was discovered(found).

{{{id=144| db.curves.delete() /// }}} {{{id=5| for s in g.readlines(): A=s.split() db.curves.insert({'N':int(A[0]), 'cond': A[1], 'weq': A[2], 'found': label}) print s /// 451 19*a-10 [a+1,a-1,0,-193*a-127,-1754*a-1070] 549 21*a-12 [a,a-1,a,36*a-65,-155*a+226] 781 25*a-13 [a+1,-a-1,a+1,-144*a-95,1048*a+654] 836 26*a-16 [1,a+1,a,47*a-71,173*a-218] 836 2*a-30 [a,a-1,a+1,-49*a+37,137*a-108] }}}

This function computes the isogenous curves to the curves read in from the file. It will then update the temporary database with a list of isogenous curves, and the corresponding adjancy matrix(that will be used to construct the graph of the isogeny class). 

{{{id=3| %time X = db('select weq,N from curves order by N') for r1 in range(len(X)): weq1=X[r1][0] weq2=eval(X[r1][0]) E = EllipticCurve(K, weq2) iso = curve_isogeny_vector(E) Tot=iso['curve_list'] India=iso['adjacency_matrix'] hotel=[] for g1 in range(len(Tot)): A=list(Tot[g1].a_invariants()) hotel.append(str(A).replace(' ','')) db.curves.update({'isoclass':str(hotel), 'mtrx': str(India)}, weq=str(weq1)) print r1 /// 0 1 2 3 4 CPU time: 38.38 s, Wall time: 38.53 s }}}

This is simply defining the function to compute the L* value that is found in the Birch Swinnerton-Dyer (BSD) Conjecture. Since the L* value will be the same for curves in the same isogeny, it will be computed now to save time.

{{{id=94| K.
=NumberField(x^2-x-1) from psage.ellcurve.lseries.lseries_nf import lseries_dokchitser def l_function(ainv): E=EllipticCurve(K,eval(ainv)) F=EllipticCurve(K,list(E.short_weierstrass_model().a_invariants())) v=lseries_dokchitser(F) f=v.taylor_series(1,6) r_an=0 while abs(f[r_an])<1e-10: r_an += 1 if r_an == 6: raise RuntimeError l=float(f[r_an]) return l /// }}} {{{id=149| l_function('[1,-1,1,-91,-310]') /// 0.80329953688042288 }}}

This function will fix the adjancy matrix so that it will be compatible with the database, and easier to read. This function will also do the computation of the L* value and update the database with both the L* and the revised adjancy matrix.

{{{id=120| %time test=db('select weq,mtrx,isoclass from curves order by N') for s in range(len(test)): A=str(test[s][1]).replace('\n','') A=A.replace('][',',') A='('+A.replace(' ',',')+')' B=len(eval(test[s][2])) M=matrix(B,eval(A)) mat = "matrix(%s,%s)"%(M.nrows(),str(M.list()).replace(' ','')) Lstar=l_function(test[s][0]) db.curves.update({'mtrx':mat, 'L':Lstar},weq=test[s][0]) print s /// 0 1 2 3 4 CPU time: 5.98 s, Wall time: 9.15 s }}}

This function now splits up each curve(i.e. the curves within the same isogeny class) and inserts them into another temporary database so that the computation below can calculate all information about each curve. This also adds on the I to the label to indicate that the curves found through isogeny are properly labeled.

{{{id=7| %time test=db('select N,cond,weq,isoclass,mtrx,found, L from curves order by N') for s in range(len(test)): A=test[s] db.curvesU.insert({'N':A[0], 'cond': A[1], 'weq': A[2], 'mtrx': A[4], 'found': A[5], 'L': A[6]}) B=eval(A[3]) for t in range(1,len(B)): E=EllipticCurve(K,eval(B[t])) F=canonical_model(E.global_minimal_model()).a_invariants() G=str([F[0],F[1],F[2],F[3],F[4]]).replace(' ','') db.curvesU.insert({'N':A[0], 'cond': A[1], 'weq': G, 'mtrx':A[4], 'found':A[5]+'I', 'L': A[6]}) /// CPU time: 0.85 s, Wall time: 1.02 s }}}

This function below will compute all necesary things for each curve. This includes the rank bounds, order of the torsion subgroup, the signs of the curve, the order of the discriminant, the order of the j-invaraint, the tamagawa numbers, and the kodiara symbols, while inserting the label, adjancy matrix, and the L* in the process.

{{{id=42| K.
=NumberField(x^2-x-1) embs=K.embeddings(RR) #def grabber(s): # return eval('['+s.split('[')[1].split(']')[0]+']') #returns a-invariants def list_maker(N,cond,eqn): ret = [N,cond,eqn] # #we want to add new text to each line, so we take off # ret = [s] #\n first and define our list to eventually be returned #now we create the elliptic curve over K defined by the a-invariants E = EllipticCurve(K,eval(eqn)) T = E.torsion_subgroup() # calculations for rank bounds TI = T.invariants() # t2 = len([a for a in TI if a%2 == 0]) # simon = E.simon_two_descent() # ret.append(str(simon[0])) #append upper rank bound ret.append(str(simon[1] - t2)) #append lower rank bound D=K(E.discriminant()) #calculate discriminant t='' #create string to add + or - for m in embs: e=m(D) if sgn(e)<0: t+='-' else: t+='+' t+=',' ret.append(t[:-1]) #append disc signs tor=E.torsion_order() ret.append(tor) fac=D.factor() k=[str(e) for p,e in fac] #calculate disc ord ret.append(','.join(k)) #append disc ord #the next section adds ord_(j). There are certain curves (eg N=729 #2) which have #j-invariant 0. The denominator_ideal function is not defined for j=0, so we set #the value to be 1 if this is the case. # try: # denfac = K(E.j_invariant()).denominator_ideal().factor() # except ValueError: # denfac = [(1,1)] z=K(E.j_invariant()) if z: denfac=z.denominator_ideal().factor() if denfac: ret.append(','.join([str(e) for p,e in denfac])) else: ret.append('0') else: ret.append('0') #we still want a value for the table if denfac == [] # l=[str(e) for p,e in denfac] # ret.append(','.join(l)) #append j-ord ret.append(','.join([str(e) for e in E.tamagawa_numbers()])) #append tamagawa z = E.conductor().factor() ret.append(','.join([str(E.kodaira_symbol(p)) for p,e in z])) #append kodaira ret.append(B[3]) ret.append(B[4]) ret.append(B[5]) return ret /// }}}

This function will do the computations listed above, and insert them into a local text file for safekeeping. If there is an issue with a particular curve, it will simply insert it into the "broken" list. Please check to make sure this list is an empty list before continuing, as one might miss computing the rest of the worksheet to this curve.

{{{id=38| %time november=db('select N,cond,weq,mtrx,found, L from curvesU ORDER BY N') data=[] broken=[] for s in range(len(november)): B=november[s] try: data.append(list_maker(B[0],B[1],B[2])) except TypeError: broken.append(B) g = open(DATA+'1.txt','w') for curr_data in data: for i,thing in enumerate(curr_data): curr_data[i] = str(thing) g.write(' '.join(curr_data)+'\n') #writes data to new file g ^^ g.close() /// CPU time: 4.71 s, Wall time: 8.51 s }}} {{{id=45| broken /// [] }}} {{{id=150| /// }}}

This is the function of one of many values needed to order the curves and provide proper labeling for. This is the eta function defined below, which will be implemented below.

{{{id=47| def eta(alpha): return (alpha*alpha).trace() def find_small(alpha): while True: plus=a*alpha minus=alpha/a if eta(plus)This function simply inserts all the information computed above, but with some additions and some ordering. This function will take a curve with the data given from the local textfile, and take the curve and preform both the global minimal model, and the canonical model of the curve, and checks the database to see if the curve exist. If it does exist already, then the curve won't be inserted (this ensures no doubles). If it is unique, then it will compute the curve that is the galois of the initial curve. Then it computes the second conductor for this galois curve. using the two conductors, we take the ideal of the conductors in our field, and check the integral basis of both. If the galois conductor has a smaller integral basis than the other, we reverse the order in which the conductors and weierstrass equations are displayed in the table/database. If we have to switch the order, than the signs will also switch as the periods switch. After determining this, all the information will be inputed into the database which will be used for the remainder of the worksheet.

{{{id=46| %time f=open(DATA+'1.txt') for t in f.readlines(): c=t.split() E = EllipticCurve(K,eval(c[2])) s=c[5] F = E.global_minimal_model() F = canonical_model(F).a_invariants() G1 = str([F[0],F[1],F[2],F[3],F[4]]).replace(' ','') H = list(db.N1k.find(weq1=G1))+list(db.N1k.find(weq2=G1)) L = len(H) if L==0: E = EllipticCurve(K, [galois_conjugate(K(alpha)) for alpha in F]) F = E.global_minimal_model() F = canonical_model(F).a_invariants() G2 = str([F[0],F[1],F[2],F[3],F[4]]).replace(' ','') J1 = K.ideal(eval(c[1])) J2 = K.ideal(galois_conjugate(K(eval(c[1])))) if J1.integral_basis()[1][0] > J2.integral_basis()[1][0]: J1,J2 = J2,J1 G1,G2 = G2,G1 s = s[2]+','+s[0] db.N1k.insert({'N': int(J1.norm()), 'eta': int(eta_ideal(J1)), 'cond1': str(J1.gen(0)).replace(' ',''), 'cond2': str(J2.gen(0)).replace(' ',''), 'weq1': G1, 'weq2': G2, 'rlow': int(c[3]), 'rhi': int(c[4]), 'T': int(c[6]), 's': s, 'ordD': c[7], 'ordj': c[8], 'c_p': c[9], 'K': c[10],'adj': c[11],'found': c[12], 'L': float(c[13])}) /// CPU time: 3.87 s, Wall time: 4.03 s }}}

This is simply the function to compute the periods of the curves using the weierstrass equation that appears first in each row. See above for explaination on how this is determined.

{{{id=83| def period_stuff(E): w = [] v = [] for phi in K.embeddings(RR): B = E.period_lattice(phi).basis() a = B[0].real() if abs(B[1].real()) <1e-20: a *= 2 v.append(float(a)) w.append(B) return v[0], v[1] /// }}}

This computes the periods and the omega value while inserting them into the database.

{{{id=80| %time temp=db('select N,cond1,weq1 from N1k ORDER BY N') for r in range(len(temp)): A=temp[r][2] p0,p1=period_stuff(EllipticCurve(K,eval(A))) db.N1k.update({'real1': float(p0), 'real2': float(p1),'omega':float(p0*p1)},weq1=A) /// CPU time: 8.58 s, Wall time: 8.80 s }}}

This function will compute ap values for the elliptic curve using the first weierstrass equation given a range. All one needs to do is to change the number that is called in the function primes_of_bounded_norm.

{{{id=103| import psage.modform.hilbert.sqrt5.sqrt5 as sq w = sq.primes_of_bounded_norm(100) from psage.ellcurve.minmodel.sqrt5 import canonical_model def ap(E,p): return E.change_ring(p.residue_field()).trace_of_frobenius() def ap_comp(E): q=[] for i in range(len(w)): u=w[i] if E.has_good_reduction(w[i])==True: if not E.conductor().norm()%norm(w[i])==0: try: q.append(ap(E,w[i])) except: q.append('?') else: q.append('?') else: q.append('?') return q /// }}}

This computes the ap values and makes a list and inserts them into the database. This will also take the weierstrass equation and embed it into $\mathbb R^5$. This will be used for sorting purposes only. This will be explained below. Lastly, this function will take the computed ap lists and insert them into the list 'IO', while the other list thats the embedded weierstrass equations is called "NH'. These lists will be used below.

{{{id=102| %time IO=[] NH=[] embs=K.embeddings(RR)[1] temp=db('select weq1 from N1k ORDER BY N,eta') for r in range(len(temp)): A=temp[r][0] A1=eval(A) B=ap_comp(EllipticCurve(K,eval(A))) C=[embs(f) for f in A1] IO.append(B) NH.append(C) db.N1k.update({'a_p':str(B).replace(' ',''), 'remove': str(C).replace(' ','')},weq1=A) /// CPU time: 6.21 s, Wall time: 6.54 s }}}

This function takes the IO and NH and uses them and sorts them in lexigraphical order. This then assigns each ap list and embedded weierstrass an integer value which will serve for ordering isogeny classes via ap lists, and ordering within an isogeny class, i.e embedded weierstrass equations.

{{{id=106| %time IO=sorted(IO) NH=sorted(NH) for r in range(len(IO)): db.N1k.update({'R': int(r)}, a_p=str(IO[r]).replace(' ','')) for s in range(len(NH)): db.N1k.update({'U': int(s)}, remove=str(NH[s]).replace(' ','')) test=db('select weq1,omega from N1k order by N') for r in range(len(test)): O=1/float(test[r][1]) db.N1k.update({'V': float(O)},weq1=test[r][0]) /// CPU time: 0.05 s, Wall time: 0.67 s }}}

After determing the values from above, we compute the 2 sets of labels, a_lbl which is used to sort by norm of the conductor and the conductor(via the eta function). The second label, b_lbl, will be used to order isogeny classes and order within the same isogeny class. a_lbl uses the value from the norm of the conductor and the eta value to sort between those, in that order, while b_lbl uses the lexigraphical order of the ap values, the value of 1/omega, and the lexigraphical order of the embedded weierstrass equation(to break ties if 1/omega value is the same). This then inserts them into the database.

{{{id=107| temp=db('select N,eta,R,V,U, weq1 from N1k ORDER BY N,eta,R,V,U') N=0 lastchar1=ord('a') L=1 lastchar2=ord('a') test=[] for s in range(len(temp)): A=temp[s] if temp[s][0] != temp[s-1][0]: #this instance is a curve with a new norm than the previous entry N=int(temp[s][0]) lastchar1=ord('a') L=ord('a') lastchar2=1 else: if temp[s][1]==temp[s-1][1]: if temp[s][2]==temp[s-1][2]: lastchar2+=1 else: L+=1 lastchar2=1 else: lastchar1+=1 L=ord('a') lastchar2=1 i_lbl=str(N)+chr(lastchar1) l_lbl=chr(L)+str(lastchar2) db.N1k.update({'i_lbl': i_lbl, 'l_lbl': l_lbl}, weq1=temp[s][5]) /// }}}

These next two function serve as a way to ensure the ranks are correct. If a weierstrass equation has large integer coefficents, the simon_two_descent function sometimes cannot figure out the correct rank, usually within the same isogeny. To correct this, we know that the rank of the isogeny class is the same, so this function will pull the optimal curves from the database and check to see if the rank bound matches, and if it does, it inserts them into the database as "rank", not as the bounds which are already inserted.

{{{id=108| temp=db('select R,weq1,rlow,rhi from N1k WHERE l_lbl LIKE "_1" ORDER BY N') for r in range(len(temp)): if temp[r][2] == temp[r][3]: db.temp.insert({'rank':int(temp[r][2]), 'weq1':temp[r][1], 'value': int(temp[r][0])}) else: print temp[r] /// }}}

This function will make the rank of the curves within the same isogeny the same by using the ap list to match against. If there isn't an integer value for the rank(computed above), it will not insert a rank into the database, but simply leave the bounds for now.

{{{id=109| temp=db('select R,weq1 from N1k ORDER BY N') for r in range(len(temp)): A=temp[r][0] B=db.temp.find_one(value=A)['rank'] db.N1k.update({'rank': int(B)}, weq1=temp[r][1]) /// }}}

This function will define both the regulator and sha function, and a third function which will compute both at the same time. Disclaimer: the saturation bound is low purposely to speed up the calculatio of sha. If one wants, one can raise the saturation bound by changing the number in the function comp( see comment within the function to find where to change).

{{{id=53| def regulator_new(E,rank,sat_bound): if rank == 0: Q= 0 else: v = E.simon_two_descent() Q = v[-1][0] for p in prime_range(sat_bound): if len(Q.division_points(p)) != 0: Q = Q.division_points(p)[0] print Q if Q== 0: return int(1), [] else: return Q.height()/2, [Q] def conjectural_sha(E, omega, reg=1, Lstar=1): M = E.tamagawa_product_bsd() sha = RR(sqrt(5))*Lstar*(E.torsion_order())^2/((omega)*reg*M) return sha def comp(weq,lstar,rank,omega): E=EllipticCurve(K,eval(weq)) R=regulator_new(E,rank,10) #this is where one would change the value for saturation bound. Currently held at 10 if R[0] <= 0: return R[0], 'error with regulator' else: Sha=conjectural_sha(E,omega,R[0],lstar) return R[0],Sha /// }}}

This function actually tries to compute the value of sha and regulator. As seen above, the saturation bound is low for speed, so there might be errors when trying to compute. If the value of the regulator is negative or zero, it will append the curve to the broken2 list automatically. If the value of sha is below .5, it will also give an error and append to broken 2. Lastly, if a ValueError or IndexError, it will also append to broken2. One will look at these curves after the computation is done, which is evaluated immediately after this computation.

{{{id=92| %time broken2=[] temp=db('select weq1,L,rank,omega from N1k') for r in range(len(temp)): try: reg,S=comp(temp[r][0], temp[r][1], temp[r][2], temp[r][3]) if S>=.5: db.N1k.update({'Sha': float(S), 'Reg': float(reg)}, weq1=temp[r][0]) else: broken2.append((temp[r][0], reg, S)) except IndexError: broken2.append(temp[r][0]) except ValueError: broken2.append(temp[r][0]) print r /// 0 0 0 1 (-4*a + 8 : -3*a + 3 : 1) 2 3 (727/4*a + 443/4 : -587/4*a - 731/8 : 1) 4 (-39/4*a - 27/2 : 16*a + 93/8 : 1) 5 0 6 0 7 0 8 CPU time: 8.15 s, Wall time: 10.43 s }}} {{{id=96| broken2 /// [u'[a,-1,a,142*a-237,-1049*a+1703]', u'[a+1,-a-1,a,-273*a-216,2921*a+1936]', u'[a,1,a+1,-220475*a-136262,59462360*a+36749759]', u'[a+1,-a-1,a,-283*a-201,2861*a+2009]'] }}}

This function will now create a permanant database that will be stored to a folder/file of your choice.  It will include all the data computed from this worksheet and insert it in. This will also include the values for the sorting: eta,R(lexigraphical order for ap list),V(value computed by 1/omega) ,U(lexigraphical order of the embedded weierstrass equation).

 

###NOTE: PLEASE CHANGE LOCATION OF DATABASE TO BE SAVED. CHANGE DATABASE NAME IF NEEDED ###

{{{id=145| db2=nosqlite.Client('/home/psharaba/ECdb').db temp=db2('select a_lbl,b_lbl,N,weq1,weq2,V,U from N1k WHERE N=855 ORDER BY N,eta,R,V,U') /// }}} {{{id=110| db2=nosqlite.Client('/home/psharaba/ECdb').db temp=db('select N,cond1,cond2,weq1, weq2, rank,T,s,ordD,ordj,c_p, K, real1,real2,omega,L,Reg,Sha,adj,found,i_lbl,l_lbl, eta,R,V,U from N1k ORDER BY N,eta,R,V,U') for r in range(len(temp)): A=temp[r] db2.N1k.insert({'N':int(A[0]), 'cond1': A[1], 'cond2': A[2], 'weq1': A[3], 'weq2': A[4], 'rank': int(A[5]), 'T': int(A[6]), 's': A[7], 'ordD': A[8], 'ordj': A[9], 'c_p': A[10], 'K': A[11], 'real1': float(A[12]), 'real2': float(A[13]), 'omega': float(A[14]), 'L': float(A[15]), 'Reg': A[16], 'Sha': A[17], 'adj': A[18], 'found': A[19], 'a_lbl': A[20], 'b_lbl': A[21], 'eta': int(A[22]), 'R': int(A[23]), 'V': int(A[24]), 'U': int(A[25])}) /// }}}

These last two functions may look familiar, but these only need to be run if one is inserting new curves into already database.

###NOTE: YOUR DATABASE NAME MAYBE DIFFERENT. CHANGE ACCORDINGLY. ###

These functions will redo the sorting for the lexigraphical ordering for the ap lists and embedded weierstrass equations

{{{id=111| %time IO=[] NH=[] embs=K.embeddings(RR)[1] temp=db2('select weq1 from N1k ORDER BY N,eta') for r in range(len(temp)): A=temp[r][0] A1=eval(A) B=ap_comp(EllipticCurve(K,eval(A))) C=[embs(f) for f in A1] IO.append(B) NH.append(C) db2.N1k.update({'a_p':str(B).replace(' ',''), 'remove': str(C).replace(' ','')},weq1=A) print r /// WARNING: Output truncated!
full_output.txt 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 ... 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 CPU time: 539.40 s, Wall time: 565.16 s }}} {{{id=118| %time IO=sorted(IO) NH=sorted(NH) for r in range(len(IO)): db2.N1k.update({'R': int(r)}, a_p=str(IO[r]).replace(' ','')) print r for s in range(len(NH)): db2.N1k.update({'U': int(s)}, remove=str(NH[s]).replace(' ','')) print s /// WARNING: Output truncated! full_output.txt 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 ... 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 CPU time: 6.49 s, Wall time: 76.40 s }}} {{{id=142| test=db2('select weq1,omega from N1k order by N') for r in range(len(test)): O=float(1)/float(test[r][1]) db2.N1k.update({'V': float(O)},weq1=test[r][0]) print r /// WARNING: Output truncated! full_output.txt 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 ... 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 }}} {{{id=123| temp=db2('select N,cond1,cond2,weq1, weq2, rank,T,s,ordD,ordj,c_p, K, real1,real2,omega,L,Reg,Sha,adj,found,a_lbl,b_lbl, eta,R,V,U from N1k ORDER BY N,eta,R,V,U') db2.N1k.delete() for r in range(len(temp)): A=temp[r] db2.N1k.insert({'N':int(A[0]), 'cond1': A[1], 'cond2': A[2], 'weq1': A[3], 'weq2': A[4], 'rank': int(A[5]), 'T': int(A[6]), 's': A[7], 'ordD': A[8], 'ordj': A[9], 'c_p': A[10], 'K': A[11], 'real1': float(A[12]), 'real2': float(A[13]), 'omega': float(A[14]), 'L': float(A[15]), 'Reg': A[16], 'Sha': A[17], 'adj': A[18], 'found': A[19], 'a_lbl': A[20], 'b_lbl': A[21], 'eta': int(A[22]), 'R': int(A[23]), 'V': float(A[24]), 'U': int(A[25])}) print r,A[0], A[22], A[23], A[24], A[25] /// WARNING: Output truncated! full_output.txt 0 31 63 34 0.0194141433894 474 1 31 63 34 0.0388282867788 553 2 31 63 34 0.0776565735575 720 3 31 63 34 0.155313147115 473 4 31 63 34 0.62125258846 472 5 31 63 34 0.62125258846 668 6 36 72 615 0.0225735561997 901 7 36 72 615 0.0225735561997 896 8 36 72 615 0.564338904993 894 9 36 72 615 0.564338904993 898 10 41 87 132 0.0216165371929 30 11 41 87 132 1.05921032245 29 12 45 90 105 0.0318603018896 425 13 45 90 105 0.0318603018896 428 14 45 90 105 0.0318603018896 430 15 45 90 105 0.127441207558 427 16 45 90 105 0.509764830233 423 17 45 90 105 0.509764830233 433 18 45 90 105 2.03905932093 422 19 45 90 105 2.03905932093 424 20 45 90 105 8.15623728373 454 21 45 90 105 8.15623728373 674 22 49 98 322 0.0382611020547 82 23 49 98 322 0.956527551366 80 24 55 115 295 0.0251672670109 316 25 55 115 295 0.0251672670109 313 26 55 115 295 0.0503345340218 509 27 55 115 295 0.0503345340218 826 28 55 115 295 0.226505403098 311 29 55 115 295 0.226505403098 312 30 55 115 295 0.453010806197 318 31 55 115 295 0.453010806197 823 32 64 128 656 0.0260697190491 137 33 64 128 656 0.0521394380982 27 34 64 128 656 0.0521394380982 129 35 64 128 656 0.104278876196 130 36 64 128 656 0.417115504786 25 37 64 128 656 0.417115504786 126 38 71 147 212 0.0223332061013 690 39 71 147 212 0.0446664122026 692 40 71 147 212 0.200998854911 686 41 71 147 212 0.401997709823 687 42 76 168 629 0.028279977903 810 43 76 168 629 0.254519801127 812 44 76 168 629 2.29067821014 807 45 76 168 629 20.6161038913 589 46 76 168 730 0.0309004126628 382 47 76 168 730 0.772510316571 596 48 79 162 344 0.0463869728756 845 49 79 162 344 0.0927739457511 844 50 79 162 344 0.185547891502 530 51 79 162 344 0.371095783004 840 52 80 160 842 0.031339729789 160 53 80 160 842 0.0626794595781 154 54 80 160 842 0.0626794595781 157 55 80 160 842 0.125358919156 164 56 80 160 842 0.282057568101 152 57 80 160 842 0.564115136203 2 58 80 160 842 0.564115136203 196 ... 872 900 1800 927 0.416594784188 701 873 900 1800 927 0.416594784188 706 874 900 1800 927 1.66637913675 703 875 900 1800 927 1.66637913675 705 876 900 1800 931 0.319460414745 348 877 900 1800 931 0.319460414745 342 878 900 1800 931 0.319460414745 344 879 900 1800 931 0.319460414745 352 880 905 1835 144 0.0688927794608 33 881 905 1835 144 3.37574619358 32 882 905 1835 150 0.0309658110664 86 883 905 1835 300 0.0930167181089 766 884 905 1835 300 0.0930167181089 767 885 905 1835 300 0.0930167181089 771 886 905 1835 300 0.372066872435 765 887 909 1827 44 0.0449726681837 573 888 909 1827 202 0.861253037201 645 889 916 2012 685 0.0912564823488 739 890 919 1883 206 0.0280435314678 605 891 919 1883 206 0.25239178321 608 892 919 1883 555 0.0655122196473 650 893 919 1883 555 0.131024439295 647 894 931 2058 323 0.0431694479801 12 895 944 2032 751 0.0800513648166 4 896 944 2032 751 0.160102729633 7 897 956 1932 625 0.0396174633495 796 898 956 1932 682 0.0255380618865 631 899 956 1932 774 0.143306308285 271 900 956 1932 774 0.143306308285 488 901 961 1922 324 0.154494767854 189 902 961 1922 522 0.266235699754 123 903 961 2047 60 0.290076849884 729 904 961 2047 60 0.580153699768 340 905 961 2047 60 1.16030739954 727 906 961 2047 60 2.32061479907 581 907 961 2047 60 2.32061479907 726 908 961 2047 60 4.64122959814 461 909 961 2047 325 0.028209448281 13 910 961 2047 331 0.313163098221 28 911 964 1992 623 0.0662305750165 660 912 964 1992 633 0.0417189282816 842 913 964 1992 633 0.375470354534 838 914 964 1992 633 3.37923319081 524 915 964 1992 681 0.030077104711 747 916 971 1978 173 0.0534327670111 827 917 971 1978 173 0.4808949031 310 918 979 1962 553 0.132240614207 602 919 979 1962 553 0.264481228414 607 920 979 2138 50 0.0384504933231 780 921 979 2138 50 0.0769009866462 782 922 979 2138 556 0.254214633715 699 923 980 1960 818 0.179453525904 266 924 980 1960 818 0.179453525904 268 925 980 1960 818 0.179453525904 274 926 980 1960 818 0.717814103618 263 927 991 1987 200 0.0290506907686 871 928 991 1987 419 0.0678066683293 636 929 991 1987 419 0.135613336659 235 930 995 2215 269 0.038308764188 540 931 995 2215 269 0.076617528376 539 }}} {{{id=124| db2.N1k.count() /// (932,) }}} {{{id=126| def printer(): temp = db2('select a_lbl, b_lbl N,cond1,cond2,weq1,weq2 from N1k ORDER BY N,eta,R,V,U') J=open('/home/psharaba/CompleteList.txt','w') for y in temp: S=[] for entry in y: s=str(entry) s.replace(' ','') S.append(s) J.write(' '.join(S)+'\n') /// }}} {{{id=132| printer() /// }}} {{{id=129| E=EllipticCurve(K,[a,-a-1,a,-23*a-12,-45*a-29]) /// }}} {{{id=130| E.conductor() /// Fractional ideal (22*a - 6) }}} {{{id=135| lbl = '199.2a3' /// }}} {{{id=136| v = lbl.split('.') print v[0], sage.databases.cremona.parse_cremona_label(v[0]) print v[1], sage.databases.cremona.parse_cremona_label(v[1]) /// 199 (199, 'a', 1) 2a3 (2, 'a', 3) }}} {{{id=131| sage.databases.cremona.cremona_letter_code(30) /// 'be' }}} {{{id=133| list(cremona_optimal_curves([1..20])) /// [Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field, Elliptic Curve defined by y^2 + x*y + y = x^3 + 4*x - 6 over Rational Field, Elliptic Curve defined by y^2 + x*y + y = x^3 + x^2 - 10*x - 10 over Rational Field, Elliptic Curve defined by y^2 + x*y + y = x^3 - x^2 - x - 14 over Rational Field, Elliptic Curve defined by y^2 + y = x^3 + x^2 - 9*x - 15 over Rational Field, Elliptic Curve defined by y^2 = x^3 + x^2 + 4*x + 4 over Rational Field] }}} {{{id=141| EllipticCurve('389a') /// Elliptic Curve defined by y^2 + y = x^3 + x^2 - 2*x over Rational Field }}} {{{id=134| # This would give back an iterator over curves with the given conductors or norm conductors (up to conjugates). # LATER: add option to give both each curve and its Galois conjugate. sqrt5_curves([22*a-6,5*a-2] + [31, 199]) /// Traceback (most recent call last): File "", line 1, in File "_sage_input_132.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("IyBUaGlzIHdvdWxkIGdpdmUgYmFjayBhbiBpdGVyYXRvciBvdmVyIGN1cnZlcyB3aXRoIHRoZSBnaXZlbiBjb25kdWN0b3JzIG9yIG5vcm0gY29uZHVjdG9yczoKICAgIApzcXJ0NV9jdXJ2ZXMoWzIyKmEtNl0gKyBbMzEsIDE5OV0p"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/tmp/tmpdwIwzk/___code___.py", line 4, in exec compile(u'sqrt5_curves([_sage_const_22 *a-_sage_const_6 ] + [_sage_const_31 , _sage_const_199 ])' + '\n', '', 'single') File "", line 1, in NameError: name 'sqrt5_curves' is not defined }}} {{{id=148| /// }}} {{{id=137| sqrt5_optimal_curves([ ... ] ) same above, only the "*1" curves. /// Traceback (most recent call last): File "", line 1, in File "_sage_input_133.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("c3FydDVfb3B0aW1hbF9jdXJ2ZXMoWyAuLi4gXSApICBzYW1lIGFib3ZlLCBvbmx5IHRoZSAiYTEiIGN1cnZlcy4="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/tmp/tmpUbhPe9/___code___.py", line 2 sqrt5_optimal_curves([ Ellipsis ] ) same above, only the "a1" curves. ^ SyntaxError: invalid syntax }}} {{{id=138| sqrt5_curve('484b.b2') # outputs EllipticCurve([a+1,0,1,893*a-1430,15172*a-24603]) # default, but have option to give just [a+1,0,1,893*a-1430,15172*a-24603]. /// Traceback (most recent call last): File "", line 1, in File "_sage_input_134.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("c3FydDVfY3VydmUoJzQ4NGIuYjInKQojIG91dHB1dHMgCkVsbGlwdGljQ3VydmUoW2ErMSwwLDEsODkzKmEtMTQzMCwxNTE3MiphLTI0NjAzXSkgICAgIyBkZWZhdWx0LCBidXQgaGF2ZSBvcHRpb24gdG8gZ2l2ZSBqdXN0IFthKzEsMCwxLDg5MyphLTE0MzAsMTUxNzIqYS0yNDYwM10u"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/tmp/tmp4QBEYF/___code___.py", line 3, in sqrt5_curve('484b.b2') NameError: name 'sqrt5_curve' is not defined }}} {{{id=140| /// }}} {{{id=139| /// }}}