Quantum Codes of Maximal Distance and Highly Entangled Subspaces

We present new bounds on the existence of quantum maximum distance separable codes (QMDS): the length $n$ of all non-trivial QMDS codes with local dimension $D$ and distance $d$ is bounded by $n \leq D^2 + d - 2$. We obtain their weight distribution and present additional bounds that arise from Rains' shadow inequalities. Our main result can be seen as a generalization of bounds that are known for the two special cases of stabilizer QMDS codes and absolutely maximally entangled states, and confirms the quantum MDS conjecture in the special case of distance-three codes. As the existence of QMDS codes is linked to that of highly entangled subspaces (in which every vector has uniform $r$-body marginals) of maximal dimension, our methods directly carry over to address questions in multipartite entanglement.


I. INTRODUCTION
The processing of information with quantum particles is inevitably affected by disturbance from the environment. By distributing the information onto many particles, quantum error correcting codes (QECC) can safeguard quantum information from unwanted noise. In this way, a limited amount of corruption or even particle-loss can be tolerated. Since the discovery of quantum error correction [1,2] and the establishment of its theoretical foundations [3][4][5][6], the search for "good" codes with desirable characteristics has been an ongoing endeavor. Both increasingly better-performing codes [7][8][9][10][11][12] as well as stricter bounds imposed upon their existence have been found [13,14].
The quantum Singleton bound can be seen as having its origins in the no-cloning theorem [15,16]. It states that the parameters of any quantum error correction code of distance d, encoding states from C K into a subspace of n systems with local dimensions D each, are bounded by Codes achieving this bound are called quantum maximum distance separable (QMDS) [3,17]. Hugging the fundamental limit of no-cloning, one can expect these codes to have particularly intriguing features. The study of multipartite entanglement has led to the discovery of different types of entanglement that can be shared by three or more quantum particles [18][19][20]. In turn, subspaces whose vectors show interesting entanglement properties have been investigated, such as those showing a bounded Schmidt rank [21], having a negative * felix.huber@icfo.eu † markus.grassl@mpl.mpg.de partial transpose [22], and being completely [23,24] or genuinly entangled [25].
Generalizing the concept of maximal bipartite entanglement, r-uniform states are a particular type of highly entangled pure quantum states: these states exhibit maximal entanglement between any r particles and the rest. Consequently, all of their r-sized marginals are maximally mixed (i.e. uniform). While it is reasonable not to expect an abundance of such states to exist, one might be tempted to ask the following question: given a number n of D-level quantum systems, what is the largest possible subspace in which every state vector is r-uniform? In other words, what is the dimension of the largest possible r-uniform subspace (rUS), and by what methods can this subspace be characterized?
It can be established that the concepts of so-called pure QECC and rUS are in fact equivalent [26]. Consequently, the attainable dimensions of both objects are constrained by the quantum Singleton bound. In this article, we will focus on the case of QECC and rUS achieving this bound, that is, on QMDS codes and their corresponding highly entangled subspaces. All of our results can thus be seen as results concerning both coding and entanglement theory, and we will use methods from quantum error correction to answer questions in multipartite entanglement, and vice versa.
While the quantum Singleton bound was one of the earliest bounds obtained on quantum codes, not much more about the structural properties of QMDS codes is known than what was already obtained by Rains in Ref. [17]. Explicit constructions for stabilizer QMDS codes from classical maximal distance separable codes followed [27][28][29], and QMDS codes were later understood to constitute optimal ramp secret sharing schemes [30].
It turns out that there are stronger constraints for the existence of QMDS codes than their parameters meeting the quantum Singleton bound, the full set of which are not yet known. Similarly, classical MDS codes have been arXiv:1907.07733v1 [quant-ph] 17 Jul 2019 studied for more than half a century, but despite of that, the exact conditions for their existence have not yet been entirely resolved [31,32].
In this article, we obtain two new bounds: first, we prove that for any QMDS code (respectively r-uniform subspace satisfying the Singleton bound) to exist, the following condition has to be met: The result is obtained by a systematic investigation of families of QMDS codes where n + k is constant. Second, we use Rains' shadow inequality to further restrict the allowed parameters in the case of small "alphabets". This can be seen as additional constraints that originate in the monogamy of entanglement [33]. Furthermore, we derive the weight distribution of QMDS codes, a useful tool for the analysis and characterization of codes; it is seen that the weights are solely determined by the parameters of the code. This highlights a surprising correspondence between classical and quantum MDS codes: all quantum MDS codes found to date are constructed through the stabilizer theory, and thus are intrinsically of classical origin. Yet independent of whether or not a given quantum MDS code is indeed a stabilizer code, its weight distribution matches that of its classical MDS counterpart. Hence it is an intriguing question whether or not there exist QMDS codes that do not arise from any classical construction.
The structure of this article is as follows: connections between quantum error correcting codes and highly entangled subspaces are drawn in Sections II and III. Then, Sections IV and V introduce methods that are needed for the proofs that follow: the machinery of quantum weight enumerators and descendence rules for pure codes are presented. Sections VI and VII introduce quantum maximum distance separable codes and the families formed thereof. The weights of QMDS codes are derived in Section VIII. This results in bounds on the existence of QMDS codes (Sections IX and X). The QMDS conjecture is treated in Section XI, before concluding in Section XII. The appendices contain proofs of the quantum Singleton bound and an overview on previous bounds for stabilizer QMDS codes and AME states. This is followed by detailed tables on known QMDS constructions and bounds on their existence for small local dimensions.

