The `Permutation` function is more general. For example, the folllowing all
work:
sage: Permutation([2, 1, 4, 5, 3])
[2, 1, 4, 5, 3]
sage: Permutation((1,7))
[7, 2, 3, 4, 5, 6, 1]
sage: Permutation('(1,7)')
[7, 2, 3, 4, 5, 6, 1]
In particular, you do not need to specify the "degree" of the permutation.
This is exploiting the fact that the symmetric group of degree `k`
naturally embeds in the symmetric group of degree `l`, for `l\ge k`. As a
result you do calculations like:
sage: Permutation('(1,7)') * Permutation([1,4,2,3])
[7, 4, 2, 3, 5, 6, 1]
If you want to restrict the degree of the permutations you can always use:
sage: S5=SymmetricGroup(5)
sage: S5([1,4,3,2,5])
(2,4)
sage: _.parent()
Symmetric group of order 5! as a permutation group
Andrew
On Friday, 3 May 2019 22:11:29 UTC+10, Daniel Krenn wrote:
>
> sage: Permutation([5,4,3,2,1]).parent()
> Standard permutations
> sage: Permutation('(1,5)(2,4)(3)').parent()
> Standard permutations of 5
>
> Why is the first not restricted to permutations of length 5?
>
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.