# ulab.linalg – Linear algebra functions¶

ulab.linalg.cholesky(A: ulab.array) → ulab.array
Parameters: Return ~ulab.array L: A (array) – a positive definite, symmetric square matrix a square root matrix in the lower triangular form ValueError – If the input does not fulfill the necessary conditions

The returned matrix satisfies the equation m=LL*

ulab.linalg.det(m: ulab.array) → float
Param: m, a square matrix The determinant of the matrix

Computes the eigenvalues and eigenvectors of a square matrix

ulab.linalg.dot(m1: ulab.array, m2: ulab.array) → Union[ulab.array, float]
Parameters: m1 (array) – a matrix, or a vector m2 (array) – a matrix, or a vector

Computes the product of two matrices, or two vectors. In the letter case, the inner product is returned.

ulab.linalg.eig(m: ulab.array) → Tuple[ulab.array, ulab.array]
Parameters: m – a square matrix

Computes the eigenvalues and eigenvectors of a square matrix

ulab.linalg.inv(m: ulab.array) → ulab.array
Parameters: m (array) – a square matrix The inverse of the matrix, if it exists ValueError – if the matrix is not invertible

Computes the inverse of a square matrix

ulab.linalg.norm(x: ulab.array) → float
Parameters: x (array) – a vector or a matrix

Computes the 2-norm of a vector or a matrix, i.e., sqrt(sum(x*x)), however, without the RAM overhead.

ulab.linalg.size(array: ulab.array) → int

Return the total number of elements in the array, as an integer.

ulab.linalg.trace(m: ulab.array) → float
Parameters: m – a square matrix

Compute the trace of the matrix, the sum of its diagonal elements.