Open mahrud opened 1 year ago
++
edit: actually I was thinking of modules, not matrices, but kinda sameI think like this could be a thing that method functions do automatically so you don't have to do it manually dozens of places.
Moving over these from #535:
Problem:
kernel
changes the ambient free module. For instance, the original might have direct sum components, as in the example below, but the call to 'kernel' loses this information.S = ZZ/101[a..d] M = S^1 ++ S^2 F = S^2 f = random(F,M) K = kernel f assert(target generators K == M) assert(target generators K === M) assert(components target generators K == components M) -- fails
The
ambient
of the map should also remember this information.g = K_{0} ambient g target ambient g === M components M components target ambient g assert(components M == components target ambient g)
There is (or recently was) the same problem with tensor products and Hom. I wrote special versions “tensorWithSummands” etc to fix this.
Also related: #300
(I vaguely recall a related issue, but I couldn't find it. Let me know if this is duplicate)
It seems like there are a lot of procedures that cause M2 to forget component and formation information. Ideally this work shouldn't have to be duplicated in every single method. Is there a good way to do this once? For instance, when creating the directSum method give it an option that indicates that the method should store formation in each call.
More specifically for this issue, I think the following should work:
Perhaps additive methods should automatically be applied component-wise? Not sure if this is a good idea in general though.