toqito.matrix_props.is_block_positive

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

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

Raises:

ValueError – Unable to determine block positive property.

Parameters:
  • mat – A bipartite Hermitian operator.

  • k – 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 – The dimension of the two sub-systems. By default it’s assumed to be equal.

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

  • rtol – 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.