Two comments, neither about memory management as such:

(1) Why do you need to store all the primes and curves?  Why don't you
loop through primes?

(2) EllipticCurve([0,-1,1,0,0]).aplist(10000) gives you almost what
you want (just replace the i'th entry ap by 1+p-ap where p is the ith
prime):

e=EllipticCurve([0,-1,1,0,0]);
ap=e.aplist(10000);
plist=prime_range(10000);
[1+plist[i]-ap[i] for i in range(prime_pi(10000))]

John Cremona

On 8/10/07, Justin <[EMAIL PROTECTED]> wrote:
>
> Hi again everyone,
>
> I'm playing around with this project exploring Hasse's theorem for
> Elliptic Curves over prime order field and playing with the
> distributions that I get. The bottom line is that I execute alot of
> lines like this:
>
> -----------
> sage: P=prime_range(8000,9000)
> sage: L=[EllipticCurve(GF(i),[0,-1,1,0,0]) for i in P]
> sage: E=[L[i].cardinality() for i in range(len(P))]
> -----------
> What I wanted originally to do was to get the cardinality for these
> curves for all primes from 12 to 10000, but I ran out of memory. So I
> started breaking down the problem into 1000 prime_range chunks.
>
> The interesting thing is that I would start running out of memory on
> these chunks too! I then discovered that after a few runs, using the
> same variables and replacing 5000-6000 with 6000-7000 and opening
> another text document to store the cardinalities in, I would run out
> of memory. Once I was forced to quit SAGE, the memory allocation would
> be ready for another prime run of 1000. However in order to make
> progress, I would have to quit SAGE after each run, to clear up enough
> memory for each stretch of commands.
>
> What seems odd is that memory seems to be occupied with old and
> commands that I issued in the past and "clear" doesn't work, but only
> a "quit"!
>
> Any thoughts?
>
> -Justin
>
> Sample output below:
>
> sage: P=prime_range(8000,9000)
> sage: L=[EllipticCurve(GF(i),[0,-1,1,0,0]) for i in P]
> error: no more memory
> System 4600k:4600k Appl 4180k/419k Malloc 4084k/3k Valloc 512k/416k
> Pages 31/97 Regions 1:1
>
>
> >
>


-- 
John Cremona

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to