本文整理汇总了Python中sage.rings.all.QQ.valuation方法的典型用法代码示例。如果您正苦于以下问题:Python QQ.valuation方法的具体用法?Python QQ.valuation怎么用?Python QQ.valuation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.rings.all.QQ
的用法示例。
在下文中一共展示了QQ.valuation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __call__
# 需要导入模块: from sage.rings.all import QQ [as 别名]
# 或者: from sage.rings.all.QQ import valuation [as 别名]
def __call__(self, Q, P):
"""
Compute and return the :class:`ReductionData` corresponding to
the genus 2 curve `y^2 + Q(x) y = P(x)`.
EXAMPLES::
sage: x = polygen(QQ)
sage: genus2reduction(x^3 - 2*x^2 - 2*x + 1, -5*x^5)
Reduction data about this proper smooth genus 2 curve:
y^2 + (x^3 - 2*x^2 - 2*x + 1)*y = -5*x^5
A Minimal Equation (away from 2):
y^2 = x^6 - 240*x^4 - 2550*x^3 - 11400*x^2 - 24100*x - 19855
Minimal Discriminant (away from 2): 56675000
Conductor (away from 2): 1416875
Local Data:
p=2
(potential) stable reduction: (II), j=1
p=5
(potential) stable reduction: (I)
reduction at p: [V] page 156, (3), f=4
p=2267
(potential) stable reduction: (II), j=432
reduction at p: [I{1-0-0}] page 170, (1), f=1
::
sage: genus2reduction(x^2 + 1, -5*x^5)
Reduction data about this proper smooth genus 2 curve:
y^2 + (x^2 + 1)*y = -5*x^5
A Minimal Equation (away from 2):
y^2 = -20*x^5 + x^4 + 2*x^2 + 1
Minimal Discriminant (away from 2): 48838125
Conductor: 32025
Local Data:
p=3
(potential) stable reduction: (II), j=1
reduction at p: [I{1-0-0}] page 170, (1), f=1
p=5
(potential) stable reduction: (IV)
reduction at p: [I{1-1-2}] page 182, (5), f=2
p=7
(potential) stable reduction: (II), j=4
reduction at p: [I{1-0-0}] page 170, (1), f=1
p=61
(potential) stable reduction: (II), j=57
reduction at p: [I{2-0-0}] page 170, (2), f=1
Verify that we fix :trac:`5573`::
sage: genus2reduction(x^3 + x^2 + x,-2*x^5 + 3*x^4 - x^3 - x^2 - 6*x - 2)
Reduction data about this proper smooth genus 2 curve:
y^2 + (x^3 + x^2 + x)*y = -2*x^5 + 3*x^4 - x^3 - x^2 - 6*x - 2
A Minimal Equation (away from 2):
y^2 = x^6 + 18*x^3 + 36*x^2 - 27
Minimal Discriminant (away from 2): 1520984142
Conductor: 954
Local Data:
p=2
(potential) stable reduction: (II), j=1
reduction at p: [I{1-0-0}] page 170, (1), f=1
p=3
(potential) stable reduction: (I)
reduction at p: [II] page 155, (1), f=2
p=53
(potential) stable reduction: (II), j=12
reduction at p: [I{1-0-0}] page 170, (1), f=1
"""
R = PolynomialRing(QQ, 'x')
P = R(P)
Q = R(Q)
if P.degree() > 6:
raise ValueError("P (=%s) must have degree at most 6"%P)
if Q.degree() >=4:
raise ValueError("Q (=%s) must have degree at most 3"%Q)
res = pari.genus2red([P,Q])
conductor = ZZ(res[0])
minimal_equation = R(res[2])
minimal_disc = QQ(res[2].poldisc()).abs()
if minimal_equation.degree() == 5:
minimal_disc *= minimal_equation[5]**2
# Multiply with suitable power of 2 of the form 2^(2*(d-1) - 12)
b = 2 * (minimal_equation.degree() - 1)
k = QQ((12 - minimal_disc.valuation(2), b)).ceil()
minimal_disc >>= 12 - b*k
minimal_disc = ZZ(minimal_disc)
local_data = {}
for red in res[3]:
p = ZZ(red[0])
t = red[1]
data = "(potential) stable reduction: (%s)" % roman_numeral[int(t[0])]
t = t[1]
if len(t) == 1:
data += ", j=%s" % t[0].lift()
elif len(t) == 2:
#.........这里部分代码省略.........