Posts Tagged ‘Quantum Entanglement’

Introducing QETLAB: A MATLAB toolbox for quantum entanglement

April 14th, 2015

After over two and a half years in various stages of development, I am happy to somewhat “officially” announce a MATLAB package that I have been developing: QETLAB (Quantum Entanglement Theory LABoratory). This announcement is completely arbitrary, since people started finding QETLAB via Google about a year ago, and a handful of papers have made use of it already, but I figured that I should at least acknowledge its existence myself at some point. I’ll no doubt be writing some posts in the near future that highlight some of its more advanced features, but I will give a brief run-down of what it’s about here.

The Basics

First off, QETLAB has a variety of functions for dealing with “simple” things like tensor products, Schmidt decompositions, random pure and mixed states, applying superoperators to quantum states, computing Choi matrices and Kraus operators, and so on, which are fairly standard daily tasks for quantum information theorists. These sorts of functions are somewhat standard, and are also found in a few other MATLAB packages (such as Toby Cubitt’s nice Quantinf package and Géza Tóth’s QUBIT4MATLAB package), so I won’t really spend any time discussing them here.

Mixed State Separability

The “motivating problem” for QETLAB is the separability problem, which asks us to (efficiently / operationally / practically) determine whether a given mixed quantum state is separable or entangled. The (by far) most well-known tool for this job is the positive partial transpose (PPT) criterion, which says that every separable state remains positive semidefinite when the partial transpose map is applied to it. However, this is just a quick-and-dirty one-way test, and going beyond it is much more difficult.

The QETLAB function that tries to solve this problem is the IsSeparable function, which goes through several separability criteria in an attempt to prove the given state separable or entangled, and provides a journal reference to the paper that contains the separability criteria that works (if one was found).

As an example, consider the “tiles” state, introduced in [1], which is an example of a quantum state that is entangled, but is not detected by the simple PPT test for entanglement. We can construct this state using QETLAB’s UPB function, which lets the user easily construct a wide variety of unextendible product bases, and then verify its entanglement as follows:

>> u = UPB('Tiles'); % generates the "Tiles" UPB
>> rho = eye(9) - u*u'; % rho is the projection onto the orthogonal complement of the UPB
>> rho = rho/trace(rho); % we are now done constructing the bound entangled state
>> IsSeparable(rho)
Determined to be entangled via the realignment criterion. Reference:
K. Chen and L.-A. Wu. A matrix realignment method for recognizing entanglement.
Quantum Inf. Comput., 3:193-202, 2003.
ans =

And of course more advanced tests for entanglement, such as those based on symmetric extensions, are also checked. Generally, quick and easy tests are done first, and slow but powerful tests are only performed if the script has difficulty finding an answer.

Alternatively, if you want to check individual tests for entanglement yourself, you can do that too, as there are stand-alone functions for the partial transpose, the realignment criterion, the Choi map (a specific positive map in 3-dimensional systems), symmetric extensions, and so on.

Symmetry of Subsystems

One problem that I’ve come across repeatedly in my work is the need for robust functions relating to permuting quantum systems that have been tensored together, and dealing with the symmetric and antisymmetric subspaces (and indeed, this type of thing is quite common in quantum information theory). Some very basic functionality of this type has been provided in other MATLAB packages, but it has never been as comprehensive as I would have liked. For example, QUBIT4MATLAB has a function that is capable of computing the symmetric projection on two systems, or on an arbitrary number of 2- or 3-dimensional systems, but not on an arbitrary number of systems of any dimension. QETLAB’s SymmetricProjection function fills this gap.

Similarly, there are functions for computing the antisymmetric projection, for permuting different subsystems, and for constructing the unitary swap operator that implements this permutation.

Nonlocality and Bell Inequalities

QETLAB also has a set of functions for dealing with quantum non-locality and Bell inequalities. For example, consider the CHSH inequality, which says that if \(\{A_1,A_2\}\) and \(\{B_1,B_2\}\) are \(\{-1,+1\}\)-valued measurement settings, then the following inequality holds in classical physics (where \(\langle \cdot \rangle\) denotes expectation):

\(\langle A_1B_1 \rangle + \langle A_1B_2 \rangle + \langle A_2B_1 \rangle – \langle A_2B_2 \rangle \leq 2.\)

However, in quantum-mechanical settings, this inequality can be violated, and the quantity on the left can take on a value as large as \(2\sqrt{2}\) (this is Tsirelson’s bound). Finally, in no-signalling theories, the quantity on the left can take on a value as large as \(4\).

All three of these quantities can be easily computed in QETLAB via the BellInequalityMax function:

>> coeffs = [1 1;1 -1]; % coefficients of the terms <A_iB_j> in the Bell inequality
>> a_coe = [0 0]; % coefficients of <A_i> in the Bell inequality
>> b_coe = [0 0]; % coefficients of <B_i> in the Bell inequality
>> a_val = [-1 1]; % values of the A_i measurements
>> b_val = [-1 1]; % values of the B_i measurements
>> BellInequalityMax(coeffs, a_coe, b_coe, a_val, b_val, 'classical')
ans =
>> BellInequalityMax(coeffs, a_coe, b_coe, a_val, b_val, 'quantum')
ans =
>> BellInequalityMax(coeffs, a_coe, b_coe, a_val, b_val, 'nosignal')
ans =

The classical value of the Bell inequality is computed simply by brute force, and the no-signalling value is computed via a linear program. However, no reasonably efficient method is known for computing the quantum value of a Bell inequality, so this quantity is estimated using the NPA hierarchy [2]. Advanced users who want more control can specify which level of the NPA hierarchy to use, or even call the NPAHierarchy function directly themselves. There is also a closely-related function for computing the classical, quantum, or no-signalling value of a nonlocal game (in case you’re a computer scientist instead of a physicist).

