M2 icon indicating copy to clipboard operation
M2 copied to clipboard

Components & formation of direct sums of matrices

Open mahrud opened this issue 2 years ago • 2 comments
trafficstars

(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:

i1 : m = matrix{{1}};

              1        1
o1 : Matrix ZZ  <--- ZZ

i2 : components(m ++ m)

o2 = {| 1 |, | 1 |}

o2 : List

i3 : components coker(m ++ m) -- HERE

o3 = {cokernel | 1 0 |}
               | 0 1 |

o3 : List

i4 : components(coker m ++ coker m)

o4 = {cokernel | 1 |, cokernel | 1 |}

Perhaps additive methods should automatically be applied component-wise? Not sure if this is a good idea in general though.

mahrud avatar Jun 26 '23 22:06 mahrud

  • taking the transpose / dual will lose formation
  • tensor product will lose components though formation will be there
  • labels of blocks get lost even with ++ edit: actually I was thinking of modules, not matrices, but kinda same

pzinn avatar Jun 30 '23 08:06 pzinn

I think like this could be a thing that method functions do automatically so you don't have to do it manually dozens of places.

mahrud avatar Jun 30 '23 13:06 mahrud

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.

mahrud avatar Jul 21 '24 17:07 mahrud

Also related: #300

mahrud avatar Jul 21 '24 18:07 mahrud