Can I get coefficients of a vector with respect to given basis for a vector space.

Hello.

I have a question.

For example,

1. make vector space V by a basis B=[1+x,3*x,x^2] over the field of rationalsQ
2. v=3*x^2+17*x+5 in V
3. v=a*B[0]+b*B[1]+c*B[2] for some a,b,c in Q
4. [a,b,c]=?

We easily know the solution of previous example.

In general, for given basis B and a vector v, how can I get the list of coefficients?

And is it possible to the case of matrix space (B: the basis consists of matrices) ?

Thanks. :)

edit retag close merge delete

Sort by » oldest newest most voted

Hi,

If V is the vector space, then you can simply ask for the coordinate vector of v by using V.coordinate_vector(v). If you wish to use a different basis, then you can construct the subspace U spanned by the new basis (see this other question) and then use U.coordinate_vector(v).

Hope this helps.

more

Oh, I see. By using that command, I solved my problem. :) I made a function that converts a polynomial to a vector in the vector space V. And then make the subspace U with the basis consists in converted vectors. Then I have coordinate vectors as I wanted. :)

( 2014-11-22 03:16:28 -0500 )edit