I have a rank three n-dim tensor A. For two of the axes I want to perform v^t A v (a quadratic form with scalar output, where v is a vector). The final output should be a vector. I also need to compute the derivative of this with respect to v. This involves symmetrizing and matrix-vector multiplication (2 sym(A)v using two axes of A only, which gives a vector) with the final result being a matrix.

Is there something elegant I can do short of extending numpy with fortrash routines? Perhaps something like SciPy's 3-d tensor ops but for n-dim?

Thanks in advance for any tips, - d

PS One more dumb question: I just installed the ScientificPython-2.4.1 rpm on my reincarnated Mandrake linux machine running python2.2. Do I need to do something to configure it? My scripts aren't finding things (e.g. indexing.py).