import numberdb.sage
from sage.rings.rational_field import QQ
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.matroids import database_matroids as catalog
# Initialize Sage's multivariate polynomial implementation.
PolynomialRing(QQ, 2, 'x')
P = PolynomialRing(QQ, 't')
t = P.gen()
def augmented_chow(M):
"""Return H_M(t) for a finite simple matroid M."""
if not M.is_simple():
raise ValueError('M must be simple')
A = M.chow_ring(QQ, True, 'fy')
return sum((t**b.homogeneous_degree() for b in A.basis()), P.zero())
print(augmented_chow(catalog.Fano()))# Place the attached generate.py in the working directory.
from generate import MatroidAugmentedChow, uniform_augmented, braid_augmented
uniform_augmented(8, 12)
braid_augmented(8)
generator = MatroidAugmentedChow()
[(p["matroid"], generator.value(p, 100)) for p in generator.enumerate()]All 37 values are exact polynomials in $\mathbb Z[t]$. The generator evaluates the weighted-chain formula of [1], Proposition 3.6, by dynamic programming on upper flat intervals, with symmetry reductions for uniform and braid matroids.
The separate checks.py uses (2) for the eight catalogue objects, constructing flats independently from all subset ranks, and permutation-cycle counts for the five braid objects. It checks all 24 uniform values using (3), with Eulerian coefficients counted directly from permutations. Ten complete polynomials also agree with published Table 1(b,d). Known-answer controls precede the comparisons. Degree, endpoint coefficients, nonnegativity, symmetry, unimodality and (5) are checked on every entry, as are both expressions in (1). The standard dry run measures a longest entry of 95 characters and about 3.4 KB of entries. The attached argument-selection.md records the coverage rationale, and numerical-evidence.md records the commands and results.