Optimal entanglement witnesses for continuous-variable systems

This paper is concerned with all tests for continuous-variable entanglement that arise from linear combinations of second moments or variances of canonical coordinates, as they are commonly used in experiments to detect entanglement. All such tests for bi-partite and multi-partite entanglement correspond to hyperplanes in the set of second moments. It is shown that all optimal tests, those that are most robust against imperfections with respect to some figure of merit for a given state, can be constructed from solutions to semi-definite optimization problems. Moreover, we show that for each such test, referred to as an entanglement witness based on second moments, there is a one-to-one correspondence between the witness and a stronger product criterion, which amounts to a nonlinear witness, based on the same measurements. This generalizes the known product criteria. The presented tests are all applicable also to non-Gaussian states. To provide a service to the community, we present the documentation of two numerical routines, FullyWit and MultiWit, which have been made publicly available.


Introduction
The field of continuous-variable quantum information has seen a very substantial progress in recent years. This has in part been made possible-from the experimental side-by the availability of a number of sources of systems prepared in entangled states in the canonical coordinates. Notably, two-mode squeezed states of light close to minimal uncertainty have been prepared [1], as well as bright entangled light beams [2,3]. The collective spin states of atomic ensembles have been brought into states that can be well described in terms of continuous-variable entanglement [4], even allowing for a light-matter interface [5]. First instances of multi-mode, multi-partite entangled states have also been prepared already [6].
In many of these setups, the starting point of further exploitation of entanglement is to see whether the envisioned bi-partite or multi-partite entanglement can be found in the prepared states. This is often done by making use of criteria of entanglement based on second moments, (a) Schematic representation of the optimal entanglement witness based on second moments, with respect to a state with covariance matrix γ, as a separating hyperplane from the convex set of second moments consistent with separable Gaussian states (dark grey). (b) Curved quadratic witness, which is curved towards the above convex set. or uncertainties, of quantum states. Notably, in a two-mode setup, the probably most well-known criterion of this type is the following: if one finds that the state ρ of a two-mode system equipped with the canonical coordinatesx 1 andp 1 of one mode andx 2 andp 2 for the second mode fulfils whereû = (x 1 +x 2 )/ √ 2 andv = (p 1 −p 2 )/ √ 2, then one can assert that the state must have been entangled [7]. Such a criterion is tremendously helpful: firstly, it gives a clearcut test for deciding whether a state is entangled or in a subset where one cannot assert whether it was separable or entangled. Secondly, one only has to measure certain fixed combinations of second moments of the original canonical coordinates. This is, yet, only one specific test, detecting the entanglement in some states, not detecting it in others. Similar tests have been proposed also to detect the entanglement of certain multi-party entangled states [6,8].
Commonly used tests for entanglement are entanglement witnesses [9]. An entanglement witness is an Hermitian operator W such that Tr[Wσ s ] 0 holds for all separable states σ s , while Tr[Wρ] < 0 for some entangled state ρ [9]. These tests are based on expectation values. In contrast, the tests mentioned above correspond to entanglement witnesses based on second moments, or equivalently, on 'variances' or 'uncertainties'. The covariance matrices collecting the second moments of the states that lead to a given fixed value on the left-hand side of (1) give rise to a hyperplane in the set of all second moments embodying the correlations of the state, see figure 1. It is a separating hyperplane: all second moments that correspond to separable states-as well as some corresponding to entangled states-are on one side of the hyperplane. Hence, the test either confirms the presence of entanglement or returns an inconclusive result.
These criteria are different from, for example, criteria directly based on the positivity of the partial transpose (PPT) [10], requiring the full knowledge of all second moments. This PPT condition then also constrains symplectic eigenvalues of covariance matrices, and hence marginal and full purities [11,12].
It has been shown how the set of entanglement witnesses in this sense can indeed be completely characterized [13]. However, important open questions remain: given a state with some covariance matrix, can one find an optimal entanglement witness in the sense that it most robustly detects the state as being entangled? This is important, since for experiments aiming at the production of a specific entangled state, the answer would deliver an optimal test detecting the entanglement, optimally robust to noise. Another question is whether this can be done for all different separability classes versus multi-particle entanglement. This paper gives a positive answer to these questions. In particular, we show that all such optimal tests (and not only the test whether a covariance matrix corresponds to a separable Gaussian state 1 ) in the bi-and multi-partite setting arise from solutions to certain semi-definite problems [14].
To provide a service to the community, we present a publicly available software package, consisting of the functions FullyWit and MultiWit. Given the covariance matrix of a state, the first one finds optimal witnesses detecting entanglement when a certain splitting of the parties sharing the state is held fixed, while the latter identifies witnesses detecting only genuine multipartite entanglement. Further, the routines allow to restrict the types of measurements that one wants to perform. For example, for a two-mode squeezed state in the so-called standard basis under no further constraints the test as in equation (1) would be delivered as output. Hence, all entanglement witnesses in the bi-and the multi-partite setup are efficiently obtained.
Further, we show that for each entanglement witness, there is a one-to-one correspondence to a curved quadratic witness, thereby generalizing the known product criteria [15], related to expressions of the type These correspond to separating hyperplanes which are curved towards the set of separable covariance matrices, cf figure 1. Also, the complete set of generalized quadratic witnesses is stated and discussed. The paper is organized as follows: in section 2, we recall the basic definitions regarding Gaussian states, the classification of entangled states in a general setting, and semi-definite programs (SDPs). In section 3, we state the definition of linear entanglement witnesses based on second moments. The SDPs designed to find the optimal witnesses described above are presented in the sections 4 and 5. We make some remarks on the form of the witnesses when the state in question does not include correlations between position and momentum variables and other issues in section 6. The theoretical part is concluded with the characterization of the product witnesses in section 7. The final section 8 contains several numerical examples where optimal witnesses have been found for several states with the help of the functions FullyWit and MultiWit based on the results of the sections 4 and 5, respectively.

5
Institute of Physics ⌽ DEUTSCHE PHYSIKALISCHE GESELLSCHAFT

Definitions
We consider a system consisting of n modes, associated with canonical coordinatesr = (x 1 ,p 1 ,x 2 ,p 2 , . . . ,x n ,p n ), satisfying the canonical commutation relations, giving rise to the familiar skew symmetric matrix These canonical coordinates will typically-but not necessarily-refer to amplitude and phase quadratures of a finite number of modes of the electromagnetical field of light. In the following, we will often consider the multi-partite situation: here, a subsystem A embodies n A modes, system B consists of n B modes, C of n C modes, and so on, such that n A + n B + · · · = n. In this paper, we will investigate entanglement and separability properties of such states on multi-partite systems. We will refer to a split as a coarse graining of subsystems, i.e., a distribution of the n physical subsystems into groups that are considered the subsystems. For our purposes, the moments of the states will play the central role. The first moments are the displacements in phase space, d j = r j ρ , j = 1, . . . , n. The second moments, the variances, can be collected in the covariance matrix γ of the state, with entries where j, k = 1, . . . , n. For a survey about these preliminaries, see also [16,17]. Any covariance matrix of a quantum state satisfies the Heisenberg uncertainty principle γ + iσ 0.
In turn, for every real symmetric matrix γ ∈ R 2n×2n satisfying (5) there exists a physical state with just these second moments γ. Gaussian states-those quantum states for which the characteristic function is a Gaussian in phase space-are uniquely characterized by their first and second moments [16,17]. Such Gaussian states play a central role in continuous-variable quantum information, essentially since the Gaussian operations-completely positive maps preserving the Gaussian character-are to a large extent readily accessible [18,19]. However, the criteria we present can also detect the entanglement of non-Gaussian states. It is a very useful fact that any matrix M ∈ R 2m×2m , M > 0, can be diagonalized as where S ∈ Sp(2m, R) is not an orthogonal matrix, but one leaving the symplectic form invariant, i.e., SσS T = σ. These canonical transformations are referred to as symplectic transformations. The diagonal matrix D can be taken to have the form D = (s 1 , s 1 , . . . , s m , s m ) with s 1 , . . . , s m 0. These values are the symplectic eigenvalues of M (different from the eigenvalues), which are also given by the eigenvalues of the matrix M 1/2 (iσ)M 1/2 . The symbol str denotes the symplectic trace of a matrix which is defined as counting each symplectic eigenvalue only once. So it is essentially the trace of the matrix after symplectic diagonalization.

6
Institute of Physics ⌽ DEUTSCHE PHYSIKALISCHE GESELLSCHAFT

