Is there any way (or a package built for it) can do simple operations with vectors and matricies of arbitrary size, but conforming extents?
For the simplest example to test, given an arbitrary vector $a,z\in R^n$ and $A \in R^{n \times n}$, $\nabla(a \cdot z) = a$ and the jabobian: $\nabla(A \cdot z) = A$, etc.
I tried the obvious (assuming that $z$ was a vector) Grad[a . z, {z}]
etc, but it didn't work. I noticed Differentiating with respect to vectors of unspecified length, and Generating a vector of dummy variables but they didn't appear to help - and may be suggesting that it isn't possible...
Experimantal`NumericalFunction
for automatic gradients and Jacobians. $\endgroup$