Section 8.2 Minors of a Matrix
A minor \(M_{ij}\) of a matrix \(A\) is the determinant of the submatrix obtained by deleting the \(i^{th}\) row and \(j^{th}\) column of \(A\text{.}\)
Currently, Sage does not implement methods to directly extract the minors of a matrix. To compute a minor \(M_{ij}\) of a matrix \(A\text{,}\) Sage offers
delete_rows() and delete_columns() methods which can be used to delete a specific row \(i\) and column \(j\) and obtain a submatrix whose determinant yields a minor \(M_{ij}\text{.}\) Below is a demonstration how to compute the minor \(M_{12}\) of a given matrix \(A\text{.}\)
Sageβs
minors() method can be used to compute the minors of a matrix. The method takes an integer \(n\) and returns a all minors of size \(n \times n\) of the matrix as a list.
For a square matrix of size \(N \times N\text{,}\) the number of minors of size \(n \times n\) is given by \(\binom{N}{n}^2\text{,}\) since we need to choose \(n\) rows and \(n\) columns from the original matrix to form the submatrix whose determinant gives the minor.
For example, for the previous 5x5 matrix, there are \(100\) minors of size \(2 \times 2\) (\(5\) choose \(2\) for rows gives \(10\text{,}\) and the same thing for columns, resulting in \(10 \times 10 = 100\)).
Note that for a square matrix of size \(N \times N\text{,}\) the method
minors(N) returns a list with a single element which is the determinant of the matrix itself.
Similarly, the minors of size \(1\) will be the individual entries of the matrix as a list.
Also, for \(n > N\text{,}\) the method
minors(n) returns an empty list since there are no minors of size larger than the matrix itself.
To construct the matrix of minors for a given square matrix \(A\) of size \(N \times N\text{,}\) we can use the list of minors obtained from
minors(N-1) and reshape it into a matrix (must reverse the order of the minors since they are returned in a specific order corresponding to the rows and columns deleted).
For example, to construct a matrix of all 4x4 minors of the matrix \(A\text{,}\) we can do as follows:
To verify that the matrix of minors is correct, we can compute the matrix of minors by iterating over all rows and columns of the original matrix, and computing the determinant of the submatrix obtained by deleting the corresponding row and column to compute the minor for each entry of the matrix of minors. The resulting matrix should match the one obtained from reshaping the list of minors.
