Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can do the following if v is a 1×32 matrix (as in your example):

Matrix([vector(v[3*k:3*k+3,0].transpose()) for k in range(3)])

Or more easily, if v is a vector with 32 components:

v = vector(GF(3)[x], [2*x+1,x,1,x,x^2+2*x,2*x,x,2*x^2,0])
Matrix([v[3*k:3*k+3] for k in range(3)])
click to hide/show revision 2
No.2 Revision

You can do the following if v is a $1 $3^2 \times 3^2$ 1$ matrix (as in your example):

Matrix([vector(v[3*k:3*k+3,0].transpose()) for k in range(3)])

Or more easily, if v is a vector with 32 components:

v = vector(GF(3)[x], [2*x+1,x,1,x,x^2+2*x,2*x,x,2*x^2,0])
Matrix([v[3*k:3*k+3] for k in range(3)])