Ask Your Question

Default algorithm for cardinality

asked 2019-12-18 20:00:15 +0200

JanoutV gravatar image

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: 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 flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-12-18 23:27:01 +0200

updated 2019-12-18 23:28:31 +0200

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 < self.base_field().degree():
            algorithm = "subfield"
            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??
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-12-18 20:00:15 +0200

Seen: 319 times

Last updated: Dec 18 '19