On Dec 29, 2008, at 3:32 PM, Santanu Sarkar wrote:

> I write a program in SAGE as follows:
> R.<x1,x2>=QQ[]
> M=matrix(R,1,2,[x1+x2,x1*x2])
> may i do following steps to extract polynomials from matrix?
> 1) x = list(M)
> 2) f1 = x[0]
> 3) f2 = x[1]
> is f1 & f2 are polynomials?
> if not how i can get them? please help me!

I think that

sage: x = M.list()

will do what you want.

I'm not sure why list(M) doesn't do "the right thing":

sage: list(M)
  [(x1 + x2, x1*x2)]

To get what you want using list(), do
sage: x = list(M)
sage: f1=x[0][0]
sage: f2=x[0][1]

HTH

Justin

--
Justin C. Walker, Curmudgeon at Large
Institute for the Absorption of Federal Funds
--
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