# Changing from PolynomialRing to LaurentPolynomialRing and maybe back

Hej,

I am doing some calculations in a Polynomial Ring R<x,y,z> over a finite field GF(p). With the results from that calculation, I would like to do calculations for which I need a Laurent polynomials over the same finite field, how do I do that in SageMath?

R=PolynomialRing(GF(field),x,num_var, order='degrevlex')
d=f(x,y,z)
Change to LaurentPolynomialRing
Do so more calculations with results d


Thanks

edit retag close merge delete

Sort by » oldest newest most voted

Like this

sage: L = LaurentPolynomialRing(GF(3),x,2, order='degrevlex')
sage: R = L.polynomial_ring()
sage: x = R.gens()
sage: x[0] + 1
x0 + 1
sage: L(_)
x0 + 1
sage: parent(_)
Multivariate Laurent Polynomial Ring in x0, x1 over Finite Field of size 3

more

L = LaurentPolynomialRing(GF(11),x,2, order='degrevlex') R = L.polynomial_ring() x = R.gens() f=x[0]**2+1 L(f) print(f.parent())

returns: Multivariate Polynomial Ring in x0, x1 over Finite Field of size 11

In the console, the thing you suggest works

( 2022-05-19 16:27:23 +0200 )edit