# Default algorithm for cardinality

Hello, I am using Sage for operations on elliptic curves and I was curious what is the default algorithm used to compute the cardinality of a curve when: "E.cardinality()" is used? I tried to find it here: http://doc.sagemath.org/html/en/refer... but I only found out there are some algorithms which you can choose as an optional argument. Is it the Schoof's algorithm?

edit retag close merge delete

Sort by » oldest newest most voted The reference manual describes cardinality as

cardinality(algorithm=None, extension_degree=1)


which means that the default value for the argument is None. The code says

    if algorithm is None:
# Check for j in subfield
jpol = self.j_invariant().minimal_polynomial()
if jpol.degree() < self.base_field().degree():
algorithm = "subfield"
else:
algorithm = "pari"


So if you are working over a prime field, for example, the algorithm is "pari": "use the PARI C-library function ellcard", according to the reference manual. This pari function is documented here. (Click on "Elliptic curves" in the menu on the left, then "ellcard" at the top. I don't see how to give a precise link to the page.)

By the way, to see the source code, you can do

sage: E = EllipticCurve(GF(10007), [1,2,3,4,5])
sage: E.cardinality??

more