A deep dive into representing multivariate polynomials as tries in Haskell. Starting from McIlroy's power series paper, the post builds up from list-based polynomials to a trie-based representation that naturally encodes Horner's rule for efficient evaluation. It covers multivariate extensions, lens-based division, monomial orderings (grlex, grevlex), breadth-first monomial enumeration, and efficient leading-monomial extraction using priority search queues (OrdPSQ). The post also touches on noncommutative Gröbner bases via Buchberger's algorithm and discusses the tradeoffs of the trie representation for computer algebra.

19m read timeFrom doisinkidney.com
Post cover image
Table of contents
Tries for PolynomialsEvaluation and Horner’s RuleMultiple VariablesSums of ProductsA TrieThe numeric functions on TriesLenses and DivisionGröbner BasesMonomial OrderingsEnumerating MonomialsEfficiently Popping the Leading MonomialUsesGistsReferences

Sort: