Ticket #11165 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

core and quotient of partitions should be partitions

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

Description

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

trac_11165-partitions_core_quotient_fix-fh.patch Download (3.3 KB) - added by hivert 2 years ago.

Change History

Changed 2 years ago by hivert

comment:1 Changed 2 years ago by hivert

  • Status changed from new to needs_review

Patch ready for review

comment:2 Changed 2 years ago by mhansen

  • Status changed from needs_review to positive_review
  • Reviewers set to Mike Hansen

Looks good to me.

comment:3 Changed 2 years ago by pdehaye

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 2 years ago by jdemeyer

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-4.7.1.alpha3
Note: See TracTickets for help on using tickets.