From 26127416ae20281ecbee3d693caaad2b8dfb14c2 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sat, 4 May 2024 22:25:29 +0200 Subject: Fix regression in ElemMultExpr Caused by 5aa5d53c9375b6b0c98054351a4eb782497da330 --- polymatrix/expression/mixins/elemmultexprmixin.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/polymatrix/expression/mixins/elemmultexprmixin.py b/polymatrix/expression/mixins/elemmultexprmixin.py index f8121a8..330474b 100644 --- a/polymatrix/expression/mixins/elemmultexprmixin.py +++ b/polymatrix/expression/mixins/elemmultexprmixin.py @@ -11,6 +11,7 @@ from polymatrix.polymatrix.init import init_poly_matrix, init_broadcast_poly_mat from polymatrix.polymatrix.typing import MonomialIndex from polymatrix.expression.mixins.expressionbasemixin import ExpressionBaseMixin from polymatrix.polymatrix.abc import PolyMatrix +from polymatrix.polymatrix.utils.mergemonomialindices import merge_monomial_indices class ElemMultExprMixin(ExpressionBaseMixin): @@ -62,14 +63,9 @@ class ElemMultExprMixin(ExpressionBaseMixin): # monomial = tuple(sorted(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) + new_monomial = merge_monomial_indices( + (left_monomial, right_monomial) + ) if new_monomial not in polynomial: polynomial[new_monomial] = 0 -- cgit v1.2.1