summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--polymatrix/expression/mixins/matrixmultexprmixin.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/polymatrix/expression/mixins/matrixmultexprmixin.py b/polymatrix/expression/mixins/matrixmultexprmixin.py
index 9402a19..2d86619 100644
--- a/polymatrix/expression/mixins/matrixmultexprmixin.py
+++ b/polymatrix/expression/mixins/matrixmultexprmixin.py
@@ -30,12 +30,12 @@ class MatrixMultExprMixin(ExpressionBaseMixin):
state, left = self.left.apply(state=state)
state, right = self.right.apply(state=state)
- # assert left.shape[1] == right.shape[0], f'{left.shape[1]} is not equal to {right.shape[0]}'
-
if not (left.shape[1] == right.shape[0]):
+ msg = f"Cannot multiply matrices {self.left} and {self.right} because their shapes " \
+ f"{left.shape}, and {right.shape} do not match!"
raise AssertionError(
to_operator_exception(
- message=f"{left.shape[1]} is not equal to {right.shape[0]}",
+ message=msg,
stack=self.stack,
)
)