Ejemplo n.º 1
0
def render_elliptic_modular_form_space_list_chars(level, weight):
    r"""
    Renders a page with list of spaces of elliptic forms of given
    level and weight (list all characters)
    """
    emf_logger.debug(
        "In render_elliptic_modular_form_space_list_chars(level={0},weight={1})".format(level, weight))
    info = dict()
    # s = make_table_of_characters(level,weight)
    info['level'] = level
    info['weight'] = weight
    # if not isinstance(s,str):
    #    info['character'] = s
    #    return redirect(url_for("emf.render_elliptic_modular_forms", **info))
    # info['list_spaces']=s
    title = "Newforms of weight {0} for \(\Gamma_1({1})\)".format(weight, level)
    # bread =[(MF_TOP,url_for('mf.modular_form_main_page'))]
    bread = [(EMF_TOP, url_for('emf.render_elliptic_modular_forms'))]
    bread.append(("Level %s" % level, url_for("emf.render_elliptic_modular_forms", level=level)))
    bread.append(
        ("Weight %s" % weight, url_for("emf.render_elliptic_modular_forms", level=level, weight=weight)))
    # info['browse_type']=" of level %s and weight %s " % (level,weight)
    dimtbl = DimensionTable(1)
    info['grouptype'] = 1
    disp = ClassicalMFDisplay('modularforms')
    disp.set_table_browsing(limit=[(weight, weight), (level, level)], keys=['Weight', 'Level'],
                            character='all', dimension_table=dimtbl, title='Dimension of newforms')
    info['show_all_characters'] = 1
    info['browse_table'] = disp._table
    info['bread'] = bread
    info['title'] = title
    return render_template("emf_browse_fixed_level.html", **info)
Ejemplo n.º 2
0
def browse_elliptic_modular_forms(level=0, weight=0, character=-1, label='', limits=None, **kwds):
    r"""
    Renders the webpage for browsing modular forms of given level and/or weight.
    """
    emf_logger.debug("In browse_elliptic_modular_forms kwds: {0}".format(kwds))
    emf_logger.debug(
        "Input: level={0},weight={1},character={2},label={3}".format(level, weight, character, label))
    bread = [(EMF_TOP, url_for('emf.render_elliptic_modular_forms'))]
    # if level <0:
    #    level=None
    # if weight<0:
    #    weight=None
    info = dict()
    drawdomain = False
    if character == 0:
        info['grouptype'] = 0
        info['groupother'] = 1
        dimtbl = DimensionTable(0)
        if level <= N_max_Gamma0_fdraw:
            drawdomain = True
    else:
        info['grouptype'] = 1
        info['groupother'] = 0
        if level <= N_max_Gamma1_fdraw:
            drawdomain = True
        dimtbl = DimensionTable(1)
        emf_logger.info("level=%s, %s" % (level, type(level)))
    emf_logger.info("wt=%s, %s" % (weight, type(weight)))
    if level > 0:
        info['geometric'] = get_geometric_data(level, info['grouptype'])
        # if info.has_key('plot'):
        if drawdomain:
            info['fd_plot_url'] = url_for('emf.render_plot', level=level, grouptype=info['grouptype'])
            emf_logger.info("PLOT: %s" % info['fd_plot_url'])
    if level > 0 and weight == 0:
        # print "here1!"
        title = "Newforms for \(\Gamma_{0}({1})\)".format(info['grouptype'], level)
        level = int(level)
        info['level_min'] = level
        info['level_max'] = level
        info['weight_min'] = 1
        info['weight_max'] = 20
        # largs = [ {'level':level,'character':character,'weight_block':k} for k in range(100)]
        disp = ClassicalMFDisplay('modularforms')
        disp.set_table_browsing(limit=[(2, 12), (level, level)], keys=['Weight', 'Level'],
                                character=character, dimension_table=dimtbl, title='Dimension of cusp forms')
        tbl = disp._table
        if tbl is not None:
            info['browse_table'] = tbl
        # info['list_spaces']=ajax_more(make_table_of_spaces_fixed_level,*largs,text='more')
        bread.append(("Level %s" % level, url_for("emf.render_elliptic_modular_forms", level=level)))
        info['browse_type'] = " of level %s " % level
        info['title'] = title
        info['bread'] = bread
        info['level'] = level
        return render_template("emf_browse_fixed_level.html", **info)
    elif level == 0 and weight > 0:
        title = "Newforms of weight %s " % weight
        bread.append(("Weight %s" % level, url_for("emf.render_elliptic_modular_forms", weight=weight)))
        level = int(weight)
        info['level_min'] = 1
        info['level_max'] = 20
        info['weight_min'] = weight
        info['weight_max'] = weight
        # largs = [ {'level':level,'character':character,'weight_block':k} for k in range(100)]
        # info['show_all_characters']=1
        disp = ClassicalMFDisplay('modularforms')
        disp.set_table_browsing(
            limit=[(weight, weight), (info['level_min'], info['level_max'])], keys=['Weight', 'Level'],
            character=character, dimension_table=dimtbl, title='Dimension of cusp forms')
        tbl = disp._table
        if tbl is not None:
            info['browse_table'] = tbl
        # info['list_spaces']=ajax_more(make_table_of_spaces_fixed_level,*largs,text='more')
        info['title'] = title
        info['bread'] = bread
        info['level'] = level
        return render_template("emf_navigation.html", info=info, title=title, bread=bread)
    emf_logger.debug("here2!")
    info['level_min'] = level
    info['level_max'] = level
    info['weight_min'] = weight
    info['weight_max'] = weight
    return render_elliptic_modular_form_space_list_chars(level, weight)
