regarding precomputed primes in pari

5 views
Skip to first unread message

Robert Miller

unread,
Jun 28, 2010, 6:54:59 PM6/28/10
to saged...@googlegroups.com
Arijit just asked me how to do this, and I realized that Gagan asked
me last week. So, now everybody will know:


---------- Forwarded message ----------
From: Robert Miller <r...@rlmiller.org>
Date: Tue, Jun 22, 2010 at 10:34 PM
Subject: Re: need help with sage regarding precomputed primes in pari
To: Gagan Sekhon <sek...@math.uconn.edu>


On Tue, Jun 22, 2010 at 10:18 PM, Gagan Sekhon <sek...@math.uconn.edu> wrote:
> So I was trying to get the Galois closure of a Number field and
> encountered the following error
>
>
> sage.libs.pari.gen.PariError: not enough precomputed primes (34)
>
>
> I know there is a way to extend the number of precomputed primes in
> pari, however it is currently escaping me. Can you please remind me
> what that command is?

This is for pure Pari:

http://pari.math.u-bordeaux.fr/archives/pari-users-0503/msg00006.html

In Sage, you should look at the functions pari._primelimit and pari.init_primes:

sage: pari._primelimit?
Type:           builtin_function_or_method
Base Class:     <type 'builtin_function_or_method'>
String Form:    <built-in method _primelimit of
sage.libs.pari.gen.PariInstance object at 0x101b9b140>
Namespace:      Interactive
Definition:     pari._primelimit(self)
Docstring:

      Return the number of primes already computed in this Pari instance.

      EXAMPLES:
         sage: pari._primelimit() 500519
         sage: pari.init_primes(600000)
         sage: pari._primelimit() 600000

Class Docstring:
   <attribute '__doc__' of 'builtin_function_or_method' objects>


sage: pari.init_primes?
Type:           builtin_function_or_method
Base Class:     <type 'builtin_function_or_method'>
String Form:    <built-in method init_primes of
sage.libs.pari.gen.PariInstance object at 0x101b9b140>
Namespace:      Interactive
Definition:     pari.init_primes(self, _M)
Docstring:

      Recompute the primes table including at least all primes up to M
      (but possibly more).

      EXAMPLES:

         sage: pari.init_primes(200000)

Class Docstring:
   <attribute '__doc__' of 'builtin_function_or_method' objects>


I hope this helps!

> Thank you,
> Gagan
>

--
Robert L. Miller
http://www.rlmiller.org/

--
Robert L. Miller
http://www.rlmiller.org/

William Stein

unread,
Jun 28, 2010, 6:56:53 PM6/28/10
to saged...@googlegroups.com
On Mon, Jun 28, 2010 at 3:54 PM, Robert Miller <r...@rlmiller.org> wrote:
> Arijit just asked me how to do this, and I realized that Gagan asked
> me last week. So, now everybody will know:

And the reason that error occurs is often because you're trying to do
number theory without assuming the GRH. To assume GRH (++), do

sage: proof.number_field(False)

This will make some algebraic number fields computations thousands of
times faster.

-- William

--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

Reply all
Reply to author
Forward
0 new messages