Opened 12 years ago

Closed 11 years ago

#11165 closed enhancement (fixed)

core and quotient of partitions should be partitions

Reported by: Florent Hivert Owned by: Sage Combinat CC user
Priority: major Milestone: sage-4.7.1
Component: combinatorics Keywords: partitions core quotient
Cc: Sage Combinat CC user Merged in: sage-4.7.1.alpha3
Authors: Florent Hivert Reviewers: Mike Hansen
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


Currently the methods core and quotient returns respectively a list and a list of list:

sage: Partition([7,7,5,3,3,3,1]).core(3)
[1, 1]
sage: type(Partition([7,7,5,3,3,3,1]).core(3))
<type 'list'>

sage:  sage: Partition([7,7,5,3,3,3,1]).quotient(3)
[[2], [1], [2, 2, 2]]
sage:  type(Partition([7,7,5,3,3,3,1]).quotient(3)[0])
<type 'list'>

Mathematically, those lists are partitions and moreover list are not hashable. As a consequence, in most use we have no choice but to change them to partitions. So after the patch, core should returns a partition and quotient a tuple of partitions.

Attachments (1)

trac_11165-partitions_core_quotient_fix-fh.patch (3.3 KB) - added by Florent Hivert 12 years ago.

Download all attachments as: .zip

Change History (5)

Changed 12 years ago by Florent Hivert

comment:1 Changed 12 years ago by Florent Hivert

Status: newneeds_review

Patch ready for review

comment:2 Changed 12 years ago by Mike Hansen

Reviewers: Mike Hansen
Status: needs_reviewpositive_review

Looks good to me.

comment:3 Changed 12 years ago by Paul-Olivier Dehaye

the construction of partitions starting with a core and a finite sequence of quotients is broken, please look at #11412 for a fix on top of this patch

comment:4 Changed 11 years ago by Jeroen Demeyer

Merged in: sage-4.7.1.alpha3
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.