{{{id=1| K.=NumberField(x^2-x-1) import nosqlite db=nosqlite.Client(DATA+'localdb').db db2=nosqlite.Client('/home/psharaba/table/ECdb').db from psage.ellcurve.minmodel.sqrt5 import canonical_model f=open('/home/psharaba/CLIsogeniesU.txt') g=open('/home/psharaba/CLlistU.txt') /// }}} {{{id=4| g.readline().split() /// ['124', '10*a-4', '[a+1,a-1,a+1,5*a-16,4*a-21]', 'matrix(6,[0,2,3,3,0,0,2,0,0,0,3,3,3,0,0,0,0,2,3,0,0,0,2,0,0,3,0,2,0,0,0,3,2,0,0,0])'] }}} {{{id=5| for s in f.readlines(): A=s.split() db.CLI.insert({'N':int(A[0]), 'cond':A[1], 'weq':A[2], 'rlow':A[3], 'rhi':A[4], 'sign':A[5], 'tor':A[6], 'ordD':A[7], 'ordj':A[8], 'tama':A[9], 'kod':A[10], 'mtrx':A[11]}) /// }}} {{{id=6| for t in g.readlines(): B=t.split() db.CL.insert({'N':int(B[0]), 'cond':B[1], 'weq':B[2], 'mtrx':B[3]}) /// }}} {{{id=7| def eta(alpha): return (alpha*alpha).trace() def find_small(alpha): while True: plus=a*alpha minus=alpha/a if eta(plus)full_output.txt {'Lstar': 0.74430627997559418} [a+1,a-1,a+1,5*a-16,4*a-21] {'Lstar': 0.74430627997559418} [a+1,a-1,a+1,-35*a-56,-260*a-117] {'Lstar': 0.74430627997559418} [a+1,a-1,a+1,-1,-a+1] {'Lstar': 0.74430627997559418} [a+1,a-1,a+1,465*a-1316,8192*a-18821] {'Lstar': 0.74430627997559418} [a+1,a-1,a+1,-3305*a-3646,-139218*a-109925] {'Lstar': 0.74430627997559418} [a+1,a-1,a+1,10*a-21,-33*a+51] {'Lstar': 0.78701822832939261} [0,-a+1,0,2*a+3,-13*a-9] {'Lstar': 0.78701822832939261} [0,-a+1,0,-3*a-2,-2*a-2] {'Lstar': 0.78701822832939261} [0,-a+1,0,-48*a-32,-188*a-116] {'Lstar': 0.78701822832939261} [0,-a+1,0,-3*a-17,31*a-14] {'Lstar': 0.81017526826307285} [0,a+1,a,-9*a-9,-31*a-23] {'Lstar': 0.81017526826307285} [0,a+1,a,a+1,0] {'Lstar': 0.77639467373455751} [a+1,a-1,0,20*a-33,42*a-71] {'Lstar': 0.77639467373455751} [a+1,a-1,0,2,a-1] {'Lstar': 0.83744898378826638} [1,0,1,-19,26] {'Lstar': 0.83744898378826638} [1,0,1,-69,-194] {'Lstar': 0.83744898378826638} [1,0,1,1,2] {'Lstar': 0.83744898378826638} [1,0,1,-289,1862] {'Lstar': 0.83744898378826638} [1,0,1,-334,-2368] {'Lstar': 0.83744898378826638} [1,0,1,-5334,-150368] {'Lstar': 0.83744898378826638} [1,0,1,-14,-64] {'Lstar': 0.83744898378826638} [1,0,1,-454,-544] {'Lstar': 0.87781677175583817} [1,0,1,4,-6] {'Lstar': 0.87781677175583817} [1,0,1,-36,-70] {'Lstar': 0.87781677175583817} [1,0,1,-171,-874] {'Lstar': 0.87781677175583817} [1,0,1,-1,0] {'Lstar': 0.87781677175583817} [1,0,1,-2731,-55146] {'Lstar': 0.87781677175583817} [1,0,1,-11,12] {'Lstar': 0.65781488300995983} [0,a+1,1,-9*a,-16*a-15] {'Lstar': 0.65781488300995983} ... {'Lstar': 1.5108562088745863} [a,0,1,-a,0] {'Lstar': 1.5108562088745863} [a,0,1,104*a-310,946*a-2218] {'Lstar': 1.3481693072243983} [a,a-1,a+1,-7*a-5,6*a+4] {'Lstar': 1.3481693072243983} [a,a-1,a+1,3*a-10,12*a+31] {'Lstar': 1.3481693072243983} [a,a-1,a+1,-2*a,-a-1] {'Lstar': 1.3481693072243983} [a,a-1,a+1,-97*a-80,588*a+337] {'Lstar': 1.3229981898760828} [a+1,-a+1,1,-9*a-8,12*a+11] {'Lstar': 1.3229981898760828} [a+1,-a+1,1,a-3,1] {'Lstar': 1.1925645460013397} [0,1,0,27*a-47,-79*a+127] {'Lstar': 1.1925645460013397} [0,1,0,2*a-2,-a+2] {'Lstar': 1.1925645460013397} [0,1,0,-13*a-167,-223*a-697] {'Lstar': 1.1925645460013397} [0,1,0,-18*a+18,11*a-38] {'Lstar': 1.6522282407481246} [1,1,a,7*a-15,15*a-32] {'Lstar': 1.6522282407481246} [1,1,a,-3*a,-2*a-3] {'Lstar': 1.40058926314229} [a+1,a+1,1,-5*a-4,-8*a-3] {'Lstar': 1.40058926314229} [a+1,a+1,1,5*a+1,4*a+3] {'Lstar': 1.0734978268437574} [a+1,-a-1,1,-93*a-93,-525*a-394] {'Lstar': 1.0734978268437574} [a+1,-a-1,1,-1443*a-1443,-37245*a-27934] {'Lstar': 1.0734978268437574} [a+1,-a-1,1,7*a+7,-45*a-34] {'Lstar': 1.0734978268437574} [a+1,-a-1,1,-343*a-343,3875*a+2906] {'Lstar': 1.0734978268437574} [a+1,-a-1,1,-1668*a-1668,47355*a+35516] {'Lstar': 1.0734978268437574} [a+1,-a-1,1,-2268*a-2268,10875*a+8156] {'Lstar': 1.0734978268437574} [a+1,-a-1,1,-68*a-68,1275*a+956] {'Lstar': 1.0734978268437574} [a+1,-a-1,1,-26668*a-26668,3007355*a+2255516] {'Lstar': 1.2019710128250896} [a+1,-a+1,0,-4,a-6] {'Lstar': 1.2019710128250896} [a+1,-a+1,0,5*a-74,34*a-287] {'Lstar': 1.2019710128250896} [a+1,-a+1,0,-5*a-14,12*a+11] {'Lstar': 1.2019710128250896} [a+1,-a+1,0,1,0] {'Lstar': 1.3023248577549955} [a+1,-a+1,a,3*a-7,6] {'Lstar': 1.3023248577549955} [a+1,-a+1,a,-2*a-2,a-1] }}} {{{id=8| k=0 for s in range(len(test)): ainv=test[s][1] E=EllipticCurve(K,eval(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]) k+=1 print Lstar print k db.CLI.update({'Lstar':Lstar},weq=ainv) /// 0.744306279976 1 Traceback (most recent call last): v=F.lseries().dokchitser() File "", line 1, in File "/tmp/tmpp0CxWY/___code___.py", line 4, in exec compile(u"for s in range(len(test)):\n ainv=test[s][_sage_const_1 ]\n E=EllipticCurve(K,eval(ainv))\n E=canonical_model(E.global_minimal_model())\n F=EllipticCurve(K,list(E.short_weierstrass_model().a_invariants()))\n v=F.lseries().dokchitser()\n f=v.taylor_series(_sage_const_1 ,_sage_const_6 )\n r_an=_sage_const_0 \n while abs(f[r_an])<_sage_const_1en10 :\n r_an+=_sage_const_1 \n if r_an == _sage_const_6 :\n raise RuntimeError\n Lstar=float(f[r_an])\n k+=_sage_const_1 \n print Lstar\n print k\n db.CLI.update({'Lstar':Lstar},weq=ainv)" + '\n', '', 'single') File "", line 17, in File "/home/wstein/nosqlite/nosqlite.py", line 934, in update self._add_columns(new_cols) File "/home/wstein/nosqlite/nosqlite.py", line 1135, in _add_columns self.database('ALTER TABLE "%s" ADD COLUMN "%s"'%(self.name, col)) File "/home/wstein/nosqlite/nosqlite.py", line 592, in __call__ return self.client(cmds, t, file=self.name, many=many, coerce=coerce) File "/home/wstein/nosqlite/nosqlite.py", line 467, in __call__ return self.server.execute(cmd, t, file, many) File "/home/wstein/nosqlite/nosqlite.py", line 350, in execute o = cursor.execute(c) sqlite3.OperationalError: duplicate column name: Lstar }}} {{{id=9| test=db('select cond,weq from CLI ORDER BY N') /// }}} {{{id=12| eval(test[0][0]) /// 10*a - 4 }}} {{{id=10| data=[] for s in range(len(test)): #A=K.ideal(eval(test[s][0])) #T=eta_ideal(A) data.append(test[s][1]) #db.CLI.update({'eta':int(T)},weq=test[s][1]) /// }}} {{{id=17| for s in range(len(test)): A=test[s][1] B=f_height(eval(A)) C=n_height(eval(A)) db.CLI.update({'fh':float(B), 'nh':float(C)},weq=A) /// }}} {{{id=21| /// Traceback (most recent call last): File "", line 1, in File "_sage_input_72.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("ZGIuQ0xJLmZpbmQoKVsnbmgnXQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/tmp/tmpO6fEBc/___code___.py", line 2, in exec compile(u"db.CLI.find()['nh']" + '\n', '', 'single') File "", line 1, in TypeError: 'generator' object is unsubscriptable }}} {{{id=22| len(data) /// 232 }}} {{{id=23| test=db('select Lstar,fh,nh from CLI ORDER BY N,eta,Lstar,fh,nh') /// }}} {{{id=24| for s in range(len(test)): print test[s][0] /// WARNING: Output truncated! full_output.txt 0.744306279976 0.744306279976 0.744306279976 0.744306279976 0.744306279976 0.744306279976 0.787018228329 0.787018228329 0.787018228329 0.787018228329 0.810175268263 0.810175268263 0.776394673735 0.776394673735 0.837448983788 0.837448983788 0.837448983788 0.837448983788 0.837448983788 0.837448983788 0.837448983788 0.837448983788 0.877816771756 0.877816771756 0.877816771756 0.877816771756 0.877816771756 0.877816771756 0.65781488301 0.65781488301 0.65781488301 0.788973030839 0.788973030839 0.788973030839 0.788973030839 0.858093423821 0.858093423821 0.858093423821 0.858093423821 0.858093423821 0.858093423821 1.01919569269 1.01919569269 1.01919569269 1.01919569269 1.01919569269 1.01919569269 1.01919569269 1.01919569269 1.01919569269 1.01919569269 0.895137043731 0.895137043731 0.895137043731 0.895137043731 0.948764605694 0.948764605694 0.948764605694 0.992576504984 ... 1.19943679382 1.19943679382 1.19943679382 1.3175102718 1.3175102718 1.3175102718 1.3175102718 1.5258567169 1.5258567169 1.24091429536 1.24091429536 1.28518138673 1.28518138673 1.50855362857 1.50855362857 1.50855362857 1.50855362857 1.50855362857 1.50855362857 1.581657216 1.581657216 1.03019431847 1.03019431847 1.03019431847 1.03019431847 1.28840002385 1.28840002385 1.27353814662 1.27353814662 1.51085620887 1.51085620887 1.51085620887 1.34816930722 1.34816930722 1.34816930722 1.34816930722 1.32299818988 1.32299818988 1.192564546 1.192564546 1.192564546 1.192564546 1.65222824075 1.65222824075 1.40058926314 1.40058926314 1.07349782684 1.07349782684 1.07349782684 1.07349782684 1.07349782684 1.07349782684 1.07349782684 1.07349782684 1.20197101283 1.20197101283 1.20197101283 1.20197101283 1.30232485775 1.30232485775 }}} {{{id=25| f=open('/home/psharaba/CLlist.txt') /// }}} {{{id=26| f.readline().split() /// ['124', '10*a-4', '[a+1,a-1,a+1,5*a-16,4*a-21]'] }}} {{{id=27| db.f.readline().split()[2] /// '[0,-a+1,0,2*a+3,-13*a-9]' }}} {{{id=28| db.CL.columns() /// [u'weq', u'cond', u'mtrx', u'N'] }}} {{{id=13| db.CLI.columns() /// [u'rhi', u'ordD', u'ordj', u'tor', u'tama', u'kod', u'N', u'rlow', u'weq', u'cond', u'sign', u'mtrx', u'eta', u'fh', u'nh', u'Lstar'] }}} {{{id=29| 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 db2.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[4]), 'rhi': int(c[5]), 'tor': int(c[6]), 'sign': c[7], 'ordD': c[8], 'ordj': c[9], 'tama': c[10], 'kod': c[11],'fh': float(c[13]), 'nh': float(c[14]),'mtrx': c[15],'Lstar': float(c[12]), 'found': 'CLI'}) /// CPU time: 54.11 s, Wall time: 55.43 s }}} {{{id=31| db2.N1k.count() /// (831,) }}} {{{id=35| db.CL.count() /// (62,) }}} {{{id=42| E=EllipticCurve(K,[a,-a,a+1,1027*a+635,-10878*a-6723]) F=canonical_model(E.global_minimal_model()).a_invariants() G=[F[0],F[1],F[2],F[3],F[4]];G /// [a, 0, 1, 4*a, 2*a - 6] }}} {{{id=36| db.CL.columns() /// [u'weq', u'cond', u'mtrx', u'N'] }}} {{{id=32| len(list(db2.N1k.find(found='CLI'))) /// 28 }}} {{{id=34| test2=db2("select N,cond1,ainv1,mtrx from N1k WHERE found='CL' ORDER BY N") /// }}} {{{id=37| for t in range(len(test2)): db2.N1k.update({'mtrx':test2[t][3]}) /// }}} {{{id=43| db2.N1k.count() /// (740,) }}} {{{id=39| type(eval(test2[0][3])) /// }}} {{{id=40| for s in range(len(test2)): if type(eval(test2[s][3])) != type(eval(test2[0][3])): print test2[s] /// }}} {{{id=41| /// }}}