catalogue.py

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

1878 bytes, as of the version from 2026-11-02 11:02 (current). Recorded here, not run.

"""Quadratic CM determinant catalogue for T651.

Source: Samart--Tao, arXiv:2409.14714v3, Table 1 rows 13--27.
Each tuple: row, rational part, radical coefficient, radicand,
CM order discriminant, determinant coefficients a,b, and L-value factors r,s.
The positive square root fixes the orientation; keys match T649 and T650.
"""
import numberdb.sage as numberdb
from sage.rings.rational_field import QQ
from sage.rings.qqbar import AA
CATALOGUE = (
 (13,'108','54',2,-24,2,1,'729','9/8'),
 (14,'18','6',3,-36,2,1,'729/2','9/4'),
 (15,'270','162',3,-4,2,1,'2187/2','27/4'),
 (16,'729','405',3,-48,4,-1,'2187','27/8'),
 (17,'-27/2','-27/2',5,-15,5,1,'18225/16','9/2'),
 (18,'3375/2','1485/2',5,-60,5,1,'127575/32','63/4'),
 (19,'-4320','-1944',5,-75,25,-1,'455625/16','-9/2'),
 (20,'32','2',6,-72,2,1,'486','27/4'),
 (21,'3672','1458',6,-8,2,1,'2754','153/4'),
 (22,'-864','-216',17,-51,17,1,'210681/16','9/2'),
 (23,'-163296','-35640',21,-147,49,-1,'1750329/16','-9/2'),
 (24,'4','-4',33,-99,11,1,'29403/16','27/2'),
 (25,'-16740','-2916',33,-11,11,1,'245025/16','225/2'),
 (26,'-55296','-8640',41,-123,41,1,'1225449/16','9/2'),
 (27,'-13500000','-1431000',89,-267,89,1,'5774409/16','9/2'),
)

def key(u,v,d):
    v=QQ(v)
    return str(QQ(u))+('+' if v>0 else '-')+str(abs(v))+'*sqrt('+str(d)+')'

def items():
    return [dict(row=row,u=u,v=v,d=d,D=D,a=a,b=b,r=r,s=s,
                 key=key(u,v,d),conjugate=key(u,-QQ(v),d))
            for row,u,v,d,D,a,b,r,s in CATALOGUE]

def exact(item,conjugate=False):
    return AA(QQ(item['u']))+(-1 if conjugate else 1)*AA(QQ(item['v']))*AA(item['d']).sqrt()

def label(item):
    def rat(q):
        q=QQ(q)
        return str(q) if q.denominator()==1 else r'\frac{'+str(q.numerator())+'}{'+str(q.denominator())+'}'
    v=QQ(item['v'])
    return '$'+rat(item['u'])+('+' if v>0 else '-')+rat(abs(v))+r'\sqrt{'+str(item['d'])+'}$'