From 5b400c6da87a524ca6fee02bad18b9adfc90bff7 Mon Sep 17 00:00:00 2001 From: Michael Schneeberger Date: Tue, 7 May 2024 15:16:40 +0200 Subject: add example of degree 3 in docstring of monomial_to_monomial_vector_indices --- polymatrix/denserepr/utils/monomialtoindex.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/polymatrix/denserepr/utils/monomialtoindex.py b/polymatrix/denserepr/utils/monomialtoindex.py index 151e8bf..5520dd9 100644 --- a/polymatrix/denserepr/utils/monomialtoindex.py +++ b/polymatrix/denserepr/utils/monomialtoindex.py @@ -8,13 +8,19 @@ def monomial_to_monomial_vector_indices( ) -> set[int]: """ Given a monomial of degree d, this function returns the indices of a monomial - vector containing monomial of the same degree. + vector containing monomials of the same degree. Given the variable mapping {x : 0, y : 1}, the monomial x*y of the monomial vector - z = [x**2 x*y x*y y**2] + z = [x**2, x*y, x*y, y**2] - results in indices = (1, 2). + results in indices = (1, 2). + + Or, the monomial x*y**2 of the monomial vector + + z = [x**3, x**2*y, x**2*y, x*y**2, x**2*y, x*y**2, x*y**2, y**3] + + results in indices = (3, 5, 6) """ variable_indices_perm = itertools.permutations(variable_indices) -- cgit v1.2.1