## Introduction

For a given multiparticle quantum state $$\left|\varphi \right\rangle$$ 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 entanglement1, and it was recognized as a central problem in quantum chemistry2. 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 principle3,4. A variation of the marginal problem is the question of whether or not the marginals determine the global state uniquely or not5,6,7. This is relevant in condensed matter physics, where one may ask whether a state is the unique ground state of a local Hamiltonian8,9. Many other cases, such as marginal problems for Gaussian and symmetric states10,11 and applications in quantum correlation12, quantum causality13, and interacting quantum many-body systems14,15 have been studied.

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 protocols16,17, 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 found18,19,20,21. 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 exist22,23,24. More generally, the construction of quantum error-correcting codes, which constitute fundamental building blocks in the design of quantum computer architectures25,26,27, essentially amounts to the identification of subspaces of 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 theory28.

In this paper, we rewrite the marginal problem as an optimization problem over separable states. Here and in the following, the term marginal problem usually refers to the pure state marginal problem in quantum mechanics. This rewriting allows us to transform the nonconvex and thus intractable purity constraint into 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 (SDP), 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. There are at least two advantages of writing the marginal problem as an SDP hierarchy: First, the symmetry in the physical problem can be directly incorporated to drastically simplify the optimization (or feasibility) problem. Second, many known efficient and reliable algorithms are known for solving SDPs29, which is in stark contrast to nonconvex optimization. To show the effectiveness of our method, we consider the existence problem of AME states. By employing the symmetry, we show 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 us to reproduce nearly all previous results on the AME problem30 with only few lines of calculation. Finally, we show that our approach can also be extended to study the existence problem of quantum codes.

## Results

### Connecting the marginal problem with the separability problem

The formal definition of the marginal problem is the following: Consider an n-particle Hilbert space $${\mathcal{H}}={\bigotimes }_{i = 1}^{n}{{\mathcal{H}}}_{i}$$, and let $${\mathcal{I}}\subset \{I| I\subset [n]=\{1,2,\ldots ,n\}\}$$ be some subsets of the particles, where the reduced states ρI are known marginals. Then, the problem reads

$$\begin{array}{ll}{\rm{find}}\ \quad &\left|\varphi \right\rangle\hfill \\ {\rm{s.t.}}\ &{{\rm{Tr}}}_{{I}^{c}}(\left|\varphi \right\rangle \left\langle \varphi \right|)={\rho }_{I},\,I\in {\mathcal{I}}.\end{array}$$
(1)

Here, Ic = [n]I denotes the complement of the set I. Before explaining our approach, two facts are worth mentioning: First, if the global state $$\left|\varphi \right\rangle \left\langle \varphi \right|$$ is not required to be pure, then the quantum marginal problem without purity constraint is already an SDP. Second, if the given marginals are only one-body marginals, that is $${\mathcal{I}}=\{\{i\}| i\in [n]\}$$, the marginals are non-overlapping and the problem in Eq. (1) was solved by Klyachko31. For overlapping marginals, however, the solution is more complicated, and this is what we want to discuss in this work.

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 $${\mathcal{C}}$$ be the set of global states (not necessarily pure) that are compatible with the marginals, i.e.,

$${\mathcal{C}}=\{\rho | \rho \ge 0,\,{{\rm{Tr}}}_{{I}^{c}}(\rho)={\rho }_{I}\quad{\rm{\forall }}\,I\in {\mathcal{I}}\}.$$
(2)

Then, we define $${{\mathcal{C}}}_{2}$$ to be the convex hull of two copies of the compatible states

$${{\mathcal{C}}}_{2}={\rm{conv}}\{\rho \otimes \rho | \rho \in {\mathcal{C}}\}=\left\{\sum _{\mu }{p}_{\mu }{\rho }_{\mu }\otimes {\rho }_{\mu }| {\rho }_{\mu }\in {\mathcal{C}}\right\},$$
(3)

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 relation32

$${\rm{Tr}}({V}_{AB}{\rho }_{A}\otimes {\rho }_{B})={\rm{Tr}}({\rho }_{A}{\rho }_{B}),$$
(4)

where ρA and ρB are arbitrary quantum states, and VAB is the swap operator between parties A and B, i.e.,

$${V}_{AB}=\sum _{i,j}\left|j,i\right\rangle \left\langle i,j\right|,$$
(5)

which acts on a state $${{{\Phi }}}_{AB}={\sum }_{i,j}{\omega }_{ijkl}\left|i,j\right\rangle \left\langle k,l\right|$$ as $${V}_{AB}{{{\Phi }}}_{AB}={\sum }_{i,j}{\omega }_{ijkl}\left|j,i\right\rangle \left\langle k,l\right|$$. For a state ΦAB in $${{\mathcal{C}}}_{2}$$ this implies that

$${\rm{Tr}}({V}_{AB}{{{\Phi }}}_{AB})=\sum _{\mu }{p}_{\mu }{\rm{Tr}}({\rho }_{\mu }^{2})\le 1.$$
(6)

