{{{id=3| K.=NumberField(x^2-x-1) import nosqlite db=nosqlite.Client('/home/psharaba/table/ECdb').db from psage.ellcurve.minmodel.sqrt5 import canonical_model /// }}} {{{id=7| db.N1k.columns() /// [u'rhi', u'ordD', u'cond1', u'ainv2', u'ainv1', u'cond2', u'tor', u'tama', u'kod', u'sign', u'rlow', u'eta', u'found', u'N', u'ordj', u'nh', u'Lstar', u'fh', u'mtrx', u'label'] }}} {{{id=4| def eta(alpha): return (alpha*alpha).trace() def find_small(alpha): while True: plus=a*alpha minus=alpha/a if eta(plus) J2.integral_basis()[1][0]: J1,J2 = J2,J1 G1,G2 = G2,G1 h=f_height(eval(G1)) n=n_height(eval(G1)) db.N1k.insert({'N': int(J1.norm()), 'eta': int(eta_ideal(J1)), 'cond1': str(J1.gen(0)).replace(' ',''), 'cond2': str(J2.gen(0)).replace(' ',''), 'ainv1': G1, 'ainv2': G2, 'rlow': int(c[3]), 'rhi': int(c[4]), 'tor': int(c[6]), 'sign': c[5], 'ordD': c[7], 'ordj': c[8], 'tama': c[9], 'kod': c[10],'fh': float(h), 'nh': float(n),'mtrx': c[11],'Lstar': float(c[12]), 'found': 'JI'}) /// CPU time: 1137.35 s, Wall time: 1220.85 s }}} {{{id=21| db.N1k.count() /// (722,) }}} {{{id=12| g=open('/Users/sharaba/table/ECRevised.txt') /// }}} {{{id=13| g.readline().split() /// ['31', '5*a-2', '[1,a+1,a,a,0]', 'matrix(6,[0,2,0,0,0,0,2,0,2,2,0,0,0,2,0,0,2,2,0,2,0,0,0,0,0,0,2,0,0,0,0,0,2,0,0,0])', '0.359928959498'] }}} {{{id=11| %time for s in g.readlines(): b=s.split() h=f_height(eval(b[2])) n=n_height(eval(b[2])) db.N1k.update({'fh':float(h), 'nh': float(n), 'mtrx': b[3],'Lstar':float(b[4])}, ainv1=b[2]) /// CPU time: 598.89 s, Wall time: 649.10 s }}} {{{id=14| temp=db("select N,eta,ainv1,ainv2 from N1k WHERE found='CL' ORDER BY N,eta") /// }}} {{{id=20| len(temp) /// 64 }}} {{{id=29| db.N1k.count() /// (722,) }}} {{{id=22| eval(temp[0][2]) /// [a + 1, a - 1, a + 1, 5*a - 16, 4*a - 21] }}} {{{id=25| def l_func(ainv): E=EllipticCurve(K,ainv) E=canonical_model(E.global_minimal_model()) F=EllipticCurve(K,list(E.short_weierstrass_model().a_invariants())) v=F.lseries().dokchitser() 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 Lstar=float(f[r_an]) return Lstar /// }}} {{{id=15| %time for v in range(len(temp)): h=f_height(eval(temp[v][2])) n=n_height(eval(temp[v][2])) L=l_func(eval(temp[v][2])) db.N1k.update({'fh':float(h), 'nh':float(n),'Lstar':float(L)}, ainv1=temp[v][2]) /// }}} {{{id=28| temp=db('select N,eta,Lstar,fh,nh,cond1,cond2,ainv1,ainv2,rlow,rhi,tor,sign,ordD,ordj,tama,kod,mtrx from N1k ORDER BY N,eta,Lstar,fh,nh') /// }}} {{{id=27| %time 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=1 lastchar2=ord('a') else: if temp[s][1]==temp[s-1][1]: if temp[s][2]==temp[s-1][2]: lastchar2+=1 else: L+=1 lastchar2=ord('a') else: lastchar1+=1 L=1 lastchar2=ord('a') key=str(N)+chr(lastchar1)+str(L)+chr(lastchar2) db.N1k.update({'label': key},ainv1=A[7]) /// CPU time: 0.90 s, Wall time: 2.22 s }}} {{{id=16| temp=db('select label,N,eta,Lstar,fh,nh,cond1,cond2,ainv1,ainv2,rlow,rhi,tor,sign,ordD,ordj,tama,kod from N1k ORDER BY N,eta,Lstar,fh,nh') /// }}} {{{id=17| def printer(): J=open('/home/psharaba/table/Fulllist.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=18| printer() /// }}} {{{id=31| /// }}}