ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 28 Aug 2016 23:10:36 +0200Finding order of a polynomial over finite fieldhttps://ask.sagemath.org/question/34604/finding-order-of-a-polynomial-over-finite-field/**order** of a polynomial $f(x)$ in $\mathbb{F}_p [x]$ is defined as minimum $e$ such that $f(x) | x^e -1$ . Do we have an inbuilt function in sage to find the same ?Sat, 27 Aug 2016 08:06:49 +0200https://ask.sagemath.org/question/34604/finding-order-of-a-polynomial-over-finite-field/Answer by nbruin for <p><strong>order</strong> of a polynomial $f(x)$ in $\mathbb{F}_p [x]$ is defined as minimum $e$ such that $f(x) | x^e -1$ . Do we have an inbuilt function in sage to find the same ?</p>
https://ask.sagemath.org/question/34604/finding-order-of-a-polynomial-over-finite-field/?answer=34623#post-id-34623I would expect that you mainly need this for irreducible polynomials. In that case it's the multiplicative order of one of its roots in an appropriate extension:
L = GF(p^f.degree(),name='b')
[a[1].multiplicative_order() for a in f.roots(L)]
(all those numbers should be equal and you only need to compute one of them)
If your polynomial is square-free, you'd have to do this for each of the irreducible factors and take the LCM.
If your polynomial has higher multiplicity factors, you have to take the appropriate powers before taking LCMsSun, 28 Aug 2016 23:10:36 +0200https://ask.sagemath.org/question/34604/finding-order-of-a-polynomial-over-finite-field/?answer=34623#post-id-34623