def det_LU_decomposition(self):
        if not self.is_square:
            raise NonSquareMatrixError()
        if not self:
            return S.One

        M, n = self.copy(), self.rows
        p, prod = [], 1
        l, u, p = M.LUdecomposition()
        if len(p) % 2:
            prod = -1

        for k in range(n):
            prod = prod*u[k, k]*l[k, k]

        return prod.expand()
Compute matrix determinant using LU decomposition
dataset/ETHPy150Open sympy/sympy/sympy/matrices/matrices.py/MatrixBase.det_LU_decomposition