L-functions

Dirichlet characters

A Dirichlet character is a pattern of roots of unity that repeats modulo qq and respects multiplication. Characters pick out residue classes the way sines and cosines pick out frequencies, which is how Dirichlet proved that every progression a,a+q,a+2q,…a, a + q, a + 2q, \dots with gcd⁡(a,q)=1\gcd(a, q) = 1 contains infinitely many primes.

Definition and numbering

A character modulo qq is a function χ\chi on the integers with χ(mn)=χ(m)χ(n)\chi(mn) = \chi(m)\chi(n), χ(n+q)=χ(n)\chi(n + q) = \chi(n), and χ(n)=0\chi(n) = 0 exactly when gcd⁡(n,q)>1\gcd(n, q) > 1. Its nonzero values are roots of unity. There are φ(q)\varphi(q) characters modulo qq, and under multiplication they form a group isomorphic to the units modulo qq.

That isomorphism can be made explicit, and Conrey's numbering (the one used by the LMFDB) does so: for each mm coprime to qq there is a character χq(m,⋅)\chi_q(m, \cdot), with χq(m,n)=χq(n,m)\chi_q(m, n) = \chi_q(n, m). For an odd prime power pep^e with least primitive root gg,

χpe(ga,gb)=exp⁡ ⁣(2πi abφ(pe)), \chi_{p^e}(g^a, g^b) = \exp\!\left( \frac{2\pi i\, ab}{\varphi(p^e)} \right),

with a similar rule for powers of 2 using ±5a\pm 5^a, and a product over the prime powers of qq.

import { dirichletCharacter, dirichletGroup } from "@ratmath/numtheory";

const chi = dirichletCharacter(7, 3);
String(chi);            // "χ_7(3, ·)"
chi.order;              // 6
chi.exponent(2);        // 1/3: χ(2) = exp(2πi/3), exactly
chi.exponents();        // [null, 0, 1/3, 1/6, 2/3, 5/6, 1/2] for n = 0, …, 6
chi.value(2);           // { re: -0.5, im: 0.866… }
chi.parity;             // "odd": χ(−1) = −1

Values are kept exactly as fractions tt with χ(n)=e2πit\chi(n) = e^{2\pi i t}; value gives the complex number in doubles, and at(n) gives 0,1,−10, 1, -1 as BigInts for a real character.

The group of characters

const G = dirichletGroup(15);
G.order;                 // 8
G.structure;             // [2, 4]: the group is Z/2 × Z/4, like the units mod 15
G.characters.map((c) => [c.number, c.order, c.conductor, c.parity]);
// [1, 1, 1, even] [2, 4, 15, even] [4, 2, 5, even] [7, 4, 5, odd]
// [8, 4, 15, even] [11, 2, 3, odd] [13, 4, 5, odd] [14, 2, 15, odd]

String(dirichletCharacter(15, 2).mul(dirichletCharacter(15, 2)));    // "χ_15(4, ·)": numbers multiply
String(dirichletCharacter(3, 2).mul(dirichletCharacter(5, 2)));      // "χ_15(2, ·)": moduli combine
String(dirichletCharacter(15, 2).conjugate());                       // "χ_15(8, ·)"

The orthogonality relations are what make characters useful: summing over all characters isolates one residue class.

∑χ mod qχ(a) χ(b)‾={φ(q)a≡b(modq), gcd⁡(a,q)=10otherwise. \sum_{\chi \bmod q} \chi(a)\,\overline{\chi(b)} = \begin{cases} \varphi(q) & a \equiv b \pmod q,\ \gcd(a, q) = 1 \\ 0 & \text{otherwise.} \end{cases}
G.orthogonality(2, 2);     // { re: 8, im: 0 }
G.orthogonality(2, 7);     // { re: 0, im: 0 }

Conductors and primitive characters

A character modulo 15 may really come from a smaller modulus: χ15(11,⋅)\chi_{15}(11, \cdot) only depends on nn modulo 3, wherever it is not zero. The smallest such modulus is the conductor, and a character is primitive when its conductor is its modulus. Every character is induced by exactly one primitive character.

const c = dirichletCharacter(15, 11);
c.conductor;               // 3
String(c.primitive());     // "χ_3(2, ·)"
G.primitive.map((x) => x.number);                 // [2, 8, 14]
String(dirichletCharacter(5, 2).induce(15));      // "χ_15(7, ·)"

For a primitive character the Gauss sum τ(χ)=∑aχ(a)e2πia/q\tau(\chi) = \sum_a \chi(a) e^{2\pi i a/q} has absolute value exactly q\sqrt q; it is the constant in the functional equation of the L-function.

Real characters and the Kronecker symbol

The characters with values in {0,1,−1}\{0, 1, -1\} are the quadratic ones. For a discriminant DD, the Kronecker symbol n↦(Dn)n \mapsto \left(\frac{D}{n}\right) is a character modulo ∣D∣|D|, primitive exactly when DD is a fundamental discriminant. It records how primes split in Q(D)\mathbb{Q}(\sqrt D): pp splits when the symbol is 11, is inert when it is −1-1, and ramifies when it is 00.

const k = kroneckerCharacter(-23);
String(k);                               // "χ_23(22, ·)"
[1, 2, 3, 4, 5, 6, 7].map((n) => k.at(n));   // [1n, 1n, 1n, 1n, -1n, 1n, -1n]
k.isPrimitive;                           // true
k.gaussSum();                            // { re: 0, im: 4.7958… }: i·√23
String(kroneckerCharacter(-4));          // "χ_4(3, ·)"
String(kroneckerCharacter(5));           // "χ_5(4, ·)"

What characters are for: the L-functions L(s,χ)=∑χ(n)n−sL(s, \chi) = \sum \chi(n) n^{-s}, in Zeta and L values.

Try itEdit the code and run it with @ratmath/numtheory and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.
Ctrl/⌘ + Enter runs