E077: Indicator via character orthogonality (sanity check).¶
Tags: number-theory, quantitative-exploration, visualization, dirichlet-characters
Highlights¶
Uses character orthogonality to reconstruct residue indicators.
Measures reconstruction error / maximal partial sums across characters.
Explores how primitive characters vary with the modulus.
What this experiment does¶
A standard identity expresses an indicator of a residue class using Dirichlet characters. For gcd(a,q)=1 and gcd(n,q)=1:
The implementation focuses on a compact, reproducible numerical workflow: deterministic parameter defaults, structured output folders, and one or more figures saved for the gallery.
Outputs¶
This experiment writes into out/e077/:
figures/fig_01_indicator_error.png
How to run¶
make run EXP=e077
Notes¶
The gallery preview figure shipped with the documentation uses conservative cutoffs so builds stay fast. If you run the experiment locally, increase the cutoffs to see the asymptotic regime more clearly.
Prime-race plots depend on the chosen sampling of
x(linear vs. log grid). The qualitative “who leads” picture can change when you zoom in.
Published run snapshot¶
If this experiment is included in the docs gallery, include the published snapshot (report + params).
q: 9
a_target: 2
phi(q): 6
max abs error: 1.665e-16
Figure:
fig_01_indicator_error.png
Notes:
The identity holds on units (gcd(n,q)=1). Non-units are outside the unit group, and χ(n)=0 there.
params.json (snapshot)
{
"a_target": 2,
"q": 9
}