Separability
Quantum states of bi-partite systems may be classically correlated or entangled. If they can be prepared by means of local quantum operations and shared randomness alone, a state is called separable. A state vector |φ in turn is entangled if it cannot be written as a tensor product |φ = |a ⊗|b of state vectors |a , |b . A general mixed state of a bi-partite system is called separable [20] if it can be represented as a convex combination of products where p i 0 and i p i = 1. Otherwise, it is called entangled.
For quantum systems consisting of more than two constituents, different kinds of classically correlated, i.e., of separable states are conceivable. Depending on possible preparation strategies, a state can be classified according to a full hierarchy. At the lowest level of the hierarchy are those states that contain no entanglement at all. Such an N-partite (mixed) state ρ is called fully separable, if it can be written as a convex combination of product states, so that where p i 0 for all i and i p i = 1. These are states that can be prepared by means of local operations with respect to all subsystems, together with shared randomness. In a multi-partite system, however, also other classes of separability are possible. To obtain a hierarchy, one may consider k-partite splits, where each of the parts is considered a subsystem in its own right, and refer to states that are fully separable with respect to such a k-partite split as being k-separable [21,22] (for a short review, see also [23]). Towards the end of this hierarchy are the 2-separable or bi-separable states: they are those states for which there exists a bi-partite split such that the state is separable with respect to this split. Needless to say, a state that is fully separable with respect to one k-partite split might be entangled when another k-partite split is considered. Hence, all possible splits for all possible k have to be considered for a complete classification. This classification is treated theoretically in section 4 and practically by the routine FullyWit.
According to this classification, a state is genuinely N-partite entangled if it is not separable with respect to any split. However, in general, there exist states which can be written as a convex combination of certain k-separable states which are not separable with respect to any split. This motivates the alternative definition that an N-partite state is called genuinely N-partite entangled if it cannot be written as a convex combination of some k-separable states [24] for any k 2. For example, in a tri-partite system consisting of parts A, B, and C only those states are then genuinely three-partite entangled which cannot be written in the form 7 Institute of Physics ⌽ DEUTSCHE PHYSIKALISCHE GESELLSCHAFT where λ, p (A|BC) , p (AB|C) and p (AC|B) form probability distributions. Genuine N-partite entanglement according to this definition is treated theoretically in section 5 and practically by the routine MultiWit. The definitions from above immediately carry over to continuous variable systems with canonical coordinates. Here, they can be expressed in terms of covariance matrices. Let γ be the covariance matrix of a state on n modes with finite second moments, which is fully separable with respect to n subsystems. Then there exist covariance matrices γ (i) , i = 1, . . . , n, corresponding to the n subsystems, such that [25] γ γ (1) Conversely, if this holds, then Gaussian states with the covariance matrix γ are separable. Hence, if this criterion is violated, then the corresponding state is entangled, irrespective of whether it is Gaussian or not. If it is not violated, then a Gaussian state is separable while a non-Gaussian state might be entangled. Keeping this in mind, we will call all covariance matrices fulfilling equation (11) fully separable to keep our notation simple.
Note that the problem of testing whether (11) can be satisfied is a semi-definite problem in its own right (see footnote 1), see the subsequent subsection. It is a feasibility problem, so the question is whether or not such matrices γ (1) , . . . , γ (n) can be found satisfying in turn the semi-definite constraints γ (j) + iσ 0 for all j = 1, . . . , n.
This statement can be generalized to bi-separable states in the sense of a convex combination of pure bi-separable states. Let γ BS be the covariance matrix of a bi-separable n-partite state with finite second moments. Then there exist partitions π of the n modes into two subsystems consisting of m < n modes and n−m modes, covariance matrices γ π(k) which are block diagonal with respect to the partition π(k), and a probability distribution λ so that Conversely, if this holds, then Gaussian states with the covariance matrix γ BS are bi-separable. The same comment on non-Gaussian states that we made after the criterion for full separability applies here which we have to keep in mind when we call all covariance matrices fulfilling equation (12) bi-separable. Note further that these states include those with are separable for a split with k > 2, hence all states which are not in this set are genuinely N-partite entangled according to the second definition.

Semi-definite problems
SDPs [14] will play a prominent role in the subsequent argument. Readers familiar with the subject may wish to jump to the next section. SDPs are convex optimization problems [26] of a specific form: one minimizes a linear function, subject to a semi-definite constraint. Many problems in quantum information science can be cast into this form [27], essentially originating from the fact that semi-definite constraints appear in conditions to quantum states, as well as to quantum operations via the duality between positive operators and completely positive maps. Also, even global optimization problems can be relaxed to semi-definite form, with several applications to quantum information problems [28,29].

8
Institute of Physics ⌽ DEUTSCHE PHYSIKALISCHE GESELLSCHAFT More specifically, a SDP is an optimization problem of the following kind: where the minimization is performed with respect to a real vector x of length t. The problem is specified by the vector c ∈ R t and the Hermitian matrices F i ∈ C s×s , i = 1, . . . , t. This is the form that is usually referred to as being the primal problem. It is desirable to formulate a given problem as an SDP, not the least because these can be solved efficiently, for instance by using interior point methods [14]. Via Lagrange-duality the Lagrange-dual of the above problem can be formulated. Dual problems to SDPs are again SDPs, where essentially the roles of objective variables and constraints are interchanged. The so called dual problem can be formulated as follows The objective value of every solution of the dual provides a lower bound to the value of any solution to the primal problem and vice versa. This is referred to as weak duality: for feasible x and Z, i.e. x and Z fulfilling the respective constraints, holds, where the inequality is due to the fact that F(x) 0 and Z 0. If either the primal or the dual problem (or both) are strictly feasible, meaning that there exists a feasible vector x such that F(x) > 0 or there exists a feasible Z > 0, then there exist x * and Z * such that This is referred to as strong duality. An important class of problems are the feasibility problems. Here, c = 0, so that the primal problem amounts to checking whether there exists any feasible x fulfilling the primal constraints. In this case, Tr[F 0 Z] 0 has to hold for all feasible Z. Hence, if there is a feasible Z with Tr[F 0 Z] < 0, then the primal problem cannot be feasible.

Concept of entanglement witnesses based on second moments
We now turn to entanglement witnesses based on second moments. They are tests for entanglement based on linear combinations of second moments. Each test corresponds to a hyperplane in the set of second moments. In turn, these hyperplanes encode the physical setup, the type of measurement that is being physically performed. Such hyperplanes are defined by a real symmetric positive semi-definite (PSD) matrix Z and a number c ∈ R, via the Hilbert Schmidt scalar product. The 9 Institute of Physics ⌽ DEUTSCHE PHYSIKALISCHE GESELLSCHAFT hyperplane consists of all γ such that So an entanglement witnesses based on second moments can be characterized by a real matrix Z 0 satisfying [13] (i) Tr[Zγ s ] 1 for all (fully) separable γ s , As mentioned in the introduction, this notion is very similar to the one for entanglement witnesses based on expectation values: note that here, however, the witness refers to second moments of quantum states. If condition (ii) is fulfilled, then the quantum state giving rise to γ is entangled, irrespective of whether it is Gaussian or not, as discussed in subsection 2.2. These hyperplanes are hence separating entangled covariance matrices from the set of fully separable covariance matrices. That this characterization is possible is due to the fact that the set of fully separable covariance matrices is convex and closed. Its boundary is given by the matrices ⊕ n k=1 γ k fulfilling the condition ⊕ n k=1 γ k iσ. It is clearly convex, because the semi-definite constraint defining fully separable covariance matrices is preserved under convex combination: if ⊕ n k=1 γ k iσ and ⊕ n k=1 η k iσ, then for α ∈ [0, 1]. Further, the set is closed. Firstly, the subset of covariance matrices of the form ⊕ n k=1 γ k is closed itself since its complement is open: if a matrix γ has non-vanishing off-diagonal elements, then in its neighbourhood there will be only matrices with non-vanishing off-diagonal elements. Secondly, the constraint defines a closed convex cone which is a subset of the space of matrices ⊕ n k=1 γ k . Because the set is convex and closed, there exist hyperplanes separating a covariance matrix γ which is not separable from the set of separable covariance matrices [26].

