import numberdb.sage as numberdb
from sage.rings.integer_ring import ZZ
from sage.rings.rational_field import QQ
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.symbolic.ring import SR
import sage.rings.polynomial.laurent_polynomial_ring
from sage.combinat.sf.sf import SymmetricFunctions
QT = PolynomialRing(QQ, ['q', 't'])
q, t = QT.gens()
J = SymmetricFunctions(QT.fraction_field()).macdonald(q=q, t=t).J()
R = PolynomialRing(ZZ, ['x1', 'x2', 'x3', 'q', 't'])
print(R(str(J[2, 1].expand(3, alphabet=['x1', 'x2', 'x3']))))All coefficients are exact integers. The attached generator converts monomial symmetric functions to power sums by set-partition inclusion–exclusion, performs exact Gram–Schmidt orthogonalization over $\mathbb Q(q,t)$, multiplies by $c_\lambda(q,t)$, and specializes the alphabet. Coercion to $\mathbb Z[x_1,\ldots,x_n,q,t]$ rejects residual denominators.
Every entry is compared with the independent SageMath Macdonald $J$ implementation, which uses determinantal formulas [2]. Exact polynomial arithmetic checks the difference-operator eigenidentity after multiplication by the Vandermonde. Controls include the constant polynomial and the linear power sum, and an incorrect quadratic is required to fail. Symmetry, alphabet degree, dominance support, leading coefficient, column formulas, boundary formulas and alphabet stability are also checked.
All 14 $q=t$ specializations agree with an independently computed Schur alternant and with the stored Schur table. All 14 $q=0$ specializations agree with the stored Hall–Littlewood table after multiplication by $b_\lambda(t)$. The attached checks run before submission and on the values read back from the draft.