Base class for elements of Hecke algebras.
Apply this Hecke operator to .
EXAMPLES:
sage: M = ModularSymbols(11); t2 = M.hecke_operator(2)
sage: t2(M.gen(0))
3*(1,0) - (1,9)
sage: t2 = M.hecke_operator(2); t3 = M.hecke_operator(3)
sage: t3(t2(M.gen(0)))
12*(1,0) - 2*(1,9)
sage: (t3*t2)(M.gen(0))
12*(1,0) - 2*(1,9)
EXAMPLE:
sage: M = ModularSymbols(1,12)
sage: T = M.hecke_operator(2).matrix_form()
sage: T[0,0]
-24
Create an element of a Hecke algebra.
EXAMPLES:
sage: R = ModularForms(Gamma0(7), 4).hecke_algebra()
sage: sage.modular.hecke.hecke_operator.HeckeAlgebraElement(R) # please don't do this!
Generic element of a structure
EXAMPLES:
sage: M = ModularSymbols(11); t2 = M.hecke_operator(2)
sage: 2*t2
Hecke operator on Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field defined by:
[ 6 0 -2]
[ 0 -4 0]
[ 0 0 -4]
Add self to other.
EXAMPLES:
sage: M = ModularSymbols(11)
sage: t = M.hecke_operator(2)
sage: t
Hecke operator T_2 on Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field
sage: t + t # indirect doctest
Hecke operator on Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field defined by:
[ 6 0 -2]
[ 0 -4 0]
[ 0 0 -4]
We can also add Hecke operators with different indexes:
sage: M = ModularSymbols(Gamma1(6),4)
sage: t2 = M.hecke_operator(2); t3 = M.hecke_operator(3)
sage: t2 + t3
Hecke operator on Modular Symbols space of dimension 6 for Gamma_1(6) of weight 4 with sign 0 and over Rational Field defined by:
[ 35 0 0 -8/7 24/7 -16/7]
[ 4 28 0 19/7 -57/7 38/7]
[ 18 0 9 -40/7 22/7 18/7]
[ 0 18 4 -22/7 -18/7 54/7]
[ 0 18 4 13/7 -53/7 54/7]
[ 0 18 4 13/7 -18/7 19/7]
sage: (t2 - t3).charpoly('x')
x^6 + 36*x^5 + 104*x^4 - 3778*x^3 + 7095*x^2 - 3458*x
Compute the difference of self and other, where other has already been coerced into the parent of self.
EXAMPLES:
sage: M = ModularSymbols(Gamma1(6),4)
sage: t2 = M.hecke_operator(2); t3 = M.hecke_operator(3)
sage: t2 - t3 # indirect doctest
Hecke operator on Modular Symbols space of dimension 6 for Gamma_1(6) of weight 4 with sign 0 and over Rational Field defined by:
[ -19 0 0 4/7 -12/7 8/7]
[ 4 -26 0 -17/7 51/7 -34/7]
[ -18 0 7 -12/7 -6/7 18/7]
[ 0 -18 4 -16/7 34/7 -18/7]
[ 0 -18 4 -23/7 41/7 -18/7]
[ 0 -18 4 -23/7 34/7 -11/7]
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)
Return the characteristic polynomial of this Hecke operator.
INPUT:
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
The codomain of this operator. This is the Hecke module associated to the parent Hecke algebra.
EXAMPLE:
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
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
]
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
]
Return the determinant of this Hecke operator.
EXAMPLES:
sage: M = ModularSymbols(23)
sage: T = M.hecke_operator(3)
sage: T.det()
100
The domain of this operator. This is the Hecke module associated to the parent Hecke algebra.
EXAMPLE:
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
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
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 and over Rational Field
sage: t.hecke_module_morphism()
Hecke module morphism T_2 defined by the matrix
[ 2 1 0 0 0 0 0 0 0 0 0 0 0 0 -1]
[ 0 2 0 1 0 0 0 -1 0 0 0 0 0 0 0]
[ 0 0 2 0 0 1 -1 1 0 -1 0 1 -1 0 0]
[ 0 0 0 2 1 0 1 0 0 0 1 -1 0 0 0]
[ 0 0 1 0 2 0 0 0 0 1 -1 0 0 0 1]
[ 1 0 0 0 0 2 0 0 0 0 0 0 1 0 0]
[ 0 0 0 0 0 0 0 1 -1 1 -1 0 -1 1 1]
[ 0 0 0 0 0 0 0 -1 1 1 0 0 -1 1 0]
[ 0 0 0 0 0 0 -1 -1 0 1 -1 -1 1 0 -1]
[ 0 0 0 0 0 0 -2 0 2 -2 0 2 -2 1 -1]
[ 0 0 0 0 0 0 0 0 2 -1 1 0 0 1 -1]
[ 0 0 0 0 0 0 -1 1 2 -1 1 0 -2 2 0]
[ 0 0 0 0 0 0 0 0 1 1 0 -1 0 0 0]
[ 0 0 0 0 0 0 -1 1 1 0 1 1 -1 0 0]
[ 0 0 0 0 0 0 2 0 0 0 2 -1 0 1 -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 ...
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
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
Return the trace of this Hecke operator.
sage: M = ModularSymbols(1,12)
sage: T = M.hecke_operator(2)
sage: T.trace()
2001
An element of the Hecke algebra represented by a matrix.
Compare self to other, where the coercion model has already ensured that other has the same parent as self.
EXAMPLES:
sage: T = ModularForms(SL2Z, 12).hecke_algebra()
sage: m = T(matrix(QQ, 2, [1,2,0,1]), check=False); n = T.hecke_operator(14)
sage: m == n
False
sage: m == n.matrix_form()
False
sage: n.matrix_form() == T(matrix(QQ, 2, [401856, 0, 0, 4051542498456]), check=False)
True
Initialise an element from a matrix. This must be over the base ring of self and have the right size.
This is a bit overkill as similar checks will be performed by the call and coerce methods of the parent of self, but it can’t hurt to be paranoid. Any fancy coercion / base_extension / etc happens there, not here.
TESTS:
sage: T = ModularForms(Gamma0(7), 4).hecke_algebra()
sage: M = sage.modular.hecke.hecke_operator.HeckeAlgebraElement_matrix(T, matrix(QQ,3,[2,3,0,1,2,3,7,8,9])); M
Hecke operator on Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(7) of weight 4 over Rational Field defined by:
[2 3 0]
[1 2 3]
[7 8 9]
sage: loads(dumps(M)) == M
True
sage: sage.modular.hecke.hecke_operator.HeckeAlgebraElement_matrix(T, matrix(Integers(2),3,[2,3,0,1,2,3,7,8,9]))
...
TypeError: base ring of matrix (Ring of integers modulo 2) does not match base ring of space (Rational Field)
sage: sage.modular.hecke.hecke_operator.HeckeAlgebraElement_matrix(T, matrix(QQ,2,[2,3,0,1]))
...
TypeError: A must be a square matrix of rank 3
Latex representation of self (just prints the matrix)
EXAMPLE:
sage: M = ModularSymbols(1,12)
sage: M.hecke_operator(2).matrix_form()._latex_()
'\\left(\\begin{array}{rrr}\n-24 & 0 & 0 \\\\\n0 & -24 & 0 \\\\\n4860 & 0 & 2049\n\\end{array}\\right)'
Multiply self by other (which has already been coerced into an element of the parent of self).
EXAMPLES:
sage: M = ModularSymbols(1,12)
sage: T = M.hecke_operator(2).matrix_form()
sage: T * T # indirect doctest
Hecke operator on Modular Symbols space of dimension 3 for Gamma_0(1) of weight 12 with sign 0 over Rational Field defined by:
[ 576 0 0]
[ 0 576 0]
[9841500 0 4198401]
String representation of self.
EXAMPLES:
sage: M = ModularSymbols(1,12)
sage: M.hecke_operator(2).matrix_form()._repr_()
'Hecke operator on Modular Symbols space of dimension 3 for Gamma_0(1) of weight 12 with sign 0 over Rational Field defined by:\n[ -24 0 0]\n[ 0 -24 0]\n[4860 0 2049]'
sage: ModularForms(Gamma0(100)).hecke_operator(4).matrix_form()._repr_()
'Hecke operator on Modular Forms space of dimension 24 for Congruence Subgroup Gamma0(100) of weight 2 over Rational Field defined by:\n24 x 24 dense matrix over Rational Field'
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]
The Hecke operator for some
(which need not be coprime to the
level). The matrix is not computed until it is needed.
Compare self and other (where the coercion model has already ensured that self and other have the same parent). Hecke operators on the same space compare as equal if and only if their matrices are equal, so we check if the indices are the same and if not we compute the matrices (which is potentially expensive).
EXAMPLES:
sage: M = ModularSymbols(Gamma0(7), 4)
sage: m = M.hecke_operator(3)
sage: m == m
True
sage: m == 2*m
False
sage: m == M.hecke_operator(5)
False
These last two tests involve a coercion:
sage: m == m.matrix_form()
True
sage: m == m.matrix()
False
EXAMPLES:
sage: M = ModularSymbols(11)
sage: H = M.hecke_operator(2005); H
Hecke operator T_2005 on Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field
sage: H == loads(dumps(H))
True
We create a Hecke operator of large index (greater than 32 bits):
sage: M1 = ModularSymbols(21,2)
sage: M1.hecke_operator(13^9)
Hecke operator T_10604499373 on Modular Symbols space of dimension 5 for Gamma_0(21) of weight 2 with sign 0 over Rational Field
LaTeX representation of self
EXAMPLE:
sage: ModularSymbols(Gamma0(7), 4).hecke_operator(6)._latex_()
'T_{6}'
Multiply this Hecke operator by another element of the same algebra. If
the other element is of the form for some m, we check whether the
product is equal to
and return that; if the product is not
(easily seen to be) of the form
, then we calculate the product
of the two matrices and return a Hecke algebra element defined by that.
EXAMPLES: We create the space of modular symbols of level
and weight
, then compute
and
on it, along with their composition.
sage: M = ModularSymbols(11)
sage: t2 = M.hecke_operator(2); t3 = M.hecke_operator(3)
sage: t2*t3 # indirect doctest
Hecke operator T_6 on Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field
sage: t3.matrix() * t2.matrix()
[12 0 -2]
[ 0 2 0]
[ 0 0 2]
sage: (t2*t3).matrix()
[12 0 -2]
[ 0 2 0]
[ 0 0 2]
When we compute the result is not (easily seen to
be) a Hecke operator of the form
, so it is returned
as a Hecke module homomorphism defined as a matrix:
sage: t2**5
Hecke operator on Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field defined by:
[243 0 -55]
[ 0 -32 0]
[ 0 0 -32]
String representation of self
EXAMPLE:
sage: ModularSymbols(Gamma0(7), 4).hecke_operator(6)._repr_()
'Hecke operator T_6 on Modular Symbols space of dimension 4 for Gamma_0(7) of weight 4 with sign 0 over Rational Field'
Return the index of this Hecke operator, i.e., if this Hecke
operator is , return the int
.
EXAMPLES:
sage: T = ModularSymbols(11).hecke_operator(17)
sage: T.index()
17
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]
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]
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))
True
sage: is_HeckeAlgebraElement(M.T(3) + M.T(5))
True
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))
True
sage: is_HeckeOperator(M.T(3) + M.T(5))
False