# Roots of Polynomials over finite Fields

Hi guys,

How can I define all polynomial as this form -> a*x^2+b*y-1 over QQ where a and b are constants. for examples polynomials as : 2*x^2+3*y-1 or 5*x^2+y-1 , ... I know that I have to create a PolynomialRing, but I don't understand how exactly.

Thank you so much.

edit retag close merge delete

What do you want to do with that set, apart from just "definiing" it ?

( 2018-09-24 21:14:30 +0200 )edit

The title of your question says "roots of polynomials over finite fields", while the body of your question asks about creating polynomials over QQ. Could you explain the relationship?

( 2018-09-25 12:15:43 +0200 )edit

I want to do the addition of 2 points of this equations (a point of this equation is a P=[x,y] such that f(P)=0) The addition for example would be -> [x1+x2, y1,y2]

( 2018-09-25 18:28:07 +0200 )edit

Sort by » oldest newest most voted

It seems you want to create a function to create polynomials of degree two, in two variables $x$, $y$, of the form $a x^2 + b y - 1$.

The function would take $a$ and $b$ as arguments and return the polynomial above.

You could define the polynomial ring in $x$ and $y$ over $\mathbb{Q}$ as

R = PolynomialRing(QQ, ['x', 'y'])
x, y = R.gens()


and then define a function that takes $a$ and $b$ and outputs $a x^2 + b y - 1$:

def degree_two_polynomial(a, b):
return a*x^2 + b*y - 1


which you could use as follows:

sage: degree_two_polynomial(2, 3)
2*x^2 + 3*y - 1
sage: degree_two_polynomial(5, 1)
5*x^2 + y - 1

more

I think that I understood your answer but, in your case, Why do you define R If you don't use it afterwards? Thank you so much

( 2018-09-25 18:24:04 +0200 )edit

Sure, you could replace the first two lines by

x, y = PolynomialRing(QQ, ['x', 'y']).gens()

( 2018-09-26 09:33:48 +0200 )edit

I want to do the addition of 2 points of this equations (a point of this equation is a P=[x,y] such that f(P)=0) The addition for example would be -> [x1+x2, y1,y2], do you know how?

( 2018-09-26 09:47:13 +0200 )edit