Skip to content

Secondary zeta function#2717

Draft
fredrik-johansson wants to merge 1 commit into
flintlib:mainfrom
fredrik-johansson:secondzeta
Draft

Secondary zeta function#2717
fredrik-johansson wants to merge 1 commit into
flintlib:mainfrom
fredrik-johansson:secondzeta

Conversation

@fredrik-johansson

@fredrik-johansson fredrik-johansson commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

WIP implementation of the "secondary zeta function"

$$Z(s) = \sum_{n=1}^{\infty} \frac{1}{\alpha^s_n},$$

where $\rho_n = 1/2 + i \alpha_n$ runs over the zeros of $\zeta(s)$ in the upper half plane, following the algorithm of Arias de Reyna (https://arxiv.org/abs/2006.04869).

This evaluates a decomposition $Z(s) = A(s) - P(s) + E(s) - S(s)$ where each term implicitly depends on a free parameter $a > 0$ (the "approximate functional equation" approach). The A and P terms are sums of incomplete gamma functions taken over zeros of zeta, E is a hypergeometric function, and S is an asymptotic series.

The code was mostly AI-generated (Claude Sonnet) with several bug fixes, code simplifications and optimizations done in manual review.

This implementation also depends on AI-derived tail bounds: the P bound of Arias de Reyna is too weak to be practical and has been replaced by a stronger one; the heuristic estimates for the A and S tails have been replaced by rigorous bounds. The AI's proofs can be found in the "companion note" secondary_zeta_master.pdf (not included in the documentation or repository as this would want a much cleaner writeup).

Should we trust the AI here? The math looks correct at least from a cursory view, the code works as intended when tested, producing consistent enclosures at both low and high precision, near singularities, for large imaginary parts, etc. It's reasonable efficient (10-100 times faster than mpmath.secondzeta which has some accuracy problems).

However, bugs in this kind of code tend to be very easily masked by numerical noise, and this function is too expensive to test for tens of thousands of randomized inputs. As such, this would need to be considered somewhat experimental. Fortunately, this is not a super important special function; bugs here aren't "high risk". I consider this interesting mainly as a model for eventually implementing other analytic functions defined in terms of L-function zeros (which have various applications).

PR marked as draft for further review.

@albinahlback

Copy link
Copy Markdown
Collaborator

We could launch a more exhaustive test on my team's Zen 4 computer. We could also try to run an extensive AI review (GPT is supposedly the best AI engine for mathematics, see https://arxiv.org/abs/2606.05818).

@fredrik-johansson

Copy link
Copy Markdown
Collaborator Author

One-time expensive testing isn't a problem; the limitation is that we can't afford to do a lot of checks as part of the normal test suite. Review by a secondary strong AI model would be interesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants