Example #1
0
def galois_rep_from_path(p):
    if p[0]=='EllipticCurve':
        # create the sage elliptic curve then create Galois rep object
        ainvs = db.ec_curves.lucky({'lmfdb_label':p[2]+"."+p[3]+p[4]}, 'ainvs')
        E = EllipticCurve(ainvs)
        return GaloisRepresentation(E)

    elif (p[0]=='Character' and p[1]=='Dirichlet'):
        dirichletArgs = {'type':'Dirichlet', 'modulus':int(p[2]), 'number':int(p[3])}
        chi = WebDirichletCharacter(**dirichletArgs)
        return GaloisRepresentation(chi)
 
    elif (p[0]=='ModularForm'):
        level = int(p[4])
        weight = int(p[5])
        conrey_label = p[6] # this should be zero; TODO check this is the case
        hecke_orbit = p[7] # this is a, b, c, etc.; chooses the galois orbit
        embedding = p[8] # this is the embedding of that galois orbit
        label = convert_newformlabel_from_conrey(str(level)+"."+str(weight)+"."+str(conrey_label)+"."+hecke_orbit)
        form = WebNewform(label)
        return GaloisRepresentation([form, ZZ(embedding)])

    elif (p[0]=='ArtinRepresentation'):
        dim = p[1]
        conductor = p[2]
        index = p[3]
        rho = ArtinRepresentation(dim, conductor, index)
        return GaloisRepresentation(rho)
    else:
        return
Example #2
0
def galois_rep_from_path(p):
    C = getDBConnection()
    if p[0] == 'EllipticCurve':
        # create the sage elliptic curve then create Galois rep object
        data = C.elliptic_curves.curves.find_one(
            {'lmfdb_label': p[2] + "." + p[3] + p[4]})
        ainvs = [int(a) for a in data['ainvs']]
        E = EllipticCurve(ainvs)
        return GaloisRepresentation(E)

    elif (p[0] == 'Character' and p[1] == 'Dirichlet'):
        dirichletArgs = {
            'type': 'Dirichlet',
            'modulus': int(p[2]),
            'number': int(p[3])
        }
        chi = WebDirichletCharacter(**dirichletArgs)
        return GaloisRepresentation(chi)

    elif (p[0] == 'ModularForm'):
        N = int(p[4])
        k = int(p[5])
        chi = p[6]  # this should be zero; TODO check this is the case
        label = p[7]  # this is a, b, c, etc.; chooses the galois orbit
        embedding = p[8]  # this is the embedding of that galois orbit
        form = WebNewForm(N, k, chi=chi, label=label)
        return GaloisRepresentation([form, ZZ(embedding)])

    elif (p[0] == 'ArtinRepresentation'):
        dim = p[1]
        conductor = p[2]
        index = p[3]
        rho = ArtinRepresentation(dim, conductor, index)
        return GaloisRepresentation(rho)
    else:
        return
Example #3
0
def show():
    args = request.args

    objLinks = args # an immutable dict of links to objects to tp

    objPaths = []
    for k, v in objLinks.items():
        objPaths.append(v.split('/')) 

    galoisRepObjs = []
    for p in objPaths:
        galoisRepObjs.append(galois_rep_from_path(p))

    if len(galoisRepObjs)==1:
        gr = galoisRepObjs[0]
        gr.lfunction()

        info = {}
        info['dirichlet'] = lfuncDShtml(gr, "analytic")
        info['eulerproduct'] = lfuncEPtex(gr, "abstract")
        info['functionalequation'] = lfuncFEtex(gr, "analytic")
        info['functionalequationSelberg'] = lfuncFEtex(gr, "selberg")
        info['bread'] = get_bread()

        return render_template('Lfunction.html', **info)

    # currently only implemented tp of two things
    if len(galoisRepObjs)==2:
 
        try: 
            tp = GaloisRepresentation([galoisRepObjs[0], galoisRepObjs[1]])
            tp.lfunction()

            info = {}
            info['dirichlet'] = lfuncDShtml(tp, "analytic")
            info['eulerproduct'] = lfuncEPtex(tp, "abstract")
            info['functionalequation'] = lfuncFEtex(tp, "analytic")
            info['functionalequationSelberg'] = lfuncFEtex(tp, "selberg")

            properties = [('Root number', '$'+str(tp.root_number()).replace('*','').replace('I','i')+'$'),
                           ('Dimension', '$'+str(tp.dimension())+'$'),
                           ('Conductor', '$'+str(tp.cond())+'$')]
            info['properties'] = properties

            if (tp.numcoeff > len(tp.dirichlet_coefficients)+10):
                info['zeroswarning'] = 'These zeros may be inaccurate because we use only %s terms rather than the theoretically required %s terms' %(len(tp.dirichlet_coefficients), tp.numcoeff)
                info['svwarning'] = 'These special values may also be inaccurate, for the same reason.'
            else:
                info['zeroswarning'] = ''       
                info['svwarning'] = '' 
    
            info['tpzeroslink'] = zeros(tp) 
            info['sv_edge'] = specialValueString(tp, 1, '1')
            info['sv_critical'] = specialValueString(tp, 0.5, '1/2')

