# Equivalent to Singular's minpoly?

Hello everyone

In Singular, one can define a ring such as

ring r = (0,i),(x,y),dp;
minpoly = i2+1;


in order to specify that the parameter i verifies i²+1=0. Can I do this, or is it at all needed to work with Q(i), in Sage?

As of now, I have defined a ring

K.<x,y,I>=QQ[]


but I don't know if defining I as a parameter of the ring in Sage is needed, neither how could I define the minimal polynomial for K.

Thank you.

Edit: I discovered I can simplify each polynomial using .mod(I^2+1) but I guess there has to be a more general solution that applies this to the ring itself.

edit retag close merge delete

Sort by » oldest newest most voted

Is this what you need ?

sage: R.<I> = QQ[I]
sage: R
Number Field in I with defining polynomial x^2 + 1
sage: K.<x,y> = PolynomialRing(R)
sage: K
Multivariate Polynomial Ring in x, y over Number Field in I with defining polynomial x^2 + 1
sage: P = x+I*y
sage: P^2
x^2 + (2*I)*x*y - y^2


EDIT: For GF(5), you can do similarly, but you have to define the quotient by yourself:

sage: S.<i> = GF(5)[]
sage: S
Univariate Polynomial Ring in i over Finite Field of size 5
sage: R.<I> = S.quotient(i^2+1)
sage: R
Univariate Quotient Polynomial Ring in I over Finite Field of size 5 with modulus i^2 + 1
sage: I
I
sage: I^2
4
sage: K.<x,y> = PolynomialRing(R)
sage: K
Multivariate Polynomial Ring in x, y over Univariate Quotient Polynomial Ring in I over Finite Field of size 5 with modulus i^2 + 1
sage: P = x+I*3*y
sage: P
x + 3*I*y
sage: P^2
x^2 + I*x*y + y^2

more

That is exactly what I needed, thank you!

Just one follow-up question, how would I do this for a finite field like GF(5) instead of QQ?

1