Download and Documentation

QETLAB v0.8 is currently available at (where you will also find its documentation) and also on github. If you have any suggestions/comments/requests/anything, or if you have used QETLAB in your work, please let me know!


  1. C.H. Bennett, D.P. DiVincenzo, T. Mor, P.W. Shor, J.A. Smolin, and B.M. Terhal. Unextendible product bases and bound entanglement. Phys. Rev. Lett. 82, 5385–5388, 1999. E-print: arXiv:quant-ph/9808030
  2. M. Navascués, S. Pironio, and A. Acín. A convergent hierarchy of semidefinite programs characterizing the set of quantum correlations. New J. Phys., 10:073013, 2008. E-print: arXiv:0803.4290 [quant-ph]

What the Operator-Schmidt Decomposition Tells Us About Entanglement

June 27th, 2014

In quantum information theory, the well-known Schmidt decomposition theorem tells us that every pure quantum state \(|\phi\rangle\in\mathbb{C}^d\otimes\mathbb{C}^d\) can be written in the form

\(|\phi\rangle =\displaystyle\sum_{i=1}^d\gamma_i|a_i\rangle\otimes|b_i\rangle,\)

where each \(\gamma_i \geq 0\) is a real scalar and the sets \(\{|a_i\rangle\}\) and \(\{|b_i\rangle\}\) form orthonormal bases of \(\mathbb{C}^d\).

The Schmidt decomposition theorem isn’t anything fancy: it is just the singular value decomposition in disguise (the \(\gamma_i\)’s are singular values of some matrix and the sets \(\{|a_i\rangle\}\) and \(\{|b_i\rangle\}\) are its left and right singular vectors). However, it tells us everything we could ever want to know about the entanglement of \(|\phi\rangle\): it is entangled if and only if it has more than one non-zero \(\gamma_i\), and in this case the question of “how much” entanglement is contained within \(|\phi\rangle\) is answered by a certain function of the \(\gamma_i\)’s.

Well, we can find a similar decomposition of mixed quantum states. If \(\rho\in M_d\otimes M_d\) is a mixed quantum state then it can be written in its operator-Schmidt decomposition:

\(\rho=\displaystyle\sum_{i=1}^{d^2}\gamma_iA_i\otimes B_i,\)

where each \(\gamma_i \geq 0\) is a real scalar and the sets \(\{A_i\}\) and \(\{B_i\}\) form orthonormal bases of Hermitian matrices in \(M_d\) (under the Hilbert–Schmidt inner product \(\langle A,B\rangle :=\mathrm{Tr}(A^\dagger B)\)).

Once again, we haven’t really done anything fancy: the operator-Schmidt decomposition is also just the singular value decomposition in disguise in almost the exact same way as the regular Schmidt decomposition. However, its relationship with entanglement of mixed states is much weaker (as we might expect from the fact that the singular value decomposition can be computed in polynomial time, but determining whether a mixed state is entangled or separable (i.e., not entangled) is expected to be hard [1]). In this post, we’ll investigate some cases when the operator-Schmidt decomposition does let us conclude that \(\rho\) is separable or entangled.

Proving a State is Entangled: The Realignment Criterion

One reasonably well-known method for proving that a mixed state is entangled is the realignment criterion [2,3]. What is slightly less well-known is that the realignment criterion can be phrased in terms of the coefficients \(\{\gamma_i\}\) in the operator-Schmidt decomposition of \(\rho\).

Theorem 1 (realignment criterion). Let \(\rho\in M_d\otimes M_d\) have operator-Schmidt decomposition

\(\rho=\displaystyle\sum_{i=1}^{d^2}\gamma_iA_i\otimes B_i.\)

If \(\sum_{i=1}^{d^2}\gamma_i>1\) then \(\rho\) is entangled.

Proof. The idea is to construct a specific entanglement witness that detects the entanglement in \(\rho\). In particular, the entanglement witness that we will use is \(W:=I-\sum_{i=1}^{d^2}A_i\otimes B_i\). To see that \(W\) is indeed an entanglement witness, we must show that \((\langle a|\otimes\langle b|)W(|a\rangle\otimes|b\rangle)\geq 0\) for all \(|a\rangle\in\mathbb{C}^m\) and \(|b\rangle\in\mathbb{C}^n\). Well, some algebra shows that

\((\langle a|\otimes\langle b|)W(|a\rangle\otimes|b\rangle) = 1 – \displaystyle\sum_{i=1}^{d^2}\langle a|A_i|a\rangle\langle b|B_i|b\rangle,\)

so it suffices to show that \(\sum_{i=1}^{d^2}\langle a|A_i|a\rangle\langle b|B_i|b\rangle\leq 1\). To see this notice that

\(\displaystyle\sum_{i=1}^{d^2}\langle a|A_i|a\rangle\langle b|B_i|b\rangle\leq \sqrt{\sum_{i=1}^{d^2}(\langle a|A_i|a\rangle)^2}\sqrt{\sum_{i=1}^{d^2}(\langle b|B_i|b\rangle)^2}= 1,\)

where the inequality is the Cauchy–Schwarz inequality and the equality comes from the fact that the sets \(\{A_i\}\) and \(\{B_i\}\) are orthonormal bases, so \(\sum_{i=1}^{d^2}(\langle a|A_i|a\rangle)^2=\big\langle |a\rangle\langle a|,|a\rangle\langle a|\big\rangle=1\) (and similarly for \(|b\rangle\)).

