本文整理匯總了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))