1 | initial version |
Radical expressions are nice to look at when they exist, but not so important.
In general, it is better to work with algebraic numbers.
Looking at the factors of E3 is also not so interesting, you should look at all roots.
I would suggest something along the lines of this:
E = EllipticCurve([0, 0, 0, -3267, 45630])
E3 = E.division_polynomial(3)
S.<x> = QQbar[]
p = S(E3)
roots = p.roots(multiplicities=False)
q = x^3 - 3267*x + 45630
Q = E(QQbar)(51,108)
for (x, y) in [(r, sqrt(q(r))) for r in roots]:
P = E(QQbar)(x,y)
R = P + Q
print("P = {}".format(P))
print("P + Q = {}\n".format(R))
which gives the following result
P = (-94.19483056089681? : 694.5464483276473?*I : 1)
P + Q = (20.86577892629443? - 7.11627524481309?*I : -51.544273987571? - 138.855208656804?*I : 1)
P = (67.96049831231529? : 370.7929379838096? : 1)
P + Q = (121.11628555967136? : -1194.410572580779? : 1)
P = (13.11716612429076? - 19.58845998947787?*I : 161.4836552080483? + 190.1138813616981?*I : 1)
P + Q = (-65.5718663720001? + 40.98365708169645?*I : -615.217201111534? - 264.8790840730025?*I : 1)
P = (13.11716612429076? + 19.58845998947787?*I : 161.4836552080483? - 190.1138813616981?*I : 1)
P + Q = (-65.5718663720001? - 40.98365708169645?*I : -615.217201111534? + 264.8790840730025?*I : 1)
If you care a lot about radical expressions, you can try to get them:
for (x, y) in [(r, sqrt(q(r))) for r in roots]:
P = E(QQbar)(x,y)
R = P + Q
print("P = {}".format(P))
xp, yp = P[:2]
print("xp = {}".format(xp.radical_expression()))
print("yp = {}".format(yp.radical_expression()))
print("P + Q = {}".format(R))
xr, yr = R[:2]
print("xr = {}".format(xr.radical_expression()))
print("yr = {}\n".format(yr.radical_expression()))
although apparently this gives radical expressions for the coordinates of P
but not of P + Q
.
P = (-94.19483056089681? : 694.5464483276473?*I : 1)
xp = -3*sqrt(12*612^(1/3)*(-1)^(1/3) + 121) - 1/2*sqrt(-432*612^(1/3)*(-1)^(1/3) + 60840/sqrt(12*612^(1/3)*(-1)^(1/3) + 121) + 8712)
yp = sqrt(-108*sqrt(78408*1734^(1/3)*(-1)^(1/3) + 1507177) - 1/2*sqrt(-3658203648*1734^(1/3)*(-1)^(1/3) + 150108334945920/sqrt(78408*1734^(1/3)*(-1)^(1/3) + 1507177) + 140637700224) - 91260)
P + Q = (20.86577892629443? - 7.11627524481309?*I : -51.544273987571? - 138.855208656804?*I : 1)
xr = 20.86577892629443? - 7.11627524481309?*I
yr = -51.544273987571? - 138.855208656804?*I
P = (67.96049831231529? : 370.7929379838096? : 1)
xp = 3*sqrt(12*612^(1/3)*(-1)^(1/3) + 121) + 1/2*sqrt(-432*612^(1/3)*(-1)^(1/3) - 60840/sqrt(12*612^(1/3)*(-1)^(1/3) + 121) + 8712)
yp = sqrt(108*sqrt(78408*1734^(1/3)*(-1)^(1/3) + 1507177) + 1/2*sqrt(-3658203648*1734^(1/3)*(-1)^(1/3) - 150108334945920/sqrt(78408*1734^(1/3)*(-1)^(1/3) + 1507177) + 140637700224) - 91260)
P + Q = (121.11628555967136? : -1194.410572580779? : 1)
xr = 121.11628555967136?
yr = -1194.410572580779?
P = (13.11716612429076? - 19.58845998947787?*I : 161.4836552080483? + 190.1138813616981?*I : 1)
xp = -3*sqrt(12*612^(1/3)*(-1)^(1/3) + 121) + 1/2*sqrt(-432*612^(1/3)*(-1)^(1/3) + 60840/sqrt(12*612^(1/3)*(-1)^(1/3) + 121) + 8712)
yp = sqrt(108*sqrt(78408*1734^(1/3)*(-1)^(1/3) + 1507177) - 1/2*sqrt(-3658203648*1734^(1/3)*(-1)^(1/3) - 150108334945920/sqrt(78408*1734^(1/3)*(-1)^(1/3) + 1507177) + 140637700224) - 91260)
P + Q = (-65.5718663720001? + 40.98365708169645?*I : -615.217201111534? - 264.8790840730025?*I : 1)
xr = -65.5718663720001? + 40.98365708169645?*I
yr = -615.217201111534? - 264.8790840730025?*I
P = (13.11716612429076? + 19.58845998947787?*I : 161.4836552080483? - 190.1138813616981?*I : 1)
xp = 3*sqrt(12*612^(1/3)*(-1)^(1/3) + 121) - 1/2*sqrt(-432*612^(1/3)*(-1)^(1/3) - 60840/sqrt(12*612^(1/3)*(-1)^(1/3) + 121) + 8712)
yp = sqrt(-108*sqrt(78408*1734^(1/3)*(-1)^(1/3) + 1507177) + 1/2*sqrt(-3658203648*1734^(1/3)*(-1)^(1/3) + 150108334945920/sqrt(78408*1734^(1/3)*(-1)^(1/3) + 1507177) + 140637700224) - 91260)
P + Q = (-65.5718663720001? - 40.98365708169645?*I : -615.217201111534? + 264.8790840730025?*I : 1)
xr = -65.5718663720001? - 40.98365708169645?*I
yr = -615.217201111534? + 264.8790840730025?*I
Note that support for radical expressions is incomplete in Sage, see Sage trac ticket 17516: Radical expressions for roots of polynomials using Galois theory.