IsPPT

IsPPT is a function that determines whether or not a given matrix has positive partial transpose (PPT), which is a quick and easy separability criterion. This function works on both full and sparse matrices, and if desired a witness can be provided that verifies that the input matrix is not PPT.

Syntax

 * PPT = IsPPT(X)
 * PPT = IsPPT(X,SYS)
 * PPT = IsPPT(X,SYS,DIM)
 * PPT = IsPPT(X,SYS,DIM,TOL)
 * [PPT,WIT] = IsPPT(X,SYS,DIM,TOL)

Input arguments

 * X: A square matrix.
 * SYS (optional, default 2): A scalar or vector indicating which subsystem(s) the transpose should be applied on.
 * DIM</tt> (optional, default has X</tt> living on two subsystems of equal size): A vector containing the dimensions of the (possibly more than 2) subsystems on which X</tt> lives.
 * TOL</tt> (optional, default sqrt(eps)</tt>): The numerical tolerance used when determining positive semidefiniteness. The matrix will be determined to have positive partial transpose if its partial transpose's minimal eigenvalue is computed to be at least -TOL</tt>.

Output arguments

 * PPT</tt>: A flag (either 1 or 0) indicating that X</tt> does or does not have positive partial transpose.
 * WIT</tt> (optional): An eigenvector corresponding to the minimal eigenvalue of PartialTranspose(X)</tt>. When PPT = 0</tt>, this serves as a witness that verifies that X</tt> does not have positive partial transpose, since WIT'*PartialTranspose(X)*WIT < 0</tt>.

Examples
The following code verifies that the 9-by-9 identity operator (thought of as an operator in $M_3 \otimes M_3$) has positive partial transpose: