本文整理汇总了Python中sage.all.QQ.extension方法的典型用法代码示例。如果您正苦于以下问题:Python QQ.extension方法的具体用法?Python QQ.extension怎么用?Python QQ.extension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.all.QQ
的用法示例。
在下文中一共展示了QQ.extension方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: to_polredabs
# 需要导入模块: from sage.all import QQ [as 别名]
# 或者: from sage.all.QQ import extension [as 别名]
def to_polredabs(K):
"""
INPUT:
* "K" - a number field
OUTPUT:
* "phi" - an isomorphism K -> L, where L = QQ['x']/f and f a polynomial such that f = polredabs(f)
"""
R = PolynomialRing(QQ,'x')
x = R.gen(0)
if K == QQ:
L = QQ.extension(x,'w')
return QQ.hom(L)
L = K.absolute_field('a')
m1 = L.structure()[1]
f = L.absolute_polynomial()
g = pari(f).polredabs(1)
g,h = g[0].sage(locals={'x':x}),g[1].lift().sage(locals={'x':x})
if debug:
print 'f',f
print 'g',g
print 'h',h
M = QQ.extension(g,'w')
m2 = L.hom([h(M.gen(0))])
return m2*m1
示例2: EllipticCurve_from_hoeij_data
# 需要导入模块: from sage.all import QQ [as 别名]
# 或者: from sage.all.QQ import extension [as 别名]
def EllipticCurve_from_hoeij_data(line):
"""Given a line of the file "http://www.math.fsu.edu/~hoeij/files/X1N/LowDegreePlaces"
that is actually corresponding to an elliptic curve, this function returns the elliptic
curve corresponding to this
"""
Rx=PolynomialRing(QQ,'x')
x = Rx.gen(0)
Rxy = PolynomialRing(Rx,'y')
y = Rxy.gen(0)
N=ZZ(line.split(",")[0].split()[-1])
x_rel=Rx(line.split(',')[-2][2:-4])
assert x_rel.leading_coefficient()==1
y_rel=line.split(',')[-1][1:-5]
K = QQ.extension(x_rel,'x')
x = K.gen(0)
y_rel=Rxy(y_rel).change_ring(K)
y_rel=y_rel/y_rel.leading_coefficient()
if y_rel.degree()==1:
y = - y_rel[0]
else:
#print "needing an extension!!!!"
L = K.extension(y_rel,'y')
y = L.gen(0)
K = L
#B=L.absolute_field('s')
#f1,f2 = B.structure()
#x,y=f2(x),f2(y)
r = (x**2*y-x*y+y-1)/x/(x*y-1)
s = (x*y-y+1)/x/y
b = r*s*(r-1)
c = s*(r-1)
E=EllipticCurve([1-c,-b,-b,0,0])
return N,E,K