4
$\begingroup$

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: enter image description here

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 /@ # &
$\endgroup$
  • 3
    $\begingroup$ Perhaps Diagonal @ Minors[mat, k]? $\endgroup$ – Carl Woll Aug 18 '17 at 17:01
  • 1
    $\begingroup$ Diagonal@Map[Reverse, Minors[mat, k, Identity], {0, 1}] // MatrixForm /@ # & $\endgroup$ – kglr Aug 18 '17 at 17:04
  • $\begingroup$ @kglr Thanks for the answer but is this in general. What if the matrix is a 4X4 measurement . $\endgroup$ – Emad kareem Aug 18 '17 at 17:14
  • $\begingroup$ @kglr Thank you very much. This gives the exact result in general. $\endgroup$ – Emad kareem Aug 18 '17 at 17:24
3
$\begingroup$

To get the principal submatrices:

Diagonal[Map[Reverse, Minors[mat, #, Identity], {0, 1}]] & /@ {1, 2}

enter image description here

For the principal minors

Diagonal[Map[Reverse, Minors[mat, #], {0, 1}]] & /@ {1, 2}

enter image description here

$\endgroup$
  • $\begingroup$ What is the & /@ {1, 2} for? $\endgroup$ – AzJ Jan 25 '18 at 19:46
  • 2
    $\begingroup$ @AzJ, the & belongs to the left part, that is, the expression is actually (Diagonal[Map[Reverse, Minors[mat, #], {0, 1}]] & ) /@ {1,2}. For a pure function (a function with unnamed arguments) foo[#]& (where foo is an instruction on what to do with the stuff #; for example, multiply it by 2 and add 1 , (1+ 3 #)&) , the expression foo[#]&/@{a,b,c} Maps foo over a list of arguments ({a, b}) , that is, it is a short hand for ` {foo[a], foo[b], foo[c]}`. ... $\endgroup$ – kglr Jan 25 '18 at 20:34
  • 1
    $\begingroup$ ... Please see the doc pages on for details on of esoteric symbols such as Function (&), Slot (#) and Map $\endgroup$ – kglr Jan 25 '18 at 20:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.