def decomposition_display(self): factors = self.decomp if len(factors) == 1 and factors[0][1] == 1: return 'simple' ans = '' for factor in factors: if ans != '': ans += '$\\times$ ' if factor[1] == 1: ans += av_display_knowl(factor[0]) + ' ' else: ans += av_display_knowl(factor[0]) + '<sup> {0} </sup> '.format(factor[1]) return ans
def decomposition_display(self): factors = self.decomp if len(factors) == 1 and factors[0][1] == 1: return 'simple' ans = '' for factor in factors: if ans != '': ans += '$\\times$ ' if factor[1] == 1: ans += av_display_knowl(factor[0]) + ' ' else: ans += av_display_knowl(factor[0]) + '<sup> {0} </sup> '.format(factor[1]) return ans
def decomposition_display(factors): if len(factors) == 1 and factors[0][1] == 1: return "simple" factor_str = "" for factor in factors: if factor_str != "": factor_str += " $\\times$ " factor_str += av_display_knowl(factor[0]) if factor[1] > 1: factor_str += "<sup> {0} </sup>".format(factor[1]) return factor_str
def twist_display(self, show_all): if not self.twists: return "This isogeny class has no twists." if show_all: ans = "Below is a list of all twists of this isogeny class." else: ans = "Below are some of the twists of this isogeny class." ans += '<table class = "ntdata">\n' ans += "<tr><td>Twist</td><td>Extension Degree</td><td>Common base change</td></tr>\n" i = 0 for twist in self.twists: if twist[2] <= 3 or show_all or i < 3: if self.q**twist[2] <= maxq(self.g, self.p): bc = av_display_knowl(twist[1]) else: bc = "(not in LMFDB)" ans += "<tr><td>%s</td><td>$%s$</td><td>%s</td></tr>\n" % ( av_display_knowl(twist[0]), str(twist[2]), bc) i += 1 ans += "</table>\n" return ans
def basechange_display(self): models = self.prim_models if len(models) == 0: return 'primitive' ans = '<table class = "ntdata">\n' ans += '<tr><td>Subfield</td><td>Primitive Model</td></tr>\n' for model in models: ans += ' <tr><td class="center">$%s$</td><td>'%(self.field(model.split('.')[1])) ans += av_display_knowl(model) + ' ' ans += '</td></tr>\n' ans += '</table>\n' return ans
def basechange_display(self): models = self.prim_models if len(models) == 0: return 'primitive' ans = '<table class = "ntdata">\n' ans += '<tr><td>Subfield</td><td>Primitive Model</td></tr>\n' for model in models: ans += ' <tr><td class="center">$%s$</td><td>'%(self.field(model.split('.')[1])) ans += av_display_knowl(model) + ' ' ans += '</td></tr>\n' ans += '</table>\n' return ans
def basechange_display(self): if self.is_primitive: return "primitive" else: models = self.primitive_models ans = '<table class = "ntdata">\n' ans += "<tr><td>Subfield</td><td>Primitive Model</td></tr>\n" for model in models: ans += ' <tr><td class="center">${0}$</td><td>'.format(self.field(model.split(".")[1])) ans += av_display_knowl(model) + " " ans += "</td></tr>\n" ans += "</table>\n" return ans
def non_simple_loop(p, factors): ans = '<ul style="margin-top: 5px;margin-bottom: 8px;">\n' for factor in factors: ans += "<li>" ans += av_display_knowl(factor[0]) if factor[1] > 1: ans += "<sup> {0} </sup>".format(factor[1]) ans += " : " end_alg = describe_end_algebra(p, factor[0]) if end_alg is None: ans += no_endo_data() elif factor[1] == 1: ans += end_alg[1] else: ans += matrix_display(factor, end_alg) ans += "</li>\n" ans += "</ul>\n" return ans
def display_endo_info(self, degree, do_describe=True): # When degree > 1 we find the factorization by looking at the extension database if degree > 1: factors = self.endo_extension_by_deg(degree) if not factors: return "The data at degree %s is missing." % degree, do_describe ans = "The base change of $A$ to ${0}$ is ".format( self.ext_field(degree)) else: factors = list( zip(self.simple_distinct, self.simple_multiplicities)) if self.is_simple: ans = "The endomorphism algebra of this simple isogeny class is " else: ans = "The isogeny class factors as " dec_display = decomposition_display(factors) if dec_display == "simple": end_alg = describe_end_algebra(self.p, factors[0][0]) if end_alg is None: return no_endo_data(), do_describe if degree > 1: ans += "the simple isogeny class " ans += av_display_knowl(factors[0][0]) ans += " and its endomorphism algebra is " ans += end_alg[1] elif len(factors) == 1: end_alg = describe_end_algebra(self.p, factors[0][0]) if end_alg is None: return no_endo_data(), do_describe ans += dec_display + " and its endomorphism algebra is " ans += matrix_display(factors[0], end_alg) else: ans += dec_display if do_describe: ans += " and its endomorphism algebra is a direct product of the endomorphism algebras for each isotypic factor" do_describe = False ans += ". The endomorphism algebra for each factor is: \n" ans += non_simple_loop(self.p, factors) return ans, do_describe