II. QUANTUM ERROR CORRECTING CODES
A quantum error correcting code Q = ((n, K, d)) D is a K-dimensional subspace of (C D ) ⊗n such that every error affecting at most d − 1 subsystems can either be detected or acts trivially on the code. As a consequence, a code with distance d ≥ 2t + 1 allows to correct a set of errors that affect up to t subsystems each.
Let us gently introduce some notation to make this precise: denote by {e a } an orthogonal operator basis for C D that includes the identity e 0 = 1, such that tr(e a e b ) = Dδ ab . By taking n-fold tensor products of elements in {e a } we obtain a so-called local error basis {E α } on (C D ) ⊗n satisfying tr(E α E β ) = D n δ αβ . The weight of an error-operator, that is, the number of subsystems it acts non-trivially on, is denoted by wt(E α ) = | supp(E α )|. Finally, let {|i Q } be a set of orthogonal unit vectors spanning Q. Then Π Q = |i Q i Q | is the projector onto the code space.
For Q to be a QECC with minimum distance d, a necessary and sufficient criterion is for to hold for all pairs |i Q , |j Q and errors E α of weight strictly less than d [34]. Note that C(E α ) is a constant that depends on the specific error E α only, but not on the vectors |i Q and |j Q . A code is called pure if C(E α ) = tr(E α )/D n for all E α with wt(E α ) < d. In other words, the constant C of pure codes vanishes for all non-trivial errors that are to be detectable. For notational clarity and slightly departing from the more standard notation, we will write (stabilizer and non-stabilizer) codes where K is an integer-power of D as [[n, k, d]] D ; this corresponds to a code with the parameters ((n, K = D k , d)) D [35]. For one of the proofs that follow, we will also need an entropic condition on quantum error correction: consider the purification of = Π Q /K with a reference system R of dimension K, |φ Q = 1 The von Neumann entropy of a subsystem I is given by where λ i are the eigenvalues of the reduced density matrix I for the subsystem I. For the code to have distance d, a necessary and sufficition is that S RA = S R + S A holds for every subsystem A with |A| < d, that is, the reference system R and the subsystem A are uncorrelated. From the conditions on equality in the strong subadditivity, an equivalent formulation is that RA = R ⊗ A must hold.

III. HIGHLY ENTANGLED SUBSPACES
A pure state |φ , whose reductions onto r parties are all maximally mixed, is termed r-uniform. That is, tr S c (|φ φ|) ∝ 1 for every subset S ⊆ {1, . . . , n} of size |S| ≤ r, where S c denotes its complement. An r-uniform subspace (rUS) is a subspace of (C D ) ⊗n in which every vector is at least r-uniform. In other words, every vector |φ lying in an rUS fulfills for every error operator of support supp(E α ) ⊆ S with |S| < d that (4) Accordingly, |φ is maximally entangled across any bipartition of size r vs. n − r, having the largest possible von Neumann entropy on its reductions.
From the definition of a QECC in Eq. (3), it is not hard to see that a pure code with parameters ((n, K, r + 1)) D implies the existence of an r-uniform subspace of (C D ) ⊗n with dimension K. In fact, the converse statement is also true: the existence of an r-uniform subspace implies that of a pure QECC of distance r + 1. The proof is based on an equivalent condition for a subspace Q to be a QECC, namely that the expectation value is constant for all |φ ranging over the subspace Q and operators E with support on less than d parties. The claim then follows by considering pure codes with C(E α ) = tr(E α )/D n . The equivalence of Eq. (3) and Eq. (5) has already been established, and we sketch the proof [36,37]: expanding |φ in the logical basis {|i Q } and E in a Hermitean error basis {E α }, Eq. (3) implies Eq. (5). The converse can be established by defining the inner product v, w Eα := v| (E α + λ1) |w , and its associated norm and the decomposition of |i Q and |j Q into sum and differences (with and without a complex phase i) of two vectors |ψ , |φ ∈ Q , it is seen that Eq. (5) implies Eq. (3). Therefore, the formulations of Eq. (3) and Eq. (5) are equivalent. Considering these two definitions for the case of pure codes, one arrives at the following observation. Thus the question about the maximal dimension that an r-uniform subspace can attain is one-to-one related to the maximal dimension of pure codes. In what follows we will mostly focus on pure codes, as the corresponding results for uniform subspaces can simply be read off Observation 1.

