Linear algebra
Determinant
linalg.determinantAlso called determinant, det, matrix determinant
Signed volume scaling of a square matrix, written as the Leibniz sum over permutations σ of 1..n.
Notation
square matrix
A ∈ ℝn×n
matrix size
Size, at least 1
Result: the determinant
scalar
Worked examples
Each result is solved exactly and confirmed by two independent computations.
Given
Result
Given
Result
Given
Result
Common mistakes
Returns the absolute value
The sign from row exchanges or orientation is lost.
Fix: Track the permutation sign, or use numpy.linalg.det.
Multiplies the diagonal of A
The product of the diagonal equals the determinant only for triangular matrices.
Fix: Factor A first (LU or QR) and multiply the diagonal of the factor, with the permutation sign.
Sources
Golub and Van Loan 2013
Golub, Gene H.; Van Loan, Charles F. Matrix Computations. 4th ed. Johns Hopkins University Press, 2013.
Horn and Johnson 2013
Horn, Roger A.; Johnson, Charles R. Matrix Analysis. 2nd ed. Cambridge University Press, 2013.