Calculate the determinant of a square matrix used in linear algebra operations.
The determinant of a square matrix is a scalar value that indicates whether the matrix is invertible (non-zero determinant) and represents the signed volume scaling factor of the linear transformation. For a 2×2 matrix [[a,b],[c,d]], det = ad − bc.
2×2 Determinant
det([[a,b],[c,d]]) = a*d - b*c
A zero determinant means the matrix is singular (non-invertible) and the transformation it represents collapses at least one dimension — the rows or columns are linearly dependent.
Determinants appear in Gaussian distributions (normalization constant involves det of covariance matrix), in checking rank of feature matrices, and in volume-preserving normalizing flows.