def __init__(self, *x, **data_dict): if len(x) == 0: # Just passing named arguments self._data = data_dict["data"] label = self._data['label'] else: if len(x) == 1: # Assume we got a label label = x[0] parts = x[0].split(".") base = "%s.%s.%s.%s" % tuple(parts[j] for j in (0, 1, 2, 3)) if len(parts) < 5: # Galois orbit conjindex = 1 else: conjindex = letters2num(parts[4]) elif len(x) == 2: # base and gorb index base = x[0] conjindex = x[1] label = "%s.%s" % (str(x[0]), num2letters(x[1])) else: raise ValueError("Invalid number of positional arguments") self._data = db.artin_reps.lucky({'Baselabel': str(base)}) conjs = self._data["GaloisConjugates"] conj = [xx for xx in conjs if xx['GalOrbIndex'] == conjindex] self._data['label'] = label self._data.update(conj[0])
def friends(self): from lmfdb.lfunctions.LfunctionDatabase import get_lfunction_by_url friendlist = [] cglink = url_character(type=self.type, modulus=self.modulus) friendlist.append(("Character group", cglink)) gal_orb_link = url_character(type=self.type, modulus=self.modulus, orbit_label=self.orbit_label) friendlist.append(("Character orbit", gal_orb_link)) if self.type == "Dirichlet" and self.isprimitive == bool_string(True): url = url_character(type=self.type, number_field=None, modulus=self.modulus, number=self.number) if get_lfunction_by_url(url[1:]): friendlist.append(('L-function', '/L' + url)) else: if self.conductor == 1: friendlist.append(('L-function', '/L/Riemann')) friendlist.append( ('Sato-Tate group', '/SatoTateGroup/0.1.%d' % self.order)) if len(self.vflabel) > 0: friendlist.append(("Value field", '/NumberField/' + self.vflabel)) if self.symbol_numerator(): if self.symbol_numerator() > 0: assoclabel = '2.2.%d.1' % self.symbol_numerator() else: assoclabel = '2.0.%d.1' % -self.symbol_numerator() friendlist.append( ("Associated quadratic field", '/NumberField/' + assoclabel)) label = "%s.%s" % (self.modulus, self.number) myrep = db.artin_reps.lucky({'Dets': {'$contains': label}}) if myrep is not None: j = myrep['Dets'].index(label) artlabel = myrep['Baselabel'] + '.' + num2letters(j + 1) friendlist.append(( 'Artin representation ' + artlabel, url_for( 'artin_representations.render_artin_representation_webpage', label=artlabel))) if self.type == "Dirichlet" and self.isprimitive == bool_string(False): friendlist.append(('Primitive character ' + self.inducing, url_for('characters.render_Dirichletwebpage', modulus=self.conductor, number=self.indlabel))) return friendlist