diff options
-rw-r--r-- | README.md | 14 | ||||
-rw-r--r-- | polymatrix/expressionstate/mixins/expressionstatemixin.py | 1 |
2 files changed, 7 insertions, 8 deletions
@@ -1,6 +1,6 @@ # Multivariate polynomial library -`polymatrix` is a library to represent and operate on multivariate polynomials. +`polymatrix` is a library to represent and operate on multivariate polynomial matrices. It is used to define Sum Of Squares optimization problems. @@ -16,11 +16,11 @@ Some aspects of the library: * [`polymatrix.v_stack`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/__init__.py) * [`polymatrix.block_diag`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/__init__.py). * polynomial expressions are manipulated using methods like - * [`diff`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/mixins/expressionmixin.py), - * [`reshape`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/mixins/expressionmixin.py) - * [`substitute`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/mixins/expressionmixin.py) - * [`sum`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/mixins/expressionmixin.py) - * [`to_constant`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/mixins/expressionmixin.py) + * [`diff`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/expression.py), + * [`reshape`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/expression.py) + * [`substitute`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/expression.py) + * [`sum`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/expression.py) + * [`to_constant`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/expression.py) * an expression is converted to matrix representation using [`polymatrix.to_matrix_repr`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/__init__.py). To get the actual representation, the [`apply(state)`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/statemonad/mixins/statemonadmixin.py) method needs to be called. ## Example @@ -31,7 +31,7 @@ f_1(x_1, x_2) = x_1 + x_2 f_2(x_1, x_2) = x_1 + x_1 x_2 -Then, the two expression are combined using the [`__add__`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/mixins/expressionmixin.py) (or equivalently `+` infix) method +Then, the two expression are combined using the [`__add__`](https://gitlab.nccr-automation.ch/michael.schneeberger/polymatrix/-/blob/main/polymatrix/expression/expression.py) (or equivalently `+` infix) method f_3(x_1, x_2) = f_1(x_1, x_2) + f_2(x_1, x_2) = 2 x_1 + x_2 + x_1 x_2 diff --git a/polymatrix/expressionstate/mixins/expressionstatemixin.py b/polymatrix/expressionstate/mixins/expressionstatemixin.py index 6268d4b..8a8405c 100644 --- a/polymatrix/expressionstate/mixins/expressionstatemixin.py +++ b/polymatrix/expressionstate/mixins/expressionstatemixin.py @@ -41,7 +41,6 @@ class ExpressionStateMixin( if start <= offset < end: return f'{str(variable)}_{offset-start}' - def get_key_from_offset(self, offset: int): for variable, (start, end) in self.offset_dict.items(): if start <= offset < end: |