def test_division_generators(self): prec = 6 div_consts = [c for c in gens_consts if isinstance(c, ConstDivision)] consts = (even_gen_consts() + odd_gen_consts() + [CVH(_wt18_consts[0], 2), CVH(sym10_19_consts[0], 2)]) calculator = CalculatorVectValued(consts, data_dir) calculator.calc_forms_and_save(prec, verbose=True, force=True) gens_dct = calculator.forms_dict(prec) for c in div_consts: k = c.weight() print "checking when k = %s" % (str(k), ) if k % 2 == 0: sccst = _find_const_of_e4_e6_of_same_wt(18 - k) M = Sym10EvenDiv(sccst, prec) else: sccst = _find_const_of_e4_e6_of_same_wt(19 - k) M = Sym10OddDiv(sccst, prec) pl = _anihilate_pol(k, M) hol_basis = M.basis_of_subsp_annihilated_by(pl) N = Sym10GivenWtBase(prec, k, hol_basis) # Check this prec is sufficient. mt = matrix(QQ, [[b[t] for b in N.basis()] for t in N.linearly_indep_tuples()]) self.assertTrue( mt.is_invertible(), "False when k = %s" % (str(k),)) # Check our construction gives a holomorphic modular form self.assertTrue(N.contains(gens_dct[c]), "False when k = %s" % (str(k),))
def test_known_eigenforms(self): '''Test Hecke polynomial of degree 4 for Klingen-Eisenstein series and a KRS-lift. ''' klingen_consts = [c for c in even_gen_consts() if c.weight() in (6, 8)] klingen_consts.append(_wt10_klingen_const()) krs_const = [c for c in odd_gen_consts() if c.weight() == 13][0] clc = CalculatorVectValued(klingen_consts + [krs_const], data_dir) forms_dct = clc.forms_dict(6) for c in klingen_consts: self.assertEqual(forms_dct[c].euler_factor_of_spinor_l(2), _hecke_pol_klingen(c.weight())) self.assertEqual(forms_dct[krs_const].euler_factor_of_spinor_l(2), _hecke_pol_krs_lift())
'''Test relations among generators. ''' import unittest from degree2.vector_valued_impl.sym10.module_of_given_wt import relation, sym10_space import os from degree2.const import CalculatorVectValued from degree2.vector_valued_impl.sym10.even_structure import gen_consts as even_gen_consts from degree2.vector_valued_impl.sym10.odd_structure import gen_consts as odd_gen_consts data_dir = os.path.expanduser("~/data/vector_valued_sym10/test/") calculator = CalculatorVectValued(even_gen_consts() + odd_gen_consts(), data_dir) class TestRelation(unittest.TestCase): def test_relation(self): '''Test relations of weight 24, 26, 27 and 29. ''' prec = 6 forms_dict = calculator.forms_dict(prec) for wt in [24, 26, 27, 29]: print "Checking when k = %s" % (wt,) M = sym10_space(wt, prec, data_directory=data_dir) rel = relation(wt, data_directory=data_dir) self.assertEqual(len(rel), M.dimension() + 1) self.assertTrue(all(c.weight() == wt for c in rel)) self.assertTrue(sum(c.calc_form_from_dependencies_depth_1( prec, forms_dict) * a for c, a in rel.items()), 0) suite = unittest.TestLoader().loadTestsFromTestCase(TestRelation) unittest.TextTestRunner(verbosity=2).run(suite)
from degree2.vector_valued_impl.sym10.even_structure import _wt18_consts from degree2.const import ConstVectValuedHeckeOp as CVH from degree2.const import ConstDivision, ScalarModFormConst from degree2.vector_valued_smfs import VectorValuedSiegelModularForms from degree2.tsushima_dimension_formula import hilbert_series_maybe from degree2.vector_valued_impl.sym10.odd_structure import sym10_19_consts from sage.all import (cached_function, PolynomialRing, QQ, cached_method, CuspForms, matrix) from degree2.vector_valued_impl.sym10.even_structure import gen_consts as even_gen_consts from degree2.vector_valued_impl.sym10.odd_structure import gen_consts as odd_gen_consts from degree2.basic_operation import PrecisionDeg2 from degree2.scalar_valued_smfs import tuples_even_wt_modular_forms import os data_dir = os.path.expanduser("~/data/vector_valued_sym10/test/") gens_consts = even_gen_consts() + odd_gen_consts() class Sym10GivenWtHeckeConstBase(VectorValuedSiegelModularForms): '''A parent class of Sym10Wt18HeckeConst and Sym10Wt19HeckeConst. ''' def __init__(self, prec, wt, basis_consts): self._basis_consts = basis_consts self._calculator = CalculatorVectValued(self._basis_consts, data_dir) super(Sym10GivenWtHeckeConstBase, self).__init__(wt, 10, prec) @cached_method def basis(self): d = self._calculator.forms_dict(self.prec)