#10836: primitive root is broken
-----------------------------------+----------------------------------------
Reporter: kcrisman | Owner: was
Type: defect | Status: needs_review
Priority: critical | Milestone: sage-4.7
Component: number theory | Keywords:
Author: Karl-Dieter Crisman | Upstream: Reported upstream.
Developers deny it's a bug.
Reviewer: | Merged:
Work_issues: |
-----------------------------------+----------------------------------------
Changes (by newvalueoldvalue):
* status: new => needs_review
* milestone: => sage-4.7
* author: => Karl-Dieter Crisman
Comment:
Well, I have a provisional patch, but because I am very unfamiliar with
how gp/GP/Pari/PARI interact with Sage, this might be really kludgy. Also,
I have observed the following perplexing behavior in testing (in Sage or
Pari):
{{{
parisize = 8000000, primelimit = 500509
? p = 10^80+129
%1 =
100000000000000000000000000000000000000000000000000000000000000000000000000000129
? znprimroot(p)
^C *** at top-level: znprimroot(p)
*** ^-------------
*** znprimroot: user interrupt after 29,777 ms.
*** Break loop: type <Return> to continue; 'break' to go back to GP
break> break
? p = 10^76+133
%2 =
10000000000000000000000000000000000000000000000000000000000000000000000000133
? znprimroot(p)
%3 = Mod(2,
10000000000000000000000000000000000000000000000000000000000000000000000000133)
}}}
Should this size difference really make such a huge difference? I would
estimate the second computation took about a second. The slowness is all
in Pari, too; in Sage I get the same thing. I would think these were not
such large numbers.
{{{
sage: primitive_root(next_prime(3.32*10^76))
^C
KeyboardInterrupt:
sage: primitive_root(next_prime(3.33*10^76))
2
}}}
This also happens in Sage 4.6.2, so it's nothing unusual. Am I just
getting unlucky with numbers that have really big primitive roots? Maybe;
I just put a problem to that effect on a take-home exam...
On the other hand, when I quit after having done these breaks, I get
{{{
*** Warning: I/O: leaked file descriptor (0):
/var/folders/Yy/YytEJm5VEB0+pBRD7JNLe++++TQ/-Tmp-/MPQS.503.640ad/LPNEW.
*** Warning: I/O: leaked file descriptor (0):
/var/folders/Yy/YytEJm5VEB0+pBRD7JNLe++++TQ/-Tmp-/MPQS.503.640ad/FNEW.
*** Warning: I/O: leaked file descriptor (0):
/var/folders/Yy/YytEJm5VEB0+pBRD7JNLe++++TQ/-Tmp-/MPQS.503.640ac/FNEW.
}}}
type stuff, so maybe I'm not crazy.
Anyway, for the purposes here, the problem is finding a doctest where the
Sage version takes a long time without the Pari one taking a long time. I
tried lots and lots of things.
Any ideas? Anyway, maybe this patch is better than WRONG answers, so here
is a patch to look at.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10836#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
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.