def conjclasses(self): if 'conjclasses' in self._data: return self._data['conjclasses'] g = self.gapgroupnt() n = self.n() gap.set( 'cycletype', 'function(el, n) local ct; ct := CycleLengths(el, [1..n]); ct := ShallowCopy(ct); Sort(ct); ct := Reversed(ct); return(ct); end;' ) cc = g.ConjugacyClasses() ccn = [x.Size() for x in cc] ccc = [x.Representative() for x in cc] if int(n) == 1: cc2 = [[1]] cc = ['()'] else: cc = ccc cc2 = [x.cycletype(n) for x in cc] cc2 = [str(x) for x in cc2] cc2 = [re.sub(r"\[", '', x) for x in cc2] cc2 = [re.sub(r"\]", '', x) for x in cc2] ans = [[cc[j], ccc[j].Order(), ccn[j], cc2[j]] for j in range(len(ccn))] self._data['conjclasses'] = ans return ans
def factor_perm_repn(self, nfgg=None): if 'artincoefs' in self._data: return self._data['artincoefs'] try: if nfgg is not None: self._data["nfgg"] = nfgg else: if "nfgg" not in self._data: from artin_representations.math_classes import NumberFieldGaloisGroup nfgg = NumberFieldGaloisGroup(self._data['coeffs']) self._data["nfgg"] = nfgg else: nfgg = self._data["nfgg"] cc = nfgg.conjugacy_classes() # cc is list, each has methods group, size, order, representative ccreps = [x.representative() for x in cc] ccns = [int(x.size()) for x in cc] ccreps = [x.cycle_string() for x in ccreps] ccgen = '[' + ','.join(ccreps) + ']' ar = nfgg.artin_representations() # list of artin reps from db arfull = nfgg.artin_representations_full_characters( ) # list of artin reps from db gap.set( 'fixed', 'function(a,b) if a*b=a then return 1; else return 0; fi; end;' ) g = gap.Group(ccgen) h = g.Stabilizer('1') rc = g.RightCosets(h) # Permutation character for our field permchar = [gap.Sum(rc, 'j->fixed(j,' + x + ')') for x in ccreps] charcoefs = [0 for x in arfull] # list of lists (inner are giving char values ar2 = [x[0] for x in arfull] for j in range(len(ar)): fieldchar = int(arfull[j][1]) zet = CyclotomicField(fieldchar).gen() ar2[j] = [psum(zet, x) for x in ar2[j]] for j in range(len(ar)): charcoefs[j] = 0 for k in range(len(ccns)): charcoefs[j] += int(permchar[k]) * ccns[k] * ar2[j][k] charcoefs = [x / int(g.Size()) for x in charcoefs] self._data['artincoefs'] = charcoefs return charcoefs except AttributeError: return [] return []
def conjclasses(g, n): gap.set('cycletype', 'function(el, n) local ct; ct := CycleLengths(el, [1..n]); ct := ShallowCopy(ct); Sort(ct); ct := Reversed(ct); return(ct); end;') cc = g.ConjugacyClasses() ccn = [x.Size() for x in cc] ccc = [x.Representative() for x in cc] if int(n) == 1: cc2 = [[1]] cc = ['()'] else: cc = ccc cc2 = [x.cycletype(n) for x in cc] cc2 = [str(x) for x in cc2] cc2 = map(lambda x: re.sub("\[", '', x), cc2) cc2 = map(lambda x: re.sub("\]", '', x), cc2) ans = [[cc[j], ccc[j].Order(), ccn[j], cc2[j]] for j in range(len(ccn))] return(ans)
def factor_perm_repn(self, nfgg=None): if 'artincoefs' in self._data: return self._data['artincoefs'] try: if nfgg is not None: self._data["nfgg"] = nfgg else: if "nfgg" not in self._data: from artin_representations.math_classes import NumberFieldGaloisGroup nfgg = NumberFieldGaloisGroup(self._data['coeffs']) self._data["nfgg"] = nfgg else: nfgg = self._data["nfgg"] cc = nfgg.conjugacy_classes() # cc is list, each has methods group, size, order, representative ccreps = [x.representative() for x in cc] ccns = [int(x.size()) for x in cc] ccreps = [x.cycle_string() for x in ccreps] ccgen = '['+','.join(ccreps)+']' ar = nfgg.artin_representations() # list of artin reps from db arfull = nfgg.artin_representations_full_characters() # list of artin reps from db gap.set('fixed', 'function(a,b) if a*b=a then return 1; else return 0; fi; end;'); g = gap.Group(ccgen) h = g.Stabilizer('1') rc = g.RightCosets(h) # Permutation character for our field permchar = [gap.Sum(rc, 'j->fixed(j,'+x+')') for x in ccreps] charcoefs = [0 for x in arfull] # list of lists (inner are giving char values ar2 = [x[0] for x in arfull] for j in range(len(ar)): fieldchar = int(arfull[j][1]) zet = CyclotomicField(fieldchar).gen() ar2[j] = [psum(zet, x) for x in ar2[j]] for j in range(len(ar)): charcoefs[j] = 0 for k in range(len(ccns)): charcoefs[j] += int(permchar[k])*ccns[k]*ar2[j][k] charcoefs = [x/int(g.Size()) for x in charcoefs] self._data['artincoefs'] = charcoefs return charcoefs except AttributeError: return [] return []