# TensorTranspose

TensorTranspose[tensor,perm]

represents the tensor obtained by transposing the slots of tensor as given by the permutation perm.

# Details • The tensor can be any form of explicit array (normal, sparse, or structured) or any symbolic expression representing a tensor, including tensor products, tensor contractions, etc.
• The permutation perm can be given as a permutation list or in cyclic notation with head Cycles. Cyclic notation is automatically transformed into list notation.
• TensorTranspose[tensor] is equivalent to TensorTranspose[tensor,{2,1}].

# Examples

open allclose all

## Basic Examples(2)

Transpose the first two levels of a symbolic array of rank 3:

Perform tensor operations on transposed symbolic tensors:

## Scope(3)

On normal arrays:

On symmetrized arrays. This is an antisymmetric array:

On symbolic tensors:

The presence of symmetry allows further simplification:

## Generalizations & Extensions(1)

Transpose tensors using symmetry generators of the form {perm,φ}, with φ a root of unity:

## Applications(1)

Given a Riemannian metric , the so-called Christoffel coefficients of the first kind form a rank-three array with components given by the formula :

The second term keeps the first level in place but interchanges the second and third levels:

The final term cyclically permutes the levels in the first term:

Combining all the pieces yields the following:

This procedure is automated using the following function:

Apply the function to the spherical metric:

## Properties & Relations(7)

TensorTranspose on arrays is equivalent to Transpose:

However, Transpose allows second arguments that are not permutations: The dimensions of the transposed array are equal to the permuted dimensions of the original:

Transposing a tensor product of vectors is equivalent to permuting those vectors:

With symbolic tensors, the permutation is canonicalized to list form by default:

If the rank is known, the permutation list will be extended if possible:

TensorTranspose is always placed outside TensorContract:

That is a transposition of a rank 3 symbolic array:

Combine transpositions of a symbolic tensor:

Check it with explicit arrays:

TensorTranspose is a proper right action with respect to PermutationProduct:

The same result can be obtained by multiplying permutations in the same order:

But not in the opposite order: