diff options
author | Nao Pross <np@0hm.ch> | 2024-04-26 13:29:39 +0200 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2024-04-26 13:29:39 +0200 |
commit | 5aa5d53c9375b6b0c98054351a4eb782497da330 (patch) | |
tree | f63f0091bc58e914d8df85d192fd4fa9f64347de | |
parent | Wrap raw dictionaries as PolyDict and PolyMatrixDict (diff) | |
download | polymatrix-5aa5d53c9375b6b0c98054351a4eb782497da330.tar.gz polymatrix-5aa5d53c9375b6b0c98054351a4eb782497da330.zip |
Fix regression in ElemMultExpr from introduction of index types
-rw-r--r-- | polymatrix/expression/mixins/elemmultexprmixin.py | 12 |
1 files 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 |