Hecke operators#

class sage.modular.hecke.hecke_operator.DiamondBracketOperator(parent, d)[source]#

Bases: HeckeAlgebraElement_matrix

The diamond bracket operator \(\langle d \rangle\) for some \(d \in \ZZ / N\ZZ\) (which need not be a unit, although if it is not, the operator will be zero).

class sage.modular.hecke.hecke_operator.HeckeAlgebraElement(parent)[source]#

Bases: AlgebraElement

Base class for elements of Hecke algebras.

apply_sparse(x)[source]#

Apply this Hecke operator to x, where we avoid computing the matrix of x if possible.

EXAMPLES:

sage: M = ModularSymbols(11)
sage: T = M.hecke_operator(23)
sage: T.apply_sparse(M.gen(0))
24*(1,0) - 5*(1,9)
>>> from sage.all import *
>>> M = ModularSymbols(Integer(11))
>>> T = M.hecke_operator(Integer(23))
>>> T.apply_sparse(M.gen(Integer(0)))
24*(1,0) - 5*(1,9)
charpoly(var='x')[source]#

Return the characteristic polynomial of this Hecke operator.

INPUT:

  • var – string (default: ‘x’)

OUTPUT: a monic polynomial in the given variable.

EXAMPLES:

sage: M = ModularSymbols(Gamma1(6),4)
sage: M.hecke_operator(2).charpoly('x')
x^6 - 14*x^5 + 29*x^4 + 172*x^3 - 124*x^2 - 320*x + 256
>>> from sage.all import *
>>> M = ModularSymbols(Gamma1(Integer(6)),Integer(4))
>>> M.hecke_operator(Integer(2)).charpoly('x')
x^6 - 14*x^5 + 29*x^4 + 172*x^3 - 124*x^2 - 320*x + 256
codomain()[source]#

The codomain of this operator. This is the Hecke module associated to the parent Hecke algebra.

EXAMPLES:

sage: R = ModularForms(Gamma0(7), 4).hecke_algebra()
sage: sage.modular.hecke.hecke_operator.HeckeAlgebraElement(R).codomain()
Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(7)
 of weight 4 over Rational Field
>>> from sage.all import *
>>> R = ModularForms(Gamma0(Integer(7)), Integer(4)).hecke_algebra()
>>> sage.modular.hecke.hecke_operator.HeckeAlgebraElement(R).codomain()
Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(7)
 of weight 4 over Rational Field
decomposition()[source]#

Decompose the Hecke module under the action of this Hecke operator.

EXAMPLES:

sage: M = ModularSymbols(11)
sage: t2 = M.hecke_operator(2)
sage: t2.decomposition()
[
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field,
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field
]
>>> from sage.all import *
>>> M = ModularSymbols(Integer(11))
>>> t2 = M.hecke_operator(Integer(2))
>>> t2.decomposition()
[
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field,
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field
]
sage: M = ModularSymbols(33, sign=1).new_submodule()
sage: T = M.hecke_operator(2)
sage: T.decomposition()
[
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 6 for Gamma_0(33) of weight 2 with sign 1 over Rational Field,
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 6 for Gamma_0(33) of weight 2 with sign 1 over Rational Field
]
>>> from sage.all import *
>>> M = ModularSymbols(Integer(33), sign=Integer(1)).new_submodule()
>>> T = M.hecke_operator(Integer(2))
>>> T.decomposition()
[
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 6 for Gamma_0(33) of weight 2 with sign 1 over Rational Field,
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 6 for Gamma_0(33) of weight 2 with sign 1 over Rational Field
]
det()[source]#

Return the determinant of this Hecke operator.

EXAMPLES:

sage: M = ModularSymbols(23)
sage: T = M.hecke_operator(3)
sage: T.det()
100
>>> from sage.all import *
>>> M = ModularSymbols(Integer(23))
>>> T = M.hecke_operator(Integer(3))
>>> T.det()
100
domain()[source]#

