matrix_props.is_positive

Checks if the matrix is positive.

Functions

is_positive(input_mat)

Check if the matrix is positive.

Module Contents

matrix_props.is_positive.is_positive(input_mat)

Check if the matrix is positive.

When all the entries in the matrix are larger than zero the matrix of interest is a positive matrix [1].

Examples

We expect a matrix full of 1s to be positive.

>>> import numpy as np
>>> from toqito.matrix_props import is_positive
>>> input_mat = np.array([[1, 1, 1],[1, 1, 1],[1, 1, 1]])
>>> is_positive(input_mat)
np.True_

References

[1]

Wikipedia. Nonnegative matrix. URL: https://en.wikipedia.org/wiki/Nonnegative_matrix.

input_mat: np.ndarray

Matrix of interest.

Parameters:

input_mat (numpy.ndarray)

Return type:

bool