0

I have an invertible Hermitian matrix M\in \mathbb{C}^{K\times K} and 2^K square submatrices of M, ${M_S}_{S\subseteq {1,\dots,K}}$ defined:

\begin{equation}M_S = (\text{submatrix consisting only of rows and columns $S$ from $M$}) \in \mathbb{C}^{|S|\times |S|}\end{equation}

I need to know the determinant of every $M_S$.

Is there a fast way of computing this in MATLAB?


Here is the bad way to do it:

  • Loop over [1:2^K]
  • Convert loop index to binary vector vSubset
  • Compute det(mtxM(vSubset,vSubset))

This runs slow and seems wasteful, since you can build the determinant of a parent matrix from the determinant of its minors.

duplode
  • 33,731
  • 7
  • 79
  • 150
Christian Chapman
  • 1,018
  • 10
  • 27

1 Answers1

1

One way would be to use the Cholesky factorisation. I use the upper triangular form below, so that

M = U'*U

where ' is adjoint and U is upper triangular. Note that det(M) = square( |det(U)|) and that the determinant of U is the product of its diagonal elements.

We can compute the factor of a matrix obtained from M by appending a row and column like this:

M~ = ( M  n )
     ( n' p )
U~ = ( U  x )
     ( 0  y )

where

U'*x = n 
y = sqrt( p - x'*x)

and so det( M~) = det( M) * ( p - x'*x)

I'm not sure of the best way to use this. There is quite a neat recursive way: in pseudo C code

void det_step( double* U, double det, int high_ix)
{ 
int ix;
  for( ix=high_ix+1; ix<dim; ++ix)
  { // notionally add row, col ix
    // augment U, update det (and store in the output)
    det_step( U, det, ix);
  }
}
void dets( double* M, int dim)
{
int ix;
   for( ix=0; ix<dim; ++ix)
   { // compute U and det for matrix consisting of just row/col ix
     // store det in the output
     det_step( U, det, ix);
   }
}
dmuir
  • 4,211
  • 2
  • 14
  • 12