Now that we know that \(W\) is an entanglement witness, we must check that it detects the entanglement in \(\rho\) (that is, we want to show that \(\mathrm{Tr}(W\rho)<0\)). This is straightforward to show by making use of the fact that the sets \(\{A_i\}\) and \(\{B_i\}\) are orthonormal:

\(\mathrm{Tr}(W\rho) = \displaystyle\mathrm{Tr}\left( \Big(I – \sum_{i=1}^{d^2}A_i\otimes B_i\Big)\Big(\sum_{i=1}^{d^2}\gamma_iA_i\otimes B_i\Big)\right)=1-\mathrm{Tr}\left(\sum_{i,j=1}^{d^2}\gamma_iA_iA_j\otimes B_iB_j\right)\)

\({}_{{}_{{}_{.}}} \phantom{\mathrm{Tr}(W\rho)}=\displaystyle 1-\sum_{i,j=1}^{d^2}\gamma_i\mathrm{Tr}(A_iA_j)\mathrm{Tr}(B_iB_j)=1-\sum_{i=1}^{d^2}\gamma_i<0.\)

It follows that \(\rho\) is entangled, which completes the proof.

A more popular formulation of the realignment criterion says that if we define the realignment map \(R\) by \(R(|i\rangle\langle j|\otimes|k\rangle\langle\ell|)=|i\rangle\langle k|\otimes|j\rangle\langle\ell|\) and extending by linearity, and let \(\|\cdot\|_{tr}\) denote the trace norm (i.e., the sum of the singular values), then \(\|R(\rho)\|_{tr}>1\) implies that \(\rho\) is entangled. The equivalence of these two formulations of the realignment criterion comes from the fact that the singular values of \(R(\rho)\) are exactly the coefficients \(\{\gamma_i\}\) in its operator-Schmidt decomposition.

Proving a State is Entangled: Beyond the Realignment Criterion

We might naturally wonder whether we can prove that even more states are entangled based on their operator-Schmidt decomposition than those detected by the realignment criterion. The following theorem gives one sense in which the answer to this question is “no”: if we only look at “nice” functions of the coefficients \(\{\gamma_i\}\) then the realignment criterion gives the best method of entanglement detection possible.

Theorem 2. Let \(f : \mathbb{R}^{d^2}\rightarrow\mathbb{R}_{\geq 0}\) be a symmetric gauge function (i.e., a norm that is invariant under permutations and sign changes of the \(d^2\) entries of the input vector). If we can conclude that \(\rho\in M_d\otimes M_d\) is entangled based on the value of \(f(\gamma_1,\gamma_2,\ldots,\gamma_{d^2})\) then it must be the case that \(\sum_{i=1}^{d^2}\gamma_i>1\).

Proof. Without loss of generality, we scale \(f\) so that \(f(1,0,0,\ldots,0) = 1\). We first prove two facts about \(f\).

Claim 1: \(f(\gamma_1,\gamma_2,\ldots,\gamma_{d^2})\geq \frac{1}{d}\) for all mixed states \(\rho\in M_d\otimes M_d\). This follows from the fact that \(\max_i\gamma_i\geq\frac{1}{d}\) (which itself is kind of a pain to prove: it follows from the fact that the \(1\rightarrow\infty\) Schatten norm of the realignment map \(R\) is \(d\), but if anyone knows of a more direct and/or simpler way to prove this, I’d love to see it). If we assume without loss of generality that \(\gamma_1\geq\frac{1}{d}\) then

\(f(\gamma_1,\gamma_2,\ldots,\gamma_{d^2}) = \frac{1}{2}\big(f(\gamma_1,\gamma_2,\ldots,\gamma_{d^2})+f(\gamma_1,-\gamma_2,\ldots,-\gamma_{d^2})\big)\)

\({}_{{}_{.}} \phantom{f(\gamma_1,\gamma_2,\ldots,\gamma_{d^2})} \geq f(\gamma_1,0,0,\ldots,0) = \gamma_1f(1,0,0,\ldots,0) = \gamma_1 \geq \frac{1}{d},\)

as desired.

Claim 2: There exists a separable state \(\rho\in M_d\otimes M_d\) for which \(f(\gamma_1,\gamma_2,\ldots,\gamma_{d^2})\) equals any given value in the interval \([\frac{1}{d},1]\). To see why this is the case, first notice that there exists a separable state \(\rho\in M_d\otimes M_d\) with \(\gamma_1=1\) and \(\gamma_i=0\) for all \(i\geq 2\): the state \(\rho=|0\rangle\langle 0|\otimes|0\rangle\langle 0|\) is one such example. Similarly, there is a separable state with \(\gamma_1=\frac{1}{d}\) and \(\gamma_i=0\) for all \(i\geq 2\): the state \(\rho=\frac{1}{d^2}I\otimes I\) is one such example. Furthermore, it is straightforward to interpolate between these two extremes to find separable states (even product states) with \(\gamma_i = 0\) for all \(i\geq 2\) and any value of \(\gamma_1 \in[\frac{1}{d},1]\). For such states we have

\(f(\gamma_1,\gamma_2,\ldots,\gamma_{d^2}) = f(\gamma_1,0,0,\ldots,0)=\gamma_1f(1,0,0,\ldots,0)=\gamma_1,\)

which can take any value in the interval \([\frac{1}{d},1]\) as claimed.

By combining claims 1 and 2, we see that we could only ever use the value of \(f(\gamma_1,\gamma_2,\ldots,\gamma_{d^2})\) to conclude that \(\rho\) is entangled if \(f(\gamma_1,\gamma_2,\ldots,\gamma_{d^2})>1\). However, in this case we have

\(\displaystyle\sum_{i=1}^{d^2}\gamma_i = f(\gamma_1,0,0,\ldots,0) + f(0,\gamma_2,0,\ldots,0) + \cdots + f(0,0,0,\ldots,\gamma_{d^2})\)

\({}_{{}_{.}}\displaystyle\phantom{\sum_{i=1}^{d^2}\gamma_i}\geq f(\gamma_1,\gamma_2,\ldots,\gamma_{d^2}) >1,\)

which completes the proof.

Theorem 2 can be phrased naturally in terms of the other formulation of the realignment criterion as well: it says that there is no unitarily-invariant matrix norm \(\|\cdot\|_{u}\) with the property that we can use the value of \(\|R(\rho)\|_{u}\) to conclude that \(\rho\) is entangled, except in those cases where the trace norm (i.e., the realignment criterion) itself already tells us that \(\rho\) is entangled.

Nonetheless, we can certainly imagine using functions of the coefficients \(\{\gamma_i\}\) that are not symmetric gauge functions. Alternatively, we could take into account some (hopefully easily-computable) properties of the matrices \(\{A_i\}\) and \(\{B_i\}\). One such method for detecting entanglement that depends on the coefficients \(\{\gamma_i\}\) and the trace of each \(\{A_i\}\) and \(\{B_i\}\) is as follows.

Theorem 3 [4,5]. Let \(\rho\in M_d\otimes M_d\) have operator-Schmidt decomposition

\(\rho=\displaystyle\sum_{i=1}^{d^2}\gamma_iA_i\otimes B_i.\)


\(\displaystyle\sum_{i=1}^{d^2}\big|\gamma_i – \gamma_i^2\mathrm{Tr}(A_i)\mathrm{Tr}(B_i)\big| + \frac{1}{2}\sum_{i=1}^{d^2}\gamma_i^2\big(\mathrm{Tr}(A_i)^2+\mathrm{Tr}(B_i)^2\big) > 1\)

then \(\rho\) is entangled.

I won’t prove Theorem 3 here, but I will note that it is strictly stronger than the realignment criterion, which can be seen by showing that the left-hand side of Theorem 3 is at least as large as the left-hand side of Theorem 1. To show this, observe that

\(\displaystyle\sum_{i=1}^{d^2}\big|\gamma_i – \gamma_i^2\mathrm{Tr}(A_i)\mathrm{Tr}(B_i)\big| \geq \sum_{i=1}^{d^2}\gamma_i – \sum_{i=1}^{d^2}\gamma_i^2\mathrm{Tr}(A_i)\mathrm{Tr}(B_i)\)


\(\displaystyle\frac{1}{2}\sum_{i=1}^{d^2}\gamma_i^2\big(\mathrm{Tr}(A_i)^2+\mathrm{Tr}(B_i)^2\big) – \sum_{i=1}^{d^2}\gamma_i^2\mathrm{Tr}(A_i)\mathrm{Tr}(B_i) = \frac{1}{2}\sum_{i=1}^{d^2}\big(\gamma_i\mathrm{Tr}(A_i)-\gamma_i\mathrm{Tr}(B_i)\big)^2,\)

which is nonnegative.

Proving a State is Separable

Much like we can use the operator-Schmidt decomposition to sometimes prove that a state is entangled, we can also use it to sometimes prove that a state is separable. To this end, we will use the operator-Schmidt rank of \(\rho\), which is the number of non-zero coefficients \(\{\gamma_i\}\) in its operator-Schmidt decomposition. One trivial observation is as follows:

Proposition 4. If the operator-Schmidt rank of \(\rho\) is \(1\) then \(\rho\) is separable.

Proof. If the operator-Schmidt rank of \(\rho\) is \(1\) then we can write \(\rho=A\otimes B\) for some \(A,B\in M_d\). Since \(\rho\) is positive semidefinite, it follows that either \(A\) and \(B\) are both positive semidefinite or both negative semidefinite. If they are both positive semidefinite, we are done. If they are both negative semidefinite then we can write \(\rho=(-A)\otimes(-B)\) and then we are done.

Somewhat surprisingly, however, we can go further than this: it turns out that all states with operator-Schmidt rank \(2\) are also separable, as was shown in [6].

Theorem 5 [6]. If the operator-Schmidt rank of \(\rho\) is \(2\) then \(\rho\) is separable.

Proof. If \(\rho\) has operator-Schmidt rank \(2\) then it can be written in the form \(\rho=A\otimes B + C\otimes D\) for some \(A,B,C,D\in M_d\). Throughout this proof, we use the notation \(a:=\mathrm{Tr}(A), b:=\mathrm{Tr}(B)\), and so on.

Since \(\rho\) is positive semidefinite, so are each of its partial traces. Thus \(bA+dC\) and \(aB+cD\) are both positive semidefinite operators. It is then straightforward to verify that

\((bA+dC)\otimes(aB+cD) + (cA-aC)\otimes(dB-bD)= A\otimes B + C\otimes D =\rho.\)

What is important here is that we have found a rank-\(2\) tensor decomposition of \(\rho\) in which one of the terms is positive semidefinite. Now we define

\(X := \big((bA+dC)^{-1/2}\otimes(aB+cD)^{-1/2}\big) \rho \big((bA+dC)^{-1/2}\otimes(aB+cD)^{-1/2}\big)\)

