{'fraction_non_alphanumeric': 0.05430862136482615, 'fraction_numerical': 0.013211319276984275, 'mean_word_length': 3.742913000977517, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 54, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Complete hierarchy for the quantum marginal problem

Clarifying the relation between the whole and its parts is crucial for many problems in science. In quantum mechanics, this question manifests itself in the quantum marginal problem, which asks whether there is a global pure quantum state for some given marginals. This problem arises in many contexts, ranging from quantum chemistry to entanglement theory and quantum error correcting codes. In this paper, we prove a correspondence of the marginal problem to the separability problem. Based on this, we describe a sequence of semidefinite programs which can decide whether some given marginals are compatible with some pure global quantum state. As an application, we prove that the existence of multiparticle absolutely maximally entangled states for a given dimension is equivalent to the separability of an explicitly given two-party quantum state. Finally, we show that the existence of quantum codes with given parameters can also be interpreted as a marginal problem, hence, our complete hierarchy can also be used.

Clarifying the relation between the whole and its parts is crucial for many problems in science. In quantum mechanics, this question manifests itself in the quantum marginal problem, which asks whether there is a global pure quantum state for some given marginals. This problem arises in many contexts, ranging from quantum chemistry to entanglement theory and quantum error correcting codes. In this paper, we prove a correspondence of the marginal problem to the separability problem. Based on this, we describe a sequence of semidefinite programs which can decide whether some given marginals are compatible with some pure global quantum state. As an application, we prove that the existence of multiparticle absolutely maximally entangled states for a given dimension is equivalent to the separability of an explicitly given two-party quantum state. Finally, we show that the existence of quantum codes with given parameters can also be interpreted as a marginal problem, hence, our complete hierarchy can also be used.

I. INTRODUCTION
For a given multiparticle quantum state |ϕ it is straightforward to compute its marginals or reduced density matrices on some subsets of the particles. The reverse question, whether a given set of marginals is compatible with a global pure state, is, however, not easy to decide. Still, it is at the heart of many problems in quantum physics. Already in the early days it was a key motivation for Schrödinger to study entanglement [1], and it was recognized as a central problem in quantum chemistry [2]. There, often additional constraints play a role, e.g., if one considers fermionic systems. Then the anti-symmetry leads to additional constraints on the marginals, generalizing the Pauli principle [3,4]. A variation of the marginal problem is the question whether or not the marginals determine the global state uniquely or not [5,6]. This is relevant in condensed matter physics, where one may ask whether a state is the unique ground state of a local Hamiltonian [7,8].
With the emergence of quantum information processing, various specifications of the marginal problem moved into the center of attention. In entanglement theory a pure two-particle state is maximally entangled, if the one-particle marginals are maximally mixed. Furthermore, absolutely maximally entangled (AME) states are multiparticle states that are maximally entangled for any bipartition. This makes them valuable ingredients for quantum information protocols [9,10], but it turns out that AME states do not exist for arbitrary dimensions, as not always global states with the desired mixed marginals can be found [11][12][13][14]. In fact, also states obeying weaker conditions, where a smaller number of marginals should be maximally mixed, are of fundamental interest, but in general it is open when such states exist [15][16][17]. More generally, the construction of quantum error correcting codes for quantum computing essentially amounts to the identification of subspaces of In the marginal problem, one aims to characterize the pure states |ϕ on n particles, which are compatible with given marginals. The key idea of our approach is to drop the purity constraint and to consider mixed states ρ with the given marginals. Then, the purity is enforced by considering a twoparty extension Φ AB .
the total Hilbert space, where all states in this space obey certain marginal constraints. This establishes a connection to the AME problem, which consequently was announced to be one of the central problems in quantum information theory [18].
In this paper, we reformulate the marginal problem as an optimization problem over separable states. This has various consequences. First, it allows to formulate a complete hierarchy of conditions for a set of marginals to be compatible with a global pure state. Each step is given by a semidefinite program, the conditions become stronger with each level, and a set of marginals comes from a global state, if and only if all steps are passed. Second, when applied to the AME problem, our approach shows that an AME state for a given number of particles and dimension exists, if and only if a specific two-party quantum state is separable. In fact, this allows to reproduce nearly all previous results on the AME problem [19] with a few lines of calculation. Finally, we show that our approach can be extended to study the existence problem of quantum codes.
The formal definition of the marginal problem is the arXiv:2008.02124v1 [quant-ph] 5 Aug 2020 following: Consider an n-particle Hilbert space H = n i=1 H i , and let I ⊂ {I | I ⊂ [n] = {1, 2, . . . , n}} be some subsets of the particles, where the reduced states ρ I are known marginals. Then, the problem reads find |ϕ s.t. Tr I c (|ϕ ϕ|) = ρ I , I ∈ I. (1) Here, I c = [n] \ I denotes the complement of the set I. Before explaining our approach, two facts are worth mentioning: First, if the global state |ϕ ϕ| is not required to be pure, then the quantum marginal problem without purity constraint is a semidefinite program (SDP) for which a lot of efficient algorithms exist [20]. Second, if the given marginals are only one-body marginals, that is I = {{i} | i ∈ [n]}, the marginals are non-overlapping and the problem in Eq.
(1) was solved by Klyashko [21]. For overlapping marginals, however, the solution is more complicated, and this is what we want to discuss in this work.

II. CONNECTING THE MARGINAL PROBLEM WITH THE SEPARABILITY PROBLEM
The main idea of our method is to consider, for a given set of marginals, the compatible states and their extensions to two copies. Then, we can formulate the purity constraint using an SDP. First, let us introduce some notation. Let C be the set of global states (not necessarily pure) that are compatible with the marginals, i.e., C = {ρ | ρ ≥ 0, Tr I c (ρ) = ρ I ∀ I ∈ I}. (2) Then, we define C 2 to be the convex hull of two copies of the compatible states where the p µ form a probability distribution. We denote the two parties as A and B, and each of them owns an n-body quantum system; see Fig. 1.
To impose the purity constraint, we take advantage of the well-known relation [22] where V AB is the swap operator between parties A and B, and ρ A and ρ B are arbitrary quantum states. For a state Φ AB in C 2 this implies that Furthermore, equality in Eq. (5) is attained if and only if all ρ µ are pure states. This leads to our first key observation: There exists a pure state in C if and only if max Φ AB ∈C 2 Tr(V AB Φ AB ) = 1.
What remains to be done is the characterization of the set C 2 , then we can formulate the quantum marginal problem as an optimization problem over this set. Obviously, any Φ AB ∈ C 2 is separable with respect to the bipartition (A|B) [23] and its marginals satisfy where Tr A I c is the partial trace over all subsystems i ∈ I c on party A. These two constraints provide a necessary, but not sufficient, criterion for Φ ∈ C 2 . Nevertheless, together with the condition Tr(V AB Φ AB ) = 1, these two constraints completely characterize the quantum marginal problem with purity constraint: There exists a pure quantum state |ϕ that satisfies Tr I c (|ϕ ϕ|) = ρ I for all I ∈ I if, and only if, the solution of the following convex optimization is equal to one, (9) where SEP denotes the set of separable states w.r.t. the bipartition (A|B), and A I c denotes all subsystems A i for i ∈ I c .
On the other hand, if the solution of Eq. (7) is equal to one, then the separability constraint and Eq. (5) imply that Φ AB must be of the form Writing Tr I c (|ψ µ ψ µ |) = σ (µ) One can show that states of the form ρ ⊗ ρ are extreme points of the convex hull conv{ρ ⊗ ρ | ρ ≥ 0, Tr(ρ) = 1}; see Appendix A for more details. Thus, σ (µ) I = ρ I for all µ and I ∈ I. This means that each |ψ µ is a pure state with the desired marginals.
Before proceeding further, we would like to add a few remarks. First, in Theorem 1 the normalization constraint and the constraint in Eq. (9) can be replaced by a weaker condition as this does not affect the validity of Eq. (11). However, when considering relaxations of the optimization In order to formulate the hierarchy for the marginal problem, one extends the two copies in Fig. (1) to an arbitrary number of copies N. If the marginal problem has a solution |ϕ , then there are multi-party extensions Φ AB···Z for any number of copies, obeying some semidefinite constraints.
in Eq. (7) by replacing the separability constraint in Eq. (8) with some entanglement criteria, the former constraint may be stronger than the latter. Second, if one finds that Tr(V AB Φ AB ) = 1, this is equivalent to V AB Φ AB = Φ AB , as the largest eigenvalue of V AB is one. Physically, this means that Φ AB is a two-party state acting on the symmetric subspace only. Hence, Theorem 1 is also equivalent to the feasibility problem (15) Third, the separability condition in the optimization Eq. (8) is usually not easy to characterize, hence relaxations of the problem need to be considered. The first candidate is the positive partial transpose (PPT) criterion [24,25], which is an SDP relaxation of the optimization in Eq. (7). The PPT relaxation provides a pretty good approximation when the local dimension and the number of parties are small. In the following, inspired by the symmetric extension criterion [26], we propose a multi-party extension method and obtain a complete hierarchy for the marginal problem.

III. THE HIERARCHY FOR THE MARGINAL PROBLEM
In order to generalize Theorem 1 we first need to extend C 2 in Eq. (3) from two to an arbitrary number of copies of ρ. That is, we define C N = conv{ρ ⊗N | ρ ∈ C}. Second, we introduce the notion of the symmetric subspace. We denote the N parties as A, B, . . . , Z, and each of them owns an n-body quantum system. For any H ⊗N := H A ⊗ H B ⊗ · · · ⊗ H Z , the symmetric subspace is defined as where S N is the permutation group over N symbols and V Σ are the corresponding operators on the N parties A, B, . . . , Z; see Fig. 2. Let P + N denote the orthogonal projector onto the symmetric subspace of H ⊗N . P + N can be explicitly written as In particular, for two parties we have the well-known relation P + 2 = (1 AB + V AB )/2, which implies that Tr(V AB Φ AB ) = 1 if and only if Tr(P + 2 Φ AB ) = 1. Also, Hereafter, without ambiguity, we will use P + N to denote both the symmetric subspace and the corresponding orthogonal projector.
Suppose that there exists a pure state ρ ∈ C. It is easy to see that Φ AB···Z = ρ ⊗N satisfies (20) Here, the separability can be understood as either full separability or biseparability, since they are equivalent in the symmetric subspace [27]. Relaxing Φ AB···Z ∈ SEP, we obtain a complete hierarchy for the quantum marginal problem: Theorem 2. There exists a pure quantum state |ϕ that satisfies Tr I c (|ϕ ϕ|) = ρ I for all I ∈ I if and only if for all N ≥ 2 there exists an N-party quantum state Φ AB···Z such that Each step of this hierarchy is a semidefinite feasibility problem, and the conditions become more restrictive if N increases.
The proof of Theorem 2 is shown in Appendix B. Notably, we can add any criterion of full separability, e.g., the PPT criterion for all bipartitions, as extra constraints to the feasibility problem. Then, Theorem 2 still provides a complete hierarchy for the quantum marginal problem. In addition, the quantum marginal problems of practical interest are usually highly symmetric. These symmetries can be utilized to largely simplify the problems in Theorems 1 and 2. In the following, we illustrate this with the existence problem of AME states.

IV. ABSOLUTELY MAXIMALLY ENTANGLED STATES
We first recall the definition of AME states. An n-qudit state |ψ is called an AME state, denoted as AME(n, d), if it satisfies where I r = {I ⊂ [n] | |I| = r} and r = n/2 . Thus, Eq. (13) implies that an AME(n, d) exists if and only if the following problem is feasible, Direct evaluation of the problem is usually difficult, because the dimension of Φ AB is d 2n × d 2n , which is already very large for the simplest cases. For instance, for the 4-qubit case, the size of Φ AB is 256 × 256.
To resolve this size issue, we investigate the symmetries that can be used to simplify the feasibility problem. Let X denote the set of Φ AB that satisfy the constraints in Eqs. (25,26,27). If we find a unitary group G such that for all g ∈ G and Φ AB ∈ X we have that Then, the convexity of X implies that we can add a symmetry constraint to the constraints in Eqs. (25,26,27), namely, In the following, we will show that the symmetries of the set of AME states (if they exist for given n and d) are restrictive enough to leave only a single unique candidate for Φ AB , for which separability needs to be checked. The set of AME(n, d) is invariant under local unitaries and permutations on the n particles, so by Theorem 1 (or by direct verification) the following two classes of unitaries satisfy Eq. (28), where π = π(A 1 , A 2 , . . . , A n ) = π(B 1 , B 2 , . . . , B n ) denotes the permutation operators on H A and H B . Note that the U i in Eq. (30) can be different. First, let us view V AB and Φ AB as V 12...n and Φ 12...n , where i labels the subsystems A i B i . Hereafter, without ambiguity, we will omit the subscripts of for simplicity. From this perspective, V AB can be written as V ⊗n , and the symmetries in Eq. (30) can be written as n i=1 (U i ⊗ U i ) for U i ∈ SU(d) and Π = Π(A 1 B 1 , A 2 B 2 , . . . , A n B n ) for Π ∈ S n , respectively. According to Werner's result [22], a (U ⊗ U)-invariant Hermitian operator must be of the form α1 + βV with α, β ∈ R. This implies that a [ n i=1 (U i ⊗ U i )]-invariant state must be a linear combination of operators of the form In addition, we take advantage of the permutation symmetry under Π ∈ S n to write any invariant Φ AB as where P represents the sum over all possible permutations that give different terms, e.g., Inserting this ansatz in Eqs. (26,27) one can show by brute force calculation that the x i are uniquely determined and given by where we use the convention that ( i j ) = 0 when j < 0 or j > i; see Appendix C for details. Then, Theorem 1 implies that the AME state exists if and only if Φ AB is a separable quantum state.

Theorem 3. An AME(n, d) state exists if and only if the
To check the separability of Φ AB , we first consider the positivity condition and the PPT condition. It is easy to see that Φ AB can be written as and Φ T B AB can be written as where Here p i and q i are the eigenvalues of Φ AB and Φ T B AB , respectively. Then, we can simplify the positivity condition Φ AB ≥ 0 and the PPT condition Φ for all i = 0, 1, 2, . . . , n. Note that the latter inequality is trivial for i ≤ r. The explicit form of p i and q i and the proof of the conditions in Eq. (38) are shown in Appendix D. The positivity and PPT conditions can already rule out the existence of many AME states. Actually, they can reproduce all the known nonexistence results except AME(7, 2) [13,14]. To get a higher-order approximation, we provide a general framework for performing the symmetric extension in Appendices E and F.
As the open problem of the existence of AME(4, 6) is of particular interest in the quantum information community [18,28], we explicitly express it as the following corollary.

Corollary 4.
An AME(4, 6) exists if and only if the quantum state is separable, or equivalently, is separable w.r.t. bipartition (A|B).
At the moment, we are unable to decide separability of these states; in Appendix G we provide a short discussion of this problem.

V. QUANTUM CODES
As another application, we show that our method can also be used to analyze the existence of quantum error correcting codes. For simplicity, we only consider pure quantum codes [29] in the text; see Appendix H for the general case. Our starting point is the fact that pure quantum codes are closely related to m-uniform states [11]. More precisely, an ((n, K, m + 1)) d pure code exists if and only if there where I m = {I ∈ [n] | |I| = m} and I c = [n] \ I. The existence of ((n, 1, m + 1)) d pure codes reduces to the existence of m-uniform states, for which the methods from the last section are directly applicable. Here, we show that the existence of ((n, K, m + 1)) d pure codes can still be written as a marginal problem if K > 1. To do so, we define an auxiliary system H 0 = C K and let ⊗n . Now, we can write the existence of ((n, K, m + 1)) d pure codes as a marginal problem on H. Lemma 5. A quantum ((n, K, m + 1)) d pure code exists if and only if there exists a quantum state |Q in H such that where I c is still defined as {1, 2, . . . , n} \ I.
Proof. We first show the necessity part. Suppose that a ((n, K, m + 1)) d code with corresponding subspace Q exists. We define an entangled state |Q in H 0 ⊗ Q ⊂ H as where {|k } K k=1 and {|k L } K k=1 are orthonormal bases for H 0 and Q, respectively. Then for any pure state |a in H 0 , √ K a|Q ∈ Q. Hence, Eq. (41) implies that for all |a in H 0 , which in turn implies Eq. (42).
To prove the sufficiency part, let Q be the space generated by the pure states |ϕ a = √ K a|Q for all |a in H 0 . Then, Eq. (42) implies that all |ϕ a are muniform states. Furthermore, from rank(Tr 0 (|Q Q|)) = rank(Tr 12···n (|Q Q|)) = rank(1 K /K) = K it follows that Q is a K-dimensional subspace.
Thus, Theorem 1 gives a necessary and sufficient condition for the existence of ((n, K, m + 1)) d pure codes.
where SEP denotes the set of separable states w.r.t. the biparti- Furthermore, the multi-party extension and symmetrization techniques that we developed for AME states can be easily adapted to the quantum error correcting codes. For instance, the PPT relaxation can be written as a linear program and the symmetric extensions can be written as SDPs. An important difference is that the symmetrized Φ AB for quantum error correcting codes is no longer uniquely determined by the marginals in general. Finally, we would like to mention that Lemma 5 is of independent interest on its own. For example, Eq. (42) implies that (Kd m ) 2 ≤ Kd n , which provides a simple proof for the quantum Singleton bound [29,30] K ≤ d n−2m for pure codes.

VI. CONCLUSION
We have shown that the marginal problem for multiparticle quantum systems is closely related to the problem of entanglement and separability for two-party systems. More precisely, we have shown that the existence of a pure multiparticle state with given marginals can be reformulated as the existence of a two-party separable state with additional semidefinite constraints. This allows for further refinements: First, one may use the multi-party extension technique to develop a complete hierarchy for the quantum marginal problem. Second, one can use symmetries of the original marginal problem, to restrict the search of the two-party separable state further. For the AME problem, this allows to determine a unique candidate for the state, and it remains to check its separability properties. Finally, the approach can be extended to characterize the existence of quantum codes.
Our work provides new insight in several subfields of quantum information theory. First, it may provide a significant step towards solving the problem of the existence of the AME(4, 6) state or quantum orthogonal Latin squares, a problem which has been highlighted as an outstanding problem in quantum information theory [18]. Second, there are already a variety of results on the separability problem, and in the future, these can be used to study marginal problems in various situations. Finally, it would be interesting to extend our work to other versions of the marginal problem, e.g., in fermionic systems or with a relaxed version of the purity constraint. We believe that our approach can also lead to progress in these cases.
Each step of this hierarchy is a semidefinite feasibility problem, and the conditions become more restrictive if N increases.
To prove Theorem 2, we take advantage the following lemma, which can be viewed as a special case of the quantum de Finetti theorem [31]. Lemma 8. Let ρ N be an N-party quantum state in the symmetric subspace P + N , then there exists a k-party quantum state i.e., a fully separable state in P + k , such that where · is the trace norm and D is the local dimension.
The necessity part of Theorem 2 is obvious. Hence, we only need to prove the sufficient part, i.e., that the existence of an N-party quantum state Φ AB···Z for arbitrary N implies the existence of |ϕ . Let Φ N AB = Tr C···Z (Φ ABC···Z ), then Φ N AB satisfy that Further, Lemma 8 implies that there exist separable states Φ N AB such that As the set of quantum states for any fixed dimension is compact, we can choose a convergent subsequence Φ N i AB of the sequence Φ N AB . Thus, Eq. (B8) implies that Thus, Eqs. (B6, B7) and the fact that the set of separable states is closed imply that Φ AB satisfies all constraints in Eqs. (13,14,15). Then, Theorem 2 follows directly from Theorem 1.

Appendix C: Existence and uniqueness of the symmetrized Φ AB for AME states
Before proving the existence and uniqueness of the symmetrized Φ AB , we show how to simplify the constraints in Eqs. (26,27) by taking advantage of Eq. (33). The meaning of this simplification is two-fold: first, it gives an intuition about why the symmetrized Φ AB is uniquely determined; second, it can be directly generalized to other marginal problems, such as the m-uniform states and quantum codes, in which the symmetrized Φ AB are no longer uniquely determined. Recall the symmetrized Φ AB is of the form then the constraints in Eqs. (26,27) can be simplified as follows: • Normalization constraint Tr(Φ AB ) = 1: • Symmetric subspace constraint V AB Φ AB = Φ AB : which implies that • Marginal constraints Tr A I c (Φ AB ) = 1 d r d r ⊗ Tr A (Φ AB ): Because Φ AB is invariant under permutations Π ∈ S n , it is sufficient to consider I c = {1, 2, . . . , n − r}. Further, as 1 d r d r ⊗ Tr A (Φ AB ) ∝ 1 d n+r , it must also hold that Tr A I c (Φ AB ) ∝ 1 d n+r . Hence, all terms that contain V in Tr A I c (Φ AB ) must be zero. Thus, the marginal constraints Equations (C2, C4, C5) provide n + 1 linear equations, which can uniquely determine the n + 1 parameters To rigorously prove the existence and uniqueness of Φ AB constrained by Eqs. (C2, C4, C5), we take advantage of the following lemma; for more details about the dual basis, see e.g., Ref. [32]. First, we define S to be the space generated by the linearly independent operators and the inner product to be the Hilbert-Schmidt inner product, e.g., Then, Φ AB ∈ S by Eq. (C1). Second, we show that if Φ AB exists, then it is unique. By slightly modifying the derivation of Eq. (C5), it is easy to see that the normalization constraint and the marginal constraints for AME(n, d) are equivalent to which implies that The symmetric subspace constraint V AB Φ AB = V ⊗n Φ AB = Φ AB and the relation X i V AB = X i V ⊗n = X n−i imply that Thus, we get which implies the uniqueness by Lemma 9. Furthermore, in this case, we can easily write down the dual basis It is straightforward to check that Tr( X i X j ) = δ ij . Thus, we can get an explicit form of Φ AB from x i = Tr( X i Φ AB ), where we have used the relation whose proof is similar to Eq. (C11). Finally, we show the existence of Φ AB , i.e., Φ AB determined by Eq. (C11) is compatible with the constraints in Eqs. (C2, C4, C5). To this end, we show that Eq. (C11) implies that V AB Φ AB = Φ AB and Eq. (C8). As Tr(X i Φ AB ) = Tr(X n−i Φ AB ) by Eq. (C11) and X i V AB = X i V ⊗n = X n−i , it holds that From the uniqueness statement in Lemma 9, it follows that V AB Φ AB = Φ AB . To prove Eq. (C8), we define R to be the space generated by the linearly independent operators Equation (C11) and the permutation symmetry of Φ AB ∈ S imply that Thus, Furthermore, one can easily check that Then, applying the uniqueness statement in Lemma 9 to R implies Eq. (C8). Hence, we proved the compatibility of Φ AB with Eqs. (C2, C4, C5).

Appendix D: Positivity and PPT conditions for AME state
To get a closed form of the positivity and PPT conditions for AME states, we will use the following relations  Similarly due to Eq. (36), the PPT condition is equivalent to By noticing that we obtain an explicit expressions for p i and q i (D5)

Appendix E: Multi-party extension: primal problem
We are going to analyze and simplify the hierarchy of SDPs stated in Theorem 2 for the case of the existence of AME states, Similar to the two-party case, we can view the N-party state Φ AB···Z as Φ 12...n , where i labels the subsystems A i B i · · · Z i . The permutations on A i B i · · · Z i are denoted with subscripts ab · · · z. For example, V AB and V ABC can be written as V ⊗n ab and V ⊗n abc , respectively, where V ab are the permutations A i ↔ B i and V abc are the permutations Generally, we use σ and Σ to denote the permutations on ab · · · z and AB · · · Z, respectively, and in addition V Σ = V ⊗n σ . Again, as the set of AME(n, d) is invariant under local unitaries and permutations on the n particles, we can assume that Φ AB···Z is symmetric under the following operations, Note that π ∈ S n denotes a permutation on 12 · · · n (vertical permutation in Fig. 3), while σ ∈ S N in the previous paragraph denotes a permutation on ab · · · z (horizontal permutation in Fig. 3). According to Schur-Weyl duality [33], any operator Φ such that [Φ, U ⊗N ] = 0 must have the form Thus, the [U 1 ⊗ · · · ⊗ U n ] ⊗N symmetry implies that The number of parameters can be further reduced by taking advantage of the vertical permutation symmetry {Π = π ⊗N | π ∈ S n }, i.e., x σ 1 σ 2 ···σ n = x σ 1 σ 2 ···σ n (E5) when {σ 1 , σ 2 , · · · , σ n } and {σ 1 , σ 2 , · · · , σ n } are the same multiset (set that allows repeated elements).
We are now ready to express the constraints in the problem (E1) in terms of the variables x σ 1 σ 2 ···σ n in Eq. (E4). Naively plugging Eq. (E4) into Eq. (E1) results in relations between large matrices; however the symmetry of the problem allows one to also simplify these constraints.
Notice that the partial trace operation can also be expressed under the basis {V σ | σ ∈ S N }. For example, where all V σ are operators on abc and we perform ⊗1 c to ensure that the operator stays within the original space. Similarly, we can implement the trace operation. In this way, the equality constraints regarding the marginals in Eq. (E1) can be written in terms of the basis operators V σ 1 ⊗ V σ 2 ⊗ · · · ⊗ V σ n without referring to explicit matrix elements. Also, the symmetric projection P + N takes the form Therefore the equality P + N Φ AB···Z P + N = Φ AB···Z can also be expressed in terms of basis operators V σ 1 ⊗ V σ 2 ⊗ · · · ⊗ V σ n . Let us now consider the positivity constraint Φ AB···Z ≥ 0. Here, the crucial observation is that Φ AB···Z is simply a linear combination of the basic matrices V σ 1 ⊗ V σ 2 ⊗ · · · ⊗ V σ n . The matrices V σ i in fact form a so-called (unitary linear) representation of the group S N [33]. By the general theory of linear representations of groups, there is an orthogonal basis such that all of these matrices are block-diagonalized. Moreover, the possible blocks that appear in the block-diagonal form of these matrices are also completely specified by the group, known as the unitary irreducible representations of the group. In this way, the positivity constraint on Φ AB···Z ≥ 0 is reduced to the positivity of each of the different irreducible blocks.
For the symmetric group S N , the irreducible representations are conveniently labeled by the partitions of N. A partition λ of length k = |λ| is a tuple of positive integer numbers λ = (N 1 , N 2 , . . . , N k ) such that N 1 ≥ N 2 ≥ · · · ≥ N k and N 1 + N 2 + · · · + N k = N. We denote the set of all partitions by Λ N . For each partition λ, there is an associated unitary irreducible representation M λ , that is, the set of unitary matrices M λ (σ) for σ ∈ S N . Concretely, by choosing a suitable orthonormal basis (independent of σ), all V σ can be written as where M λ (σ) correspond to the unitary irreducible representations and d λ are the corresponding multiplicities. The matrix elements of M λ (σ) can also be constructed explicitly by taking advantage of the Young tableaux [34]. For practical purposes, these matrices can be called from an appropriate computer algebra system such as GAP [35]. For the representation V σ , it is also known that M λ (σ) is present (d λ = 0) in the block-diagonal form of V σ if and only if the length of λ is smaller than the local dimension |λ| ≤ d [33]. We thus have the following observation.
There is yet another way to parameterize the optimization problem, which additionally incorporates the constraint P + N Φ AB···Z P + N = Φ AB···Z more directly. Let us recall from the above that Φ AB···Z as well as P + N are linear combinations of operators of the form V σ 1 ⊗ V σ 2 ⊗ · · · ⊗ V σ n . Thus, by choosing a suitable basis such that V σ i are all block-diagonal, both Φ AB···Z and P + N are also block-diagonal. The possible blocks of V σ are labeled by partitions of the form λ = (N 1 , N 2 , . . . , N k ) with k = |λ| ≤ d. Correspondingly, the possible blocks of V σ 1 ⊗ V σ 2 ⊗ · · · ⊗ V σ n are labeled by a tuple of partitions λ = (λ 1 , λ 2 , . . . , λ n ) with |λ i | ≤ d. Each of such blocks may appear multiple times, but because of Eq. (E8), this simply results in exactly the same blocks in Φ AB···Z as well as P + N . Therefore, considering just one time of appearance of each block is sufficient. Moreover, because of the symmetry of coefficients in the linear combination under vertical permutations as in Eq. (E5), only a single representative of the tuples of partitions that are different by a vertical permutation needs to be considered. Hence, we are left with analyzing the constraint P + N Φ AB···Z P + N = Φ AB···Z within the blocks corresponding to λ = (λ 1 , λ 2 , . . . , λ n ).
More specifically, let H λ i denote the subspace corresponding to the blocks λ i of the operators V σ i . Then the subspace corresponding to the block λ = (λ 1 , λ 2 , . . . , λ n ) of V σ 1 ⊗ V σ 2 ⊗ · · · ⊗ V σ n is given by In this subspace, the symmetric projection P + N reads The constraint P + N Φ AB···Z P + N = Φ AB···Z restricted to the subspace H λ means that the corresponding block of Φ AB···Z , denoted as Φ λ AB···Z , is supported only on the symmetric subspace defined by the projection (P + N ) λ , , for this subspace K λ , then the corresponding block of Φ AB···Z is of the form In this way, Φ λ AB···Z is parameterized by the matrix X λ , and its positivity reduces to the positivity of X λ . In short, let us summarize the procedure to implement the optimization problem. First, enumerate all irreducible representations of S N , i.e., all possible partitions λ. Then, select those partitions that have length |λ| no longer than d. Based on that, enumerate all tuples of partitions λ = (λ 1 , λ 2 , . . . , λ n ) with |λ i | ≤ d. For each of those tuples λ, compute the symmetric projection (P + N ) λ by Eq. (E11) and select a basis for K λ = Image(P + N ) λ . Finally, for each partition tuple λ, consider the associated positive semidefinite Hermitian matrix variable X λ and write down the constraints corresponding to the condition on the marginals in Eq. (E1) to complete the SDP.
In addition, we provide some more details for the construction of the basis of K λ . For readers who are familiar with the representation theory of groups, there is a simple characterization of K λ that helps carrying out the practical implementation. In the language of representation theory, H λ i is an irreducible representation of S N , while H λ is an irreducible representation of (S N ) n . This space is also a representation of S N via the diagonal embedding into (S N ) n , which maps σ ∈ S N to (σ, σ, . . . , σ) ∈ (S N ) n . As a representation of S N , H λ contains a subrepresentation K λ on which S N acts trivially (this is technically known as the isotropic component of the trivial representation). Methods of representation theory then allow for detailed characterization of K λ . In particular, one obtains the dimension of K λ as [33] The symmetric projection (P + N ) λ in Eq. (E11) is in fact also known as the twirling operator: it maps a vector of H λ to its average under the action of the group S N . A basis of this space can be found by applying the twirling operation (P + N ) λ to a set of k λ random vectors in H λ ; if the resulted vectors are linearly independent, they form a basis of K λ , else one can start over with another random set of vectors. As an alternative method, Eqs. (E11,E12) imply that K λ is the common unit eigenspace of M λ 1 (σ) ⊗ M λ 2 (σ) ⊗ · · · ⊗ M λ n (σ) for all σ ∈ S N . As all eigenvalues of M λ i (σ) are always in the unit circle, a basis of K λ can also constructed from calculating the kernel of where σ s = (ab) and σ c = (ab · · · z) form a set of generators of S N . As another technical remark, working with unitary representation requires computation with cyclotomic numbers, which is often slow. Therefore, one may adjust the procedure by implementing intermediate computations in non-unitary representations (or equivalently, working in non-orthogonal bases) where matrix elements (of the representations of symmetric groups) are all rationals.

Appendix F: Multi-party extension: dual problem and entanglement witness
Specifically for the existence problem of AME states, as Φ AB is uniquely determined, one can easily verify that the following equation is a relaxed but still complete hierarchy of Theorem 2, where Φ AB is the unique quantum state given by Theorem 3. Alternatively, we can write the objective function in the program (F1) as max Φ ABC···Z {0}, such that the dual problem reads min W AB where W AB is Hermitian. One can easily verify that strong duality holds from Slater's condition [20] with positivity considered on the symmetric subspace, which means the problem in Eq. (F1) is feasible if and only if the solution of the dual problem in Eq. (F2) equals zero. Thus, if Tr(W AB Φ AB ) < 0, we know that Φ AB is entangled and the corresponding AME state does not exist from Theorem 3. Notice that numerically determining the negativity of the dual problem (F2) is less sensitive to small numerical errors, and hence, more stable than solving the primal feasibility problem (F1). Moreover, the physical meaning of W AB is also clear: a feasible point W AB of Eq. (F2) with a negative objective value provides an entanglement witness for Φ AB in the symmetric subspace P + 2 = 1 2 (1 AB + V AB ). Indeed, because the set of separable states in P + 2 is given by conv{|ψ ψ| ⊗ |ψ ψ|}, the constraint in Eq. (F2) implies that The analysis of the symmetry and parametrization of the dual problem Eq. (F2) is similar to that for the primal problem as discussed in Appendix E; in fact, it is more straightforward for the dual problem. For g ∈ G defined in Eq. (30), we have In addition, we know that Φ AB and P + N are also in the symmetric subspace P + 2 , i.e., Thus, we can assume that W AB is invariant under G and constrained to P + 2 , i.e., Similar to the analysis of Eq. (33), one can easily see that gW AB g † = W AB for all g ∈ G implying that where again P denotes the sum over all permutations of the tensor product under its argument. Furthermore, P + W AB P + = W AB implies that Hence, the objective function Tr(W AB Φ AB ) can be expressed as where from Eq. (C11).
To get some intuition about the variables w l , let us consider the problem of the existence of AME (4,6). Here n = 4 and hence, there are five variables w l in Eq. (F7). Moreover, Eq. (F8) implies that only three of those variables are independent. Furthermore, one can notice that the dual problem (F2) is homogeneous, that is, the objective function is linear and the constraints are invariant under rescaling W AB → tW AB with t > 0. This allows one to impose that w 0 = 0 or w 0 = ±1, and one is then left with two independent variables. The constraint P + N W AB ⊗ 1 C···Z P + N ≥ 0 can be expressed in terms of the variables w l in similarity to Appendix E. Let us summarize the arguments once more for completeness. The fact that W AB ⊗ 1 C···Z and P + N are both of linear combinations of V σ 1 ⊗ V σ 2 ⊗ · · · ⊗ V σ n implies that they are block-diagonal when one chooses a basis such that the V σ i are block-diagonal. Let H λ i denote the subspace corresponding to the block of V σ i labeled by partition λ i with |λ i | ≤ d. Then H λ = H λ 1 ⊗ H λ 2 ⊗ H λ n denotes the subspace corresponding to a block of V σ 1 ⊗ V σ 2 ⊗ · · · ⊗ V σ n labeled by a tuple of partitions λ = (λ 1 , λ 2 , . . . , λ n ). Moreover, within this subspace, (P + N ) λ is a projection onto the symmetric subspace, which is typically low-rank. Let K λ denote the image of (P + N ) λ and {|Ψ λ i } k λ i=1 denote a basis of K λ . One defines the matrix Y λ as Notice that in computing these matrix elements, we only need the blocks of P + N and W AB ⊗ 1 C···Z corresponding to partitions λ. Then, P + N W AB ⊗ 1 C···Z P + N ≥ 0 is equivalent to Y λ ≥ 0 for all tuples of partitions λ with |λ i | ≤ d. Moreover, since the problem is symmetric under vertical permutations, tuples of partitions λ that are different by a vertical permutation are considered just once.
As a final remark, we can consider the relaxations of the constraints in Eq. (F2). If the optimal value of a relaxed problem is non-negative, we conclude that the optimal value of Eq. (F2) is also non-negative. In particular, ignoring some tuples of partitions λ in the constraints Y λ ≥ 0 corresponds to a relaxation of Eq. (F2). For example, one can consider only λ such that (P + N ) λ is rank-1 and obtain a linear program relaxation of Eq. (F2).
1. The state for the AME(4, 6) problem Let us start by recalling the state presented already in Corollary 4. The state acts on a 6 4 × 6 4 system, where Alice and Bob each own four six-dimensional systems. The state is given by where P ± are the projectors onto the (anti-)symmetric subspace of the 6 × 6 systems. Here, the tensor product denotes the tensor product between the four 6 × 6 systems and P {·} denotes a sum over all permutations of the four copies that give distinct terms; in this case, there are six different terms. Note that the state Φ AB acts on the symmetric subspace only. It is also useful to consider the partial transposition of this state. Let |φ + = (∑ 5 k=0 |kk )/ √ 6 be the maximally entangled state of two six-dimensional systems and define P ⊥ = 1 − |φ + φ + | as the projector onto the corresponding orthogonal subspace. Then, we have This time, the sum over all permutations contains four different terms. Clearly, the separability of Φ AB is equivalent to the separability of Φ T B AB . To test whether or not these states are entangled the following approaches came to our mind: AB has a similarity to the states discussed in Ref. [36]. There, a family of bound entangled states with high Schmidt rank has been constructed. To do so, one considers a bipartite system, where Alice's as well as Bob's system can be further split up into two subsystems, A 1 and A 2 as well as B 1 and B 2 , respectively. Then, one investigates unnormalized states of the form Under weak conditions on X A 1 B 1 and Y A 1 B 1 one can show that Z is a bipartite entangled state with a positive partial transpose. For instance, one may choose X A 1 B 1 = (P ⊥ ) A 1 B 1 and Y A 1 B 1 = (d 1 − 1)(d 2 + 1)|φ + φ + | A 1 B 1 .
Here, d 1 is the dimension of A 1 and B 1 and d 2 the dimension of A 2 and B 2 . For the argument of Ref. [36] it is crucial that these dimensions are different, typically one takes d 2 d 1 .
The entanglement proof for the states in Ref. [36] goes as follows: The map is k-positive, where id(·) denotes the identity map. That is, the output of id ⊗ Λ is always positive on states with Schmidt rank k. A non-positive output by applying this map to the A 2 B 2 part of states of the form in Eq. (G3), i.e., applying id A 1 B 1 A 2 ⊗ Λ B 2 , would indicate that the state has a very high Schmidt rank in the systems A 2 B 2 . The (low-dimensional) systems A 1 B 1 cannot significantly change the Schmidt rank, so the total state must be entangled. This idea can also be formalized by writing down explicit entanglement witnesses [36].
For the state Φ T B AB one can apply similar tricks. For instance, one can split the four subsystems of Alice and Bob in a one-vs-three partition to achieve d 2 d 1 . In this particular case, however, the state is not detected as entangled, the expectation value of the witness from Ref. [36] vanishes. One may also consider further refined splits, as any six-dimensional system can be seen as a (2 × 3)-system. For example, one can split the system such that d 1 = 2 4 = 16 and d 2 = 3 4 = 81. Still, we found no proof of entanglement for Φ T B AB , however, the expectation value for several of the resulting witnesses vanishes.
• Similar states as in Ref. [36] were also considered before in Ref. [37]. There, entanglement witnesses of the form have been investigated. For the purpose of Ref. [37], it was only relevant that for some ε > 0 this operator is indeed positive on all separable states, and it was shown that this holds for nearly arbitrary |ψ 1 and |ψ 2 .
For our purposes, we need to calculate the maximal ε explicitly. If we assume that |ψ 1 and |ψ 2 are maximally entangled states in different dimensions, this can be done as follows: First, we know that W k = k/d 2 − |ψ 2 ψ 2 | is a Schmidt rank-k witness. Second, if we consider a product state |η = |α A 1 A 2 ⊗ |β B 1 B 2 , the unnormalized pure state has at most Schmidt rank d 1 . Combining these observations, we find that W in Eq. (G5) is an entanglement witness if For instance, taking the state Φ T B AB as well as d 1 = 2 and d 2 = 6 3 × 3, one obtains ε = 323. Still, we find Tr(WΦ T B AB ) = 0 and no entanglement is detected.
• As described in Appendix E, we also tested whether or not there exists a symmetric extension for the state Φ AB making use of the symmetries to reduce the number of parameters substantially. However, for large extensions, computing the bases for K λ in Eq. (E12) as well as rephrasing the constraints in terms of the variables in Eq. (E13) takes a considerable amount of time. Moreover, precision issues pose a major challenge due to coefficients being of different order of magnitude. One possible relaxation that simplifies the computation is to consider the second last constraint in the SDP in Eqs. (E1) only for some marginal of the extension. The largest extension we computed reliably is N = 5 while restricting the second last constraint to Φ ABC = Tr DE (Φ ABCDE ). Furthermore, we computed a PPT-extension for N = 3 utilizing the basis from Ref. [38]. Both of these extensions exist up to numerical precision.
• We implemented the dual problem in Eq. (F2) exploiting its symmetry as discussed in Appendix F. Using the linear program relaxation of the problem by means of retaining only partitions λ such that the symmetric projection (P + N ) λ is rank-1 as discussed there, we can show that the optimal values are non-negative up to N = 7. Thus the hierarchy fails to indicate the possible entanglement of Φ AB up to N = 7.
• A final idea could be to start with the symmetric state Φ AB and use the following strategy to prove that the state is entangled: For a multiparticle symmetric state it is known that it is either fully separable or genuine multipartite entangled. This implies that if a multiparticle symmetric state is entangled for one bipartition, it must be entangled for all bipartitions. Hence, proving entanglement for one bipartition can be used to show entanglement for another bipartition, even if the state has a positive partial transpose for the latter bipartition. This trick has been exploited to find symmetric bound entangled states [27]. For the state Φ AB one would need to find an embedding in a multiparticle system, where Φ AB corresponds to some bipartition. This, however, is not straightforward, as the embedding idea from Ref. [27] does not work for bipartite symmetric states with maximal rank.
2. The state for the AME(7, 2) problem For training purposes, it may be useful to consider a state where the separability properties are known. The following state originates from the seven-qubit AME problem, where no AME state exists [13]. It is, however, not easy to see the entanglement of the corresponding state directly, and finding a criterion might also help to decide whether or not there is an AME(4, 6) state.
The states Φ AB and Φ T B AB in Eqs. (G8, G9) are entangled, but we are not aware of any operational entanglement criterion detecting them.

Appendix H: General quantum codes
In general, a quantum ((n, K, m + 1)) d code exists if and only if there exists a K-dimensional subspace Q of H = n i=1 H i = (C d ) ⊗n such that for all |ϕ ∈ Q Tr I c (|ϕ ϕ|) = ρ I ∀ I ∈ I m , where ρ I are marginals that are arbitrary, but independent of |ϕ , I m = {I ∈ [n] | |I| = m}, and I c = [n] \ I = {1, 2, . . . , n} \ I. Similar to the case of pure codes, we can prove the following lemma.

Lemma 11.
A quantum ((n, K, m + 1)) d code exists if and only if there exists a quantum state |Q in H and marginal states ρ I such that where H = H 0 ⊗ H = n i=0 H i = C K ⊗ (C d ) ⊗n and I c is defined as [n] \ I = {1, 2, . . . , n} \ I. If the marginals ρ I are given like in the case of pure codes, the problem reduces to a marginal problem. However, to ensure the existence of ((n, K, m + 1)) d codes, an arbitrary set of marginals is sufficient. This makes the problem no longer a marginal problem, however, we can circumvent this issue by observing that Eq. (H2) is equivalent to for all M 0 such that Tr(M 0 ) = 0. Moreover, we can choose an arbitrary basis B for {M 0 | Tr(M 0 ) = 0, M † 0 = M 0 }. Then, with the result from Ref. [39], we obtain the following theorem, and similar to the AME existence problem, a complete hierarchy can be constructed using the symmetric extension technique.

Theorem 12.
A quantum ((n, K, m + 1)) d code exists if and only if there exists Φ AB in H A ⊗ H B = [C K ⊗ (C d ) ⊗n ] ⊗2 such that Φ AB ∈ SEP, V AB Φ AB = Φ AB , Tr(Φ AB ) = 1, where the SEP means the separability with respect to the bipartition (A|B) = (A 0 A 1 · · · A n |B 0 B 1 · · · B n ), V AB is the swap operator between H A and H B , A I c denotes all subsystems A i for i ∈ I c , and 1 A c 0 denote the identity operator on AB \ A 0 = A 1 A 2 · · · A n B 0 B 1 B 2 · · · B n .
By noticing that the set of ((n, K, m + 1)) d (pure or general) codes, or rather, the set of states |Q , is invariant under local unitaries and permutations on the bodies 123 · · · n, we can assume that Φ AB is invariant under the following two classes of unitaries U 0 ⊗ U 1 ⊗ · · · ⊗ U n ⊗ U 0 ⊗ U 1 ⊗ · · · ⊗ U n ∀ U 0 ∈ SU(K) ∀ U i ∈ SU(d) for i = 1, 2, . . . , n, id 0 ⊗ π ⊗ id 0 ⊗ π ∀ π ∈ S n . (H5) Thus, the symmetrized Φ AB is of the form for x i , y i ∈ R. Hence, all the techniques we developed for AME states can be easily adapted to the quantum error correcting codes. For example, the PPT relaxation can be written as a linear program and the symmetric extension can be written as SDPs.