コード例 #1
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")
コード例 #2
0
ファイル: main.py プロジェクト: AurelPage/lmfdb
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")

            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}'
            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")