diff options
-rw-r--r-- | polymatrix/expression/expression.py | 3 | ||||
-rw-r--r-- | polymatrix/expression/utils/getderivativemonomials.py | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/polymatrix/expression/expression.py b/polymatrix/expression/expression.py index f5318ae..6231714 100644 --- a/polymatrix/expression/expression.py +++ b/polymatrix/expression/expression.py @@ -28,6 +28,9 @@ class Expression( def apply(self, state: ExpressionState) -> tuple[ExpressionState, PolyMatrix]: return self.underlying.apply(state) + def read(self, state: ExpressionState) -> PolyMatrix: + return self.apply(state)[1] + def __add__(self, other: ExpressionBaseMixin) -> 'Expression': return self._binary(polymatrix.expression.init.init_addition_expr, self, other) diff --git a/polymatrix/expression/utils/getderivativemonomials.py b/polymatrix/expression/utils/getderivativemonomials.py index 0b74135..a8b2e16 100644 --- a/polymatrix/expression/utils/getderivativemonomials.py +++ b/polymatrix/expression/utils/getderivativemonomials.py @@ -121,5 +121,5 @@ def get_derivative_monomials( ) derivation_terms[diff_monomial] += value - # return state, dict(derivation_terms) - return state, derivation_terms
\ No newline at end of file + return state, dict(derivation_terms) + # return state, derivation_terms
\ No newline at end of file |