On Mar 8, 2009, at 11:43 , alex wrote:

>
> How can i compute the matrix multiplication (product) of two symbolic
> matrices in sage ?

I'm not an expert in this part of Sage, but I think you need to get  
more explicit about what you are doing.  Real experts can correct me  
where I err.

In Sage, there is a "symbolic ring" that supports all symbolic  
computation.  When you declare variables:

sage: var('x y z w')
  (x, y, z, w)

these elements belong to that ring:

sage: x.parent()
  Symbolic Ring

The name of the ring is 'SR':

sage: SR
  Symbolic Ring

This seems to give you what you want:

sage: M = Matrix(SR,2,2,[x,y,z,w])
sage: M

[x y]
[z w]
sage: M*M

[y*z + x^2 x*y + w*y]
[x*z + w*z y*z + w^2]
sage: M^-1

[ w/(w*x - y*z) -y/(w*x - y*z)]
[-z/(w*x - y*z)  x/(w*x - y*z)]

HTH,

Justin

--
Justin C. Walker, Curmudgeon at Large
Director
Institute for the Enhancement of the Director's income
-----------
--
They said it couldn't be done, but sometimes,
it doesn't work out that way.
   - Casey Stengel
--




--~--~---------~--~----~------------~-------~--~----~
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
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to