#            friends = []
#            friends.append(('L-function of first object', url_for('.show', obj1=objLinks[0])))
#            friends.append(('L-function of second object', url_for('.show', obj2=objLinks[1]))) 
#            info['friends'] = friends

            info['eulerproduct'] = 'L(s, V \otimes W) = \prod_{p} \det(1 - Frob_p p^{-s} | (V \otimes W)^{I_p})^{-1}'
            info['bread'] = get_bread()
            return render_template('Lfunction.html', **info)
        except (KeyError,ValueError,RuntimeError,NotImplementedError) as err:
            return render_lfunction_exception(err)
    else:
        return render_template("not_yet_implemented.html")
Example #4
0
def show():
    args = request.args
    bread = get_bread()

    objLinks = args # an immutable dict of links to objects to tp

    objPaths = []
    for k, v in objLinks.items():
        objPaths.append(v.split('/')) 

    galoisRepObjs = []
    for p in objPaths:
        galoisRepObjs.append(galois_rep_from_path(p))

    if len(galoisRepObjs)==1:
        gr = galoisRepObjs[0]
        gr.lfunction()

        info = {}
        info['dirichlet'] = lfuncDShtml(tp, "analytic")
        info['eulerproduct'] = lfuncEPtex(tp, "abstract")
        info['functionalequation'] = lfuncFEtex(tp, "analytic")
        info['functionalequationSelberg'] = lfuncFEtex(tp, "selberg")

        return render_template('Lfunction.html', **info)

    # currently only implemented tp of two things
    if len(galoisRepObjs)==2:
 
        try: 
            tp = GaloisRepresentation([galoisRepObjs[0], galoisRepObjs[1]])
            tp.lfunction()

            info = {}
            info['dirichlet'] = lfuncDShtml(tp, "analytic")
            info['eulerproduct'] = lfuncEPtex(tp, "abstract")
            info['functionalequation'] = lfuncFEtex(tp, "analytic")
            info['functionalequationSelberg'] = lfuncFEtex(tp, "selberg")

            properties2 = [('Root number', '$'+str(tp.root_number()).replace('*','').replace('I','i')+'$'),
                           ('Dimension', '$'+str(tp.dimension())+'$'),
                           ('Conductor', '$'+str(tp.cond())+'$')]
            info['properties2'] = properties2

            if (tp.numcoeff > len(tp.dirichlet_coefficients)+10):
                info['zeroswarning'] = 'These zeros may be inaccurate because we use only %s terms rather than the theoretically required %s terms' %(len(tp.dirichlet_coefficients), tp.numcoeff)
                info['svwarning'] = 'These special values may also be inaccurate, for the same reason.'
            else:
                info['zeroswarning'] = ''       
                info['svwarning'] = '' 
    
            info['tpzeroslink'] = zeros(tp) 
            info['sv_edge'] = specialValueString(tp, 1, '1')
            info['sv_critical'] = specialValueString(tp, 0.5, '1/2')

#            friends = []
#            friends.append(('L-function of first object', url_for('.show', obj1=objLinks[0])))
#            friends.append(('L-function of second object', url_for('.show', obj2=objLinks[1]))) 
#            info['friends'] = friends

            info['eulerproduct'] = 'L(s, V \otimes W) = \prod_{p} \det(1 - Frob_p p^{-s} | (V \otimes W)^{I_p})^{-1}'

            return render_template('Lfunction.html', **info)
        except Exception as ex:
            info = {'content': 'Sorry, there was a problem: ' + str(ex.args), 'title':'Error'}
            return render_template('LfunctionSimple.html', **info) 
    else:
        return render_template("not_yet_implemented.html")