IV. WEIGHT ENUMERATORS
We will make use of weight distributions in the proofs that follow. They are a useful tool for the characterization of codes and can be employed to determine their distance, as well as to conduct proofs in coding theory. Their knowledge is not required to understand the main result [Proposition 10] of this article (if Theorem 2 is accepted); in that case this section can be skipped.
Given a local error basis {E} with tr(E α E β ) = D n δ αβ , define the Shor-Laflamme weights of a code Q with asso-ciated projector Π Q as [38,39] The sum above is taken over all errors E of weight j in the basis. Note that A j = A j (Π Q ) is simply the Hilbert-Schmidt norm of all correlations in the code that act on exactly j parties non-trivially. Both A j and B j are nonnegative quantities that are invariant under the action of local unitaries U 1 ⊗ · · · ⊗ U n [40], and thus do not depend on the specific orthonormal error basis chosen. We will also need Rains' unitary weights [39], defined as where the sum is over all subsets S ⊆ {1, . . . , n} of size j.
For readers familiar with measures in quantum information, these quantities are proportional to the average purities of suitably normalized reductions of size j and n − j, respectively [41]. From the definition, A j = B n−j . A fine-graining of both types of weights will prove useful for later proofs: These are simply the non-symmetrized versions of Eqs. (7) to (10) for a fixed subset S.
The following facts about the weights of codes are known [39]: necessary and sufficient conditions for a projector Π of rank K to be a QECC of distance d are These conditions can be restated in terms of the unitary enumerators. Because A j and B j are linear functions of the quantities A i and B i with i ≤ j respectively [42], the relations of Eq. (15) are equivalent to Generally, one has that KB j ≥ A j and KB j ≥ A j for all j, while KB 0 = A 0 = K 2 . Analogous relations hold for subsets. Let T be a subset of size less than d. From the conditions for the image of a projector to be a code subspace [Eq. (15)] it follows that KB T = A T , while generally KB S ≥ A S holds [43]. Similarly, it can be seen that KB T = A T holds, while KB S ≥ A S for arbitrary subsets S. (In terms of purities of the normalized projector = Π Q /K, this simply From the definition in Eq. (3), it follows that pure codes are those with A j = 0 [or correspondingly, A j = n j K 2 D −j ] for all 0 < j < d. These are codes whose spanning vectors have maximally mixed (d − 1)-body marginals, and correspond to r-uniform subspaces.

V. NEW CODES FROM OLD
To develop our main results, we need a method with which new codes can be constructed from old ones. This is done by taking partial traces of Π Q .
Theorem 2 (Rains [39]). Let ((n, K, d)) D be a pure code with n, d ≥ 2. Then there exists a pure code Proof. Let the code space be spanned by an orthogonal set of vectors, For simplicity, we normalize the projector onto the code space to a density matrix, = Π Q /K, such that tr( ) = 1. (This is motivated by the fact that stays normalized after application of the partial trace). The code being pure, it follows from Eq. (3) that all marginals of the spanning vectors |i Q on less than d parties must be maximally mixed. Accordingly, the above vectors can for any subset of parties S ⊆ {1, . . . , n} with |S| < d be Schmidt-decomposed as We will now show that after performing a partial trace over parties of some subset V with |V | < d, the operator tr V ( ) forms again (a projector onto) a pure code of distance d − |V | and dimension KD |V | . First, note that the rank of tr V ( ) can be at most KD |V | , while the complementary operator tr V c ( ) is proportional to the identity. Because the reduction onto V is maximally mixed, A V ( ) = 1/D |V | . From the condition in Eq.(18), the complementary reduction must have As the operator tr V ( ) can have a rank of at most D |V | K, it must indeed be proportional to a projector onto a subspace of dimension D |V | K.
In similar manner, we can establish that the code tr V (Π Q ) has a distance of d − |V |. For this we must check the condition in Eq. (18) Does this method of creating new codes from old by partial trace also work for codes that are not pure? It is tempting to think that any given impure code ((n, K, d)) D may yield a ((n−1, K , d−1)) D with K < K ≤ DK. However, this does not seem to be straightforward: consider Shor's code, which is an impure code with parameters ((9, 2, 3)) 2 . A partial trace on the last qubit yields a projector of rank 4, yet it does not form an ((8, 4, 2)) 2 code (such that K = DK), as an analysis of its weight distribution shows [44].

VI. QUANTUM MDS CODES
Let us recall the bound from which the concept of QMDS codes originates, the quantum Singleton bound.
Theorem 3 (Rains [17]). Let Q = [[n, k, d]] D be a QECC. Its parameters are bounded by For a code Q = ((n, K, d)) D with K not necessarily a power of D, the quantum singleton bound reads Two proofs of the quantum Singleton bound are presented in Appendix A.
A code that achieves equality in Eqs. (20) and (21), respectively, [i.e., having parameters ((n, D n−2d+2 , d)) D ] is called a quantum maximum distance separable code (QMDS). The length n of QMDS codes is unbounded for d ≤ 2; these codes are called trivial [45]. From now on, we restrict ourselves to non-trivial QMDS codes, and can make use of n + 2 = k + 2d in all derivations that follow.
It happens that all QMDS codes are pure [17,45]. For this fact we will present a new information theoretic proof which was kindly communicated to us by Andreas Winter [46]. The following lemma on the von Neumann entropy S(J) = S( J ) = − i λ i log(λ i ) of a subsystem J ⊆ {1, . . . , n}, where λ i are the eigenvalues of J , is needed.
Lemma 4 (Winter [46]). Let n ≥ m > . Then The proof can be found in Appendix B.
Proof. Purify the projector Π Q onto the code space with a reference system R of dimension D k . For any bipartition A|B of {1, . . . , n} with sizes |A| = d−1 and |B| = n−d+1, respectively, must hold for Π Q to be a code of distance d [cf. Section II]. Naturally, also where S(A) and S(B) denote the average entropy of subsystems in {1, . . . , n} of sizes d − 1 and n − d + 1, respectively. Making use of Lemma 4, one has that It is interesting to note that Eq. (25) presents a tradeoff, where large values of d/n and k/n go hand in hand with a highly entangled code space.
Quantum maximum distance separable codes being pure, we can extend Observation 1 to the case of subspaces that meet the quantum Singleton bound: Observation 6 (QMDS codes and maximal rUS). The following objects are equivalent: These objects-quantum MDS codes and r-uniform subspaces of maximal dimension-are now the main focus of our attention. All results in the following sections apply to both objects.

VII. QMDS FAMILIES
By Theorem 2, the existence of a QMDS code with distance d leads to a family of QMDS codes with distances d ≤ d (see Fig. 1 is solely determined by the parameter n + k (n + k = 6 in the above example), and we are interested in the highest achievable distanced = (ñ −k)/2 + 1 within any given family.
Note that the reversal of such a chain of codes might not always be possible: for example, the existence of a code [ [8,4,3]] 3 does not imply the existence of a code [ [9,3,4]] 3 . Indeed, a construction for the former is known, whereas the existence of the latter can be excluded (see Section X and Tables I and II in Appendix D). Nevertheless, any QMDS code Q has the characteristics of same-sized reductions of any of its hypothetical parent codesQ: the reductions of Q are proportional to projectors, whose ranks match those of hypothetical reductions ofQ, while forming QECC themselves. This structure of nested projectors makes QMDS codes both attractive from the perspective of coding and entanglement theory, but also non-trivial to construct.
A certain part of the chain of the QMDS codes, consisting of the two top-most codes in any family, can always be reversed.
Proposition 7. The existence of the following two QMDS codes is equivalent: (Note that for these to be QMDS codes, n must necessarily be even).
Proof. ⇒: This direction was established in Theorem 2. ⇐: Let us purify [[n, 1, n/2]] D with the associated projector Π Q = D i=1 |i Q i Q | to a state on n parties, where {|i R } is a basis for the n'th particle. From the conditions in Eq. (18) it follows that for |φ φ| to be a pure code of distance n/2 + 1 it suffices to check that B j (|φ φ|) = A j (|φ φ|) = n j D −j (as K = 1) for all j < n/2 + 1. By partially tracing over any (n/2 − 1) parties of Π Q , we see that this is indeed the case. With Theorem 2, any code Q with parameters [[n − 1, 1, n/2]] D can be reduced to a pure [[n/2, n/2, 1]] D , the latter corresponding to the identity matrix on n/2 particles. Thus every reduction of Π Q = D i=1 |v i v i | Q onto n/2 particles is maximally mixed. Correspondingly, any reduction of |φ of size n/2 that does not include the last particle is maximally mixed. From the Schmidt decomposition for pure states, it follows that any n/2-sized reduction that includes the last particle must then be maximally mixed, too. Thus |φ φ| forms a pure code of dimension 1 and distance n/2 + 1. This completes the proof. While it was previously known that every pure code of dimension D can with the addition of a single Ddimensional system be purified to a rank-one quantum state [39] 3 can be excluded from the methods of Section X (also see Table II in Appendix D). Let us make a small detour to propagation rules for classical codes. From a linear code [n, k, d] q , one can obtain a code [n − 1, k, d − 1] q by an operation called puncturing (deleting one coordinate), and a code [n − 1, k − 1, d] q by shortening (taking an appropriate subcode after deleting one coordinate) [47]. Both operations yield MDS codes when starting with an MDS code. On the other hand, puncturing (i.e. projectively measuring a single subsystem) a quantum code ((n, K, d)) D yields a code ((n − 1, k, d − 1)) D [6]. But even when starting from a QMDS code, the resulting code is, in general, no longer QMDS. The analogue of shortening of quantum codes preserves the property of being a QMDS code, but it is more involved and not always possible. Rains [17] has given a criterium when a stabilizer code [[n − s, k − s, d]] q can be derived from a stabilizer code [[n, k, d]] q by shortening.

VIII. THE WEIGHTS OF QUANTUM MDS CODES
The weights of classical MDS codes are fixed by their parameters [48], and it is natural to ask if a similar result might also hold for their quantum analogue. This is indeed the case.
Proof. From the repeated application of Theorem 2, all reductions of size smaller than or equal to α are proportional to identity. On the other hand, all reductions of size j > α, being pure codes with parameters [[j, 2α − j, j − α + 1]] D , are also proportional to projectors. These, however, have a non-full rank of 2α − j, namely the dimension of their code space. Summing over all reductions of size j and taking into account the normalization tr(Π Q ) = D k yields the claim.
To obtain the Shor-Laflamme weights A j , we make use of the combinatorial version of the Möbius inversion formula (see page 267 in Ref. [49]). Denote by 2 Using Möbius inversion, one can determine the weight distribution of QMDS codes.
Proof. In Eqs. (9) and (13), we defined the fine-grained weights It is straightforward to show that We can accordingly make use of the Möbius inversion [Eq. (30)] to obtain [39], With A j (Π Q ) = |S|=j A S (Π Q ), one obtains the Shor-Laflamme weights for QMDS codes This ends the proof.
Remark. The same result could be obtained by the polynomial transform [39,50] A(x, y) = A (x − y, Dy) where A j x n−j y j .
Let us point out that the weights of an [[n, k, d]] D QMDS code are proportional to those of any n-sized reduction of a hypothetical QMDS parent code [[n + k, 0, n+k 2 + 1]] D [51] (cf. the next section): this hypothetical parent code is represented by a pure state |φ φ| that has all its (n+k)/2body marginals maximally mixed. Accordingly, its j-sized reductions (j) have purity tr[ 2 (j) ] = D − min(j,n+k−j) . Indeed, let Π Q = D k tr V (|φ φ|) with |V | = k be proportional to an n-sized reduction of |φ . Summing over the purities of all its marginals of size j, we obtain the weights of Proposition 8. We conclude that the unitary weights of a QMDS code [[n, k, d]] D are proportional to those of any n-sized reduction tr V |φ φ| with (|V | = k) of a hypothetical [[n + k, 0, n+k 2 ]] D code. This observation motivates the bound on QMDS codes that follows in Section IX. It is of the same type as the one obtained by Scott in Ref. [52] (see Proposition 16 in Appendix C) for the existence of absolutely maximally entangled states.

IX. THE MAXIMAL LENGTH OF QMDS CODES
In this section we derive a new bound for the existence of QMDS codes. Our bound generalizes a result by Ketkar et al. [53] on QMDS stabilizer or additive codes to QMDS codes of any type. It can equally be seen as a generalization of a bound by Scott [52] Proof. Denote by Π Q the projector onto the code space. For convenience we normalize the code to a quantum state = Π Q /D k , such that tr[ ] = 1. Define α = (n + k)/2, and denote by the reduced density matrix of corresponding to the code Q = [[α + 1, α − 1, 2]] D on the first α + 1 parties. Likewise, denote by a reduced density matrix of corresponding to Q = [[α+2, α − 2, 3]] on the first α + 2 parties. By Theorem 2 both Q and Q must be pure, being derived from a pure code Q. Then tr[ 2 ] = D −(α−1) and tr[ 2 ] = D −(α−2) . Since A j = 0 for all 0 < j < α + 1, we can decompose and in the Bloch representation in the following way, where P α+1 , P (i) α+1 and P α+2 only contain terms of weight α + 1, α + 1 and α + 2 respectively. Note that there are α + 2 different terms P (i) α+1 with support on different subsystems in . Also, our normalization is chosen such that Making use of tr[ 2 ] = D −(α−1) leads to Similarly, making use of tr[ 2 ] = D −(α−2) yields, which must be non-negative. Division by (D 2 − 1) leads to D 2 − 1 − α ≥ 0, which can be recast to the bound above. This proofs the claim.

X. SHADOW BOUNDS
Considering absolutely maximally entangled states, stronger bounds on their existence can be made than what is achieved by the bound from Scott [see Proposition 16 in Appendix C] in case their local dimension is small [50]. In a similar spirit, it is possible to constrain the existence of low-dimensional QMDS codes further.
The shadow inequalities state that for any positive semidefinite operators M 1 , M 2 ≥ 0 and T ⊆ {1, . . . , n}, the following family of inequalities hold [39,54]. The shadow inequalities can be seen as a family of monogamy of entanglement relations that constrain the entanglement appearing in the code subspace [33] [55]. In order to use the shadow inequalities to determine the existence of codes, one sets M 1 = M 2 = Π Q and checks the non-negativity of Eq. (47) for all subsets T ⊆ {1, . . . , n}.
Let Q = [[n, k, d]] D be a QMDS code. Then tr S c (Π Q ) 2 = D 2k+min(n+k−|S|,|S|) , in line with the arguments of the proof of Proposition 8. Thus their structure in terms of their unitary invariants is symmetric under permutation of the subsystems. We thus do not forgo by considering a symmetrized version of Eq. (47) only, the coefficients of the so-called shadow enumerator [39,54] S j (Π Q ) = |T c |=j S⊆{1,...,n} Above, K m ( , n) is the Krawtchouk polynomial defined as Remark. The same result can be obtained by the polynomial transform [39,50] S(x, y) = A (x + y, y − x) where S(x, y) = n j=0 S j x n−j y j , A (x, y) = n j=0 A j x n−j y j .
We now can state the following corollary for the special case of QMDS codes.
Corollary 11. Let [[n, k, d]] D be a QMDS code. The following expression must be non-negative for all j in 0 ≤ j ≤ n, Generally, the constraints imposed by Eqs. (47) and (48) do not seem to give rise to simple closed-form expressions on the existence or minimum distance of codes. In the case of a binary alphabet however, the constraints yield the following bounds (cf. Theorem 9 in Ref. [56] and Theorem 13.4.1 in Ref. [57]): the minimum distance of codes ((n, 1, d)) 2 is bounded by d ≤ 2 n 6 + 3 if n = 5 mod 6; 2 n 6 + 2 otherwise , whereas the minimum distance of codes ((n, K, d)) 2 with K > 1 is bounded by 6 + 2 if n = 4 mod 6; 2 n+1 6 + 1 otherwise .
As done for the case of AME states in Ref. [50], it is possible to evaluate Corollary 11 numerically for any QMDS code having small enough parameters. This leads to new bounds on the existence of QMDS codes in dimensions D ≤ 5, see Appendix D.

XI. QMDS CONJECTURE
The following conjecture regarding QMDS codes is of interest. It follows from the classical MDS conjecture, and thus concerns itself with QMDS codes of stabilizer type only.
Conjecture 12 (QMDS Conjecture, Cor. 65 in Ref. [53]). With exception of [[D 2 + 2, D 2 − 4, 4]] D with D = 2 m where n ≤ D 2 + 2 (cf. Thm. 14 in Ref. [28]), the length of all stabilizer QMDS codes with d ≥ 3 is bounded by The strongest confirmation of the classical MDS conjecture was proven in a seminal work by Ball, which showed that the conjecture is true for linear q-ary codes when q is prime [32].
Indeed, our bound (Proposition 10) constrains the length of QMDS codes for distance d = 3 to n ≤ D 2 + 1, confirming the QMDS Conjecture for this choice of distance. For d = 4, our bound can be met when D = 2 m (Thm. 14 in Ref. [28]). In general, however, Conjecture 12 is still unresolved for d > 3.
From the bound in Proposition 10 it is seen that QMDS codes with distance d ≥ 3 can only exist if n + k ≤ 6 for qubits, n + k ≤ 16 for qutrits, n + k ≤ 30 for ququarts, and n+k ≤ 48 in the case of local dimension D = 5. Thus for qubits, no other non-trivial QMDS codes exist apart from the known stabilizer codes having the parameters [ [6,0,4]] stab 2 and [ [5,1,3]] stab 2 . In the case of qutrits, only seven QMDS families exist; for five of these, the optimal parent code has already been found (see Table II).

XII. CONCLUSIONS
It is readily seen that quantum maximum distance separable (QMDS) codes must correspond to subspaces in which every unit vector shows maximal entanglement across all bipartitions where the smaller partition has size (d − 1). The question under what conditions such codes exist is thus not only relevant in coding theory, but also for the study of multipartite entanglement.
Interestingly, all QMDS codes can be grouped into QMDS families whose members can be regarded as being obtained by partial trace from a (possibly hypothetical) parent code of larger length and distance. Since all descendents within a QMDS family form codes of smaller distance themselves, their spectra are completely determined by the parameters of their parent code. This insight completely determines the weight enumerator of QMDS codes. It also leads to a bound applicable to all (stabilizer and non-stabilizer) QMDS codes, extending results known for the special cases of stabilizer QMDS codes and absolutely maximally entangled states. Moreover, the application of Rains' shadow inequalities yields additional non-existence results.
While non-stabilizer (also called non-additive) QMDS codes of distance two do exist [59,Thm. 7], all nontrivial QMDS codes (and thus highly entangled subspaces) seem to be of the stabilizer type. They are, by their connection to classical codes over F D 2 , thus of classical origin. It is an open question if this must be generally the case, or if constructions that do not originate in concepts from classical coding theory can be found: the Singleton bound is independent of the local dimension D, and one cannot expect it to be particularly strong. However, if the Singleton bound can be met, classical codes are in all known cases origin of the corresponding optimal quantum codes and highly entangled subspaces. Hence it is intriguing that hitherto no genuine "quantum" constructions have been found that surpass their classical counterparts for these types of codes.
A interesting aspect seen here is that "optimal" codes that show a largest possible distance must necessarily also exhibit the highest possible bipartite entanglement amongst the constituent particles. One can readily expect a trade-off to be present, where large values of k/n and d/n necessarily go hand in hand with a highly entangled code space, whereas lowly entangled subspaces can only yield low values. Indeed, such a trade-off can be seen in Eq. (25), quantified by the average entropy of entanglement. A precise understanding of this trade-off might pave the way to derive stronger bounds on the performance of quantum codes, and could possibly help to explain the distance scalings found in low-density parity check codes [9].
To conclude, QMDS codes present themselves as a rich playground: they form nested subspaces that are highly entangled and prove to be a testing ground for our understanding of multipartite entanglement. The discovery of further monogamy relations as well as entropic and rank inequalities would likely find an immediate application in stronger bounds on the existence of these ideal quantum objects.

XIII. ACKNOWLEDGMENTS
We thank Daniel Alsina and Simeon Ball for fruitful discussions, and Andreas Winter for kindly communicating his proof. FH thanks David Gross and Otfried Gühne for their support, during which significant part of this work was carried out. This work was supported by the Swiss We present two known proofs for the quantum Singleton bound below.
Theorem 13 (Quantum Singleton bound [15,17]). Let ((n, K, d)) D be a QECC. Its parameters are bounded by Proof 1: Rains, Thm. 2 in Ref. [17]. Let us first show that 2(d − 1) ≤ n. Assume that 2(d − 1) > n and consider K = 1: by convention, codes with K = 1 are only considered codes if they are pure, and thus must have tr S c |φ φ| ∝ 1 for all |S| < d. From the Schmidt decomposition however it is seen that it is impossible that marginals of size n 2 + 1 are of full rank, and thus 2(d − 1) ≤ n. Consider now K > 1: in terms of the unitary weight enumerators, the conditions for a projector Π Q to be a QECC subspace read KB j (Π Q ) = A j (Π Q ) for all j < d [Eq. (18)]. Also recall that by definition A j = B n−j . If 2(d − 1) > n, one thus requires that both and, due to n − (d − 1) < (d − 1), also that leading to a contradiction also for K > 1. Consequently, 2(d − 1) ≤ n. With the decompositions from Eq. (16), one has that but also [60] With n−i n−d+1 = n−i d−1−i , the quantum Singleton bound follows from the analysis of Consider the coefficient A i for 0 ≤ i < d.
Note that because n − d + 1 ≥ d − 1 as established previously. If K > D n−2(d−1) > 1, the expression (A7) must be nonnegative due to A i ≥ 0, and it is furthermore strictly positive in the case of i = 0 due to A 0 = K. Consequently Eq. (A7) can only vanish if at least K ≤ D n−2(d−1) . This proofs the claim.
Proof 2: Cerf & Cleve [15]. For this proof we only consider the case K > 1. Then the distance must be bounded by 2(d − 1) ≤ n, for if not, two copies of the encoded state could be recovered each from reductions of size n − (d − 1) < d − 1, violating the no-cloning theorem. Let Π Q = K i=1 |v i v i | be the projector onto the code space. The purification with a reference system R leads to, where |i R is any orthonormal basis for R. Recall that the von Neumann entropy is defined as S( ) = − tr log . Let us partition the code into the three subsystems A, B, C, such that |A| = |B| = d−1 and |C| = n−2(d−1). Then S R = S(tr ABC [ ]) = log(K). As the code has distance d, any subsystem of size strictly smaller than d cannot reveal anything about the reference system R: indeed the condition of RA = R ⊗ A is known to be a necessary and sufficient condition for the subsystem A to be correctable [61]; this is also equivalent to S RA = S R + S A . With the subadditivity of the von Neumann entropy, namely S 12 ≤ S 1 + S 2 , this leads to where we used that the entropies of complementary subsystems are equal for a pure state. The combination of the above two inequalities yields log(K) = S R ≤ S C ≤ log dim(H C ) = log D n−2(d−1) . This proofs the claim.
A third proof of the quantum Singleton bound using auxiliary polynomial functions can be found in Ref. [62].

Appendix B: Entropy Lemma
Lemma 14 (Winter [46]). Let n ≥ m > . Then where the equality follows from the fact that the state on the entire system X 1 . . . X n R is pure, and the inequality follows from strong subadditivity. The repeated application of Eq. (B2) yields This completes the proof.
Appendix C: QMDS stabilizer codes and AME states In order to set the bound appearing in Section IX, Proposition 10 into context, we shortly state the previously known bounds on stabilizer and largest-distance QMDS codes.
Stabilizer codes are constructed from Abelian subgroups of nice error bases not containing a non-trivial multiple of the identity [63]. The following is known on the maximal length of stabilizer QMDS codes. (C1) A pure state |φ n,D of n parties with local dimension D each is called absolutely maximally entangled (AME), if maximal entanglement is present across every bipartition. Consequently, all its reductions to half of its parties are maximally mixed. AME states are pure codes with parameters [[n, 0, n 2 + 1]] D . If n is even, these states are the top-most member of a QMDS family, reaching the largest distance allowed by the quantum Singleton bound. They are then are also known as perfect tensors. Scott obtained the following bound on the existence of absolutely maximally entangled states.
Proposition 16 (Maximal length of AME states, Eq. 44 in Ref. [52]). Let |φ n,D be an absolutely maximally entangled state of n ≥ 4 parties of local dimension D each. Then n ≤ 2(D 2 − 1) if n is even; 2D(D + 1) − 1 if n is odd . (C2) Thus for n even, Proposition 16 is indeed a bound on the existence of QMDS codes that have k = 0.

Appendix D: Known constructions and Tables
We list parameters of some known QMDS constructions in Table I. Tables II to IV report on the highest distances within a QMDS family that are not excluded by our bounds, as well as on the parameters that can be reached by known constructions. All upper bounds listed arise from the shadow inequalities (Corollary 11). For local dimensions D > 5, these constraints do not seem to be stronger than those of Proposition 10, and thus our tables only include codes up to D = 5.
Should the upper and lower bound meet, the corresponding code is optimal and specifies its QMDS family completely; these entries are marked by * . Since all currently known non-trivial constructions are stabilizer codes, we omit marking them with stab in the tables.