本文整理汇总了Python中sage.modular.dirichlet.DirichletGroup.kernel方法的典型用法代码示例。如果您正苦于以下问题:Python DirichletGroup.kernel方法的具体用法?Python DirichletGroup.kernel怎么用?Python DirichletGroup.kernel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.modular.dirichlet.DirichletGroup
的用法示例。
在下文中一共展示了DirichletGroup.kernel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dimension_cusp_forms
# 需要导入模块: from sage.modular.dirichlet import DirichletGroup [as 别名]
# 或者: from sage.modular.dirichlet.DirichletGroup import kernel [as 别名]
def dimension_cusp_forms(self, k=2, eps=None, algorithm="CohenOesterle"):
r"""
Return the dimension of the space of cusp forms for self, or the
dimension of the subspace corresponding to the given character if one
is supplied.
INPUT:
- ``k`` - an integer (default: 2), the weight.
- ``eps`` - either None or a Dirichlet character modulo N, where N is
the level of this group. If this is None, then the dimension of the
whole space is returned; otherwise, the dimension of the subspace of
forms of character eps.
- ``algorithm`` -- either "CohenOesterle" (the default) or "Quer". This
specifies the method to use in the case of nontrivial character:
either the Cohen--Oesterle formula as described in Stein's book, or
by Möbius inversion using the subgroups GammaH (a method due to
Jordi Quer).
EXAMPLES:
We compute the same dimension in two different ways ::
sage: K = CyclotomicField(3)
sage: eps = DirichletGroup(7*43,K).0^2
sage: G = Gamma1(7*43)
Via Cohen--Oesterle::
sage: Gamma1(7*43).dimension_cusp_forms(2, eps)
28
Via Quer's method::
sage: Gamma1(7*43).dimension_cusp_forms(2, eps, algorithm="Quer")
28
Some more examples::
sage: G.<eps> = DirichletGroup(9)
sage: [Gamma1(9).dimension_cusp_forms(k, eps) for k in [1..10]]
[0, 0, 1, 0, 3, 0, 5, 0, 7, 0]
sage: [Gamma1(9).dimension_cusp_forms(k, eps^2) for k in [1..10]]
[0, 0, 0, 2, 0, 4, 0, 6, 0, 8]
In weight 1 this will return 0 in a few small cases, and otherwise give a NotImplementedError::
sage: chi = [u for u in DirichletGroup(40) if u(-1) == -1 and u(21) == 1][0]
sage: Gamma1(40).dimension_cusp_forms(1, chi)
0
sage: Gamma1(40).dimension_cusp_forms(1)
Traceback (most recent call last):
...
NotImplementedError: Computation of dimensions of weight 1 cusp forms spaces not implemented in general
"""
from .all import Gamma0
# first deal with special cases
if eps is None:
return GammaH_class.dimension_cusp_forms(self, k)
N = self.level()
K = eps.base_ring()
eps = DirichletGroup(N, K)(eps)
if K.characteristic() != 0:
raise NotImplementedError('dimension_cusp_forms() is only implemented for rings of characteristic 0')
if eps.is_trivial():
return Gamma0(N).dimension_cusp_forms(k)
if (k <= 0) or ((k % 2) == 1 and eps.is_even()) or ((k%2) == 0 and eps.is_odd()):
return ZZ(0)
if k == 1:
try:
# see if we can rule out cusp forms existing
n = GammaH_constructor(self.level(), eps.kernel()).dimension_cusp_forms(1)
if n == 0:
return ZZ(0)
else: # never happens at present
raise NotImplementedError("Computations of dimensions of spaces of weight 1 cusp forms not implemented at present")
except NotImplementedError:
raise
# now the main part
if algorithm == "Quer":
n = eps.order()
dim = ZZ(0)
for d in n.divisors():
G = GammaH_constructor(N,(eps**d).kernel())
dim = dim + moebius(d)*G.dimension_cusp_forms(k)
return dim//phi(n)
elif algorithm == "CohenOesterle":
from sage.modular.dims import CohenOesterle
#.........这里部分代码省略.........