sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.4k stars 473 forks source link

Surprising behaviour of PlanePartitions with given symmetry. #36116

Closed mantepse closed 1 year ago

mantepse commented 1 year ago

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

mantepse commented 1 year ago

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

So possibly, this issue is invalid.