Furthermore, equality in Eq. (6) is attained if and only if all ρμ are pure states. This leads to our first key observation: there exists a pure state in $${\mathcal{C}}$$ if and only if $$\mathop{\max }\nolimits_{{{{\Phi }}}_{AB}\in {{\mathcal{C}}}_{2}}{\rm{Tr}}({V}_{AB}{{{\Phi }}}_{AB})=1$$.

What remains to be done is the characterization of the set $${{\mathcal{C}}}_{2}$$, then we can formulate the quantum marginal problem as an optimization problem over this set. This can be done by taking advantage of the separability property32 of the states in $${{\mathcal{C}}}_{2}$$ with respect to the bipartition (AB).

Theorem 1 There exists a pure quantum state $$\left|\varphi \right\rangle$$ that satisfies $${{\rm{Tr}}}_{{I}^{c}}(\left|\varphi \right\rangle \left\langle \varphi \right|)={\rho }_{I}$$ for all $$I\in {\mathcal{I}}$$ if, and only if, the solution of the following convex optimization is equal to one,

$$\mathop{\max }\limits_{{{{\Phi }}}_{AB}}\ {\rm{Tr}}({V}_{AB}{{{\Phi }}}_{AB})$$
(7)
$${\rm{s.t.}}\ {{{\Phi }}}_{AB}\in {\rm{SEP}},\,{\rm{Tr}}({{{\Phi }}}_{AB})=1,$$
(8)
$${{\rm{Tr}}}_{{A}_{{I}^{c}}{B}_{{I}^{c}}}({{{\Phi }}}_{AB})={\rho }_{I}\otimes {\rho }_{I}\quad{\rm{\forall }} I\in {\mathcal{I}},$$
(9)

where SEP denotes the set of separable states w.r.t. the bipartition (AB), $${A}_{{I}^{c}}$$ denotes all subsystems Ai for iIc, and similarly for $${B}_{{I}^{c}}$$.

Proof On the one hand, if there exists a pure state $$\left|\varphi \right\rangle \left\langle \varphi \right|\in {\mathcal{C}}$$, one can easily verify that $${{{\Phi }}}_{AB}=\left|\varphi \right\rangle \left\langle \varphi \right|\otimes \left|\varphi \right\rangle \left\langle \varphi \right|$$ satisfies the constraints in Eqs. (8) and (9) as well as $${\rm{Tr}}({V}_{AB}{{{\Phi }}}_{AB})=1$$.

On the other hand, if the solution of Eq. (7) is equal to one, then the separability constraint and Eq. (6) imply that ΦAB must be of the form33

$${{{\Phi }}}_{AB}=\sum _{\mu }{p}_{\mu }|{\psi }_{\mu }\rangle \langle {\psi }_{\mu }|\otimes |{\psi }_{\mu }\rangle \langle {\psi }_{\mu }|.$$
(10)

Writing $${{\rm{Tr}}}_{{I}^{c}}(|{\psi }_{\mu }\rangle \langle {\psi }_{\mu }|)={\sigma }_{I}^{(\mu)}$$, the constraint in Eq. (9) implies that

$$\sum _{\mu }{p}_{\mu }{\sigma }_{I}^{(\mu)}\otimes {\sigma }_{I}^{(\mu)}={\rho }_{I}\otimes {\rho }_{I}\quad{\rm{\forall }} I\in {\mathcal{I}}.$$
(11)

Without loss of generality, we assume that all pμ are strictly positive and we want to show that all $${\sigma }_{I}^{(\mu)}={\rho }_{I}$$, which will imply that each $$|{\psi }_{\mu }\rangle$$ is a pure state with the desired marginals. Let X be any Hermitian matrix such that $${\rm{Tr}}(X{\rho }_{I})=0$$, then Eq. (11) and the relation $${\rm{Tr}}[(X\otimes X)(\sigma \otimes \sigma)]={[{\rm{Tr}}(X\sigma)]}^{2}$$ imply that

$$\sum _{\mu }{p}_{\mu }{\left[{\rm{Tr}}\left(X{\sigma }_{I}^{(\mu)}\right)\right]}^{2}={[{\rm{Tr}}(X{\rho }_{I})]}^{2}=0.$$
(12)

By noting that $${\rm{Tr}}(X{\sigma }_{I}^{(\mu)})$$ are real numbers, we get that $${\rm{Tr}}(X{\sigma }_{I}^{(\mu)})=0$$, for all μ and all X such that $${\rm{Tr}}(X{\rho }_{I})=0$$. Thus, all $${\sigma }_{I}^{(\mu)}$$ are proportional to ρI and, together with $${\rm{Tr}}({\rho }_{I})={\rm{Tr}}({\sigma }_{I}^{(\mu)})=1$$, this implies that $${\sigma }_{I}^{(\mu)}={\rho }_{I}$$ for all μ.

Before proceeding further, we would like to add a few remarks. First, in Theorem 1 the constraint in Eq. (9) can be replaced by a stronger condition

$${{\rm{Tr}}}_{{A}_{{I}^{c}}}({{{\Phi }}}_{AB})={\rho }_{I}\otimes {{\rm{Tr}}}_{A}({{{\Phi }}}_{AB})\quad{\rm{\forall }} I\in {\mathcal{I}}.$$
(13)

