Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Directly convert PermutationGroup element into sized Permutation #37288

Merged
merged 12 commits into from
Mar 25, 2024
Merged
10 changes: 10 additions & 0 deletions src/sage/combinat/permutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7092,7 +7092,17 @@ def _element_constructor_(self, x, check=True):
[1, 4, 5, 2, 3, 6]
sage: Permutations(6)(x) # known bug
[1, 4, 5, 2, 3, 6]

Ensure that :issue:`37284` is fixed::

sage: PG = PermutationGroup([[(1,2,3),(5,6)],[(7,8)]])
sage: P5 = Permutations(8)
sage: p = PG.an_element()
sage: P5(p).parent()
Standard permutations of 8
RuchitJagodara marked this conversation as resolved.
Show resolved Hide resolved
"""
if isinstance(x, PermutationGroupElement):
return self. _from_permutation_group_element(x)
if len(x) < self.n:
x = list(x) + list(range(len(x) + 1, self.n + 1))
return self.element_class(self, x, check=check)
Expand Down
Loading