The domain of this operator. This is the Hecke module associated to the parent Hecke algebra.

EXAMPLES:

sage: R = ModularForms(Gamma0(7), 4).hecke_algebra()
sage: sage.modular.hecke.hecke_operator.HeckeAlgebraElement(R).domain()
Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(7)
 of weight 4 over Rational Field
>>> from sage.all import *
>>> R = ModularForms(Gamma0(Integer(7)), Integer(4)).hecke_algebra()
>>> sage.modular.hecke.hecke_operator.HeckeAlgebraElement(R).domain()
Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(7)
 of weight 4 over Rational Field
fcp(var='x')[source]#

Return the factorization of the characteristic polynomial of this Hecke operator.

EXAMPLES:

sage: M = ModularSymbols(23)
sage: T = M.hecke_operator(3)
sage: T.fcp('x')
(x - 4) * (x^2 - 5)^2
>>> from sage.all import *
>>> M = ModularSymbols(Integer(23))
>>> T = M.hecke_operator(Integer(3))
>>> T.fcp('x')
(x - 4) * (x^2 - 5)^2
hecke_module_morphism()[source]#

Return the endomorphism of Hecke modules defined by the matrix attached to this Hecke operator.

EXAMPLES:

sage: M = ModularSymbols(Gamma1(13))
sage: t = M.hecke_operator(2)
sage: t
Hecke operator T_2 on Modular Symbols space of dimension 15 for Gamma_1(13)
 of weight 2 with sign 0 over Rational Field
sage: t.hecke_module_morphism()
Hecke module morphism T_2 defined by the matrix
[ 2  0  0  0  0  0  0  1  0  0  1  0  0  0  0]
[ 0  2  0  1  0  1  0  0 -1  0  0  0  0  0  1]
[ 0  1  2  0  0  0  0  0  0  0  0 -1  1  0  0]
[ 1  0  0  2  0 -1  1  0  1  0 -1  1 -1  0  0]
[ 0  0  1  0  2  0 -1  0  0  0  0  0  0  0  0]
[ 0  0  0  0  0  0  0  0  0  0  0  1 -2  2 -1]
[ 0  0  0  0  0  2 -1  0 -1  0  0  0  0  1  0]
[ 0  0  0  0  1  0  0  2  0  0  0  0  0  0 -1]
[ 0  0  0  0  0  1  0  0 -1  0  2 -1  0  2 -1]
[ 0  0  0  0  0  1  1  0  0 -1  0  1 -1  2  0]
[ 0  0  0  0  0  2  0  0 -1 -1  1 -1  0  1  0]
[ 0  0  0  0  0  1  1  0  1  0  0  0 -1  1  0]
[ 0  0  0  0  0  1  1  0  0  1  0  0  0  0  0]
[ 0  0  0  0  0  1  0  0  1 -1  2  0  0  0 -1]
[ 0  0  0  0  0  0  0  0  0  1  0 -1  2  0 -1]
Domain:   Modular Symbols space of dimension 15 for Gamma_1(13) of weight ...
Codomain: Modular Symbols space of dimension 15 for Gamma_1(13) of weight ...
>>> from sage.all import *
>>> M = ModularSymbols(Gamma1(Integer(13)))
>>> t = M.hecke_operator(Integer(2))
>>> t
Hecke operator T_2 on Modular Symbols space of dimension 15 for Gamma_1(13)
 of weight 2 with sign 0 over Rational Field
