What is a Transpose Matrix

Sharing is caring

In this short post, we learn how to obtain the transpose of a matrix and how to perform operations with a matrix transpose.

The transpose of a matrix is a matrix that is obtained by flipping the original matrix over its diagonal. In other words, the rows of a matrix become the columns of its transpose, while its columns become the rows of the transpose. For a 2 dimensional square matrix, it would look like this.

A =   
\begin{bmatrix}
    1 & 2 \\
    3 & 4 \\
  \end{bmatrix}
\,
A^T = 
\begin{bmatrix}
    1 & 3 \\
    2 & 4 \\
  \end{bmatrix}

If you have more dimensions and the matrix is not square, you can also obtain the transpose over its diagonal. Note that now you also have to flip the dimensions.

A =
\begin{bmatrix}
1 & 2 & 3\\
4 & 5 & 6 \\
\end{bmatrix}
\,
A^T =
\begin{bmatrix}
1 & 4 \\
2 & 5 \\
3 & 6 \\
\end{bmatrix}

If you transpose the transpose of a matrix A, you arrive back at your original matrix A.

(A^T)^T = A

The transpose of the sum of two matrices equals the sum of the transposes of the original elements.

(A + B)^T = A^T + B^T

If you transpose the product of several matrices, the product is equivalent to the transposes of the original matrices in reversed order.

(AB)^T = B^TA^T

This post is part of a series on linear algebra for machine learning. To read other posts in this series, go to the index.


Sharing is caring