Determinant of Large Matrix
Mark Westwood
markc.westwood at gmail.com
Thu Jun 7 12:27:39 CEST 2007
Hi James
Mathematica says that the determinant of the integer version of this
matrix is 2774532096, which is another vote for the answer you have.
Mathematica says that the determinant of the 24-digit real version of
your matrix is 2.774532096*10^9, which looks very similar to me.
I'd go with Numpy.
Regards
Mark Westwood
PS 13x13 isn't a large matrix !
On Jun 6, 12:10 pm, James Stroud <jstr... at mbi.ucla.edu> wrote:
> Hello All,
>
> I'm using numpy to calculate determinants of matrices that look like
> this (13x13):
>
> [[ 0. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
> [ 1. 0. 1. 4. 1. 9. 4. 4. 1. 1. 4. 9. 4. 9.]
> [ 1. 1. 0. 1. 4. 4. 9. 9. 4. 4. 1. 4. 1. 4.]
> [ 1. 4. 1. 0. 9. 1. 4. 4. 9. 1. 4. 1. 4. 1.]
> [ 1. 1. 4. 9. 0. 4. 4. 4. 1. 4. 1. 9. 4. 9.]
> [ 1. 9. 4. 1. 4. 0. 4. 4. 9. 4. 1. 1. 4. 1.]
> [ 1. 4. 9. 4. 4. 4. 0. 1. 1. 1. 9. 1. 9. 4.]
> [ 1. 4. 9. 4. 4. 4. 1. 0. 4. 1. 9. 4. 4. 1.]
> [ 1. 1. 4. 9. 1. 9. 1. 4. 0. 4. 4. 4. 4. 9.]
> [ 1. 1. 4. 1. 4. 4. 1. 1. 4. 0. 9. 4. 9. 4.]
> [ 1. 4. 1. 4. 1. 1. 9. 9. 4. 9. 0. 4. 1. 4.]
> [ 1. 9. 4. 1. 9. 1. 1. 4. 4. 4. 4. 0. 4. 1.]
> [ 1. 4. 1. 4. 4. 4. 9. 4. 4. 9. 1. 4. 0. 1.]
> [ 1. 9. 4. 1. 9. 1. 4. 1. 9. 4. 4. 1. 1. 0.]]
>
> For this matrix, I'm getting this with numpy:
>
> 2774532095.9999971
>
> But I have a feeling I'm exceeding the capacity of floats here. Does
> anyone have an idea for how to treat this? Is it absurd to think I could
> get a determinant of this matrix? Is there a python package that could
> help me?
>
> Many thanks for any answers.
>
> James
More information about the Python-list
mailing list