本文整理汇总了Python中constructor.EllipticCurve.rst_transform方法的典型用法代码示例。如果您正苦于以下问题:Python EllipticCurve.rst_transform方法的具体用法?Python EllipticCurve.rst_transform怎么用?Python EllipticCurve.rst_transform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类constructor.EllipticCurve
的用法示例。
在下文中一共展示了EllipticCurve.rst_transform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _tate
# 需要导入模块: from constructor import EllipticCurve [as 别名]
# 或者: from constructor.EllipticCurve import rst_transform [as 别名]
#.........这里部分代码省略.........
if val_disc == 0:
## Good reduction already
cp = 1
fp = 0
KS = KodairaSymbol("I0")
break #return
# Otherwise, we change coordinates so that p | a3, a4, a6
if p == 2:
if pdiv(b2):
r = proot(a4, 2)
t = proot(((r + a2)*r + a4)*r + a6, 2)
else:
temp = pinv(a1)
r = temp * a3
t = temp * (a4 + r*r)
elif p == 3:
if pdiv(b2):
r = proot(-b6, 3)
else:
r = -pinv(b2) * b4
t = a1 * r + a3
else:
if pdiv(c4):
r = -pinv(12) * b2
else:
r = -pinv(12*c4) * (c6 + b2 * c4)
t = -halfmodp * (a1 * r + a3)
r = preduce(r)
t = preduce(t)
verbose("Before first transform C = %s"%C)
verbose("[a1,a2,a3,a4,a6] = %s"%([a1, a2, a3, a4, a6]))
C = C.rst_transform(r, 0, t)
(a1, a2, a3, a4, a6) = C.a_invariants()
(b2, b4, b6, b8) = C.b_invariants()
if min([pval(a) for a in (a1, a2, a3, a4, a6) if a != 0]) < 0:
raise RuntimeError("Non-integral model after first transform!")
verbose("After first transform %s\n, [a1,a2,a3,a4,a6] = %s\n, valuations = %s"%([r, 0, t], [a1, a2, a3, a4, a6], [pval(a1), pval(a2), pval(a3), pval(a4), pval(a6)]), t, 2)
if pval(a3) == 0:
raise RuntimeError("p does not divide a3 after first transform!")
if pval(a4) == 0:
raise RuntimeError("p does not divide a4 after first transform!")
if pval(a6) == 0:
raise RuntimeError("p does not divide a6 after first transform!")
# Now we test for Types In, II, III, IV
# NB the c invariants never change.
if not pdiv(c4):
# Multiplicative reduction: Type In (n = val_disc)
split = False
if _pquadroots(1, a1, -a2):
cp = val_disc
split = True
elif Integer(2).divides(val_disc):
cp = 2
else:
cp = 1
KS = KodairaSymbol("I%s"%val_disc)
fp = 1
break #return
# Additive reduction
if pval(a6) < 2: