Negativity

Negativity is a function that computes the negativity of a bipartite density matrix, which is defined as follows:
 * $$\mathcal{N}(\rho) := \frac{1}{2}\big( \|\rho^\Gamma\|_1 - 1 \big),$$

where $\rho^\Gamma$ is the partial transpose of $\rho$ and $\|\cdot\|_1$ is the trace norm. Equivalently, the negativity of $\rho$ is the absolute value of the sum of the negative eigenvalues of $\rho^\Gamma$.

Syntax

 * NEG = Negativity(RHO)
 * NEG = Negativity(RHO,DIM)

Argument descriptions

 * RHO: A bipartite density matrix.
 * DIM (optional, by default has both subsystems of equal dimension): A specification of the dimensions of the subsystems that RHO acts on. DIM can be provided in one of two ways:
 * If DIM is a scalar, it is assumed that the first subsystem has dimension DIM</tt> and the second subsystem has dimension length(RHO)/DIM</tt>.
 * If $X \in M_{n_1} \otimes M_{n_2}$ then DIM</tt> should be a row vector containing the dimensions (i.e., DIM = [n_1, n_2]</tt>).

PPT states have zero negativity
States with positive partial transpose have zero negativity. The following code verifies this fact for one particular Chessboard state:

Can be used with CVX
This function is convex and can be used in the objective function or constraints of a CVX optimization problem. For example, the following code finds the maximum overlap of a density matrix $\rho$ with the maximally-entangled pure state, subject to the constraint that its negativity is no larger than 1/2: