passagemath-schemes 10.6.40__cp314-cp314-macosx_13_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of passagemath-schemes might be problematic. Click here for more details.
- passagemath_schemes/.dylibs/libflint.22.0.dylib +0 -0
- passagemath_schemes/.dylibs/libgmp.10.dylib +0 -0
- passagemath_schemes/.dylibs/libgmpxx.4.dylib +0 -0
- passagemath_schemes/.dylibs/libmpfr.6.dylib +0 -0
- passagemath_schemes/__init__.py +3 -0
- passagemath_schemes-10.6.40.dist-info/METADATA +204 -0
- passagemath_schemes-10.6.40.dist-info/METADATA.bak +205 -0
- passagemath_schemes-10.6.40.dist-info/RECORD +314 -0
- passagemath_schemes-10.6.40.dist-info/WHEEL +6 -0
- passagemath_schemes-10.6.40.dist-info/top_level.txt +3 -0
- sage/all__sagemath_schemes.py +23 -0
- sage/databases/all__sagemath_schemes.py +7 -0
- sage/databases/cremona.py +1723 -0
- sage/dynamics/all__sagemath_schemes.py +2 -0
- sage/dynamics/arithmetic_dynamics/affine_ds.py +1083 -0
- sage/dynamics/arithmetic_dynamics/all.py +14 -0
- sage/dynamics/arithmetic_dynamics/berkovich_ds.py +1101 -0
- sage/dynamics/arithmetic_dynamics/dynamical_semigroup.py +1543 -0
- sage/dynamics/arithmetic_dynamics/endPN_automorphism_group.py +2426 -0
- sage/dynamics/arithmetic_dynamics/endPN_minimal_model.py +1169 -0
- sage/dynamics/arithmetic_dynamics/generic_ds.py +663 -0
- sage/dynamics/arithmetic_dynamics/product_projective_ds.py +339 -0
- sage/dynamics/arithmetic_dynamics/projective_ds.py +9558 -0
- sage/dynamics/arithmetic_dynamics/projective_ds_helper.cpython-314-darwin.so +0 -0
- sage/dynamics/arithmetic_dynamics/projective_ds_helper.pyx +301 -0
- sage/dynamics/arithmetic_dynamics/wehlerK3.py +2576 -0
- sage/lfunctions/all.py +18 -0
- sage/lfunctions/dokchitser.py +745 -0
- sage/lfunctions/pari.py +818 -0
- sage/lfunctions/zero_sums.cpython-314-darwin.so +0 -0
- sage/lfunctions/zero_sums.pyx +1847 -0
- sage/modular/abvar/abvar.py +5135 -0
- sage/modular/abvar/abvar_ambient_jacobian.py +413 -0
- sage/modular/abvar/abvar_newform.py +244 -0
- sage/modular/abvar/all.py +8 -0
- sage/modular/abvar/constructor.py +186 -0
- sage/modular/abvar/cuspidal_subgroup.py +371 -0
- sage/modular/abvar/finite_subgroup.py +896 -0
- sage/modular/abvar/homology.py +720 -0
- sage/modular/abvar/homspace.py +998 -0
- sage/modular/abvar/lseries.py +415 -0
- sage/modular/abvar/morphism.py +935 -0
- sage/modular/abvar/torsion_point.py +274 -0
- sage/modular/abvar/torsion_subgroup.py +740 -0
- sage/modular/all.py +43 -0
- sage/modular/arithgroup/all.py +20 -0
- sage/modular/arithgroup/arithgroup_element.cpython-314-darwin.so +0 -0
- sage/modular/arithgroup/arithgroup_element.pyx +474 -0
- sage/modular/arithgroup/arithgroup_generic.py +1402 -0
- sage/modular/arithgroup/arithgroup_perm.py +2692 -0
- sage/modular/arithgroup/congroup.cpython-314-darwin.so +0 -0
- sage/modular/arithgroup/congroup.pyx +334 -0
- sage/modular/arithgroup/congroup_gamma.py +363 -0
- sage/modular/arithgroup/congroup_gamma0.py +692 -0
- sage/modular/arithgroup/congroup_gamma1.py +653 -0
- sage/modular/arithgroup/congroup_gammaH.py +1469 -0
- sage/modular/arithgroup/congroup_generic.py +628 -0
- sage/modular/arithgroup/congroup_sl2z.py +267 -0
- sage/modular/arithgroup/farey_symbol.cpython-314-darwin.so +0 -0
- sage/modular/arithgroup/farey_symbol.pyx +1066 -0
- sage/modular/arithgroup/tests.py +418 -0
- sage/modular/btquotients/all.py +4 -0
- sage/modular/btquotients/btquotient.py +3753 -0
- sage/modular/btquotients/pautomorphicform.py +2570 -0
- sage/modular/buzzard.py +100 -0
- sage/modular/congroup.py +29 -0
- sage/modular/congroup_element.py +13 -0
- sage/modular/cusps.py +1109 -0
- sage/modular/cusps_nf.py +1270 -0
- sage/modular/dims.py +569 -0
- sage/modular/dirichlet.py +3310 -0
- sage/modular/drinfeld_modform/all.py +2 -0
- sage/modular/drinfeld_modform/element.py +446 -0
- sage/modular/drinfeld_modform/ring.py +773 -0
- sage/modular/drinfeld_modform/tutorial.py +236 -0
- sage/modular/etaproducts.py +1065 -0
- sage/modular/hecke/algebra.py +746 -0
- sage/modular/hecke/all.py +20 -0
- sage/modular/hecke/ambient_module.py +1019 -0
- sage/modular/hecke/degenmap.py +119 -0
- sage/modular/hecke/element.py +325 -0
- sage/modular/hecke/hecke_operator.py +780 -0
- sage/modular/hecke/homspace.py +206 -0
- sage/modular/hecke/module.py +1767 -0
- sage/modular/hecke/morphism.py +174 -0
- sage/modular/hecke/submodule.py +989 -0
- sage/modular/hypergeometric_misc.cpython-314-darwin.so +0 -0
- sage/modular/hypergeometric_misc.pxd +4 -0
- sage/modular/hypergeometric_misc.pyx +166 -0
- sage/modular/hypergeometric_motive.py +2017 -0
- sage/modular/local_comp/all.py +2 -0
- sage/modular/local_comp/liftings.py +292 -0
- sage/modular/local_comp/local_comp.py +1071 -0
- sage/modular/local_comp/smoothchar.py +1825 -0
- sage/modular/local_comp/type_space.py +748 -0
- sage/modular/modform/all.py +30 -0
- sage/modular/modform/ambient.py +815 -0
- sage/modular/modform/ambient_R.py +177 -0
- sage/modular/modform/ambient_eps.py +306 -0
- sage/modular/modform/ambient_g0.py +124 -0
- sage/modular/modform/ambient_g1.py +204 -0
- sage/modular/modform/constructor.py +545 -0
- sage/modular/modform/cuspidal_submodule.py +708 -0
- sage/modular/modform/defaults.py +14 -0
- sage/modular/modform/eis_series.py +505 -0
- sage/modular/modform/eisenstein_submodule.py +663 -0
- sage/modular/modform/element.py +4131 -0
- sage/modular/modform/find_generators.py +59 -0
- sage/modular/modform/half_integral.py +154 -0
- sage/modular/modform/hecke_operator_on_qexp.py +247 -0
- sage/modular/modform/j_invariant.py +47 -0
- sage/modular/modform/l_series_gross_zagier.py +133 -0
- sage/modular/modform/l_series_gross_zagier_coeffs.cpython-314-darwin.so +0 -0
- sage/modular/modform/l_series_gross_zagier_coeffs.pyx +177 -0
- sage/modular/modform/notes.py +45 -0
- sage/modular/modform/numerical.py +514 -0
- sage/modular/modform/periods.py +14 -0
- sage/modular/modform/ring.py +1257 -0
- sage/modular/modform/space.py +1860 -0
- sage/modular/modform/submodule.py +118 -0
- sage/modular/modform/tests.py +64 -0
- sage/modular/modform/theta.py +110 -0
- sage/modular/modform/vm_basis.py +381 -0
- sage/modular/modform/weight1.py +220 -0
- sage/modular/modform_hecketriangle/abstract_ring.py +1932 -0
- sage/modular/modform_hecketriangle/abstract_space.py +2528 -0
- sage/modular/modform_hecketriangle/all.py +30 -0
- sage/modular/modform_hecketriangle/analytic_type.py +590 -0
- sage/modular/modform_hecketriangle/constructor.py +416 -0
- sage/modular/modform_hecketriangle/element.py +351 -0
- sage/modular/modform_hecketriangle/functors.py +752 -0
- sage/modular/modform_hecketriangle/graded_ring.py +541 -0
- sage/modular/modform_hecketriangle/graded_ring_element.py +2225 -0
- sage/modular/modform_hecketriangle/hecke_triangle_group_element.py +3352 -0
- sage/modular/modform_hecketriangle/hecke_triangle_groups.py +1432 -0
- sage/modular/modform_hecketriangle/readme.py +1214 -0
- sage/modular/modform_hecketriangle/series_constructor.py +580 -0
- sage/modular/modform_hecketriangle/space.py +1037 -0
- sage/modular/modform_hecketriangle/subspace.py +423 -0
- sage/modular/modsym/all.py +17 -0
- sage/modular/modsym/ambient.py +3846 -0
- sage/modular/modsym/boundary.py +1420 -0
- sage/modular/modsym/element.py +336 -0
- sage/modular/modsym/g1list.py +178 -0
- sage/modular/modsym/ghlist.py +182 -0
- sage/modular/modsym/hecke_operator.py +73 -0
- sage/modular/modsym/manin_symbol.cpython-314-darwin.so +0 -0
- sage/modular/modsym/manin_symbol.pxd +5 -0
- sage/modular/modsym/manin_symbol.pyx +497 -0
- sage/modular/modsym/manin_symbol_list.py +1295 -0
- sage/modular/modsym/modsym.py +400 -0
- sage/modular/modsym/modular_symbols.py +384 -0
- sage/modular/modsym/p1list.cpython-314-darwin.so +0 -0
- sage/modular/modsym/p1list.pxd +29 -0
- sage/modular/modsym/p1list.pyx +1372 -0
- sage/modular/modsym/p1list_nf.py +1241 -0
- sage/modular/modsym/relation_matrix.py +591 -0
- sage/modular/modsym/relation_matrix_pyx.cpython-314-darwin.so +0 -0
- sage/modular/modsym/relation_matrix_pyx.pyx +108 -0
- sage/modular/modsym/space.py +2468 -0
- sage/modular/modsym/subspace.py +455 -0
- sage/modular/modsym/tests.py +375 -0
- sage/modular/multiple_zeta.py +2632 -0
- sage/modular/multiple_zeta_F_algebra.py +786 -0
- sage/modular/overconvergent/all.py +6 -0
- sage/modular/overconvergent/genus0.py +1878 -0
- sage/modular/overconvergent/hecke_series.py +1187 -0
- sage/modular/overconvergent/weightspace.py +778 -0
- sage/modular/pollack_stevens/all.py +4 -0
- sage/modular/pollack_stevens/distributions.py +874 -0
- sage/modular/pollack_stevens/fund_domain.py +1572 -0
- sage/modular/pollack_stevens/manin_map.py +859 -0
- sage/modular/pollack_stevens/modsym.py +1593 -0
- sage/modular/pollack_stevens/padic_lseries.py +417 -0
- sage/modular/pollack_stevens/sigma0.py +534 -0
- sage/modular/pollack_stevens/space.py +1076 -0
- sage/modular/quasimodform/all.py +3 -0
- sage/modular/quasimodform/element.py +845 -0
- sage/modular/quasimodform/ring.py +828 -0
- sage/modular/quatalg/all.py +3 -0
- sage/modular/quatalg/brandt.py +1642 -0
- sage/modular/ssmod/all.py +8 -0
- sage/modular/ssmod/ssmod.py +827 -0
- sage/rings/all__sagemath_schemes.py +1 -0
- sage/rings/polynomial/all__sagemath_schemes.py +1 -0
- sage/rings/polynomial/binary_form_reduce.py +585 -0
- sage/schemes/all.py +41 -0
- sage/schemes/berkovich/all.py +6 -0
- sage/schemes/berkovich/berkovich_cp_element.py +2582 -0
- sage/schemes/berkovich/berkovich_space.py +748 -0
- sage/schemes/curves/affine_curve.py +2928 -0
- sage/schemes/curves/all.py +33 -0
- sage/schemes/curves/closed_point.py +434 -0
- sage/schemes/curves/constructor.py +381 -0
- sage/schemes/curves/curve.py +542 -0
- sage/schemes/curves/plane_curve_arrangement.py +1283 -0
- sage/schemes/curves/point.py +463 -0
- sage/schemes/curves/projective_curve.py +3026 -0
- sage/schemes/curves/zariski_vankampen.py +1932 -0
- sage/schemes/cyclic_covers/all.py +2 -0
- sage/schemes/cyclic_covers/charpoly_frobenius.py +320 -0
- sage/schemes/cyclic_covers/constructor.py +137 -0
- sage/schemes/cyclic_covers/cycliccover_finite_field.py +1309 -0
- sage/schemes/cyclic_covers/cycliccover_generic.py +310 -0
- sage/schemes/elliptic_curves/BSD.py +1036 -0
- sage/schemes/elliptic_curves/Qcurves.py +592 -0
- sage/schemes/elliptic_curves/addition_formulas_ring.py +94 -0
- sage/schemes/elliptic_curves/all.py +49 -0
- sage/schemes/elliptic_curves/cardinality.py +609 -0
- sage/schemes/elliptic_curves/cm.py +1102 -0
- sage/schemes/elliptic_curves/constructor.py +1552 -0
- sage/schemes/elliptic_curves/ec_database.py +175 -0
- sage/schemes/elliptic_curves/ell_curve_isogeny.py +3972 -0
- sage/schemes/elliptic_curves/ell_egros.py +459 -0
- sage/schemes/elliptic_curves/ell_field.py +2836 -0
- sage/schemes/elliptic_curves/ell_finite_field.py +3359 -0
- sage/schemes/elliptic_curves/ell_generic.py +3760 -0
- sage/schemes/elliptic_curves/ell_local_data.py +1207 -0
- sage/schemes/elliptic_curves/ell_modular_symbols.py +775 -0
- sage/schemes/elliptic_curves/ell_number_field.py +4220 -0
- sage/schemes/elliptic_curves/ell_padic_field.py +107 -0
- sage/schemes/elliptic_curves/ell_point.py +4787 -0
- sage/schemes/elliptic_curves/ell_rational_field.py +7368 -0
- sage/schemes/elliptic_curves/ell_tate_curve.py +671 -0
- sage/schemes/elliptic_curves/ell_torsion.py +436 -0
- sage/schemes/elliptic_curves/ell_wp.py +352 -0
- sage/schemes/elliptic_curves/formal_group.py +760 -0
- sage/schemes/elliptic_curves/gal_reps.py +1459 -0
- sage/schemes/elliptic_curves/gal_reps_number_field.py +1669 -0
- sage/schemes/elliptic_curves/gp_simon.py +152 -0
- sage/schemes/elliptic_curves/heegner.py +7335 -0
- sage/schemes/elliptic_curves/height.py +2109 -0
- sage/schemes/elliptic_curves/hom.py +1406 -0
- sage/schemes/elliptic_curves/hom_composite.py +934 -0
- sage/schemes/elliptic_curves/hom_frobenius.py +522 -0
- sage/schemes/elliptic_curves/hom_scalar.py +531 -0
- sage/schemes/elliptic_curves/hom_sum.py +682 -0
- sage/schemes/elliptic_curves/hom_velusqrt.py +1290 -0
- sage/schemes/elliptic_curves/homset.py +271 -0
- sage/schemes/elliptic_curves/isogeny_class.py +1521 -0
- sage/schemes/elliptic_curves/isogeny_small_degree.py +2797 -0
- sage/schemes/elliptic_curves/jacobian.py +237 -0
- sage/schemes/elliptic_curves/kodaira_symbol.py +344 -0
- sage/schemes/elliptic_curves/kraus.py +1014 -0
- sage/schemes/elliptic_curves/lseries_ell.py +943 -0
- sage/schemes/elliptic_curves/mod5family.py +105 -0
- sage/schemes/elliptic_curves/mod_poly.py +197 -0
- sage/schemes/elliptic_curves/mod_sym_num.cpython-314-darwin.so +0 -0
- sage/schemes/elliptic_curves/mod_sym_num.pyx +3796 -0
- sage/schemes/elliptic_curves/modular_parametrization.py +305 -0
- sage/schemes/elliptic_curves/padic_lseries.py +1793 -0
- sage/schemes/elliptic_curves/padics.py +1816 -0
- sage/schemes/elliptic_curves/period_lattice.py +2234 -0
- sage/schemes/elliptic_curves/period_lattice_region.cpython-314-darwin.so +0 -0
- sage/schemes/elliptic_curves/period_lattice_region.pyx +722 -0
- sage/schemes/elliptic_curves/saturation.py +715 -0
- sage/schemes/elliptic_curves/sha_tate.py +1158 -0
- sage/schemes/elliptic_curves/weierstrass_morphism.py +1117 -0
- sage/schemes/elliptic_curves/weierstrass_transform.py +200 -0
- sage/schemes/hyperelliptic_curves/all.py +6 -0
- sage/schemes/hyperelliptic_curves/constructor.py +291 -0
- sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py +1914 -0
- sage/schemes/hyperelliptic_curves/hyperelliptic_g2.py +192 -0
- sage/schemes/hyperelliptic_curves/hyperelliptic_generic.py +954 -0
- sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py +1332 -0
- sage/schemes/hyperelliptic_curves/hyperelliptic_rational_field.py +84 -0
- sage/schemes/hyperelliptic_curves/invariants.py +410 -0
- sage/schemes/hyperelliptic_curves/jacobian_endomorphism_utils.py +315 -0
- sage/schemes/hyperelliptic_curves/jacobian_g2.py +32 -0
- sage/schemes/hyperelliptic_curves/jacobian_generic.py +419 -0
- sage/schemes/hyperelliptic_curves/jacobian_homset.py +186 -0
- sage/schemes/hyperelliptic_curves/jacobian_morphism.py +875 -0
- sage/schemes/hyperelliptic_curves/kummer_surface.py +99 -0
- sage/schemes/hyperelliptic_curves/mestre.py +302 -0
- sage/schemes/hyperelliptic_curves/monsky_washnitzer.py +3871 -0
- sage/schemes/jacobians/abstract_jacobian.py +277 -0
- sage/schemes/jacobians/all.py +2 -0
- sage/schemes/overview.py +161 -0
- sage/schemes/plane_conics/all.py +22 -0
- sage/schemes/plane_conics/con_field.py +1296 -0
- sage/schemes/plane_conics/con_finite_field.py +158 -0
- sage/schemes/plane_conics/con_number_field.py +456 -0
- sage/schemes/plane_conics/con_rational_field.py +406 -0
- sage/schemes/plane_conics/con_rational_function_field.py +580 -0
- sage/schemes/plane_conics/constructor.py +249 -0
- sage/schemes/plane_quartics/all.py +2 -0
- sage/schemes/plane_quartics/quartic_constructor.py +71 -0
- sage/schemes/plane_quartics/quartic_generic.py +73 -0
- sage/schemes/riemann_surfaces/all.py +1 -0
- sage/schemes/riemann_surfaces/riemann_surface.py +4117 -0
- sage_wheels/share/cremona/cremona_mini.db +0 -0
- sage_wheels/share/ellcurves/rank0 +30427 -0
- sage_wheels/share/ellcurves/rank1 +31871 -0
- sage_wheels/share/ellcurves/rank10 +6 -0
- sage_wheels/share/ellcurves/rank11 +6 -0
- sage_wheels/share/ellcurves/rank12 +1 -0
- sage_wheels/share/ellcurves/rank14 +1 -0
- sage_wheels/share/ellcurves/rank15 +1 -0
- sage_wheels/share/ellcurves/rank17 +1 -0
- sage_wheels/share/ellcurves/rank19 +1 -0
- sage_wheels/share/ellcurves/rank2 +2388 -0
- sage_wheels/share/ellcurves/rank20 +1 -0
- sage_wheels/share/ellcurves/rank21 +1 -0
- sage_wheels/share/ellcurves/rank22 +1 -0
- sage_wheels/share/ellcurves/rank23 +1 -0
- sage_wheels/share/ellcurves/rank24 +1 -0
- sage_wheels/share/ellcurves/rank28 +1 -0
- sage_wheels/share/ellcurves/rank3 +836 -0
- sage_wheels/share/ellcurves/rank4 +10 -0
- sage_wheels/share/ellcurves/rank5 +5 -0
- sage_wheels/share/ellcurves/rank6 +5 -0
- sage_wheels/share/ellcurves/rank7 +5 -0
- sage_wheels/share/ellcurves/rank8 +6 -0
- sage_wheels/share/ellcurves/rank9 +7 -0
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-schemes
|
|
2
|
+
# sage.doctest: needs sage.libs.pari
|
|
3
|
+
"""
|
|
4
|
+
Creating spaces of modular forms
|
|
5
|
+
|
|
6
|
+
EXAMPLES::
|
|
7
|
+
|
|
8
|
+
sage: m = ModularForms(Gamma1(4),11)
|
|
9
|
+
sage: m
|
|
10
|
+
Modular Forms space of dimension 6 for
|
|
11
|
+
Congruence Subgroup Gamma1(4) of weight 11 over Rational Field
|
|
12
|
+
sage: m.basis()
|
|
13
|
+
[q - 134*q^5 + O(q^6),
|
|
14
|
+
q^2 + 80*q^5 + O(q^6),
|
|
15
|
+
q^3 + 16*q^5 + O(q^6),
|
|
16
|
+
q^4 - 4*q^5 + O(q^6),
|
|
17
|
+
1 + 4092/50521*q^2 + 472384/50521*q^3 + 4194300/50521*q^4 + O(q^6),
|
|
18
|
+
q + 1024*q^2 + 59048*q^3 + 1048576*q^4 + 9765626*q^5 + O(q^6)]
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
# ****************************************************************************
|
|
22
|
+
# Copyright (C) 2004-2006 William Stein <wstein@gmail.com>
|
|
23
|
+
#
|
|
24
|
+
# This program is free software: you can redistribute it and/or modify
|
|
25
|
+
# it under the terms of the GNU General Public License as published by
|
|
26
|
+
# the Free Software Foundation, either version 2 of the License, or
|
|
27
|
+
# (at your option) any later version.
|
|
28
|
+
# https://www.gnu.org/licenses/
|
|
29
|
+
# ****************************************************************************
|
|
30
|
+
|
|
31
|
+
import weakref
|
|
32
|
+
import re
|
|
33
|
+
|
|
34
|
+
import sage.modular.arithgroup.all as arithgroup
|
|
35
|
+
import sage.modular.dirichlet as dirichlet
|
|
36
|
+
from sage.rings.integer import Integer
|
|
37
|
+
from sage.rings.rational_field import Q as QQ
|
|
38
|
+
from sage.categories.commutative_rings import CommutativeRings
|
|
39
|
+
|
|
40
|
+
from .ambient_eps import ModularFormsAmbient_eps
|
|
41
|
+
from .ambient_g0 import ModularFormsAmbient_g0_Q
|
|
42
|
+
from .ambient_g1 import ModularFormsAmbient_g1_Q, ModularFormsAmbient_gH_Q
|
|
43
|
+
from . import ambient_R
|
|
44
|
+
from . import defaults
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def canonical_parameters(group, level, weight, base_ring):
|
|
48
|
+
"""
|
|
49
|
+
Given a group, level, weight, and base_ring as input by the user,
|
|
50
|
+
return a canonicalized version of them, where level is a Sage
|
|
51
|
+
integer, group really is a group, weight is a Sage integer, and
|
|
52
|
+
base_ring a Sage ring. Note that we can't just get the level from
|
|
53
|
+
the group, because we have the convention that the character for
|
|
54
|
+
Gamma1(N) is None (which makes good sense).
|
|
55
|
+
|
|
56
|
+
INPUT:
|
|
57
|
+
|
|
58
|
+
- ``group`` -- integer, group, or Dirichlet character
|
|
59
|
+
|
|
60
|
+
- ``level`` -- integer or group
|
|
61
|
+
|
|
62
|
+
- ``weight`` -- coercible to integer
|
|
63
|
+
|
|
64
|
+
- ``base_ring`` -- commutative ring
|
|
65
|
+
|
|
66
|
+
OUTPUT:
|
|
67
|
+
|
|
68
|
+
- ``level`` -- integer
|
|
69
|
+
|
|
70
|
+
- ``group`` -- congruence subgroup
|
|
71
|
+
|
|
72
|
+
- ``weight`` -- integer
|
|
73
|
+
|
|
74
|
+
- ``ring`` -- commutative ring
|
|
75
|
+
|
|
76
|
+
EXAMPLES::
|
|
77
|
+
|
|
78
|
+
sage: from sage.modular.modform.constructor import canonical_parameters
|
|
79
|
+
sage: v = canonical_parameters(5, 5, int(7), ZZ); v
|
|
80
|
+
(5, Congruence Subgroup Gamma0(5), 7, Integer Ring)
|
|
81
|
+
sage: type(v[0]), type(v[1]), type(v[2]), type(v[3])
|
|
82
|
+
(<class 'sage.rings.integer.Integer'>,
|
|
83
|
+
<class 'sage.modular.arithgroup.congroup_gamma0.Gamma0_class_with_category'>,
|
|
84
|
+
<class 'sage.rings.integer.Integer'>,
|
|
85
|
+
<class 'sage.rings.integer_ring.IntegerRing_class'>)
|
|
86
|
+
sage: canonical_parameters( 5, 7, 7, ZZ )
|
|
87
|
+
Traceback (most recent call last):
|
|
88
|
+
...
|
|
89
|
+
ValueError: group and level do not match.
|
|
90
|
+
"""
|
|
91
|
+
weight = Integer(weight)
|
|
92
|
+
if weight <= 0:
|
|
93
|
+
raise NotImplementedError("weight must be at least 1")
|
|
94
|
+
|
|
95
|
+
if isinstance(group, dirichlet.DirichletCharacter):
|
|
96
|
+
if group.level() != Integer(level):
|
|
97
|
+
raise ValueError("group.level() and level do not match.")
|
|
98
|
+
group = group.minimize_base_ring()
|
|
99
|
+
level = Integer(level)
|
|
100
|
+
|
|
101
|
+
elif isinstance(group, arithgroup.CongruenceSubgroupBase):
|
|
102
|
+
if Integer(level) != group.level():
|
|
103
|
+
raise ValueError("group.level() and level do not match.")
|
|
104
|
+
# normalize the case of SL2Z
|
|
105
|
+
if isinstance(group, arithgroup.SL2Z_class) or \
|
|
106
|
+
isinstance(group, arithgroup.Gamma1_class) and group.level() == Integer(1):
|
|
107
|
+
group = arithgroup.Gamma0(Integer(1))
|
|
108
|
+
|
|
109
|
+
elif group is None:
|
|
110
|
+
pass
|
|
111
|
+
|
|
112
|
+
else:
|
|
113
|
+
try:
|
|
114
|
+
m = Integer(group)
|
|
115
|
+
except TypeError:
|
|
116
|
+
raise TypeError("group of unknown type.")
|
|
117
|
+
level = Integer(level)
|
|
118
|
+
if m != level:
|
|
119
|
+
raise ValueError("group and level do not match.")
|
|
120
|
+
group = arithgroup.Gamma0(m)
|
|
121
|
+
|
|
122
|
+
if base_ring not in CommutativeRings():
|
|
123
|
+
raise TypeError("base_ring (=%s) must be a commutative ring" % base_ring)
|
|
124
|
+
|
|
125
|
+
# it is *very* important to include the level as part of the data
|
|
126
|
+
# that defines the key, since Dirichlet characters of different
|
|
127
|
+
# levels can compare equal, but define much different modular
|
|
128
|
+
# forms spaces.
|
|
129
|
+
return level, group, weight, base_ring
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
_cache = {}
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def ModularForms_clear_cache():
|
|
136
|
+
"""
|
|
137
|
+
Clear the cache of modular forms.
|
|
138
|
+
|
|
139
|
+
EXAMPLES::
|
|
140
|
+
|
|
141
|
+
sage: M = ModularForms(37,2)
|
|
142
|
+
sage: sage.modular.modform.constructor._cache == {}
|
|
143
|
+
False
|
|
144
|
+
|
|
145
|
+
::
|
|
146
|
+
|
|
147
|
+
sage: sage.modular.modform.constructor.ModularForms_clear_cache()
|
|
148
|
+
sage: sage.modular.modform.constructor._cache
|
|
149
|
+
{}
|
|
150
|
+
"""
|
|
151
|
+
global _cache
|
|
152
|
+
_cache = {}
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def ModularForms(group=1,
|
|
156
|
+
weight=2,
|
|
157
|
+
base_ring=None,
|
|
158
|
+
eis_only=False,
|
|
159
|
+
use_cache=True,
|
|
160
|
+
prec=defaults.DEFAULT_PRECISION):
|
|
161
|
+
r"""
|
|
162
|
+
Create an ambient space of modular forms.
|
|
163
|
+
|
|
164
|
+
INPUT:
|
|
165
|
+
|
|
166
|
+
- ``group`` -- a congruence subgroup or a Dirichlet character eps
|
|
167
|
+
|
|
168
|
+
- ``weight`` -- integer; the weight (`\geq 1`)
|
|
169
|
+
|
|
170
|
+
- ``base_ring`` -- the base ring (ignored if group is a Dirichlet character)
|
|
171
|
+
|
|
172
|
+
- ``eis_only`` -- if ``True``, compute only the Eisenstein part of the space.
|
|
173
|
+
Only permitted (and only useful) in weight 1, where computing dimensions
|
|
174
|
+
of cusp form spaces is expensive.
|
|
175
|
+
|
|
176
|
+
Create using the command ModularForms(group, weight, base_ring)
|
|
177
|
+
where group could be either a congruence subgroup or a Dirichlet
|
|
178
|
+
character.
|
|
179
|
+
|
|
180
|
+
EXAMPLES: First we create some spaces with trivial character::
|
|
181
|
+
|
|
182
|
+
sage: ModularForms(Gamma0(11),2).dimension()
|
|
183
|
+
2
|
|
184
|
+
sage: ModularForms(Gamma0(1),12).dimension()
|
|
185
|
+
2
|
|
186
|
+
|
|
187
|
+
If we give an integer N for the congruence subgroup, it defaults to
|
|
188
|
+
`\Gamma_0(N)`::
|
|
189
|
+
|
|
190
|
+
sage: ModularForms(1,12).dimension()
|
|
191
|
+
2
|
|
192
|
+
sage: ModularForms(11,4)
|
|
193
|
+
Modular Forms space of dimension 4 for Congruence Subgroup Gamma0(11)
|
|
194
|
+
of weight 4 over Rational Field
|
|
195
|
+
|
|
196
|
+
We create some spaces for `\Gamma_1(N)`.
|
|
197
|
+
|
|
198
|
+
::
|
|
199
|
+
|
|
200
|
+
sage: ModularForms(Gamma1(13),2)
|
|
201
|
+
Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13)
|
|
202
|
+
of weight 2 over Rational Field
|
|
203
|
+
sage: ModularForms(Gamma1(13),2).dimension()
|
|
204
|
+
13
|
|
205
|
+
sage: [ModularForms(Gamma1(7),k).dimension() for k in [2,3,4,5]]
|
|
206
|
+
[5, 7, 9, 11]
|
|
207
|
+
sage: ModularForms(Gamma1(5),11).dimension()
|
|
208
|
+
12
|
|
209
|
+
|
|
210
|
+
We create a space with character::
|
|
211
|
+
|
|
212
|
+
sage: # needs sage.rings.number_field
|
|
213
|
+
sage: e = (DirichletGroup(13).0)^2
|
|
214
|
+
sage: e.order()
|
|
215
|
+
6
|
|
216
|
+
sage: M = ModularForms(e, 2); M
|
|
217
|
+
Modular Forms space of dimension 3, character [zeta6] and weight 2
|
|
218
|
+
over Cyclotomic Field of order 6 and degree 2
|
|
219
|
+
sage: f = M.T(2).charpoly('x'); f
|
|
220
|
+
x^3 + (-2*zeta6 - 2)*x^2 - 2*zeta6*x + 14*zeta6 - 7
|
|
221
|
+
sage: f.factor()
|
|
222
|
+
(x - zeta6 - 2) * (x - 2*zeta6 - 1) * (x + zeta6 + 1)
|
|
223
|
+
|
|
224
|
+
We can also create spaces corresponding to the groups `\Gamma_H(N)` intermediate
|
|
225
|
+
between `\Gamma_0(N)` and `\Gamma_1(N)`::
|
|
226
|
+
|
|
227
|
+
sage: G = GammaH(30, [11])
|
|
228
|
+
sage: M = ModularForms(G, 2); M
|
|
229
|
+
Modular Forms space of dimension 20 for Congruence Subgroup Gamma_H(30)
|
|
230
|
+
with H generated by [11] of weight 2 over Rational Field
|
|
231
|
+
sage: M.T(7).charpoly().factor() # long time (7s on sage.math, 2011)
|
|
232
|
+
(x + 4) * x^2 * (x - 6)^4 * (x + 6)^4 * (x - 8)^7 * (x^2 + 4)
|
|
233
|
+
|
|
234
|
+
More examples of spaces with character::
|
|
235
|
+
|
|
236
|
+
sage: e = DirichletGroup(5, RationalField()).gen(); e
|
|
237
|
+
Dirichlet character modulo 5 of conductor 5 mapping 2 |--> -1
|
|
238
|
+
|
|
239
|
+
sage: m = ModularForms(e, 2); m
|
|
240
|
+
Modular Forms space of dimension 2, character [-1] and weight 2
|
|
241
|
+
over Rational Field
|
|
242
|
+
sage: m == loads(dumps(m))
|
|
243
|
+
True
|
|
244
|
+
sage: m.T(2).charpoly('x')
|
|
245
|
+
x^2 - 1
|
|
246
|
+
sage: m = ModularForms(e, 6); m.dimension()
|
|
247
|
+
4
|
|
248
|
+
sage: m.T(2).charpoly('x')
|
|
249
|
+
x^4 - 917*x^2 - 42284
|
|
250
|
+
|
|
251
|
+
This came up in a subtle bug (:issue:`5923`)::
|
|
252
|
+
|
|
253
|
+
sage: ModularForms(gp(1), gap(12))
|
|
254
|
+
Modular Forms space of dimension 2 for Modular Group SL(2,Z)
|
|
255
|
+
of weight 12 over Rational Field
|
|
256
|
+
|
|
257
|
+
This came up in another bug (related to :issue:`8630`)::
|
|
258
|
+
|
|
259
|
+
sage: chi = DirichletGroup(109, CyclotomicField(3)).0
|
|
260
|
+
sage: ModularForms(chi, 2, base_ring = CyclotomicField(15))
|
|
261
|
+
Modular Forms space of dimension 10, character [zeta3 + 1] and weight 2
|
|
262
|
+
over Cyclotomic Field of order 15 and degree 8
|
|
263
|
+
|
|
264
|
+
We create some weight 1 spaces. Here modular symbol algorithms do not work.
|
|
265
|
+
In some small examples we can prove using Riemann--Roch that there are no
|
|
266
|
+
cusp forms anyway, so the entire space is Eisenstein::
|
|
267
|
+
|
|
268
|
+
sage: M = ModularForms(Gamma1(11), 1); M
|
|
269
|
+
Modular Forms space of dimension 5 for Congruence Subgroup Gamma1(11)
|
|
270
|
+
of weight 1 over Rational Field
|
|
271
|
+
sage: M.basis()
|
|
272
|
+
[1 + 22*q^5 + O(q^6),
|
|
273
|
+
q + 4*q^5 + O(q^6),
|
|
274
|
+
q^2 - 4*q^5 + O(q^6),
|
|
275
|
+
q^3 - 5*q^5 + O(q^6),
|
|
276
|
+
q^4 - 3*q^5 + O(q^6)]
|
|
277
|
+
sage: M.cuspidal_subspace().basis()
|
|
278
|
+
[]
|
|
279
|
+
sage: M == M.eisenstein_subspace()
|
|
280
|
+
True
|
|
281
|
+
|
|
282
|
+
When this does not work (which happens as soon as the level is more than
|
|
283
|
+
about 30), we use the Hecke stability algorithm of George Schaeffer::
|
|
284
|
+
|
|
285
|
+
sage: M = ModularForms(Gamma1(57), 1); M # long time
|
|
286
|
+
Modular Forms space of dimension 38 for Congruence Subgroup Gamma1(57)
|
|
287
|
+
of weight 1 over Rational Field
|
|
288
|
+
sage: M.cuspidal_submodule().basis() # long time
|
|
289
|
+
[q - q^4 + O(q^6), q^3 - q^4 + O(q^6)]
|
|
290
|
+
|
|
291
|
+
The Eisenstein subspace in weight 1 can be computed quickly, without
|
|
292
|
+
triggering the expensive computation of the cuspidal part::
|
|
293
|
+
|
|
294
|
+
sage: E = EisensteinForms(Gamma1(59), 1); E # indirect doctest
|
|
295
|
+
Eisenstein subspace of dimension 29 of Modular Forms space for
|
|
296
|
+
Congruence Subgroup Gamma1(59) of weight 1 over Rational Field
|
|
297
|
+
sage: (E.0 + E.2).q_expansion(40)
|
|
298
|
+
1 + q^2 + 196*q^29 - 197*q^30 - q^31 + q^33 + q^34 + q^37 + q^38 - q^39 + O(q^40)
|
|
299
|
+
"""
|
|
300
|
+
if isinstance(group, dirichlet.DirichletCharacter):
|
|
301
|
+
if base_ring is None:
|
|
302
|
+
base_ring = group.minimize_base_ring().base_ring()
|
|
303
|
+
if base_ring is None:
|
|
304
|
+
base_ring = QQ
|
|
305
|
+
|
|
306
|
+
if isinstance(group, (dirichlet.DirichletCharacter,
|
|
307
|
+
arithgroup.CongruenceSubgroupBase)):
|
|
308
|
+
level = group.level()
|
|
309
|
+
else:
|
|
310
|
+
level = group
|
|
311
|
+
|
|
312
|
+
eis_only = bool(eis_only)
|
|
313
|
+
key = canonical_parameters(group, level, weight, base_ring) + (eis_only,)
|
|
314
|
+
|
|
315
|
+
if eis_only and weight != 1:
|
|
316
|
+
raise ValueError("eis_only parameter only valid in weight 1")
|
|
317
|
+
|
|
318
|
+
if use_cache and key in _cache:
|
|
319
|
+
M = _cache[key]()
|
|
320
|
+
if M is not None:
|
|
321
|
+
M.set_precision(prec)
|
|
322
|
+
return M
|
|
323
|
+
|
|
324
|
+
(level, group, weight, base_ring, eis_only) = key
|
|
325
|
+
|
|
326
|
+
M = None
|
|
327
|
+
if isinstance(group, arithgroup.Gamma0_class):
|
|
328
|
+
M = ModularFormsAmbient_g0_Q(group.level(), weight)
|
|
329
|
+
if base_ring != QQ:
|
|
330
|
+
M = ambient_R.ModularFormsAmbient_R(M, base_ring)
|
|
331
|
+
|
|
332
|
+
elif isinstance(group, arithgroup.Gamma1_class):
|
|
333
|
+
M = ModularFormsAmbient_g1_Q(group.level(), weight, eis_only)
|
|
334
|
+
if base_ring != QQ:
|
|
335
|
+
M = ambient_R.ModularFormsAmbient_R(M, base_ring)
|
|
336
|
+
|
|
337
|
+
elif isinstance(group, arithgroup.GammaH_class):
|
|
338
|
+
M = ModularFormsAmbient_gH_Q(group, weight, eis_only)
|
|
339
|
+
if base_ring != QQ:
|
|
340
|
+
M = ambient_R.ModularFormsAmbient_R(M, base_ring)
|
|
341
|
+
|
|
342
|
+
elif isinstance(group, dirichlet.DirichletCharacter):
|
|
343
|
+
eps = group
|
|
344
|
+
if eps.base_ring().characteristic() != 0:
|
|
345
|
+
# TODO -- implement this
|
|
346
|
+
# Need to add a lift_to_char_0 function for characters,
|
|
347
|
+
# and need to still remember eps.
|
|
348
|
+
raise NotImplementedError("currently the character must be over a ring of characteristic 0.")
|
|
349
|
+
eps = eps.minimize_base_ring()
|
|
350
|
+
if eps.is_trivial():
|
|
351
|
+
return ModularForms(eps.modulus(), weight, base_ring,
|
|
352
|
+
use_cache=use_cache,
|
|
353
|
+
prec=prec)
|
|
354
|
+
M = ModularFormsAmbient_eps(eps, weight, eis_only=eis_only)
|
|
355
|
+
if base_ring != eps.base_ring():
|
|
356
|
+
M = M.base_extend(base_ring) # ambient_R.ModularFormsAmbient_R(M, base_ring)
|
|
357
|
+
|
|
358
|
+
if M is None:
|
|
359
|
+
raise NotImplementedError("computation of requested space of modular forms not defined or implemented")
|
|
360
|
+
|
|
361
|
+
M.set_precision(prec)
|
|
362
|
+
_cache[key] = weakref.ref(M)
|
|
363
|
+
return M
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
def CuspForms(group=1,
|
|
367
|
+
weight=2,
|
|
368
|
+
base_ring=None,
|
|
369
|
+
use_cache=True,
|
|
370
|
+
prec=defaults.DEFAULT_PRECISION):
|
|
371
|
+
"""
|
|
372
|
+
Create a space of cuspidal modular forms.
|
|
373
|
+
|
|
374
|
+
See the documentation for the ModularForms command for a
|
|
375
|
+
description of the input parameters.
|
|
376
|
+
|
|
377
|
+
EXAMPLES::
|
|
378
|
+
|
|
379
|
+
sage: CuspForms(11,2)
|
|
380
|
+
Cuspidal subspace of dimension 1 of Modular Forms space of dimension 2
|
|
381
|
+
for Congruence Subgroup Gamma0(11) of weight 2 over Rational Field
|
|
382
|
+
"""
|
|
383
|
+
return ModularForms(group, weight, base_ring,
|
|
384
|
+
use_cache=use_cache, prec=prec).cuspidal_submodule()
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
def EisensteinForms(group=1,
|
|
388
|
+
weight=2,
|
|
389
|
+
base_ring=None,
|
|
390
|
+
use_cache=True,
|
|
391
|
+
prec=defaults.DEFAULT_PRECISION):
|
|
392
|
+
"""
|
|
393
|
+
Create a space of Eisenstein modular forms.
|
|
394
|
+
|
|
395
|
+
See the documentation for the ModularForms command for a
|
|
396
|
+
description of the input parameters.
|
|
397
|
+
|
|
398
|
+
EXAMPLES::
|
|
399
|
+
|
|
400
|
+
sage: EisensteinForms(11,2)
|
|
401
|
+
Eisenstein subspace of dimension 1 of Modular Forms space of dimension 2
|
|
402
|
+
for Congruence Subgroup Gamma0(11) of weight 2 over Rational Field
|
|
403
|
+
"""
|
|
404
|
+
if weight == 1:
|
|
405
|
+
return ModularForms(group, weight, base_ring,
|
|
406
|
+
use_cache=use_cache, eis_only=True, prec=prec).eisenstein_submodule()
|
|
407
|
+
else:
|
|
408
|
+
return ModularForms(group, weight, base_ring,
|
|
409
|
+
use_cache=use_cache, prec=prec).eisenstein_submodule()
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
def Newforms(group, weight=2, base_ring=None, names=None):
|
|
413
|
+
r"""
|
|
414
|
+
Return a list of the newforms of the given weight and level (or weight,
|
|
415
|
+
level and character). These are calculated as
|
|
416
|
+
`\operatorname{Gal}(\overline{F} / F)`-orbits, where `F` is the given base
|
|
417
|
+
field.
|
|
418
|
+
|
|
419
|
+
INPUT:
|
|
420
|
+
|
|
421
|
+
- ``group`` -- the congruence subgroup of the newform, or a Nebentypus
|
|
422
|
+
character
|
|
423
|
+
|
|
424
|
+
- ``weight`` -- the weight of the newform (default: 2)
|
|
425
|
+
|
|
426
|
+
- ``base_ring`` -- the base ring (defaults to `\QQ` for spaces without
|
|
427
|
+
character, or the base ring of the character otherwise)
|
|
428
|
+
|
|
429
|
+
- ``names`` -- if the newform has coefficients in a number field, a
|
|
430
|
+
generator name must be specified
|
|
431
|
+
|
|
432
|
+
EXAMPLES::
|
|
433
|
+
|
|
434
|
+
sage: Newforms(11, 2)
|
|
435
|
+
[q - 2*q^2 - q^3 + 2*q^4 + q^5 + O(q^6)]
|
|
436
|
+
sage: Newforms(65, names='a')
|
|
437
|
+
[q - q^2 - 2*q^3 - q^4 - q^5 + O(q^6),
|
|
438
|
+
q + a1*q^2 + (a1 + 1)*q^3 + (-2*a1 - 1)*q^4 + q^5 + O(q^6),
|
|
439
|
+
q + a2*q^2 + (-a2 + 1)*q^3 + q^4 - q^5 + O(q^6)]
|
|
440
|
+
|
|
441
|
+
A more complicated example involving both a nontrivial character, and a
|
|
442
|
+
base field that is not minimal for that character::
|
|
443
|
+
|
|
444
|
+
sage: K.<i> = QuadraticField(-1)
|
|
445
|
+
sage: chi = DirichletGroup(5, K)[1]
|
|
446
|
+
sage: len(Newforms(chi, 7, names='a'))
|
|
447
|
+
1
|
|
448
|
+
sage: x = polygen(K); L.<c> = K.extension(x^2 - 402*i)
|
|
449
|
+
sage: N = Newforms(chi, 7, base_ring = L); len(N)
|
|
450
|
+
2
|
|
451
|
+
sage: sorted([N[0][2], N[1][2]]) == sorted([1/2*c - 5/2*i - 5/2, -1/2*c - 5/2*i - 5/2])
|
|
452
|
+
True
|
|
453
|
+
|
|
454
|
+
TESTS:
|
|
455
|
+
|
|
456
|
+
We test that :issue:`8630` is fixed::
|
|
457
|
+
|
|
458
|
+
sage: chi = DirichletGroup(109, CyclotomicField(3)).0
|
|
459
|
+
sage: CuspForms(chi, 2, base_ring = CyclotomicField(9))
|
|
460
|
+
Cuspidal subspace of dimension 8 of Modular Forms space of dimension 10,
|
|
461
|
+
character [zeta3 + 1] and weight 2 over Cyclotomic Field of order 9 and degree 6
|
|
462
|
+
|
|
463
|
+
Check that :issue:`15486` is fixed (this used to take over a day)::
|
|
464
|
+
|
|
465
|
+
sage: N = Newforms(719, names='a'); len(N) # long time (3 s)
|
|
466
|
+
3
|
|
467
|
+
"""
|
|
468
|
+
return CuspForms(group, weight, base_ring).newforms(names)
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
def Newform(identifier, group=None, weight=2, base_ring=QQ, names=None):
|
|
472
|
+
"""
|
|
473
|
+
INPUT:
|
|
474
|
+
|
|
475
|
+
- ``identifier`` -- a canonical label, or the index of
|
|
476
|
+
the specific newform desired
|
|
477
|
+
|
|
478
|
+
- ``group`` -- the congruence subgroup of the newform
|
|
479
|
+
|
|
480
|
+
- ``weight`` -- the weight of the newform (default: 2)
|
|
481
|
+
|
|
482
|
+
- ``base_ring`` -- the base ring
|
|
483
|
+
|
|
484
|
+
- ``names`` -- if the newform has coefficients in a
|
|
485
|
+
number field, a generator name must be specified
|
|
486
|
+
|
|
487
|
+
EXAMPLES::
|
|
488
|
+
|
|
489
|
+
sage: Newform('67a', names='a')
|
|
490
|
+
q + 2*q^2 - 2*q^3 + 2*q^4 + 2*q^5 + O(q^6)
|
|
491
|
+
sage: Newform('67b', names='a')
|
|
492
|
+
q + a1*q^2 + (-a1 - 3)*q^3 + (-3*a1 - 3)*q^4 - 3*q^5 + O(q^6)
|
|
493
|
+
"""
|
|
494
|
+
if isinstance(group, str) and names is None:
|
|
495
|
+
names = group
|
|
496
|
+
if isinstance(identifier, str):
|
|
497
|
+
group, identifier = parse_label(identifier)
|
|
498
|
+
if weight != 2:
|
|
499
|
+
raise ValueError("Canonical label not implemented for higher weight forms.")
|
|
500
|
+
elif base_ring != QQ:
|
|
501
|
+
raise ValueError("Canonical label not implemented except for over Q.")
|
|
502
|
+
elif group is None:
|
|
503
|
+
raise ValueError("Must specify a group or a label.")
|
|
504
|
+
return Newforms(group, weight, base_ring, names=names)[identifier]
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
def parse_label(s):
|
|
508
|
+
"""
|
|
509
|
+
Given a string s corresponding to a newform label, return the
|
|
510
|
+
corresponding group and index.
|
|
511
|
+
|
|
512
|
+
EXAMPLES::
|
|
513
|
+
|
|
514
|
+
sage: sage.modular.modform.constructor.parse_label('11a')
|
|
515
|
+
(Congruence Subgroup Gamma0(11), 0)
|
|
516
|
+
sage: sage.modular.modform.constructor.parse_label('11aG1')
|
|
517
|
+
(Congruence Subgroup Gamma1(11), 0)
|
|
518
|
+
sage: sage.modular.modform.constructor.parse_label('11wG1')
|
|
519
|
+
(Congruence Subgroup Gamma1(11), 22)
|
|
520
|
+
|
|
521
|
+
GammaH labels should also return the group and index (:issue:`20823`)::
|
|
522
|
+
|
|
523
|
+
sage: sage.modular.modform.constructor.parse_label('389cGH[16]')
|
|
524
|
+
(Congruence Subgroup Gamma_H(389) with H generated by [16], 2)
|
|
525
|
+
"""
|
|
526
|
+
m = re.match(r'(\d+)([a-z]+)((?:G.*)?)$', s)
|
|
527
|
+
if not m:
|
|
528
|
+
raise ValueError("Invalid label: %s" % s)
|
|
529
|
+
N, order, G = m.groups()
|
|
530
|
+
N = int(N)
|
|
531
|
+
index = 0
|
|
532
|
+
for c in reversed(order):
|
|
533
|
+
index = 26*index + ord(c)-ord('a')
|
|
534
|
+
if G == '' or G == 'G0':
|
|
535
|
+
G = arithgroup.Gamma0(N)
|
|
536
|
+
elif G == 'G1':
|
|
537
|
+
G = arithgroup.Gamma1(N)
|
|
538
|
+
elif G[:2] == 'GH':
|
|
539
|
+
if G[2] != '[' or G[-1] != ']':
|
|
540
|
+
raise ValueError("Invalid congruence subgroup label: %s" % G)
|
|
541
|
+
gens = [int(g.strip()) for g in G[3:-1].split(',')]
|
|
542
|
+
return arithgroup.GammaH(N, gens), index
|
|
543
|
+
else:
|
|
544
|
+
raise ValueError("Invalid congruence subgroup label: %s" % G)
|
|
545
|
+
return G, index
|