Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
fix wrong doctest, improve doc
Browse files Browse the repository at this point in the history
  • Loading branch information
mantepse committed May 4, 2022
1 parent 00f5169 commit 8eaaba1
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions src/sage/groups/perm_gps/permgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,15 @@ def PermutationGroup(gens=None, *args, **kwds):
We can create a permutation group from a group action::
sage: a = lambda x: (2*x) % 6
sage: X = [0,1,2,3,4,5]
sage: G = PermutationGroup(action=a, domain=X)
sage: G.orbits()
[[0], [1, 2, 4], [3], [5]]
sage: a = lambda x: (2*x) % 7
sage: H = PermutationGroup(action=a, domain=range(7))
sage: H.orbits()
[[0], [1, 2, 4], [3, 6, 5]]
sage: H.gens()
[(), (1,2,4), (3,6,5)]
Note that we provide generators for the acting group. The
permutation group we construct is its homomorphic image::
sage: a = lambda g, x: vector(g*x, immutable=True)
sage: X = [vector(x, immutable=True) for x in GF(3)^2]
Expand Down Expand Up @@ -379,6 +383,7 @@ def PermutationGroup(gens=None, *args, **kwds):
...
DeprecationWarning: gap_group, domain, canonicalize, category will become keyword only
See https://trac.sagemath.org/31510 for details.
"""
if not is_ExpectElement(gens) and hasattr(gens, '_permgroup_'):
return gens._permgroup_()
Expand Down Expand Up @@ -5074,11 +5079,10 @@ def __init__(self, gens, action, domain, gap_group=None, category=None, canonica
EXAMPLES::
sage: a = lambda x: (2*x) % 6
sage: X = [0,1,2,3,4,5]
sage: G = PermutationGroup(action=a, domain=X)
sage: a = lambda x: (2*x) % 7
sage: G = PermutationGroup(action=a, domain=range(7))
sage: G.orbits()
[[0], [1, 2, 4], [3], [5]]
[[0], [1, 2, 4], [3, 6, 5]]
"""
from sage.combinat.cyclic_sieving_phenomenon import orbit_decomposition
Expand Down Expand Up @@ -5109,11 +5113,10 @@ def orbits(self):
EXAMPLES::
sage: a = lambda x: (2*x) % 6
sage: X = [0,1,2,3,4,5]
sage: G = PermutationGroup(action=a, domain=X)
sage: a = lambda x: (2*x) % 7
sage: G = PermutationGroup(action=a, domain=range(7))
sage: G.orbits()
[[0], [1, 2, 4], [3], [5]]
[[0], [1, 2, 4], [3, 6, 5]]
"""
return self._orbits

Expand Down

0 comments on commit 8eaaba1

Please sign in to comment.