Consider the following four-dimensional matrix of four-dimensional matrices (they are the generators of the vector representation of the Lorentz group):
metric := Matrix(4,4,Vector([-1,1,1,1]),shape=diagonal):
generators := Matrix(4,4,
	(a,b) -> metric . Matrix(4,4,
	(c,d) -> metric[a,c]*metric[b,d] - metric[b,c]*metric[a,d])
);
The expression is antisymmetric in the indices a and b, i.e., the (outer) matrix is antisymmetric. So, to optimize my code (especially important, I suppose, when going to higher spacetime dimensions) I thought I would try adding the option shape=antisymmetric:
metric := Matrix(4,4,Vector([-1,1,1,1]),shape=diagonal):
generators := Matrix(4,4,
	(a,b) -> metric . Matrix(4,4,
	(c,d) -> metric[a,c]*metric[b,d] - metric[b,c]*metric[a,d]),
shape=antisymmetric);
The problem, however, is that now the diagonal elements are (of course) not four-dimensional generators anymore, but just plain scalar zeros. My question is: Can the scalar zeros be replaced (using the Matrix constructor) with four-dimensional zero-matrices, while still maintaining the option shape=antisymmetric?

Please Wait...