Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 2 years ago

Max Alekseyev gravatar image

One can construct matrix space over GF(3) and then change ring of each matrix to ZZ and subtract 1:

MS = MatrixSpace(GF(3),2,2)
for T in MS:
    M = T.change_ring(ZZ).apply_map(lambda x: x-1)
    print(M,'\n')
click to hide/show revision 2
No.2 Revision

One To get all matrices over 1,0,+1 one can construct matrix space over GF(3) and then change ring of each matrix to ZZ and subtract 1:1 from each element:

MS = MatrixSpace(GF(3),2,2)
for T in MS:
MatrixSpace(GF(3),2,2):
    M = T.change_ring(ZZ).apply_map(lambda x: x-1)
    print(M,'\n')
click to hide/show revision 3
No.3 Revision

To get all matrices over ${ $\{ -1, 0, +1}$ +1\}$ one can construct matrix space over GF(3) and then change ring of each matrix to ZZ and subtract 1 from each element:

for T in MatrixSpace(GF(3),2,2):
    M = T.change_ring(ZZ).apply_map(lambda x: x-1)
    print(M,'\n')