Familiar examples
Any such matrix Z encodes the measurement pattern performed for a certain test, so the linear combination of second moments that is required to assert that a state was entangled. For example, the matrix Z for the familiar test of equation (1) from [7] can be written as Institute of Physics ⌽ DEUTSCHE PHYSIKALISCHE GESELLSCHAFT Using the definition (4) it follows that such that inequality (1) is equivalent with from which one can conclude that the state must have been entangled. In turn, the test gives rise to a hyperplane in the space of second moments separating a subset of all entangled states from the separable states. The general criterion of [7], dependent on a parameter a ∈ R\{0}, reads as for all separable ρ, wherê This test corresponds to a particular hyperplane for each a, corresponding to the entanglement witness so that Tr[Z a γ s ] 1 for all separable γ s , Tr[Z a γ] < 1 for some entangled γ.
In [7,10], it was further shown that the covariance matrix can always be brought into the standard form of a direct sum in position and momentum variables, using local symplectic transformations. The test (26) is necessary and sufficient for covariance matrices in this standard form. In other words, if the covariance matrix of a state is known, and we allow for further local operations based on that knowledge, then the set of witnesses Z a completely characterizes the set of separable Gaussian states. Another example of criteria that corresponds to witnesses based on second moment are the tests for multi-partite entanglement of [8]. In turn, the set of witnesses of second moments can be fully characterized [13], as sketched in the appendix.

Detecting entanglement in non-Gaussian states
There is finally a comment in order concerning non-Gaussian states: as mentioned before, all such tests also detect non-Gaussian states as being entangled. This is due to the fact that if a Gaussian state is entangled, then every non-Gaussian state with the same second moments is necessarily entangled. Hence, one does not have to assume a priori that the state in question is exactly Gaussian. This knowledge is typically not available in any case, without referring to full quantum state tomography.
One has to be aware, however, that in such infinite-dimensional quantum systems, the entangled states are trace-norm dense in state space [30]. That is, in any neighbourhood of a separable state an entangled state can be found, and the volume of the set of separable states has measure zero. This situation remains unaltered if one introduces a constraint to the mean energy of the system [30].
Nevertheless, it still makes sense to test for entanglement in this setting: one only has to state the result in the form that if a state is detected as being entangled then a trace-norm ball centred at it is not consistent with any separable state. In other words, one can still meaningfully say that a state is 'far from being separable'.

Task of finding witnesses as a semi-definite problem
The common situation that one encounters is the following: one knows what kind of entanglement one would like to see in a certain state, prepared in some setup. Also, one typically has an idea about what the covariance matrix γ of the prepared state roughly looks like or at least about how it is desired to look. The question is: what measurements have to be performed in order to most easily detect the entanglement? More specifically, in case of bi-partite entanglement, the task is the following: We have two parts consisting of n A and n B modes, respectively. For a given γ (the covariance matrix that we suspect that we have) corresponding to an entangled Gaussian state we would like to find the test Z with the property that Z detects γ as corresponding to an entangled state, such that takes its minimal value. This is the test which 'most distinctly' detects γ as originating from an entangled state, in a way that is most robust against detection imperfections. Geometrically, we aim at finding the hyperplane with the greatest distance from γ. Obviously, not only is γ detected as coming from an entangled state by this test, but the test is optimized for this specific guess.

The primal problem
It turns out that the previous problem is related to the following optimization problem. For a separable γ, we have that there exist covariance matrices γ A and γ B , satisfying the Heisenberg uncertainty relation γ A ⊕ γ B + iσ 0. For covariance matrices γ corresponding to entangled states, we may write the primal problem in the following form: If there is an optimal solution with x e 0, then γ is separable, because γ A ⊕ γ B fulfils an even stricter form of the Heisenberg uncertainty relations. If x e < 0, then γ is entangled, since γ A ⊕ γ B can now violate the uncertainty relations. This is actually just the p-measure from [19], up to where ρ denotes the partial transpose of ρ and . 1 is the trace norm. It is moreover identical to the logarithmic negativity for 1 × n-mode systems [19]. The negativity [31] is a measure of entanglement, and indeed a monotone under local operations and classical communication [32]- [34].

The dual problem
The dual problem of the above problem can easily be found. The key point in what follows is that from the dual of the above semi-definite problem allowing for a pre-factor in the Heisenberg uncertainty one can extract the required optimal tests. The dual problem can be cast into the form where the maximization is performed over Hermitian matrices X ∈ C 4n×4n . This matrix corresponds to a partitioning of degrees of freedom labelled 1, . . . , n A of system A first, then n A + 1, . . . , n labelling the modes of system B, and then again the same ordering. F j,k , j, k = 1, . . . , n, form a set of real symmetric matrices all entries of which are zero, except These matrices F j,k form a basis of all real symmetric n × n-matrices. The form of equation (33) of the dual problem becomes manifest when expressing the primal problem in terms of this operator basis, and writing the two semi-definite constraints of the primal problem in form of a direct sum as one constraint. Due to the block diagonal structure of (γ ⊕ iσ) and all constraints, we can without loss of generality assume that The first constraint is then equivalent to X 1,2 0. The latter constraints in the dual problem lead to Tr[F j,k X 1 ] = Tr[F j,k X 2 ], which restricts the real symmetric single system blocks of system A and B in X 1 and X 2 to be equal. This generalizes directly to the case of N subsystems: then the N real symmetric single system blocks of X 1 have to be equal to the N real symmetric single party blocks of X 2 . The matrix X 2 is further restricted by the condition Since γ is real and symmetric, we have further that Tr[γX 1 ] = Tr[γX re 1 ], where X re 1 is the real part of X 1 .
To summarize, the dual problem can be formulated as In this formulation, no basis is used explicitly. X bd 1,2 refers to the block diagonal matrices obtained from X bd 1,2 through pinching to the blocks of system A and B (i.e., a projection on to the form of a direct sum). Now we are in the position to formulate the connection between the separability problem and witnesses based on second moments:

Proposition 1 (Optimal witnesses in bi-partite systems).
For every feasible solution X to the dual program formulated above, the matrix X re 1 fulfils the witness condition (18). If γ is entangled, then so that X re 1 also fulfils condition (19). Further, Tr[γX re 1 ] is the minimal value of Tr[γZ] for any witness Z.
Proof. From weak Lagrange duality (15) it follows that where c is the vector specifying the objective function of the primal problem, being equivalent with In this case, there is always a strictly feasible X: just take X = 1 1 ⊕ (11 − iσ/(2n A + 2n B )). Hence, there exist feasible X and x such that equality is obtained in equation (41). We have seen before that x e 0 for all separable states. Hence, the condition (18) is fulfilled. On the other hand, if γ is an entangled covariance matrix, then x e < 0, hence also the condition (19) if fulfilled. Since the equality holds in equation (41), Tr[γX re 1 ] reaches the minimal value. An analogous proposition holds for witnesses detecting full separability in a system of N subsystems. Hence, all classes of k-separability can be tested with this criterion.

Detecting genuine multi-partite entangled states
The previous section was devoted to tests of full separability. Here, we formulate the problem for excluding bi-separability for systems of N subsystems, each consisting of n i modes, i = 1, . . . , N. As before, the total number of modes is n = i n i . The condition bi-separable states have to fulfil is inequality (12). 14 Institute of Physics ⌽ DEUTSCHE PHYSIKALISCHE GESELLSCHAFT

Primal problem
We write the primal problem in the following form: Here, π(k) are all K = 2 N−1 − 1 possible bi-partite partitions of the N systems. The matrices γ π(k) are block diagonal with respect to the partition π(k). If the solution x e 0, then γ is biseparable, because the matrices k γ π(k) fulfil an even stricter form of the Heisenberg uncertainty relations. If the solution x e < 0, then γ is genuinely multi-partite entangled, since k γ π(k) can now violate the uncertainty relations.
With the basis introduced in the previous section, the problem can be formulated as where the index 'bd,re,π(k)' refers to 'block-diagonal and real with respect to the partition π(k)'. The set of constraints can again be cast into the form of a single constraint in a direct sum form. This helps to identify the respective terms in the dual problem.

Dual problem
We can again assume the Hermitian matrix X ∈ C (2n[K+1]+2+K)×(2n[K+1]+2+K) to be block diagonal. The dual problem is then given by subject to X re,bd,π(k) 1 = X re,bd,π(k) k+1 for all k, Institute of Physics ⌽ DEUTSCHE PHYSIKALISCHE GESELLSCHAFT where 1 1 d and 0 d are the d-dimensional identity operator and 0 operator, respectively. With the last constraint, the objective function reduces to Now we can formulate the connection between the bi-separability problem and witnesses:

Proposition 2 (Witnesses for multi-partite entanglement).
For every feasible solution X to the dual program formulated above, the matrix X re 1 satisfies the witness condition for all bi-separable γ BS . If γ is genuinely multi-partite entangled, then Tr[γX re 1 ] < 1 so that X re 1 also satisfies condition (19). Further, Tr[γX re 1 ] is the minimal value of Tr[γZ] for any witness Z detecting only genuinely multi-party entangled states.

Proof. From weak Lagrange duality (15) it follows that
which is equivalent with (48) In this case, there is always a strictly feasible X: just take for all k. Here, n is the total number of modes as before. Hence, there exist feasible X and x such that equality is obtained in the last equation. We have seen before that x e 0 for bi-separable states. Hence, X re 1 fulfils the condition (18). Further, if γ is genuinely multi-partite entangled, then x e < 0. Hence, X re 1 also respects the condition (19). Finally, since the equality holds in equation (48), Tr[γX re 1 ] reaches the minimal value.

