# Simple Jacobians, Gradients, etc. with arbitrary length vectors/matrices?

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...

-
You have to use symbolic tensors‌​. – István Zachar Oct 8 '13 at 23:06
Closely related: How to declare a 3D vector variable?. – Artes Oct 8 '13 at 23:54
Tensors and reductions may be overkill, but they sure look like they would work. Are there easy ways to apply differential operators to an expression with tensors, tensor products, etc? (i.e. my gradient operation above). – jlperla Oct 9 '13 at 2:28
If you perform numerical computations you can consider using built-in ExperimantalNumericalFunction` for automatic gradients and Jacobians. – Alexey Popkov Apr 15 '14 at 16:01