コード例 #1
0
ファイル: WebNumberField.py プロジェクト: koffie/lmfdb
def modules2string(n, t, modlist):
    modlist = [[galois_module_knowl(n, t, z[0]), int(z[1])] for z in modlist]
    ans = modlist[0][0]
    modlist[0][1] -= 1
    for j in range(len(modlist)):
        while modlist[j][1] > 0:
            ans += r' $\oplus$ ' + modlist[j][0]
            modlist[j][1] -= 1
    return ans
コード例 #2
0
ファイル: WebNumberField.py プロジェクト: sanni85/lmfdb
def modules2string(n, t, modlist):
    modlist = [[galois_module_knowl(n, t, z[0]), int(z[1])] for z in modlist]
    ans = modlist[0][0]
    modlist[0][1] -= 1
    for j in range(len(modlist)):
        while modlist[j][1]>0:
            ans += r' $\oplus$ '+modlist[j][0]
            modlist[j][1] -= 1
    return ans
コード例 #3
0
ファイル: WebNumberField.py プロジェクト: kmcgown/lmfdb
 def unit_galois_action_show(self):
     ugm = self.unit_galois_action()
     if ugm == []:
         return ''
     C = base.getDBConnection()
     gmods = C.transitivegroups.Gmodules
     n = self.degree()
     t = self.galois_t()
     ugm = [[galois_module_knowl(n, t, z[0], C), int(z[1])] for z in ugm]
     #ugm = [do_mult(a) for a in ugm]
     ans = ugm[0][0]
     ugm[0][1] -= 1
     for j in range(len(ugm)):
         while ugm[j][1] > 0:
             ans += r' $\oplus$ ' + ugm[j][0]
             ugm[j][1] -= 1
     return ans
コード例 #4
0
ファイル: WebNumberField.py プロジェクト: kmcgown/lmfdb
 def unit_galois_action_show(self):
     ugm = self.unit_galois_action()
     if ugm == []:
         return ''
     C = base.getDBConnection()
     gmods = C.transitivegroups.Gmodules
     n = self.degree()
     t = self.galois_t()
     ugm = [[galois_module_knowl(n, t, z[0], C), int(z[1])] for z in ugm]
     #ugm = [do_mult(a) for a in ugm]
     ans = ugm[0][0]
     ugm[0][1] -= 1
     for j in range(len(ugm)):
         while ugm[j][1]>0:
             ans += r' $\oplus$ '+ugm[j][0]
             ugm[j][1] -= 1
     return ans
コード例 #5
0
ファイル: main.py プロジェクト: michaelneururer/lmfdb
def render_group_webpage(args):
    data = None
    info = {}
    if 'label' in args:
        label = clean_input(args['label'])
        label = label.replace('t', 'T')
        C = base.getDBConnection()
        data = C.transitivegroups.groups.find_one({'label': label})
        if data is None:
            bread = get_bread([("Search error", url_for('.search'))])
            info['err'] = "Group " + label + " was not found in the database."
            info['label'] = label
            return search_input_error(info, bread)
        title = 'Galois Group:' + label
        wgg = WebGaloisGroup.from_data(data)
        n = data['n']
        t = data['t']
        data['yesno'] = yesno
        order = data['order']
        data['orderfac'] = latex(ZZ(order).factor())
        orderfac = latex(ZZ(order).factor())
        data['ordermsg'] = "$%s=%s$" % (order, latex(orderfac))
        if order == 1:
            data['ordermsg'] = "$1$"
        if ZZ(order).is_prime():
            data['ordermsg'] = "$%s$ (is prime)" % order
        pgroup = len(ZZ(order).prime_factors()) < 2
        if n == 1:
            G = gap.SmallGroup(n, t)
        else:
            G = gap.TransitiveGroup(n, t)
        if ZZ(order) < ZZ('10000000000'):
            ctable = chartable(n, t)
        else:
            ctable = 'Group too large'
        data['gens'] = generators(n, t)
        if n == 1 and t == 1:
            data['gens'] = 'None needed'
        data['chartable'] = ctable
        data['parity'] = "$%s$" % data['parity']
        data['cclasses'] = conjclasses(G, n)
        data['subinfo'] = subfield_display(C, n, data['subs'])
        data['resolve'] = resolve_display(C, data['resolve'])
#    if len(data['resolve']) == 0: data['resolve'] = 'None'
        data['otherreps'] = wgg.otherrep_list()
        query={'galois': bson.SON([('n', n), ('t', t)])}
        C = base.getDBConnection()
        intreps = C.transitivegroups.Gmodules.find({'n': n, 't': t})
        # turn cursor into a list
        intreps = [z for z in intreps]
        data['int_reps'] = [galois_module_knowl(n, t, z['index'], C) for z in intreps]
        data['int_reps_complete'] = int_reps_are_complete(intreps)

        friends = []
        one = C.numberfields.fields.find_one(query)
        if one:
            friends.append(('Number fields with this Galois group', url_for('number_fields.number_field_render_webpage')+"?galois_group=%dT%d" % (n, t) )) 
        prop2 = [
            ('Order:', '\(%s\)' % order),
            ('n:', '\(%s\)' % data['n']),
            ('Cyclic:', yesno(data['cyc'])),
            ('Abelian:', yesno(data['ab'])),
            ('Solvable:', yesno(data['solv'])),
            ('Primitive:', yesno(data['prim'])),
            ('$p$-group:', yesno(pgroup)),
            ('Name:', group_display_short(n, t, C)),
        ]
        info.update(data)

        bread = get_bread([(label, ' ')])
        return render_template("gg-show-group.html", credit=GG_credit, title=title, bread=bread, info=info, properties2=prop2, friends=friends)