IsCP
From QETLAB
IsCP | |
Determines whether or not a superoperator is completely positive | |
Other toolboxes required | none |
---|---|
Related functions | IsHermPreserving |
Function category | Superoperators |
IsCP is a function that determines whether or not a given superoperator is completely positive.
Syntax
- CP = IsCP(PHI)
- CP = IsCP(PHI,TOL)
Argument descriptions
- PHI: A superoperator. Should be provided as either a Choi matrix, or as a cell with either 1 or 2 columns (see the tutorial page for more details about specifying superoperators within QETLAB).
- TOL (optional, default eps^(3/4)): The numerical tolerance used when determining complete positivity.
Examples
The following code verifies that the map $\Phi$ defined by $\Phi(X) = X - UXU^*$ is not completely positive, where $U = \frac{1}{\sqrt{2}}\begin{bmatrix}1 & 1 \\ -1 & 1\end{bmatrix}$.
Source code
Click on "expand" to the right to view the MATLAB source code for this function.
%% ISCP Determines whether or not a superoperator is completely positive
% This function has one required argument:
% PHI: a superoperator
%
% CP = IsCP(PHI) is either 1 or 0, indicating that PHI is or is not
% completely positive (within reasonable numerical error).
%
% This function has one optional input argument:
% TOL (default eps^(3/4))
%
% CP = IsCP(PHI,TOL) determines whether or not PHI is completely positive
% within the numerical tolerance specified by TOL.
%
% URL: http://www.qetlab.com/IsCP
% requires: ApplyMap.m, ChoiMatrix.m, iden.m, IsHermPreserving.m,
% IsPSD.m, MaxEntangled.m, opt_args.m, PermuteSystems.m,
% sporth.m, superoperator_dims.m
%
% author: Nathaniel Johnston (nathaniel@njohnston.ca)
% package: QETLAB
% last updated: January 4, 2013
function cp = IsCP(Phi,varargin)
if(iscell(Phi) && size(Phi,2) == 1)
cp = 1;
return
end
% Use Choi's theorem to determine whether or not Phi is CP.
C = ChoiMatrix(Phi);
cp = (IsHermPreserving(C,varargin{:}) && IsPSD(C,varargin{:}));