M2
M2 copied to clipboard
bug in (quotient, Module, Ideal)
The following code produces an error because the ambient free module of M has a Schreyer order, whereas the ambient free module of 0*M does not (the free modules mentioned in the error message are the same except for this.)
S = ZZ/101[x]
I = ideal "x2"
R=S/I
F = res coker vars R
M = image F.dd_2
(0*M):(ideal gens R)
stdio:6:6:(3): error: expected matrices with the same target
Yes, @jchen419 and I traced this to using =!= instead of != for checking equality of modules in remainder(Matrix,Matrix). I made an issue in https://github.com/Macaulay2/M2/issues/1726 with a list of all uses of =!= but didn't hear back about whether there's a reason =!= has been used in so many places instead of !=.
It's probably fine to change those occurrences of =!=. Perhaps simultaneously review the method for Module == Module for speed -- if the two modules have identical generators and relations, it seems that it could return true more quickly.
Actually, I don't think my comment above is the root of this problem anymore:
i1 : R = kk[x]/x^2;
i2 : C = res ideal gens R
1 1 1
o2 = R <-- R <-- R
0 1 2
o2 : ChainComplex
i8 : target C.dd_2
1
o8 = R
o8 : R-module, free, degrees {1}
i3 : target C.dd_2 == R^{-1}
o3 = true
i4 : target C.dd_2 === R^{-1}
o4 = false
Shouldn't free modules with the same degree be essentially unique?! It seems like the raw module coming from the engine is different:
i6 : raw target C.dd_2
o6 = free(rank 1 degrees = {T}x.0)
o6 : RawFreeModule
i7 : raw R^{-1}
o7 = free(rank 1 degrees = {T})
o7 : RawFreeModule
@mikestillman do you know what {T}x.0 means?