Macaulay2 / M2

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

bug in map and image #3352

Open mahrud opened 2 months ago

mahrud commented 2 months ago

What is happening here?

i1 : f = vars(QQ[x,y]);

i2 : map(image f, , f)
stdio:2:1:(3): error: expected matrix and new target module to agree

Note: I understand that inducedMap works here, but that method can be computationally expensive (e.g. computes Grobner bases in some cases) which seems unnecessary for what the code above should do.

mahrud commented 2 months ago

Related: say I have the following matrix:

i1 : R = QQ[a..d];

i2 : P = image map(R^{4:-3}, , {{d}, {0}, {-c}, {b}})

o2 = image {3} | d  |
           {3} | 0  |
           {3} | -c |
           {3} | b  |

                             4
o2 : R-module, submodule of R

i3 : f = basis(5, P)

o3 = {4} | a b c d |

                   4
o3 : Matrix P <-- R

Now I take it's image and forget about f:

i4 : F = image f

o4 = image {3} | ad  bd  cd  d2  |
           {3} | 0   0   0   0   |
           {3} | -ac -bc -c2 -cd |
           {3} | ab  b2  bc  bd  |

                             4
o4 : R-module, submodule of R

How do I recover the 1x4 map f again? gens F gives the 4x4 matrix. The only way seems to be inducedMap(P, , gens F), which performs a gb computation, for something we should have cached!