>>> t.hecke_module_morphism()
Hecke module morphism T_2 defined by the matrix
[ 2  0  0  0  0  0  0  1  0  0  1  0  0  0  0]
[ 0  2  0  1  0  1  0  0 -1  0  0  0  0  0  1]
[ 0  1  2  0  0  0  0  0  0  0  0 -1  1  0  0]
[ 1  0  0  2  0 -1  1  0  1  0 -1  1 -1  0  0]
[ 0  0  1  0  2  0 -1  0  0  0  0  0  0  0  0]
[ 0  0  0  0  0  0  0  0  0  0  0  1 -2  2 -1]
[ 0  0  0  0  0  2 -1  0 -1  0  0  0  0  1  0]
[ 0  0  0  0  1  0  0  2  0  0  0  0  0  0 -1]
[ 0  0  0  0  0  1  0  0 -1  0  2 -1  0  2 -1]
[ 0  0  0  0  0  1  1  0  0 -1  0  1 -1  2  0]
[ 0  0  0  0  0  2  0  0 -1 -1  1 -1  0  1  0]
[ 0  0  0  0  0  1  1  0  1  0  0  0 -1  1  0]
[ 0  0  0  0  0  1  1  0  0  1  0  0  0  0  0]
[ 0  0  0  0  0  1  0  0  1 -1  2  0  0  0 -1]
[ 0  0  0  0  0  0  0  0  0  1  0 -1  2  0 -1]
Domain:   Modular Symbols space of dimension 15 for Gamma_1(13) of weight ...
Codomain: Modular Symbols space of dimension 15 for Gamma_1(13) of weight ...
image()[source]#

Return the image of this Hecke operator.

EXAMPLES:

sage: M = ModularSymbols(23)
sage: T = M.hecke_operator(3)
sage: T.fcp('x')
(x - 4) * (x^2 - 5)^2
sage: T.image()
Modular Symbols subspace of dimension 5 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field
sage: (T-4).image()
Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field
sage: (T**2-5).image()
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field
>>> from sage.all import *
>>> M = ModularSymbols(Integer(23))
>>> T = M.hecke_operator(Integer(3))
>>> T.fcp('x')
(x - 4) * (x^2 - 5)^2
>>> T.image()
Modular Symbols subspace of dimension 5 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field
>>> (T-Integer(4)).image()
Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field
>>> (T**Integer(2)-Integer(5)).image()
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field
kernel()[source]#

Return the kernel of this Hecke operator.

EXAMPLES:

sage: M = ModularSymbols(23)
sage: T = M.hecke_operator(3)
sage: T.fcp('x')
(x - 4) * (x^2 - 5)^2
sage: T.kernel()
Modular Symbols subspace of dimension 0 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field
sage: (T-4).kernel()
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field
sage: (T**2-5).kernel()
Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field
>>> from sage.all import *
>>> M = ModularSymbols(Integer(23))
>>> T = M.hecke_operator(Integer(3))
>>> T.fcp('x')
(x - 4) * (x^2 - 5)^2
>>> T.kernel()
Modular Symbols subspace of dimension 0 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field
>>> (T-Integer(4)).kernel()
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field
>>> (T**Integer(2)-Integer(5)).kernel()
Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field
trace()[source]#

Return the trace of this Hecke operator.

sage: M = ModularSymbols(1,12)
sage: T = M.hecke_operator(2)
sage: T.trace()
2001
>>> from sage.all import *
>>> M = ModularSymbols(Integer(1),Integer(12))
>>> T = M.hecke_operator(Integer(2))
>>> T.trace()
2001
class sage.modular.hecke.hecke_operator.HeckeAlgebraElement_matrix(parent, A)[source]#

Bases: HeckeAlgebraElement

An element of the Hecke algebra represented by a matrix.

matrix()[source]#

Return the matrix that defines this Hecke algebra element.

EXAMPLES:

sage: M = ModularSymbols(1,12)
sage: T = M.hecke_operator(2).matrix_form()
sage: T.matrix()
[ -24    0    0]
[   0  -24    0]
[4860    0 2049]
>>> from sage.all import *
>>> M = ModularSymbols(Integer(1),Integer(12))
>>> T = M.hecke_operator(Integer(2)).matrix_form()
>>> T.matrix()
[ -24    0    0]
[   0  -24    0]
[4860    0 2049]
class sage.modular.hecke.hecke_operator.HeckeOperator(parent, n)[source]#

Bases: HeckeAlgebraElement

The Hecke operator \(T_n\) for some \(n\) (which need not be coprime to the level). The matrix is not computed until it is needed.

