Ask Your Question

Revision history [back]

The elements of your lists belong to a monoid, not a ring:

sage: type(A[0])
<class 'sage.monoids.string_monoid_element.StringMonoidElement'>
sage: A[0].parent()
Free binary string monoid

So, you can transform them into integer first:

sage: A = [ZZ(str(i)) for i in A]
sage: B = [ZZ(str(i)) for i in B]

Then, you can do:

sage: Matrix([A,B])
2 x 448 dense matrix over Integer Ring (use the '.str()' method to see the entries)

(note that you put to many brackets).

The elements of your lists belong to a monoid, not a ring:

sage: type(A[0])
<class 'sage.monoids.string_monoid_element.StringMonoidElement'>
sage: A[0].parent()
Free binary string monoid

So, you can transform them into integer first:

sage: A = [ZZ(str(i)) for i in A]
sage: B = [ZZ(str(i)) for i in B]

Then, you can do:

sage: Matrix([A,B])
2 x 448 dense matrix over Integer Ring (use the '.str()' method to see the entries)

(note that you put to many brackets).

You can also trnasform 0 and 1 as elements of GF(2) if it makes more sense in your application.