The GAP-command DirectSumMat allows to take the direct sum of matrices over (only certain?) fields. Now I did the following in GAP:
F:=FunctionField(Rationals,["x1","x2","x3","x4"]);AssignGeneratorVariables(F);
N:=[[x1,x2],[x3,x4]];U:=DirectSumMat(N,N);
This gives an error so it seems that the command DirectSumMat does not work over the field F:=FunctionField(Rationals,["x1","x2","x3","x4"]); or am I using the command wrong? The command DirectSumMat seems to work fine over the rationals.
Question: Is there an easy fix for this so that one can take the direct sum of matrices over any fields in GAP?
As a workaround until
DirectSumMatis fixed (hopefully in GAP 4.13.0, to be released in a couple weeks if all goes well), you can use this helper. For simplicity, it takes the coefficient ring plus two matrices; if you need more you can either call it multiple times or adapt it suitably):Example: