Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can define a function to do the same for arbitrary $n$ (I am just guessing the shape of your matrices)

def MultiMatrix(n):
      R = PolynomialRing(GF(2), n, 'x')
      M = MatrixSpace(R,n,n)
      return M([[R.gen(k)^(2^l) for k in [0..n-1]] for l in [1..n]])

Then we have

MultiMatrix(3)
[x0^2 x1^2 x2^2]
[x0^4 x1^4 x2^4]
[x0^8 x1^8 x2^8]

and

MultiMatrix(4)
[ x0^2  x1^2  x2^2  x3^2]
[ x0^4  x1^4  x2^4  x3^4]
[ x0^8  x1^8  x2^8  x3^8]
[x0^16 x1^16 x2^16 x3^16].