1 | initial version |
You can do the following if v
is a $1 \times 3^2$ 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 $3^2$ 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)])
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 $3^2$ 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)])