If you have an *ordered set* there is a canonical way to define one
permutation from a partition. You make it so that the atom of the
partitions are your cycles. And you order the cycle given by your order.
As an example
sage: p = SetPartition([[1,2,4],[3,5]]).to_permutation()
sage: p
[2, 4, 5, 1, 3]
sage: p.to_cycles()
[(1, 2, 4), (3, 5)]
There should also be Permutation.to_set_partition that gives the
partition of the space.
That being said: .to_permutation (and .to_whatever in general) are
terrible names.
Vincent
On 17/12/15 09:23, Nathann Cohen wrote:
Hello everybody,
Because of #19737 [1] (which was just opened) I learned the existence
of SetPartition.to_permutation.
A SetPartition object represents, as expected, a partition of a given
set. For FindSt---- some reason, there is a function turning it into a
permutation object [2], added in #14140 [3].
I do not see how this function can be defined mathematically and so I
write here to ask what you think we should do about it. Remove it?
Rename it? Move it to some other class?
Thanks,
Nathann
[1] http://trac.sagemath.org/ticket/19737
[2] Which raises an exception when one defines a partition of a set
which is not a set of integers:
sage: SetPartition([{'a','b','c'}]).to_permutation()
...
TypeError: cannot concatenate 'str' and 'int' objects
[3] http://trac.sagemath.org/ticket/14140
--
You received this message because you are subscribed to the Google Groups
"sage-devel" 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-devel.
For more options, visit https://groups.google.com/d/optout.