Yes, for the matrix differential operators with matrices which are
depended of the variables of differentiation we must think.
But for the "constant" matrix (which is independent of the variable x) I
don't quite understand what kind of subclass of Matrix is needed: which
is related to differential operator or differential method of matrix itself.
In order to avoid duplicating code, I think, we must use that for the
matrix M which is independent of the variable x the following is:
M Dx = Dx M
and at the same time for the applying this operator we only care that
differential operator would always be to the left of the expression A
(x) to which it is applied.
So for the (constant) matrix differential operator myD = (M Dx)
(M Dx) A(x) = (Dx M) A(x) = Dx (M A(x))
Is it right?
This is done automatically in presented diff_operator.py (only for the
matrices M which are independent of the variable x)
Therefore for the (M Dx) A(x) we can compute M A(x) firstly and then
only a problem in this case, that I can't compute derivative of the
matrix expression
diff( M*A(x), x)
This was the question.
In the case when M(x) is depended of x, we must of course keep it always
on the left in th expression
M(x) Dx != Dx M(x)
(this is not realized in attached code above)
So a subclass of Matrix will be needed only in this case.
Or rather, internal support in DiffOperator expression must be
implemented for this case.
Alexey Gudchenko