This is because for any (not necessarily separable) quantum state ΦAB satisfying $${\rm{Tr}}({V}_{AB}{{{\Phi }}}_{AB})=1$$, Eq. (13) implies the validity of Eq. (9). Hence, this replacement will lead to an equivalent result as in Theorem 1. However, when considering relaxations of the optimization in Eq. (7) by replacing the separability constraint in Eq. (8) with some entanglement criteria, Eq. (13) may be strictly stronger for certain marginal problems.

Second, if one finds that $${\rm{Tr}}({V}_{AB}{{{\Phi }}}_{AB})=1$$, this is equivalent to VABΦAB = ΦAB, as the largest eigenvalue of VAB 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

$${\rm{find}}\ \quad {{{\Phi }}}_{AB}\in {\rm{SEP}}$$
(14)
$${\rm{s.t.}}\ \quad {V}_{AB}{{{\Phi }}}_{AB}={{{\Phi }}}_{AB},\,{\rm{Tr}}({{{\Phi }}}_{AB})=1,$$
(15)
$${{\rm{Tr}}}_{{A}_{{I}^{c}}}({{{\Phi }}}_{AB})={\rho }_{I}\otimes {{\rm{Tr}}}_{A}({{{\Phi }}}_{AB})\,\quad{\rm{\forall }}\,I\in {\mathcal{I}}.$$
(16)

Furthermore, any feasible state ΦAB can be used for constructing the global state $$\left|\varphi \right\rangle$$ with the desired marginals, as the proof of Theorem 1 implies any pure state in the separable decomposition of ΦAB can give a desired global state.

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) criterion34,35, 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 criterion36, we propose a multi-party extension method and obtain a complete hierarchy for the marginal problem.

### The hierarchy for the marginal problem

