New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Partitions to posets #15428
Comments
Author: Darij Grinberg |
This comment has been minimized.
This comment has been minimized.
comment:2
Wrong formatting in docstrings fixed; thanks Nathan! |
comment:3
Looks good to me. Thanks. |
Reviewer: Travis Scrimshaw |
comment:4
The documentation doesn't build properly:
|
comment:5
Thanks for spotting this one! It's weird: apparently sphinx doesn't like |
comment:6
I agree that there is a natural correspondance between a tableau (or more generally filling) and a poset. So having a poset method in tableaux definitely makes sense. Here the process is more about getting from a partition to a tableaux (or filling) using some filling scheme, and then asking for the poset. It would be natural for the invokation to reflect that:
If you believe a shorthand for the above really brings something to the user, please find something more explicit than just In general: I am super glad of all the work you are both puting into Sage, and all the progress that comes from the pair of you crossreviewing. But please keep in mind that we will have to maintain the code in the long run; so think really, really hard about good user interface and conciseness. Thanks guys! Keep it up! |
comment:7
Hi Nicholas, what exactly should the Best regards, Darij |
comment:8
OOPS, I was stupid: With your convention, |
comment:9
Hi Darij, I think Nicolas' point is that it is more natural to define posets associated to tableaux than partitions. The partition poset that you implemented could then be easily obtained from that. You could use
to label the cells by their coordinates. In Sage we should have general purpose methods rather than very specific methods. If I understand correctly, this is his point! Anne PS: I do not understand your comment that all entries are pairwise distinct. Cells inside a tableau/partition are always all distinct. |
comment:10
Hi Anne, The way I understand Nicolas, the poset would be labelled by the entries of the tableau, not by the cells of the tableau. So the entries would have to be distinct (and hashable). I still think that refactoring the method through a Greets, |
comment:11
Ok, I had missed the fact that the poset you created was indexed by the cells (i,j). That's a reasonable reason to put at least a shorthand in partition. I let you chose the final design and timeline (for this ticket or later) for the best, knowing that:
Cheers, |
comment:12
I guess my takeaway is then to add similar methods to About the name: What do you think about |
comment:13
The same name just came out independently in my head. So it's probably not too bad :-) |
comment:14
Btw:
Thanks! |
comment:15
OK, tomorrow. Setting to needs_work for now. Thanks for the careful look at the code! |
comment:16
I've renamed the methods and made the standard orientation the first example. About the DRYness, what exactly would you factor out? What do you mean by "indexing" rows and columns? About the |
comment:17
Replying to @darijgr:
Thanks. Maybe you could use SE rather than NW as well in the documentation when you explain what the poset is about.
Oh, now I see the misunderstanding; I thought the option was about the To make your code DRY, you could build two lists horizontal_covers and
For consistency, I would tend to favor non boolean options like Cheers, |
comment:18
Replying to @nthiery:
Will do next time I'm editing the file; good point!
Hmm. TBH I still don't understand you. How do you get anything from reversal? I'm building up a dictionary, not a list of cover relations. The (arguably toy) timing I have done shows the dictionary to be faster:
Hmm. I thought you wanted to get rid of strings as arguments. I'm not really convinced of replacing a 2-letter string by 2 multiletter strings :/ |
comment:19
Hi Darij, Replying to @darijgr:
I'd say: too early of an optimization. Especially since the above At this point, just focus on expressive and duplication free code. Use
I agree. My point was more about separation of concerns (up/down, Cheers, |
updated version |
comment:20
Attachment: trac_15428-partition-posets-dg.patch.gz I've replaced NW by SE in the doc. About %timeit not seeing the advantages of UniqueRepresentation: I kind of expected it, but I don't really know how to measure the timing right (I asked something similar on sage-devel a week ago). Maybe this:
I think that even when we speed up I don't think that separating the |
comment:21
Replying to @darijgr:
Thanks!
The conversion from a list to a dictionary is orders of magnitude
So, don't worry about this at this point.
Fair enough :-) Cheers, |
comment:22
Can anyone remind me what needs to be done here after all the discussion? Sorry, time flies... |
comment:23
I think all that's left is to convert this to a branch and do a final review... |
comment:24
OK -- since this needs review, I've thrown in one more minor commit. (The old one is unchanged apart from the commit message.) Nicolas' tableaux suggestion is now #15598. I haven't simplifies the implementation of the |
Commit: |
comment:26
Looks good to me. |
comment:27
Thank you once again! (And sorry for my reviewing inactivity lately...) |
This adds methods to
partition.py
andskew_partition.py
that take a partition to its corresponding poset. The user can choose the orientation of the poset from currently 4 geographical ones (if anyone knows some more -- let me know).Depends on #15350
CC: @sagetrac-sage-combinat @tscrim @anneschilling @nathanncohen
Component: combinatorics
Keywords: sage-combinat, partition, poset
Author: Darij Grinberg
Branch/Commit: public/combinat/partitions_posets @
b36286f
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/15428
The text was updated successfully, but these errors were encountered: