Open taboege opened 3 weeks ago
Interesting. snf_with_transform
is actually a function provided by AbstractAlgebra, but it is underdocumented and I don't think it was written with zero divisors in mind.
But your code snippet actually doesn't run in AA, nor in Nemo (entering it will throw various "not implemented" errors). It only runs in Hecke (and hence in OSCAR) because Hecke actually implements Base.divrem(n::T, m::T) where T <: Union{zzModRingElem,Nemo.ZZModRingElem}
.
Anyway, https://github.com/Nemocas/AbstractAlgebra.jl/pull/1899 fixes this particular instances. But I'd not be surprised if there were other issues with it.
Thanks, this is very interesting! I had tracked the SNF code to AbstractAlgebra but couldn't get my example to run, for the reason you mentioned. It seems like there is still something to be done in the implementation over in AbstractAlgebra to make it work in the presence of zero divisors. I'm not sure if this issue should be closed while the one in AA remains open?
The problem
The function
snf_with_transform
returns inconsistent results, at least over residue rings ofZZ
. As documented, the returned tupleS,T,U = snf_with_transform(A)
should satisfyT*A*U == S
but doesn't in the following example:The function works fine over
ZZ
:Note that a Smith normal form over
ZZ
reduces to a Smith normal form overZZ/8
by reducing all the entries mod 8. This shows that the matrixS
computed overZZ/8
was wrong (its 3rd diagonal entry should be 4 instead of 0) andT*A*U
was right.Version information