Skip to content

Conversation

@alvgutcac
Copy link

@alvgutcac alvgutcac commented Feb 24, 2025

The bijection from Knutson-Tao puzzles to Littlewood-Richardson tableaux was implemented in the initial version of sage.combinat.knutson_tao_puzzles but it was removed during revision. See #14141 (comment) and #14141 (comment)
This is a new independent implementation.

Changes to sage.combinat.knutso_tao_puzzles:

  • A new public method PuzzleFilling.to_littlewood_richardson_tableau that takes a puzzle filling and returns its corresponding Littlewood-Richardson tableau.
  • A new private method PuzzleFilling._ne_to_south_path that does one step of the above bijection.
  • Refactoring of all code to make output consistent.

Changes to sage.combinat.skew_tableau:

  • A new method SkewTableau.is_littlewood_richardson that checks if a tableau is Littlewood-Richardson
  • A new method SkewTableau.to_knutson_tao_puzzle that sends a Littlewood-Richardson tableau to a Knutson-Tao puzzle. This is the inverse of PuzzleFilling.to_littlewood_richardson_tableau.

Changes to sage.combinat.partition:

  • A new public method Partition.to_abacus that converts a partition to a string of 0s and 1s representing its abacus.
  • A new public function abacus_to_partition which is the inverse of the above.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

Álvaro Gutiérrez and others added 4 commits February 24, 2025 15:13
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.
@mantepse mantepse self-requested a review February 25, 2025 07:26
@github-actions
Copy link

github-actions bot commented Feb 25, 2025

Documentation preview for this PR (built with commit 112b035; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@alvgutcac alvgutcac marked this pull request as ready for review February 25, 2025 09:42

def abacus_to_partition(abacus):
r"""
Returns a partition from an abacus.
Copy link
Contributor

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"

@fchapoton
Copy link
Contributor

also we prefer long but explicit names for functions and methods, without acronyms inside

@alvgutcac
Copy link
Author

also we prefer long but explicit names for functions and methods, without acronyms inside

So would you for instance call the method to_littlewood_richardson_tableau rather than to_LRtableau? If so I can make the changes.

@fchapoton
Copy link
Contributor

yes, please do

part = []
n = len(abacus)
k = 0
for i in range(0,n):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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')
Copy link
Contributor

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)

False
sage: SkewTableau([[None,1],[2,2]]).is_littlewood_richardson()
False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no empty line here

1/\0 0\/1
sage: ''.join(puzzle.south_labels())
'01000010001001000000'
sage: # puzzle.plot() # not tested
Copy link
Contributor

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

D[(a,b)]['north_west'] = '1'
D[(a,b)]['south_east'] = '1'
D[(a,b)]['south_west'] = '0'
(a, b) = (i, j)
Copy link
Contributor

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

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():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (i,j) in D.keys():
for i, j in D:

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()):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no .keys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants