|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)
- 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:
However, the swap operator is not 2-block positive, which we can verify as follows:
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:
A complicated operator on 4 local dimensions
A somewhat messy positive linear map was introduced in Lemma 3 of . The following code verifies that this map is indeed positive in the $t = 1$ case.
Click on "expand" to the right to view the MATLAB source code for this function.
%% ISBLOCKPOSITIVE Determines whether or not an operator is block positive
% This function has one required input argument:
% X: a square matrix
% IBP = IsBlockPositive(X) is either -1, 0, or 1. A value of 1 indicates
% that X is block positive, a value of 0 indicates that X is not block
% positive, and a value of -1 indicates that the block positivity of X
% could not be determined.
% This function has four optional input arguments:
% K (default 1)
% DIM (default has both subsystems of equal dimension)
% STR (default 2)
% TOL (default eps^(3/8))
% [IBP,WIT] = IsBlockPositive(X,K,DIM,STR,TOL) is as above, where DIM is
% a 1-by-2 vector containing the dimensions of the subsystems on which X
% K is the "level" of positivity -- the script checks whether or not X is
% K-block positive. That is, it checks whether or not X has positive
% expectation with all states of Schmidt rank <= K.
% STR is 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
% TOL is the numerical tolerance used throughout the script.
% WIT is a witness that verifies that X is (or is not) block positive.
% URL: http://www.qetlab.com/IsBlockPositive
% requires: cvx (http://cvxr.com/cvx/), iden.m, IsPSD.m, kpNorm.m,
% MaxEntangled.m, normalize_cols.m, opt_args.m, PartialMap.m,
% PartialTrace.m, PartialTranspose.m, PermuteSystems.m,
% Realignment.m, SchmidtDecomposition.m, SchmidtRank.m,
% sk_iterate.m, SkOperatorNorm.m, SkVectorNorm.m, sporth.m,
% author: Nathaniel Johnston (email@example.com)
% package: QETLAB
% last updated: September 23, 2014
function [ibp,wit] = IsBlockPositive(X,varargin)
wit = 0;
X = full(X);
dX = size(X);
% set optional argument defaults: k=1, dim=sqrt(length(X)), str=2,
if(str == -1)
str = 1/eps; % keep going forever!
% Make sure that X is Hermitian.
ibp = 0;
% allow the user to enter a single number for dim
if(length(dim) == 1)
dim = [dim,dX(1)/dim];
error('IsBlockPositive:InvalidDim','If DIM is a scalar, it must evenly divide length(X); please provide the DIM array containing the dimensions of the subsystems.');
dim(2) = round(dim(2));
% When a local dimension is small, block positivity is trivial.
if(min(dim) <= k)
ibp = IsPSD(X);
wit = zeros(dX);
op_norm = norm(X);
Y = op_norm*speye(dX(1)) - X; % we compute the S(k)-norm of this operator
[lb,lwit,ub,uwit] = SkOperatorNorm(Y,k,dim,str,op_norm,tol); % compute the norm
if(ub <= op_norm*(1 + tol)) % block positive
ibp = 1;
wit = uwit;
elseif(lb >= op_norm*(1 - tol)) % not block positive
ibp = 0;
wit = lwit;
else % not sure :(
ibp = -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.