#19737: SetPartition.to_permutation().cycle_tuples() is not the identity
-------------------------------------+-------------------------------------
       Reporter:  mantepse           |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-7.0
      Component:  combinatorics      |   Resolution:
       Keywords:  set partitions,    |    Merged in:
  permutations                       |    Reviewers:
        Authors:  Martin Rubey       |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  c6a3939d2e18efe3906e1f959dc5c019c921a944
  u/mantepse/setpartition_to_permutation___cycle_tuples___is_not_the_identity|  
   Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by mantepse):

 Replying to [comment:15 ncohen]:
 > > Oh, I missed that, I thought that Permutation would handle bijections,
 not just Permutations of `{1,...,n}`.  That's really strange, I must say.
 > >
 > > Hm, now I'm not sure what should be done.  I guess, the only
 reasonable thing then is to fail when the ground set is not of this form.
 Well, that might make sense anyway.
 >
 > On the sage-devel thread I opened (se [comment:6]) I proposed to rename
 the class (or to create a new one) which checks from the start that its
 ground set is 1...n. This way, one could write methods like
 `to_permutation` without having to check it manually, each time.
 >
 > There is a usage from a `SetPartition` class with arbitrary ground set
 (I do have examples in mind) and usage for a specific
 `IntegerSetPartition` class restricted to those 1...n integers, which is
 the only case many seem to be interested in.
 >
 > Mixing the two, as it is done in this class, is a bad idea.

 I am not quite convinced that this is true.  But if you are convinced, is
 there an easy way to do it?  Can I simply do
 {{{
 class IntegerSetPartition(SetPartition):

     def to_permutation(self):
         ....

 }}}

 where should I put the check that the ground set is {1,...,n}?

--
Ticket URL: <http://trac.sagemath.org/ticket/19737#comment:18>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" 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-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to