Ask Your Question

I have an elliptic curve say y^2=x^3 8. I pick a point P=(1,3) and an arbitrary point Q=(x,y). I want to add the two points on Sage to leave my results in x and y. How do I do that

asked 2023-11-06 17:25:25 +0100

Poncho gravatar image

I want a general formula for addition of two points on an elliptic curve that can be generated by sage.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2023-11-20 20:48:19 +0100

dan_fulea gravatar image

We construct the function field $F$ of the quotient ring of $\Bbb Z[x,y]$ (well, $\Bbb Q$ also works, but will write fractions not as i like them) w.r.t. the ideal generated by $-y^2+x^3+8$. We arrange that in $F$ the two elements have these names. Then consider the elliptic curve with $a_4=0$, $a_6=8$, either directly over $F$, or use a base change from $Q$ to $F$. There are two points, $(1,3)$ and $(x,y)$, and we can add them (generically, something has to be arranged in case of the specialization $x=1$ in practice).

R.<X,Y> = PolynomialRing(QQ)
S.<x,y> = R.quotient(-Y^2 + X^3 + 8)
F = FractionField(S)
E = EllipticCurve(F, [0, 8])
P1, P2 = E.point((1, 3)), E.point((x, y))

print(f"P1 + P2 has the components:\n{(P1 + P2).xy()}")

And we get:

P1 + P2 has the components:
((x^2 + x - 6*y + 16)/(x^2 - 2*x + 1), (-9*x^2 + 3*x*y - 3*y^2 + 33*y - 72)/(3*x^2 - y^2 - 3*x + 9))
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: 2023-11-06 17:25:25 +0100

Seen: 159 times

Last updated: Nov 20