def __init__(self, m, n): """ Initialize ``self``. EXAMPLES:: sage: C = ColoredPermutations(4, 3) sage: TestSuite(C).run() sage: C = ColoredPermutations(2, 3) sage: TestSuite(C).run() sage: C = ColoredPermutations(1, 3) sage: TestSuite(C).run() """ if m <= 0: raise ValueError("m must be a positive integer") self._m = ZZ(m) self._n = ZZ(n) self._C = IntegerModRing(self._m) self._P = Permutations(self._n) if self._m == 1 or self._m == 2: from sage.categories.finite_coxeter_groups import FiniteCoxeterGroups category = FiniteCoxeterGroups().Irreducible() else: from sage.categories.complex_reflection_groups import ComplexReflectionGroups category = ComplexReflectionGroups().Finite().Irreducible( ).WellGenerated() Parent.__init__(self, category=category)
def __init__(self, cartan_type): """ Construct this Coxeter group as a Sage permutation group, by fetching the permutation representation of the generators from Chevie's database. TESTS:: sage: from sage.combinat.root_system.coxeter_group import CoxeterGroupAsPermutationGroup sage: W = CoxeterGroupAsPermutationGroup(CartanType(["H",3])) # optional - chevie sage: TestSuite(W).run() # optional - chevie """ assert cartan_type.is_finite() assert cartan_type.is_irreducible() self._semi_simple_rank = cartan_type.n from sage.interfaces.gap3 import gap3 gap3._start() gap3.load_package("chevie") self._gap_group = gap3('CoxeterGroup("%s",%s)' % (cartan_type.letter, cartan_type.n)) # Following #9032, x.N is an alias for x.numerical_approx in every Sage object ... N = self._gap_group.__getattr__("N").sage() generators = [str(x) for x in self._gap_group.generators] self._is_positive_root = [None] + [True] * N + [False] * N PermutationGroup_generic.__init__(self, gens=generators, category=Category.join([ FinitePermutationGroups(), FiniteCoxeterGroups() ]))
def super_categories(self): r""" EXAMPLES:: sage: FiniteWeylGroups().super_categories() [Category of weyl groups, Category of finite coxeter groups] """ return [WeylGroups(), FiniteCoxeterGroups()]
def __init__(self, n): """ Initialize ``self``. EXAMPLES:: sage: S = SignedPermutations(4) sage: TestSuite(S).run() """ ColoredPermutations.__init__(self, 2, n, FiniteCoxeterGroups())