M2 icon indicating copy to clipboard operation
M2 copied to clipboard

Inconsistent behavior when defining polynomial rings with duplicate variables

Open d-torrance opened this issue 1 year ago • 1 comments

The following behavior seems reasonable, I suppose:

i1 : QQ[x,x]

o1 = QQ[x ..x ]
         0   1

o1 : PolynomialRing

But as soon as we try including three or more variables, we get the following:

i2 : QQ[x,x,x]
stdio:2:1:(3): error: baseName: no base name available

Shouldn't this give us QQ[x_0,x_1,x_2] for consistency?

d-torrance avatar May 24 '24 11:05 d-torrance

I think the issue is in this code:

https://github.com/Macaulay2/M2/blob/ec9e9ac60ed4a8e791448942202f077a88a87e15/M2/Macaulay2/m2/monoids.m2#L480-L481

The third argument to applyKeys is always a function of two arguments (the values of the clashing keys), so #dups will always be 2.

d-torrance avatar May 24 '24 12:05 d-torrance

Closed in #3262 and #3265.

d-torrance avatar Jun 03 '24 20:06 d-torrance