#5535: [with patch, needs review] is_primitive is computes integer prime
factorization on every call
-------------------------+--------------------------------------------------
Reporter: rhinton | Owner: tbd
Type: enhancement | Status: new
Priority: major | Milestone:
Component: algebra | Keywords:
-------------------------+--------------------------------------------------
Comment(by cremona):
This looks ok to me, though I think you could delete the second paragraph
of the docstring (it's a bit too detailed).
For the code itself one could also use the (generic) order_from_multiple()
function like this:
{{{
return order_from_multiple(y,n,n_prime_divs,operation='*')==n
}}}
since the order_from_multiple() function (which I wrote) already takes the
list of prime divisors of n as a parameter, computing it if it is not
given. I just tried that on a poly of degree 257 over GF(2) and it worked
fine (I was impressed at Sage's ability to factor the 78-digit number
{{{2^257-1}}}!). It does do a little more work though as it finds the
exact order.
There seems to be quite a large literature on finding primitive
polynomials which may include better tests of primitivity. I'll take a
look at some of those when I'm back at work.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5535#comment:6>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---