There's currently an open issue for this https://github.com/sympy/sympy/issues/5855.
For now, I think the only way to do it is to manually subclass MatrixExpr. Aaron Meurer On Mon, Oct 24, 2022 at 6:52 AM Anton Akhmerov <anton.akhme...@gmail.com> wrote: > > Hello everyone, > > I would like to represent a symbolic function whose argument is a matrix > symbol and so is its output. To make a specific example, I would like an > expression like to define F, such that F(X) + X works if X is a > MatrixSymbol("X", n, n). > > The closest that I was able to find in the docs is FunctionMatrix, but it > doesn't quite get me there. Using F = sympy.Function("F") does not work > neither. > > Is there a way to achieve the desired result? > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sympy+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/24458147-5905-4619-8f57-5e5137cd7c07n%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAKgW%3D6JTMJP1dnbUBWwPj4Lj6WWf2v6%3DEJmLdtMEHR%3DEwZsR9A%40mail.gmail.com.