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 · 11 comments · May be fixed by #4270
Open

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

fingolfin opened this issue Oct 23, 2024 · 11 comments · May be fixed by #4270
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.

@JohnAAbbott
Copy link
Contributor

I'm almost ready to make a PR. One question: what name should the function have weight or weight_sequence?

@JohnAAbbott
Copy link
Contributor

My opinion: I believe that the name weight_sequence is significantly better than just weight. A brief search on the internet did not result in any conclusive function notation for the weight sequence of a YT. Changing the name is not backward compatible, but at the moment that probably affects no-one.

@JohnAAbbott
Copy link
Contributor

I do note that the word weight is also used in several other contexts in Oscar, whereas weight_sequence is not used anywhere outside my modified branch.

@lgoettgens
Copy link
Member

My opinion: I believe that the name weight_sequence is significantly better than just weight. A brief search on the internet did not result in any conclusive function notation for the weight sequence of a YT. Changing the name is not backward compatible, but at the moment that probably affects no-one.

We could (and IMO should) add a deprecation to the old name in case that you do a rename. (This is possible to do for only some dispatches)

@thofma
Copy link
Collaborator

thofma commented Nov 4, 2024

The method exists, is exported and documented. So removing it or deprecating it both require 2.0?

@lgoettgens
Copy link
Member

The method exists, is exported and documented. So removing it or deprecating it both require 2.0?

No, deprecating just requires a minor bump (so 1.3). Removing I agree with 2.0.

@joschmitt
Copy link
Member

I feel like the discussion about the name is moot as long as no-one who would actually use the function is voicing an opinion. For now, I would leave the name as it is (possibly with an alias for another variant) and hope that the original contributor chose it well. With this hope, I am against deprecating anything unless we are really sure about it.
But again, all of this is moot because I do not expect that I will ever use this function.

@JohnAAbbott JohnAAbbott linked a pull request Nov 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants