Matrix Transpose

The transpose of a matrix \(\,\boldsymbol{A}=[a_{ij}]_{m\times n}\,\) is defined as the matrix \(\,\boldsymbol{A}^T=\,[a^T_{ij}]_{n\times m}\,,\ \) where

\[a_{ij}^T\ :\,=\ a_{ji},\qquad i=1,2,\ldots,n;\ \ j=1,2,\ldots,m.\]

In the direct notation: \(\qquad \left[\begin{array}{cccc} a_{11} & a_{12} & \ldots & a_{1n} \\ a_{21} & a_{22} & \ldots & a_{2n} \\ \ldots & \ldots & \ldots & \ldots \\ a_{m1} & a_{m2} & \ldots & a_{mn} \end{array}\right]^T \ =\quad \left[\begin{array}{cccc} a_{11} & a_{21} & \ldots & a_{m1} \\ a_{12} & a_{22} & \ldots & a_{m2} \\ \ldots & \ldots & \ldots & \ldots \\ a_{1n} & a_{2n} & \ldots & a_{mn} \end{array}\right]\,.\)

Thus each \(\,i\)-th row of matrix \(\,\boldsymbol{A}^T\,\) is composed of elements of the \(\,i\)-th column of matrix \(\,\boldsymbol{A},\,\) and each j-th column of matrix \(\,\boldsymbol{A}^T\,\) is composed of elements of the \(\,j\)-th row of matrix \(\,\boldsymbol{A},\,\) \(\ i=1,2,\ldots,n;\ j=1,2,\ldots,m.\)

Graphically, the operation of transposing a matrix may be described as the reflection of that matrix over its main diagonal.

Examples.

1.) \(\ \) If \(\ \ \boldsymbol{A}\ =\ \left[\begin{array}{rr} 2 & - 1 \\ 3 & 0 \\ - 2 & 1 \end{array}\right] \in M_{3\times 2}(R),\ \ \) then \(\ \ \boldsymbol{A}^T\ =\ \left[\begin{array}{rrr} 2 & 3 & -2 \\ -1 & 0 & 1 \end{array} \right]\in M_{2\times 3}(R).\)

2.) \(\ \) Transpose of a square matrix over the ring \(\,Z:\) \(\ \ \left[\begin{array}{rrr} -2 & 1 & 0 \\ 5 & 2 & 3 \\ 7 & -3 & 8 \end{array}\right]^T =\ \;\left[\begin{array}{rrr} -2 & 5 & 7 \\ 1 & 2 & -3 \\ 0 & 3 & 8 \end{array}\right]\,.\)

3.) \(\ \) Transpose of a one-column matrix over any ring: \(\ \ \left[\begin{array}{c} a_1 \\ a_2 \\ a_3 \\ a_4 \end{array}\right]^T =\ \;\left[\begin{array}{cccc} a_1 & a_2 & a_3 & a_4 \end{array}\right]\,.\)

Properties of Transpose.

0.) \(\,\) If \(\,\boldsymbol{A}\in M_{m \times n}(K),\,\) then \(\,\left(\boldsymbol{A}^T\right)^T\ =\ \boldsymbol{A}\)

(a twofold application of transpose returns the original matrix).

1.) \(\,\) Let \(\,\boldsymbol{A},\boldsymbol{B}\in M_{m \times n}(K),\ c\in K.\ \ \) Then \(\ \ (\boldsymbol{A}+\boldsymbol{B})^T =\, \boldsymbol{A}^T + \boldsymbol{B}^T,\ \ (c\boldsymbol{A})^T =\,c\boldsymbol{A}^T\,.\)

(transpose of a sum of two matrices equals the sum of their transposes, \(\\\) a numerical factor may be moved up to the front of the transpose symbol: \(\\\) transpose is a linear operation).

2.) \(\,\) Let \(\,\boldsymbol{A}\in M_{m\times p}(K),\ \boldsymbol{B}\in M_{p\times n}(K).\ \) Then \(\ \ (\boldsymbol{A}\boldsymbol{B})^T =\, \boldsymbol{B}^T\boldsymbol{A}^T\,\)

(transpose of a product of two matrices equals the product of their transposes in reverse order).