Ejemplo n.º 3
0
def render_elliptic_modular_form_navigation_wp(**args):
    r"""
    Renders the webpage for the navigational page.

    """
    emf_logger.debug("render_c_m_f_n_wp")
    info = to_dict(args)
    level = my_get(info, 'level', 0, int)
    weight = my_get(info, 'weight', 0, int)
    character = my_get(info, 'character', 0, int)
    label = info.get('label', '')
    disp = ClassicalMFDisplay('modularforms2')
    emf_logger.debug("info={0}".format(info))
    emf_logger.debug("level=%s, %s" % (level, type(level)))
    emf_logger.debug("label=%s, %s" % (label, type(label)))
    emf_logger.debug("wt=%s, %s" % (weight, type(weight)))
    emf_logger.debug("character=%s, %s" % (character, type(character)))

    if('plot' in info and level is not None):
        return render_fd_plot(level, info)
    is_set = dict()
    is_set['weight'] = False
    is_set['level'] = False
    if weight != 0:
        is_set['weight'] = True
    if level != 0:
        is_set['level'] = True
    if('get_table' in info):  # we want a table
        info = set_table(info, is_set)
        page = "emf_table.html"
        title = "Table of spaces of elliptic modular forms"
        return render_template(page, info=info, title=title)
    ## This is the list of weights we initially put on the form
    weight = int(weight)
    title = "Holomorphic Cusp Forms"
    bread = [(MF_TOP, url_for('mf.modular_form_main_page'))]
    #  fun = dimension_new_cusp_forms
    #  title = 'Newforms'
    if is_set['weight']:
        wt_range = (weight, weight)
    else:
        if character == 0:
            wt_range = (2, 12)
        else:
            wt_range = (2, 12)
    if is_set['level']:
        level_range = (level, level)
    else:
        level_range = (1, 24)
    if character == 0:
        info['grouptype'] = 0
        info['groupother'] = 1
    else:
        info['grouptype'] = 1
        info['groupother'] = 0
    info['show_switch'] = True
    disp.set_table_browsing(limit=[wt_range, level_range],
                            keys=['Weight', 'Level'], character=character,
                            dimension_table=DimensionTable(info['grouptype']), title='Browse Holomorphic Modular Forms', check_db=True)
    info['browse_table'] = disp._table

    return render_template("emf_navigation.html", info=info, title=title, bread=bread)
