(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Determines whether or not an operator is block positive

Other toolboxes required CVX
Related functions IsPPT
Function category Entanglement and separability

IsBlockPositive is a function that determines whether or not a bipartite operator is block positive (roughly speaking, it determines whether the operator is an entanglement witness or not). A value of 0 indicates that the operator is not block positive (and hence is not an entanglement witness), a value of 1 indicates that the operator is block positive (and hence is either an entanglement witness or is positive semidefinite), and a value of -1 indicates that the script was unable to determine whether or not the operator is block positive.


  • IBP = IsBlockPositive(X)
  • IBP = IsBlockPositive(X,K)
  • IBP = IsBlockPositive(X,K,DIM)
  • IBP = IsBlockPositive(X,K,DIM,STR)
  • IBP = IsBlockPositive(X,K,DIM,STR,TOL)
  • [IBP,WIT] = IsBlockPositive(X,K,DIM,STR,TOL)

Argument descriptions

  • X: A bipartite Hermitian operator.
  • K (optional, default 1): A positive integer indicating that the script should determine whether or not X is K-block positive (i.e., whether or not it remains nonnegative under left and right multiplication by vectors with Schmidt rank <= K).
  • DIM (optional, by default has both subsystems of equal dimension): A 1-by-2 vector containing the dimensions of the two subsystems that X acts on.
  • STR (optional, default 2): An integer that determines how hard the script should work to determine block positivity before giving up (STR = -1 means that the script won't stop working until it finds an answer). Other valid values are 0, 1, 2, 3, .... In practice, if STR >= 4 then most computers will run out of memory and/or the sun will explode before computation completes.
  • TOL (optional, default eps^(3/8)): The numerical tolerance used throughout the script.


The swap operator is block positive

The swap operator always block positive, since it is the Choi matrix of the transpose map (and it is easy to see that the transpose map is positive). We can verify this in small dimensions as follows:

>> for d = 2:10
       res(d) = IsBlockPositive(SwapOperator(d));
>> res(2:10)

ans =

     1     1     1     1     1     1     1     1     1

However, the swap operator is not 2-block positive, which we can verify as follows:

>> IsBlockPositive(SwapOperator(5),2)

ans =


The Choi map is positive

The Choi map is a well-known example of a positive linear map that acts on 3-by-3 matrices. The following code verifies that this map is indeed positive, but not 2-positive:

>> IsBlockPositive(ChoiMap())

ans =


>> IsBlockPositive(ChoiMap(),2)

ans =


A complicated operator on 4 local dimensions

A somewhat messy positive linear map was introduced in Lemma 3 of [1]. The following code verifies that this map is indeed positive in the $t = 1$ case.

>> b0 = Bell(0);
>> b3 = Bell(3);
>> v0 = kron(b0,b0);
>> Y = (kron(eye(4),b0*b0')/2 + kron(b3*b3',PartialTranspose(b3*b3',1)))/3 - v0*v0'/4;
>> Y = Swap(Y,[2,3],[2,2,2,2]); % this is the Choi matrix of the linear map given in Lemma 3
>> IsBlockPositive(Y)

ans =


Source code

Click here to view this function's source code on github.


  1. S. Bandyopadhyay, A. Cosentino, N. Johnston, V. Russo, J. Watrous, and N. Yu. Limitations on separable measurements by convex optimization. E-print: arXiv:1408.6981 [quant-ph], 2014.