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

Surprising behaviour of PlanePartitions with given symmetry. #36116

Closed
2 tasks done
mantepse opened this issue Aug 22, 2023 · 1 comment · Fixed by #36124
Closed
2 tasks done

Surprising behaviour of PlanePartitions with given symmetry. #36116

mantepse opened this issue Aug 22, 2023 · 1 comment · Fixed by #36124

Comments

@mantepse
Copy link
Collaborator

Steps To Reproduce

PlanePartitions silently ignores the symmetry keyword when the first argument is an integer:

sage: [PlanePartitions(n, symmetry="TSSCPP").cardinality() for n in range(15)]
[1, 1, 3, 6, 13, 24, 48, 86, 160, 282, 500, 859, 1479, 2485, 4167]
sage: oeis(_)
0: A000219: Number of planar partitions (or plane partitions) of n.

For TSSCPP this is particularly puzzling, since in this case, the box must be a cube, so we would have to do

sage: [PlanePartitions([n,n,n], symmetry="TSSCPP").cardinality() for n in range(0,15,2)]
[1, 1, 2, 7, 42, 429, 7436, 218348]

instead. As a side note, it would be more useful if PlanePartitions(3, symmetry="TSSCPP").cardinality() would return zero instead of raising an error.

Expected Behavior

I would expect

sage: [PlanePartitions(n, symmetry="TSSCPP").cardinality() for n in range(15)]
[1, 0, 1, 0, 2, 0, 7, 0, 42, 0, 429, 0, 7436, 0, 218348]

Actual Behavior

sage: [PlanePartitions(n, symmetry="TSSCPP").cardinality() for n in range(15)]
[1, 1, 3, 6, 13, 24, 48, 86, 160, 282, 500, 859, 1479, 2485, 4167]

Additional Information

No response

Environment

irrelevant

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide
@mantepse
Copy link
Collaborator Author

I just realize that the semantics of the first argument depend on whether it is an integer or not:

  • if it is an integer, then it is interpreted as the number of boxes
  • otherwise it is interpreted as the ambient box size.

So possibly, this issue is invalid.

mantepse added a commit to mantepse/sage that referenced this issue Aug 22, 2023
vbraun pushed a commit to vbraun/sage that referenced this issue Aug 27, 2023
…gemath#36116

    
* Fix a thinko in the iterator for TSSCPP
* make plane partitions hashable
* avoid rational numbers in the cardinality methods, when necessary
* raise an error when an integer and a symmetry is provided as argument
to `PlanePartitions`

Fixes sagemath#36119
Fixes sagemath#36118
Fixes sagemath#36116

- [X] The title is concise, informative, and self-explanatory.
- [X] The description explains in detail what this PR is about.
- [X] I have linked a relevant issue or discussion.
- [X] I have created tests covering the changes.
    
URL: sagemath#36124
Reported by: Martin Rubey
Reviewer(s): Frédéric Chapoton
@mkoeppe mkoeppe added this to the sage-10.2 milestone Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants