Macaulay2 / M2

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.
https://macaulay2.com
334 stars 228 forks source link

Map of multigraded modules removes degrees #2368

Open mahrud opened 2 years ago

mahrud commented 2 years ago

Here is an example:

A = kk[x_0..x_1, DegreeRank => 2]
B = kk[a_0..a_1,y_0..y_1, DegreeRank => 4]
f = map(B, A, {B_0, B_1})
degrees A^{{1,2}}     -- {{-1, -2}}
degrees B^{{1,2,0,0}} -- {{-1, -2, 0, 0}}
degrees f A^{{1,2}}   -- {{ 0,  0, 0, 0}}, seems wrong
degrees sub(A^{{1,2}}, B) -- same
DanGrayson commented 2 years ago

If f were homogeneous, it would probably do something more sensible. Try giving f a degree map.

mahrud commented 2 years ago

Try giving f a degree map.

The usage of DegreeMap for multigraded rings is hard to use (and poorly documented), but regardless, I shouldn't need to. Here is another examples where M2 should just do the sensible thing:

A = kk[x_0..x_1, DegreeRank => 2]
R = A ** A
f = map(R, A)
degrees f A^{{1,2}} -- {{0, 0, 0, 0}}

S = A ** (kk[y])
f = map(S, A)
degrees f A^{{1,2}} -- {{0, 0, 0}}
mikestillman commented 2 years ago

I think that having it do something better by default is a good idea.

mahrud commented 2 years ago

Yes. Though both map(Ring, Ring, Matrix) and kernel RingMap are intimidatingly long for me. I think it might help if I broke them into smaller functions, perhaps using hooks to take care of special cases like maps involving Galois fields, then we can focus on the piece that guesses the correct degree map.

mahrud commented 2 years ago

What is a homogeneous ring map? The documentation doesn't say.