One-line definition
The determinant of a square matrix is the signed factor by which scales -dimensional volumes. Geometrically, is the volume of the parallelepiped spanned by ‘s column vectors; the sign flips if contains a reflection.
Why it matters
Determinants tell you whether a linear map is invertible (non-zero det) or singular (zero det). They appear in change-of-variables formulas (probability density transformations, normalizing flows), in computing volumes of parallelotopes (Gaussian likelihoods), and as Jacobian determinants in differential geometry.
Properties
For :
- . Composition multiplies volumes.
- .
- when is invertible.
- for scalar .
- columns linearly dependent not invertible has a zero eigenvalue.
- (product of eigenvalues, with multiplicity, possibly complex).
- For triangular matrices: (product of diagonal).
Geometric interpretation
The columns of are vectors in . They span a parallelepiped. Its volume is .
- : preserves orientation.
- : reverses orientation (contains a reflection).
- : parallelepiped is flat. Columns are linearly dependent. collapses at least one dimension.
For an orthogonal matrix : (rotation/reflection preserves volume).
Change of variables (probability)
If with invertible and differentiable, the density of is
where is the Jacobian of the inverse transform. This is the basis of normalizing flows: pick so the Jacobian determinant is cheap to compute (triangular Jacobian → ).
Computing determinants
| Method | Cost | When |
|---|---|---|
| LU decomposition | General-purpose; standard library default | |
| Triangular: product of diag | When matrix is already triangular | |
| Eigendecomposition: | If you need eigenvalues anyway | |
| Log-determinant for PD matrices | via Cholesky | When you only need (e.g., Gaussian log-likelihood) |
Numerical tip: for large matrices, compute directly (sum of of LU diagonal); itself overflows or underflows quickly.
Common pitfalls
- Using as a proxy for matrix “size.” A nearly singular matrix can have huge entries but tiny .
- Computing for invertibility tests. Numerically unstable; use rank or condition number instead.
- Forgetting the absolute value in change-of-variables formulas. Densities are non-negative; the Jacobian determinant can be negative.