On Tue, Nov 24, 2009 at 8:59 AM, Felix Breuer <fe...@fbreuer.de> wrote:
> Hello!
>
> I want to do symbolic linear algebra with Sage, i.e. I want to
> calculate, say, the determinant of a matrix, where the entries of the
> matrix are symbolic expressions. I am under the impression that maxima
> is the right package for this task. Correct?
>
> I am now faced with the following problem: I have a list of vectors
> (with symbolic entries) and I want to form a matrix that has these
> vectors as columns. How do I achieve that?
>
> For what it's worth, here is what I tried:
>
> a = maxima('matrix([a1],[a2])')
> b = maxima('matrix([b1],[b2])')
> c = maxima('matrix([c1],[c2])')
> M = maxima('matrix(a-c,b-c)')
> M = maxima('matrix(transpose(a-c),transpose(b-c))')
>
> In the last two lines I get errors about the arguments being "invalid
> rows".
>
> Any suggestions?

Use Sage.  Don't use Maxima.

var('a1,a2,b1,b2,c1,c2')
a = matrix([[a1],[a2]])
b = matrix([[b1],[b2]])
c = matrix([[c1],[c2]])
M = (a-c).stack(b-c)
N = transpose(a-c).stack(transpose(b-c))

or

R.<a1,a2,b1,b2,c1,c2> = QQ[]
a = matrix([[a1],[a2]])
b = matrix([[b1],[b2]])
c = matrix([[c1],[c2]])
M = (a-c).stack(b-c)
N = transpose(a-c).stack(transpose(b-c))

See

  http://sagenb.org/home/pub/1123/

William

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to