and notice that \(X = I\otimes I + E\otimes F\) for some \(E,F\in M_d\) (in order to do this, we actually need the partial traces of \(\rho\) to be nonsingular, but this is easily taken care of by standard continuity arguments, so we’ll sweep it under the rug). Furthermore, \(X\) is also positive semidefinite, and it is separable if and only if \(\rho\) is separable. Since \(X\) is positive semidefinite, we know that \(1 + \lambda_i(E)\lambda_j(F) \geq 0\) for all eigenvalues \(\lambda_i(E)\) of \(E\) and \(\lambda_j(F)\) of \(F\). If we absorb scalars between \(E\) and \(F\) so that \(\max_i\lambda_i(E) = 1\) then this implies that \(\lambda_j(F) \geq -1\) for all \(j\). Thus \(I-E\) and \(I+F\) are both positive semidefinite. Furthermore, a straightforward calculation shows that

\((I-E)\otimes I + E \otimes (I+F) = I\otimes I + E\otimes F = X.\)

We now play a similar game as before: we define a new matrix

\(Y := \big((I-E)^{-1/2}\otimes(I+F)^{-1/2}\big)X\big((I-E)^{-1/2}\otimes(I+F)^{-1/2}\big)\)

and notice that \(Y = I \otimes G + H \otimes I\) for some \(G,H\in M_d\) (similar to before, we note that there is a standard continuity argument that can be used to handle the fact that \(I-E\) and \(I+F\) might be singluar). The minimum eigenvalue of \(Y\) is then \(\lambda_{\textup{min}}(G)+\lambda_{\textup{min}}(H)\), which is non-negative as a result of \(Y\) being positive semidefinite. It then follows that

\(Y = I \otimes (G – \lambda_{\textup{min}}(G)I) + (H – \lambda_{\textup{min}}(H)I) \otimes I + \big(\lambda_{\textup{min}}(G)+\lambda_{\textup{min}}(H)\big)I \otimes I.\)

Since each term in the above decomposition is positive semidefinite, it follows that \(Y\) is separable, which implies that \(X\) is separable, which finally implies that \(\rho\) is separable.

In light of Theorem 6, it seems somewhat natural to ask how far we can push things: what values of the operator-Schmidt rank imply that a state is separable? Certainly we cannot expect all states with an operator-Schmidt rank of \(4\) to be separable, since every state in \(M_2 \otimes M_2\) has operator-Schmidt rank \(4\) or less, and there are entangled states in this space (more concretely, it’s easy to check that the maximally-entangled pure state has operator-Schmidt rank \(4\)).

This left the case of operator-Schmidt rank \(3\) open. Very recently, it was shown in [7] that a mixed state in \(M_2 \otimes M_d\) with operator-Schmidt rank \(3\) is indeed separable, yet there are entangled states with operator-Schmidt rank \(3\) in \(M_3 \otimes M_3\).


  1. L. Gurvits. Classical deterministic complexity of Edmonds’ problem and quantum entanglement. In Proceedings of the Thirty-Fifth Annual ACM Symposium on Theory of Computing, pages 10–19, 2003. E-print: arXiv:quant-ph/0303055
  2. K. Chen and L.-A. Wu. A matrix realignment method for recognizing entanglement. Quantum Inf. Comput., 3:193–202, 2003. E-print: arXiv:quant-ph/0205017
  3. O. Rudolph. Some properties of the computable cross norm criterion for separability. Phys. Rev. A, 67:032312, 2003. E-print:  E-print: arXiv:quant-ph/0212047
  4. C.-J. Zhang, Y.-S. Zhang, S. Zhang, and G.-C. Guo. Entanglement detection beyond the cross-norm or realignment criterion. Phys. Rev. A, 77:060301(R), 2008. E-print: arXiv:0709.3766 [quant-ph]
  5. O. Gittsovich, O. Gühne, P. Hyllus, and J. Eisert. Unifying several separability conditions using the covariance matrix criterion. Phys. Rev. A, 78:052319, 2008. E-print: arXiv:0803.0757 [quant-ph]
  6. D. Cariello. Separability for weak irreducible matrices. E-print: arXiv:1311.7275 [quant-ph]
  7. D. Cariello. Does symmetry imply PPT property?. E-print: arXiv:1405.3634 [math-ph]

Counting the Possible Orderings of Pairwise Multiplication

February 12th, 2014

Suppose we are given n distinct positive real numbers \(a_1 > a_2 > \cdots > a_n > 0\). The question we are going to consider in this post is as follows:

Question. How many different possible orderings are there of the \(n(n+1)/2\) numbers \(\{a_ia_j\}_{1\leq i\leq j\leq n}\)?

To help illustrate what we mean by this question, consider the n = 2 case, where \(a_1 > a_2 > 0\). Then the 3 possible products of \(a_1\) and \(a_2\) are \(a_1^2, a_2^2, a_1a_2\), and it is straightforward to see that we must have \(a_1^2 > a_1a_2> a_2^2\), so there is only one possible ordering in the n = 2 case.

In the n = 3 case, we have \(a_1 > a_2 > a_3 > 0\) and 6 possible products: \(a_1^2, a_2^2, a_3^2, a_1a_2, a_1a_3, a_2a_3\). Some relationships between these 6 numbers are immediate, such as \(a_1^2 > a_1a_2 > a_1a_3 > a_2a_3 > a_3^2\). However, it could be the case that either \(a_2^2 > a_1a_3\) or \(a_1a_3 > a_2^2\) (we ignore the degenerate cases where two products are equal to each other), so there are two different possible orderings in this case:

\(a_1^2 > a_1a_2 > a_2^2 > a_1a_3 > a_2a_3 > a_3^2\quad\text{ or }\\ a_1^2 > a_1a_2 > a_1a_3 > a_2^2 > a_2a_3 > a_3^2.\)

