Skip to content
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

BoundsError thrown by weight(hook_lengths(partition([4,2,1]))) #4230

Open
fingolfin opened this issue Oct 23, 2024 · 4 comments
Open

BoundsError thrown by weight(hook_lengths(partition([4,2,1]))) #4230

fingolfin opened this issue Oct 23, 2024 · 4 comments
Labels

Comments

@fingolfin
Copy link
Member

julia> H = hook_lengths(partition([4,2,1]))
+---+---+---+---+
| 6 | 4 | 2 | 1 |
+---+---+---+---+
| 3 | 1 |
+---+---+
| 1 |
+---+

julia> weight(H)  # gives  BoundsError
ERROR: BoundsError: attempt to access 1-element Vector{Int64} at index [6]

A quick look at the code suggests that it requires that the tableau be semistandard, but does not check this! Either we modify the code so that it checks, or we modify it so that all Young tableaux are accepted. I do also wonder whether the name should be changed to weight_sequence. I have searched quickly on internet: given a YT the weight is a sequence; it may assume that the entries in the YT are positive (or maybe just non-negative).

Originally posted by @JohnAAbbott in #3850 (comment)

@fingolfin
Copy link
Member Author

The code in weight(tab::YoungTableau) indeed assumes that the given tableau is semi-standard, i.e., the entries are weakly increasing in each row; but here they are decreasing.

It would be easy to fix weight to deal with this case, but I wonder if this is the way to go. Perhaps @ulthiel has a comment on this?

@JohnAAbbott
Copy link
Contributor

To get a more helpful error message, the code should check that the input is semi-standard, and produce a comprehensible message if not: e.g. Tableau must be (semi-)standard

@JohnAAbbott
Copy link
Contributor

Regarding @fingolfin comment about the name. Oscar tends to use long names (with several exceptions). While the name weight is apparently used in literature focussed on combinatorics, for the benefit of people not so familiar with that small sphere, I think it would be more helpful to use the longer name weight_sequence (e.g. if the person needs to search for this phrase...)

@fingolfin
Copy link
Member Author

@JohnAAbbott can you please open a PR that let's it throw an error if the tableau is not standard? If someone needs the function more generally they can request it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants