-
-
Notifications
You must be signed in to change notification settings - Fork 704
Implement a bijection between Knutson-Tao puzzles and LR tableaux #39581
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
base: develop
Are you sure you want to change the base?
Conversation
The previous implementation iterated over sets, which caused inconsistent output; this was solved by adding 'UniqueRepresentation' as a parent for one class and by sorting outputs in many doctests. The new code iterates over tuples.
|
Documentation preview for this PR (built with commit 112b035; changes) is ready! 🎉 |
src/sage/combinat/partition.py
Outdated
|
|
||
| def abacus_to_partition(abacus): | ||
| r""" | ||
| Returns a partition from an abacus. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First line should use "imperative mode", so "Return" and not "Returns"
|
also we prefer long but explicit names for functions and methods, without acronyms inside |
So would you for instance call the method |
|
yes, please do |
src/sage/combinat/partition.py
Outdated
| part = [] | ||
| n = len(abacus) | ||
| k = 0 | ||
| for i in range(0,n): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| for i in range(0,n): | |
| for i in range(n): |
| k += 1 | ||
| part.insert(0, i+1-k) | ||
| elif abacus[i] != '0' and abacus[i] != 0: | ||
| raise ValueError('an abacus should be a tuple, list or string of 0s and 1s') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there should be a doctest for the raise (with a bad input provoking the error)
src/sage/combinat/skew_tableau.py
Outdated
| False | ||
| sage: SkewTableau([[None,1],[2,2]]).is_littlewood_richardson() | ||
| False | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no empty line here
src/sage/combinat/skew_tableau.py
Outdated
| 1/\0 0\/1 | ||
| sage: ''.join(puzzle.south_labels()) | ||
| '01000010001001000000' | ||
| sage: # puzzle.plot() # not tested |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for the # in front
src/sage/combinat/skew_tableau.py
Outdated
| D[(a,b)]['north_west'] = '1' | ||
| D[(a,b)]['south_east'] = '1' | ||
| D[(a,b)]['south_west'] = '0' | ||
| (a, b) = (i, j) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove all parentheses in this line and similar ones
src/sage/combinat/skew_tableau.py
Outdated
| dirs = ('north_east', 'north_west', 'south') | ||
| triangles = sorted(all_pieces.delta_pieces(), key=lambda p : ''.join(p[dir] for dir in dirs)) | ||
|
|
||
| for (i,j) in D.keys(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| for (i,j) in D.keys(): | |
| for i, j in D: |
src/sage/combinat/skew_tableau.py
Outdated
| dirs = ('north_east', 'north_west', 'south_east', 'south_west') | ||
| # Check what pieces have the desired boundaries | ||
| for piece in pieces: | ||
| if all(piece[dir] == D[(i,j)][dir] for dir in dirs if dir in D[(i,j)].keys()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no .keys
The bijection from Knutson-Tao puzzles to Littlewood-Richardson tableaux was implemented in the initial version of
sage.combinat.knutson_tao_puzzlesbut it was removed during revision. See #14141 (comment) and #14141 (comment)This is a new independent implementation.
Changes to
sage.combinat.knutso_tao_puzzles:PuzzleFilling.to_littlewood_richardson_tableauthat takes a puzzle filling and returns its corresponding Littlewood-Richardson tableau.PuzzleFilling._ne_to_south_paththat does one step of the above bijection.Changes to
sage.combinat.skew_tableau:SkewTableau.is_littlewood_richardsonthat checks if a tableau is Littlewood-RichardsonSkewTableau.to_knutson_tao_puzzlethat sends a Littlewood-Richardson tableau to a Knutson-Tao puzzle. This is the inverse ofPuzzleFilling.to_littlewood_richardson_tableau.Changes to
sage.combinat.partition:Partition.to_abacusthat converts a partition to a string of 0s and 1s representing its abacus.abacus_to_partitionwhich is the inverse of the above.📝 Checklist
⌛ Dependencies