[Numpy-discussion] .T Transpose shortcut for arrays again
Sasha
ndarray at mac.com
Thu Jul 6 15:30:41 CDT 2006
On 7/6/06, Robert Kern <robert.kern at gmail.com> wrote:
> ...
> I don't think that just because arrays are often used for linear algebra that
> linear algebra assumptions should be built in to the core array type.
>
In addition, transpose is a (rank-2) array or matrix operation and not
a linear algebra operation. Transpose corresponds to the "adjoint"
linear algebra operation if you represent vectors as single column
matrices and co-vectors as single-row matrices. This is a convenient
representation followed by much of the relevant literature, but it
does not alow generalization beyond rank-2. Another useful feature is
that inner product can be calculated as the matrix product as long as
you accept a 1x1 matrix for a scalar. This feature does not work
beyond rank-2 either because in order to do tensor inner product you
have to be explicit about the axes being collapsed (for example using
Einstein notation).
Since ndarray does not distinguish between upper an lower indices, it
is not possible distinguish between vectors and co-vectors in any way
other than using matrix convention. This makes ndarrays a poor model
for linear algebra tensors.
More information about the Numpy-discussion
mailing list