adrianX
adrianX

Reputation: 627

sympy modulo doesn't work with non-commutative expressions

I have the following code:

y = IndexedBase('y')
z = y[0] % 2000

This gives the error:

sympy.polys.polyerrors.PolynomialError: non-commutative expressions are not supported

I believe this is because of the IndexedBase term. What is an alternate way to represent z = y[0] % 2000?

Upvotes: 2

Views: 705

Answers (1)

adrianX
adrianX

Reputation: 627

Answering my own question:

in the latest version of sympy 0.7.6 (was using a slightly older version previously), indexedBase objects are made to be commutative by default. So just download the newer version of sympy and i can use the Mod operator.

https://github.com/sympy/sympy/pull/7355

Upvotes: 1

Related Questions