本文整理汇总了Python中sage.rings.all.Integer.binomial方法的典型用法代码示例。如果您正苦于以下问题:Python Integer.binomial方法的具体用法?Python Integer.binomial怎么用?Python Integer.binomial使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.rings.all.Integer
的用法示例。
在下文中一共展示了Integer.binomial方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: apply_T
# 需要导入模块: from sage.rings.all import Integer [as 别名]
# 或者: from sage.rings.all.Integer import binomial [as 别名]
def apply_T(self, j):
"""
Apply the matrix `T=[0,1,-1,-1]` to the `j`-th Manin symbol.
INPUT:
- ``j`` - (int) a symbol index
OUTPUT: see documentation for apply()
EXAMPLE::
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(5,8)
sage: m.apply_T(4)
[(3, 1), (9, -6), (15, 15), (21, -20), (27, 15), (33, -6), (39, 1)]
sage: [m.apply_T(i) for i in xrange(10)]
[[(5, 1), (11, -6), (17, 15), (23, -20), (29, 15), (35, -6), (41, 1)],
[(0, 1), (6, -6), (12, 15), (18, -20), (24, 15), (30, -6), (36, 1)],
[(4, 1), (10, -6), (16, 15), (22, -20), (28, 15), (34, -6), (40, 1)],
[(2, 1), (8, -6), (14, 15), (20, -20), (26, 15), (32, -6), (38, 1)],
[(3, 1), (9, -6), (15, 15), (21, -20), (27, 15), (33, -6), (39, 1)],
[(1, 1), (7, -6), (13, 15), (19, -20), (25, 15), (31, -6), (37, 1)],
[(5, 1), (11, -5), (17, 10), (23, -10), (29, 5), (35, -1)],
[(0, 1), (6, -5), (12, 10), (18, -10), (24, 5), (30, -1)],
[(4, 1), (10, -5), (16, 10), (22, -10), (28, 5), (34, -1)],
[(2, 1), (8, -5), (14, 10), (20, -10), (26, 5), (32, -1)]]
"""
k = self._weight
i, u, v = self._symbol_list[j]
u, v = self.__syms.normalize(v,-u-v)
if (k-2) % 2 == 0:
s = 1
else:
s = -1
z = []
a = Integer(k-2-i)
for j in range(k-2-i+1):
m = self.index((j, u, v))
z.append((m, s * a.binomial(j)))
s *= -1
return z
示例2: apply_TT
# 需要导入模块: from sage.rings.all import Integer [as 别名]
# 或者: from sage.rings.all.Integer import binomial [as 别名]
def apply_TT(self, j):
"""
Apply the matrix `TT=[-1,-1,0,1]` to the `j`-th Manin symbol.
INPUT:
- ``j`` - (int) a symbol index
OUTPUT: see documentation for apply()
EXAMPLE::
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(5,8)
sage: m.apply_TT(4)
[(38, 1)]
sage: [m.apply_TT(i) for i in xrange(10)]
[[(37, 1)],
[(41, 1)],
[(39, 1)],
[(40, 1)],
[(38, 1)],
[(36, 1)],
[(31, -1), (37, 1)],
[(35, -1), (41, 1)],
[(33, -1), (39, 1)],
[(34, -1), (40, 1)]]
"""
k = self._weight
i, u, v = self._symbol_list[j]
u, v = self.__syms.normalize(-u-v,u)
if (k-2-i) % 2 == 0:
s = 1
else:
s = -1
z = []
a = Integer(i)
for j in range(i+1):
m = self.index((k-2-i+j, u, v))
z.append((m, s * a.binomial(j)))
s *= -1
return z