scipy.linalg.det

scipy.linalg.det(a, overwrite_a=False)[source]

Compute the determinant of a matrix

The determinant of a square matrix is a value derived arithmetically from the coefficients of the matrix.

The determinant for a 3x3 matrix, for example, is computed as follows:

a    b    c
d    e    f = A
g    h    i

det(A) = a*e*i +b*f*g + c*d*h - c*e*g - b*d*i - a*f*h
Parameters :

a : array_like, shape (M, M)

A square matrix.

overwrite_a : bool

Allow overwriting data in a (may enhance performance).

Returns :

det : float or complex

Determinant of a.

Notes

The determinant is computed via LU factorization, LAPACK routine z/dgetrf.

Examples

>>> a = np.array([[1,2,3],[4,5,6],[7,8,9]])
>>> linalg.det(a)
0.0
>>> a = np.array([[0,2,3],[4,5,6],[7,8,9]])
>>> linalg.det(a)
3.0

Previous topic

scipy.linalg.solve_triangular

Next topic

scipy.linalg.norm