# Compute determinant of a skew-symmetric matrix

Hello everybody,

To compute an observable in a physical problem I need to compute the determinant of a skew matrix (http://en.wikipedia.org/wiki/Skew-symmetric_matrix#Determinant").
The straightforward way to numerically calculate this determinant is to use a lapack routine that compute the determinant for a general matrix (without symmetries). But this is not the optimal choice for big matrices.

Is there some code (preferably in Fortran, but not necessarily) to compute this determinant in a efficient way? Do I have to write it by myself?

Thank you very much!

Last edited by a moderator:

## Answers and Replies

AlephZero
Science Advisor
Homework Helper
There should be a Lapack routine to calculate the determinant of a symmetric matrix. There was a routine for that in Linpack. It may be an option in the routine to factorize a symmetric matrix for solving linear equations, not a separately named routine.

For a fully populated matrix, the Lapack method is is the most efficient way to do it (it takes O(n^3) operations for an nxn matrix). Of course if your matrix is sparse or has a special structure, you may be able to find a better way that uses all the information you know about the matrix.

Yes, of course, lapack is the best and optimal choice for symmetric or "generic" matrices. But I have not been able to find routines for anti-symmetric matrices in lapack.

Therefore, in your opinion, for an anti-symmetric matrix I have two choices: use lapack routines for "generic" matrices or write by myself a "fast" routine that exploits the anti-symmetry of the matrix. I think that if I write by myself this routine I will not get a better result than O(n^3) operations...so, for the time being, I will use the lapack routine although there should be a faster algorithm. :(

AlephZero
Science Advisor
Homework Helper
Sorry, my bad, my brain decided that "skew" meant "symmetric", which is nonsense of course

The factorization algorithm for symmetric (but not positive definite) matrices is not straightforward, because you can have zero terms on the diagonal. You can't use pivoting because it destroys the symmetry. The LINPACK routine used an algorithm by Bunch and Parlett. Bunch (who was a PhD student of Parlett's, I believe) proved that if you eliminate variables in blocks of either 1 or 2 at a time, the factorization is always numerically stable without pivoting.

I don't have a reference to the original paper but I'm fairly sure it is referenced in the LINPACK / LAPACK documentation. I suspect the same idea would work for skew matrices, where of course every diagonal term in the matrix is zero.

But as you say, you will only gain a speed up of 2 or 3 times compared with a general matrix routine, so it's up to you if this is worth the trouble.