Module: sage.modular.dirichlet
A DirichletCharacter is the extension of a homomorphism
for some ring
sage: G, x = DirichletGroup(35).objgens() sage: e = x[0]*x[1]^2; e [zeta12^3, zeta12^2 - 1] sage: e.order() 12
Author Log:
Module-level Functions
modulus, [base_ring=None], [zeta=None], [zeta_order=None]) |
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: modulus -- int base_ring -- Ring (optional), where characters take their values (should be an integral domain). zeta -- Element (optional), element of base_ring; zeta is a root of unity zeta_order -- int (optional), the order of zeta OUTPUT: DirichletGroup -- a group of Dirichlet characters.
NOTES: Uniqueness - If a group is created with the same parameters as another DirichletGroup still in memory, then the same group is returned instead of a new group defined by the same parameters.
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, Q); 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) [[1, 1], [-1, 1], [1, -1], [-1, -1]]
Next we construct the group of Dirichlet character mod 20, but with values in Q(zeta_n):
sage: G = DirichletGroup(20) sage: G.list() [[1, 1], [-1, 1], [1, zeta4], [-1, zeta4], [1, -1], [-1, -1], [1, -zeta4], [-1, -zeta4]]
We next compute several invariants of G:
sage: G.gens() ([-1, 1], [1, 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 = PolynomialRing(Q); x = R.gen() sage: K = NumberField(x^4 + 1); a = K.gen(0) 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() [[1], [a^2], [-1], [-a^2]]
sage: G, e = DirichletGroup(13).objgens() sage: loads(G.dumps()) == G True
sage: G = DirichletGroup(19, GF(5)) sage: loads(G.dumps()) == G True
N, [base_ring=Rational Field]) |
x) |
x) |
Returns True if x is a Dirichlet group.
sage: is_DirichletGroup(DirichletGroup(11)) True sage: is_DirichletGroup(11) False sage: is_DirichletGroup(DirichletGroup(11).0) False
Class: DirichletCharacter
self, parent, values_on_gens) |
Create with DirichletCharacter(parent, values_on_gens)
INPUT: parent -- DirichletGroup, a group of Dirichlet characters values_on_gens -- tuple (or list) of ring elements, the values of the Dirichlet character on the chosen generators of $(\Z/N\Z)^*$. OUTPUT: DirichletCharacter -- a Dirichlet character
sage: G, e = DirichletGroup(13).objgen() sage: G Group of Dirichlet characters of modulus 13 over Cyclotomic Field of order 12 and degree 4 sage: e [zeta12] sage: loads(e.dumps()) == e True
sage: G, x = DirichletGroup(35).objgens() sage: e = x[0]*x[1]; e [zeta12^3, zeta12^2] sage: e.order() 12 sage: loads(e.dumps()) == e True
Functions: bar,
base_ring,
bernoulli,
change_ring,
conductor,
decomposition,
extend,
galois_orbit,
gauss_sum,
gauss_sum_numerical,
is_even,
is_odd,
is_primitive,
is_trivial,
maximize_base_ring,
minimize_base_ring,
modulus,
multiplicative_order,
primitive_character,
restrict,
values,
values_on_gens
self) |
Return the complex conjugate of this Dirichlet character.
sage: e = DirichletGroup(5).0 sage: e [zeta4] sage: e.bar() [-zeta4]
self) |
Returns the base ring of this Dirichlet character.
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
self, k) |
Returns the generalized Bernoulli number
.
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
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
self, R) |
Returns the base extension of self to the ring R.
sage: e = DirichletGroup(7, QQ).0 sage: f = e.change_ring(QuadraticField(3)) 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) Traceback (most recent call last): ... TypeError: Unable to coerce zeta12 to a rational
self) |
Computes and returns the conductor of this character.
sage: G.<a,b> = DirichletGroup(20) sage: a.conductor() 4 sage: b.conductor() 5 sage: (a*b).conductor() 20
self) |
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.
sage: G.<a,b> = DirichletGroup(20) sage: c = a*b sage: d = c.decomposition(); d [[-1], [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 Traceback (most recent call last): ... TypeError: unable to find a common parent for [-1] (parent: Group of Dirichlet characters of modulus 4 over Cyclotomic Field of order 4 and degree 2) and [zeta4] (parent: 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
self, M) |
Returns the extension of this character to a Dirichlet character modulo the multiple M of the modulus.
sage: G.<a,b> = DirichletGroup(20) sage: H.<c> = DirichletGroup(4) sage: c.extend(20) [-1, 1] sage: a [-1, 1] sage: c.extend(20) == a True
self) |
Return the orbit of this character under the action of the absolute Galois group of the prime subfield of the base ring.
sage: G = DirichletGroup(13) sage: G.galois_orbits() [ [[1]], [[zeta12], [zeta12^3 - zeta12], [-zeta12], [-zeta12^3 + zeta12]], [[zeta12^2], [-zeta12^2 + 1]], [[zeta12^3], [-zeta12^3]], [[zeta12^2 - 1], [-zeta12^2]], [[-1]] ] sage: e = G.0 sage: e [zeta12] sage: e.galois_orbit() [[zeta12], [zeta12^3 - zeta12], [-zeta12], [-zeta12^3 + zeta12]] sage: e = G.0^2; e [zeta12^2] sage: e.galois_orbit() [[zeta12^2], [-zeta12^2 + 1]]
self, [a=1]) |
Return a Gauss sum associated to this Dirichlet character.
The Gauss sum associated to
is
where
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.
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
self, [prec=1], [a=53]) |
Return a Gauss sum associated to this Dirichlet character as an approximate complex number with prec bits of precision.
INPUT: prec -- integer (deafault: 53), *bits* of precision a -- integer, as for gauss_sum.
The Gauss sum associated to
is
where
self.parent().zeta()
.
sage: G = DirichletGroup(3) sage: e = G.0 sage: e.gauss_sum_numerical() 0.00000000000000055511151231257827 + 1.7320508075688772*I sage: abs(e.gauss_sum_numerical()) 1.7320508075688772 sage: sqrt(3) 1.7320508075688772 sage: e.gauss_sum_numerical(a=2) -0.0000000000000011102230246251565 - 1.7320508075688772*I sage: e.gauss_sum_numerical(a=2, prec=100) 0.0000000000000000000000000000047331654313260708324703713916967 - 1.7320508075688772935274463415062*I sage: G = DirichletGroup(13) sage: e = G.0 sage: e.gauss_sum_numerical() -3.0749720589952387 + 1.8826966926190174*I sage: abs(e.gauss_sum_numerical()) 3.6055512754639896 sage: sqrt(13) 3.6055512754639891
self) |
Return True
if and only if
.
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)) sage: e.is_even() True sage: e.is_odd() True
self) |
Return True
if and only if
.
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)) sage: e.is_even() True sage: e.is_odd() True
self) |
Return True
if and only if this character is primitive,
i.e., its conductor equals its modulus.
sage: G.<a,b> = DirichletGroup(20) sage: a.is_primitive() False sage: b.is_primitive() False sage: (a*b).is_primitive() True
self) |
Returns True
if this is the trivial character, i.e., has
order 1.
sage: G.<a,b> = DirichletGroup(20) sage: a.is_trivial() False sage: (a^2).is_trivial() True
self) |
Let
be a Dirichlet character. This function returns an equal Dirichlet character
where
sage: G.<a,b> = DirichletGroup(20,QQ) sage: b.maximize_base_ring() [1, -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
self) |
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.
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
self) |
The modulus of this character.
sage: e = DirichletGroup(100, QQ).0 sage: e.modulus() 100 sage: e.conductor() 4
self) |
The order of this character.
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
self) |
Returns the primitive character associated to self.
sage: e = DirichletGroup(100).0; e [-1, 1] sage: e.conductor() 4 sage: f = e.primitive_character(); f [-1] sage: f.modulus() 4
self, M) |
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.
sage: e = DirichletGroup(100).0 sage: e.modulus() 100 sage: e.conductor() 4 sage: e.restrict(20) [-1, 1] sage: e.restrict(4) [-1] sage: e.restrict(50) Traceback (most recent call last): ... ValueError: conductor(=4) must divide M(=50)
self) |
Returns a list of the values of this character on each integer between 0 and the modulus.
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).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).1 sage: e.values() [0, 1, 0, -zeta4, 0, 0, 0, zeta4, 0, -1, 0, 1, 0, -zeta4, 0, 0, 0, zeta4, 0, -1]
self) |
Returns a tuple of the values of this character on each of the
minimal generators of
, where
is the modulus.
sage: e = DirichletGroup(16)([-1, 1]) sage: e.values_on_gens () (-1, 1)
Special Functions: __call__,
__cmp__,
__invert__,
__pow__,
_DirichletCharacter__eval_at_minus_one,
_mul_,
_repr_
self, m) |
Return the value of this character at the integer
.
sage: e = prod(DirichletGroup(60).gens()) sage: e [-1, -1, zeta4] sage: e(2) 0 sage: e(7) -zeta4 sage: Integers(60).unit_gens() [31, 41, 37] sage: e(31) -1 sage: e(41) -1 sage: e(37) zeta4 sage: e(31*37) -zeta4
self, other) |
sage: e = DirichletGroup(16)([-1, 1]) sage: f = e.restrict(8) sage: e == e True sage: f == f True sage: e == f False
self) |
Return the multiplicative inverse of self. The notation is self.
sage: e = DirichletGroup(13).0 sage: f = ~e sage: f*e [1]
self, n) |
Return self raised to the power of n
sage: G.<a,b> = DirichletGroup(20) sage: a^2 [1, 1] sage: b^2 [1, -1]
self) |
Efficiently evalute the character at -1 using knowledge of its order. This is potentially much more efficient than computing the value of -1 directly using dlog and a large power of the image root of unity.
We use the following.
Proposition: Suppose eps is a character mod
, where
is a prime.
Then
if and only if
and the factor of eps at 4 is nontrivial
or
and 2 does not divide
ord
.
self, other) |
Return the product of self and other.
sage: G.<a,b> = DirichletGroup(20) sage: a [-1, 1] sage: b [1, zeta4] sage: a*b [-1, zeta4]
Class: DirichletGroup_class
self, modulus, [base_ring=None], [zeta=None], [zeta_order=None]) |
Functions: base_ring,
change_ring,
decomposition,
exponent,
galois_orbits,
gen,
gens,
integers_mod,
modulus,
ngens,
order,
random_element,
unit_gens,
zeta,
zeta_order
self) |
Returns the base ring of self.
sage: DirichletGroup(11).base_ring() Cyclotomic Field of order 10 and degree 4 sage: DirichletGroup(11,QQ).base_ring() Rational Field sage: DirichletGroup(11,GF(7)).base_ring() Finite Field of size 7 sage: DirichletGroup(20).base_ring() Cyclotomic Field of order 4 and degree 2
self, R, [zeta=None], [zeta_order=None]) |
Returns the Dirichlet group over R with the same modulus as self.
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
self) |
Returns the Dirichlet groups of prime power modulus corresponding to primes dividing modulus.
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 ]
self) |
Return the exponent of this group.
sage: DirichletGroup(20).exponent() 4 sage: DirichletGroup(20,GF(3)).exponent() 2 sage: DirichletGroup(20,GF(2)).exponent() 1 sage: DirichletGroup(37).exponent() 36
self) |
Return a list of the Galois orbits of Dirichlet characters in self.
The Galois group is the absolute Galois group of the prime subfield of Frac(R).
sage: DirichletGroup(20).galois_orbits() [ [[1, 1]], [[-1, 1]], [[1, zeta4], [1, -zeta4]], [[-1, zeta4], [-1, -zeta4]], [[1, -1]], [[-1, -1]] ]
self, [n=0]) |
Return the n-th generator of self.
sage: G = DirichletGroup(20) sage: G.gen(0) [-1, 1] sage: G.gen(1) [1, zeta4] sage: G.gen(2) Traceback (most recent call last): ... IndexError: n(=2) must be between 0 and 1
sage: G.gen(-1) Traceback (most recent call last): ... IndexError: n(=-1) must be between 0 and 1
self) |
Returns generators of self.
sage: G = DirichletGroup(20) sage: G.gens() ([-1, 1], [1, zeta4])
self) |
Returns the group of integers
where
is the
modulus of self.
sage: G = DirichletGroup(20) sage: G.integers_mod() Ring of integers modulo 20
self) |
Returns the modulus of self.
sage: G = DirichletGroup(20) sage: G.modulus() 20
self) |
Returns the number of generators of self.
sage: G = DirichletGroup(20) sage: G.ngens() 2
self) |
Return the number of elements of self. This is the same as len(self).
sage: DirichletGroup(20).order() 8 sage: DirichletGroup(37).order() 36
self) |
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.
sage: DirichletGroup(37).random_element() [-zeta36^6] sage: DirichletGroup(20).random_element() [-1, -zeta4] sage: DirichletGroup(60).random_element() [1, 1, zeta4]
self) |
Returns the minimal generators for the units of
,
where
is the modulus of self.
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]
self) |
Returns the chosen root zeta of unity in the base ring
.
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)).zeta() 2
self) |
Returns the order of the chosen root zeta of unity in the base
ring
.
sage: DirichletGroup(20).zeta_order() 4 sage: DirichletGroup(60).zeta_order() 4 sage: DirichletGroup(60, GF(25)).zeta_order() 4 sage: DirichletGroup(19).zeta_order() 18
Special Functions: __call__,
__cmp__,
__len__,
_repr_
self, x) |
Coerce x into this Dirichlet group.
sage: G = DirichletGroup(13) sage: K = G.base_ring() sage: G(1) [1] sage: G([-1]) [-1] sage: G([K.0]) [zeta12] sage: G(0) Traceback (most recent call last): ... TypeError: No coercion of 0 into Group of Dirichlet characters of modulus 13 over Cyclotomic Field of order 12 and degree 4 defined.
self, other) |
Compare two Dirichlet groups. They are equal if they have the same modulus, are over the same base ring, and have the same chosen root of unity. Otherwise we compare first on the modulus, then the base ring, and finally the root of unity.
sage: DirichletGroup(13) == DirichletGroup(13) True sage: DirichletGroup(13) == DirichletGroup(13,QQ) False sage: DirichletGroup(11) < DirichletGroup(13,QQ) True sage: DirichletGroup(17) > DirichletGroup(13) True
self) |
Return the number of elements of this Dirichlet group. This is the same as self.order().
sage: len(DirichletGroup(20)) 8 sage: len(DirichletGroup(20, QQ)) 4 sage: len(DirichletGroup(20, GF(5))) 8 sage: len(DirichletGroup(20, GF(2))) 1 sage: len(DirichletGroup(20, GF(3))) 4
self) |
Return a print representation of this group, which can be renamed.
sage: G = DirichletGroup(11) sage: G Group of Dirichlet characters of modulus 11 over Cyclotomic Field of order 10 and degree 4 sage: G.rename('Dir(11)') sage: G Dir(11)
See About this document... for information on suggesting changes.