I'm using sympy matrix expressions for differentiation and I want to add some custom matrix functions and including spectral norm and eigenvectors. I also want to be able to differentiate expressions containing these functions.
The relevant documentation(https://docs.sympy.org/latest/guides/custom-functions.html) says "functions that accept or return other kinds of objects than complex numbers should subclass another class, such as Boolean, MatrixExpr, Expr, or Basic." but only gives examples for Function.
Later it says "Subclasses of Expr that aren’t Function subclasses will need to define _eval_derivative()"
I have three questions relating to this