conversion to recursive polynomial ring

22 views
Skip to first unread message

Ralf Hemmecke

unread,
Apr 27, 2015, 3:57:33 PM4/27/15
to sage-s...@googlegroups.com
Suppose I have an algorithm that works over univariate polynomials and can be recursively applied to its coefficients which may be themselves univariate polynomials over univariate polynomials ... over some base ring like QQ.
It probably makes sense to assume that the input polynomial is given exactly in such a recursive format.

Before I start writing a wrapper routine that turns any polynomial into such a recursive form, I'd like to ask whether such a routine perhaps already exists.

Input should be a polynomial in any form, for example living in Q[x,y,z][u,v][a][s,t] should be transformed into the "same" polynomial living in Q[x][y][z][u][v][a][s][t] (of course, creating that very recursive polynomial ring during the coercion).

I hope, it's somehow clear what I mean.

Thank you in advance.

Ralf

Vincent Delecroix

unread,
Apr 28, 2015, 1:47:29 AM4/28/15
to sage-s...@googlegroups.com
There is already a "routine" called coercion

sage: P = QQ['x','y','z']['u','v']['a']['s','t']
sage: R = QQ['x']['y']['z']['u']['v']['a']['s']['t']

Generators of P:

sage: Px,Py,Pz,Pu,Pv,Pa,Ps,Pt = map(P, 'xyzuvast')

Generators of R:

sage: Rx,Ry,Rz,Ru,Rv,Ra,Rs,Rt = map(R, 'xyzuvast')

A polynomial on P

sage: p = (Px + Pu*(Py*Pz +Pa)) * (1 + Ps + Pt) * (1 + Px)

Its equivalent on R

sage: r = R(p)

Of course, this is not completely automatic like

sage: p.as_I_want()

Note that the data structure used for the above polynomial r will be
*very* slow compared to using directly the multivariate polynomial ring
QQ['x','y','z','u','v','a','s','t']. So I would rather advice you to try
hard using this one instead of the recursive version.

Vincent

Nils Bruin

unread,
Apr 28, 2015, 2:43:23 AM4/28/15
to sage-s...@googlegroups.com
On Monday, April 27, 2015 at 10:47:29 PM UTC-7, vdelecroix wrote:
Note that the data structure used for the above polynomial r will be
*very* slow compared to using directly the multivariate polynomial ring
QQ['x','y','z','u','v','a','s','t']. So I would rather advice you to try
hard using this one instead of the recursive version.
 
That depends on what you want to do. For some polynomial computations, recursive dense representation is quite compact and efficient.
Reply all
Reply to author
Forward
0 new messages