In this post, we will consider the problem of how many such orderings exist for larger values of n. This problem arises naturally from a problem in quantum entanglement: the number of such orderings is exactly the minimum number of linear matrix inequalities needed to characterize the eigenvalues of quantum states that are “PPT from spectrum” [1].

A Rough Upper Bound

We now begin constructing upper bounds on the number of possible orderings of \(\{a_ia_j\}_{1\leq i\leq j\leq n}\). Since we are counting orderings between \(n(n+1)/2\) numbers, a trivial upper bound is given by \((n(n+1)/2)!\), since that is the number of possible orderings of \(n(n+1)/2\) arbitrary numbers. However, this quantity is a gross overestimate.

We can improve this upper bound by creating an \(n \times n\) matrix whose \((i,j)\)-entry is \(a_ia_j\) (note that this matrix is symmetric, positive semidefinite, and has rank 1, which is roughly how the connection to quantum entanglement arises). For example, in the n = 4 case, this matrix is as follows:

\(\begin{bmatrix}a_1^2 & a_1a_2 & a_1a_3 & a_1a_4 \\ * & a_2^2 & a_2a_3 & a_2a_4 \\ * & * & a_3^2 & a_3a_4 \\ * & * & * & a_4^2\end{bmatrix},\)

where we have used asterisks (*) to indicate entries that are determined by symmetry. The fact that \(a_1 > a_2 > \cdots > a_n > 0\) implies that the rows and columns of the upper-triangular part of this matrix are decreasing. Thus we can get an upper bound to the solution to our problem by counting the number of ways that we can place the numbers \(1, 2, \ldots, n(n+1)/2\) (exactly once each) in the upper-triangular part of a matrix in such a way that the rows and columns of that upper-triangular part are decreasing. For example, this can be done in 2 different ways in the n = 3 case:

\(\begin{bmatrix}6 & 5 & 4 \\ * & 3 & 2 \\ * & * & 1\end{bmatrix} \quad \text{and} \quad \begin{bmatrix}6 & 5 & 3\\ * & 4 & 2\\ * & * & 1\end{bmatrix}.\)

The matrix above on the left corresponds to the case \(a_1a_3 > a_2^2\) discussed earlier, while the matrix above on the right corresponds to the case \(a_2^2 > a_1a_3\).

A formula for the number of such ways to place the integers \(1, 2, \ldots, n(n+1)/2\) in a matrix was derived in [2] (see also A003121 in the OEIS), which immediately gives us the following upper bound on the number of orderings of the products \(\{a_ia_j\}_{1\leq i\leq j\leq n}\):

\(\displaystyle(n(n+1)/2)! \frac{1! 2! \cdots (n-1)!}{1! 3! \cdots (2n-1)!}.\)

For n = 1, 2, 3, …, this formula gives the values 1, 1, 2, 12, 286, 33592, 23178480, …

A Better Upper Bound

Before improving the upper bound that we just presented, let’s first discuss why it is not actually a solution to the original question. In the n = 4 case, our best upper bound so far is 12, since there are 12 different ways to place the integers \(1,2,\ldots,10\) in the upper-triangular part of a \(4 \times 4\) matrix such that the rows and columns of that upper-triangular part are decreasing. However, one such placement is as follows:

\(\begin{bmatrix}10 & 9 & 7 & 6 \\ * & 8 & 5 & 3 \\ * & * & 4 & 2 \\ * & * & * & 1\end{bmatrix}.\)

The above matrix corresponds to the following inequalities in terms of \(\{a_ia_j\}_{1\leq i\leq j\leq n}\):

\(a_1^2 > a_1a_2 > a_2^2 > a_1a_3 > a_1a_4 > a_2a_3 > a_3^2 > a_2a_4 > a_3a_4 > a_4^2.\)

The problem here is that there actually do not exist real numbers \(a_1 > a_2 > a_3 > a_4 > 0\) that satisfy the above string of inequalities. To see this, notice in particular that we have the following three inequalities: \(a_2^2 > a_1a_3\), \(a_1a_4 > a_2a_3\), and \(a_3^2 > a_2a_4\). However, multiplying the first two inequalities together gives \(a_1a_2^2a_4 > a_1a_2a_3^2\), so \(a_2a_4 > a_3^2\), which contradicts the third inequality.

More generally, there can not be indices \(i,j,k,\ell,m,n\) such that we simultaneously have the following three inequalities:

\(a_ia_j > a_ka_\ell\), \(a_\ell a_m > a_j a_n\), and \(a_i a_m < a_k a_n\).

I am not aware of a general formula for the number integer matrices that do not lead to these types of “bad” inequalities, but I have computed this quantity for n ≤ 7 (C code is available here), which gives the following better upper bound on the number of possible orderings of the products \(\{a_ia_j\}_{1\leq i\leq j\leq n}\) for n = 1, 2, 3, …: 1,1,2,10,114,2612,108664, …, which we see is significantly smaller than the upper bound found in the previous section for n ≥ 5.

This Bound is Not Tight

It is straightforward to write a script that generates random numbers \(a_1 > a_2 > \cdots > a_n > 0\) and determines the resulting ordering of the pairwise products \(\{a_ia_j\}_{1\leq i\leq j\leq n}\). By doing this, we can verify that the upper bounds from the previous section are in fact tight when n ≤ 5. However, when n = 6, we find that 4 of the 2612 potential orderings do not seem to actually be attained by any choice of \(a_1 > a_2 > \cdots > a_6 > 0\). One of these “problematic” orderings is the one that arises from the following matrix:

