-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements to lambdify for matrices #2826
Comments
Shouldn't I be able to specify that SymPy MutableDenseMatrices become the numpy array function?
|
This worked! Cool. Not sure why I had to specify
|
I think it sympifies everything, converting all matrices to immutable matrices. |
I'll close this, as it is possible to do what I want with the current options. |
I'm told that arrays are better in numpy than matrices, and that the only real reason to use matrices is for the syntactic sugar for multiplication. So maybe we should default to array. |
I'd like to be able to create a sympy matrix of expressions, lambdify it, and then pass in and n x m numpy array of the m arguments to get back an array of n matrices.
Expected result would be a 5 x 2 x 2 numpy array.
You can do this with a for loop:
But it is much too slow for long expressions and large n. It would be nice if this translated to a vectorized version on numpy's side.
This may just be a matter of generate code that uses numpy.array instead of numpy.matrix:
The text was updated successfully, but these errors were encountered: