passagemath-repl 10.4.62__py3-none-any.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.
- passagemath_repl-10.4.62.data/scripts/sage-cachegrind +25 -0
- passagemath_repl-10.4.62.data/scripts/sage-callgrind +16 -0
- passagemath_repl-10.4.62.data/scripts/sage-cleaner +230 -0
- passagemath_repl-10.4.62.data/scripts/sage-coverage +327 -0
- passagemath_repl-10.4.62.data/scripts/sage-eval +14 -0
- passagemath_repl-10.4.62.data/scripts/sage-fixdoctests +708 -0
- passagemath_repl-10.4.62.data/scripts/sage-inline-fortran +12 -0
- passagemath_repl-10.4.62.data/scripts/sage-ipynb2rst +50 -0
- passagemath_repl-10.4.62.data/scripts/sage-ipython +16 -0
- passagemath_repl-10.4.62.data/scripts/sage-massif +25 -0
- passagemath_repl-10.4.62.data/scripts/sage-notebook +267 -0
- passagemath_repl-10.4.62.data/scripts/sage-omega +25 -0
- passagemath_repl-10.4.62.data/scripts/sage-preparse +302 -0
- passagemath_repl-10.4.62.data/scripts/sage-run +27 -0
- passagemath_repl-10.4.62.data/scripts/sage-run-cython +10 -0
- passagemath_repl-10.4.62.data/scripts/sage-runtests +9 -0
- passagemath_repl-10.4.62.data/scripts/sage-startuptime.py +163 -0
- passagemath_repl-10.4.62.data/scripts/sage-valgrind +34 -0
- passagemath_repl-10.4.62.dist-info/METADATA +77 -0
- passagemath_repl-10.4.62.dist-info/RECORD +162 -0
- passagemath_repl-10.4.62.dist-info/WHEEL +5 -0
- passagemath_repl-10.4.62.dist-info/top_level.txt +1 -0
- sage/all__sagemath_repl.py +119 -0
- sage/doctest/__init__.py +4 -0
- sage/doctest/__main__.py +236 -0
- sage/doctest/all.py +4 -0
- sage/doctest/check_tolerance.py +261 -0
- sage/doctest/control.py +1727 -0
- sage/doctest/external.py +534 -0
- sage/doctest/fixtures.py +383 -0
- sage/doctest/forker.py +2665 -0
- sage/doctest/marked_output.py +102 -0
- sage/doctest/parsing.py +1708 -0
- sage/doctest/parsing_test.py +79 -0
- sage/doctest/reporting.py +733 -0
- sage/doctest/rif_tol.py +124 -0
- sage/doctest/sources.py +1657 -0
- sage/doctest/test.py +584 -0
- sage/doctest/tests/1second.rst +4 -0
- sage/doctest/tests/99seconds.rst +4 -0
- sage/doctest/tests/abort.rst +5 -0
- sage/doctest/tests/atexit.rst +7 -0
- sage/doctest/tests/fail_and_die.rst +6 -0
- sage/doctest/tests/initial.rst +15 -0
- sage/doctest/tests/interrupt.rst +7 -0
- sage/doctest/tests/interrupt_diehard.rst +14 -0
- sage/doctest/tests/keyboardinterrupt.rst +11 -0
- sage/doctest/tests/longtime.rst +5 -0
- sage/doctest/tests/nodoctest +5 -0
- sage/doctest/tests/random_seed.rst +4 -0
- sage/doctest/tests/show_skipped.rst +18 -0
- sage/doctest/tests/sig_on.rst +9 -0
- sage/doctest/tests/simple_failure.rst +8 -0
- sage/doctest/tests/sleep_and_raise.rst +106 -0
- sage/doctest/tests/tolerance.rst +31 -0
- sage/doctest/util.py +750 -0
- sage/interfaces/cleaner.py +48 -0
- sage/interfaces/quit.py +163 -0
- sage/misc/all__sagemath_repl.py +51 -0
- sage/misc/banner.py +235 -0
- sage/misc/benchmark.py +221 -0
- sage/misc/classgraph.py +131 -0
- sage/misc/copying.py +22 -0
- sage/misc/cython.py +694 -0
- sage/misc/dev_tools.py +745 -0
- sage/misc/edit_module.py +304 -0
- sage/misc/explain_pickle.py +3079 -0
- sage/misc/gperftools.py +361 -0
- sage/misc/inline_fortran.py +212 -0
- sage/misc/messaging.py +86 -0
- sage/misc/pager.py +21 -0
- sage/misc/profiler.py +179 -0
- sage/misc/python.py +70 -0
- sage/misc/remote_file.py +53 -0
- sage/misc/sage_eval.py +246 -0
- sage/misc/sage_input.py +3621 -0
- sage/misc/sagedoc.py +1742 -0
- sage/misc/sh.py +38 -0
- sage/misc/trace.py +90 -0
- sage/repl/__init__.py +16 -0
- sage/repl/all.py +15 -0
- sage/repl/attach.py +625 -0
- sage/repl/configuration.py +186 -0
- sage/repl/display/__init__.py +1 -0
- sage/repl/display/fancy_repr.py +354 -0
- sage/repl/display/formatter.py +318 -0
- sage/repl/display/jsmol_iframe.py +290 -0
- sage/repl/display/pretty_print.py +153 -0
- sage/repl/display/util.py +163 -0
- sage/repl/image.py +302 -0
- sage/repl/inputhook.py +91 -0
- sage/repl/interface_magic.py +298 -0
- sage/repl/interpreter.py +854 -0
- sage/repl/ipython_extension.py +593 -0
- sage/repl/ipython_kernel/__init__.py +1 -0
- sage/repl/ipython_kernel/__main__.py +4 -0
- sage/repl/ipython_kernel/all_jupyter.py +10 -0
- sage/repl/ipython_kernel/install.py +301 -0
- sage/repl/ipython_kernel/interact.py +278 -0
- sage/repl/ipython_kernel/kernel.py +217 -0
- sage/repl/ipython_kernel/widgets.py +466 -0
- sage/repl/ipython_kernel/widgets_sagenb.py +587 -0
- sage/repl/ipython_tests.py +163 -0
- sage/repl/load.py +326 -0
- sage/repl/preparse.py +2218 -0
- sage/repl/prompts.py +90 -0
- sage/repl/rich_output/__init__.py +4 -0
- sage/repl/rich_output/backend_base.py +648 -0
- sage/repl/rich_output/backend_doctest.py +316 -0
- sage/repl/rich_output/backend_emacs.py +151 -0
- sage/repl/rich_output/backend_ipython.py +596 -0
- sage/repl/rich_output/buffer.py +311 -0
- sage/repl/rich_output/display_manager.py +829 -0
- sage/repl/rich_output/example.avi +0 -0
- sage/repl/rich_output/example.canvas3d +1 -0
- sage/repl/rich_output/example.dvi +0 -0
- sage/repl/rich_output/example.flv +0 -0
- sage/repl/rich_output/example.gif +0 -0
- sage/repl/rich_output/example.jpg +0 -0
- sage/repl/rich_output/example.mkv +0 -0
- sage/repl/rich_output/example.mov +0 -0
- sage/repl/rich_output/example.mp4 +0 -0
- sage/repl/rich_output/example.ogv +0 -0
- sage/repl/rich_output/example.pdf +0 -0
- sage/repl/rich_output/example.png +0 -0
- sage/repl/rich_output/example.svg +54 -0
- sage/repl/rich_output/example.webm +0 -0
- sage/repl/rich_output/example.wmv +0 -0
- sage/repl/rich_output/example_jmol.spt.zip +0 -0
- sage/repl/rich_output/example_wavefront_scene.mtl +7 -0
- sage/repl/rich_output/example_wavefront_scene.obj +17 -0
- sage/repl/rich_output/output_basic.py +391 -0
- sage/repl/rich_output/output_browser.py +103 -0
- sage/repl/rich_output/output_catalog.py +54 -0
- sage/repl/rich_output/output_graphics.py +320 -0
- sage/repl/rich_output/output_graphics3d.py +345 -0
- sage/repl/rich_output/output_video.py +231 -0
- sage/repl/rich_output/preferences.py +432 -0
- sage/repl/rich_output/pretty_print.py +339 -0
- sage/repl/rich_output/test_backend.py +201 -0
- sage/repl/user_globals.py +214 -0
- sage/tests/__init__.py +1 -0
- sage/tests/all.py +3 -0
- sage/tests/article_heuberger_krenn_kropf_fsm-in-sage.py +630 -0
- sage/tests/arxiv_0812_2725.py +351 -0
- sage/tests/benchmark.py +1923 -0
- sage/tests/book_schilling_zabrocki_kschur_primer.py +795 -0
- sage/tests/book_stein_ent.py +651 -0
- sage/tests/book_stein_modform.py +558 -0
- sage/tests/cmdline.py +790 -0
- sage/tests/combinatorial_hopf_algebras.py +52 -0
- sage/tests/finite_poset.py +623 -0
- sage/tests/functools_partial_src.py +27 -0
- sage/tests/gosper-sum.py +218 -0
- sage/tests/lazy_imports.py +28 -0
- sage/tests/modular_group_cohomology.py +80 -0
- sage/tests/numpy.py +21 -0
- sage/tests/parigp.py +76 -0
- sage/tests/startup.py +27 -0
- sage/tests/symbolic-series.py +76 -0
- sage/tests/sympy.py +16 -0
- sage/tests/test_deprecation.py +31 -0
@@ -0,0 +1,558 @@
|
|
1
|
+
# sage_setup: distribution = sagemath-repl
|
2
|
+
# sage.doctest: needs sage.libs.flint sage.modular
|
3
|
+
"""
|
4
|
+
This file contains a bunch of tests extracted from the published book
|
5
|
+
'Modular Forms: a Computational Approach' by William Stein, AMS 2007.
|
6
|
+
|
7
|
+
TESTS::
|
8
|
+
|
9
|
+
sage: # needs sage.libs.gap
|
10
|
+
sage: G = SL(2,ZZ); G
|
11
|
+
Special Linear Group of degree 2 over Integer Ring
|
12
|
+
sage: S, T = G.gens()
|
13
|
+
sage: S
|
14
|
+
[ 0 1]
|
15
|
+
[-1 0]
|
16
|
+
sage: T
|
17
|
+
[1 1]
|
18
|
+
[0 1]
|
19
|
+
|
20
|
+
sage: delta_qexp(6)
|
21
|
+
q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 + O(q^6)
|
22
|
+
sage: bernoulli(12)
|
23
|
+
-691/2730
|
24
|
+
sage: bernoulli(50)
|
25
|
+
495057205241079648212477525/66
|
26
|
+
sage: len(str(bernoulli(10000)))
|
27
|
+
27706
|
28
|
+
sage: E4 = eisenstein_series_qexp(4, 3)
|
29
|
+
sage: E6 = eisenstein_series_qexp(6, 3)
|
30
|
+
sage: E4^6
|
31
|
+
1/191102976000000 + 1/132710400000*q + 203/44236800000*q^2 + O(q^3)
|
32
|
+
sage: E4^3*E6^2
|
33
|
+
1/3511517184000 - 1/12192768000*q - 377/4064256000*q^2 + O(q^3)
|
34
|
+
sage: E6^4
|
35
|
+
1/64524128256 - 1/32006016*q + 241/10668672*q^2 + O(q^3)
|
36
|
+
sage: victor_miller_basis(28,5)
|
37
|
+
[
|
38
|
+
1 + 15590400*q^3 + 36957286800*q^4 + O(q^5),
|
39
|
+
q + 151740*q^3 + 61032448*q^4 + O(q^5),
|
40
|
+
q^2 + 192*q^3 - 8280*q^4 + O(q^5)
|
41
|
+
]
|
42
|
+
sage: R.<q> = QQ[['q']]
|
43
|
+
sage: F4 = 240 * eisenstein_series_qexp(4,3)
|
44
|
+
sage: F6 = -504 * eisenstein_series_qexp(6,3)
|
45
|
+
sage: F4^3
|
46
|
+
1 + 720*q + 179280*q^2 + O(q^3)
|
47
|
+
sage: Delta = (F4^3 - F6^2)/1728; Delta
|
48
|
+
q - 24*q^2 + O(q^3)
|
49
|
+
sage: F4^3 - 720*Delta
|
50
|
+
1 + 196560*q^2 + O(q^3)
|
51
|
+
sage: M = ModularForms(1,36, prec=6).echelon_form()
|
52
|
+
sage: M.basis()
|
53
|
+
[
|
54
|
+
1 + 6218175600*q^4 + 15281788354560*q^5 + O(q^6),
|
55
|
+
q + 57093088*q^4 + 37927345230*q^5 + O(q^6),
|
56
|
+
q^2 + 194184*q^4 + 7442432*q^5 + O(q^6),
|
57
|
+
q^3 - 72*q^4 + 2484*q^5 + O(q^6)
|
58
|
+
]
|
59
|
+
sage: T2 = M.hecke_matrix(2); T2
|
60
|
+
[ 34359738369 0 6218175600 9026867482214400]
|
61
|
+
[ 0 0 34416831456 5681332472832]
|
62
|
+
[ 0 1 194184 -197264484]
|
63
|
+
[ 0 0 -72 -54528]
|
64
|
+
sage: T2.charpoly().factor()
|
65
|
+
(x - 34359738369) * (x^3 - 139656*x^2 - 59208339456*x - 1467625047588864)
|
66
|
+
sage: bernoulli_mod_p(23)
|
67
|
+
[1, 4, 13, 17, 13, 6, 10, 5, 10, 9, 15]
|
68
|
+
sage: set_modsym_print_mode ('modular')
|
69
|
+
sage: M = ModularSymbols(11, 2)
|
70
|
+
sage: M.basis()
|
71
|
+
({Infinity, 0}, {-1/8, 0}, {-1/9, 0})
|
72
|
+
sage: S = M.cuspidal_submodule()
|
73
|
+
sage: S.integral_basis() # basis over ZZ.
|
74
|
+
({-1/8, 0}, {-1/9, 0})
|
75
|
+
sage: set_modsym_print_mode ('manin') # set it back
|
76
|
+
sage: continued_fraction(4/7).convergents()
|
77
|
+
[0, 1, 1/2, 4/7]
|
78
|
+
sage: M = ModularSymbols(2,2)
|
79
|
+
sage: M
|
80
|
+
Modular Symbols space of dimension 1 for Gamma_0(2)
|
81
|
+
of weight 2 with sign 0 over Rational Field
|
82
|
+
sage: M.manin_generators()
|
83
|
+
[(0,1), (1,0), (1,1)]
|
84
|
+
|
85
|
+
sage: M = ModularSymbols(3,2)
|
86
|
+
sage: M.manin_generators()
|
87
|
+
[(0,1), (1,0), (1,1), (1,2)]
|
88
|
+
|
89
|
+
sage: M = ModularSymbols(6,2)
|
90
|
+
sage: M.manin_generators()
|
91
|
+
[(0,1), (1,0), (1,1), (1,2), (1,3), (1,4), (1,5), (2,1),
|
92
|
+
(2,3), (2,5), (3,1), (3,2)]
|
93
|
+
sage: M = ModularSymbols(2,2)
|
94
|
+
sage: [x.lift_to_sl2z(2) for x in M.manin_generators()]
|
95
|
+
[[1, 0, 0, 1], [0, -1, 1, 0], [1, 0, 1, 1]]
|
96
|
+
sage: M = ModularSymbols(6,2)
|
97
|
+
sage: x = M.manin_generators()[9]
|
98
|
+
sage: x
|
99
|
+
(2,5)
|
100
|
+
sage: x.lift_to_sl2z(6)
|
101
|
+
[1, 2, 2, 5]
|
102
|
+
sage: M = ModularSymbols(2,2)
|
103
|
+
sage: M.manin_basis()
|
104
|
+
[1]
|
105
|
+
sage: [M.manin_generators()[i] for i in M.manin_basis()]
|
106
|
+
[(1,0)]
|
107
|
+
sage: M = ModularSymbols(6,2)
|
108
|
+
sage: M.manin_basis()
|
109
|
+
[1, 10, 11]
|
110
|
+
sage: [M.manin_generators()[i] for i in M.manin_basis()]
|
111
|
+
[(1,0), (3,1), (3,2)]
|
112
|
+
sage: M.basis()
|
113
|
+
((1,0), (3,1), (3,2))
|
114
|
+
sage: [x.modular_symbol_rep() for x in M.basis()]
|
115
|
+
[{Infinity, 0}, {0, 1/3}, {-1/2, -1/3}]
|
116
|
+
sage: M = ModularSymbols(2,2)
|
117
|
+
sage: M.manin_gens_to_basis()
|
118
|
+
[-1]
|
119
|
+
[ 1]
|
120
|
+
[ 0]
|
121
|
+
sage: M = ModularSymbols(2,2)
|
122
|
+
sage: x = (1,0); M(x)
|
123
|
+
(1,0)
|
124
|
+
sage: M( (3,1) ) # entries are reduced modulo 2 first
|
125
|
+
0
|
126
|
+
sage: M( (10,19) )
|
127
|
+
-(1,0)
|
128
|
+
sage: M = ModularSymbols(6,2)
|
129
|
+
sage: M.manin_gens_to_basis()
|
130
|
+
[-1 0 0]
|
131
|
+
[ 1 0 0]
|
132
|
+
[ 0 0 0]
|
133
|
+
[ 0 -1 1]
|
134
|
+
[ 0 -1 0]
|
135
|
+
[ 0 -1 1]
|
136
|
+
[ 0 0 0]
|
137
|
+
[ 0 1 -1]
|
138
|
+
[ 0 0 -1]
|
139
|
+
[ 0 1 -1]
|
140
|
+
[ 0 1 0]
|
141
|
+
[ 0 0 1]
|
142
|
+
sage: M = ModularSymbols(6,2)
|
143
|
+
sage: M((0,1))
|
144
|
+
-(1,0)
|
145
|
+
sage: M((1,2))
|
146
|
+
-(3,1) + (3,2)
|
147
|
+
sage: HeilbronnCremona(2).to_list()
|
148
|
+
[[1, 0, 0, 2], [2, 0, 0, 1], [2, 1, 0, 1], [1, 0, 1, 2]]
|
149
|
+
sage: HeilbronnCremona(3).to_list()
|
150
|
+
[[1, 0, 0, 3], [3, 1, 0, 1], [1, 0, 1, 3], [3, 0, 0, 1],
|
151
|
+
[3, -1, 0, 1], [-1, 0, 1, -3]]
|
152
|
+
sage: HeilbronnCremona(5).to_list()
|
153
|
+
[[1, 0, 0, 5], [5, 2, 0, 1], [2, 1, 1, 3], [1, 0, 3, 5],
|
154
|
+
[5, 1, 0, 1], [1, 0, 1, 5], [5, 0, 0, 1], [5, -1, 0, 1],
|
155
|
+
[-1, 0, 1, -5], [5, -2, 0, 1], [-2, 1, 1, -3],
|
156
|
+
[1, 0, -3, 5]]
|
157
|
+
sage: len(HeilbronnCremona(37))
|
158
|
+
128
|
159
|
+
sage: len(HeilbronnCremona(389))
|
160
|
+
1892
|
161
|
+
sage: len(HeilbronnCremona(2003))
|
162
|
+
11662
|
163
|
+
sage: M = ModularSymbols(2,2)
|
164
|
+
sage: M.T(2).matrix()
|
165
|
+
[1]
|
166
|
+
sage: M = ModularSymbols(6, 2)
|
167
|
+
sage: M.T(2).matrix()
|
168
|
+
[ 2 1 -1]
|
169
|
+
[-1 0 1]
|
170
|
+
[-1 -1 2]
|
171
|
+
sage: M.T(3).matrix()
|
172
|
+
[3 2 0]
|
173
|
+
[0 1 0]
|
174
|
+
[2 2 1]
|
175
|
+
sage: M.T(3).fcp() # factored characteristic polynomial
|
176
|
+
(x - 3) * (x - 1)^2
|
177
|
+
sage: M = ModularSymbols(39, 2)
|
178
|
+
sage: T2 = M.T(2)
|
179
|
+
sage: T2.matrix()
|
180
|
+
[ 3 0 -1 0 0 1 1 -1 0]
|
181
|
+
[ 0 0 2 0 -1 1 0 1 -1]
|
182
|
+
[ 0 1 0 -1 1 1 0 1 -1]
|
183
|
+
[ 0 0 1 0 0 1 0 1 -1]
|
184
|
+
[ 0 -1 2 0 0 1 0 1 -1]
|
185
|
+
[ 0 0 1 1 0 1 1 -1 0]
|
186
|
+
[ 0 0 0 -1 0 1 1 2 0]
|
187
|
+
[ 0 0 0 1 0 0 2 0 1]
|
188
|
+
[ 0 0 -1 0 0 0 1 0 2]
|
189
|
+
sage: T2.fcp() # factored characteristic polynomial
|
190
|
+
(x - 1)^2 * (x - 3)^3 * (x^2 + 2*x - 1)^2
|
191
|
+
sage: T2 = M.T(2).matrix()
|
192
|
+
sage: T5 = M.T(5).matrix()
|
193
|
+
sage: T2*T5 - T5*T2 == 0
|
194
|
+
True
|
195
|
+
sage: T5.charpoly().factor()
|
196
|
+
(x - 2)^2 * (x - 6)^3 * (x^2 - 8)^2
|
197
|
+
sage: M = ModularSymbols(39, 2)
|
198
|
+
sage: M.T(2).decomposition()
|
199
|
+
[
|
200
|
+
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 9 for Gamma_0(39) of weight 2 with sign 0 over Rational Field,
|
201
|
+
Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension 9 for Gamma_0(39) of weight 2 with sign 0 over Rational Field,
|
202
|
+
Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension 9 for Gamma_0(39) of weight 2 with sign 0 over Rational Field
|
203
|
+
]
|
204
|
+
sage: M = ModularSymbols(2, 2)
|
205
|
+
sage: M.boundary_map()
|
206
|
+
Hecke module morphism boundary map defined by the matrix
|
207
|
+
[ 1 -1]
|
208
|
+
Domain: Modular Symbols space of dimension 1 for
|
209
|
+
Gamma_0(2) of weight ...
|
210
|
+
Codomain: Space of Boundary Modular Symbols for
|
211
|
+
Congruence Subgroup Gamma0(2) ...
|
212
|
+
sage: M.cuspidal_submodule()
|
213
|
+
Modular Symbols subspace of dimension 0 of Modular
|
214
|
+
Symbols space of dimension 1 for Gamma_0(2) of weight
|
215
|
+
2 with sign 0 over Rational Field
|
216
|
+
sage: M = ModularSymbols(11, 2)
|
217
|
+
sage: M.boundary_map().matrix()
|
218
|
+
[ 1 -1]
|
219
|
+
[ 0 0]
|
220
|
+
[ 0 0]
|
221
|
+
sage: M.cuspidal_submodule()
|
222
|
+
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
|
223
|
+
sage: S = M.cuspidal_submodule(); S
|
224
|
+
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
|
225
|
+
sage: S.basis()
|
226
|
+
((1,8), (1,9))
|
227
|
+
sage: S.T(2).matrix()
|
228
|
+
[-2 0]
|
229
|
+
[ 0 -2]
|
230
|
+
sage: S.T(3).matrix()
|
231
|
+
[-1 0]
|
232
|
+
[ 0 -1]
|
233
|
+
sage: S.T(5).matrix()
|
234
|
+
[1 0]
|
235
|
+
[0 1]
|
236
|
+
sage: E = EllipticCurve([0,-1,1,-10,-20])
|
237
|
+
sage: 2 + 1 - E.Np(2)
|
238
|
+
-2
|
239
|
+
sage: 3 + 1 - E.Np(3)
|
240
|
+
-1
|
241
|
+
sage: 5 + 1 - E.Np(5)
|
242
|
+
1
|
243
|
+
sage: 7 + 1 - E.Np(7)
|
244
|
+
-2
|
245
|
+
sage: [S.T(p).matrix()[0,0] for p in [2,3,5,7]]
|
246
|
+
[-2, -1, 1, -2]
|
247
|
+
sage: M = ModularSymbols(11); M.basis()
|
248
|
+
((1,0), (1,8), (1,9))
|
249
|
+
sage: S = M.cuspidal_submodule(); S
|
250
|
+
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
|
251
|
+
sage: S.T(2).matrix()
|
252
|
+
[-2 0]
|
253
|
+
[ 0 -2]
|
254
|
+
sage: S.T(3).matrix()
|
255
|
+
[-1 0]
|
256
|
+
[ 0 -1]
|
257
|
+
sage: M = ModularSymbols(33)
|
258
|
+
sage: S = M.cuspidal_submodule(); S
|
259
|
+
Modular Symbols subspace of dimension 6 of Modular
|
260
|
+
Symbols space of dimension 9 for Gamma_0(33) of weight
|
261
|
+
2 with sign 0 over Rational Field
|
262
|
+
sage: R.<q> = PowerSeriesRing(QQ)
|
263
|
+
sage: v = [S.T(n).matrix()[0,0] for n in range(1,6)]
|
264
|
+
sage: f00 = sum(v[n-1]*q^n for n in range(1,6)) + O(q^6)
|
265
|
+
sage: f00
|
266
|
+
q - q^2 - q^3 + q^4 + O(q^6)
|
267
|
+
sage: v = [S.T(n).matrix()[0,1] for n in range(1,6)]
|
268
|
+
sage: f01 = sum(v[n-1]*q^n for n in range(1,6)) + O(q^6)
|
269
|
+
sage: f01
|
270
|
+
-2*q^3 + O(q^6)
|
271
|
+
sage: v = [S.T(n).matrix()[1,0] for n in range(1,6)]
|
272
|
+
sage: f10 = sum(v[n-1]*q^n for n in range(1,6)) + O(q^6)
|
273
|
+
sage: f10
|
274
|
+
q^3 + O(q^6)
|
275
|
+
sage: v = [S.T(n).matrix()[1,1] for n in range(1,6)]
|
276
|
+
sage: f11 = sum(v[n-1]*q^n for n in range(1,6)) + O(q^6)
|
277
|
+
sage: f11
|
278
|
+
q - 2*q^2 + 2*q^4 + q^5 + O(q^6)
|
279
|
+
sage: M = ModularSymbols(23)
|
280
|
+
sage: S = M.cuspidal_submodule()
|
281
|
+
sage: S
|
282
|
+
Modular Symbols subspace of dimension 4 of Modular
|
283
|
+
Symbols space of dimension 5 for Gamma_0(23) of weight
|
284
|
+
2 with sign 0 over Rational Field
|
285
|
+
sage: f = S.q_expansion_cuspforms(6)
|
286
|
+
sage: f(0,0)
|
287
|
+
q - 2/3*q^2 + 1/3*q^3 - 1/3*q^4 - 4/3*q^5 + O(q^6)
|
288
|
+
sage: f(0,1)
|
289
|
+
O(q^6)
|
290
|
+
sage: f(1,0)
|
291
|
+
-1/3*q^2 + 2/3*q^3 + 1/3*q^4 - 2/3*q^5 + O(q^6)
|
292
|
+
sage: S.q_expansion_basis(6)
|
293
|
+
[
|
294
|
+
q - q^3 - q^4 + O(q^6),
|
295
|
+
q^2 - 2*q^3 - q^4 + 2*q^5 + O(q^6)
|
296
|
+
]
|
297
|
+
sage: R = Integers(49)
|
298
|
+
sage: R
|
299
|
+
Ring of integers modulo 49
|
300
|
+
sage: R.unit_gens()
|
301
|
+
(3,)
|
302
|
+
sage: Integers(25).unit_gens()
|
303
|
+
(2,)
|
304
|
+
sage: Integers(100).unit_gens()
|
305
|
+
(51, 77)
|
306
|
+
sage: Integers(200).unit_gens()
|
307
|
+
(151, 101, 177)
|
308
|
+
sage: Integers(2005).unit_gens()
|
309
|
+
(402, 1206)
|
310
|
+
sage: Integers(200000000).unit_gens()
|
311
|
+
(174218751, 51562501, 187109377)
|
312
|
+
sage: list(DirichletGroup(5))
|
313
|
+
[Dirichlet character modulo 5 of conductor 1 mapping 2 |--> 1,
|
314
|
+
Dirichlet character modulo 5 of conductor 5 mapping 2 |--> zeta4,
|
315
|
+
Dirichlet character modulo 5 of conductor 5 mapping 2 |--> -1,
|
316
|
+
Dirichlet character modulo 5 of conductor 5 mapping 2 |--> -zeta4]
|
317
|
+
sage: list(DirichletGroup(5, QQ))
|
318
|
+
[Dirichlet character modulo 5 of conductor 1 mapping 2 |--> 1, Dirichlet character modulo 5 of conductor 5 mapping 2 |--> -1]
|
319
|
+
sage: G = DirichletGroup(200)
|
320
|
+
sage: G
|
321
|
+
Group of Dirichlet characters modulo 200 with values in Cyclotomic Field of order 20 and degree 8
|
322
|
+
sage: G.exponent()
|
323
|
+
20
|
324
|
+
sage: G.gens()
|
325
|
+
(Dirichlet character modulo 200 of conductor 4 mapping 151 |--> -1, 101 |--> 1, 177 |--> 1,
|
326
|
+
Dirichlet character modulo 200 of conductor 8 mapping 151 |--> 1, 101 |--> -1, 177 |--> 1,
|
327
|
+
Dirichlet character modulo 200 of conductor 25 mapping 151 |--> 1, 101 |--> 1, 177 |--> zeta20)
|
328
|
+
sage: K = G.base_ring()
|
329
|
+
sage: zeta = K.0
|
330
|
+
sage: eps = G([1,-1,zeta^5])
|
331
|
+
sage: eps
|
332
|
+
Dirichlet character modulo 200 of conductor 40 mapping 151 |--> 1, 101 |--> -1, 177 |--> zeta20^5
|
333
|
+
sage: eps(3)
|
334
|
+
zeta20^5
|
335
|
+
sage: -zeta^15
|
336
|
+
zeta20^5
|
337
|
+
sage: kronecker(151,200)
|
338
|
+
1
|
339
|
+
sage: kronecker(101,200)
|
340
|
+
-1
|
341
|
+
sage: kronecker(177,200)
|
342
|
+
1
|
343
|
+
sage: G = DirichletGroup(20)
|
344
|
+
sage: G.galois_orbits()
|
345
|
+
[
|
346
|
+
[Dirichlet character modulo 20 of conductor 20 mapping 11 |--> -1, 17 |--> -1],
|
347
|
+
[Dirichlet character modulo 20 of conductor 20 mapping 11 |--> -1, 17 |--> -zeta4,
|
348
|
+
Dirichlet character modulo 20 of conductor 20 mapping 11 |--> -1, 17 |--> zeta4],
|
349
|
+
[Dirichlet character modulo 20 of conductor 4 mapping 11 |--> -1, 17 |--> 1],
|
350
|
+
[Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> -1],
|
351
|
+
[Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> -zeta4,
|
352
|
+
Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> zeta4],
|
353
|
+
[Dirichlet character modulo 20 of conductor 1 mapping 11 |--> 1, 17 |--> 1]
|
354
|
+
]
|
355
|
+
sage: G = DirichletGroup(11, QQ); G
|
356
|
+
Group of Dirichlet characters modulo 11 with values in Rational Field
|
357
|
+
sage: list(G)
|
358
|
+
[Dirichlet character modulo 11 of conductor 1 mapping 2 |--> 1,
|
359
|
+
Dirichlet character modulo 11 of conductor 11 mapping 2 |--> -1]
|
360
|
+
sage: eps = G.0 # 0th generator for Dirichlet group
|
361
|
+
sage: eps
|
362
|
+
Dirichlet character modulo 11 of conductor 11 mapping 2 |--> -1
|
363
|
+
sage: G.unit_gens()
|
364
|
+
(2,)
|
365
|
+
sage: eps(2)
|
366
|
+
-1
|
367
|
+
sage: eps(3)
|
368
|
+
1
|
369
|
+
sage: [eps(11*n) for n in range(10)]
|
370
|
+
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
371
|
+
sage: R = CyclotomicField(4)
|
372
|
+
sage: CyclotomicField(4)
|
373
|
+
Cyclotomic Field of order 4 and degree 2
|
374
|
+
sage: G = DirichletGroup(15, R)
|
375
|
+
sage: G
|
376
|
+
Group of Dirichlet characters modulo 15 with values in Cyclotomic Field of order 4 and degree 2
|
377
|
+
sage: list(G)
|
378
|
+
[Dirichlet character modulo 15 of conductor 1 mapping 11 |--> 1, 7 |--> 1,
|
379
|
+
Dirichlet character modulo 15 of conductor 3 mapping 11 |--> -1, 7 |--> 1,
|
380
|
+
Dirichlet character modulo 15 of conductor 5 mapping 11 |--> 1, 7 |--> zeta4,
|
381
|
+
Dirichlet character modulo 15 of conductor 15 mapping 11 |--> -1, 7 |--> zeta4,
|
382
|
+
Dirichlet character modulo 15 of conductor 5 mapping 11 |--> 1, 7 |--> -1,
|
383
|
+
Dirichlet character modulo 15 of conductor 15 mapping 11 |--> -1, 7 |--> -1,
|
384
|
+
Dirichlet character modulo 15 of conductor 5 mapping 11 |--> 1, 7 |--> -zeta4,
|
385
|
+
Dirichlet character modulo 15 of conductor 15 mapping 11 |--> -1, 7 |--> -zeta4]
|
386
|
+
sage: e = G.1
|
387
|
+
sage: e(4)
|
388
|
+
-1
|
389
|
+
sage: e(-1)
|
390
|
+
-1
|
391
|
+
sage: e(5)
|
392
|
+
0
|
393
|
+
sage: [e(n) for n in range(15)]
|
394
|
+
[0, 1, zeta4, 0, -1, 0, 0, zeta4, -zeta4,
|
395
|
+
0, 0, 1, 0, -zeta4, -1]
|
396
|
+
sage: G = DirichletGroup(15, GF(5)); G
|
397
|
+
Group of Dirichlet characters modulo 15 with values in Finite Field of size 5
|
398
|
+
sage: list(G)
|
399
|
+
[Dirichlet character modulo 15 of conductor 1 mapping 11 |--> 1, 7 |--> 1,
|
400
|
+
Dirichlet character modulo 15 of conductor 3 mapping 11 |--> 4, 7 |--> 1,
|
401
|
+
Dirichlet character modulo 15 of conductor 5 mapping 11 |--> 1, 7 |--> 2,
|
402
|
+
Dirichlet character modulo 15 of conductor 15 mapping 11 |--> 4, 7 |--> 2,
|
403
|
+
Dirichlet character modulo 15 of conductor 5 mapping 11 |--> 1, 7 |--> 4,
|
404
|
+
Dirichlet character modulo 15 of conductor 15 mapping 11 |--> 4, 7 |--> 4,
|
405
|
+
Dirichlet character modulo 15 of conductor 5 mapping 11 |--> 1, 7 |--> 3,
|
406
|
+
Dirichlet character modulo 15 of conductor 15 mapping 11 |--> 4, 7 |--> 3]
|
407
|
+
sage: e = G.1
|
408
|
+
sage: e(-1)
|
409
|
+
4
|
410
|
+
sage: e(2)
|
411
|
+
2
|
412
|
+
sage: e(5)
|
413
|
+
0
|
414
|
+
sage: [e(n) for n in range(15)]
|
415
|
+
[0, 1, 2, 0, 4, 0, 0, 2, 3, 0, 0, 1, 0, 3, 4]
|
416
|
+
sage: G = DirichletGroup(5)
|
417
|
+
sage: e = G.0
|
418
|
+
sage: e(2)
|
419
|
+
zeta4
|
420
|
+
sage: e.bernoulli(1)
|
421
|
+
-1/5*zeta4 - 3/5
|
422
|
+
sage: e.bernoulli(9)
|
423
|
+
-108846/5*zeta4 - 176868/5
|
424
|
+
sage: E = EisensteinForms(Gamma1(13),2)
|
425
|
+
sage: E.eisenstein_series()
|
426
|
+
[
|
427
|
+
1/2 + q + 3*q^2 + 4*q^3 + 7*q^4 + 6*q^5 + O(q^6),
|
428
|
+
-7/13*zeta6 - 11/13 + q + (2*zeta6 + 1)*q^2 + (-3*zeta6 + 1)*q^3 + (6*zeta6 - 3)*q^4 - 4*q^5 + O(q^6),
|
429
|
+
q + (zeta6 + 2)*q^2 + (-zeta6 + 3)*q^3 + (3*zeta6 + 3)*q^4 + 4*q^5 + O(q^6),
|
430
|
+
-zeta6 + q + (2*zeta6 - 1)*q^2 + (3*zeta6 - 2)*q^3 + (-2*zeta6 - 1)*q^4 + 6*q^5 + O(q^6),
|
431
|
+
q + (zeta6 + 1)*q^2 + (zeta6 + 2)*q^3 + (zeta6 + 2)*q^4 + 6*q^5 + O(q^6),
|
432
|
+
-1 + q - q^2 + 4*q^3 + 3*q^4 - 4*q^5 + O(q^6),
|
433
|
+
q + q^2 + 4*q^3 + 3*q^4 + 4*q^5 + O(q^6),
|
434
|
+
zeta6 - 1 + q + (-2*zeta6 + 1)*q^2 + (-3*zeta6 + 1)*q^3 + (2*zeta6 - 3)*q^4 + 6*q^5 + O(q^6),
|
435
|
+
q + (-zeta6 + 2)*q^2 + (-zeta6 + 3)*q^3 + (-zeta6 + 3)*q^4 + 6*q^5 + O(q^6),
|
436
|
+
7/13*zeta6 - 18/13 + q + (-2*zeta6 + 3)*q^2 + (3*zeta6 - 2)*q^3 + (-6*zeta6 + 3)*q^4 - 4*q^5 + O(q^6),
|
437
|
+
q + (-zeta6 + 3)*q^2 + (zeta6 + 2)*q^3 + (-3*zeta6 + 6)*q^4 + 4*q^5 + O(q^6)
|
438
|
+
]
|
439
|
+
sage: e = E.eisenstein_series()
|
440
|
+
sage: for e in E.eisenstein_series():
|
441
|
+
....: print(e.parameters())
|
442
|
+
(Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, 13)
|
443
|
+
(Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, Dirichlet character modulo 13 of conductor 13 mapping 2 |--> zeta6, 1)
|
444
|
+
(Dirichlet character modulo 13 of conductor 13 mapping 2 |--> zeta6, Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, 1)
|
445
|
+
(Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, Dirichlet character modulo 13 of conductor 13 mapping 2 |--> zeta6 - 1, 1)
|
446
|
+
(Dirichlet character modulo 13 of conductor 13 mapping 2 |--> zeta6 - 1, Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, 1)
|
447
|
+
(Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -1, 1)
|
448
|
+
(Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -1, Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, 1)
|
449
|
+
(Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -zeta6, 1)
|
450
|
+
(Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -zeta6, Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, 1)
|
451
|
+
(Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -zeta6 + 1, 1)
|
452
|
+
(Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -zeta6 + 1, Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1, 1)
|
453
|
+
sage: from sage.modular.dims import *
|
454
|
+
sage: dimension_cusp_forms(Gamma0(2007),2)
|
455
|
+
221
|
456
|
+
sage: dimension_eis(Gamma0(2007),2)
|
457
|
+
7
|
458
|
+
sage: dimension_modular_forms(Gamma0(2007),2)
|
459
|
+
228
|
460
|
+
sage: dimension_new_cusp_forms(Gamma0(11),12)
|
461
|
+
8
|
462
|
+
sage: dimension_cusp_forms(Gamma0(11),12)
|
463
|
+
10
|
464
|
+
sage: dimension_new_cusp_forms(Gamma0(2007),12)
|
465
|
+
1017
|
466
|
+
sage: dimension_cusp_forms(Gamma0(2007),12)
|
467
|
+
2460
|
468
|
+
sage: dimension_cusp_forms(Gamma1(2007),2)
|
469
|
+
147409
|
470
|
+
sage: dimension_eis(Gamma1(2007),2)
|
471
|
+
3551
|
472
|
+
sage: dimension_modular_forms(Gamma1(2007),2)
|
473
|
+
150960
|
474
|
+
sage: G = DirichletGroup(2007)
|
475
|
+
sage: e = prod(G.gens(), G(1))
|
476
|
+
sage: dimension_cusp_forms(e,2)
|
477
|
+
222
|
478
|
+
sage: dimension_cusp_forms(e,3)
|
479
|
+
0
|
480
|
+
sage: dimension_cusp_forms(e,4)
|
481
|
+
670
|
482
|
+
sage: dimension_cusp_forms(e,24)
|
483
|
+
5150
|
484
|
+
sage: dimension_eis(e,2)
|
485
|
+
4
|
486
|
+
sage: dimension_eis(e,3)
|
487
|
+
0
|
488
|
+
sage: dimension_eis(e,4)
|
489
|
+
4
|
490
|
+
sage: dimension_eis(e,24)
|
491
|
+
4
|
492
|
+
sage: G = DirichletGroup(2007, QQ)
|
493
|
+
sage: e = prod(G.gens(), G(1))
|
494
|
+
sage: dimension_new_cusp_forms(e,2)
|
495
|
+
76
|
496
|
+
sage: p = 389
|
497
|
+
sage: k = GF(p)
|
498
|
+
sage: a = k(7/13); a
|
499
|
+
210
|
500
|
+
sage: a.rational_reconstruction()
|
501
|
+
7/13
|
502
|
+
sage: M = MatrixSpace(QQ,4,8)
|
503
|
+
sage: A = M([[-9,6,7,3,1,0,0,0],[-10,3,8,2,0,1,0,0],[3,-6,2,8,0,0,1,0],[-8,-6,-8,6,0,0,0,1]])
|
504
|
+
sage: A41 = MatrixSpace(GF(41),4,8)(A)
|
505
|
+
sage: E41 = A41.echelon_form()
|
506
|
+
sage: B = A.matrix_from_columns([0,1,2,4])
|
507
|
+
sage: E = B^(-1)*A
|
508
|
+
sage: B = A.matrix_from_columns([0,1,2,3])
|
509
|
+
sage: M = ModularSymbols(Gamma0(6)); M
|
510
|
+
Modular Symbols space of dimension 3 for Gamma_0(6)
|
511
|
+
of weight 2 with sign 0 over Rational Field
|
512
|
+
sage: M.new_subspace()
|
513
|
+
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 3 for Gamma_0(6) of weight 2 with sign 0 over Rational Field
|
514
|
+
sage: M.old_subspace()
|
515
|
+
Modular Symbols subspace of dimension 3 of Modular
|
516
|
+
Symbols space of dimension 3 for Gamma_0(6) of weight
|
517
|
+
2 with sign 0 over Rational Field
|
518
|
+
sage: G = DirichletGroup(13)
|
519
|
+
sage: G
|
520
|
+
Group of Dirichlet characters modulo 13 with values in Cyclotomic Field of order 12 and degree 4
|
521
|
+
sage: dimension_modular_forms(Gamma1(13),2)
|
522
|
+
13
|
523
|
+
sage: [dimension_modular_forms(e,2) for e in G]
|
524
|
+
[1, 0, 3, 0, 2, 0, 2, 0, 2, 0, 3, 0]
|
525
|
+
sage: G = DirichletGroup(100)
|
526
|
+
sage: G
|
527
|
+
Group of Dirichlet characters modulo 100 with values in Cyclotomic Field of order 20 and degree 8
|
528
|
+
sage: dimension_modular_forms(Gamma1(100),2)
|
529
|
+
370
|
530
|
+
sage: v = [dimension_modular_forms(e,2) for e in G]; v
|
531
|
+
[24, 0, 0, 17, 18, 0, 0, 17, 18, 0, 0, 21, 18, 0, 0, 17,
|
532
|
+
18, 0, 0, 17, 24, 0, 0, 17, 18, 0, 0, 17, 18, 0, 0, 21,
|
533
|
+
18, 0, 0, 17, 18, 0, 0, 17]
|
534
|
+
sage: sum(v)
|
535
|
+
370
|
536
|
+
sage: S = CuspForms(Gamma0(45), 2, prec=14); S
|
537
|
+
Cuspidal subspace of dimension 3 of Modular Forms space
|
538
|
+
of dimension 10 for Congruence Subgroup Gamma0(45) of
|
539
|
+
weight 2 over Rational Field
|
540
|
+
sage: S.basis()
|
541
|
+
[
|
542
|
+
q - q^4 - q^10 - 2*q^13 + O(q^14),
|
543
|
+
q^2 - q^5 - 3*q^8 + 4*q^11 + O(q^14),
|
544
|
+
q^3 - q^6 - q^9 - q^12 + O(q^14)
|
545
|
+
]
|
546
|
+
sage: S.new_subspace().basis()
|
547
|
+
[
|
548
|
+
q + q^2 - q^4 - q^5 - 3*q^8 - q^10 + 4*q^11 - 2*q^13 + O(q^14)
|
549
|
+
]
|
550
|
+
sage: CuspForms(Gamma0(9),2)
|
551
|
+
Cuspidal subspace of dimension 0 of Modular Forms space
|
552
|
+
of dimension 3 for Congruence Subgroup Gamma0(9) of
|
553
|
+
weight 2 over Rational Field
|
554
|
+
sage: CuspForms(Gamma0(15),2, prec=10).basis()
|
555
|
+
[
|
556
|
+
q - q^2 - q^3 - q^4 + q^5 + q^6 + 3*q^8 + q^9 + O(q^10)
|
557
|
+
]
|
558
|
+
"""
|