A submatrix of a matrix is obtained by deleting any collection of rows and/or columns.
For example, from the following 3-by-4 matrix, we can construct a 2-by-3 submatrix by removing row 3 and column 2:
The minors and cofactors of a matrix are found by computing the determinant of certain submatrices.
A principal submatrix is a square submatrix obtained by removing certain rows and columns. The definition varies from author to author. According to some authors, a principal submatrix is a submatrix in which the set of row indices that remain is the same as the set of column indices that remain.
For a general 3 × 3 matrix in Mathematica,
(mat = Array[Subscript[a, ##] &, {3, 3}]) // MatrixForm
$mat=\left( \begin{array}{ccc} a_{1,1} & a_{1,2} & a_{1,3} \\ a_{2,1} & a_{2,2} & a_{2,3} \\ a_{3,1} & a_{3,2} & a_{3,3} \\ \end{array} \right)$
there is one third order principal submatrix, namely mat. There are three second order principal submatrix:
$mat_{33}=\left( \begin{array}{ccc} a_{1,1} & a_{1,2} \\ a_{2,1} & a_{2,2} \\ \end{array} \right)$, formed by deleting column 3 and row 3;
$mat_{22}=\left( \begin{array}{ccc} a_{1,1} & a_{1,3} \\ a_{3,1} & a_{3,3} \\ \end{array} \right)$, formed by deleting column 2 and row 2;
$mat_{11}=\left( \begin{array}{ccc} a_{2,2} & a_{2,3} \\ a_{3,2} & a_{3,3} \\ \end{array} \right)$, formed by deleting column 1 and row 1;
And there are three first order principal submatrix:
$mat=\left( \begin{array}{ccc} a_{1,1} \\ \end{array} \right)$, formed by deleting column 2,3 and row 2,3;
$mat=\left( \begin{array}{ccc} a_{2,2} \\ \end{array} \right)$, formed by deleting column 1, 3 and row 1, 3;
$mat=\left( \begin{array}{ccc} a_{3,3} \\ \end{array} \right)$, formed by deleting column 1,2 and row 1,2;
Do you have a way to find all principal submatrix in Mathematica ?
or find the determine of all principal submatrix (principal minor) in Mathematica ?
By @klgr comment.
Diagonal@Map[Reverse, Minors[mat, k, Identity], {0, 1}] //MatrixForm /@ # &
Diagonal @ Minors[mat, k]
? $\endgroup$Diagonal@Map[Reverse, Minors[mat, k, Identity], {0, 1}] // MatrixForm /@ # &
$\endgroup$