Ask Your Question

Revision history [back]

Sage displays all vector spaces with the basis given in rows of a matrix; see the documentation of basis_matrix.

The basis that you got spans the same space as the basis you expected:

sage: A = matrix(QQ, [[1,3,8],[1,2,6],[0,1,2]])
sage: A.column_space() == matrix(QQ, [[1, 3], [1, 2], [0, 1]]).column_space()
True

You can also get the basis as a list of vectors instead:

sage: A.column_space().basis()
[
(1, 0, 1),
(0, 1, -1)
]

Indeed these are the rows of the matrix.