cratepy.tensor.tensoroperations.rotate_tensor

rotate_tensor(tensor, r)[source]

Rotation of \(n\)-dimensional tensor.

The rotation of the \(n\)-dimensional tensor is here defined as

\[A^{r}_{i_{1}i_{2}\dots i_{n}} = R_{i_{1}j_{1}} R_{i_{2}j_{2}} \dots R_{i_{n}j_{n}} A_{j_{1}j_{2} \dots j_{n}}\]

where \(\mathbf{R}\) denotes the rotation tensor, \(\mathbf{A}\) denotes the original tensor, and \(\mathbf{A}^{r}\) denotes the rotated tensor.


Parameters:
  • tensor (numpy.ndarray) – Tensor.

  • r (numpy.ndarray (2d)) – Rotation tensor (for given rotation angle theta, active transformation (+ theta) and passive transformation (- theta)).

Returns:

rtensor – Rotated tensor.

Return type:

numpy.ndarray