diff --git a/src/sage/categories/coxeter_groups.py b/src/sage/categories/coxeter_groups.py index a131c61427e..b0bc02e2682 100644 --- a/src/sage/categories/coxeter_groups.py +++ b/src/sage/categories/coxeter_groups.py @@ -513,9 +513,10 @@ def succ(u): from sage.categories.finite_coxeter_groups import FiniteCoxeterGroups default_category = FiniteEnumeratedSets() if self in FiniteCoxeterGroups() else EnumeratedSets() + cat = default_category.or_subcategory(category) return RecursivelyEnumeratedSet_forest((self.one(),), succ, - algorithm='breadth', - category=default_category.or_subcategory(category)) + algorithm='breadth', + category=cat) @cached_method def coxeter_element(self): @@ -1229,10 +1230,6 @@ def random_element_of_length(self, n): x = x.apply_simple_reflection_right(antiD[rnd]) return x - # TODO: Groups() should have inverse() call __invert__ - # With strong doc stating that this is just a convenience for the user - # and links to ~ / __invert__ - # parabolic_subgroup def _test_simple_projections(self, **options): @@ -2236,7 +2233,6 @@ def binary_factorizations(self, predicate=ConstantFunction(True)): if not predicate(W.one()): from sage.sets.finite_enumerated_set import FiniteEnumeratedSet return FiniteEnumeratedSet([]) - s = W.simple_reflections() def succ(u_v): u, v = u_v @@ -2372,7 +2368,7 @@ def bruhat_lower_covers_reflections(self): wi = self.apply_simple_reflection(i, side='right') return [(u.apply_simple_reflection(i, side='right'), r.apply_conjugation_by_simple_reflection(i)) - for u,r in wi.bruhat_lower_covers_reflections() + for u, r in wi.bruhat_lower_covers_reflections() if not u.has_descent(i, side='right')] + [ (wi, self.parent().simple_reflection(i))] @@ -3109,7 +3105,7 @@ def kazhdan_lusztig_cell(self, side='left'): The cell computation uses the optional package ``coxeter3`` in the background if available to speed up the computation, - even in the different implementations implementations:: + even in the different implementations:: sage: W = WeylGroup('A3', prefix='s') # optional - coxeter3 sage: s1,s2,s3 = W.simple_reflections() # optional - coxeter3 diff --git a/src/sage/categories/monoids.py b/src/sage/categories/monoids.py index ecf591c7559..23c96a79285 100644 --- a/src/sage/categories/monoids.py +++ b/src/sage/categories/monoids.py @@ -377,6 +377,8 @@ def inverse(self): This is an alias for inversion, which can also be invoked by ``~x`` for an element ``x``. + Nota Bene: Element classes should implement ``__invert__`` only. + EXAMPLES:: sage: AA(sqrt(~2)).inverse() # optional - sage.symbolic sage.rings.number_field