I have a polynomial expression P(x) in x and I want to evaluate it for x=A a matrix. I tried P(x).substitute(x=A) but I have error : TypeError: Cannot convert sage.matrix.matrix_integer_dense.Matrix_integer_dense to sage.symbolic.expression.Expression
How can I proceed? Is there a coercion possible. Thanks