Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The following was working for me. A is a matrix of shape 6x35, taken (almost) randomly. (There was a rank check after getting it.) C is the linear code associated to it. B is the parity check matrix for the code.

sage: A = MatrixSpace( GF(2), 6, 35 ).random_element()
sage: A
[1 1 1 1 0 1 1 0 0 1 1 0 1 0 0 0 1 1 1 1 1 0 0 1 1 1 0 1 1 0 1 1 1 0 1]
[1 0 0 0 0 1 0 0 1 0 1 1 0 1 1 0 0 0 1 1 0 1 0 1 1 1 0 1 1 0 0 0 1 1 1]
[1 0 0 0 0 0 1 1 1 1 1 1 1 1 0 1 1 1 0 0 1 0 0 1 1 1 0 1 0 1 0 1 1 0 1]
[0 1 1 0 1 1 1 1 1 1 0 0 0 0 0 1 0 1 1 0 1 1 1 1 1 0 0 0 1 1 0 1 0 1 1]
[0 1 0 1 0 1 0 0 0 0 1 1 0 1 1 1 0 1 0 0 1 0 0 0 0 0 1 1 0 0 1 0 0 1 1]
[1 0 0 0 1 0 1 0 0 1 0 0 0 1 0 0 1 0 1 0 1 1 1 1 1 1 1 0 1 0 1 0 0 1 0]
sage: A.rank()
6
sage: # this is ok...
sage: C = LinearCode(A)
sage: B = C.parity_check_matrix()
sage: B
29 x 35 dense matrix over Finite Field of size 2 (use the '.str()' method to see the entries)