I'm trying to use lambdify on some matrix expression, but my problem is that the shape of the matrix expr is not preserved. this is an example of my problem:
from sympy import Symbol, Matrix
from sympy.utilities.lambdify import lambdify
xi = Symbol("xi")
eta = Symbol("eta")
phi = Symbol("phi")
mat22 = Matrix([[xi+1,eta],[phi+2,eta]])
mat11 = Matrix([[xi+1]])
mat00 = Matrix([[]])
print("shape of the expression")
print(mat22.shape)
print(mat11.shape)
print(mat00.shape)
symbols = [xi,eta,phi]
args = [0,1,2]
print("shape of the lambdify expression")
print(lambdify(symbols,mat22)(*args).shape)
print(lambdify(symbols,mat11)(*args).shape)
print(lambdify(symbols,mat00)(*args).shape)
''
shape of the expretion
(2, 2)
(1, 1)
(0, 0)
shape of the lambdify expretion
(2, 2)
(1, 1)
(0,) <----- i will like to have (0,0)
Python 3.6.10 |Anaconda, Inc.| (default, May 8 2020, 02:54:21)
[GCC 7.3.0] on linux