Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
sagemathgh-39617: Fixed _positive_roots_reflections for index_set different from {1, 2, …, n}
    
The method _positive_roots_reflections() of CoxeterMatrixGroup, required
by the method positive_roots(), assumes that the index_set of the group,
represented by the keys of self.simple_reflections(), is of the type {1,
2, ..., n}.

This is not always the case, for example the following code fails:
`CoxeterGroup(CoxeterType("A3").relabel({1: "r", 2: "s", 3:
"t"})).positive_roots()`

This PR fixes this issue by allowing other type of keys.
    
URL: sagemath#39617
Reported by: Eduardo Venturini
Reviewer(s): Eduardo Venturini, Travis Scrimshaw
  • Loading branch information
Release Manager committed Mar 9, 2025
2 parents 392e467 + b1335a4 commit 1c44b37
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/sage/groups/matrix_gps/coxeter_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,18 @@ def _positive_roots_reflections(self):
[-1 1] [ 0 -1] [ 1 0]
[ 0 1], [-1 0], [ 1 -1]
]
TESTS::
sage: W = CoxeterGroup(CoxeterType(['A', 2]).relabel({1: 'r', 2: 's'}))
sage: F = W._positive_roots_reflections()
sage: F.keys()
[(1, 0), (1, 1), (0, 1)]
sage: list(F)
[
[-1 1] [ 0 -1] [ 1 0]
[ 0 1], [-1 0], [ 1 -1]
]
"""
if not self.is_finite():
raise NotImplementedError('not available for infinite groups')
Expand All @@ -557,13 +569,14 @@ def _positive_roots_reflections(self):
simple_roots = FreeModule(self.base_ring(), self.ngens()).gens()

refls = self.simple_reflections()
refls_index = {refl_i[1]: refl_i[0] for refl_i in enumerate(refls.keys())}
resu = []
d = {}
for i in range(1, N + 1):
segment = word[:i]
last = segment.pop()
ref = refls[last]
rt = simple_roots[last - 1]
rt = simple_roots[refls_index[last]]
while segment:
last = segment.pop()
cr = refls[last]
Expand Down

0 comments on commit 1c44b37

Please sign in to comment.