Skip to content

Commit d61d297

Browse files
committed
Fixing some doctests and details.
1 parent 5439a9d commit d61d297

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

src/sage/combinat/permutation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6844,9 +6844,10 @@ def _from_cactus_group_element(self, x):
68446844
68456845
sage: J3 = groups.misc.Cactus(3)
68466846
sage: s12,s13,s23 = J3.gens()
6847-
sage: elt = s12*s23*s13
6847+
sage: elt = s12 * s23 * s13
68486848
sage: P5 = Permutations(5)
68496849
sage: P5._from_cactus_group_element(elt)
6850+
[1, 3, 2, 4, 5]
68506851
"""
68516852
return self(x.to_permutation())
68526853

src/sage/groups/finitely_presented_catalog.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@
2323
from .finitely_presented_named import QuaternionPresentation as Quaternion
2424
from .finitely_presented_named import AlternatingPresentation as Alternating
2525
from .finitely_presented_named import BinaryDihedralPresentation as BinaryDihedral
26+
from .finitely_presented_named import CactusPresentation as Cactus

src/sage/groups/finitely_presented_named.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
- Alternating group, `A_n` of order `n!/2` --
1313
:func:`groups.presentation.Alternating <sage.groups.finitely_presented_named.AlternatingPresentation>`
1414
15+
- Cactus group, `J_n` --
16+
:func:`groups.presentation.Cactus <sage.groups.finitely_presented_named.CactusPresentation>`
17+
1518
- Cyclic group, `C_n` of order `n` --
1619
:func:`groups.presentation.Cyclic <sage.groups.finitely_presented_named.CyclicPresentation>`
1720
@@ -580,12 +583,13 @@ def CactusPresentation(n):
580583
F = FreeGroup(G.variable_names())
581584
gens = F.gens()
582585
rls = [g**2 for g in gens]
583-
K = G.group_generators().keys()
586+
Gg = G.group_generators()
587+
K = Gg.keys()
584588
for i,key in enumerate(K):
585589
for j,key2 in enumerate(K):
586590
if i == j:
587591
continue
588-
x,y = G._product_on_gens(key, key2)
592+
x,y = (Gg[key] * Gg[key2])._data
589593
if key == x and key2 == y:
590594
continue
591595
elt = gens[i] * gens[j] * ~gens[K.index(y)] * ~gens[K.index(x)]

src/sage/groups/perm_gps/permgroup_named.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,13 @@ def _coerce_map_from_(self, G):
339339
340340
sage: J3 = groups.misc.Cactus(3)
341341
sage: S5 = SymmetricGroup(5)
342-
sage: S5._coerce_map_from_(J3)
343-
True
342+
sage: S5.coerce_map_from(J3)
343+
Conversion via _from_cactus_group_element map:
344+
From: Cactus Group with 3 fruit
345+
To: Symmetric group of order 5! as a permutation group
344346
sage: S2 = SymmetricGroup(2)
345-
sage: S2._coerce_map_from_(J3)
346-
False
347+
sage: S2._coerce_map_from_(J3) is None
348+
True
347349
"""
348350
from sage.groups.cactus_group import CactusGroup
349351
if isinstance(G, CactusGroup) and G._n <= self._deg:
@@ -361,6 +363,7 @@ def _from_cactus_group_element(self, x):
361363
sage: elt = s12*s23*s13
362364
sage: S5 = SymmetricGroup(5)
363365
sage: S5._from_cactus_group_element(elt)
366+
(2,3)
364367
"""
365368
return self(x.to_permutation())
366369

0 commit comments

Comments
 (0)