Skip to content

add add_entry and anti_restrict methods to SkewTableau #39918

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

Merged
merged 11 commits into from
Jun 1, 2025

Conversation

jmcdonough98
Copy link
Contributor

add_entry and anti_restrict are already existing methods in Tableau, but they also make sense for SkewTableau.
This PR ports these methods to SkewTableau, and adds a simple check to add_entry to avoid trying to construct a new tableau when the given cell is too large.

📝 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

None

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/sage/combinat/tableau.py:3193

  • The new condition in add_entry adds a constraint that may unintentionally block valid cells in edge cases. Please verify that this additional check correctly handles all tableau shapes and add a comment explaining its intent.
if c == len(tab_r) and (r == 0 or len(tab_r) < len(tab[r-1])):

if r == len(tab) and c == 0:
tab.append([m])
else:
raise IndexError('%s is not an addable cell of the tableau' % ((r, c),))
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe check here for bottom left cell None (per our in-person conversation)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This ended up being not too bad to implement in full generality (instead of raising a NotImplementedError like we previously discussed).

Copy link
Contributor

@trevorkarn trevorkarn left a comment

Choose a reason for hiding this comment

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

LGTM

@trevorkarn
Copy link
Contributor

@jmcdonough98 as long as your tests pass locally, you can set to positive review

@jmcdonough98
Copy link
Contributor Author

@trevorkarn all tests pass on my machine, but github is not letting me change PR labels. I think I don't have permission.

@vbraun
Copy link
Member

vbraun commented May 18, 2025

merge conflict, please fix

@trevorkarn
Copy link
Contributor

Thanks @vbraun. @jmcdonough98 Do you need help with this?

vbraun pushed a commit to vbraun/sage that referenced this pull request May 24, 2025
sagemathgh-39918: add add_entry and anti_restrict methods to SkewTableau
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

`add_entry` and `anti_restrict` are already existing methods in
`Tableau`, but they also make sense for `SkewTableau`.
This PR ports these methods to `SkewTableau`, and adds a simple check to
`add_entry` to avoid trying to construct a new tableau when the given
cell is too large.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

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

### ⌛ Dependencies
None
<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#39918
Reported by: Joe McDonough
Reviewer(s): Copilot, Joe McDonough, trevorkarn
vbraun pushed a commit to vbraun/sage that referenced this pull request May 26, 2025
sagemathgh-39918: add add_entry and anti_restrict methods to SkewTableau
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

`add_entry` and `anti_restrict` are already existing methods in
`Tableau`, but they also make sense for `SkewTableau`.
This PR ports these methods to `SkewTableau`, and adds a simple check to
`add_entry` to avoid trying to construct a new tableau when the given
cell is too large.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

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

### ⌛ Dependencies
None
<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#39918
Reported by: Joe McDonough
Reviewer(s): Copilot, Joe McDonough, trevorkarn
vbraun pushed a commit to vbraun/sage that referenced this pull request May 28, 2025
sagemathgh-39918: add add_entry and anti_restrict methods to SkewTableau
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

`add_entry` and `anti_restrict` are already existing methods in
`Tableau`, but they also make sense for `SkewTableau`.
This PR ports these methods to `SkewTableau`, and adds a simple check to
`add_entry` to avoid trying to construct a new tableau when the given
cell is too large.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

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

### ⌛ Dependencies
None
<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#39918
Reported by: Joe McDonough
Reviewer(s): Copilot, Joe McDonough, trevorkarn
@vbraun vbraun merged commit 8e0eda4 into sagemath:develop Jun 1, 2025
3 checks passed
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