qml.math.T

T(tensor)[source]

Returns the transpose of the tensor by reversing the order of the axes. For a 2D tensor, this corresponds to the matrix transpose.

Parameters

tensor (tensor_like) – input tensor

Returns

input tensor with axes reversed

Return type

tensor_like

Example

>>> x = tf.Variable([[1, 2], [3, 4]])
>>> T(x)
<tf.Tensor: shape=(2, 2), dtype=int32, numpy=
array([[1, 3],
       [2, 4]], dtype=int32)>