Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question
0

Get decomposition of vector in basis

asked 9 years ago

mimoo gravatar image

Hey!

I have a matrix that represents my basis (it's actually a lattice so the vectors are rows, but it's not important I can transpose)

I have a vector aa in a canonical basis, I want to know what's the linear combination in R of my lattice's vectors that gives my vector aa

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 9 years ago

tmonteil gravatar image

updated 9 years ago

This is not very specific to Sage: if M is the matrix whose columns C0,...,Cn1 represent your basis expressed in the canonical basis, you have MX=aa where X is a column vector, whose entries x0,...xn1 correspond to the coefficients of the linear combination you are looking for, that is aa=x0C0+...+xn1Cn1 .

So, if you want to find X you just have to compute:

sage: X = M^(-1)*aa

Then, if you want to manipulate the coefficients xi as in a list, you can do:

sage: L = X.list()
Preview: (hide)
link

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: 9 years ago

Seen: 811 times

Last updated: May 21 '15