A DirichletCharacter is the extension of a homomorphism
for some ring , to the map obtained by sending those with to .
EXAMPLES:
sage: G = DirichletGroup(35)
sage: x = G.gens()
sage: e = x[0]*x[1]^2; e
Dirichlet character modulo 35 of conductor 35 mapping 22 |--> zeta12^3, 31 |--> zeta12^2 - 1
sage: e.order()
12
This illustrates a canonical coercion.
sage: e = DirichletGroup(5, QQ).0
sage: f = DirichletGroup(5,CyclotomicField(4)).0
sage: e*f
Dirichlet character modulo 5 of conductor 5 mapping 2 |--> -zeta4
AUTHORS:
Bases: sage.structure.element.MultiplicativeGroupElement
A Dirichlet character
Return the complex conjugate of this Dirichlet character.
EXAMPLES:
sage: e = DirichletGroup(5).0
sage: e
Dirichlet character modulo 5 of conductor 5 mapping 2 |--> zeta4
sage: e.bar()
Dirichlet character modulo 5 of conductor 5 mapping 2 |--> -zeta4
Returns the base ring of this Dirichlet character.
EXAMPLES:
sage: G = DirichletGroup(11)
sage: G.gen(0).base_ring()
Cyclotomic Field of order 10 and degree 4
sage: G = DirichletGroup(11, RationalField())
sage: G.gen(0).base_ring()
Rational Field
Returns the generalized Bernoulli number .
INPUT:
Let eps be this character (not necessarily primitive), and let be an integer weight. This function computes the (generalized) Bernoulli number , e.g., as defined on page 44 of Diamond-Im:
where is the modulus of .
The default algorithm is the recurrence on page 656 of Cohen’s GTM ‘Number Theory and Diophantine Equations’, section 9.
EXAMPLES:
sage: G = DirichletGroup(13)
sage: e = G.0
sage: e.bernoulli(5)
7430/13*zeta12^3 - 34750/13*zeta12^2 - 11380/13*zeta12 + 9110/13
sage: eps = DirichletGroup(9).0
sage: eps.bernoulli(3)
10*zeta6 + 4
sage: eps.bernoulli(3, algorithm="definition")
10*zeta6 + 4
Returns the base extension of self to the ring R.
EXAMPLE:
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
sage: e = DirichletGroup(13).0
sage: e.change_ring(QQ)
...
ValueError: cannot coerce element of order 12 into self
Computes and returns the conductor of this character.
EXAMPLES:
sage: G.<a,b> = DirichletGroup(20)
sage: a.conductor()
4
sage: b.conductor()
5
sage: (a*b).conductor()
20
Return the decomposition of self as a product of Dirichlet characters of prime power modulus, where the prime powers exactly divide the modulus of this character.
EXAMPLES:
sage: G.<a,b> = DirichletGroup(20)
sage: c = a*b
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
sage: d[1].parent()
Group of Dirichlet characters of modulus 5 over 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:
sage: d[0]*d[1] == c
...
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'
We can multiply if we’re explicit about where we want the multiplication to take place.
sage: G(d[0])*G(d[1]) == c
True
Conductors that are divisible by various powers of 2 present some problems as the multiplicative group modulo is trivial for and non-cyclic for :
sage: (DirichletGroup(18).0).decomposition()
[Dirichlet character modulo 2 of conductor 1 mapping , Dirichlet character modulo 9 of conductor 9 mapping 2 |--> zeta6]
sage: (DirichletGroup(36).0).decomposition()
[Dirichlet character modulo 4 of conductor 4 mapping 3 |--> -1, Dirichlet character modulo 9 of conductor 1 mapping 2 |--> 1]
sage: (DirichletGroup(72).0).decomposition()
[Dirichlet character modulo 8 of conductor 4 mapping 7 |--> -1, 5 |--> 1, Dirichlet character modulo 9 of conductor 1 mapping 2 |--> 1]
Return the underlying -module vector of exponents.
Warning
Please do not change the entries of the returned vector; this vector is mutable only because immutable vectors are implemented yet.
EXAMPLE:
sage: G.<a,b> = DirichletGroup(20)
sage: a.element()
(2, 0)
sage: b.element()
(0, 1)
Returns the extension of this character to a Dirichlet character modulo the multiple M of the modulus.
EXAMPLES:
sage: G.<a,b> = DirichletGroup(20)
sage: H.<c> = DirichletGroup(4)
sage: c.extend(20)
Dirichlet character modulo 20 of conductor 4 mapping 11 |--> -1, 17 |--> 1
sage: a
Dirichlet character modulo 20 of conductor 4 mapping 11 |--> -1, 17 |--> 1
sage: c.extend(20) == a
True
Return the orbit of this character under the action of the absolute Galois group of the prime subfield of the base ring.
EXAMPLES:
sage: G = DirichletGroup(30); e = G.1
sage: e.galois_orbit()
[Dirichlet character modulo 30 of conductor 5 mapping 11 |--> 1, 7 |--> zeta4, Dirichlet character modulo 30 of conductor 5 mapping 11 |--> 1, 7 |--> -zeta4]
Another example:
sage: G = DirichletGroup(13)
sage: G.galois_orbits()
[
[Dirichlet character modulo 13 of conductor 1 mapping 2 |--> 1], ... [Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -1]
]
sage: e = G.0
sage: e
Dirichlet character modulo 13 of conductor 13 mapping 2 |--> zeta12
sage: e.galois_orbit()
[Dirichlet character modulo 13 of conductor 13 mapping 2 |--> zeta12, Dirichlet character modulo 13 of conductor 13 mapping 2 |--> zeta12^3 - zeta12, Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -zeta12, Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -zeta12^3 + zeta12]
sage: e = G.0^2; e
Dirichlet character modulo 13 of conductor 13 mapping 2 |--> zeta12^2
sage: e.galois_orbit()
[Dirichlet character modulo 13 of conductor 13 mapping 2 |--> zeta12^2, Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -zeta12^2 + 1]
A non-example:
sage: chi = DirichletGroup(7, Integers(9), zeta = Integers(9)(2)).0
sage: chi.galois_orbit()
...
TypeError: Galois orbits only defined if base ring is an integral domain
Return a Gauss sum associated to this Dirichlet character.
The Gauss sum associated to is
where is the modulus of and is a primitive root of unity, i.e., is self.parent().zeta().
FACTS: If the modulus is a prime and the character is nontrivial, then the Gauss sum has absolute value .
CACHING: Computed Gauss sums are not cached with this character.
EXAMPLES:
sage: G = DirichletGroup(3)
sage: e = G([-1])
sage: e.gauss_sum(1)
2*zeta6 - 1
sage: e.gauss_sum(2)
-2*zeta6 + 1
sage: norm(e.gauss_sum())
3
sage: G = DirichletGroup(13)
sage: e = G.0
sage: e.gauss_sum()
-zeta156^46 + zeta156^45 + zeta156^42 + zeta156^41 + 2*zeta156^40 + zeta156^37 - zeta156^36 - zeta156^34 - zeta156^33 - zeta156^31 + 2*zeta156^30 + zeta156^28 - zeta156^24 - zeta156^22 + zeta156^21 + zeta156^20 - zeta156^19 + zeta156^18 - zeta156^16 - zeta156^15 - 2*zeta156^14 - zeta156^10 + zeta156^8 + zeta156^7 + zeta156^6 + zeta156^5 - zeta156^4 - zeta156^2 - 1
sage: factor(norm(e.gauss_sum()))
13^24
Return a Gauss sum associated to this Dirichlet character as an approximate complex number with prec bits of precision.
INPUT:
The Gauss sum associated to is
where is the modulus of and is a primitive root of unity, i.e., is self.parent().zeta().
EXAMPLES:
sage: G = DirichletGroup(3)
sage: e = G.0
sage: abs(e.gauss_sum_numerical())
1.7320508075...
sage: sqrt(3.0)
1.73205080756888
sage: e.gauss_sum_numerical(a=2)
-...e-15 - 1.7320508075...*I
sage: e.gauss_sum_numerical(a=2, prec=100)
4.7331654313260708324703713917e-30 - 1.7320508075688772935274463415*I
sage: G = DirichletGroup(13)
sage: e = G.0
sage: e.gauss_sum_numerical()
-3.07497205... + 1.8826966926...*I
sage: abs(e.gauss_sum_numerical())
3.60555127546...
sage: sqrt(13.0)
3.60555127546399
Return True if and only if .
EXAMPLES:
sage: G = DirichletGroup(13)
sage: e = G.0
sage: e.is_even()
False
sage: e(-1)
-1
sage: [e.is_even() for e in G]
[True, False, True, False, True, False, True, False, True, False, True, False]
Note that is_even need not be the negation of is_odd, e.g., in characteristic 2:
sage: G.<e> = DirichletGroup(13, GF(4,'a'))
sage: e.is_even()
True
sage: e.is_odd()
True
Return True if and only if .
EXAMPLES:
sage: G = DirichletGroup(13)
sage: e = G.0
sage: e.is_odd()
True
sage: [e.is_odd() for e in G]
[False, True, False, True, False, True, False, True, False, True, False, True]
Note that is_even need not be the negation of is_odd, e.g., in characteristic 2:
sage: G.<e> = DirichletGroup(13, GF(4,'a'))
sage: e.is_even()
True
sage: e.is_odd()
True
Return True if and only if this character is primitive, i.e., its conductor equals its modulus.
EXAMPLES:
sage: G.<a,b> = DirichletGroup(20)
sage: a.is_primitive()
False
sage: b.is_primitive()
False
sage: (a*b).is_primitive()
True
Returns True if this is the trivial character, i.e., has order 1.
EXAMPLES:
sage: G.<a,b> = DirichletGroup(20)
sage: a.is_trivial()
False
sage: (a^2).is_trivial()
True
Return the Jacobi sum associated to these Dirichlet characters (i.e., J(self,char)). This is defined as
where and are both characters modulo .
EXAMPLES:
sage: D = DirichletGroup(13)
sage: e = D.0
sage: f = D[-2]
sage: e.jacobi_sum(f)
3*zeta12^2 + 2*zeta12 - 3
sage: f.jacobi_sum(e)
3*zeta12^2 + 2*zeta12 - 3
sage: p = 7
sage: DP = DirichletGroup(p)
sage: f = DP.0
sage: e.jacobi_sum(f)
...
NotImplementedError: Characters must be from the same Dirichlet Group.
sage: all_jacobi_sums = [(DP[i].values_on_gens(),DP[j].values_on_gens(),DP[i].jacobi_sum(DP[j])) ... for i in range(p-1) for j in range(p-1)[i:]]
...
sage: for s in all_jacobi_sums:
... print s
((1,), (1,), 5)
((1,), (zeta6,), -1)
((1,), (zeta6 - 1,), -1)
((1,), (-1,), -1)
((1,), (-zeta6,), -1)
((1,), (-zeta6 + 1,), -1)
((zeta6,), (zeta6,), -zeta6 + 3)
((zeta6,), (zeta6 - 1,), 2*zeta6 + 1)
((zeta6,), (-1,), -2*zeta6 - 1)
((zeta6,), (-zeta6,), zeta6 - 3)
((zeta6,), (-zeta6 + 1,), 1)
((zeta6 - 1,), (zeta6 - 1,), -3*zeta6 + 2)
((zeta6 - 1,), (-1,), 2*zeta6 + 1)
((zeta6 - 1,), (-zeta6,), -1)
((zeta6 - 1,), (-zeta6 + 1,), -zeta6 - 2)
((-1,), (-1,), 1)
((-1,), (-zeta6,), -2*zeta6 + 3)
((-1,), (-zeta6 + 1,), 2*zeta6 - 3)
((-zeta6,), (-zeta6,), 3*zeta6 - 1)
((-zeta6,), (-zeta6 + 1,), -2*zeta6 + 3)
((-zeta6 + 1,), (-zeta6 + 1,), zeta6 + 2)
Let’s check that trivial sums are being calculated correctly:
sage: N = 13
sage: D = DirichletGroup(N)
sage: g = D(1)
sage: g.jacobi_sum(g)
11
sage: sum([g(x)*g(1-x) for x in IntegerModRing(N)])
11
And sums where exactly one character is nontrivial (see trac #6393):
sage: G=DirichletGroup(5); X=G.list(); Y=X[0]; Z=X[1]
sage: Y.jacobi_sum(Z)
-1
sage: Z.jacobi_sum(Y)
-1
Now let’s take a look at a non-prime modulus:
sage: N = 9
sage: D = DirichletGroup(N)
sage: g = D(1)
sage: g.jacobi_sum(g)
3
We consider a sum with values in a finite field:
sage: g = DirichletGroup(17, GF(9,'a')).0
sage: g.jacobi_sum(g**2)
2*a
TESTS:
This shows that ticket #6393 has been fixed:
sage: G = DirichletGroup(5); X = G.list(); Y = X[0]; Z = X[1]
sage: # Y is trivial and Z is quartic
sage: sum([Y(x)*Z(1-x) for x in IntegerModRing(5)])
-1
sage: # The value -1 above is the correct value of the Jacobi sum J(Y, Z).
sage: Y.jacobi_sum(Z); Z.jacobi_sum(Y)
-1
-1
Return the kernel of this character.
OUTPUT: Currently the kernel is returned as a list. This may change.
EXAMPLES:
sage: G.<a,b> = DirichletGroup(20)
sage: a.kernel()
[1, 9, 13, 17]
sage: b.kernel()
[1, 11]
Return the “twisted” Kloosterman sum associated to this Dirichlet character. This includes Gauss sums, classical Kloosterman sums, Salie sums, etc.
The Kloosterman sum associated to and the integers a,b is
where is the modulus of and is a primitive th root of unity. This reduces to to the Gauss sum if .
This method performs an exact calculation and returns an element of a suitable cyclotomic field; see also kloosterman_sum_numerical(), which gives an inexact answer (but is generally much quicker).
CACHING: Computed Kloosterman sums are not cached with this character.
EXAMPLES:
sage: G = DirichletGroup(3)
sage: e = G([-1])
sage: e.kloosterman_sum(3,5)
-2*zeta6 + 1
sage: G = DirichletGroup(20)
sage: e = G([1 for u in G.unit_gens()])
sage: e.kloosterman_sum(7,17)
-2*zeta20^6 + 2*zeta20^4 + 4
Return the Kloosterman sum associated to this Dirichlet character as an approximate complex number with prec bits of precision. See also kloosterman_sum(), which calculates the sum exactly (which is generally slower).
INPUT:
EXAMPLES:
sage: G = DirichletGroup(3)
sage: e = G.0
The real component of the numerical value of e is near zero:
sage: v=e.kloosterman_sum_numerical()
sage: v.real() < 1.0e15
True
sage: v.imag()
1.73205080756888
sage: G = DirichletGroup(20)
sage: e = G.1
sage: e.kloosterman_sum_numerical(53,3,11)
3.80422606518061 - 3.80422606518061*I
Synonym for modulus.
EXAMPLE:
sage: e = DirichletGroup(100, QQ).0
sage: e.level()
100
Let
be a Dirichlet character. This function returns an equal Dirichlet character
where is the least common multiple of and the exponent of .
EXAMPLES:
sage: G.<a,b> = DirichletGroup(20,QQ)
sage: b.maximize_base_ring()
Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> -1
sage: b.maximize_base_ring().base_ring()
Cyclotomic Field of order 4 and degree 2
sage: DirichletGroup(20).base_ring()
Cyclotomic Field of order 4 and degree 2
Return a Dirichlet character that equals this one, but over as small a subfield (or subring) of the base ring as possible.
Note
This function is currently only implemented when the base ring is a number field. It’s the identity function in characteristic p.
EXAMPLES:
sage: G = DirichletGroup(13)
sage: e = DirichletGroup(13).0
sage: e.base_ring()
Cyclotomic Field of order 12 and degree 4
sage: e.minimize_base_ring().base_ring()
Cyclotomic Field of order 12 and degree 4
sage: (e^2).minimize_base_ring().base_ring()
Cyclotomic Field of order 6 and degree 2
sage: (e^3).minimize_base_ring().base_ring()
Cyclotomic Field of order 4 and degree 2
sage: (e^12).minimize_base_ring().base_ring()
Rational Field
The modulus of this character.
EXAMPLES:
sage: e = DirichletGroup(100, QQ).0
sage: e.modulus()
100
sage: e.conductor()
4
The order of this character.
EXAMPLES:
sage: e = DirichletGroup(100).1
sage: e.order() # same as multiplicative_order, since group is multiplicative
20
sage: e.multiplicative_order()
20
sage: e = DirichletGroup(100).0
sage: e.multiplicative_order()
2
Returns the primitive character associated to self.
EXAMPLES:
sage: e = DirichletGroup(100).0; e
Dirichlet character modulo 100 of conductor 4 mapping 51 |--> -1, 77 |--> 1
sage: e.conductor()
4
sage: f = e.primitive_character(); f
Dirichlet character modulo 4 of conductor 4 mapping 3 |--> -1
sage: f.modulus()
4
Returns the restriction of this character to a Dirichlet character modulo the divisor M of the modulus, which must also be a multiple of the conductor of this character.
EXAMPLES:
sage: e = DirichletGroup(100).0
sage: e.modulus()
100
sage: e.conductor()
4
sage: e.restrict(20)
Dirichlet character modulo 20 of conductor 4 mapping 11 |--> -1, 17 |--> 1
sage: e.restrict(4)
Dirichlet character modulo 4 of conductor 4 mapping 3 |--> -1
sage: e.restrict(50)
...
ValueError: conductor(=4) must divide M(=50)
Returns a list of the values of this character on each integer between 0 and the modulus.
EXAMPLES:
sage: e = DirichletGroup(20)(1)
sage: e.values()
[0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1]
sage: e = DirichletGroup(20).gen(0)
sage: print e.values()
[0, 1, 0, -1, 0, 0, 0, -1, 0, 1, 0, -1, 0, 1, 0, 0, 0, 1, 0, -1]
sage: e = DirichletGroup(20).gen(1)
sage: e.values()
[0, 1, 0, -zeta4, 0, 0, 0, zeta4, 0, -1, 0, 1, 0, -zeta4, 0, 0, 0, zeta4, 0, -1]
sage: e = DirichletGroup(21).gen(0) ; e.values()
[0, 1, -1, 0, 1, -1, 0, 0, -1, 0, 1, -1, 0, 1, 0, 0, 1, -1, 0, 1, -1]
sage: e = DirichletGroup(21, base_ring=GF(37)).gen(0) ; e.values()
[0, 1, 36, 0, 1, 36, 0, 0, 36, 0, 1, 36, 0, 1, 0, 0, 1, 36, 0, 1, 36]
sage: e = DirichletGroup(21, base_ring=GF(3)).gen(0) ; e.values()
[0, 1, 2, 0, 1, 2, 0, 0, 2, 0, 1, 2, 0, 1, 0, 0, 1, 2, 0, 1, 2]
sage: chi = DirichletGroup(100151, CyclotomicField(10)).0
sage: ls = chi.values() ; ls[0:10]
[0,
1,
-zeta10^3,
-zeta10,
-zeta10,
1,
zeta10^3 - zeta10^2 + zeta10 - 1,
zeta10,
zeta10^3 - zeta10^2 + zeta10 - 1,
zeta10^2]
Returns a tuple of the values of this character on each of the minimal generators of , where is the modulus.
EXAMPLES:
sage: e = DirichletGroup(16)([-1, 1])
sage: e.values_on_gens ()
(-1, 1)
The group of Dirichlet characters modulo with values in the subgroup of the multiplicative group of the base_ring. If the base_ring is omitted then we use , where is the exponent of . If is omitted then we compute and use a maximal-order zeta in base_ring, if possible.
INPUT:
OUTPUT:
EXAMPLES:
The default base ring is a cyclotomic field of order the exponent of .
sage: DirichletGroup(20)
Group of Dirichlet characters of modulus 20 over 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
sage: G.order()
4
sage: G.base_ring()
Rational Field
The elements of G print as lists giving the values of the character on the generators of :
sage: list(G)
[Dirichlet character modulo 20 of conductor 1 mapping 11 |--> 1, 17 |--> 1, Dirichlet character modulo 20 of conductor 4 mapping 11 |--> -1, 17 |--> 1, Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> -1, Dirichlet character modulo 20 of conductor 20 mapping 11 |--> -1, 17 |--> -1]
Next we construct the group of Dirichlet character mod 20, but with values in Q(zeta_n):
sage: G = DirichletGroup(20)
sage: G.1
Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> zeta4
We next compute several invariants of G:
sage: G.gens()
(Dirichlet character modulo 20 of conductor 4 mapping 11 |--> -1, 17 |--> 1, Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> zeta4)
sage: G.unit_gens()
[11, 17]
sage: G.zeta()
zeta4
sage: G.zeta_order()
4
In this example we create a Dirichlet character with values in a number field. We have to give zeta, but not its order.
sage: R.<x> = PolynomialRing(QQ)
sage: K.<a> = NumberField(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
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]
sage: G.<e> = DirichletGroup(13)
sage: loads(G.dumps()) == G
True
sage: G = DirichletGroup(19, GF(5))
sage: loads(G.dumps()) == G
True
We compute a Dirichlet group over a large prime field.
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
Note that the root of unity has small order, i.e., it is not the largest order root of unity in the field.
sage: g.zeta_order()
2
sage: r4 = CyclotomicField(4).ring_of_integers()
sage: G = DirichletGroup(60, r4)
sage: G.gens()
(Dirichlet character modulo 60 of conductor 4 mapping 31 |--> -1, 41 |--> 1, 37 |--> 1, Dirichlet character modulo 60 of conductor 3 mapping 31 |--> 1, 41 |--> -1, 37 |--> 1, Dirichlet character modulo 60 of conductor 5 mapping 31 |--> 1, 41 |--> 1, 37 |--> zeta4)
sage: val = G.gens()[2].values_on_gens()[2] ; val
zeta4
sage: parent(val)
Maximal Order in Cyclotomic Field of order 4 and degree 2
sage: r4.residue_field(r4.ideal(29).factor()[0][0])(val)
17
sage: r4.residue_field(r4.ideal(29).factor()[0][0])(val) * GF(29)(3)
22
sage: r4.residue_field(r4.ideal(29).factor()[0][0])(G.gens()[2].values_on_gens()[2]) * 3
22
sage: parent(r4.residue_field(r4.ideal(29).factor()[0][0])(G.gens()[2].values_on_gens()[2]) * 3)
Residue field of Fractional ideal (-2*zeta4 + 5)
sage: DirichletGroup(60, integral=True)
Group of Dirichlet characters of modulus 60 over 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
Bases: sage.structure.parent_gens.ParentWithMultiplicativeAbelianGens
Group of Dirichlet characters modulo over a given base ring .
Returns the Dirichlet group over R obtained by extending scalars, with the same modulus and root of unity as self.
EXAMPLES:
sage: G = DirichletGroup(7,QQ); G
Group of Dirichlet characters of modulus 7 over 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
sage: H.zeta()
-1
sage: G.base_extend(ZZ)
...
TypeError: No coercion map from 'Rational Field' to 'Integer Ring' is defined.
Returns the Dirichlet group over R with the same modulus as self.
EXAMPLES:
sage: G = DirichletGroup(7,QQ); G
Group of Dirichlet characters of modulus 7 over Rational Field
sage: G.change_ring(CyclotomicField(6))
Group of Dirichlet characters of modulus 7 over Cyclotomic Field of order 6 and degree 2
Returns the Dirichlet groups of prime power modulus corresponding to primes dividing modulus.
(Note that if the modulus is 2 mod 4, there will be a “factor” of , which is the trivial group.)
EXAMPLES:
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
]
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
]
Return the exponent of this group.
EXAMPLES:
sage: DirichletGroup(20).exponent()
4
sage: DirichletGroup(20,GF(3)).exponent()
2
sage: DirichletGroup(20,GF(2)).exponent()
1
sage: DirichletGroup(37).exponent()
36
Return a list of the Galois orbits of Dirichlet characters in self, or in v if v is not None.
INPUT:
The Galois group is the absolute Galois group of the prime subfield of Frac(R). If R is not a domain, an error will be raised.
EXAMPLES:
sage: DirichletGroup(20).galois_orbits()
[
[Dirichlet character modulo 20 of conductor 1 mapping 11 |--> 1, 17 |--> 1], ... [Dirichlet character modulo 20 of conductor 20 mapping 11 |--> -1, 17 |--> -1]
]
sage: DirichletGroup(17, Integers(6), zeta=Integers(6)(5)).galois_orbits()
...
TypeError: Galois orbits only defined if base ring is an integral domain
sage: DirichletGroup(17, Integers(9), zeta=Integers(9)(2)).galois_orbits()
...
TypeError: Galois orbits only defined if base ring is an integral domain
Return the n-th generator of self.
EXAMPLES:
sage: G = DirichletGroup(20)
sage: G.gen(0)
Dirichlet character modulo 20 of conductor 4 mapping 11 |--> -1, 17 |--> 1
sage: G.gen(1)
Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> zeta4
sage: G.gen(2)
...
IndexError: n(=2) must be between 0 and 1
sage: G.gen(-1)
...
IndexError: n(=-1) must be between 0 and 1
Returns generators of self.
EXAMPLES:
sage: G = DirichletGroup(20)
sage: G.gens()
(Dirichlet character modulo 20 of conductor 4 mapping 11 |--> -1, 17 |--> 1, Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> zeta4)
Returns the group of integers where is the modulus of self.
EXAMPLES:
sage: G = DirichletGroup(20)
sage: G.integers_mod()
Ring of integers modulo 20
Returns the modulus of self.
EXAMPLES:
sage: G = DirichletGroup(20)
sage: G.modulus()
20
Returns the number of generators of self.
EXAMPLES:
sage: G = DirichletGroup(20)
sage: G.ngens()
2
Return the number of elements of self. This is the same as len(self).
EXAMPLES:
sage: DirichletGroup(20).order()
8
sage: DirichletGroup(37).order()
36
Return a random element of self.
The element is computed by multiplying a random power of each generator together, where the power is between 0 and the order of the generator minus 1, inclusive.
EXAMPLES:
sage: DirichletGroup(37).random_element()
Dirichlet character modulo 37 of conductor 37 mapping 2 |--> zeta36^4
sage: DirichletGroup(20).random_element()
Dirichlet character modulo 20 of conductor 4 mapping 11 |--> -1, 17 |--> 1
sage: DirichletGroup(60).random_element()
Dirichlet character modulo 60 of conductor 3 mapping 31 |--> 1, 41 |--> -1, 37 |--> 1
Returns the minimal generators for the units of , where is the modulus of self.
EXAMPLES:
sage: DirichletGroup(37).unit_gens()
[2]
sage: DirichletGroup(20).unit_gens()
[11, 17]
sage: DirichletGroup(60).unit_gens()
[31, 41, 37]
sage: DirichletGroup(20,QQ).unit_gens()
[11, 17]
Returns the chosen root zeta of unity in the base ring .
EXAMPLES:
sage: DirichletGroup(37).zeta()
zeta36
sage: DirichletGroup(20).zeta()
zeta4
sage: DirichletGroup(60).zeta()
zeta4
sage: DirichletGroup(60,QQ).zeta()
-1
sage: DirichletGroup(60, GF(25,'a')).zeta()
2
Returns the order of the chosen root zeta of unity in the base ring .
EXAMPLES:
sage: DirichletGroup(20).zeta_order()
4
sage: DirichletGroup(60).zeta_order()
4
sage: DirichletGroup(60, GF(25,'a')).zeta_order()
4
sage: DirichletGroup(19).zeta_order()
18
Return the trivial character of the given modulus, with values in the given base ring.
EXAMPLE:
sage: t = trivial_character(7)
sage: [t(x) for x in [0..20]]
[0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]
sage: t(1).parent()
Rational Field
sage: trivial_character(7, Integers(3))(1).parent()
Ring of integers modulo 3
Return True if x is of type DirichletCharacter.
EXAMPLES:
sage: from sage.modular.dirichlet import is_DirichletCharacter
sage: is_DirichletCharacter(trivial_character(3))
True
sage: is_DirichletCharacter([1])
False
Returns True if x is a Dirichlet group.
EXAMPLES:
sage: from sage.modular.dirichlet import is_DirichletGroup
sage: is_DirichletGroup(DirichletGroup(11))
True
sage: is_DirichletGroup(11)
False
sage: is_DirichletGroup(DirichletGroup(11).0)
False
Returns the quadratic Dirichlet character (d/.) of minimal conductor.
EXAMPLES:
sage: kronecker_character(97*389*997^2)
Dirichlet character modulo 37733 of conductor 37733 mapping 1557 |--> -1, 37346 |--> -1
sage: a = kronecker_character(1)
sage: b = DirichletGroup(2401,QQ)(a) # NOTE -- over QQ!
sage: b.modulus()
2401
AUTHORS:
Returns the quadratic Dirichlet character (./d) of conductor d, for d0.
EXAMPLES:
sage: kronecker_character_upside_down(97*389*997^2)
Dirichlet character modulo 37506941597 of conductor 37733 mapping 13533432536 |--> -1, 22369178537 |--> -1, 14266017175 |--> 1
AUTHORS:
Return the trivial character of the given modulus, with values in the given base ring.
EXAMPLE:
sage: t = trivial_character(7)
sage: [t(x) for x in [0..20]]
[0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]
sage: t(1).parent()
Rational Field
sage: trivial_character(7, Integers(3))(1).parent()
Ring of integers modulo 3