> A related comment, though slightly tangential:  for elliptic curves E
> over QQ we can do E.ap(p) to count points on E mod p without going via
> the construction of a Sage finite field, which is important for speed.

Is it really ?


sage: p = next_prime(2^10); K = GF(p)
sage: %timeit -r3 -n100 EllipticCurve(j=QQ.random_element(p,1)).ap(p)
100 loops, best of 3: 15.3 ms per loop
sage: %timeit -r3 -n100
EllipticCurve(j=QQ.random_element(p,1)).change_ring(K).cardinality()
100 loops, best of 3: 16.1 ms per loop

sage: p = next_prime(2^20); K = GF(p)
sage: %timeit -r3 -n100 EllipticCurve(j=QQ.random_element(p,1)).ap(p)
100 loops, best of 3: 17 ms per loop
sage: %timeit -r3 -n100
EllipticCurve(j=QQ.random_element(p,1)).change_ring(K).cardinality()
100 loops, best of 3: 16.3 ms per loop

sage: p = next_prime(2^30); K = GF(p)
sage: %timeit -r3 -n100 EllipticCurve(j=QQ.random_element(p,1)).ap(p)
100 loops, best of 3: 19.7 ms per loop
sage: %timeit -r3 -n100
EllipticCurve(j=QQ.random_element(p,1)).change_ring(K).cardinality()
100 loops, best of 3: 21.9 ms per loop.

sage: p = next_prime(2^40); K = GF(p)
sage: %timeit -r3 -n100 EllipticCurve(j=QQ.random_element(p,1)).ap(p)
100 loops, best of 3: 43.1 ms per loop
sage: %timeit -r3 -n100
EllipticCurve(j=QQ.random_element(p,1)).change_ring(K).cardinality()
100 loops, best of 3: 48.5 ms per loop

sage: p = next_prime(2^50); K = GF(p)
sage: %timeit -r3 -n10 EllipticCurve(j=QQ.random_element(p,1)).ap(p)
10 loops, best of 3: 115 ms per loop
sage: %timeit -r3 -n10
EllipticCurve(j=QQ.random_element(p,1)).change_ring(K).cardinality()
10 loops, best of 3: 110 ms per loop

sage: p = next_prime(2^60); K = GF(p)
sage: %timeit -r3 -n10 EllipticCurve(j=QQ.random_element(p,1)).ap(p)
10 loops, best of 3: 235 ms per loop
sage: %timeit -r3 -n10
EllipticCurve(j=QQ.random_element(p,1)).change_ring(K).cardinality()
10 loops, best of 3: 224 ms per loop


In any case, it seems to me that the supposed speed gain is drown in the noise.

Luca

-- 
You received this message because you are subscribed to the Google Groups 
"sage-nt" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
Visit this group at http://groups.google.com/group/sage-nt.
For more options, visit https://groups.google.com/d/optout.

Reply via email to