#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 ncohen):

 Hello,

 > 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):
 >         ....
 >
 > }}}

 To me such a design would work nicely. And the check that is needed by all
 those functions can be performed there:

 {{{
 class IntegerSetPartition(SetPartition):
     def __init__(self, **kwargs):
         SetPartition.__init__(self,**kwargs)
         assert set(self.base_set()) ==
 set(range(self.base_set_cardinality()))
 }}}

 Or something nicer, which would yield a clearer error message when the
 input is wrong.

 I believe that this is the way to go. Really, look at the functions of
 `SetPartition`: how many are defined for integer partitions *only*? I
 don't know much about this kind of combinatorics, but `is_noncrossing`
 seems to be of that kind. Hell, I'd even be surprised if less than half of
 the methods of `SetPartition` should not be there, or is plain broken
 (.N(), .base_extend(), .base_ring(), .count(), db(), .n(),
 .numerical_approx(), .rename(), .reset_name(), .subs(), .substitute(),
 .version()).

 Nathann

--
Ticket URL: <http://trac.sagemath.org/ticket/19737#comment:19>
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