Ejemplo n.º 4
0
def browse_elliptic_modular_forms_ranges(**kwds):
    r"""
    Renders the webpage for browsing modular forms of given level and/or weight ranges.
    """
    emf_logger.debug("In browse_elliptic_modular_forms_ranges kwds: {0}".format(kwds))
    emf_logger.debug("args={0}".format(request.args))
    default = {}
    default['level'] = '1-12'
    default['weight'] = '2-36'
    default['character'] = 0
    info = dict()
    args = to_dict(request.args)
    emf_logger.debug("args={0}".format(args))
    for field in ['level', 'weight', 'character']:
        if args.get(field):
            info[field] = parse_range(args[field])
        else:
            info[field] = parse_range(default[field])
    if info['weight'] == 1:
        return render_template("not_available.html")
    elif (type(info['weight']) == dict) and info['weight'].get('min') == 1:
        info['weight']['min'] = 2
    emf_logger.debug("Input: info={0}".format(info))
    bread = [(MF_TOP, url_for('mf.modular_form_main_page'))]
    bread.append((EMF_TOP, url_for('emf.render_elliptic_modular_forms')))
    limits_weight = extract_limits_as_tuple(info, 'weight')
    limits_level = extract_limits_as_tuple(info, 'level')
    if limits_weight[0] == limits_weight[1] and limits_level[0] == limits_level[1]:
        return render_elliptic_modular_form_space_list_chars(limits_level[0], limits_weight[0])
    if limits_level[0] > N_max_db:
        emf_logger.debug("limits_level={0} > N_max_db={1}".format(limits_level, N_max_db))
        return render_template("not_available.html")
    if limits_weight[0] > k_max_db:
        emf_logger.debug("limits_weight={0} > k_max_db={1}".format(limits_weight, k_max_db))
        return render_template("not_available.html")
    if info['character'] == 0:
        info['grouptype'] = 0
        info['groupother'] = 1
        dimtbl = DimensionTable(0)
    else:
        info['grouptype'] = 1
        info['groupother'] = 0
        dimtbl = DimensionTable(1)
        if info['character'] == -1:
            info['show_all_characters'] = 1
    disp = ClassicalMFDisplay('modularforms')
    disp.set_table_browsing(limit=[limits_weight, limits_level],
                            keys=['Weight', 'Level'], character=info['character'], dimension_table=dimtbl, title='Dimension of newforms')
    tbl = disp._table
    if tbl is None:
        return render_template("not_available.html")
    else:
        info['browse_table'] = tbl
    if limits_level[0] == limits_level[1]:
        drawdomain = False
        level = limits_level[0]
        if info['grouptype'] == 0 and level <= N_max_Gamma0_fdraw:
            drawdomain = True
        elif level <= N_max_Gamma1_fdraw:
            drawdomain = True
        info['geometric'] = get_geometric_data(level, info['grouptype'])
        if drawdomain:
            info['fd_plot_url'] = url_for('emf.render_plot', level=level, grouptype=info['grouptype'])
        title = "Newforms for \(\Gamma_{0}({1})\)".format(info['grouptype'], level)
        level = int(level)
        # info['list_spaces']=ajax_more(make_table_of_spaces_fixed_level,*largs,text='more')
        bread.append(("Level %s" % level, url_for("emf.render_elliptic_modular_forms", level=level)))
        info['browse_type'] = " of level %s " % level
        info['title'] = title
        info['bread'] = bread
        info['level'] = level
        return render_template("emf_browse_fixed_level.html", **info)
    title = "Newforms for \(\Gamma_{0}(N)\)".format(info['grouptype'])
    info['browse_type'] = ""
    info['title'] = title
    info['bread'] = bread
    # info['level']=level
    return render_template("emf_navigation.html", info=info, title=title, bread=bread)
Ejemplo n.º 5
0
def render_elliptic_modular_form_navigation_wp(**args):
    r"""
    Renders the webpage for the navigational page.

    """
    emf_logger.debug("render_c_m_f_n_wp")
    info = to_dict(args)
    level = my_get(info, 'level', 0, int)
    weight = my_get(info, 'weight', 0, int)
    character = my_get(info, 'character', 0, int)
    label = info.get('label', '')
    disp = ClassicalMFDisplay('modularforms2')
    emf_logger.debug("info={0}".format(info))
    emf_logger.debug("level=%s, %s" % (level, type(level)))
    emf_logger.debug("label=%s, %s" % (label, type(label)))
    emf_logger.debug("wt=%s, %s" % (weight, type(weight)))
    emf_logger.debug("character=%s, %s" % (character, type(character)))

    if ('plot' in info and level is not None):
        return render_fd_plot(level, info)
    is_set = dict()
    is_set['weight'] = False
    is_set['level'] = False
    if weight != 0:
        is_set['weight'] = True
    if level != 0:
        is_set['level'] = True
    if ('get_table' in info):  # we want a table
        info = set_table(info, is_set)
        page = "emf_table.html"
        title = "Table of spaces of elliptic modular forms"
        return render_template(page, info=info, title=title)
    ## This is the list of weights we initially put on the form
    weight = int(weight)
    title = "Holomorphic Cusp Forms"
    bread = [(MF_TOP, url_for('mf.modular_form_main_page'))]
    #  fun = dimension_new_cusp_forms
    #  title = 'Newforms'
    if is_set['weight']:
        wt_range = (weight, weight)
    else:
        if character == 0:
            wt_range = (2, 12)
        else:
            wt_range = (2, 12)
    if is_set['level']:
        level_range = (level, level)
    else:
        level_range = (1, 24)
    if character == 0:
        info['grouptype'] = 0
        info['groupother'] = 1
    else:
        info['grouptype'] = 1
        info['groupother'] = 0
    info['show_switch'] = True
    disp.set_table_browsing(limit=[wt_range, level_range],
                            keys=['Weight', 'Level'],
                            character=character,
                            dimension_table=DimensionTable(info['grouptype']),
                            title='Browse Holomorphic Modular Forms',
                            check_db=True)
    info['browse_table'] = disp._table

    return render_template("emf_navigation.html",
                           info=info,
                           title=title,
                           bread=bread)