def _compute_hecke_matrix(self, n): """ Compute the matrix of the Hecke operator T_n acting on self. NOTE: If self is a level 1 space, the much faster Victor Miller basis is used for this computation. EXAMPLES:: sage: M = ModularForms(11, 2) sage: M._compute_hecke_matrix(6) [ 2 0] [ 0 12] Check that :trac:`22780` is fixed:: sage: M = ModularForms(1, 12) sage: M._compute_hecke_matrix(2) [ -24 0] [ 0 2049] sage: ModularForms(1, 2).hecke_matrix(2) [] TESTS: The following Hecke matrix is 43x43 with very large integer entries. We test it indirectly by computing the product and the sum of its eigenvalues, and reducing these two integers modulo all the primes less than 100:: sage: M = ModularForms(1, 512) sage: t = M._compute_hecke_matrix(5) # long time (2s) sage: t[-1, -1] == 1 + 5^511 # long time (0s, depends on above) True sage: f = t.charpoly() # long time (4s) sage: [f[0]%p for p in prime_range(100)] # long time (0s, depends on above) [0, 0, 0, 0, 1, 9, 2, 7, 0, 0, 0, 0, 1, 12, 9, 16, 37, 0, 21, 11, 70, 22, 0, 58, 76] sage: [f[42]%p for p in prime_range(100)] # long time (0s, depends on above) [0, 0, 4, 0, 10, 4, 4, 8, 12, 1, 23, 13, 10, 27, 20, 13, 16, 59, 53, 41, 11, 13, 12, 6, 82] """ if self.level() == 1: k = self.weight() d = self.dimension() if d == 0: return matrix(self.base_ring(), 0, 0, []) from sage.modular.all import victor_miller_basis, hecke_operator_on_basis vmb = victor_miller_basis(k, prec=d * n + 1)[1:] Tcusp = hecke_operator_on_basis(vmb, n, k) return Tcusp.block_sum(matrix(self.base_ring(), 1, 1, [sigma(n, k - 1)])) else: return space.ModularFormsSpace._compute_hecke_matrix(self, n)
def _compute_hecke_matrix(self, n): """ Compute the matrix of the Hecke operator T_n acting on self. NOTE: If self is a level 1 space, the much faster Victor Miller basis is used for this computation. EXAMPLES:: sage: M = ModularForms(11, 2) sage: M._compute_hecke_matrix(6) [ 2 0] [ 0 12] Check that :trac:`22780` is fixed:: sage: M = ModularForms(1, 12) sage: M._compute_hecke_matrix(2) [ -24 0] [ 0 2049] sage: ModularForms(1, 2).hecke_matrix(2) [] TESTS: The following Hecke matrix is 43x43 with very large integer entries. We test it indirectly by computing the product and the sum of its eigenvalues, and reducing these two integers modulo all the primes less than 100:: sage: M = ModularForms(1, 512) sage: t = M._compute_hecke_matrix(5) # long time (2s) sage: t[-1, -1] == 1 + 5^511 # long time (0s, depends on above) True sage: f = t.charpoly() # long time (4s) sage: [f[0]%p for p in prime_range(100)] # long time (0s, depends on above) [0, 0, 0, 0, 1, 9, 2, 7, 0, 0, 0, 0, 1, 12, 9, 16, 37, 0, 21, 11, 70, 22, 0, 58, 76] sage: [f[42]%p for p in prime_range(100)] # long time (0s, depends on above) [0, 0, 4, 0, 10, 4, 4, 8, 12, 1, 23, 13, 10, 27, 20, 13, 16, 59, 53, 41, 11, 13, 12, 6, 82] """ if self.level() == 1: k = self.weight() d = self.dimension() if d == 0: return matrix(self.base_ring(), 0, 0, []) from sage.modular.all import victor_miller_basis, hecke_operator_on_basis vmb = victor_miller_basis(k, prec=d*n+1)[1:] Tcusp = hecke_operator_on_basis(vmb, n, k) return Tcusp.block_sum(matrix(self.base_ring(), 1, 1, [sigma(n, k-1)])) else: return space.ModularFormsSpace._compute_hecke_matrix(self, n)