本文整理汇总了Python中sage.rings.all.ZZ.coefficients方法的典型用法代码示例。如果您正苦于以下问题:Python ZZ.coefficients方法的具体用法?Python ZZ.coefficients怎么用?Python ZZ.coefficients使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.rings.all.ZZ
的用法示例。
在下文中一共展示了ZZ.coefficients方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: J_inv_ZZ
# 需要导入模块: from sage.rings.all import ZZ [as 别名]
# 或者: from sage.rings.all.ZZ import coefficients [as 别名]
def J_inv_ZZ(self):
r"""
Return the rational Fourier expansion of ``J_inv``,
where the parameter ``d`` is replaced by ``1``.
This is the main function used to determine all Fourier expansions!
.. NOTE:
The Fourier expansion of ``J_inv`` for ``d!=1``
is given by ``J_inv_ZZ(q/d)``.
.. TODO:
The functions that are used in this implementation are
products of hypergeometric series with other, elementary,
functions. Implement them and clean up this representation.
EXAMPLES::
sage: from sage.modular.modform_hecketriangle.series_constructor import JFSeriesConstructor
sage: JFSeriesConstructor(prec=3).J_inv_ZZ()
q^-1 + 31/72 + 1823/27648*q + O(q^2)
sage: JFSeriesConstructor(group=5, prec=3).J_inv_ZZ()
q^-1 + 79/200 + 42877/640000*q + O(q^2)
sage: JFSeriesConstructor(group=5, prec=3).J_inv_ZZ().parent()
Laurent Series Ring in q over Rational Field
sage: JFSeriesConstructor(group=infinity, prec=3).J_inv_ZZ()
q^-1 + 3/8 + 69/1024*q + O(q^2)
"""
F1 = lambda a,b: self._qseries_ring(
[ ZZ(0) ]
+ [
rising_factorial(a,k) * rising_factorial(b,k) / (ZZ(k).factorial())**2
* sum(ZZ(1)/(a+j) + ZZ(1)/(b+j) - ZZ(2)/ZZ(1+j)
for j in range(ZZ(0),ZZ(k))
)
for k in range(ZZ(1), ZZ(self._prec+1))
],
ZZ(self._prec+1)
)
F = lambda a,b,c: self._qseries_ring(
[
rising_factorial(a,k) * rising_factorial(b,k) / rising_factorial(c,k) / ZZ(k).factorial()
for k in range(ZZ(0), ZZ(self._prec+1))
],
ZZ(self._prec+1)
)
a = self._group.alpha()
b = self._group.beta()
Phi = F1(a,b) / F(a,b,ZZ(1))
q = self._qseries_ring.gen()
# the current implementation of power series reversion is slow
# J_inv_ZZ = ZZ(1) / ((q*Phi.exp()).reversion())
temp_f = (q*Phi.exp()).polynomial()
new_f = temp_f.revert_series(temp_f.degree()+1)
J_inv_ZZ = ZZ(1) / (new_f + O(q**(temp_f.degree()+1)))
q = self._series_ring.gen()
J_inv_ZZ = sum([J_inv_ZZ.coefficients()[m] * q**J_inv_ZZ.exponents()[m] for m in range(len(J_inv_ZZ.coefficients()))]) + O(q**J_inv_ZZ.prec())
return J_inv_ZZ