generate.py

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

1956 bytes, as of the version from 2026-11-16 04:25 (current). Recorded here, not run.

"""T723: Absolute discriminant of the Fermat linear-cycle lattice.

Put reference-divisors.json beside this file. Install the client into Sage:
  sage -pip install numberdb
Then run:
  sage -python generate.py                 # verify all stored values, no write
  sage -python generate.py --publish       # explicitly fill the authorized draft

This generator multiplies the exact elementary divisors of Table 1 in
Aljovin--Movasati--Villaflor Loyola, arXiv:1711.02628v2. Each source row was
independently recomputed from all plane intersections in compute.py/lattice.py;
check_lattice.py verifies the integral quotient and cyclotomic incidences.
The printed leading signs are not used. There is no rounding or digit cutoff.
The natural domain is even n>=2, integer d>=3. The source-backed default range
is n=2, 3<=d<=14 and n=4, 3<=d<=5; unsupported pairs raise KeyError.
Use lattice.gram and lattice.quotient (with modular.py beside lattice.py)
to recompute or extend the invariant.
"""
import numberdb.sage as numberdb
from sage.rings.integer_ring import ZZ
from pathlib import Path
import json,sys

class FermatLinearCycleDiscriminant(numberdb.Generator):
    table='T723'
    parameters=('n','d')
    type='Z'
    rigour='exact'
    digits=100
    files=('generate.py','reference-divisors.json')

    def enumerate(self):
        for d in range(3,15):yield {'n':2,'d':d}
        for d in range(3,6):yield {'n':4,'d':d}

    def value(self,params,digits):
        n,d=int(params['n']),int(params['d'])
        source=json.loads(Path(__file__).with_name('reference-divisors.json').read_text())
        row=next((r for r in source['rows'] if (r['n'],r['d'])==(n,d)),None)
        if row is None:raise KeyError((n,d))
        value=ZZ(1)
        for s,m in row['factors']:value*=ZZ(s)**m
        return value

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