In order to generalize Theorem 1, we first need to extend $${{\mathcal{C}}}_{2}$$ in Eq. (3) from two to an arbitrary number of copies of ρ. That is, we define $${{\mathcal{C}}}_{N}={\rm{conv}}\{{\rho }^{\otimes N}| \rho \in {\mathcal{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 $${{\mathcal{H}}}^{\otimes N}:={{\mathcal{H}}}_{A}\otimes {{\mathcal{H}}}_{B}\otimes \cdots \otimes {{\mathcal{H}}}_{Z}$$, the symmetric subspace is defined as

$$\left\{\left|{{\Psi }}\right\rangle \in {{\mathcal{H}}}^{\otimes N}\,\left|\right.\,{V}_{{{\Sigma }}}\left|{{\Psi }}\right\rangle =\left|{{\Psi }}\right\rangle \quad{\rm{\forall }}{{\Sigma }}\in {S}_{N}\right\},$$
(17)

where SN 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 $${{\mathcal{H}}}^{\otimes N}$$. $${P}_{N}^{+}$$ can be explicitly written as

$${P}_{N}^{+}=\frac{1}{N!}\sum _{{{\Sigma }}\in {S}_{N}}{V}_{{{\Sigma }}}.$$
(18)

In particular, for two parties we have the well-known relation $${P}_{2}^{+}=({{\Bbb{1}}}_{AB}+{V}_{AB})/2$$, which implies that $${\rm{Tr}}({V}_{AB}{{{\Phi }}}_{AB})=1$$ if and only if $${\rm{Tr}}({P}_{2}^{+}{{{\Phi }}}_{AB})=1$$. Also, VABΦAB = ΦAB is equivalent to $${P}_{2}^{+}{{{\Phi }}}_{AB}{P}_{2}^{+}={{{\Phi }}}_{AB}$$. 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 $$\rho \in {\mathcal{C}}$$. It is easy to see that ΦABZ = ρN satisfies

$${P}_{N}^{+}{{{\Phi }}}_{AB\cdots Z}{P}_{N}^{+}={{{\Phi }}}_{AB\cdots Z},$$
(19)
$${{{\Phi }}}_{AB\cdots Z}\in {\rm{SEP}},\,{\rm{Tr}}({{{\Phi }}}_{AB\cdots Z})=1,$$
(20)
$${{\rm{Tr}}}_{{A}_{{I}^{c}}}({{{\Phi }}}_{AB\cdots Z})={\rho }_{I}\otimes {{\rm{Tr}}}_{A}({{{\Phi }}}_{AB\cdots Z})\quad{\rm{\forall }} I\in {\mathcal{I}}.$$
(21)

Here, the separability can be understood as either full separability or biseparability, since they are equivalent in the symmetric subspace33. Relaxing ΦABZ SEP, we obtain a complete hierarchy for the quantum marginal problem:

Theorem 2 There exists a pure quantum state $$\left|\varphi \right\rangle$$ that satisfies $${{\rm{Tr}}}_{{I}^{c}}(\left|\varphi \right\rangle \left\langle \varphi \right|)={\rho }_{I}$$ for all $$I\in {\mathcal{I}}$$ if and only if for all N ≥ 2 there exists an N-party quantum state ΦABZ such that

$${P}_{N}^{+}{{{\Phi }}}_{AB\cdots Z}{P}_{N}^{+}={{{\Phi }}}_{AB\cdots Z},$$
(22)
$${{{\Phi }}}_{AB\cdots Z}\ge 0,\,{\rm{Tr}}({{{\Phi }}}_{AB\cdots Z})=1,$$
(23)
$${{\rm{Tr}}}_{{A}_{{I}^{c}}}({{{\Phi }}}_{AB\cdots Z})={\rho }_{I}\otimes {{\rm{Tr}}}_{A}({{{\Phi }}}_{AB\cdots Z})\quad{\rm{\forall }}I\,\in {\mathcal{I}}.$$
(24)

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 the “Methods” section. 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. Indeed, taking advantage of symmetries is usually necessary for practical applications, because the general quantum marginal problem is QMA-complete37,38. Notably, even for non-overlapping marginals, despite recent progress in refs. 39,40,41, it is still an open problem whether there exists a polynomial-time algorithm. In the following, we illustrate how symmetry can drastically simplify quantum marginal problems with the existence problem of AME states.

### Absolutely maximally entangled states

We first recall the definition of AME states. An n-qudit state $$\left|\psi \right\rangle$$ is called an AME state, denoted as AME(n, d), if it satisfies

$${{\rm{Tr}}}_{{I}^{c}}(\left|\psi \right\rangle \left\langle \psi \right|)=\frac{{{\Bbb{1}}}_{{d}^{r}}}{{d}^{r}}\quad{\rm{\forall }}\,I\in {{\mathcal{I}}}_{r},$$
(25)

where $${{\mathcal{I}}}_{r}=\{I\subset [n]| \left|I\right|=r\}$$ and r = n/2. Thus, Eq. (14) implies that an AME(n, d) exists if and only if the following problem is feasible,

$${\rm{find}}\ {{{\Phi }}}_{AB}\in {\rm{SEP}}$$
(26)
$${\rm{s.t.}}\ {\rm{Tr}}({{{\Phi }}}_{AB})=1,\,{V}_{AB}{{{\Phi }}}_{AB}={{{\Phi }}}_{AB},$$
(27)
$${{\rm{Tr}}}_{{A}_{{I}^{c}}}({{{\Phi }}}_{AB})=\frac{{{\Bbb{1}}}_{{d}^{r}}}{{d}^{r}}\otimes {{\rm{Tr}}}_{A}({{{\Phi }}}_{AB})\quad{\rm{\forall }}\,I\in {{\mathcal{I}}}_{r}.$$
(28)

Direct evaluation of the problem is usually difficult, because the dimension of ΦAB is d2n × d2n, 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 $${\mathcal{X}}$$ denotes the set of ΦAB that satisfies the constraints in Eqs. (26), (27), and (28). If we find a unitary group G such that for all gG and $${{{\Phi }}}_{AB}\in {\mathcal{X}}$$ we have that

$$g{{{\Phi }}}_{AB}{g}^{\dagger }\in {\mathcal{X}}.$$
(29)

Then, the convexity of $${\mathcal{X}}$$ implies that we can add a symmetry constraint to the constraints in Eqs. (26), (27), and (28), namely,

$$g{{{\Phi }}}_{AB}{g}^{\dagger }={{{\Phi }}}_{AB}\quad{\rm{\forall }} g\in G.$$
(30)

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. (29),

$${U}_{1}\otimes \cdots \otimes {U}_{n}\otimes {U}_{1}\otimes \cdots \otimes {U}_{n}\,\quad{\rm{\forall }}{U}_{i}\in SU(d),$$
(31)
$$\pi \otimes \pi \quad{\rm{\forall }}\,\pi \in {S}_{n},$$
(32)

where π = π(A1, A2, …, An) = π(B1, B2, …, Bn) denotes the permutation operators on $${{\mathcal{H}}}_{A}$$ and $${{\mathcal{H}}}_{B}$$. Note that the Ui in Eq. (31) can be different.

First, let us view VAB and ΦAB as V12…n and Φ12…n, where i labels the subsystems AiBi. Hereafter, without ambiguity, we will omit the subscripts of

$${\Bbb{1}}:={{\Bbb{1}}}_{{d}^{2}},\quad V:={V}_{{A}_{i}{B}_{i}},$$
(33)

for simplicity. From this perspective, VAB can be written as Vn, and the symmetries in Eqs. (31) and (32) can be written as $${\bigotimes }_{i = 1}^{n}({U}_{i}\otimes {U}_{i})$$ for UiSU(d) and Π = Π(A1B1, A2B2, …, AnBn) for Π Sn, respectively. According to Werner’s result32, a (UU)-invariant Hermitian operator must be of the form $${\alpha }{\Bbb{1}}+{\beta }V$$ with $$\alpha ,\beta \in {\Bbb{R}}$$. This implies that a $$\left[{\bigotimes }_{i = 1}^{n}({U}_{i}\otimes {U}_{i})\right]$$-invariant state must be a linear combination of operators of the form

$$\bigotimes _{i = 1}^{n}({\alpha }_{i}{\Bbb{1}}+{\beta }_{i}V)\quad{\rm{\forall }}\,{\alpha }_{i},{\beta }_{i}\in {\Bbb{R}}.$$
(34)

In addition, we take advantage of the permutation symmetry under Π Sn to write any invariant ΦAB as

$${{{\Phi }}}_{AB}=\mathop{\sum }\limits_{i=0}^{n}{x}_{i}{\mathcal{P}}\{{V}^{\otimes i}\otimes {{\Bbb{1}}}^{\otimes (n-i)}\},$$
(35)

where $${\mathcal{P}}$$ represents the sum over all possible permutations that give different terms, e.g., $${\mathcal{P}}\{V\otimes {\Bbb{1}}\otimes {\Bbb{1}}\}=V\otimes {\Bbb{1}}\otimes {\Bbb{1}}+{\Bbb{1}}\otimes V\otimes {\Bbb{1}}+{\Bbb{1}}\otimes {\Bbb{1}}\otimes V$$.

Inserting this ansatz in Eqs. (27) and (28) one can show by brute force calculation that the xi are uniquely determined and given by

$${x}_{i}=\frac{{(-1)}^{i}}{{({d}^{2}-1)}^{n}}\mathop{\sum }\limits_{l=0}^{n}\mathop{\sum }\limits_{k=0}^{l}\frac{{(-1)}^{l}({{i}\atop {k}})({{n-i}\atop {l-k}})}{\min \{{d}^{i+2l-2k},{d}^{n+i-2k}\}},$$
(36)

where we use the convention that $$({{i}\atop {j}})=0$$ when j < 0 or j > i; see Supplementary Note 1 for details. This means that the two-party extension under the symmetries is independent of the specific AME state, which is an interesting structural result considering that there exist even infinite families of AME(n, d) states that are not SLOCC equivalent42. Together with Theorem 1, this result implies that an 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 operator ΦAB defined by Eqs. (35) and (36) is a separable state w.r.t. the bipartition (AB) = (A1A2AnB1B2Bn).

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

$${{{\Phi }}}_{AB}=\mathop{\sum }\limits_{i=0}^{n}{p}_{i}{\mathcal{P}}\left\{{P}_{+}^{\otimes (n-i)}\otimes {P}_{-}^{\otimes i}\right\},$$
(37)

and $${{{\Phi }}}_{AB}^{{T}_{B}}$$ can be written as

$${{{\Phi }}}_{AB}^{{T}_{B}}=\mathop{\sum }\limits_{i=0}^{n}{q}_{i}{\mathcal{P}}\left\{{P}_{\phi }^{\otimes (n-i)}\otimes {P}_{\perp }^{\otimes i}\right\},$$
(38)

where

$${P}_{\pm }=\frac{1}{2}({\Bbb{1}}\pm V),\,{P}_{\phi }=\left|{\phi }^{+}\right\rangle \left\langle {\phi }^{+}\right|,\,{P}_{\perp }={\Bbb{1}}-{P}_{\phi },$$
(39)

with $$\left|{\phi }^{+}\right\rangle =\frac{1}{\sqrt{d}}\mathop{\sum }\nolimits_{k = 1}^{d}\left|k\right\rangle \left|k\right\rangle$$. Here pi and qi are the eigenvalues of ΦAB and $${{{\Phi }}}_{AB}^{{T}_{B}}$$, respectively. Then, we can simplify the positivity condition ΦAB ≥ 0 and the PPT condition $${{{\Phi }}}_{AB}^{{T}_{B}}\ge 0$$ to

$$\mathop{\sum }\limits_{l=0}^{n}\mathop{\sum }\limits_{k=0}^{l}\frac{{(-1)}^{k}({{i}\atop {k}})({{n-i}\atop {l-k}})}{\min \{{d}^{l},{d}^{n-l}\}}\ge 0,$$
(40)
$$\mathop{\sum }\limits_{k=0}^{i}\frac{{(-1)}^{k}({{i}\atop {k}})}{\min \{{d}^{2(n+k-i)},{d}^{n}\}}\ge 0,$$
(41)

for all i = 0, 1, 2, …, n. Note that the latter inequality is trivial for i ≤ r.

The explicit form of pi and qi and the proof of the conditions in Eqs. (40) and (41) are shown in Supplementary Note 2. The positivity and PPT conditions can already rule out the existence of many AME states. Actually, they can reproduce all the known nonexistence results30 except AME(7, 2)20. To get a higher-order approximation, we provide a general framework for performing the symmetric extension in Supplementary Notes 3 and 4.

As the open problem of the existence of AME(4, 6) is of particular interest in the quantum information community28,43, we explicitly express it as the following corollary.

Corollary 1 An AME(4, 6) state exists if and only if the quantum state

$${{{\Phi }}}_{AB}=\frac{1}{2\cdot {6}^{4}}\left(\frac{{P}_{+}^{\otimes 4}}{343}+\frac{{\mathcal{P}}\left\{{P}_{+}^{\otimes 2}\otimes {P}_{-}^{\otimes 2}\right\}}{315}+\frac{{P}_{-}^{\otimes 4}}{375}\right),$$
(42)

is separable, or equivalently,

$${{{\Phi }}}_{AB}^{{T}_{B}}=\frac{1}{{6}^{4}}\left({P}_{\phi }^{\otimes 4}+\frac{{\mathcal{P}}\left\{{P}_{\phi }\otimes {P}_{\perp }^{\otimes 3}\right\}}{3{5}^{2}}+\frac{33{P}_{\perp }^{\otimes 4}}{3{5}^{3}}\right),$$
(43)

is separable w.r.t. bipartition (AB).

At the moment, we are unable to decide separability of these states; in Supplementary Note 5 we provide a short discussion of this problem.

### 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 codes44 in the text; see “Methods” for the general case. Our starting point is the fact that pure quantum codes are closely related to m-uniform states18. More precisely, an ((n, K, m+1))d pure code exists if and only if there exists a K-dimensional subspace $${\mathcal{Q}}$$ of $${\mathcal{H}}={\bigotimes }_{i = 1}^{n}{{\mathcal{H}}}_{i}={({{\Bbb{C}}}^{d})}^{\otimes n}$$ such that all states in $${\mathcal{Q}}$$ are m-uniform, i.e., for all $$\left|\varphi \right\rangle \in {\mathcal{Q}}$$

$${{\rm{Tr}}}_{{I}^{c}}(\left|\varphi \right\rangle \left\langle \varphi \right|)=\frac{{{\Bbb{1}}}_{{d}^{m}}}{{d}^{m}}\quad{\rm{\forall }}\,I\in {{\mathcal{I}}}_{m},$$
(44)

where $${{\mathcal{I}}}_{m}=\{I\in [n]| \left|I\right|=m\}$$ and Ic = [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 $${{\mathcal{H}}}_{0}={{\Bbb{C}}}^{K}$$ and let $$\widetilde{{\mathcal{H}}}={{\mathcal{H}}}_{0}\otimes {\mathcal{H}}={\bigotimes }_{i = 0}^{n}{{\mathcal{H}}}_{i}={{\Bbb{C}}}^{K}\otimes {({{\Bbb{C}}}^{d})}^{\otimes n}$$. Now, we can write the existence of ((n, K, m+1))d pure codes as a marginal problem on $$\widetilde{{\mathcal{H}}}$$.

Lemma 1 A quantum ((n, K, m+1))d pure code exists if and only if there exists a quantum state $$\left|Q\right\rangle$$ in $$\widetilde{{\mathcal{H}}}$$ such that

$${{\rm{Tr}}}_{{I}^{c}}(\left|Q\right\rangle \left\langle Q\right|)=\frac{{{\Bbb{1}}}_{K{d}^{m}}}{K{d}^{m}}\quad{\rm{\forall }}\,I\in {{\mathcal{I}}}_{m},$$
(45)

where Ic 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 $${\mathcal{Q}}$$ exists. We define an entangled state $$\left|Q\right\rangle$$ in $${{\mathcal{H}}}_{0}\otimes {\mathcal{Q}}\subset \widetilde{{\mathcal{H}}}$$ as

$$\left|Q\right\rangle =\frac{1}{\sqrt{K}}\mathop{\sum }\limits_{k=1}^{K}\left|k\right\rangle \left|{k}_{L}\right\rangle ,$$
(46)

where $${\{\left|k\right\rangle \}}_{k = 1}^{K}$$ and $${\{\left|{k}_{L}\right\rangle \}}_{k = 1}^{K}$$ are orthonormal bases for $${{\mathcal{H}}}_{0}$$ and $${\mathcal{Q}}$$, respectively. Then for any pure state $$\left|a\right\rangle$$ in $${{\mathcal{H}}}_{0}$$, $$\sqrt{K}\left\langle a| Q\right\rangle \in {\mathcal{Q}}$$. Hence, Eq. (44) implies that

$${{\rm{Tr}}}_{0}[{{\rm{Tr}}}_{{I}^{c}}(\left|a\right\rangle \left\langle a\right|\otimes {{\Bbb{1}}}_{{d}^{n}}\left|Q\right\rangle \left\langle Q\right|)]=\frac{{{\Bbb{1}}}_{{d}^{m}}}{K{d}^{m}}\quad{\rm{\forall }}\,I\in {{\mathcal{I}}}_{m},$$
(47)

for all $$\left|a\right\rangle$$ in $${{\mathcal{H}}}_{0}$$, which in turn implies Eq. (45).

To prove the sufficiency part, let $${\mathcal{Q}}$$ be the space generated by the pure states $$\left|{\varphi }_{a}\right\rangle =\sqrt{K}\left\langle a| Q\right\rangle$$ for all $$\left|a\right\rangle$$ in $${{\mathcal{H}}}_{0}$$. Then, Eq. (45) implies that all $$\left|{\varphi }_{a}\right\rangle$$ are m-uniform states. Furthermore, from $${\rm{rank}}({{\rm{Tr}}}_{0}(\left|Q\right\rangle \left\langle Q\right|))={\rm{rank}}({{\rm{Tr}}}_{12\cdots n}(\left|Q\right\rangle \left\langle Q\right|))={\rm{rank}}({{\Bbb{1}}}_{K}/K)=K$$ it follows that $${\mathcal{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.

Proposition 1 A quantum ((n, K, m+1))d pure code exists if and only if there exists ΦAB in $${\widetilde{{\mathcal{H}}}}_{A}\otimes {\widetilde{{\mathcal{H}}}}_{B}={[{{\Bbb{C}}}^{K}\otimes {({{\Bbb{C}}}^{d})}^{\otimes n}]}^{\otimes 2}$$ such that

$${{{\Phi }}}_{AB}\in {\rm{SEP}},\,{V}_{AB}{{{\Phi }}}_{AB}={{{\Phi }}}_{AB},\,{\rm{Tr}}({{{\Phi }}}_{AB})=1,$$
(48)
$${{\rm{Tr}}}_{{A}_{{I}^{c}}}({{{\Phi }}}_{AB})=\frac{{{\Bbb{1}}}_{K{d}^{m}}}{K{d}^{m}}\otimes {{\rm{Tr}}}_{A}({{{\Phi }}}_{AB})\quad{\rm{\forall }}\,I\in {{\mathcal{I}}}_{m},$$
(49)

where SEP denotes the set of separable states w.r.t. the bipartition (AB) = (A0A1AnB0B1Bn), VAB is the swap operator between $${\widetilde{{\mathcal{H}}}}_{A}$$ and $${\widetilde{{\mathcal{H}}}}_{B}$$, and $${A}_{{I}^{c}}$$ denotes all subsystems Ai for iIc.

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. (45) implies that $$K{d}^{m}\le \sqrt{K{d}^{n}}$$, as $${\rm{rank}}({{\rm{Tr}}}_{{I}^{c}}(\left|Q\right\rangle \left\langle Q\right|))\le \sqrt{\dim (\widetilde{{\mathcal{H}}})}$$. This provides a simple proof for the quantum Singleton bound44,45 K ≤ dn−2m for pure codes.

## Discussion

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 us 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 insights into 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 theory28. 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.

## Methods

Proof of Theorem 2. To prove Theorem 2, we take advantage of the following lemma, which can be viewed as a special case of the quantum de Finetti theorem46.

Lemma 2 Let ρN be an N-party quantum state in the symmetric subspace $${P}_{N}^{+}$$, then there exists a k-party quantum state

$${\sigma }_{k}=\sum _{\mu }{p}_{\mu }|{\psi }_{\mu }\rangle {\langle {\psi }_{\mu }|}^{\otimes k},$$
(50)

i.e., a fully separable state in $${P}_{k}^{+}$$, such that

$$\left\|{{\rm{Tr}}}_{N-k}({\rho }_{N})-{\sigma }_{k}\right\|\le \frac{4kD}{N},$$
(51)

where $$\left\|\cdot \right\|$$ 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 sufficiency part, i.e., that the existence of an N-party quantum state ΦABZ for arbitrary N implies the existence of $$\left|\varphi \right\rangle$$. Let $${{{\Phi }}}_{AB}^{N}={{\rm{Tr}}}_{C\cdots Z}({{{\Phi }}}_{ABC\cdots Z})$$, then $${{{\Phi }}}_{AB}^{N}$$ satisfies

$${\rm{Tr}}({{{\Phi }}}_{AB}^{N})=1,\quad {{\rm{Tr}}}_{{A}_{{I}^{c}}}({{{\Phi }}}_{AB}^{N})={\rho }_{I}\otimes {{\rm{Tr}}}_{A}({{{\Phi }}}_{AB}^{N})\quad{\rm{\forall }}\,I\in {\mathcal{I}}.$$
(52)

Further, Lemma 7 implies that there exist separable states $${\widetilde{{{\Phi }}}}_{AB}^{N}$$ such that

$${V}_{AB}{\widetilde{{{\Phi }}}}_{AB}^{N}={\widetilde{{{\Phi }}}}_{AB}^{N},$$
(53)
$$\left\|{{{\Phi }}}_{AB}^{N}-{\widetilde{{{\Phi }}}}_{AB}^{N}\right\|\le \frac{8D}{N}.$$
(54)

As the set of quantum states for any fixed dimension is compact, we can choose a convergent subsequence $${{{\Phi }}}_{AB}^{{N}_{i}}$$ of the sequence $${{{\Phi }}}_{AB}^{N}$$. Thus, Eq. (54) implies that

$${{{\Phi }}}_{AB}:=\mathop{\mathrm{lim}}\limits_{i\to +\infty }{{{\Phi }}}_{AB}^{{N}_{i}}=\mathop{\mathrm{lim}}\limits_{i\to +\infty }{\widetilde{{{\Phi }}}}_{AB}^{{N}_{i}}.$$
(55)

Thus, Eqs. (52) and (53) and the fact that the set of separable states is closed imply that ΦAB satisfies all constraints in Eqs. (14), (15), and (16). Then, Theorem 2 follows directly from Theorem 1.

### General quantum codes

In general, a quantum ((n, K, m+1))d code exists if and only if there exists a K-dimensional subspace $${\mathcal{Q}}$$ of $${\mathcal{H}}={\bigotimes }_{i = 1}^{n}{{\mathcal{H}}}_{i}={({{\Bbb{C}}}^{d})}^{\otimes n}$$ such that for all $$\left|\varphi \right\rangle \in {\mathcal{Q}}$$

$${{\rm{Tr}}}_{{I}^{c}}(\left|\varphi \right\rangle \left\langle \varphi \right|)={\rho }_{I}\quad{\rm{\forall }}I\in {{\mathcal{I}}}_{m},$$
(56)

where ρI are marginals that are arbitrary but independent of $$\left|\varphi \right\rangle$$, $${{\mathcal{I}}}_{m}=\{I\in [n]| \left|I\right|=m\}$$, and Ic = [n]I = {1, 2, …, n}I. Similar to the case of pure codes, we can prove the following lemma.

Lemma 3 A quantum ((n, K, m+1))d code exists if and only if there exists a quantum state $$\left|Q\right\rangle$$ in $$\widetilde{{\mathcal{H}}}$$ and marginal states ρI such that

$${{\rm{Tr}}}_{{I}^{c}}(\left|Q\right\rangle \left\langle Q\right|)=\frac{{{\Bbb{1}}}_{K}}{K}\otimes {\rho }_{I}\quad{\rm{\forall }}\,I\in {{\mathcal{I}}}_{m},$$
(57)

where $$\widetilde{{\mathcal{H}}}={{\mathcal{H}}}_{0}\otimes {\mathcal{H}}={\bigotimes }_{i = 0}^{n}{{\mathcal{H}}}_{i}={{\Bbb{C}}}^{K}\otimes {({{\Bbb{C}}}^{d})}^{\otimes n}$$ and Ic 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. (57) is equivalent to

$${{\rm{Tr}}}_{0}[({M}_{0}\otimes {{\Bbb{1}}}_{I}){{\rm{Tr}}}_{{I}^{c}}(\left|Q\right\rangle \left\langle Q\right|)]=0\quad{\rm{\forall }}\,I\in {{\mathcal{I}}}_{m},$$
(58)

for all M0 such that $${\rm{Tr}}({M}_{0})=0$$. Moreover, we can choose an arbitrary basis $${\mathcal{B}}$$ for $$\{{M}_{0}| {\rm{Tr}}({M}_{0})=0,\,{M}_{0}^{\dagger }={M}_{0}\}$$. Then, with the general result on rank-constrained optimization from ref. 47, we obtain the following theorem, and similar to the AME existence problem, a complete hierarchy can be constructed using the symmetric extension technique.

Proposition 2 A quantum ((n, K, m+1))d code exists if and only if there exists ΦAB in $${\widetilde{{\mathcal{H}}}}_{A}\otimes {\widetilde{{\mathcal{H}}}}_{B}={[{{\Bbb{C}}}^{K}\otimes {({{\Bbb{C}}}^{d})}^{\otimes n}]}^{\otimes 2}$$ such that

$${{{\Phi }}}_{AB}\in {\rm{SEP}},\ {V}_{AB}{{{\Phi }}}_{AB}={{{\Phi }}}_{AB},\ {\rm{Tr}}({{{\Phi }}}_{AB})=1,$$
(59)
$${{\rm{Tr}}}_{{A}_{0}}{{\rm{Tr}}}_{{A}_{{I}^{c}}}[({M}_{{A}_{0}}\otimes {{\Bbb{1}}}_{{A}_{0}^{c}}){{{\Phi }}}_{AB}]=0,$$
(60)

for all $$I\in {{\mathcal{I}}}_{m}$$ and $${M}_{{A}_{0}}\in {\mathcal{B}}$$, where the SEP means the separability with respect to the bipartition (AB) = (A0A1AnB0B1Bn), VAB is the swap operator between $${\widetilde{{\mathcal{H}}}}_{A}$$ and $${\widetilde{{\mathcal{H}}}}_{B}$$, $${A}_{{I}^{c}}$$ denotes all subsystems Ai for iIc, and $${{\Bbb{1}}}_{{A}_{0}^{c}}$$ denote the identity operator on ABA0 = A1A2AnB0B1B2Bn.

By noticing that the set of ((n, K, m+1))d (pure or general) codes, or rather, the set of states $$\left|Q\right\rangle$$, 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}\otimes {U}_{1}\otimes \cdots \otimes {U}_{n}\otimes {U}_{0}\otimes {U}_{1}\otimes \cdots \otimes {U}_{n},$$
(61)
$${{\rm{id}}}_{0}\otimes \pi \otimes {{\rm{id}}}_{0}\otimes \pi .$$
(62)

for all U0SU(K), UiSU(d), and πSn. Thus, the symmetrized ΦAB is of the form

$${{{\Phi }}}_{AB}= \;{{\Bbb{1}}}_{{K}^{2}}\otimes \mathop{\sum }\limits_{i=0}^{n}{x}_{i}{\mathcal{P}}\{{V}^{\otimes i}\otimes {{\Bbb{1}}}^{\otimes (n-i)}\}\\ +{V}_{{A}_{0}{B}_{0}}\otimes \mathop{\sum }\limits_{i=0}^{n}{y}_{i}{\mathcal{P}}\{{V}^{\otimes i}\otimes {{\Bbb{1}}}^{\otimes (n-i)}\},$$
(63)

for $${x}_{i},{y}_{i}\in {\Bbb{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.