# Coercion - polynomial in two variable/polynomial in one variable over function field

I need to convert a polynomial $P \in \overline{\mathbb F}_p[x, y]$ to a polynomial in $\overline{\mathbb F}_p(x)[y]$. The following code works when the first line is replaced by F = GF(3), but at present it returns "ValueError: finite field modulus must be irreducible but it is not".

F = GF(3).algebraic_closure()
Rxy.<x, y> = PolynomialRing(F, 2)
g = x*y
Rx.<x> = PolynomialRing(F)
Fx = FractionField(Rx)
FxRy.<y> = PolynomialRing(Fx)
h = FxRy(g)
print(h)


Is there an easy fix? What is the reason? Edit: checked on SageMath 10.1 (on cocalc).

edit retag close merge delete

First, it looks like you're trying to convert the polynomial to an element in $\overline{\mathbb F}_p(x)[y]$ (note $(x)$ instead of $[x]$). Second, what version of Sage are you using, and what platform? This doesn't seem to work for me, either, but the line h = FxRy(g) just hangs rather than raising an error. (I'm using the latest beta release.)

( 2023-11-28 22:38:14 +0100 )edit

Yes, I made a mistake in the description, I meant the polynomial ring over the function field. Version is 10.1 via http://cocalc.com.

( 2023-11-28 23:26:15 +0100 )edit

Sort by » oldest newest most voted

In your code you define x and y and then re-define them in a new way, which may be confusing. Below I distinguish the variables definitions and convert g into h by simply evaluating it at new variables:

F = GF(3).algebraic_closure()
Rxy.<x, y> = PolynomialRing(F, 2)
g = x*y
Rx.<xx> = PolynomialRing(F)
Fx = FractionField(Rx)
FxRy.<yy> = PolynomialRing(Fx)
h = g(xx,yy)

more

Thanks! I tried distinguishing only y earlier, but it wasn't enough.

( 2023-11-29 09:25:32 +0100 )edit