First time here? Check out the FAQ!

Ask Your Question
1

Linear transformation from polynomials

asked 13 years ago

RPC gravatar image

updated 13 years ago

Suppose I have an unspecified list of degree 1 homogeneous polynomials in several variables, say [X1,X2,X3+3X4,X0]. This list will define a linear transformation [X0,X1,X2,X3,X4]|---->[X1,X2,X3+3X4,X0].

A priori I don't know how many variables or polynomials I will have, since they are found depending on some previous parameters. (The way I have done this, the variables are the generators of a polynomial ring V = PolynomialRing(QQ, dim,'X').)

My question is: How can I transform this list of polynomials into a matrix/linear transformation?

I've tried collecting the coefficients, but the .coefficients() does not work really well for multivariable polynomials since it does not "see the zero terms" (at least I don't know how to do that).

Preview: (hide)

Comments

Your question is not clear to me mathematically. What do you mean by transforming a list of polynomials into a matrix or linear transformation?

John Palmieri gravatar imageJohn Palmieri ( 13 years ago )

Sorry, I guess I was not too precise. I've edited and hopefully it will make sense now.

RPC gravatar imageRPC ( 13 years ago )

1 Answer

Sort by » oldest newest most voted
2

answered 13 years ago

parzan gravatar image

How is this?

sage: dim=4                                
sage: F = PolynomialRing(QQ, dim,'X')      
sage: I = F.ideal([x*y for x,y in tuples(F.gens(),2)])
sage: pol = [I.reduce(F.random_element()) for i in range(dim)]
sage: pol
[-3*X2, -39/2*X1 - 1/18*X2, -1/10*X0 - 3*X1 - X2 - 1/5*X3, X2 + 6*X3]
sage: matrix(dim,lambda i,j:pol[i].coefficient(F.gen(j)))
[    0     0    -3     0]
[    0 -39/2 -1/18     0]
[-1/10    -3    -1  -1/5]
[    0     0     1     6]
Preview: (hide)
link

Comments

Thanks. That'll do it.

RPC gravatar imageRPC ( 13 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 13 years ago

Seen: 1,138 times

Last updated: Feb 11 '12