Ask Your Question

# 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

## Comments

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

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?

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]

## 1 Answer

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

## Comments

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

Sure, you could replace the first two lines by

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


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?

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2018-09-23 20:17:59 +0200

Seen: 242 times

Last updated: Sep 25 '18