Direct sum form of tests for block diagonal covariance matrices
Often, the covariance matrices of generated states exhibit a direct sum form with respect to position and momentum variables. In the simplest two-mode form, this corresponds to a covariance matrix of the form with some ξ 1 , . . . , ξ 6 ∈ R. Not only can every two-mode covariance matrix be brought into such a form by means of appropriate local symplectic transformations, but many of the second moments of typical generated states exhibit approximately this form in any case. Two-mode squeezed states or noisy variants have covariance matrices of this form, needless to say. Then, the question is: can the test also be taken to be of this form, without losing optimality? The well-known test in (1) from [7], to give an example, is of such a form. This question can be positively answered. (52) for two modes). If Z is the optimal solution of the dual problem for γ, then the pinching

Proposition 3 (Direct sum in position and momentum). Let γ be a covariance matrix of the form of a direct sum of matrices corresponding to position and momentum coordinates (as in equation
where is also a feasible solution with the same objective value Tr[γZ].
Proof. The first steps of the proof are straightforward: since γ is of the form of a direct sum of matrices corresponding to the position and momentum coordinates, γ = P x γP x + P p γP p holds, and hence Tr[Zγ] = Tr[Z γ]. Now it has to be shown that Z is a witness. First, it fulfils Z 0, as every principal submatrix of a positive matrix is positive. Secondly, Tr[Z γ s ] 1 has to hold for all separable γ s . This is equivalent to Tr[Z γ s ] = Tr[Zγ s ] 1, where γ s = P x γ s P x + P p γ s P p . (56) Hence, if γ s is a separable covariance matrix then Z is a witness. The covariance matrix γ s fulfils γ s − γ A ⊕ γ B 0 for some covariance matrices γ A , γ B . Then, clearly γ s − γ A ⊕ γ B 0 holds. It remains to show that γ A ⊕ γ B + iσ 0 if γ A ⊕ γ B + iσ 0. Due to the block-diagonal structure, it suffices to show that for any covariance η satisfying η iσ, also η iσ holds. It is in this context convenient to order coordinates as (x 1 , . . . ,x n ,p 1 , . . . ,p n ). Then, η is obtained from η as a result of a pinching. In the following, we use standard notation from [16]. The idea of the proof is that we use appropriate symplectic transformations that commute with both P x and P p to transform P x ηP x + P p ηP p + iσ → P x MP x + P p MP p + iσ, such that the problem is reduced to a single mode problem. First, the position part of η can be brought to diagonal form by is diagonal in both the position and the momentum part. We can apply a pinching such that also the off-diagonal part of M is diagonal, leaving σ invariant. Since M + iσ 0 holds, then M + iσ 0 holds as well, where M is the pinched form of M. The covariance matrix is now a direct sum of single modes. But then, the validity of the statement becomes obvious: if then always also holds true. Hence, finally we arrive at γ A ⊕ γ B iσ.
Hence, it does not restrict generality for covariance matrices γ in form of a direct sum of position and momentum contributions to take a test with the same form. In any case, even if γ does not have this form, one may look at such tests, which we will later see again in the context of product criteria.

Incorporating practical measurement constraints
Often, some combinations of second moments are more accessible via experiment than others. One is typically well advised to avoid estimating all entries of the covariance matrix, but only directly those combinations that are required-as is, e.g., routinely done using the above test (1). In the program, to be described later, additional constraints to incorporate specifically accessible measurement types (for example via interferometers, rather than through homodyning measurements) can be taken into account via a finite number of linear constraints of the form i = 1, . . . , I. If this set of I constraints is too restrictive, it may happen that no test is found that can detect the entanglement.

Remarks on quantitative statements
One should be tempted to think that whenever a state 'violates' such a criterion by a large degree, it should be very much entangled, in quantitative terms. For Gaussian states this is a simple issue, as the result of the test is essentially just a lower bound to the logarithmic negativity, see above (compare also [35]). More relevant, yet, are statements that do not assume the Gaussian character of the state, as the very point of the test is that one not only does not need full tomographic knowledge of the quantum state, but not even knowledge of all of its second moments. Yet, it is not true that the Gaussian state is the one with the smallest logarithmic negativity, given some value in equation (1): there can be small violations. It has been shown that for a given value in equation (1), non-Gaussian states may have a slightly smaller logarithmic negativity [36]. Another example has been presented in [37], where it has been shown that for a fixed full covariance matrix (and not only a fixed value of equation (1)), there exists a non-Gaussian state assuming a smaller negativity than the corresponding Gaussian state. It is still true, however, that for a given left-hand side of equation (1), one can find a lower bound of the logarithmic negativity, indicating that 'a state that very much violates this criterion is also very much entangled'.
For the entanglement of formation, the smallest degree of entanglement is in turn assumed for a Gaussian state for symmetric 1 × 1-mode states [38], as well as for the squashed entanglement [37]. Also, the conditional entropy, for states ρ, a lower bound to the distillable entanglement, takes in general its smallest value for Gaussian states [39]. Hence, if the full covariance matrix of a state is known, then it is possible to evaluate the entropies of the corresponding Gaussian state with that covariance matrix, yielding a lower bound to the distillable entanglement of the non-Gaussian state. One hence does not have to assume the Gaussian character then: one can then measures the moments, evaluates the entropies of the respective Gaussian state, and take this value as lower bound to the distillable entanglement of the true non-Gaussian state.

Curved witnesses: all product criteria
In this section, we now turn to curved witnesses, tests that do not correspond to linear combinations of second moments, but to quadratic ones. Interestingly, the measurements that have to be performed are just the same ones as in linear tests, only the combination of the respective outcomes is different. It turns out that the use of quadratic tests is always advantageous to linear tests. Frankly, it is always 'better to multiply the numbers instead of adding them', see figure 1. Geometrically, such tests-generalized product criteria-correspond to curved surfaces, which are not hyperplanes. They are curved towards the set of second moments of separable Gaussian states. In the setting before, any witness Z can be decomposed as where The projectors P x and P p are defined in equation (54) and (55), respectively. Let us first look at the class of witnesses Z that are of the form From each witness of this form, a product criterion of the type of equation (2) can be derived, which is stronger than the witness. Moreover, there is a one-to-one correspondence between the witness and the product criterion. Hence, all product tests in the strict sense, involving the product of variances with respect to position and momentum coordinates, are obtained.

Proposition 4 (All product criteria).
If Z x + Z p is a witness, then the symplectic trace of Z k is equal to that of Z k . Hence, Z is a proper witness detecting γ. Note that this argument is independent of whether Z is a witness against full separability or for multi-party entanglement. Finally, the product criterion is detecting strictly more entangled covariance matrices than the witness Z x + Z p since only the implication Tr[(Z x + Z p )γ] < 1 ⇒ Tr[Z x γ] Tr[Z p γ] < 1/4 holds, while the converse direction does not necessarily hold for some entangled γ. For instance, consider a witness Z x + Z p and a covariance matrix γ such that As a matter of fact, if we allow for Z x,p = 0, then we get a one-to-one correspondence of witnesses and generalized product criteria, fully characterizing the convex set of separable second moments.

Proposition 5 (All generalized product criteria). If
(ii) P Z (γ) < 1 4 for some entangled γ, which is equivalent to P Z (γ) < 1/4. All the other steps of the proof of proposition 4 can be performed in analogy, using that SZS T = Z x + Z p + Z x,p , where S = √ aP x + P p / √ a as above.
These criteria hence form a complete set of criteria, and all what has been said before is also applicable to these tests. In a sense, these curved tests compensate for local squeezings, operations under which the linear tests are not invariant. Note also that the tests are quadratic, but still in entries of the canonical coordinates. One can also think of tests where the observables themselves include higher polynomials. First interesting steps in this direction have been undertaken, for example, in [40].
Institute of Physics ⌽ DEUTSCHE PHYSIKALISCHE GESELLSCHAFT

Numerical examples
We implemented the dual programs for witnesses detecting entanglement and genuine multipartite entanglement in Matlab (Version 7). The routines have been made freely available [41]. They make use of the solver SeDuMi [42] and the interface Yalmip [43], which are also freely available.

Testing full separability numerically
The function FullyWit implements the dual program of equation (38). It is called by the line The inputs are the covariance matrix gamma and a vector n, which holds the number of modes that each of the parties have. For instance, if gamma is a 6-mode state held by three parties A, B and C, where party A holds 3 modes, party B holds 1 mode, and party C holds 2 modes, then n=[3 1 2]. The symmetric covariance matrix gamma would have to have dimension 2n × 2n, where n = 6. Using the parameter constraints, the witnesses can be further restricted, as explained in subsection 8.3. Until then, we will set constraints=0, thereby not using this option.
The output Z is a real symmetric matrix fulfilling the first witness condition Tr[Zγ s ] 1 for all separable covariances γ s . The second output is Hence, if c < 0, then gamma is entangled, and Z is an optimal entanglement witnesses in the sense of proposition 1. Otherwise, gamma is separable. All the following examples were solved in fractions of a second on a Pentium 4 machine with 2.8 GHz and 512 Mb RAM by FullyWit and MultiWit, respectively.
The first example we would like to consider is the PPT entangled state of 2 × 2 modes given in [25] The command Institute of Physics ⌽ DEUTSCHE PHYSIKALISCHE GESELLSCHAFT yields c=-0.1034, exemplifying the entanglement of the covariance matrix γ WW , detected by the witness where x = 0.1394, y = 0.0374 and z = 0.1021. As a second example, we consider the family of GHZ like Gaussian states introduced in [44]. For N modes, the covariance matrix is given by where and Further, r 1 > 0 is the squeezing parameter of the first initial mode at the beginning of the state construction process, and r 2 > 0 is the squeezing parameter of the other N − 1 modes at that stage [44]. These states have the following properties: they are pure, invariant under exchange of any two parties, and are genuinely multi-partite entangled. For N = 3 and r 1 = r 2 = (ln 2)/2, the covariance matrix takes the simple form Institute of Physics ⌽ DEUTSCHE PHYSIKALISCHE GESELLSCHAFT The routine FullyWit yields c=-0.500, clearly demonstrating the entanglement of the state for these parameters, and the witness is given by Then the test can be performed by the command In a similar manner, all possible partitions for N parties can be tested.

Testing bi-separability numerically
In analogy, the function MultiWit implements the dual program of equation (44). It is called by the line [c Z] = MultiWit(gamma, n, constraints).
The inputs are again the covariance matrix gamma and a vector n, which holds the number of modes that each of the parties have as in FullyWit. Again, we put constraints=0 and refer to subsection 8.3. The output Z is a real symmetric matrix fulfilling the first witness condition Tr[Zγ s ] 1 for all bi-separable covariances γ s . The second output is c=Tr[Z gamma]-1. Hence, if c < 0, then gamma is genuinely multi-partite entangled, and Z is an optimal entanglement witnesses in the sense of proposition 2. Otherwise, gamma is bi-separable.
Applying this routine to the 3-mode GHZ covariance of equation (92), we obtain c=-0.3056, showing that the state is genuinely multi-partite entangled. The witness detecting the state has the form where x = 0.2315, y = 0.2021, z = 0.1157 and w = 0.1875.

Institute of Physics ⌽ DEUTSCHE PHYSIKALISCHE GESELLSCHAFT
Another example we consider is a 4-mode state occurring in an intermediate step of an continuous-variable entanglement swapping experiment as described in [45]. Key steps towards full implementations and first experimental implementations have been reported recently [3,46].
The idea can be briefly described as follows: two entangled states are produced between the modes labelled 1 and 2 and between the modes 3 and 4, respectively. Then a certain homodynetype measurement is performed between the modes 2 and 3. In a successful implementation, after this, entanglement can be confirmed between the modes 1 and 4 which have never interacted before. Here, we consider the state before the actual measurement, which is the state where the modes 2 and 3 have been brought to overlap at a 50 : 50 beam splitter.
In order to see whether this can indeed be confirmed for realistic parameters, we construct two-mode entangled states with a fixed degree of squeezing and a fixed degree of mixedness by 'backwards reasoning'. We start with the diagonal matrix γ = diag(e −2r , e −2r , αe 2r , αe 2r ), where r, α > 0. This is the desired covariance matrix after partial transposition and symplectic diagonalization. The entanglement is reflected in the symplectic eigenvalue [16] e −2r < 1 for r > 0. We arrive at the covariance matrix γ by the reverse transformation, in this case we first apply a 50 : 50 beam splitter and then partial transposition with respect to the second system. The symplectic eigenvalues of the resulting matrix γ are both equal to √ α. The von-Neumann entropy can for a Gaussian state be calculated as [16] where N k = (s k − 1)/2 is obtained from the symplectic eigenvalues s k of γ.
For both input entangled pairs of modes, we choose r = 2 ln(2)/3, corresponding to 4dB squeezing of the initial state (the degree of squeezing can be read off the smallest eigenvalue of the covariance matrix) and α = 5, leading to H(ρ) = 2.152. The covariance matrix of the state after the beam splitter between the modes 2 and 3 is then given by where x = 6.4980 and y = −4.3142. The routine MultiWit returned c=-0.2305, demonstrating the genuine four-partite entanglement of the state. The corresponding witness is of the form of equation (99), where now x = 0.2352 and y = 0.1660. The function FullyWit returns c=-0.6031 for n=[1 1 1 1]. The corresponding witness is of the same form as equation (99), where now x = 0.125 and y = 0.0884. However, this specific instance of a test can only clarify that the state is not fully separable.

Further experimental constraints
If the experimental setup limits the possible set of tomographic measurements, then these constraints can be taken into account by requiring that the witness Z fulfils where A is an operator describing the measurement. We can, for instance, set the element Z j,k to zero with the matrix A = F j,k defined in equation (33). In this way, it is possible to restrict Z such that no position-momentum correlation measurements are required, as discussed in subsection 6.1.
If we require that equation (100) holds, then the only constraint that is affected in the primal program is and in analogy for the program detecting only genuine multi-partite entanglement. Here, x A is a new real variable in addition to the ones collected in the real vector x of the primal program.
Hence, the effect of the additional constraint (100) in the dual program on the primal program is, that the set of separable states is effectively enlarged. This was to be expected, since the set of witnesses is further restricted, and hence less entangled states can be detected with further constraints. If the dual program finds a restricted witness Z r such that Tr[Z r γ] < 1 for the covariance γ in question, then the experimental proof of entanglement can be simplified, otherwise some or all of the additional constraints have to be dropped. In the program, for each constraint a matrix A has to be defined of the dimensions of the covariance matrix. As already mentioned, if no constraint is desired, then constraints=0. Otherwise, when k extra constraints of the form of equation (100) are included.

Summary
In this paper, we have provided a complete picture of all tests for continuous-variable entanglement which are linear in variances of canonical coordinates as solutions of certain semidefinite problems. This framework has turned out to be applicable both in the bi-partite case, as well as for the various separability classes in the multi-partite setting. We moreover classified all product criteria, leading to curved witnesses, so nonlinear witnesses, curved towards the set of separable covariance matrices. Finally, we presented the functioning of the two routines FullyWit and MultiWit, which deliver just such optimal tests, given an assumption on how the state should roughly be like. We discussed several examples in detail. It is the hope that this picture, and also the freely available routines, provide useful practical tools in assessing entanglement in continuous-variable systems, also in the experimental context.