generate.py

back to table · edit · history · where entries came from · files · download

2911 bytes, as of the version from 2026-11-18 19:41 (current). Recorded here, not run.

"""T759: Shifted Hankel determinants of Riemann zeta screw-function moments.

Requires SageMath with Arb/FLINT, numberdb, and adjacent moment_series.py.
For private-draft reads, set NUMBERDB_API_KEY in the local environment.
For writes, also set NUMBERDB_ENGINE, NUMBERDB_MODEL and NUMBERDB_RUN_ID.
  sage -pip install numberdb
  sage -python generate.py             # verify every stored entry, no writes
  sage -python generate.py --publish   # fill assigned private draft only

E_n=det[mu_(i+j+1)]_(i,j=0)^n, an (n+1)-square matrix, with mu defined by
Suzuki arXiv:2206.03682v4 (1.13),(1.15). Raw signed ordinary moments and
raw determinants are used; no absolute value, factorial or scale is stored.
The default selection is all 0<=n<=20, a practical finite prefix of n>=0.
Every moment input through 2*nmax+1 is recomputed by the helper, rather than
read from a sibling table. Native acb matrices propagate these balls.
Working precision starts at 1024 bits and doubles until every determinant
has digits*log2(10)+96 retained relative bits. The source of rigorous
coefficient bounds is FLINT's native zeta/gamma/log power-series arithmetic.
Real output follows from the defining real coefficients, not just an
imaginary enclosure containing zero. See numerical-evidence.md for
measured precision and independent theta/Li plus Bareiss checks.
"""
import os,sys
from functools import lru_cache
import numberdb.sage as numberdb
from sage.rings.complex_arb import ComplexBallField
import sage.rings.polynomial.laurent_polynomial_ring
from sage.matrix.constructor import matrix
from moment_series import moment_balls_at

@lru_cache(maxsize=8)
def determinant_balls(digits=100,nmax=20):
    bits=max(1024,numberdb.bits(digits,losing=512))
    target=numberdb.bits(digits,losing=96)
    while True:
        mu=moment_balls_at(bits,2*nmax+1);C=ComplexBallField(bits);out=[]
        for n in range(nmax+1):
            z=matrix(C,n+1,n+1,lambda i,j:C(mu[i+j+1])).det()
            if not (z.real().is_finite() and z.imag().is_finite() and z.imag().contains_zero()):
                raise ArithmeticError('Nonfinite or nonreal determinant')
            out.append(z.real())
        if min(v.accuracy() for v in out)>=target:return tuple(out),mu,bits
        bits*=2
        if bits>16384:raise ArithmeticError('Determinant precision failed to converge')

class ShiftedScrewHankel(numberdb.Generator):
    table=os.environ.get('NUMBERDB_TABLE','T759')
    parameters=('n',)
    type='R'
    digits=100
    rigour='proven'
    def enumerate(self,nmax=20):
        for n in range(nmax+1):yield {'n':n}
    def value(self,params,digits):
        n=int(params['n'])
        if n<0:raise ValueError('Hankel index must be nonnegative')
        return determinant_balls(digits,max(20,n))[0][n]

if __name__=='__main__':
    g=ShiftedScrewHankel()
    print(g.publish() if '--publish' in sys.argv else g.verify(sample=None))