dpnp.linalg.det

dpnp.linalg.det(a)[source]

Compute the determinant of an array.

For full documentation refer to numpy.linalg.det.

Parameters:

a ((..., M, M) {dpnp.ndarray, usm_ndarray}) -- Input array to compute determinants for.

Returns:

det -- Determinant of a.

Return type:

(...) dpnp.ndarray

See also

dpnp.linalg.slogdet

Returns sign and logarithm of the determinant of an array.

Examples

The determinant of a 2-D array [[a, b], [c, d]] is ad - bc:

>>> import dpnp as dp
>>> a = dp.array([[1, 2], [3, 4]])
>>> dp.linalg.det(a)
array(-2.)

Computing determinants for a stack of matrices:

>>> a = dp.array([ [[1, 2], [3, 4]], [[1, 2], [2, 1]], [[1, 3], [3, 1]] ])
>>> a.shape
(3, 2, 2)
>>> dp.linalg.det(a)
array([-2., -3., -8.])