dirichlet_char – Dirichlet characters

class flint.dirichlet_group(ulong q)

Represents the group of Dirichlet characters modulo a given q.

>>> G = dirichlet_group(5)
>>> G
Dirichlet group mod q = 5
q
size(self) → long
class flint.dirichlet_char(dirichlet_group G, ulong index=0)

Represents a Dirichlet character.

Calling the character evaluates the character at the given integer, returning an acb.

>>> chi = dirichlet_char(dirichlet_group(7), 0)
>>> for n in range(7):
...     print(chi(n))
... 
0
1.00000000000000
1.00000000000000
1.00000000000000
1.00000000000000
1.00000000000000
1.00000000000000
>>> chi = dirichlet_char(dirichlet_group(7), 1)
>>> for n in range(7):
...     print(chi(n))
... 
0
1.00000000000000
-0.500000000000000 + [0.866025403784439 +/- 5.15e-16]j
0.500000000000000 + [0.866025403784439 +/- 5.15e-16]j
-0.500000000000000 + [-0.866025403784439 +/- 5.15e-16]j
0.500000000000000 + [-0.866025403784439 +/- 5.15e-16]j
-1.00000000000000
hardy_z(self, s)

Evaluates the Hardy Z-function of this character at the given complex number s.

>>> chi = dirichlet_char(dirichlet_group(1), 0)
>>> showgood(lambda: chi.hardy_z(1), dps=25)
-0.7363054628673177346778998
index
l(self, s)

Evaluates the Dirichlet L-function of this character at the given complex number s.

>>> chi = dirichlet_char(dirichlet_group(1), 0)
>>> showgood(lambda: chi.l(2), dps=25)
1.644934066848226436472415
>>> chi = dirichlet_char(dirichlet_group(7), 1)
>>> showgood(lambda: chi.l(2+3j), dps=25)
1.273313649440490751755284 - 0.07432329442559421607102118j