How can I get Sage to provide an explicit isomorphism from a genus 1 curve to its Weierstrass equation?

I defined the curve to be C = Curve(f, A) where f is a quartic in two variables and A is rational affine space. As C having genus 1 gives an isomorphism from C to Jacobian(C), I then called Jacobian(C) , and Jacobian(C) gives a Weierstrass equation for the curve. I tried reading the Sage documentation for Jacobian, but did not find a way to get an explicit morphism.

I know I need to identify a non-singular point on C to define the group law, and can find such a point algorithmically without much difficulty. Any help is greatly appreciated!

  • 2
    $\begingroup$ Did you try doc.sagemath.org/html/en/reference/arithmetic_curves/sage/… ? $\endgroup$
    – Watson
    Jul 15 '21 at 6:06
  • 1
    $\begingroup$ So the first thing you must check is that you have a nonsingular rational point - otherwise you are in no way guaranteed that the morphism will be defined over $K$. That being said - the morphism will be defined over $K(O)$ where $O$ is a $\bar{K}$-point. I am not familiar with Sage but in Magma one can call ```EllipticCurve(C, O)''' to put a genus $1$ curve with a rational point into Weierstrass form $\endgroup$ Jul 15 '21 at 8:12
  • $\begingroup$ @Watson Thank you for the recommendation! I did try each function from the link you sent, but EllipticCurve_from_curve() doesn't seem to be implemented, EllipticCurve_from_cubic() doesn't seem to work for genus 1 quartics, and going with WeierstrassTransformation() requires explicitly defining the transformation. This does however make my problem only one of writing my equation in a cubic form, so this is certainly helpful! $\endgroup$
    – Luke
    Jul 15 '21 at 9:31
  • $\begingroup$ @Mummytheturkey I will try this with the Magma online calculator right away. Thank you for pointing this out! $\endgroup$
    – Luke
    Jul 15 '21 at 9:33

I am not super familiar with the Sage interface, so the following code may be slightly buggy. In the documentation I could not find and analogy to Magma's EllipticCurve command, so instead I will discuss how in general we perform such a computation and give a slightly hacky solution with my little knowledge of Sage.

Consider a genus $1$ curve $C$ over a field $K$. We know that over $\bar{K}$ that $C$ is birational (indeed isomorphic if and only if $C$ is smooth) to its Jacobian $E := \operatorname{Jac}(C)$, which of course can be put in Weierstrass form. I will therefore assume we have extended $K$ sufficiently so that $C(K)$ is nonempty, and fix a nonsingluar point $O \in C(K)$.

Thus $(C, O)$ is an elliptic curve in the sense of Chapter III of Silverman (if $C$ is singular it is not quite, but the fact that $O$ is nonsingular makes it work anyway). The point now is to emulate the proof of Prop III.3.1 of Silverman, to put $(C, O)$ in Weierstrass form.

That is, let $\{1,x\}$ be a basis for the Riemann-Roch space $H^0(C, \mathcal{O}_C(2O))$ and let $y$ be such that $\{1,x, y\}$ be a basis for the Riemann-Roch space $H^0(C, \mathcal{O}_C(3O))$. The same arguemnt as Prop III.3.1 shows that $x,y$ must satisfy a Weierstrass equation.

So we just have to force Sage to compute the Riemann-Roch basis. Now while writing this I noticed that I can't find a general implimentation for this on Schemes in Sage (one does exist in Magma) and perhaps this is why such a function does not exist? I would not know. In any case, for curves over finite fields such a function does exist. I'll give an example now where I put $C: y^2 = x^4 - 1$ over $\mathbb{F}_5$ into Weierstrass form with the point $O = (1,0)$:

sage: P2.<U,V,W> = ProjectiveSpace(GF(5),2)
sage: C = Curve(W^2*V^2 - U^4 + W^4)
sage: D = C.divisor(C(1,0,1))
sage: C.riemann_roch_basis(2*D)
[1, (U^3 + U^2*W + V^2*W + U*W^2 + W^3)/(U*V^2)]
sage: x = C.riemann_roch_basis(2*D)[1]
sage: C.riemann_roch_basis(3*D)
 (U^4 - U^2*V^2 + U^3*W - 2*U*V^2*W + U^2*W^2 + V^2*W^2 + U*W^3)/(V^3*W),
 (U^3 + U^2*W + U*W^2 + W^3)/(V^2*W)]
sage: y = C.riemann_roch_basis(3*D)[1]
sage: h = Hom(C,P2)
sage: f = h([x,y,1])
sage: f.image()
Closed subscheme of Projective Space of dimension 2 over Finite Field of size 5 defined by:
  U^3 - U^2*W + V^2*W + U*W^2 - W^3
  • 2
    $\begingroup$ The following will work: "R.<u,v> = QQ[]; EllipticCurve(WeierstrassForm(v^2 - (u^4 - 1)))". Alternatively, "R.<u,v> = QQ[]; WeierstrassForm(v^2 - (u^4 - 1), transformation=True)" if you want the equations that transform the Weierstrass curve to your curve. $\endgroup$
    – djao
    Jul 15 '21 at 21:27
  • 2
    $\begingroup$ @djao, ah ok - as I say I know very little Sage... from the documentation it seems that this is only implemented in Sage in specific cases (i.e., the above case is $y^2 = $ binary quartic - that is, a genus $1$ model of degree $2$), one cannot force Sage to put a genus $1$ curve in Weierstrass form (in general - say as a high degree, highly singular, projective curve in $\mathbb{P}^n$)? $\endgroup$ Jul 16 '21 at 10:47
  • $\begingroup$ I actually don't know; I've not tried to do this in Sage with any heinously complicated curves. But it is perhaps useful for me to mention that I've never naturally encountered such curves -- every time, when I actually need to put into Weierstrass form an elliptic curve that I've naturally encountered in my work, the curve has always been nice enough for Sage to be able to handle. $\endgroup$
    – djao
    Jul 19 '21 at 1:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.