Ask Your Question

Revision history [back]

This is not very specific to Sage: if M is the matrix whose columns C_1,...,C_n represent your basis expressed in the canonical basis, you have M*X=aa, where X is a column vector, whose entries x_1,...x_ncorrespond to the coefficients of the linear combination you are looking for, that is aa = x_1*C_1+...+x_n*C_n.

So, if you want to find X you just have to compute X=M^(-1)*aa.

This is not very specific to Sage: if M $M$ is the matrix whose columns C_1,...,C_n $C_0,...,C_{n-1}$ represent your basis expressed in the canonical basis, you have M*X=aa, $MX=aa$, where X $X$ is a column vector, whose entries x_1,...x_n$x_0,...x_{n-1}$ correspond to the coefficients of the linear combination you are looking for, that is aa $aa = x_1*C_1+...+x_n*C_n.x_0C_0+...+x_{n-1}*C_{n-1}$.

So, if you want to find X $X$ you just have to compute X=M^(-1)*aa.compute:

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

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

sage:  L = X.list()

This is not very specific to Sage: if $M$ is the matrix whose columns $C_0,...,C_{n-1}$ represent your basis expressed in the canonical basis, you have $MX=aa$, X=aa$ where $X$ is a column vector, whose entries $x_0,...x_{n-1}$ correspond to the coefficients of the linear combination you are looking for, that is $aa = x_0C_0+...+x_{n-1}*C_{n-1}$.

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 $x_i$ as in a list, you can do:

sage:  L = X.list()

This is not very specific to Sage: if $M$ is the matrix whose columns $C_0,...,C_{n-1}$ represent your basis expressed in the canonical basis, then you have $MX=aa$ X=aa$, where $X$ is a column vector, whose entries $x_0,...x_{n-1}$ correspond to the coefficients of the linear combination you are looking for, that is $aa = x_0C_0+...+x_{n-1}*C_{n-1}$.

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 $x_i$ as in a list, you can do:

sage:  L = X.list()

This is not very specific to Sage: if $M$ is the matrix whose columns $C_0,...,C_{n-1}$ represent your basis expressed in the canonical basis, then you have $MX=aa$, X=aa$ where $X$ is a column vector, whose entries $x_0,...x_{n-1}$ correspond to the coefficients of the linear combination you are looking for, that is $aa = x_0C_0+...+x_{n-1}*C_{n-1}$.

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 $x_i$ as in a list, you can do:

sage:  L = X.list()

This is not very specific to Sage: if $M$ is the matrix whose columns $C_0,...,C_{n-1}$ represent your basis expressed in the canonical basis, then you have $MX=aa$ $MX=aa$ where $X$ is a column vector, whose entries $x_0,...x_{n-1}$ correspond to the coefficients of the linear combination you are looking for, that is $aa = x_0C_0+...+x_{n-1}C_0+...+x_{n-1}*C_{n-1}$.C_{n-1}$.

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 $x_i$ as in a list, you can do:

sage:  L = X.list()

This is not very specific to Sage: if $M$ is the matrix whose columns $C_0,...,C_{n-1}$ represent your basis expressed in the canonical basis, then you have $MX=aa$ where $X$ is a column vector, whose entries $x_0,...x_{n-1}$ correspond to the coefficients of the linear combination you are looking for, that is $aa = x_0C_0+...+x_{n-1}C_{n-1}$.C_{n-1}$ .

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 $x_i$ as in a list, you can do:

sage:  L = X.list()

This is not very specific to Sage: if $M$ is the matrix whose columns $C_0,...,C_{n-1}$ represent your basis expressed in the canonical basis, then you have $MX=aa$ where $X$ is a column vector, whose entries $x_0,...x_{n-1}$ correspond to the coefficients of the linear combination you are looking for, that is $aa = x_0C_0+...+x_{n-1}C_{n-1}$ x_0C_0+...+x_{n-1}C_{n-1}$ .

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 $x_i$ as in a list, you can do:

sage:  L = X.list()

This is not very specific to Sage: if $M$ is the matrix whose columns $C_0,...,C_{n-1}$ represent your basis expressed in the canonical basis, you have $MX=aa$ where $X$ is a column vector, whose entries $x_0,...x_{n-1}$ correspond to the coefficients of the linear combination you are looking for, that is $aa = x_0C_0+...+x_{n-1}C_{n-1}$ .

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 $x_i$ as in a list, you can do:

sage:  L = X.list()