import os.path import gzip import re import sys import time import sage.misc.preparser import subprocess from lmfdb import base from lmfdb.website import dbport base._init(dbport, '') C = base.getDBConnection() hmf_forms = C.hmfs.forms hmf_fields = C.hmfs.fields fields = C.numberfields.fields P = PolynomialRing(Rationals(), 3, ['w', 'e', 'x']) w, e, x = P.gens() def qexpansion(field_label=None): if field_label is None: S = hmf_forms.find({}) else: S = hmf_forms.find({"field_label": field_label}) S = S.sort("label") field_label = None v = S.next() while true:
# This is not a unittest, just a quick script print "importing base" from lmfdb import base from lmfdb.website import dbport print ".....done" print "initializing connection" base._init(dbport, "") print ".....done" print "math_classes, Lfunction" from math_classes import ArtinRepresentation, NumberFieldGaloisGroup assert ArtinRepresentation and NumberFieldGaloisGroup # silence pyflakes from Lfunction import ArtinLfunction assert ArtinLfunction # silence pyflakes print ".....done" # a = ArtinRepresentation(1,"5",2) # b = ArtinRepresentation.find_one({'Dim': 1, 'DBIndex': 1, 'Conductor': '5'}) # c = b.number_field_galois_group() # d = c.artin_representations() # l = ArtinLfunction(dimension = "1", conductor = "5", tim_index = "2") ### ## this was run during nosetests, should not, anyway it is not a ## nice test ## ###k = 0 ### ###for x in ArtinRepresentation.find():
import os.path import gzip import re import sys import time import os import random import glob import pymongo from lmfdb import base from lmfdb.website import dbport from sage.rings.all import ZZ print "calling base._init()" dbport=37010 base._init(dbport, '') print "getting connection" conn = base.getDBConnection() print "setting curves" # curves = conn.elliptic_curves.test curves = conn.elliptic_curves.curves # The following ensure_index command checks if there is an index on # label, conductor, rank and torsion. If there is no index it creates # one. Need: once torsion structure is computed, we should have an # index on that too. curves.ensure_index('label') curves.ensure_index('conductor') curves.ensure_index('rank') curves.ensure_index('torsion')
# If not, it does nothing # This could be improved by working in two passes: one to compute the polredabs and store it, one to link to the other database. # This would be at the expense of further deviating from Tim's original data submission import sys LMFDB_FOLDER = "../../../" sys.path.append(LMFDB_FOLDER) print "Importing sage in base" import lmfdb.base as base from lmfdb.artin_representations.math_classes import NumberFieldGaloisGroup as NF print "Sage loaded" print "getting connection" base._init(37010, "") print "I have it" base.getDBConnection() # Doing an iteration on degrees, so it is easier to stop the script and restart it again for degree in range(1,100): total = NF.collection().find({"TransitiveDegree":degree, "label": {"$exists": False}}).count() tmp = 0 for nf_dict in NF.collection().find({"TransitiveDegree":degree, "label": {"$exists": False}}).sort("QpRts-p", -1): tmp += 1 print tmp, " out of ", total, " at degree ", degree, " (with QpRts-p ", nf_dict["QpRts-p"], ")" from copy import deepcopy nf_dict2 = deepcopy(nf_dict) nf = NF(data=nf_dict)
# This would be at the expense of further deviating from Tim's original data submission from __future__ import print_function import sys LMFDB_FOLDER = "../../../" sys.path.append(LMFDB_FOLDER) print("Importing sage in base") import lmfdb.base as base from lmfdb.artin_representations.math_classes import NumberFieldGaloisGroup as NF print("Sage loaded") print("getting connection") base._init(37010, "") print("I have it") base.getDBConnection() # Doing an iteration on degrees, so it is easier to stop the script and restart it again for degree in range(1, 100): total = NF.collection().find({ "TransitiveDegree": degree, "label": { "$exists": False } }).count() tmp = 0 for nf_dict in NF.collection().find({
# If not, it does nothing # This could be improved by working in two passes: one to compute the polredabs and store it, one to link to the other database. # This would be at the expense of further deviating from Tim's original data submission import sys LMFDB_FOLDER = "../../../" sys.path.append(LMFDB_FOLDER) print "Importing sage in base" import lmfdb.base as base from lmfdb.math_classes import NumberFieldGaloisGroup as NF print "Sage loaded" print "getting connection" base._init(27017, "") #37010 print "I have it" base.getDBConnection() # Doing an iteration on degrees, so it is easier to stop the script and restart it again for degree in range(1,100): total = NF.collection().find({"TransitiveDegree":degree, "label": {"$exists": False}}).count() tmp = 0 for nf_dict in NF.collection().find({"TransitiveDegree":degree, "label": {"$exists": False}}).sort("QpRts-p", -1): tmp += 1 print tmp, " out of ", total, " at degree ", degree, " (with QpRts-p ", nf_dict["QpRts-p"], ")" from copy import deepcopy nf_dict2 = deepcopy(nf_dict) nf = NF(data=nf_dict)