The module ellcurve.constructor defines the following functions:
x, [y=None]) |
There are several ways to construct elliptic curves:
- EllipticCurve([a1,a2,a3,a4,a6]): Elliptic curve with given a-invariants. The invariants are coerced into a the parent of the first element. If all are integers, they are coerced into the rational numbers.
- EllipticCurve([a4,a6]): Same as above, but a1=a2=a3=0.
- EllipticCurve(label): Returns the elliptic curve over Q from the Cremoa database with the given label. The label is a string, such as"11A" or "37B2".
- EllipticCurve(R, [a1,a2,a3,a4,a6]): Create the elliptic curve over R with given a-invariants. Here R can be an arbitrary ring. Note that addition need not be defined.
We illustrate creating elliptic curves.
sage: EllipticCurve([0,0,1,-1,0]) Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field
sage: EllipticCurve([GF(5)(0),0,1,-1,0]) Elliptic Curve defined by y^2 + y = x^3 + 4*x over Finite field of size 5
Alternatively, one can create the curve over the finite field as follows:
sage: EllipticCurve(GF(5), [0, 0,1,-1,0]) Elliptic Curve defined by y^2 + y = x^3 + 4*x over Finite field of size 5
sage: E = EllipticCurve([CC(0),0,1,-1,0]) sage: E Elliptic Curve defined by y^2 + y = x^3 - 1.*x over Complex Field sage: E.j_invariant() 2988.97297297297297297
sage: E = EllipticCurve(ZZ, [0, 0,1,-1,0]) sage: E Elliptic Curve defined by y^2 + y = x^3 - x over Integer Ring
Of course, arithmetic on elliptic curves over Z need not be defined:
sage: P = E([0,0]) sage: P + P + P + P (2, -3) sage: P + P + P + P + P Traceback (most recent call last): ... ArithmeticError: Point (1/4, -5/8) is not on curve.
See About this document... for information on suggesting changes.