\(\begin{bmatrix}21 & 20 & 19 & 18 & 17 & 11\\ * & 16 & 15 & 14 & 10 & 6\\ * & * & 13 & 12 & 8 & 5\\ * & * & * & 9 & 7 & 3\\ * & * & * & * & 4 & 2\\ * & * & * & * & * & 1\end{bmatrix}\)

The problem here is that the above matrix implies the following 5 inequalities:

\(a_1a_5 > a_2^2, \quad \ \ a_2a_4 > a_3^2, \quad \ \ a_2a_5 > a_4^2, \quad \ \ a_3a_4 > a_1a_6, \quad \text{and }\ \ \ a_3a_6 > a_5^2.\)

However, multiplying the first four inequalities gives \(a_1a_2^2a_3a_4^2a_5^2 > a_1a_2^2a_3^2a_4^2a_6\), so \(a_5^2 > a_3a_6\), which contradicts the fifth inequality above. We can similarly prove that the other 3 seemingly problematic orderings are in fact not attainable, so there are exactly 2608 possible orderings in the n = 6 case.

I haven’t been able to compute the number of orderings when n ≥ 7, as my methods for obtaining upper and lower bounds are both much too slow in these cases. The best bounds that I have in the n = 7 case say that the number of orderings is between 50900 and 108664, inclusive.

Update [Feb. 13, 2014]: Giovanni Resta has improved the lower bound in the n = 7 case to 107498, which narrows the n = 7 region down considerably. I’ve also improved the upper bound to 108146 (see this improved version of the C script). In all likelihood, 107498 is the correct number of orderings in this case, and it’s the upper bound 108146 that needs to be further improved.

Update [Feb. 14, 2014]: This sequence is now in the OEIS. See A237749.

Update [Feb. 18, 2014]: Hans Havermann has found a couple of references that talk about this problem (in the language of Golomb rulers) and compute all values for n ≤ 7. See [3] and [4].


  1. R. Hildebrand. Positive partial transpose from spectra. Phys. Rev. A, 76:052325, 2007. E-print: arXiv:quant-ph/0502170
  2. R. M. Thrall. A combinatorial problem. Michigan Math. J., 1:81–88, 1952.
  3. M. Beck, T. Bogart, and T. Pham. Enumeration of Golomb rulers and acyclic orientations of mixed graphs. Electron. J. Combin., 19:42, 2012. E-print: arXiv:1110.6154 [math.CO]
  4. T. Pham. Enumeration of Golomb rulers. Master’s Thesis, San Francisco State University, 2011.

The Spectrum of the Partial Transpose of a Density Matrix

July 3rd, 2013

It is a simple fact that, given any density matrix (i.e., quantum state) \(\rho\in M_n\), the eigenvalues of \(\rho\) are the same as the eigenvalues of \(\rho^T\) (the transpose of \(\rho\)). However, strange things can happen if we instead only apply the transpose to one half of a quantum state. That is, if \(\rho\in M_m \otimes M_n\) then its eigenvalues in general will be very different from the eigenvalues of \((id_m\otimes T)(\rho)\), where \(id_m\) is the identity map on \(M_m\) and \(T\) is the transpose map on \(M_n\) (the map \(id_m\otimes T\) is called the partial transpose).

In fact, even though \(\rho\) is positive semidefinite (since it is a density matrix), the matrix \((id_m\otimes T)(\rho)\) in general can have negative eigenvalues. To see this, define \(p:={\rm min}\{m,n\}\) and let \(\rho=|\psi\rangle\langle\psi|\), where


is the standard maximally-entangled pure state. It then follows that

\((id_m\otimes T)(\rho)=\displaystyle\frac{1}{p}\sum_{i,j=1}^{p}|i\rangle\langle j|\otimes|j\rangle\langle i|\),

which has \(p(p+1)/2\) eigenvalues equal to \(1/p\), \(p(p-1)/2\) eigenvalues equal to \(-1/p\), and \(p|m-n|\) eigenvalues equal to \(0\).

The fact that \((id_m\otimes T)(\rho)\) can have negative eigenvalues is another way of saying that the transpose map is positive but not completely positive, and thus plays a big role in entanglement theory. In this post we consider the question of how exactly the partial transpose map can transform the eigenvalues of \(\rho\):

Question. For which ordered lists \(\lambda_1\geq\lambda_2\geq\cdots\geq\lambda_{mn}\in\mathbb{R}\) does there exist a density matrix \(\rho\) such that \((id_m\otimes T)(\rho)\) has eigenvalues \(\lambda_1,\lambda_2,\ldots,\lambda_{mn}\)?

The Answer for Pure States

In the case when \(\rho\) is a pure state (i.e., has rank 1), we can completely characterize the eigenvalues of \((id_m\otimes T)(\rho)\) by making use of the Schmidt decomposition. In particular, we have the following:

Theorem 1. Let \(|\phi\rangle\) have Schmidt rank \(r\) and Schmidt coefficients \(\alpha_1\geq\alpha_2\geq\cdots\geq\alpha_r>0\). Then the spectrum of \((id_m\otimes T)(|\phi\rangle\langle\phi|)\) is

\(\{\alpha_i^2 : 1\leq i\leq r\}\cup\{\pm\alpha_i\alpha_j:1\leq i<j\leq r\}\),

together with the eigenvalue \(0\) with multiplicity \(p|n-m|+p^2-r^2\).

Proof. If \(|\phi\rangle\) has Schmidt decomposition



\(\displaystyle(id_m\otimes T)(|\phi\rangle\langle\phi|)=\sum_{i,j=1}^r\alpha_i\alpha_j|a_i\rangle\langle a_j|\otimes|b_j\rangle\langle b_i|.\)

