{{{id=29| var('weq') /// weq }}} {{{id=83| class sqrt5curves: /// }}} {{{id=36| k /// Traceback (most recent call last): File "", line 1, in File "_sage_input_26.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("aw=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/private/var/folders/SW/SW-cfJI7GnuIEvIMHm0wsk+++Ts/-Tmp-/tmpO1dRib/___code___.py", line 2, in exec compile(u'k' + '\n', '', 'single') File "", line 1, in NameError: name 'k' is not defined }}} {{{id=71| db.data.count() /// Traceback (most recent call last): File "", line 1, in File "_sage_input_124.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("ZGIuZGF0YS5jb3VudCgp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/private/var/folders/SW/SW-cfJI7GnuIEvIMHm0wsk+++Ts/-Tmp-/tmpBBwpsi/___code___.py", line 2, in exec compile(u'db.data.count()' + '\n', '', 'single') File "", line 1, in File "/Applications/Sage-4.7-OSX-64bit-10.6.app/Contents/Resources/sage/nosqlite/nosqlite.py", line 1214, in count return self.database(cmd)[0] File "/Applications/Sage-4.7-OSX-64bit-10.6.app/Contents/Resources/sage/nosqlite/nosqlite.py", line 592, in __call__ return self.client(cmds, t, file=self.name, many=many, coerce=coerce) File "/Applications/Sage-4.7-OSX-64bit-10.6.app/Contents/Resources/sage/nosqlite/nosqlite.py", line 467, in __call__ return self.server.execute(cmd, t, file, many) File "/Applications/Sage-4.7-OSX-64bit-10.6.app/Contents/Resources/sage/nosqlite/nosqlite.py", line 350, in execute o = cursor.execute(c) sqlite3.OperationalError: no such table: data }}} {{{id=84| open(DATA+'localdb2') /// Traceback (most recent call last): File "", line 1, in File "_sage_input_16.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("b3BlbihEQVRBKydsb2NhbGRiMicp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/tmp/tmp11QkHt/___code___.py", line 2, in exec compile(u"open(DATA+'localdb2')" + '\n', '', 'single') File "", line 1, in IOError: [Errno 2] No such file or directory: '/home/psharaba/.sage/sage_notebook.sagenb/home/admin/29/data/localdb2' }}} {{{id=88| open( /// }}} {{{id=89| db. /// }}} {{{id=85| def read(): try: open(DATA+'localdb2') except IOError print 'hi' /// Traceback (most recent call last): File "", line 1, in File "_sage_input_18.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("ZGVmIHJlYWQoKToKICAgIHRyeToKICAgICAgICBvcGVuKERBVEErJ2xvY2FsZGIyJykKICAgIGV4Y2VwdCBJT0Vycm9yIDpbRXJybm8gMjFdOgogICAgICAgIHByaW50ICdoaSc="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/tmp/tmpsCArJE/___code___.py", line 6 except IOError :[Errno _sage_const_21 ]: ^ SyntaxError: invalid syntax }}} {{{id=86| read() /// hi }}} {{{id=30| def read(): import nosqlite db=nosqlite.Client(DATA+'localdb').db try: D= db('select N,weq1 from sq5') except: f=open(DATA+'sqrt5.txt') print 'hello' for r in f.readlines(): A=r.split() db.sq5.insert({'a_lbl': A[0], 'b_lbl': A[1],'N': A[2], 'cond1': A[3], 'cond2': A[4], 'weq1': A[5], 'weq2': A[6]}) /// }}} {{{id=80| db.sq5.count() /// Traceback (most recent call last): File "", line 1, in File "_sage_input_51.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("ZGIuc3E1LmNvdW50KCk="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/private/var/folders/SW/SW-cfJI7GnuIEvIMHm0wsk+++Ts/-Tmp-/tmpD2t4EJ/___code___.py", line 2, in exec compile(u'db.sq5.count()' + '\n', '', 'single') File "", line 1, in AttributeError: 'function' object has no attribute 'sq5' }}} {{{id=81| db.func_ /// }}} {{{id=76| f=open(DATA+'sqrt5.txt') f.readline().split() /// ['31a', 'a1', '31', '5*a-2', '-5*a+3', '[1,a+1,a,a,0]', '[1,-a-1,a,0,0]'] }}} {{{id=82| import nosqlite db=nosqlite.Client(DATA+'localdb').db /// }}} {{{id=35| db.sq5.delete() /// }}} {{{id=79| read() /// hello }}} {{{id=32| db.sq5.count() /// (932,) }}} {{{id=31| read() /// }}} {{{id=16| def sqrt5_curve(label,ainv1=0): #read() v=label.split('.') v1=sage.databases.cremona.parse_cremona_label(v[0]) L1=str(v1[0])+v1[1] try: v2=sage.databases.cremona.parse_cremona_label(v[1]) except ValueError: v2=sage.databases.cremona.parse_cremona_label('1'+v[1]) L2='weq'+str(v2[0]) L3=v2[1]+str(v2[2]) q=db.sq5.find_one(a_lbl=L1, b_lbl=L3)[L2] if ainv1==weq: return eval(q) else: E=EllipticCurve(K,eval(q)) return E /// }}} {{{id=78| list(db.sq5.find(a_lbl='31a', b_lbl='a1')) /// Traceback (most recent call last): File "", line 1, in File "_sage_input_6.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("bGlzdChkYi5zcTUuZmluZChhX2xibD0nMzFhJywgYl9sYmw9J2ExJykp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/private/var/folders/SW/SW-cfJI7GnuIEvIMHm0wsk+++Ts/-Tmp-/tmpa3ldD9/___code___.py", line 2, in exec compile(u"list(db.sq5.find(a_lbl='31a', b_lbl='a1'))" + '\n', '', 'single') File "", line 1, in AttributeError: 'function' object has no attribute 'sq5' }}} {{{id=77| sqrt5_curve('31a.',weq) /// [1, a + 1, a, a, 0] }}} {{{id=61| cond=['6', '5*a-2'] /// }}} {{{id=90| zz=eval("'%s' or '%s'" % (cond[0], cond[1])) /// }}} {{{id=91| /// }}} {{{id=60| Norm1="'6'" /// }}} {{{id=64| Norm1+=' '+str('or'+ str(cond[1])) /// }}} {{{id=59| Norm1+=' '+"or '5*a-2'" /// }}} {{{id=63| Norm1 /// "'6' or '5*a-2'" }}} {{{id=58| eval(Norm1) /// 6 }}} {{{id=62| list(db.sq5.find(cond1=zz)) /// Traceback (most recent call last): File "", line 1, in File "_sage_input_28.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("bGlzdChkYi5zcTUuZmluZChjb25kMT16eikp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/tmp/tmpO4OFoR/___code___.py", line 2, in exec compile(u'list(db.sq5.find(cond1=zz))' + '\n', '', 'single') File "", line 1, in AttributeError: 'function' object has no attribute 'sq5' }}} {{{id=65| norm=['6','5*a-2'] /// }}} {{{id=57| def sqrt5_curves(norm=[], cond=[], rank=[], tor=[]): /// }}} {{{id=40| data=str(6).replace(' ','') /// }}} {{{id=44| cond=['6', '6*a-3', '5*a-2'] /// }}} {{{id=48| cond1="'6'" /// }}} {{{id=95| cond1=cond1 +' '+"and '%s'" % (cond[1]) /// }}} {{{id=96| cond1+=' '+"and '%s'" % (cond[2]) /// }}} {{{id=97| cond1 /// "'6' and '6*a-3' and '5*a-2'" }}} {{{id=49| cond1.append('or cond[1]') /// }}} {{{id=47| A='6' or '5*a-2'; /// '6' }}} {{{id=46| list(db.sq5.find(cond1=A1)) /// [] }}} {{{id=45| cond=[] /// }}} {{{id=43| str(data)+'or'+str(5*a-2) /// '6or5*a - 2' }}} {{{id=92| golf="or '%s'" % (norm[0]);golf /// "or '31'" }}} {{{id=94| list(db.sq5.find(cond1='12*a-10','N=31 or N=36')) /// Traceback (most recent call last): File "", line 1, in File "_sage_input_281.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("bGlzdChkYi5zcTUuZmluZChjb25kMT0nMTIqYS0xMCcsIk49MzEgb3IgTj0zNiIpKQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/tmp/tmpyqNnyR/___code___.py", line 2 list(db.sq5.find(cond1='12*a-10',"N=31 or N=36")) SyntaxError: non-keyword arg after keyword arg }}} {{{id=93| list(db.sq5.find(cond1='6' or '5*a-2')) /// [{u'cond1': u'6', u'weq2': u'[a+1,a,a,0,0]', u'weq1': u'[a+1,a,a,0,0]', u'cond2': u'6', u'b_lbl': u'a1', u'N': 36, u'a_lbl': u'36a'}, {u'cond1': u'6', u'weq2': u'[a+1,a,a,-10*a-10,10*a+10]', u'weq1': u'[a+1,a,a,-10*a-10,10*a+10]', u'cond2': u'6', u'b_lbl': u'a2', u'N': 36, u'a_lbl': u'36a'}, {u'cond1': u'6', u'weq2': u'[a+1,a,a,-165*a-165,-1683*a-1221]', u'weq1': u'[a+1,a,a,-165*a-165,-1683*a-1221]', u'cond2': u'6', u'b_lbl': u'a3', u'N': 36, u'a_lbl': u'36a'}, {u'cond1': u'6', u'weq2': u'[a+1,a,a,-5*a-5,-51*a-37]', u'weq1': u'[a+1,a,a,-5*a-5,-51*a-37]', u'cond2': u'6', u'b_lbl': u'a4', u'N': 36, u'a_lbl': u'36a'}] }}} {{{id=41| list(db.sq5.find(cond1=golf)) /// [{u'cond1': u'6', u'weq2': u'[a+1,a,a,0,0]', u'weq1': u'[a+1,a,a,0,0]', u'cond2': u'6', u'b_lbl': u'a1', u'N': 36, u'a_lbl': u'36a'}, {u'cond1': u'6', u'weq2': u'[a+1,a,a,-10*a-10,10*a+10]', u'weq1': u'[a+1,a,a,-10*a-10,10*a+10]', u'cond2': u'6', u'b_lbl': u'a2', u'N': 36, u'a_lbl': u'36a'}, {u'cond1': u'6', u'weq2': u'[a+1,a,a,-165*a-165,-1683*a-1221]', u'weq1': u'[a+1,a,a,-165*a-165,-1683*a-1221]', u'cond2': u'6', u'b_lbl': u'a3', u'N': 36, u'a_lbl': u'36a'}, {u'cond1': u'6', u'weq2': u'[a+1,a,a,-5*a-5,-51*a-37]', u'weq1': u'[a+1,a,a,-5*a-5,-51*a-37]', u'cond2': u'6', u'b_lbl': u'a4', u'N': 36, u'a_lbl': u'36a'}] }}} {{{id=42| list(db.sq5.find(cond1='6' and '5*a-2')) /// [{u'cond1': u'5*a-2', u'weq2': u'[1,-a-1,a,0,0]', u'weq1': u'[1,a+1,a,a,0]', u'cond2': u'-5*a+3', u'b_lbl': u'a1', u'N': 31, u'a_lbl': u'31a'}, {u'cond1': u'5*a-2', u'weq2': u'[a+1,-a-1,a,15*a-27,-40*a+64]', u'weq1': u'[a,-1,a+1,-17*a-11,39*a+24]', u'cond2': u'-5*a+3', u'b_lbl': u'a2', u'N': 31, u'a_lbl': u'31a'}, {u'cond1': u'5*a-2', u'weq2': u'[a,-1,a,1786*a-2891,-44002*a+71196]', u'weq1': u'[a+1,-a-1,a+1,-1788*a-1105,44001*a+27194]', u'cond2': u'-5*a+3', u'b_lbl': u'a3', u'N': 31, u'a_lbl': u'31a'}, {u'cond1': u'5*a-2', u'weq2': u'[1,-a-1,a,-40*a-30,-130*a-76]', u'weq1': u'[1,a+1,a,41*a-70,170*a-276]', u'cond2': u'-5*a+3', u'b_lbl': u'a4', u'N': 31, u'a_lbl': u'31a'}, {u'cond1': u'5*a-2', u'weq2': u'[1,-a-1,a,-30*a-45,-111*a-117]', u'weq1': u'[1,a+1,a,31*a-75,141*a-303]', u'cond2': u'-5*a+3', u'b_lbl': u'a5', u'N': 31, u'a_lbl': u'31a'}, {u'cond1': u'5*a-2', u'weq2': u'[a+1,a+1,a+1,-32196*a-19898,-3371682*a-2083814]', u'weq1': u'[a,a,a+1,32197*a-52096,3319586*a-5371204]', u'cond2': u'-5*a+3', u'b_lbl': u'a6', u'N': 31, u'a_lbl': u'31a'}] }}} {{{id=39| qcond=[] /// }}} {{{id=54| cond.append(EllipticCurve(K,[1,a+1,a,a,0])) /// }}} {{{id=100| norm=[31] /// }}} {{{id=101| norm1='N=%d' % norm[0] /// }}} {{{id=105| norm=[31,36, 199] /// }}} {{{id=106| norm1="%d" % norm[0];norm1 /// '31' }}} {{{id=107| norm1+=' '+"or N=%d" % norm[2];norm1 /// 'N=31 or N=36 or N=199' }}} {{{id=104| test='31 or 36' /// }}} {{{id=108| list(db.sq5.find('%s' % (norm1))) /// [{u'cond1': u'5*a-2', u'weq2': u'[1,-a-1,a,0,0]', u'weq1': u'[1,a+1,a,a,0]', u'cond2': u'-5*a+3', u'b_lbl': u'a1', u'N': 31, u'a_lbl': u'31a'}, {u'cond1': u'5*a-2', u'weq2': u'[a+1,-a-1,a,15*a-27,-40*a+64]', u'weq1': u'[a,-1,a+1,-17*a-11,39*a+24]', u'cond2': u'-5*a+3', u'b_lbl': u'a2', u'N': 31, u'a_lbl': u'31a'}, {u'cond1': u'5*a-2', u'weq2': u'[a,-1,a,1786*a-2891,-44002*a+71196]', u'weq1': u'[a+1,-a-1,a+1,-1788*a-1105,44001*a+27194]', u'cond2': u'-5*a+3', u'b_lbl': u'a3', u'N': 31, u'a_lbl': u'31a'}, {u'cond1': u'5*a-2', u'weq2': u'[1,-a-1,a,-40*a-30,-130*a-76]', u'weq1': u'[1,a+1,a,41*a-70,170*a-276]', u'cond2': u'-5*a+3', u'b_lbl': u'a4', u'N': 31, u'a_lbl': u'31a'}, {u'cond1': u'5*a-2', u'weq2': u'[1,-a-1,a,-30*a-45,-111*a-117]', u'weq1': u'[1,a+1,a,31*a-75,141*a-303]', u'cond2': u'-5*a+3', u'b_lbl': u'a5', u'N': 31, u'a_lbl': u'31a'}, {u'cond1': u'5*a-2', u'weq2': u'[a+1,a+1,a+1,-32196*a-19898,-3371682*a-2083814]', u'weq1': u'[a,a,a+1,32197*a-52096,3319586*a-5371204]', u'cond2': u'-5*a+3', u'b_lbl': u'a6', u'N': 31, u'a_lbl': u'31a'}, {u'cond1': u'6', u'weq2': u'[a+1,a,a,0,0]', u'weq1': u'[a+1,a,a,0,0]', u'cond2': u'6', u'b_lbl': u'a1', u'N': 36, u'a_lbl': u'36a'}, {u'cond1': u'6', u'weq2': u'[a+1,a,a,-10*a-10,10*a+10]', u'weq1': u'[a+1,a,a,-10*a-10,10*a+10]', u'cond2': u'6', u'b_lbl': u'a2', u'N': 36, u'a_lbl': u'36a'}, {u'cond1': u'6', u'weq2': u'[a+1,a,a,-165*a-165,-1683*a-1221]', u'weq1': u'[a+1,a,a,-165*a-165,-1683*a-1221]', u'cond2': u'6', u'b_lbl': u'a3', u'N': 36, u'a_lbl': u'36a'}, {u'cond1': u'6', u'weq2': u'[a+1,a,a,-5*a-5,-51*a-37]', u'weq1': u'[a+1,a,a,-5*a-5,-51*a-37]', u'cond2': u'6', u'b_lbl': u'a4', u'N': 36, u'a_lbl': u'36a'}, {u'cond1': u'-3*a+16', u'weq2': u'[0,-a-1,1,a,0]', u'weq1': u'[0,a+1,1,a,0]', u'cond2': u'3*a+13', u'b_lbl': u'a1', u'N': 199, u'a_lbl': u'199a'}, {u'cond1': u'-3*a+16', u'weq2': u'[0,-a-1,1,11*a-10,6*a-21]', u'weq1': u'[0,a+1,1,-9*a,-16*a-15]', u'cond2': u'3*a+13', u'b_lbl': u'a2', u'N': 199, u'a_lbl': u'199a'}, {u'cond1': u'-3*a+16', u'weq2': u'[0,a+1,1,28665*a-46382,2797026*a-4525688]', u'weq1': u'[0,-a-1,1,-28663*a-17718,-2768362*a-1710944]', u'cond2': u'3*a+13', u'b_lbl': u'a3', u'N': 199, u'a_lbl': u'199a'}, {u'cond1': u'-3*a+16', u'weq2': u'[0,0,1,-4*a-5,6*a+5]', u'weq1': u'[0,0,1,4*a-9,-6*a+11]', u'cond2': u'3*a+13', u'b_lbl': u'b1', u'N': 199, u'a_lbl': u'199a'}, {u'cond1': u'-3*a+16', u'weq2': u'[0,0,1,317*a-503,3180*a-5146]', u'weq1': u'[0,0,1,-317*a-186,-3180*a-1966]', u'cond2': u'3*a+13', u'b_lbl': u'b2', u'N': 199, u'a_lbl': u'199a'}, {u'cond1': u'-3*a+16', u'weq2': u'[1,-1,a,-2,-1]', u'weq1': u'[1,-1,a+1,-a-2,-a-1]', u'cond2': u'3*a+13', u'b_lbl': u'c1', u'N': 199, u'a_lbl': u'199a'}, {u'cond1': u'-3*a+16', u'weq2': u'[a,-a-1,a,-69*a-43,-286*a-177]', u'weq1': u'[a+1,1,0,70*a-111,355*a-574]', u'cond2': u'3*a+13', u'b_lbl': u'c2', u'N': 199, u'a_lbl': u'199a'}] }}} {{{id=103| list(db.sq5.find("N=%s" % (eval(norm1)))) /// [{u'cond1': u'5*a-2', u'weq2': u'[1,-a-1,a,0,0]', u'weq1': u'[1,a+1,a,a,0]', u'cond2': u'-5*a+3', u'b_lbl': u'a1', u'N': 31, u'a_lbl': u'31a'}, {u'cond1': u'5*a-2', u'weq2': u'[a+1,-a-1,a,15*a-27,-40*a+64]', u'weq1': u'[a,-1,a+1,-17*a-11,39*a+24]', u'cond2': u'-5*a+3', u'b_lbl': u'a2', u'N': 31, u'a_lbl': u'31a'}, {u'cond1': u'5*a-2', u'weq2': u'[a,-1,a,1786*a-2891,-44002*a+71196]', u'weq1': u'[a+1,-a-1,a+1,-1788*a-1105,44001*a+27194]', u'cond2': u'-5*a+3', u'b_lbl': u'a3', u'N': 31, u'a_lbl': u'31a'}, {u'cond1': u'5*a-2', u'weq2': u'[1,-a-1,a,-40*a-30,-130*a-76]', u'weq1': u'[1,a+1,a,41*a-70,170*a-276]', u'cond2': u'-5*a+3', u'b_lbl': u'a4', u'N': 31, u'a_lbl': u'31a'}, {u'cond1': u'5*a-2', u'weq2': u'[1,-a-1,a,-30*a-45,-111*a-117]', u'weq1': u'[1,a+1,a,31*a-75,141*a-303]', u'cond2': u'-5*a+3', u'b_lbl': u'a5', u'N': 31, u'a_lbl': u'31a'}, {u'cond1': u'5*a-2', u'weq2': u'[a+1,a+1,a+1,-32196*a-19898,-3371682*a-2083814]', u'weq1': u'[a,a,a+1,32197*a-52096,3319586*a-5371204]', u'cond2': u'-5*a+3', u'b_lbl': u'a6', u'N': 31, u'a_lbl': u'31a'}] }}} {{{id=55| cond /// [Elliptic Curve defined by y^2 + x*y + a*y = x^3 + (a+1)*x^2 + a*x over Number Field in a with defining polynomial x^2 - x - 1] }}} {{{id=98| list(sqrt5_curves(['6','5*a-2'])) /// '6' or '5*a-2' [{u'cond1': u'6', u'weq2': u'[a+1,a,a,0,0]', u'weq1': u'[a+1,a,a,0,0]', u'cond2': u'6', u'b_lbl': u'a1', u'N': 36, u'a_lbl': u'36a'}, {u'cond1': u'6', u'weq2': u'[a+1,a,a,-10*a-10,10*a+10]', u'weq1': u'[a+1,a,a,-10*a-10,10*a+10]', u'cond2': u'6', u'b_lbl': u'a2', u'N': 36, u'a_lbl': u'36a'}, {u'cond1': u'6', u'weq2': u'[a+1,a,a,-165*a-165,-1683*a-1221]', u'weq1': u'[a+1,a,a,-165*a-165,-1683*a-1221]', u'cond2': u'6', u'b_lbl': u'a3', u'N': 36, u'a_lbl': u'36a'}, {u'cond1': u'6', u'weq2': u'[a+1,a,a,-5*a-5,-51*a-37]', u'weq1': u'[a+1,a,a,-5*a-5,-51*a-37]', u'cond2': u'6', u'b_lbl': u'a4', u'N': 36, u'a_lbl': u'36a'}] }}} {{{id=99| "and %d" % (101) /// 'and 101' }}} {{{id=69| list(sqrt5_curves(['6','12*a-10'], [31, 36])) /// N=31 and N=36 [] }}} {{{id=70| /// }}} {{{id=37| def sqrt5_optiomal_curves(b,n=0,ainv1=0): #read() if b<31: b=31 A=db('select N,weq1 from sq5 WHERE b_lbl LIKE "%1"') if n==0: for r in range(len(A)): if A[r][0] >= 31 and A[r][0] <= b: yield EllipticCurve(K,eval(A[r][1])) if n==weq: for r in range(len(A)): if A[r][0] >= 31 and A[r][0] <= b: yield eval(A[r][1]) if ainv1==weq: for r in range(len(A)): if A[r][0] >= b and A[r][0] <= n: yield eval(A[r][1]) else: for r in range(len(A)): if A[r][0] >= b and A[r][0] <= n: yield (EllipticCurve(K,eval(A[r][1]))) /// }}} {{{id=56| list(sqrt5_optiomal_curves(100)) /// [Elliptic Curve defined by y^2 + x*y + a*y = x^3 + (a+1)*x^2 + a*x over Number Field in a with defining polynomial x^2 - x - 1, Elliptic Curve defined by y^2 + (a+1)*x*y + a*y = x^3 + a*x^2 over Number Field in a with defining polynomial x^2 - x - 1, Elliptic Curve defined by y^2 + a*y = x^3 + (-a)*x^2 over Number Field in a with defining polynomial x^2 - x - 1, Elliptic Curve defined by y^2 + x*y + y = x^3 + x^2 + (-80)*x + 242 over Number Field in a with defining polynomial x^2 - x - 1, Elliptic Curve defined by y^2 + y = x^3 + (-a+1)*x^2 + x over Number Field in a with defining polynomial x^2 - x - 1, Elliptic Curve defined by y^2 + x*y + y = x^3 + (-a+1)*x^2 + (-a)*x over Number Field in a with defining polynomial x^2 - x - 1, Elliptic Curve defined by y^2 = x^3 + (a-1)*x^2 + (-a)*x over Number Field in a with defining polynomial x^2 - x - 1, Elliptic Curve defined by y^2 + a*x*y + a*y = x^3 + (a+1)*x^2 + a*x over Number Field in a with defining polynomial x^2 - x - 1, Elliptic Curve defined by y^2 + (a+1)*x*y + y = x^3 + (-a-1)*x over Number Field in a with defining polynomial x^2 - x - 1, Elliptic Curve defined by y^2 + x*y + a*y = x^3 + (a-2)*x + (-a+1) over Number Field in a with defining polynomial x^2 - x - 1, Elliptic Curve defined by y^2 + (a+1)*x*y + a*y = x^3 + (a-1)*x^2 over Number Field in a with defining polynomial x^2 - x - 1, Elliptic Curve defined by y^2 = x^3 + x^2 + (-1)*x over Number Field in a with defining polynomial x^2 - x - 1, Elliptic Curve defined by y^2 + x*y + a*y = x^3 + (-1)*x^2 + (-2*a)*x + a over Number Field in a with defining polynomial x^2 - x - 1, Elliptic Curve defined by y^2 + a*x*y + y = x^3 + (-a)*x^2 + (-1)*x over Number Field in a with defining polynomial x^2 - x - 1, Elliptic Curve defined by y^2 + a*x*y + a*y = x^3 + (a+1)*x^2 + (2*a-5)*x + (-4*a+2) over Number Field in a with defining polynomial x^2 - x - 1, Elliptic Curve defined by y^2 + a*x*y = x^3 + (-a+1)*x^2 + (-4)*x + (3*a-5) over Number Field in a with defining polynomial x^2 - x - 1, Elliptic Curve defined by y^2 + x*y + y = x^3 + x^2 + (-3)*x + 1 over Number Field in a with defining polynomial x^2 - x - 1, Elliptic Curve defined by y^2 + (a+1)*x*y + (a+1)*y = x^3 + a*x^2 + (-25*a-25)*x + (53*a+46) over Number Field in a with defining polynomial x^2 - x - 1] }}} {{{id=75| db.sq5.columns() /// [u'cond1', u'weq2', u'weq1', u'cond2', u'a_lbl', u'b_lbl'] }}} {{{id=66| db2=nosqlite.Client('/Users/sharaba/Desktop/ECdb').db /// }}} {{{id=25| label='31a.a1' v=label.split('.') print v v1=sage.databases.cremona.parse_cremona_label(v[0]) print v1 L1=str(v1[0])+v1[1]+str(v1[2]) print L1 /// ['31a', 'a1'] (31, 'a', 1) 31a1 }}} {{{id=26| db.sq5.find_one(a_lbl='31a1') /// Traceback (most recent call last): File "", line 1, in File "_sage_input_70.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("ZGIuc3E1LmZpbmRfb25lKGFfbGJsPSczMWExJyk="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/private/var/folders/SW/SW-cfJI7GnuIEvIMHm0wsk+++Ts/-Tmp-/tmpkzdp5o/___code___.py", line 2, in exec compile(u"db.sq5.find_one(a_lbl='31a1')" + '\n', '', 'single') File "", line 1, in File "/Applications/Sage-4.7-OSX-64bit-10.6.app/Contents/Resources/sage/nosqlite/nosqlite.py", line 1153, in find_one raise ValueError, "found nothing" ValueError: found nothing }}} {{{id=17| K.=NumberField(x^2-x-1) import nosqlite db=nosqlite.Client(DATA+'localdb').db f=open('/home/psharaba/CompleteList.txt') /// }}} {{{id=34| db.sq5.delete() /// }}} {{{id=18| for r in f.readlines(): A=r.split() db.sq5.insert({'a_lbl': A[0], 'b_lbl': A[1], 'N': int(A[2]), 'cond1': A[3], 'cond2': A[4], 'weq1': A[5], 'weq2': A[6]}) /// }}} {{{id=24| B=str(31)+'a';B /// '31a' }}} {{{id=23| db.sq5.find_one(a_lbl=B) /// {u'cond1': u'5*a-2', u'weq2': u'[1,-a-1,a,0,0]', u'weq1': u'[1,a+1,a,a,0]', u'cond2': u'-5*a+3', u'b_lbl': u'a1', u'N': 31, u'a_lbl': u'31a'} }}} {{{id=22| db.sq5.find_one(a_lbl=str(31)+'a', b_lbl='a'+str(1)) /// {u'cond1': u'5*a-2', u'weq2': u'[1,-a-1,a,0,0]', u'weq1': u'[1,a+1,a,a,0]', u'cond2': u'-5*a+3', u'b_lbl': u'a1', u'N': 31, u'a_lbl': u'31a'} }}} {{{id=19| sqrt5_curve('855a.c1') /// Traceback (most recent call last): File "", line 1, in File "_sage_input_9.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("c3FydDVfY3VydmUoJzg1NWEuYzEnKQ=="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/tmp/tmplJuq4b/___code___.py", line 2, in exec compile(u"sqrt5_curve('855a.c1')" + '\n', '', 'single') File "", line 1, in NameError: name 'sqrt5_curve' is not defined }}} {{{id=20| L1 /// Traceback (most recent call last): File "", line 1, in File "_sage_input_25.py", line 10, in exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("TDE="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in File "/private/var/folders/SW/SW-cfJI7GnuIEvIMHm0wsk+++Ts/-Tmp-/tmpCeqVcz/___code___.py", line 2, in exec compile(u'L1' + '\n', '', 'single') File "", line 1, in NameError: name 'L1' is not defined }}} {{{id=21| /// }}}