本文整理汇总了Python中sage.rings.power_series_ring.PowerSeriesRing类的典型用法代码示例。如果您正苦于以下问题:Python PowerSeriesRing类的具体用法?Python PowerSeriesRing怎么用?Python PowerSeriesRing使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PowerSeriesRing类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: series
def series(self, n, prec):
r"""
Returns the `n`-th approximation to the `p`-adic `L`-series
associated to self, as a power series in `T` (corresponding to
`\gamma-1` with `\gamma= 1 + p` as a generator of `1+p\ZZ_p`).
EXAMPLES::
sage: from sage.modular.pollack_stevens.space import ps_modsym_from_elliptic_curve
sage: E = EllipticCurve('57a')
sage: p = 5
sage: prec = 4
sage: phi = ps_modsym_from_elliptic_curve(E)
sage: phi_stabilized = phi.p_stabilize(p,M = prec+3)
sage: Phi = phi_stabilized.lift(p,prec,None,algorithm='stevens',eigensymbol=True)
sage: L = pAdicLseries(Phi)
sage: L.series(3,4)
O(5^3) + (3*5 + 5^2 + O(5^3))*T + (5 + O(5^2))*T^2
sage: L1 = E.padic_lseries(5)
sage: L1.series(4)
O(5^6) + (3*5 + 5^2 + O(5^3))*T + (5 + 4*5^2 + O(5^3))*T^2 + (4*5^2 + O(5^3))*T^3 + (2*5 + 4*5^2 + O(5^3))*T^4 + O(T^5)
"""
p = self.prime()
M = self.symb().precision_absolute()
K = pAdicField(p, M)
R = PowerSeriesRing(K, names = 'T')
T = R.gens()[0]
R.set_default_prec(prec)
return sum(self[i] * T**i for i in range(n))
示例2: test_tensprod_121_chi
def test_tensprod_121_chi():
C121=[1,2,-1,2,1,-2,2,0,-2,2,0,-2,-4,4,-1,-4,2,-4,0,2,-2,0,\
-1,0,-4,-8,5,4,0,-2,7,-8,0,4,2,-4,3,0,4,0,8,-4,6,0,-2,-2,\
8,4,-3,-8,-2,-8,-6,10,0,0,0,0,5,-2,-12,14,-4,-8,-4,0,-7,4,\
1,4,-3,0,-4,6,4,0,0,8,10,-4,1,16,6,-4,2,12,0,0,15,-4,-8,\
-2,-7,16,0,8,-7,-6,0,-8,-2,-4,-16,0,-2,-12,-18,10,-10,0,-3,\
-8,9,0,-1,0,8,10,4,0,0,-24,-8,14,-9,-8,-8,0,-6,-8,18,0,0,\
-14,5,0,-7,2,-10,4,-8,-6,0,8,0,-8,3,6,10,8,-2,0,-4,0,7,8,\
-7,20,6,-8,-2,2,4,16,0,12,12,0,3,4,0,12,6,0,-8,0,-5,30,\
-15,-4,7,-16,12,0,3,-14,0,16,10,0,17,8,-4,-14,4,-6,2,0,0,0]
chi=[1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,\
1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,\
-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,\
1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,\
1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,\
1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,\
-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,\
-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1,1,1,1,-1,-1,\
-1,1,-1,0,1,-1,1,1,1,-1,-1,-1,1,-1,0,1,-1]
ANS=[1,-2,-1,2,1,2,-2,0,-2,-2,1,-2,4,4,-1,-4,-2,4,0,2,2,-2,\
-1,0,-4,-8,5,-4,0,2,7,8,-1,4,-2,-4,3,0,-4,0,-8,-4,-6,2,-2,\
2,8,4,-3,8,2,8,-6,-10,1,0,0,0,5,-2,12,-14,4,-8,4,2,-7,-4,\
1,4,-3,0,4,-6,4,0,-2,8,-10,-4,1,16,-6,4,-2,12,0,0,15,4,-8,\
-2,-7,-16,0,-8,-7,6,-2,-8,2,-4,-16,0,2,12,18,10,10,-2,-3,8,\
9,0,-1,0,-8,-10,4,0,1,-24,8,14,-9,-8,8,0,6,-8,-18,-2,0,14,\
5,0,-7,-2,10,-4,-8,6,4,8,0,-8,3,6,-10,-8,2,0,4,4,7,-8,-7,\
20,6,8,2,-2,4,-16,-1,12,-12,0,3,4,0,-12,-6,0,8,-4,-5,-30,\
-15,-4,7,16,-12,0,3,14,-2,16,-10,0,17,8,4,14,-4,-6,-2,4,0,0]
R = PowerSeriesRing(ZZ, "T")
T = R.gens()[0]
assert ANS==tensor_get_an_deg1(C121,chi,[[11,1-T]])
assert ANS==tensor_get_an(C121,chi,2,1,[[11,1-T,1-T]])
assert get_euler_factor(ANS,2)==(1+2*T+2*T**2+O(T**8))
assert get_euler_factor(ANS,3)==(1+T+3*T**2+O(T**5))
assert get_euler_factor(ANS,5)==(1-T+5*T**2+O(T**4))
示例3: hecke_polynomial_in_T_variable
def hecke_polynomial_in_T_variable(self, q, var='x', basis=None, verbose=True):
r"""
The function hecke_polynomial returns a polynomial whose coefficients
are power series in the variable `w`, which represents an element in the
disc of radius `1/p`. This function instead uses the more standard
variable `T`, which represents an element in the disc of radius `1`.
EXAMPLES::
sage: MM = FamiliesOfOMS(11, 0, sign=-1, p=3, prec_cap=[4, 4], base_coeffs=ZpCA(3, 8))
sage: HP = MM.hecke_polynomial_in_T_variable(3, verbose=False); HP
(1 + O(3^8))*x^2 + (2 + 2*3 + 3^2 + O(3^4) + (2 + 2*3 + O(3^3))*T + O(3^2)*T^2 + (1 + O(3))*T^3 + O(T^4))*x + 1 + 2*3 + 3^2 + O(3^4) + O(3^3)*T + (2 + 3 + O(3^2))*T^2 + (1 + O(3))*T^3 + O(T^4)
"""
HPw = self.hecke_polynomial(q, var, basis, verbose)
from sage.rings.power_series_ring import PowerSeriesRing
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
v_prec = self.precision_cap()[1]
RT = PowerSeriesRing(self.base_ring().base_ring(), 'T', default_prec=v_prec)
R = PolynomialRing(RT, var)
poly_coeffs = []
for c in HPw.padded_list():
prec = c.prec()
cL = c.padded_list()
length = len(cL)
cL = [cL[i] >> i for i in range(length)]
j = 0
while j < length:
if cL[j].precision_absolute() <= 0:
break
j += 1
poly_coeffs.append(RT(cL, j))
poly_coeffs[-1] = RT.one()
return R(poly_coeffs)
示例4: __dimension_Sp6Z
def __dimension_Sp6Z(wt):
"""
Return the dimensions of subspaces of Siegel modular forms on $Sp(6,Z)$.
OUTPUT
("Total", "Miyawaki-Type-1", "Miyawaki-Type-2 (conjectured)", "Interesting")
Remember, Miywaki type 2 is ONLY CONJECTURED!!
"""
if not is_even(wt):
return (0, 0, 0, 0)
R = PowerSeriesRing(IntegerRing(), default_prec=wt + 1, names=('x',))
(x,) = R._first_ngens(1)
S = PowerSeriesRing(IntegerRing(), default_prec=max(2 * wt - 1,1), names=('y',))
(y,) = S._first_ngens(1)
H_all = 1 / ((1 - x ** 4) * (1 - x ** 12) ** 2 * (1 - x ** 14) * (1 - x ** 18) *
(1 - x ** 20) * (1 - x ** 30)) * (
1 + x ** 6 + x ** 10 + x ** 12 + 3 * x ** 16 + 2 * x ** 18 + 2 * x ** 20 +
5 * x ** 22 + 4 * x ** 24 + 5 * x ** 26 + 7 * x ** 28 + 6 * x ** 30 + 9 * x ** 32 +
10 * x ** 34 + 10 * x ** 36 + 12 * x ** 38 + 14 * x ** 40 + 15 * x ** 42 + 16 * x ** 44 +
18 * x ** 46 + 18 * x ** 48 + 19 * x ** 50 + 21 * x ** 52 + 19 * x ** 54 + 21 * x ** 56 +
21 * x ** 58 + 19 * x ** 60 + 21 * x ** 62 + 19 * x ** 64 + 18 * x ** 66 + 18 * x ** 68 +
16 * x ** 70 + 15 * x ** 72 + 14 * x ** 74 + 12 * x ** 76 + 10 * x ** 78 + 10 * x ** 80 +
9 * x ** 82 + 6 * x ** 84 + 7 * x ** 86 + 5 * x ** 88 + 4 * x ** 90 + 5 * x ** 92 +
2 * x ** 94 + 2 * x ** 96 + 3 * x ** 98 + x ** 102 + x ** 104 + x ** 108 + x ** 114)
H_noncusp = 1 / (1 - x ** 4) / (1 - x ** 6) / (1 - x ** 10) / (1 - x ** 12)
H_E = y ** 12 / (1 - y ** 4) / (1 - y ** 6)
H_Miyawaki1 = H_E[wt] * H_E[2 * wt - 4]
H_Miyawaki2 = H_E[wt - 2] * H_E[2 * wt - 2]
a, b, c, d = H_all[wt], H_noncusp[wt], H_Miyawaki1, H_Miyawaki2
return (a, c, d, a - b - c - d)
示例5: _dimension_Gamma0_4_half
def _dimension_Gamma0_4_half(k):
"""
Return the dimensions of subspaces of Siegel modular forms$Gamma0(4)$
of half integral weight k - 1/2.
INPUT
The realweight is k-1/2
OUTPUT
('Total', 'Non cusp', 'Cusp')
REMARK
Note that formula from Hayashida's and Ibukiyama's paper has formula
that coefficient of x^w is for weight (w+1/2). So here w=k-1.
"""
R = PowerSeriesRing(IntegerRing(), default_prec=k, names=("x",))
(x,) = R._first_ngens(1)
H_all = 1 / (1 - x) / (1 - x ** 2) ** 2 / (1 - x ** 3)
H_cusp = (
(2 * x ** 5 + x ** 7 + x ** 9 - 2 * x ** 11 + 4 * x ** 6 - x ** 8 + x ** 10 - 3 * x ** 12 + x ** 14)
/ (1 - x ** 2) ** 2
/ (1 - x ** 6)
)
a, c = H_all[k - 1], H_cusp[k - 1]
return (a, a - c, c)
示例6: _test__jacobi_predicted_taylor_coefficients
def _test__jacobi_predicted_taylor_coefficients(fs, q_precision) :
r"""
Given a list of power series, which are the corrected Taylor coefficients
of a Jacobi form, return the renormalized uncorrected ones, assuming that
all but one `f` vanish.
INPUT:
- ``fs`` -- A list of power series.
- ``q_precision`` -- An integer.
OUPUT:
- A list of power series.
TESTS:
See jacobi_form_by_taylor_expansion.
"""
from sage.rings.arith import gcd
R = PowerSeriesRing(ZZ, 'q'); q = R.gen(0)
diff = lambda f: f.derivative().shift(1)
normalize = lambda f: f / gcd(f.list()) if f != 0 else f
diffnorm = lambda f,l: normalize(reduce(lambda a, g: g(a), l*[diff], f))
taylor_coefficients = list()
allf = R(0)
for f in fs :
allf = f(q_precision) + diffnorm(allf, 1)
taylor_coefficients.append(allf)
return taylor_coefficients
示例7: series
def series(self, prec=5):
r"""
Return the ``prec``-th approximation to the `p`-adic `L`-series
associated to self, as a power series in `T` (corresponding to
`\gamma-1` with `\gamma` the chosen generator of `1+p\ZZ_p`).
INPUT:
- ``prec`` -- (default 5) is the precision of the power series
EXAMPLES::
sage: E = EllipticCurve('14a2')
sage: p = 3
sage: prec = 6
sage: L = E.padic_lseries(p,implementation="pollackstevens",precision=prec) # long time
sage: L.series(4) # long time
2*3 + 3^4 + 3^5 + O(3^6) + (2*3 + 3^2 + O(3^4))*T + (2*3 + O(3^2))*T^2 + (3 + O(3^2))*T^3 + O(T^4)
sage: E = EllipticCurve("15a3")
sage: L = E.padic_lseries(5,implementation="pollackstevens",precision=15) # long time
sage: L.series(3) # long time
O(5^15) + (2 + 4*5^2 + 3*5^3 + 5^5 + 2*5^6 + 3*5^7 + 3*5^8 + 2*5^9 + 2*5^10 + 3*5^11 + 5^12 + O(5^13))*T + (4*5 + 4*5^3 + 3*5^4 + 4*5^5 + 3*5^6 + 2*5^7 + 5^8 + 4*5^9 + 3*5^10 + O(5^11))*T^2 + O(T^3)
sage: E = EllipticCurve("79a1")
sage: L = E.padic_lseries(2,implementation="pollackstevens",precision=10) # not tested
sage: L.series(4) # not tested
O(2^9) + (2^3 + O(2^4))*T + O(2^0)*T^2 + (O(2^-3))*T^3 + O(T^4)
"""
p = self.prime()
M = self.symbol().precision_relative()
K = pAdicField(p, M)
R = PowerSeriesRing(K, names="T")
T = R.gens()[0]
return R([self[i] for i in range(prec)]).add_bigoh(prec)
示例8: _dimension_Sp4Z
def _dimension_Sp4Z( wt_range):
"""
Return the dimensions of subspaces of Siegel modular forms on $Sp(4,Z)$.
OUTPUT
("Total", "Eisenstein", "Klingen", "Maass", "Interesting")
"""
headers = ['Total', 'Eisenstein', 'Klingen', 'Maass', 'Interesting']
R = PowerSeriesRing( IntegerRing(), default_prec = wt_range[-1] + 1, names = ('x',))
(x,) = R._first_ngens(1)
H_all = 1 / (1 - x ** 4) / (1 - x ** 6) / (1 - x ** 10) / (1 - x ** 12)
H_Kl = x ** 12 / (1 - x ** 4) / (1 - x ** 6)
H_MS = (x ** 10 + x ** 12) / (1 - x ** 4) / (1 - x ** 6)
dct = dict( (k,
{ 'Total': H_all[k],
'Eisenstein': 1 if k >= 4 else 0,
'Klingen': H_Kl[k],
'Maass': H_MS[k],
'Interesting': H_all[k]-(1 if k >= 4 else 0)-H_Kl[k]-H_MS[k]
}
if is_even(k) else
{ 'Total': H_all[k-35],
'Eisenstein': 0,
'Klingen': 0,
'Maass': 0,
'Interesting': H_all[k-35]
}
) for k in wt_range)
return headers, dct
示例9: test_tensprod_11a_17a
def test_tensprod_11a_17a():
C11=[1,-2,-1,2,1,2,-2,0,-2,-2,1,-2,4,4,-1,-4,-2,4,0,2,2,-2,\
-1,0,-4,-8,5,-4,0,2,7,8,-1,4,-2,-4,3,0,-4,0,-8,-4,-6,2,-2,\
2,8,4,-3,8,2,8,-6,-10,1,0,0,0,5,-2,12,-14,4,-8,4,2,-7,-4,\
1,4,-3,0,4,-6,4,0,-2,8,-10,-4,1,16,-6,4,-2,12,0,0,15,4,-8,\
-2,-7,-16,0,-8,-7,6,-2,-8,2,-4,-16,0,2,12,18,10,10,-2,-3,8,\
9,0,-1,0,-8,-10,4,0,1,-24,8,14,-9,-8,8,0,6,-8,-18,-2,0,14,\
5,0,-7,-2,10,-4,-8,6,4,8,0,-8,3,6,-10,-8,2,0,4,4,7,-8,-7,\
20,6,8,2,-2,4,-16,-1,12,-12,0,3,4,0,-12,-6,0,8,-4,-5,-30,\
-15,-4,7,16,-12,0,3,14,-2,16,-10,0,17,8,4,14,-4,-6,-2,4,0,0]
C17=[1,-1,0,-1,-2,0,4,3,-3,2,0,0,-2,-4,0,-1,1,3,-4,2,0,0,4,\
0,-1,2,0,-4,6,0,4,-5,0,-1,-8,3,-2,4,0,-6,-6,0,4,0,6,-4,0,\
0,9,1,0,2,6,0,0,12,0,-6,-12,0,-10,-4,-12,7,4,0,4,-1,0,8,\
-4,-9,-6,2,0,4,0,0,12,2,9,6,-4,0,-2,-4,0,0,10,-6,-8,-4,0,\
0,8,0,2,-9,0,1,-10,0,8,-6,0,-6,8,0,6,0,0,-4,-14,0,-8,-6,\
6,12,4,0,-11,10,0,-4,12,12,8,3,0,-4,16,0,-16,-4,0,3,-6,0,\
-8,8,0,4,0,3,-12,6,0,2,-10,0,-16,-12,-3,0,-8,0,-2,-12,0,10,\
16,-9,24,6,0,4,-4,0,-9,2,12,-4,22,0,-4,0,0,-10,12,-6,-2,8,\
0,12,4,0,0,0,0,-8,-16,0,2,-2,0,-9,-18,0,-20,-3]
ANS=[1,2,0,2,-2,0,-8,8,15,-4,0,0,-8,-16,0,12,-2,30,0,-4,0,0,\
-4,0,29,-16,0,-16,0,0,28,-8,0,-4,16,30,-6,0,0,-16,48,0,-24,\
0,-30,-8,0,0,22,58,0,-16,-36,0,0,-64,0,0,-60,0,-120,56,-120,\
-8,16,0,-28,-4,0,32,12,120,-24,-12,0,0,0,0,-120,-24,144,96,\
24,0,4,-48,0,0,150,-60,64,-8,0,0,0,0,-14,44,0,58,-20,0,-128,\
-64,0,-72,144,0,60,0,0,-96,-126,0,8,0,-120,-120,16,0,-11,-240,\
0,56,-158,-240,64,-32,0,32,-288,0,0,-56,0,-16,42,0,-80,32,0,\
24,0,180,0,-48,0,-12,100,0,-32,0,-30,0,-56,0,14,-240,0,16,32,\
288,96,96,0,48,48,0,142,8,0,-48,-132,0,-232,0,0,300,-180,-60,\
-14,128,0,-32,12,0,0,0,0,0,-272,0,8,-28,0,44,36,0,0,232]
R = PowerSeriesRing(ZZ, "T")
T = R.gens()[0]
B11=[11,1-T,1+11*T**2]
B17=[17,1+2*T+17*T**2,1-T]
assert ANS==tensor_get_an_no_deg1(C11,C17,2,2,[B11,B17])
示例10: _all_weak_taylor_coefficients
def _all_weak_taylor_coefficients(weight, index) :
r"""
A product basis of the echelon bases of
- `M_k, M_{k + 2}, ..., M_{k + 2 m}` etc. if ``weight`` is even,
- `M_{k + 1}, ..., M_{k + 2 m - 3}` if ``weight`` is odd.
INPUT:
- ``weight`` -- An integer.
- ``index`` -- A non-negative integer.
TESTS::
sage: from psage.modform.jacobiforms.jacobiformd1nn_fegenerators import _all_weak_taylor_coefficients
sage: _all_weak_taylor_coefficients(12, 1)
[[<bound method ModularFormElement.qexp of 1 + 196560*q^2 + 16773120*q^3 + 398034000*q^4 + 4629381120*q^5 + O(q^6)>, <function <lambda> at ...>], [<bound method ModularFormElement.qexp of q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 + O(q^6)>, <function <lambda> at ...>], [<function <lambda> at ...>, <bound method ModularFormElement.qexp of 1 - 24*q - 196632*q^2 - 38263776*q^3 - 1610809368*q^4 - 29296875024*q^5 + O(q^6)>]]
"""
R = PowerSeriesRing(ZZ, 'q'); q = R.gen()
if weight % 2 == 0 :
nmb_modular_forms = index + 1
start_weight = weight
else :
nmb_modular_forms = index - 1
start_weight = weight + 1
modular_forms = list()
for (i,k) in enumerate(range(start_weight, start_weight + 2 * nmb_modular_forms, 2)) :
modular_forms += [ [lambda p: big_oh.O(q**p) for _ in range(i)] + [b.qexp] + [lambda p: big_oh.O(q**p) for _ in range(nmb_modular_forms - 1 - i)]
for b in ModularForms(1, k).echelon_basis() ]
return modular_forms
示例11: form_acting_matrix_on_dist
def form_acting_matrix_on_dist(p,M,k,a,b,c,d):
"""forms a large M x M matrix say G such that if v is the vector of moments of a distribution mu, then v*G is the vector of moments of mu|[a,b;c,d]"""
# print("Checking...")
# print(a,b,c,d)
# print(p)
assert (a%p != 0) and (c%p == 0), "acting by bad matrix"
R=PowerSeriesRing(QQ,'y',default_prec=M)
y=R.gen()
scale=(b+d*y)/(a+c*y)
t=((a+c*y)**k).truncate(M)
A = []
for i in range(0,M):
temp1=t.list();
d=len(temp1)
for j in range(d,M):
temp1 = temp1 + [0]
#while len(temp1)>M:
# temp1.pop()
A = A + [temp1]
t=(t*scale).truncate(M)
q=p**M
B=Matrix(QQ,A).transpose()
for r in range(0,M):
for c in range(0,M):
#B[r,c]=B[r,c]%(p**(M-c))
B[r,c]=B[r,c]%(q)
return B
示例12: _repr_
def _repr_(self):
r"""
Returns the representation of self as a string.
"""
R = PowerSeriesRing(self._parent._R,default_prec=self._depth,name='z')
z = R.gen()
s = str(sum([R(self._val[ii,0]*z**ii) for ii in range(self._depth)]))
return s
示例13: _sa_coefficients_lambda_
def _sa_coefficients_lambda_(K, beta=0):
r"""
Return the coefficients `\lambda_{k, \ell}(\beta)` used in singularity analysis.
INPUT:
- ``K`` -- an integer.
- ``beta`` -- (default: `0`) the order of the logarithmic
singularity.
OUTPUT:
A dictionary mapping pairs of indices to rationals.
.. SEEALSO::
:meth:`~AsymptoticExpansionGenerators.SingularityAnalysis`
TESTS::
sage: from sage.rings.asymptotic.asymptotic_expansion_generators \
....: import _sa_coefficients_lambda_
sage: _sa_coefficients_lambda_(3)
{(0, 0): 1,
(1, 1): -1,
(1, 2): 1/2,
(2, 2): 1,
(2, 3): -5/6,
(2, 4): 1/8,
(3, 3): -1,
(3, 4): 13/12,
(4, 4): 1}
sage: _sa_coefficients_lambda_(3, beta=1)
{(0, 0): 1,
(1, 1): -2,
(1, 2): 1/2,
(2, 2): 3,
(2, 3): -4/3,
(2, 4): 1/8,
(3, 3): -4,
(3, 4): 29/12,
(4, 4): 5}
"""
from sage.rings.laurent_series_ring import LaurentSeriesRing
from sage.rings.power_series_ring import PowerSeriesRing
from sage.rings.rational_field import QQ
V = LaurentSeriesRing(QQ, names='v', default_prec=K)
v = V.gen()
T = PowerSeriesRing(V, names='t', default_prec=2*K-1)
t = T.gen()
S = (t - (1+1/v+beta) * (1+v*t).log()).exp()
return dict(((k + L.valuation(), ell), c)
for ell, L in enumerate(S.list())
for k, c in enumerate(L.list()))
示例14: _compute_acting_matrix
def _compute_acting_matrix(self, g, M):
r"""
INPUT:
- ``g`` -- an instance of
:class:`sage.matrices.matrix_integer_2x2.Matrix_integer_2x2`
or :class:`sage.matrix.matrix_generic_dense.Matrix_generic_dense`
- ``M`` -- a positive integer giving the precision at which
``g`` should act.
OUTPUT:
-
EXAMPLES::
sage: from sage.modular.pollack_stevens.distributions import Distributions, Symk
"""
#tim = verbose("Starting")
a, b, c, d = self._adjuster(g)
# if g.parent().base_ring().is_exact():
# self._check_mat(a, b, c, d)
k = self._k
if g.parent().base_ring() is ZZ:
if self._symk:
base_ring = QQ
else:
base_ring = Zmod(self._p**M)
else:
base_ring = self.underlying_set().base_ring()
#cdef Matrix B = matrix(base_ring,M,M)
B = matrix(base_ring,M,M) #
if M == 0:
return B.change_ring(self.codomain().base_ring())
R = PowerSeriesRing(base_ring, 'y', default_prec = M)
y = R.gen()
#tim = verbose("Checked, made R",tim)
# special case for small precision, large weight
scale = (b+d*y)/(a+c*y)
t = (a+c*y)**k # will already have precision M
#cdef long row, col #
#tim = verbose("Made matrix",tim)
for col in range(M):
for row in range(M):
B.set_unsafe(row, col, t[row])
t *= scale
#verbose("Finished loop",tim)
# the changering here is annoying, but otherwise we have to change ring each time we multiply
B = B.change_ring(self.codomain().base_ring())
if self._character is not None:
B *= self._character(a)
if self._dettwist is not None:
B *= (a*d - b*c)**(self._dettwist)
return B
示例15: local_coordinates_at_weierstrass
def local_coordinates_at_weierstrass(self, P, prec=20, name='t'):
"""
For a finite Weierstrass point on the hyperelliptic
curve `y^2 = f(x)`, returns `(x(t), y(t))` such that
`(y(t))^2 = f(x(t))`, where `t = y` is the local parameter.
INPUT:
- ``P`` -- a finite 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 = y`
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: A = H(4, 0)
sage: x, y = H.local_coordinates_at_weierstrass(A, prec=7)
sage: x
4 + 1/360*t^2 - 191/23328000*t^4 + 7579/188956800000*t^6 + O(t^7)
sage: y
t + O(t^7)
sage: B = H(-5, 0)
sage: x, y = H.local_coordinates_at_weierstrass(B, prec=5)
sage: x
-5 + 1/1260*t^2 + 887/2000376000*t^4 + O(t^5)
sage: y
t + O(t^5)
AUTHOR:
- Jennifer Balakrishnan (2007-12)
- Francis Clarke (2012-08-26)
"""
if P[1] != 0:
raise TypeError("P = %s is not a finite Weierstrass point. Use local_coordinates_at_nonweierstrass instead!"%P)
L = PowerSeriesRing(self.base_ring(), name)
t = L.gen()
pol = self.hyperelliptic_polynomials()[0]
pol_prime = pol.derivative()
b = P[0]
t2 = t**2
c = b + t2/pol_prime(b)
c = c.add_bigoh(prec)
for _ in range(1 + log(prec, 2)):
c -= (pol(c) - t2)/pol_prime(c)
return (c, t.add_bigoh(prec))