# [NumericPrelude] multivariate polynomials

Lewis-Sandy, Darrell darrelll at amgen.com
Mon Jun 21 17:00:17 EDT 2010

Exactly right!   The multivariate polynomials in my problem domain are generally sparse in their monomial exponents.

Now that I have had a chance to read your comments and read through the library, I agree with your assessment of how my multivariate polynomial type could be implemented within your framework.   I think we may have been stumbling over nomenclature.  What I have been using the notation referring to as a monomial is a finite product of invariants x1^n1 x2^n2 .. xk ^ nk (sometimes referred to as the power product), and terms of the polynomial are coefficient/power product pairs.   I am aware that what I have been referring to as terms are also referred to (with equal frequency) as monomials. To avoid future confusion, I will adopt nomenclature consistent with your established convention.

Darrell

-----Original Message-----
From: Henning Thielemann [mailto:lemming at henning-thielemann.de]
Sent: Sunday, June 20, 2010 12:49 AM
To: Lewis-Sandy, Darrell
Subject: RE: multivariate polynomials

On Sat, 19 Jun 2010, Lewis-Sandy, Darrell wrote:

> Henning,
>
> In my polynomial library I did not have a function fromCoeffs because all my polynomials were multivariate.  Instead, I had a function fromTerms:
>
> fromTerms :: (Ring a, Ord symbol) => [(ring,Bag symbol)] -> Poly symbol ring
>
> where a term was represented as a coefficient/monomial pair, and Bag was
> my monoidial mononomial type.

That is you do not only want a sparse polynomial representation but also a
sparse representation of the monomial exponents using Bags, right?
Nonetheless this would be just an instance of MathObj.Algebra, where (Bag
symbol) with mempty=Bag.empty and mappend=Bag.union (occurrences of all
bag elements are added) is the Monoid of monomials.