Ask Your Question

how to check if a polynom is a square

asked 2020-04-17 23:32:38 +0200

Dasiatys gravatar image

I'ld like to put a condition in a programm that looks like:

"if Q is a square, then ..."

Q being a polynom (in GF(p)).

How can I do that ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-04-18 10:36:33 +0200

vdelecroix gravatar image

First of all, there is a function to check if a polynomial is a square

sage: x = polygen(GF(7))
sage: p = 2*x^2 + 6*x + 1
sage: p.is_square()

Then you need to learn about conditional statements in Python (if/elif/else):

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools


Asked: 2020-04-17 23:32:38 +0200

Seen: 342 times

Last updated: Apr 18 '20