Skip to main content

Linear Algebra with SageMath: Learn math with open-source software

Section 6.3 Transpose, Conjugate and Adjoint Matrix

The transpose of a matrix is obtained by flipping it over its diagonal, swapping rows with columns. The transpose is denoted as \(A^T\) and can be computed in Sage using the transpose method:
A matrix \(A\) is symmetric if it is equal to its transpose, i.e., \(A = A^T\text{.}\) Sage offers is_symmetric() method to check if a matrix is symmetric.
For matrices with complex entries, the complex conjugate is found by taking the conjugate of each individual entry. This operation is often used in conjunction with the transpose to form the conjugate transpose (also called the Hermitian transpose)
In some fields, working over complex vector spaces is necessary and common. In these contexts, the adjoint matrix of a matrix \(A\) refers to its conjugate transpose. It is obtained by first taking the complex conjugate of each entry of \(A\text{,}\) and then transposing the resulting matrix.
The adjoint of a matrix \(A\) is denoted by \(A^{*}\) and defined as: \(A^{*} = \overline{A}^{T}\) where \(\overline{A}\) represents the complex conjugate of \(A\text{.}\)
It is important to note that this meaning of adjoint differs from the adjugate matrix, which will be defined later as the transpose of the cofactor matrix. The two concepts are conceptually distinct:
  • Adjoint: involves complex conjugation and transposition.
  • Adjugate: involves cofactors and determinants (used in matrix inversion).
Sage has built-in method conjugate_transpose to compute the adjoint matrix as follows:
Note that matrices with Complex values, and computing conjugates are very common in signal processing and quantum mechanics.
Just like vectors, matrices also has a norm quantity defined. But unlike vectors, there are several types of norms for matrices. The method norm in Sage returns the Frobenius norm which is defined as the square root of the sum of the squares of all the entries in the matrix.
The trace of a square matrix \(A = [a_{ij}]\) of order \(n \times n\text{,}\) denoted by \(\mathrm{tr}(A)\text{,}\) is defined as the sum of the entries along its main diagonal: \(\mathrm{tr}(A) = \sum_{i=1}^{n} a_{ii}\text{.}\)
The trace has many useful properties, such as linearity and invariance under similarity transformations:
  • \(\displaystyle \mathrm{tr}(A + B) = \mathrm{tr}(A) + \mathrm{tr}(B)\)
  • \(\mathrm{tr}(kA) = k \, \mathrm{tr}(A)\) for any scalar \(k\)
  • \(\mathrm{tr}(AB) = \mathrm{tr}(BA)\) for any square matrices \(A\) and \(B\) of the same size
The built-in Sage method .trace() is used to compute the trace of a square matrix as shown in the example below.