It is then straightforward to verify, for all \(1\leq i<j\leq r\), that:

  • \(|a_i\rangle\otimes|b_i\rangle\) is an eigenvector with eigenvalue \(\alpha_i^2\);
  • \(|a_i\rangle\otimes|b_j\rangle\pm|a_j\rangle\otimes|b_i\rangle\) is an eigenvector with eigenvalue \(\pm\alpha_i\alpha_j\); and
  • \({\rm rank}\big((id_m\otimes T)(|\phi\rangle\langle\phi|)\big)= r^2\), from which it follows that the remaining \(p|n-m|+p^2-r^2\) eigenvalues are \(0\).

Despite such a simple characterization in the case of rank-1 density matrices, there is no known characterization for general density matrices, since eigenvalues aren’t well-behaved under convex combinations.

The Number of Negative Eigenvalues

Instead of asking for a complete characterization of the possible spectra of \((id_m\otimes T)(\rho)\), for now we focus on the simpler question that asks how many of the eigenvalues of \((id_m\otimes T)(\rho)\) can be negative. Theorem 1 answers this question when \(\rho=|\phi\rangle\langle\phi|\) is a pure state: the number of negative eigenvalues is \(r(r-1)/2\), where r is the Schmidt rank of \(|\phi\rangle\). Since \(r\leq p\), it follows that \((id_m\otimes T)(\rho)\) has at most \(p(p-1)/2\) negative eigenvalues when \(\rho\) is a pure state.

It was conjectured in [1] that a similar fact holds for general (not necessarily pure) density matrices \(\rho\) as well. In particular, they conjectured that if \(\rho\in M_n\otimes M_n\) then \((id_n\otimes T)(\rho)\) has at most \(n(n-1)/2\) negative eigenvalues. However, this conjecture is easily shown to be false just by randomly-generating many density matrices \(\rho\) and then counting the number of negative eigenvalues of \((id_n\otimes T)(\rho)\); density matrices whose partial transposes have more than \(n(n-1)/2\) negative eigenvalues are very common.

In [2,3], it was shown that if \(\rho\in M_m\otimes M_n\) then \((id_m\otimes T)(\rho)\) can not have more than \((m-1)(n-1)\) negative eigenvalues. In [4], this bound was shown to be tight when \({\rm min}\{m,n\}=2\) by explicitly constructing density matrices \(\rho\in M_2\otimes M_n\) such that \((id_2\otimes T)(\rho)\) has \(n-1\) negative eigenvalues. Similarly, this bound was shown to be tight via explicit construction when \(m=n=3\) in [3]. Finally, it was shown in [5] that this bound is tight in general. That is, we have the following result:

Theorem 2. The maximum number of negative eigenvalues that \((id_m\otimes T)(\rho)\) can have when \(\rho\in M_m\otimes M_n\) is \((m-1)(n-1)\).

It is worth pointing out that the method used in [5] to prove that this bound is tight is not completely analytic. Instead, a numerical method was presented that is proved to always generate a density matrix \(\rho\in M_m\otimes M_n\) such that \((id_m\otimes T)(\rho)\) has \((m-1)(n-1)\) negative eigenvalues. Code that implements this numerical procedure in MATLAB is available here, but no general analytic form for such density matrices is known.

Other Bounds on the Spectrum

Unfortunately, not a whole lot more is known about the spectrum of \((id_m\otimes T)(\rho)\). Here are some miscellaneous other results that impose certain restrictions on its maximal and minimal eigenvalues (which we denote by \(\lambda_\textup{max}\) and \(\lambda_\textup{min}\), respectively):

Theorem 3 [3]. \(1\geq\lambda_\textup{max}\geq\lambda_\textup{min}\geq -1/2\).

Theorem 4 [2]. \(\lambda_\textup{min}\geq\lambda_\textup{max}(1-{\rm min}\{m,n\})\).

Theorem 5 [6]. If \((id_m\otimes T)(\rho)\) has \(q\) negative eigenvalues then

\(\displaystyle\lambda_\textup{min}\geq\lambda_\textup{max}\Big(1-\big\lceil\tfrac{1}{2}\big(m+n-\sqrt{(m-n)^2+4q-4}\big)\big\rceil\Big)\) and


However, these bounds in general are fairly weak and the question of what the possible spectra of \((id_m\otimes T)(\rho)\) are is still far beyond our grasp.

Update [August 21, 2017]: Everett Patterson and I have now written a paper about this topic.


  1. R. Xi-Jun, H. Yong-Jian, W. Yu-Chun, and G. Guang-Can. Partial transposition on bipartite system. Chinese Phys. Lett., 25:35, 2008.
  2. N. Johnston and D. W. Kribs. A family of norms with applications in quantum information theory. J. Math. Phys., 51:082202, 2010. E-print: arXiv:0909.3907 [quant-ph]
  3. S. Rana. Negative eigenvalues of partial transposition of arbitrary bipartite states. Phys. Rev. A, 87:054301, 2013. E-print: arXiv:1304.6775 [quant-ph]
  4. L. Chen, D. Z. Djokovic. Qubit-qudit states with positive partial transpose. Phys. Rev. A, 86:062332, 2012. E-print: arXiv:1210.0111 [quant-ph]
  5. N. Johnston. Non-positive-partial-transpose subspaces can be as large as any entangled subspace. Phys. Rev. A, 87:064302, 2013. E-print: arXiv:1305.0257 [quant-ph]
  6. N. Johnston. Norms and Cones in the Theory of Quantum Entanglement. PhD thesis, University of Guelph, 2012.