M2 icon indicating copy to clipboard operation
M2 copied to clipboard

Error in tensor(Ring, Ring, Join => false)

Open mahrud opened this issue 2 years ago • 10 comments

Here's an unexpected error:

i1 : S1 = QQ[x,y, DegreeRank => 1];

i2 : S2 = QQ[x,y, DegreeRank => 2];

i3 : tensor(S1, S2, Join => false)
stdio:3:1:(3): error: with Join => false, expected degree map to return a list of length at most 1

i4 : tensor(S2, S1, Join => false)

o4 = QQ[x , y , x , y ]
         0   0   1   1

o4 : PolynomialRing

Looking at the code, I can't figure out what was the intention here: https://github.com/Macaulay2/M2/blob/5572c8a245d187f6c22f8eaa0b03cac0b8d86e02/M2/Macaulay2/m2/monoids.m2#L703-L705

mahrud avatar Jul 03 '23 15:07 mahrud

More generally, when tensoring two (or more) rings, why are DegreeMap and DegreeLift only mapping the degrees of the first factor and the tensor ring?

mahrud avatar Jul 03 '23 15:07 mahrud

The meaning of Join => true is that the degrees from the various factors are concatenated to get the degrees in the tensor product. The meaning of Join => false is that they are not, so they all have to be the same length.

DanGrayson avatar Jul 08 '23 16:07 DanGrayson

I don't understand your point. In both examples above I'm using Join => false with the same rings.

mahrud avatar Jul 08 '23 19:07 mahrud

S1 has degrees of length 1 and S2 has degrees of length 2. There is no sensible way to combine these in a tensor product.

DanGrayson avatar Jul 25 '23 16:07 DanGrayson

Once again, that doesn't explain why switching the order of S1 and S2 changes the result. Can you clarify what is your definition of tensor product where A⊗B and B⊗A are not only non-isomorphic, but only one is defined and there is no sensible way to define the other?!

mahrud avatar Jul 25 '23 18:07 mahrud

What should the degrees of the generators in the tensor product be if Join => false is used? I'm not sure...

mikestillman avatar Jul 25 '23 19:07 mikestillman

I think there's a misunderstanding about what the issue is. I'm not asking something about Join => true vs. Joint => false. I'm only switching the order of the two rings:

i3 : tensor(S1, S2, Join => false)
stdio:3:1:(3): error: with Join => false, expected degree map to return a list of length at most 1

i4 : tensor(S2, S1, Join => false)

o4 = QQ[x , y , x , y ]
         0   0   1   1

I claim the results should be the same, so either both should give an error, or the outputs should be isomorphic, except with different degrees:

i3 : degrees tensor(S2, S1, Join => false)

o3 = {{1, 0}, {0, 1}, {0, 1}, {0, 1}}

o3 : List

i4 : degrees tensor(S1, S2, Join => false)

o4 = {{1, 0}, {1, 0}, {1, 0}, {0, 1}} -- hypothetical answer

o4 : List

mahrud avatar Jul 25 '23 20:07 mahrud

Good point!

By the way, use Join=>true to get the degree group of the tensor product to be G1++G2.

DanGrayson avatar Jul 26 '23 01:07 DanGrayson

By the way, use Join=>true to get the degree group of the tensor product to be G1++G2.

Correct. I edited this out because it wasn't relevant.

mahrud avatar Jul 26 '23 14:07 mahrud

This is causing a bug in PushForward package:

Here is a basic example from docs for reesAlgebra:

needsPackage "PushForward"
needsPackage "ReesAlgebra"

kk = ZZ/101;
S = kk[x_0..x_4]
I = trim monomialCurveIdeal(S, {2,3,5,6})
R = reesAlgebra I
f = map(R, S, DegreeMap => prepend_0)
assert isHomogeneous f

It seems like pushForward from Core works fine but pushFwd loses homogeneity:

isHomogeneous(N = coker basis(2, R^1)) -- true
isHomogeneous pushForward_f N          -- true
isHomogeneous pushFwd_f N              -- false

See @devlin-mallory's comment in https://github.com/Macaulay2/M2/issues/3077#issuecomment-1901395089.

mahrud avatar Jan 20 '24 00:01 mahrud