def gl2_subgroup_data(label): try: data = db.gps_gl2zhat.lookup(label) if data is None: data = db.gps_gl2zhat.lucky({'Slabel':label}) if data is None: raise ValueError except ValueError: return "Unable to locate data for GL(2,Zhat) subgroup with label: %s" % label row_wrap = lambda cap, val: "<tr><td>%s: </td><td>%s</td></tr>\n" % (cap, val) matrix = lambda m: r'$\begin{bmatrix}%s&%s\\%s&%s\end{bmatrix}$' % (m[0],m[1],m[2],m[3]) info = '<table>\n' info += row_wrap('Subgroup <b>%s</b>' % (label), "<small>" + ', '.join([matrix(m) for m in data['generators']]) + "</small>") info += "<tr><td></td><td></td></tr>\n" info += row_wrap('Level', data['level']) info += row_wrap('Index', data['index']) info += row_wrap('Genus', data['genus']) def ratcusps(c,r): if not c: return "" if not r: return " (none of which are rational)" if r == c: return " (all of which are rational)" if r == 1: return " (one of which is rational)" else: return " (of which %s are rational)" % r info += row_wrap('Cusps', "%s%s" % (data['cusps'], ratcusps(data['cusps'],data['rational_cusps']))) info += row_wrap('Contains $-1$', "yes" if data['quadratic_twists'][0] == label else "no") if label != data['label']: info += row_wrap('LMFDB label', data['label']) if data.get('CPlabel'): info += row_wrap('Cummins & Pauli label', "<a href=%scsg%sM.html#level%s>%s</a>" % (CP_URL_PREFIX, data['genus'], data['level'], data['CPlabel'])) if data.get('RZBlabel'): info += row_wrap('Rouse & Zureick-Brown label', "<a href={prefix}{label}.html>{label}</a>".format(prefix= RZB_URL_PREFIX, label=data['RZBlabel'])) if data.get('Slabel') and label != data.get('Slabel'): info += row_wrap('Sutherland label', data['Slabel']) if data.get('SZlabel'): info += row_wrap('Sutherland & Zywina label', data['SZlabel']) N = ZZ(data['level']) ell = integer_prime_divisors(N)[0] e = N.valuation(ell) if e == 1: info += row_wrap("Cyclic %s-isogeny field degree" % (ell), min([r[1] for r in data['isogeny_orbits'] if r[0] == ell])) info += row_wrap("Cyclic %s-torsion field degree" % (ell), min([r[1] for r in data['orbits'] if r[0] == ell])) info += row_wrap("Full %s-torsion field degree" % (ell), ell*(ell-1)*(ell-1)*(ell+1) // data['index']) else: info += row_wrap("Cyclic %s${}^n$-isogeny field degrees" % (ell), ", ".join(["%s"%(min([r[1] for r in data['isogeny_orbits'] if r[0] == ell**n])) for n in range(1,e+1)])) info += row_wrap("Cyclic %s${}^n$-torsion field degrees" % (ell), ", ".join(["%s"%(min([r[1] for r in data['orbits'] if r[0] == ell**n])) for n in range(1,e+1)])) info += row_wrap("Full %s${}^n$-torsion field degrees" % (ell), ", ".join(["%s"%(ell*(ell-1)*(ell-1)*(ell+1)*ell**(4*n) // data['index']) for n in range(1,e+1)])) if data['genus'] > 0: info += row_wrap('Newforms', ''.join(['<a href="%s">%s</a>' % (cmf_url_for_label(x), x) for x in data['newforms']])) info += row_wrap('Analytic rank', data['rank']) if data['genus'] == 1 and data['model']: info += row_wrap('Model', '<a href="%s">%s</a>' % (url_for('ec.by_ec_label',label=data['model']), data['model'])) info += "</table>\n" return info
def wild_primes(self): return integer_prime_divisors(LCM(LCM(self.A), LCM(self.B)))