Proof of the Property 2.:

  • Comparison of the matrices’ dimensions.
    \(\boldsymbol{A}\boldsymbol{B}:\ m\times n\,;\quad (\boldsymbol{A}\boldsymbol{B})^T:\ n\times m\,.\)
    \(\boldsymbol{B}^T:\ n\times p\,;\quad \boldsymbol{A}^T:\ p\times m\,;\quad \boldsymbol{B}^T\boldsymbol{A}^T:\ n\times m\,.\)
  • Comparison of the corresponding matrix elements.
    For \(\boldsymbol{A} = [a_{ij}]_{m\times p}\,,\ \boldsymbol{B}=[b_{ij}]_{p\times n}:\)
    \((\boldsymbol{A}\boldsymbol{B})^T|_{ij}\ =\ (\boldsymbol{A}\boldsymbol{B})|_{ji}\ =\ \sum\limits_{s=1}^p \,a_{js}\,b_{si}\,,\)
    \(\boldsymbol{B}^T\boldsymbol{A}^T|_{ij}\ =\ \sum\limits_{s=1}^p \,b_{is}^T\,a_{sj}^T\ =\ \sum\limits_{s=1}^p \,a_{js}\,b_{si}\,,\quad i=1,2,\ldots,n;\ \ j=1,2,\ldots,m.\quad\bullet\)

Symmetric and Skew-Symmetric Matrices

A square matrix \(\,\boldsymbol{A}=[a_{ij}]_{n\times n}\in M_n(K)\,\) is called a symmetric matrix, \(\\\) if \(\,\boldsymbol{A}^T=\boldsymbol{A}\,,\ \) that is if \(\ \, a_{ij} = a_{ji}\,,\ \ i,j=1,2,\ldots,n.\)

Such matrix is invariant under the reflection over its main diagonal.

On the other hand, when \(\,\boldsymbol{A}^T=-\boldsymbol{A}\,,\ \) the matrix \(\,\boldsymbol{A}\ \) is said to be skew-symmetric.

Then \(\ a_{ij} = - \ a_{ji}\,,\ \ i,j=1,2,\ldots,n,\ \) wherefrom \(\ a_{ii} = 0\ \ \text{for}\ \ i=1,2,\ldots,n. \\\) (in a skew-symmetric matrix all diagonal entries vanish).

Symmetric and skew-symmetric real matrices of size three have the following general form:

\[\begin{split}\boldsymbol{A}_s\ =\ \left[\begin{array}{ccc} a & b & c \\ b & d & e \\ c & e & f \end{array}\right]\,, \qquad \boldsymbol{A}_a\ =\ \left[\begin{array}{rrr} 0 & a & \ \ b \\ -a & 0 & \ \ c \\ -b & -c & \ \ 0 \end{array}\,\right]\,.\end{split}\]

Every square matrix \(\,\boldsymbol{A}\in M_n(K)\,\) may be expressed in a unique way as a sum of a symmetric and a skew-symmetric matrix components:

\[\boldsymbol{A}\ \ =\ \ \textstyle{1\over 2}\ (\boldsymbol{A}+\boldsymbol{A}^T)\ +\ \textstyle{1\over 2}\ (\boldsymbol{A}-\boldsymbol{A}^T),\]

In Sage the matrix transpose is performed by the method transpose() (abbreviated to T). There are also methods is_symmetric() and is_skew_symmetric(), which check whether a given square matrix has the respective property.

Example. \(\,\) We shall rewrite the matrix

\[\begin{split}\boldsymbol{A}\ =\ \left[\begin{array}{rrr} 4 & 3 & -1 \\ 2 & -5 & 8 \\ 0 & -2 & 1 \end{array}\right]\,\in\,M_3(R)\end{split}\]

as the sum of symmetric and skew-symmetric components. The Sage code:

sage: A = matrix(QQ,[[4, 3,-1],
                     [2,-5, 8],
                     [0,-2, 1]])

sage: As = (A + A.T)/2
sage: Aa = (A - A.T)/2

sage: show(table([[A, '=', As, '+', Aa]]))
sage: (As.is_symmetric(), Aa.is_skew_symmetric())

yields the following result:

\[\begin{split}\left[\begin{array}{rrr} 4 & 3 & -1 \\ 2 & -5 & 8 \\ 0 & -2 & 1 \end{array}\right]\ \ =\ \ \left[\begin{array}{rrr} 4 & \textstyle{5\over 2} & -\textstyle{1\over 2} \\ \textstyle{5\over 2} & -5 & 3 \\ -\textstyle{1\over 2} & 3 & 1 \\ \end{array}\right]\ \ +\ \ \left[\begin{array}{rrr} 0 & \textstyle{1\over 2} & -\textstyle{1\over 2} \\ -\textstyle{1\over 2} & 0 & 5 \\ \textstyle{1\over 2} & -5 & 0 \\ \end{array}\right]\end{split}\]

(True, True)