monomial_symmetrize, a MATLAB code which symmetrizes the coefficients of equivalent monomials in a polynomial.
The polynomial is assumed to be written as a sum of monomials.
Each monomial is of total degree D.
Each monomial involves factors selected from a B-dimensional space.
Each monomial has a coefficient C.
Every possible permutation of D factors from a B dimensional space is used to form a separate monomial.
For instance, if D = 3 and B = 2, the polynomial has the form
P = C111 X1 X1 X1 + C112 X1 X1 X2 + C121 X1 X2 X1 + C122 X1 X2 X2 + C211 X2 X1 X1 + C212 X2 X1 X2 + C221 X2 X2 X1 + C222 X2 X2 X2
There are 4 equivalence classes of monomials, with representatives X1 X1 X1, X1 X1 X2, X1 X2 X2 and X2 X2 X2. (Two monomial are equivalent if one is simply a permutation of the other.) It is the task of this function to take the values of D, B and the coefficient vector C, and produce a new coefficient vector C2. The C2 vector is computed by averaging the coefficients of equivalent monomials.
The computer code and data files made available on this web page are distributed under the MIT license
monomial_symmetrize is available in a MATLAB version.
monomial, a MATLAB code which enumerates, lists, ranks, unranks and randomizes multivariate monomials in a space of M dimensions, with total degree less than N, equal to N, or lying within a given range.