From 5aa5d53c9375b6b0c98054351a4eb782497da330 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Fri, 26 Apr 2024 13:29:39 +0200 Subject: Fix regression in ElemMultExpr from introduction of index types --- polymatrix/expression/mixins/elemmultexprmixin.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/polymatrix/expression/mixins/elemmultexprmixin.py b/polymatrix/expression/mixins/elemmultexprmixin.py index 0d89361..fe5d6ab 100644 --- a/polymatrix/expression/mixins/elemmultexprmixin.py +++ b/polymatrix/expression/mixins/elemmultexprmixin.py @@ -4,6 +4,7 @@ import typing import dataclassabc from polymatrix.polymatrix.init import init_poly_matrix, init_broadcast_poly_matrix +from polymatrix.polymatrix.typing import MonomialIndex from polymatrix.expression.mixins.expressionbasemixin import ExpressionBaseMixin from polymatrix.polymatrix.mixins import PolyMatrixMixin from polymatrix.polymatrix.abc import PolyMatrix @@ -60,9 +61,14 @@ class ElemMultExprMixin(ExpressionBaseMixin): # monomial = tuple(sorted(left_monomial + right_monomial)) - new_monomial = merge_monomial_indices( - (left_monomial, right_monomial) - ) + # TODO: This line broke since the introduction of index + # types, investigate why. Replacing it + # MonomialIndex.product fixes the issue + + # new_monomial = merge_monomial_indices( + # (left_monomial, right_monomial) + # ) + new_monomial = MonomialIndex.product(left_monomial, right_monomial) if new_monomial not in polynomial: polynomial[new_monomial] = 0 -- cgit v1.2.1