index()[source]#

Return the index of this Hecke operator, i.e., if this Hecke operator is \(T_n\), return the int \(n\).

EXAMPLES:

sage: T = ModularSymbols(11).hecke_operator(17)
sage: T.index()
17
>>> from sage.all import *
>>> T = ModularSymbols(Integer(11)).hecke_operator(Integer(17))
>>> T.index()
17
matrix(*args, **kwds)[source]#

Return the matrix underlying this Hecke operator.

EXAMPLES:

sage: T = ModularSymbols(11).hecke_operator(17)
sage: T.matrix()
[18  0 -4]
[ 0 -2  0]
[ 0  0 -2]
>>> from sage.all import *
>>> T = ModularSymbols(Integer(11)).hecke_operator(Integer(17))
>>> T.matrix()
[18  0 -4]
[ 0 -2  0]
[ 0  0 -2]
matrix_form()[source]#

Return the matrix form of this element of a Hecke algebra.

sage: T = ModularSymbols(11).hecke_operator(17)
sage: T.matrix_form()
Hecke operator on Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field defined by:
[18  0 -4]
[ 0 -2  0]
[ 0  0 -2]
>>> from sage.all import *
>>> T = ModularSymbols(Integer(11)).hecke_operator(Integer(17))
>>> T.matrix_form()
Hecke operator on Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field defined by:
[18  0 -4]
[ 0 -2  0]
[ 0  0 -2]
sage.modular.hecke.hecke_operator.is_HeckeAlgebraElement(x)[source]#

Return True if x is of type HeckeAlgebraElement.

EXAMPLES:

sage: from sage.modular.hecke.hecke_operator import is_HeckeAlgebraElement
sage: M = ModularSymbols(Gamma0(7), 4)
sage: is_HeckeAlgebraElement(M.T(3))
doctest:warning...
DeprecationWarning: the function is_HeckeAlgebraElement is deprecated;
use 'isinstance(..., HeckeAlgebraElement)' instead
See https://github.com/sagemath/sage/issues/37895 for details.
True
sage: is_HeckeAlgebraElement(M.T(3) + M.T(5))
True
>>> from sage.all import *
>>> from sage.modular.hecke.hecke_operator import is_HeckeAlgebraElement
>>> M = ModularSymbols(Gamma0(Integer(7)), Integer(4))
>>> is_HeckeAlgebraElement(M.T(Integer(3)))
doctest:warning...
DeprecationWarning: the function is_HeckeAlgebraElement is deprecated;
use 'isinstance(..., HeckeAlgebraElement)' instead
See https://github.com/sagemath/sage/issues/37895 for details.
True
>>> is_HeckeAlgebraElement(M.T(Integer(3)) + M.T(Integer(5)))
True
sage.modular.hecke.hecke_operator.is_HeckeOperator(x)[source]#

Return True if x is of type HeckeOperator.

EXAMPLES:

sage: from sage.modular.hecke.hecke_operator import is_HeckeOperator
sage: M = ModularSymbols(Gamma0(7), 4)
sage: is_HeckeOperator(M.T(3))
doctest:warning...
DeprecationWarning: the function is_HeckeOperator is deprecated;
use 'isinstance(..., HeckeOperator)' instead
See https://github.com/sagemath/sage/issues/37895 for details.
True
sage: is_HeckeOperator(M.T(3) + M.T(5))
False
>>> from sage.all import *
>>> from sage.modular.hecke.hecke_operator import is_HeckeOperator
>>> M = ModularSymbols(Gamma0(Integer(7)), Integer(4))
>>> is_HeckeOperator(M.T(Integer(3)))
doctest:warning...
DeprecationWarning: the function is_HeckeOperator is deprecated;
use 'isinstance(..., HeckeOperator)' instead
See https://github.com/sagemath/sage/issues/37895 for details.
True
>>> is_HeckeOperator(M.T(Integer(3)) + M.T(Integer(5)))
False