本文整理汇总了Python中sage.rings.all.PowerSeriesRing.set_default_prec方法的典型用法代码示例。如果您正苦于以下问题:Python PowerSeriesRing.set_default_prec方法的具体用法?Python PowerSeriesRing.set_default_prec怎么用?Python PowerSeriesRing.set_default_prec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.rings.all.PowerSeriesRing
的用法示例。
在下文中一共展示了PowerSeriesRing.set_default_prec方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: local_coordinates_at_nonweierstrass
# 需要导入模块: from sage.rings.all import PowerSeriesRing [as 别名]
# 或者: from sage.rings.all.PowerSeriesRing import set_default_prec [as 别名]
def local_coordinates_at_nonweierstrass(self, P, prec=20, name='t'):
"""
For a non-Weierstrass point `P = (a,b)` on the hyperelliptic
curve `y^2 = f(x)`, return `(x(t), y(t))` such that `(y(t))^2 = f(x(t))`,
where `t = x - a` is the local parameter.
INPUT:
- ``P = (a, b)`` -- a non-Weierstrass point on self
- ``prec`` -- desired precision of the local coordinates
- ``name`` -- gen of the power series ring (default: ``t``)
OUTPUT:
`(x(t),y(t))` such that `y(t)^2 = f(x(t))` and `t = x - a`
is the local parameter at `P`
EXAMPLES::
sage: R.<x> = QQ['x']
sage: H = HyperellipticCurve(x^5-23*x^3+18*x^2+40*x)
sage: P = H(1,6)
sage: x,y = H.local_coordinates_at_nonweierstrass(P,prec=5)
sage: x
1 + t + O(t^5)
sage: y
6 + t - 7/2*t^2 - 1/2*t^3 - 25/48*t^4 + O(t^5)
sage: Q = H(-2,12)
sage: x,y = H.local_coordinates_at_nonweierstrass(Q,prec=5)
sage: x
-2 + t + O(t^5)
sage: y
12 - 19/2*t - 19/32*t^2 + 61/256*t^3 - 5965/24576*t^4 + O(t^5)
AUTHOR:
- Jennifer Balakrishnan (2007-12)
"""
d = P[1]
if d == 0:
raise TypeError("P = %s is a Weierstrass point. Use local_coordinates_at_weierstrass instead!"%P)
pol = self.hyperelliptic_polynomials()[0]
L = PowerSeriesRing(self.base_ring(), name)
t = L.gen()
L.set_default_prec(prec)
K = PowerSeriesRing(L, 'x')
pol = K(pol)
x = K.gen()
b = P[0]
f = pol(t+b)
for i in range((RR(log(prec)/log(2))).ceil()):
d = (d + f/d)/2
return t+b+O(t**(prec)), d + O(t**(prec))