matrix_props.is_block_positive

Is matrix block positive.

Module Contents

Functions

is_block_positive(mat[, k, dim, effort, rtol])

Check if matrix is block positive [1].

matrix_props.is_block_positive.is_block_positive(mat, k=1, dim=None, effort=2, rtol=1e-05)

Check if matrix is block positive [1].

Examples

The swap operator is always block positive, since it is the Choi matrix of the transpose map.

>>> from toqito.matrix_props import is_block_positive
>>> from toqito.perms import swap_operator
>>>
>>> mat = swap_operator(3)
>>> is_block_positive(mat)
True

However, it’s not 2 - block positive.

>>> from toqito.matrix_props import is_block_positive
>>> from toqito.perms import swap_operator
>>>
>>> mat = swap_operator(3)
>>> is_block_positive(mat, k=2)
False

References

[1] (1,2)

Nathaniel Johnston. Norms and cones in the theory of quantum entanglement. 2012. arXiv:1207.1479.

Raises:

RuntimeError – Unable to determine k-block positivity. Please consider increasing the relative tolerance or the effort level.

Parameters:
  • mat (numpy.ndarray) – A bipartite Hermitian operator.

  • k (int) – A positive integer indicating that the function should determine whether or not the input operator is k-block positive, i.e., whether or not it remains nonnegative under left and right multiplication by vectors with Schmidt rank <= k (default 1).

  • dim (int | list[int]) – The dimension of the two sub-systems. By default it’s assumed to be equal.

  • effort (int) – An integer value indicating the amount of computation you want to devote to determine block positivity before giving up.

  • rtol (float) – The relative tolerance parameter (default 1e-05).

Returns:

Return True if matrix is k-block positive definite, False if not, or raise a runtime error if we are unable to determine whether or not the operator is block positive.

Return type:

bool