From 1431319a94f2c5d221e9018d3e6b150e5548fb5a Mon Sep 17 00:00:00 2001 From: Peter Bruin Date: Mon, 20 Jul 2015 18:01:20 +0200 Subject: [PATCH] Trac 6018: improve repr() of Dirichlet groups --- src/doc/de/tutorial/tour_advanced.rst | 11 ++- .../modular_forms_and_hecke_operators.rst | 5 +- src/doc/en/tutorial/tour_advanced.rst | 11 ++- src/doc/fr/tutorial/tour_advanced.rst | 11 ++- src/doc/pt/tutorial/tour_advanced.rst | 11 ++- src/doc/ru/tutorial/tour_advanced.rst | 11 ++- src/sage/misc/functional.py | 2 +- src/sage/modular/dirichlet.py | 71 +++++++++---------- src/sage/modular/modform/element.py | 2 +- src/sage/modular/modsym/modsym.py | 2 +- src/sage/modular/modsym/space.py | 2 +- src/sage/tests/book_stein_modform.py | 18 ++--- 12 files changed, 67 insertions(+), 90 deletions(-) diff --git a/src/doc/de/tutorial/tour_advanced.rst b/src/doc/de/tutorial/tour_advanced.rst index 9b428030b77..aa2af4de61b 100644 --- a/src/doc/de/tutorial/tour_advanced.rst +++ b/src/doc/de/tutorial/tour_advanced.rst @@ -334,10 +334,8 @@ Faktorisierung des Moduls entsprechen. sage: G.decomposition() [ - Group of Dirichlet characters of modulus 3 over Cyclotomic Field of order - 6 and degree 2, - Group of Dirichlet characters of modulus 7 over Cyclotomic Field of order - 6 and degree 2 + Group of Dirichlet characters modulo 3 with values in Cyclotomic Field of order 6 and degree 2, + Group of Dirichlet characters modulo 7 with values in Cyclotomic Field of order 6 and degree 2 ] Als nächstes konstruieren wir die Gruppe der Dirichlet-Charaktere @@ -348,7 +346,7 @@ mod 20, jedoch mit Werten in :math:`\QQ(i)`: sage: K. = NumberField(x^2+1) sage: G = DirichletGroup(20,K) sage: G - Group of Dirichlet characters of modulus 20 over Number Field in i with defining polynomial x^2 + 1 + Group of Dirichlet characters modulo 20 with values in Number Field in i with defining polynomial x^2 + 1 Nun berechnen wir mehrere Invarianten von ``G``: @@ -381,8 +379,7 @@ Argument von ``DirichletGroup`` an. sage: K Number Field in a with defining polynomial x^4 + 1 sage: G = DirichletGroup(5, K, a); G - Group of Dirichlet characters of modulus 5 over Number Field in a with - defining polynomial x^4 + 1 with values in the group of order 8 generated by a + Group of Dirichlet characters modulo 5 with values in the group of order 8 generated by a in Number Field in a with defining polynomial x^4 + 1 sage: chi = G.0; chi Dirichlet character modulo 5 of conductor 5 mapping 2 |--> a^2 sage: [(chi^i)(2) for i in range(4)] diff --git a/src/doc/en/thematic_tutorials/explicit_methods_in_number_theory/modular_forms_and_hecke_operators.rst b/src/doc/en/thematic_tutorials/explicit_methods_in_number_theory/modular_forms_and_hecke_operators.rst index f908b03c883..6804e5eb7a2 100644 --- a/src/doc/en/thematic_tutorials/explicit_methods_in_number_theory/modular_forms_and_hecke_operators.rst +++ b/src/doc/en/thematic_tutorials/explicit_methods_in_number_theory/modular_forms_and_hecke_operators.rst @@ -216,8 +216,7 @@ cyclotomic field. :: sage: G = DirichletGroup(8); G - Group of Dirichlet characters of modulus 8 over Cyclotomic - Field of order 2 and degree 1 + Group of Dirichlet characters modulo 8 with values in Cyclotomic Field of order 2 and degree 1 sage: v = G.list(); v [Dirichlet character modulo 8 of conductor 1 mapping 7 |--> 1, 5 |--> 1, Dirichlet character modulo 8 of conductor 4 mapping 7 |--> -1, 5 |--> 1, @@ -230,7 +229,7 @@ cyclotomic field. Sage both represents Dirichlet characters by giving a "matrix", i.e., the list of images of canonical generators of -:math:`(\ZZ/N\ZZ)^*`, and as vectors modulo and +:math:`(\ZZ/N\ZZ)^*`, and as vectors modulo an integer :math:`n`. For years, I was torn between these two representations, until J. Quer and I realized that the best approach is to use both and make it easy to convert between them. diff --git a/src/doc/en/tutorial/tour_advanced.rst b/src/doc/en/tutorial/tour_advanced.rst index 744f8ed695d..4e959706243 100644 --- a/src/doc/en/tutorial/tour_advanced.rst +++ b/src/doc/en/tutorial/tour_advanced.rst @@ -332,10 +332,8 @@ factorization of the modulus. sage: G.decomposition() [ - Group of Dirichlet characters of modulus 3 over Cyclotomic Field of order - 6 and degree 2, - Group of Dirichlet characters of modulus 7 over Cyclotomic Field of order - 6 and degree 2 + Group of Dirichlet characters modulo 3 with values in Cyclotomic Field of order 6 and degree 2, + Group of Dirichlet characters modulo 7 with values in Cyclotomic Field of order 6 and degree 2 ] Next, we construct the group of Dirichlet characters mod 20, but @@ -346,7 +344,7 @@ with values in :math:`\QQ(i)`: sage: K. = NumberField(x^2+1) sage: G = DirichletGroup(20,K) sage: G - Group of Dirichlet characters of modulus 20 over Number Field in i with defining polynomial x^2 + 1 + Group of Dirichlet characters modulo 20 with values in Number Field in i with defining polynomial x^2 + 1 We next compute several invariants of ``G``: @@ -379,8 +377,7 @@ the third argument to ``DirichletGroup`` below. sage: K Number Field in a with defining polynomial x^4 + 1 sage: G = DirichletGroup(5, K, a); G - Group of Dirichlet characters of modulus 5 over Number Field in a with - defining polynomial x^4 + 1 with values in the group of order 8 generated by a + Group of Dirichlet characters modulo 5 with values in the group of order 8 generated by a in Number Field in a with defining polynomial x^4 + 1 sage: chi = G.0; chi Dirichlet character modulo 5 of conductor 5 mapping 2 |--> a^2 sage: [(chi^i)(2) for i in range(4)] diff --git a/src/doc/fr/tutorial/tour_advanced.rst b/src/doc/fr/tutorial/tour_advanced.rst index 8a1c971220a..d7e086c09e4 100644 --- a/src/doc/fr/tutorial/tour_advanced.rst +++ b/src/doc/fr/tutorial/tour_advanced.rst @@ -333,10 +333,8 @@ caractères, de même qu'une décomposition en produit direct correspondant sage: G.decomposition() [ - Group of Dirichlet characters of modulus 3 over Cyclotomic Field of order - 6 and degree 2, - Group of Dirichlet characters of modulus 7 over Cyclotomic Field of order - 6 and degree 2 + Group of Dirichlet characters modulo 3 with values in Cyclotomic Field of order 6 and degree 2, + Group of Dirichlet characters modulo 7 with values in Cyclotomic Field of order 6 and degree 2 ] Construisons à present le groupe de caractères de Dirichlet modulo 20, @@ -347,7 +345,7 @@ mais à valeur dans :math:`\QQ(i)`: sage: K. = NumberField(x^2+1) sage: G = DirichletGroup(20,K) sage: G - Group of Dirichlet characters of modulus 20 over Number Field in i with defining polynomial x^2 + 1 + Group of Dirichlet characters modulo 20 with values in Number Field in i with defining polynomial x^2 + 1 Nous calculons ensuite différents invariants de ``G``: @@ -380,8 +378,7 @@ de la racine de l'unité par le troisième argument de la fonction sage: K Number Field in a with defining polynomial x^4 + 1 sage: G = DirichletGroup(5, K, a); G - Group of Dirichlet characters of modulus 5 over Number Field in a with - defining polynomial x^4 + 1 with values in the group of order 8 generated by a + Group of Dirichlet characters modulo 5 with values in the group of order 8 generated by a in Number Field in a with defining polynomial x^4 + 1 sage: chi = G.0; chi Dirichlet character modulo 5 of conductor 5 mapping 2 |--> a^2 sage: [(chi^i)(2) for i in range(4)] diff --git a/src/doc/pt/tutorial/tour_advanced.rst b/src/doc/pt/tutorial/tour_advanced.rst index c4984eac386..6b98ccb1f91 100644 --- a/src/doc/pt/tutorial/tour_advanced.rst +++ b/src/doc/pt/tutorial/tour_advanced.rst @@ -334,10 +334,8 @@ módulo. sage: G.decomposition() [ - Group of Dirichlet characters of modulus 3 over Cyclotomic Field of order - 6 and degree 2, - Group of Dirichlet characters of modulus 7 over Cyclotomic Field of order - 6 and degree 2 + Group of Dirichlet characters modulo 3 with values in Cyclotomic Field of order 6 and degree 2, + Group of Dirichlet characters modulo 7 with values in Cyclotomic Field of order 6 and degree 2 ] A seguir, construímos o grupo de caracteres de Dirichlet mod 20, mas @@ -348,7 +346,7 @@ com valores em :math:`\QQ(i)`: sage: K. = NumberField(x^2+1) sage: G = DirichletGroup(20,K) sage: G - Group of Dirichlet characters of modulus 20 over Number Field in i with defining polynomial x^2 + 1 + Group of Dirichlet characters modulo 20 with values in Number Field in i with defining polynomial x^2 + 1 Agora calculamos diversos invariantes de ``G``: @@ -380,8 +378,7 @@ unidade no terceiro argumento do comando ``DirichletGroup`` abaixo. sage: K Number Field in a with defining polynomial x^4 + 1 sage: G = DirichletGroup(5, K, a); G - Group of Dirichlet characters of modulus 5 over Number Field in a with - defining polynomial x^4 + 1 with values in the group of order 8 generated by a + Group of Dirichlet characters modulo 5 with values in the group of order 8 generated by a in Number Field in a with defining polynomial x^4 + 1 sage: chi = G.0; chi Dirichlet character modulo 5 of conductor 5 mapping 2 |--> a^2 sage: [(chi^i)(2) for i in range(4)] diff --git a/src/doc/ru/tutorial/tour_advanced.rst b/src/doc/ru/tutorial/tour_advanced.rst index 4ff70c207d1..04e9d10871a 100644 --- a/src/doc/ru/tutorial/tour_advanced.rst +++ b/src/doc/ru/tutorial/tour_advanced.rst @@ -297,10 +297,8 @@ Sage может вычислить тороидальный идеал непл sage: G.decomposition() [ - Group of Dirichlet characters of modulus 3 over Cyclotomic Field of order - 6 and degree 2, - Group of Dirichlet characters of modulus 7 over Cyclotomic Field of order - 6 and degree 2 + Group of Dirichlet characters modulo 3 with values in Cyclotomic Field of order 6 and degree 2, + Group of Dirichlet characters modulo 7 with values in Cyclotomic Field of order 6 and degree 2 ] Далее надо построить группу символов Дирихле по модулю 20, но со значениями @@ -311,7 +309,7 @@ Sage может вычислить тороидальный идеал непл sage: K. = NumberField(x^2+1) sage: G = DirichletGroup(20,K) sage: G - Group of Dirichlet characters of modulus 20 over Number Field in i with defining polynomial x^2 + 1 + Group of Dirichlet characters modulo 20 with values in Number Field in i with defining polynomial x^2 + 1 Теперь посчитаем несколько инвариант ``G``: @@ -343,8 +341,7 @@ Sage может вычислить тороидальный идеал непл sage: K Number Field in a with defining polynomial x^4 + 1 sage: G = DirichletGroup(5, K, a); G - Group of Dirichlet characters of modulus 5 over Number Field in a with - defining polynomial x^4 + 1 with values in the group of order 8 generated by a + Group of Dirichlet characters modulo 5 with values in the group of order 8 generated by a in Number Field in a with defining polynomial x^4 + 1 sage: chi = G.0; chi Dirichlet character modulo 5 of conductor 5 mapping 2 |--> a^2 sage: [(chi^i)(2) for i in range(4)] diff --git a/src/sage/misc/functional.py b/src/sage/misc/functional.py index 0fcbae217e4..68ee58e02b0 100644 --- a/src/sage/misc/functional.py +++ b/src/sage/misc/functional.py @@ -230,7 +230,7 @@ def decomposition(x): [Dirichlet character modulo 4 of conductor 4 mapping 3 |--> -1, Dirichlet character modulo 5 of conductor 5 mapping 2 |--> zeta4] sage: d[0].parent() - Group of Dirichlet characters of modulus 4 over Cyclotomic Field of order 4 and degree 2 + Group of Dirichlet characters modulo 4 with values in Cyclotomic Field of order 4 and degree 2 """ return x.decomposition() diff --git a/src/sage/modular/dirichlet.py b/src/sage/modular/dirichlet.py index 6d9cc49a55b..b1164937b99 100644 --- a/src/sage/modular/dirichlet.py +++ b/src/sage/modular/dirichlet.py @@ -202,7 +202,7 @@ def __init__(self, parent, x, check=True): sage: G. = DirichletGroup(13) sage: G - Group of Dirichlet characters of modulus 13 over Cyclotomic Field of order 12 and degree 4 + Group of Dirichlet characters modulo 13 with values in Cyclotomic Field of order 12 and degree 4 sage: e Dirichlet character modulo 13 of conductor 13 mapping 2 |--> zeta12 sage: loads(e.dumps()) == e @@ -349,7 +349,7 @@ def change_ring(self, R): sage: e = DirichletGroup(7, QQ).0 sage: f = e.change_ring(QuadraticField(3, 'a')) sage: f.parent() - Group of Dirichlet characters of modulus 7 over Number Field in a with defining polynomial x^2 - 3 + Group of Dirichlet characters modulo 7 with values in Number Field in a with defining polynomial x^2 - 3 :: @@ -781,9 +781,9 @@ def decomposition(self): sage: d = c.decomposition(); d [Dirichlet character modulo 4 of conductor 4 mapping 3 |--> -1, Dirichlet character modulo 5 of conductor 5 mapping 2 |--> zeta4] sage: d[0].parent() - Group of Dirichlet characters of modulus 4 over Cyclotomic Field of order 4 and degree 2 + Group of Dirichlet characters modulo 4 with values in Cyclotomic Field of order 4 and degree 2 sage: d[1].parent() - Group of Dirichlet characters of modulus 5 over Cyclotomic Field of order 4 and degree 2 + Group of Dirichlet characters modulo 5 with values in Cyclotomic Field of order 4 and degree 2 We can't multiply directly, since coercion of one element into the other parent fails in both cases:: @@ -791,7 +791,7 @@ def decomposition(self): sage: d[0]*d[1] == c Traceback (most recent call last): ... - TypeError: unsupported operand parent(s) for '*': 'Group of Dirichlet characters of modulus 4 over Cyclotomic Field of order 4 and degree 2' and 'Group of Dirichlet characters of modulus 5 over Cyclotomic Field of order 4 and degree 2' + TypeError: unsupported operand parent(s) for '*': 'Group of Dirichlet characters modulo 4 with values in Cyclotomic Field of order 4 and degree 2' and 'Group of Dirichlet characters modulo 5 with values in Cyclotomic Field of order 4 and degree 2' We can multiply if we're explicit about where we want the multiplication to take place. @@ -1775,13 +1775,13 @@ class DirichletGroupFactory(UniqueFactory): of `(\ZZ/N\ZZ)^*`:: sage: DirichletGroup(20) - Group of Dirichlet characters of modulus 20 over Cyclotomic Field of order 4 and degree 2 + Group of Dirichlet characters modulo 20 with values in Cyclotomic Field of order 4 and degree 2 We create the group of Dirichlet character mod 20 with values in the rational numbers:: sage: G = DirichletGroup(20, QQ); G - Group of Dirichlet characters of modulus 20 over Rational Field + Group of Dirichlet characters modulo 20 with values in Rational Field sage: G.order() 4 sage: G.base_ring() @@ -1817,12 +1817,12 @@ class DirichletGroupFactory(UniqueFactory): sage: R. = PolynomialRing(QQ) sage: K. = NumberField(x^4 + 1) sage: DirichletGroup(5, K) - Group of Dirichlet characters of modulus 5 over Number Field in a with defining polynomial x^4 + 1 + Group of Dirichlet characters modulo 5 with values in Number Field in a with defining polynomial x^4 + 1 An example where we give ``zeta``, but not its order:: sage: G = DirichletGroup(5, K, a); G - Group of Dirichlet characters of modulus 5 over Number Field in a with defining polynomial x^4 + 1 with values in the group of order 8 generated by a + Group of Dirichlet characters modulo 5 with values in the group of order 8 generated by a in Number Field in a with defining polynomial x^4 + 1 sage: G.list() [Dirichlet character modulo 5 of conductor 1 mapping 2 |--> 1, Dirichlet character modulo 5 of conductor 5 mapping 2 |--> a^2, Dirichlet character modulo 5 of conductor 5 mapping 2 |--> -1, Dirichlet character modulo 5 of conductor 5 mapping 2 |--> -a^2] @@ -1830,9 +1830,9 @@ class DirichletGroupFactory(UniqueFactory): without specifying a root of unity:: sage: DirichletGroup(5, K, zeta=-1, zeta_order=2) - Group of Dirichlet characters of modulus 5 over Number Field in a with defining polynomial x^4 + 1 with values in the group of order 2 generated by -1 + Group of Dirichlet characters modulo 5 with values in the group of order 2 generated by -1 in Number Field in a with defining polynomial x^4 + 1 sage: DirichletGroup(5, K, zeta_order=2) - Group of Dirichlet characters of modulus 5 over Number Field in a with defining polynomial x^4 + 1 with values in the group of order 2 generated by -1 + Group of Dirichlet characters modulo 5 with values in the group of order 2 generated by -1 in Number Field in a with defining polynomial x^4 + 1 :: @@ -1850,7 +1850,7 @@ class DirichletGroupFactory(UniqueFactory): sage: p = next_prime(10^40) sage: g = DirichletGroup(19, GF(p)); g - Group of Dirichlet characters of modulus 19 over Finite Field of size 10000000000000000000000000000000000000121 + Group of Dirichlet characters modulo 19 with values in Finite Field of size 10000000000000000000000000000000000000121 Note that the root of unity has small order, i.e., it is not the largest order root of unity in the field:: @@ -1880,7 +1880,7 @@ class DirichletGroupFactory(UniqueFactory): :: sage: DirichletGroup(60, integral=True) - Group of Dirichlet characters of modulus 60 over Maximal Order in Cyclotomic Field of order 4 and degree 2 + Group of Dirichlet characters modulo 60 with values in Maximal Order in Cyclotomic Field of order 4 and degree 2 sage: parent(DirichletGroup(60, integral=True).gens()[2].values_on_gens()[2]) Maximal Order in Cyclotomic Field of order 4 and degree 2 @@ -1893,14 +1893,14 @@ class DirichletGroupFactory(UniqueFactory): NotImplementedError: order of element not known sage: DirichletGroup(7, CC, zeta=exp(2*pi*I/6), zeta_order=6) - Group of Dirichlet characters of modulus 7 over Complex Field with 53 bits of precision with values in the group of order 6 generated by 0.500000000000000 + 0.866025403784439*I + Group of Dirichlet characters modulo 7 with values in the group of order 6 generated by 0.500000000000000 + 0.866025403784439*I in Complex Field with 53 bits of precision If the base ring is not a domain (in which case the group of roots of unity is not necessarily cyclic), some operations still work, such as creation of elements:: sage: G = DirichletGroup(5, Zmod(15)); G - Group of Dirichlet characters of modulus 5 over Ring of integers modulo 15 + Group of Dirichlet characters modulo 5 with values in Ring of integers modulo 15 sage: chi = G([13]); chi Dirichlet character modulo 5 of conductor 5 mapping 2 |--> 13 sage: chi^2 @@ -1915,7 +1915,7 @@ class DirichletGroupFactory(UniqueFactory): ... NotImplementedError: factorization of polynomials over rings with composite characteristic is not implemented sage: G = DirichletGroup(5, Zmod(15), zeta=2); G - Group of Dirichlet characters of modulus 5 over Ring of integers modulo 15 with values in the group of order 4 generated by 2 + Group of Dirichlet characters modulo 5 with values in the group of order 4 generated by 2 in Ring of integers modulo 15 sage: G.gens() (Dirichlet character modulo 5 of conductor 5 mapping 2 |--> 2,) @@ -1946,9 +1946,9 @@ def create_key(self, N, base_ring=None, zeta=None, zeta_order=None, names=None, sage: k == l False sage: G = DirichletGroup.create_object(None, k); G - Group of Dirichlet characters of modulus 2 over Rational Field + Group of Dirichlet characters modulo 2 with values in Rational Field sage: H = DirichletGroup.create_object(None, l); H - Group of Dirichlet characters of modulus 2 over Complex Field with 53 bits of precision + Group of Dirichlet characters modulo 2 with values in Complex Field with 53 bits of precision sage: G == H False @@ -1968,13 +1968,13 @@ def create_key(self, N, base_ring=None, zeta=None, zeta_order=None, names=None, raised if only ``zeta_order`` is specified:: sage: DirichletGroup(17, Integers(15)) - Group of Dirichlet characters of modulus 17 over Ring of integers modulo 15 + Group of Dirichlet characters modulo 17 with values in Ring of integers modulo 15 sage: DirichletGroup(17, Integers(15), zeta_order=4) Traceback (most recent call last): ... ValueError: base ring (= Ring of integers modulo 15) must be an integral domain if only zeta_order is specified sage: G = DirichletGroup(17, Integers(15), zeta=7); G - Group of Dirichlet characters of modulus 17 over Ring of integers modulo 15 with values in the group of order 4 generated by 7 + Group of Dirichlet characters modulo 17 with values in the group of order 4 generated by 7 in Ring of integers modulo 15 sage: G.order() 4 @@ -2015,7 +2015,7 @@ def create_object(self, version, key, **extra_args): sage: K = CyclotomicField(4) sage: DirichletGroup.create_object(None, (K, 60, K.gen(), 4)) - Group of Dirichlet characters of modulus 60 over Cyclotomic Field of order 4 and degree 2 with values in the group of order 4 generated by zeta4 + Group of Dirichlet characters modulo 60 with values in the group of order 4 generated by zeta4 in Cyclotomic Field of order 4 and degree 2 """ base_ring, modulus, zeta, zeta_order = key @@ -2171,9 +2171,9 @@ def change_ring(self, R, zeta=None, zeta_order=None): EXAMPLES:: sage: G = DirichletGroup(7,QQ); G - Group of Dirichlet characters of modulus 7 over Rational Field + Group of Dirichlet characters modulo 7 with values in Rational Field sage: G.change_ring(CyclotomicField(6)) - Group of Dirichlet characters of modulus 7 over Cyclotomic Field of order 6 and degree 2 + Group of Dirichlet characters modulo 7 with values in Cyclotomic Field of order 6 and degree 2 TESTS: @@ -2183,7 +2183,7 @@ def change_ring(self, R, zeta=None, zeta_order=None): sage: f = K.complex_embeddings()[0] sage: D = DirichletGroup(5, K) sage: D.change_ring(f) - Group of Dirichlet characters of modulus 5 over Complex Field with 53 bits of precision + Group of Dirichlet characters modulo 5 with values in Complex Field with 53 bits of precision """ if zeta is None and self._zeta is not None: @@ -2223,9 +2223,9 @@ def base_extend(self, R): EXAMPLES:: sage: G = DirichletGroup(7,QQ); G - Group of Dirichlet characters of modulus 7 over Rational Field + Group of Dirichlet characters modulo 7 with values in Rational Field sage: H = G.base_extend(CyclotomicField(6)); H - Group of Dirichlet characters of modulus 7 over Cyclotomic Field of order 6 and degree 2 + Group of Dirichlet characters modulo 7 with values in Cyclotomic Field of order 6 and degree 2 Note that the root of unity can change:: @@ -2288,7 +2288,7 @@ def _element_constructor_(self, x): sage: G(0) Traceback (most recent call last): ... - TypeError: cannot convert 0 to an element of Group of Dirichlet characters of modulus 13 over Cyclotomic Field of order 12 and degree 4 + TypeError: cannot convert 0 to an element of Group of Dirichlet characters modulo 13 with values in Cyclotomic Field of order 12 and degree 4 sage: G = DirichletGroup(6) sage: G(DirichletGroup(3).0) @@ -2377,16 +2377,15 @@ def _repr_(self): sage: G = DirichletGroup(11) sage: repr(G) # indirect doctest - 'Group of Dirichlet characters of modulus 11 over Cyclotomic Field of order 10 and degree 4' + 'Group of Dirichlet characters modulo 11 with values in Cyclotomic Field of order 10 and degree 4' sage: G.rename('Dir(11)') sage: G Dir(11) """ - s = ("Group of Dirichlet characters of modulus %s over %s" - % (self.modulus(), self.base_ring())) + s = "Group of Dirichlet characters modulo %s with values in " % self.modulus() if self._zeta is not None: - s += (' with values in the group of order %s generated by %s' - % (self._zeta_order, self._zeta)) + s += "the group of order %s generated by %s in " % (self._zeta_order, self._zeta) + s += str(self.base_ring()) return s @cached_method @@ -2402,13 +2401,13 @@ def decomposition(self): sage: DirichletGroup(20).decomposition() [ - Group of Dirichlet characters of modulus 4 over Cyclotomic Field of order 4 and degree 2, - Group of Dirichlet characters of modulus 5 over Cyclotomic Field of order 4 and degree 2 + Group of Dirichlet characters modulo 4 with values in Cyclotomic Field of order 4 and degree 2, + Group of Dirichlet characters modulo 5 with values in Cyclotomic Field of order 4 and degree 2 ] sage: DirichletGroup(20,GF(5)).decomposition() [ - Group of Dirichlet characters of modulus 4 over Finite Field of size 5, - Group of Dirichlet characters of modulus 5 over Finite Field of size 5 + Group of Dirichlet characters modulo 4 with values in Finite Field of size 5, + Group of Dirichlet characters modulo 5 with values in Finite Field of size 5 ] """ R = self.base_ring() diff --git a/src/sage/modular/modform/element.py b/src/sage/modular/modform/element.py index b85a6573941..eb3d8432d19 100644 --- a/src/sage/modular/modform/element.py +++ b/src/sage/modular/modform/element.py @@ -1469,7 +1469,7 @@ def twist(self, chi, level=None): q - 2*q^2 - q^3 + 2*q^4 + q^5 + O(q^6) sage: eps = DirichletGroup(3).0 sage: eps.parent() - Group of Dirichlet characters of modulus 3 over Cyclotomic Field of order 2 and degree 1 + Group of Dirichlet characters modulo 3 with values in Cyclotomic Field of order 2 and degree 1 sage: f_eps = f.twist(eps) sage: f_eps.parent() Cuspidal subspace of dimension 9 of Modular Forms space of dimension 16 for Congruence Subgroup Gamma0(99) of weight 2 over Cyclotomic Field of order 2 and degree 1 diff --git a/src/sage/modular/modsym/modsym.py b/src/sage/modular/modsym/modsym.py index 48b9afdeb64..ad064eb946d 100644 --- a/src/sage/modular/modsym/modsym.py +++ b/src/sage/modular/modsym/modsym.py @@ -277,7 +277,7 @@ def ModularSymbols(group = 1, :: sage: G = DirichletGroup(13,GF(4,'a')); G - Group of Dirichlet characters of modulus 13 over Finite Field in a of size 2^2 + Group of Dirichlet characters modulo 13 with values in Finite Field in a of size 2^2 sage: e = G.list()[2]; e Dirichlet character modulo 13 of conductor 13 mapping 2 |--> a + 1 sage: M = ModularSymbols(e,4); M diff --git a/src/sage/modular/modsym/space.py b/src/sage/modular/modsym/space.py index 7bf69c3fa9d..1cac8b2ce5d 100644 --- a/src/sage/modular/modsym/space.py +++ b/src/sage/modular/modsym/space.py @@ -1144,7 +1144,7 @@ def q_eigenform_character(self, names=None): sage: eps = f.q_eigenform_character('a'); eps Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -a - 1 sage: parent(eps) - Group of Dirichlet characters of modulus 13 over Number Field in a with defining polynomial x^2 + 3*x + 3 + Group of Dirichlet characters modulo 13 with values in Number Field in a with defining polynomial x^2 + 3*x + 3 sage: eps(3) a + 1 diff --git a/src/sage/tests/book_stein_modform.py b/src/sage/tests/book_stein_modform.py index 1e197cf3a25..77852a68c82 100644 --- a/src/sage/tests/book_stein_modform.py +++ b/src/sage/tests/book_stein_modform.py @@ -312,8 +312,7 @@ [Dirichlet character modulo 5 of conductor 1 mapping 2 |--> 1, Dirichlet character modulo 5 of conductor 5 mapping 2 |--> -1] sage: G = DirichletGroup(200) sage: G -Group of Dirichlet characters of modulus 200 over -Cyclotomic Field of order 20 and degree 8 +Group of Dirichlet characters modulo 200 with values in Cyclotomic Field of order 20 and degree 8 sage: G.exponent() 20 sage: G.gens() @@ -348,8 +347,7 @@ [Dirichlet character modulo 20 of conductor 1 mapping 11 |--> 1, 17 |--> 1] ] sage: G = DirichletGroup(11, QQ); G -Group of Dirichlet characters of modulus 11 over -Rational Field +Group of Dirichlet characters modulo 11 with values in Rational Field sage: list(G) [Dirichlet character modulo 11 of conductor 1 mapping 2 |--> 1, Dirichlet character modulo 11 of conductor 11 mapping 2 |--> -1] @@ -369,8 +367,7 @@ Cyclotomic Field of order 4 and degree 2 sage: G = DirichletGroup(15, R) sage: G -Group of Dirichlet characters of modulus 15 over -Cyclotomic Field of order 4 and degree 2 +Group of Dirichlet characters modulo 15 with values in Cyclotomic Field of order 4 and degree 2 sage: list(G) [Dirichlet character modulo 15 of conductor 1 mapping 11 |--> 1, 7 |--> 1, Dirichlet character modulo 15 of conductor 3 mapping 11 |--> -1, 7 |--> 1, @@ -391,8 +388,7 @@ [0, 1, zeta4, 0, -1, 0, 0, zeta4, -zeta4, 0, 0, 1, 0, -zeta4, -1] sage: G = DirichletGroup(15, GF(5)); G -Group of Dirichlet characters of modulus 15 - over Finite Field of size 5 +Group of Dirichlet characters modulo 15 with values in Finite Field of size 5 sage: list(G) [Dirichlet character modulo 15 of conductor 1 mapping 11 |--> 1, 7 |--> 1, Dirichlet character modulo 15 of conductor 3 mapping 11 |--> 4, 7 |--> 1, @@ -515,16 +511,14 @@ 2 with sign 0 over Rational Field sage: G = DirichletGroup(13) sage: G -Group of Dirichlet characters of modulus 13 over -Cyclotomic Field of order 12 and degree 4 +Group of Dirichlet characters modulo 13 with values in Cyclotomic Field of order 12 and degree 4 sage: dimension_modular_forms(Gamma1(13),2) 13 sage: [dimension_modular_forms(e,2) for e in G] [1, 0, 3, 0, 2, 0, 2, 0, 2, 0, 3, 0] sage: G = DirichletGroup(100) sage: G -Group of Dirichlet characters of modulus 100 over -Cyclotomic Field of order 20 and degree 8 +Group of Dirichlet characters modulo 100 with values in Cyclotomic Field of order 20 and degree 8 sage: dimension_modular_forms(Gamma1(100),2) 370 sage: v = [dimension_modular_forms(e,2) for e in G]; v