mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-09 14:48:08 -05:00
show how to calculate intersection_multiplicity of point on elliptic curve: otherwise known as the order of vanishing - ord_P(f)
This commit is contained in:
18
script/research/ec/intersection-multiplicity.sage
Normal file
18
script/research/ec/intersection-multiplicity.sage
Normal file
@@ -0,0 +1,18 @@
|
||||
# Calculate intersection multiplicity of a point in sage
|
||||
q = 47
|
||||
K = GF(q)
|
||||
E = EllipticCurve(K, (0, 5))
|
||||
Q = E(10, 26)
|
||||
|
||||
C = E.defining_polynomial()
|
||||
|
||||
R.<x, y, z> = PolynomialRing(K)
|
||||
f = y - Q[1] * z
|
||||
|
||||
P.<x,y,z> = ProjectiveSpace(K, 2)
|
||||
X = P.subscheme([C(x, y, z)])
|
||||
Y = P.subscheme([f(x, y, z)])
|
||||
|
||||
Q = X([Q[0], Q[1]])
|
||||
print(Q.intersection_multiplicity(Y))
|
||||
|
||||
Reference in New Issue
Block a user