First time here? Check out the FAQ!

Ask Your Question
0

Column space of a matrix

asked 1 year ago

alef gravatar image

Hello Everyone,

I am new to Sage, and I am trying to use its linear algebra capabilities.

As a first exercise, I am trying to compute the column space of a matrix: A = matrix([[1,3,8],[1,2,6],[0,1,2]])

According to the documentation, the column space of A is given by A.column_space(). This function returns me:

  • Vector space of degree 3 and dimension 2 over Rational Field Basis matrix: [ 1 0 1] [ 0 1 -1]

when I was expecting [1 3] [1 2] [0 1]

I clearly missed something. Any clues? With Maxima, I got the expected colum space.

I thank you in advance for any help.

Best,

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 1 year ago

rburing gravatar image

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.

Preview: (hide)
link

Comments

Thank you Ricardo, the linear relationships between didn't appear clear to me at first.

Best,

alef gravatar imagealef ( 1 year ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 1 year ago

Seen: 517 times

Last updated: Oct 04 '23