Release notes for 1.17.0
Support of object arrays in matmul
It is now possible to use matmul (or the @ operator) with object arrays. For instance, it is now possible to do:
from fractions import Fraction
a = np.array([[Fraction(1, 2), Fraction(1, 3)], [Fraction(1, 3), Fraction(1, 2)]])
b = a @ a
Are you using @
(matmul
or dot
)? A numpy
array containing sympy
objects will be object dtype
. Math on object arrays depends on delegating the action to the object's own methods. It cannot be performed by the fast compiled libraries, which only work with c
types such as float
and double
.
As a general rule you should not be trying to mix numpy
and sympy
. Math is hit-or-miss, and never fast. Use sympy's
own Matrix
module, or lambdify
the sympy
expressions for numeric work.
What's the mkl
version? You may have to explore this with creator of that compilation.