{'fraction_non_alphanumeric': 0.05032481593763534, 'fraction_numerical': 0.01346903421394543, 'mean_word_length': 3.5038033937975426, 'pattern_counts': {'":': 0, '<': 8, '<?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': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Entanglement of Subspaces and Error Correcting Codes

We introduce the notion of entanglement of subspaces as a measure that quantify the entanglement of bipartite states in a randomly selected subspace. We discuss its properties and in particular we show that for maximally entangled subspaces it is additive. Furthermore, we show that maximally entangled subspaces can play an important role in the study of quantum error correction codes. We discuss both degenerate and non-degenerate codes and show that the subspace spanned by the logical codewords of a non-degenerate code is a 2k-totally (maximally) entangled subspace. As for non-degenerate codes, we provide a mathematical definition in terms of subspaces and, as an example, we analyze Shor's nine qubits code in terms of 22 mutually orthogonal subspaces.


I. INTRODUCTION AND DEFINITIONS
Bipartite entanglement has been recognized as a crucial resource for quantum information processing tasks such as teleportation [1] and super dense coding [2]. As a result, in the last years there has been an enormous effort to understand and study the characterization, manipulation and quantification of bipartite entanglement [3]. Yet, despite a great deal of progress that was achieved, the theory on mixed bipartite entanglement is incomplete and a few central important questions such as the additivity of the entanglement of formation [4] remained open. Perhaps the richness and complexity of mixed bipartite entanglement can be found in the fact that a finite set of measures of entanglement is insufficient to completely quantify it [5]. In this paper we shed some light on mixed bipartite entanglement with the introduction of a new kind of measure of entanglement which we call entanglement of subspaces (EoS). We will see that EoS can play an important role in the study of quantum error correcting codes (QECC).
It has been shown recently [6,7] that geometry of high-dimensional vector spaces can be counterintuitive especially when subspaces with very unique properties are more common than one intuitively expects. That is, roughly speaking, if a high dimensional subspace is selected randomly it is quite likely to have strange properties. For example, in [7] it has been demonstrated that a randomly chosen subspace of a bipartite quantum system will likely contain nothing but nearly maximally entangled states even if the dimension of the subspace is almost of the same order as the dimension of the original system. This kind of result has implications, in particular, to super-dense coding [8] and for quantum communication in general (see also [9] for other implications of randomly Definition 1. Let H A and H B be finite dimensional Hilbert spaces and let W AB be a subspace of H A ⊗ H B . The entanglement of W AB is defined as: where E ψ AB is the entropy of entanglement of ψ AB . Note that if the subspace W AB contains a product state then E(W AB ) = 0. On the other hand, if, for example, W AB is orthogonal to a subspace spaned by an unextendible product basis (UPB) [11,12] then E(W AB ) > 0.
This claim follows from [10] and also related to the fact that the number of (bipartite) states in a UPB is at least [11]. Note that for two qubits (i.e. d A = d B = 2) E(W AB ) can be greater than zero only for one dimensional subspaces. We can use Eq. (1) to define another measure of entanglement on bipartite mixed states. Definition 2. Let ρ ∈ B H A ⊗ H B be a bipartite mixed state and let S AB ρ be the support subspace of ρ. Then, the entanglement of the support of ρ is defined as It can be easily seen that this measure is not continuous and therefore can not be considered as a proper measure of entanglement. Nevertheless, this measure can serve as a mathematical tool to find lower bounds for other measures of entanglement that are more difficult to calculate especially in higher dimensions. For example, the entanglement of the support of ρ provides a lower bound for the entanglement of formation. It can be shown that in lower dimensions the bound is generally not tight. For example, for two qubits in a mixed state ρ, the entanglement of the support E Support (ρ) = 0 (see Eq. (2)). On the other hand, in higher dimensions the bound can be very tight [6,7].

II. ENTANGLEMENT OF SUBSPACES
In this section we study some of the properties of EoS with a focus on additivity properties. The EoS provides a lower bound on the entanglement of formation and our interest in its additivity properties is due to one of the most important unresolved questions in quantum information, namely the additivity conjecture for the entanglement of formation. In particular, the additivity question of EoS is identical to the additivity conjecture of quantum channel output entropy [13] that has been shown to be equivalent to the additivity conjecture of entanglement of formation [4]. Thus, additivity properties of EoS can shed some light on this topic.

A. Additivity properties of the entanglement of subspaces
Here we consider the additivity properties of EoS. We start by showing that if U AB and V A ′ B ′ are two subspaces such that E(U AB ) > 0 and/or E( Consider W = C n ⊗ C m . Let e j , j = 1, ..., n be the standard basis of C n . We will also use the notation f j for the standard basis of C m . An element of a tensor product of two vector spaces, A and B will be called a product if it is of the form a ⊗ b with a ∈ A and b ∈ B. . This means that there exists z ∈ C n ⊗C n and w ∈ C m ⊗C m such that i,k,l (e k ⊗e l ) ⊗(u ik ⊗v il ) = z⊗w.
If we write out z = k,l z kl e k ⊗e l with z kl ∈ C then we must have i u ik ⊗v il = z kl w for all k, l. We now write u ik = m u m ik f m and w = m f m ⊗w m . The displayed formula now implies that This implies that (with k and m fixed) we have il u m ik e l ⊗v il = ( l z kl e l )⊗w m .
Hence i u m ik v i is a product. Our assumption implies that it must be 0. Hence As was to be proved.
Note that the proposition above states that if none of the decompositions of a bipartite mixed state, ρ, contain a product state, then also none of the decompositions of ρ ⊗ σ (σ is a bipartite mixed state) contain a product state. This property is related to the additivity conjecture [4] for the entanglement of formation (and other measures) and one of the main questions that we will consider here is wether the EoS is additive. That is, does Clearly, if the EoS were additive then the proposition above would have been a trivial consequence of that. However, we were not able to prove the additivity of EoS (in general) although for some special cases it has been tested numerically in [14] and no counter example has been found. The proposition below provides a lower bound.
The equation above provides a lower bound whereas the upper bound follows directly from the definition of EoS. Thus, for N = 1 the EoS is additive. Note also that even if N is small (e.g. N = 2), E(U AB ) and E(V A ′ B ′ ) can be arbitrarily large (i.e. depending on d A and d B but not on N ).
Proof. Let χ be a normalized vector in U AB ⊗ V A ′ B ′ . We can write χ in its Schmidt decomposition as follows: 's) are orthonormal. Now, from the strong subadditivity of the von-Neumann entropy we have Hence, since the von-Neumann entropy is concave we have and similarly S(ρ B ) ≥ E U AB . Combining all this we get This complete the proof.

B. Maximally entangled subspaces
As we have seen above, if N = 1 then the EoS is clearly additive. As we will see in the next subsection, it is also additive for maximally entangled subspaces: The term maximally entangled subspace have been used in [6,7] for a subspace W with E(W ) slightly less than log m. In this paper, we will call such subspaces nearly maximally entangled to distinguish from (exactly) maximally entangled subspaces as defined above.
In [15] it has been shown that the average entanglement of a pure state φ ∈ H A ⊗ H B which is chosen randomly according to the unitarily invariant measure satisfies where without loss of generality d A ≥ d B . Later on, in [6,7] this result has been extended to subspaces and in particular it has been shown, somewhat surprisingly, that a randomly chosen subspace of bipartite quantum system will likely be a nearly maximally entangled subspace. Thus, as nearly maximally entangled subspaces are quite common it is important to understand their structure. As a first step in this direction, in the following we study the structure of (exactly) maximally entangled subspaces.
Let φ be a state in H A ⊗H B . If e 1 , ..., e m is an orthonormal basis of H B we may write B is the reduced density matrix). Let λ 1 , ..., λ dB be the set of eigenvalues of B counting multiplicity. Then the entanglement of φ is It is easy to show that E(φ) ≤ log m and equality is attained if and only if B = 1 m P with P a projection matrix onto a d dimensional subspace of C dB . Clearly this definition of entropy is independent of the choice of basis and could also be given using an orthonormal basis of H A and analyzing the corresponding d A coefficients in H B . Under the condition of equality φ is maximally entangled, and this in particular implies that if d A ≥ d B then Conversely, if U 1 , ..., U m are mutually orthogonal subspaces of H A such that dim U j = d > 0 for all j = 1, ..., m and we have unitary operators then U AB is maximally entangled.
Proof. Let ψ 1 , ..., ψ d be an orthonomal basis of U AB . Then we can write Fix l = k and let p = q ≤ d be two integers. Let a = (a 1 , ..., a d ) with a j = 0 for j = p or j = q. Set a p = b, a q = c and |b| 2 + |c| 2 = 1. Then we have bψ lp + cψ lq |bψ kp + cψ kq = 0.
On the other hand we have bψ lp + cψ lq |bψ kp + cψ kq = bc ψ lp |ψ kq + cb ψ lq |ψ kp Set z = bc. We look at two cases: for the first case and for the second. Hence, ψ lp |ψ kq = ψ lq |ψ kp = 0. We set We now consider what happens when l = k. We first note that taking a p = 1 and all other entries equal to 0 we have ψ lp |ψ lp = 1 m . Now using b, c as above for p = q we have Hence as above we find that ψ lp |ψ lq = 0 if p = q. Thus √ mψ l1 , ..., √ mψ ld is an orthonormal basis of U l . This implies that the spaces U 1 , ..., U m have the desired properties. Let u 1 , ..., u d , be the standard orthonormal basis of C d and define T i u j = √ mψ ij . With this notation in place U AB has the desired form. The converse is proved by the obvious calculation.
Furthermore, there always exists a maximally entangled According to the first part of Proposition 4, if U AB is a maximally entangled subspace of dimension d then On the other hand, if d ≤ ⌊d A /d B ⌋ then the second half of the statement implies that there is a maximally entangled subspace of dimension d.
In the following we find necessary and sufficient conditions for a subspace to be maximally entangled. In section III we use this to show that maximally entangled subspaces can play an important role in the study of error correcting codes. As above we consider the space and a maximally entangled subspace U AB ⊂ H A ⊗H B . We will also consider End(H B ) to be a Hilbert space with inner product X|Y = Tr(X † Y ) for any two operators X and Y in End(H B ). Proof. Let d = dim U AB and let the notation be as in Proposition 3. Thus, if U AB is maximally entangled and if e 1 , ..., e dB is an orthonormal basis of H B then an element of U AB is of the form with T i a unitary operator from C d onto a subspace U i of H A and U i and U j are orthogonal for all i = j. We now calculate we have: That is, we proved that if U AB is maximally entangled then the map is an isometry. For the converse we note that we have an isometry of C d onto U AB given by Now, if the map defined in the proposition is an isometry then That is, for all X, Y ∈ End(H B ). Hence, we must have T i (w)|T j (z) = δ ij w|z / and from Proposition 3 the subspace U AB is maximally entangled.

C. Additivity of maximally entangled subspaces
We now discuss the additivity properties of maximally entangled subspaces.
where m ≡ min{d A , d B } and m ′ ≡ min{d A ′ , d B ′ }.

Remark. From the above proposition it follows that
Proof. There are basically two possibilities (up to interchanging factors): the first is In the first case we have as in the statement of proposition 3 the subspaces U j and the unitaries T j : We also have the orthonormal basis f i of H B ′ , the subspaces V j and the unitaries S j : Thus if we identify C d ⊗C d ′ with C dd ′ then the converse assertion in proposition 3 implies that U AB ⊗V A ′ B ′ is a maximally entangled space. This implies that We now consider the second case. For U AB we have exactly as above we denote by f j an orthonormal basis of H A ′ (not of H B ′ as above). Thus, according to proposition 3 we have We will assume first that d where w k are some non-normalized vectors in C d . Furthermore, Hence, if φ is normalized then Now, since S j w ′ k is an orthonormal set of vectors for all j and k (see proposition 3), the entanglement of φ as an element of (H A ⊗H A ′ )⊗(H B ⊗H B ′ ) is given by where B = [ w i |w j ] 1≤i,j≤d ′ , and if λ 1 , ..., λ d ′ are the eigenvalues of B then the von-Neumann entropy of B is The minimum of the entropy for such matrices is This proves the proposition for the case d ′ ≤ d. If d < d ′ then we can prove the proposition by using the same argument, this time with w k an orthonormal basis of C d and with B ′ = w ′ i |w ′ j 1≤i,j≤d . This completes the proof.
The above proposition also shows that the entanglement of formation is additive for bipartite states with maximally entangled support. If ρ is a mixed state in H A ⊗H B then the entanglement of formation is defined in terms of the convex roof extension: where the minimum taken over all decompositions with φ i a pure bipartite state and p i > 0 and p i = 1.

Corollary 7. Let ρ and σ be mixed states in B(H A ⊗H B )
and B(H A ′ ⊗H B ′ ), respectively. If the support subspaces S ρ and S σ are maximally entangled then The proof of this corollary follows directly from the fact that for states with maximally entangled support E F (ρ) = E(S ρ ). Note that the class of mixed states with maximally entangled support is extremely small (i.e. of measure zero). In particular, it is a much smaller class than the one found by Vidal, Dur and Cirac [16] .

A. Definitions
We consider error correcting codes that are used to encode l qubits in n ≥ l qubits in such a way that they can correct errors on any subset of k or fewer qubits. These codes, which we call (n, l, k) error correcting codes, can be classified into two classes (for example see [17]): degenerate and non-degenerate (or orthogonal) codes. We start with a general definition of error correcting codes that is equivalent to the definition given (for example) in [17] , but here we define the codes in terms of subspaces.
The operator X i0i1···i k−1 on ⊗ n C 2 , that represents the errors on the k qubits i 1 , ..., and (c) ⊗ n C 2 is viewed as (⊗ k C 2 ) ⊗ (⊗ n−k C 2 ) (putting together the k tensor factors that correspond to the k qubits i 1 , ..., i k−1 and the rest n − k tensor factors). An (n, l, k) error correcting code is defined from its following ingredients: I. An isometry T : . There are V 1 , ..., V d mutually orthogonal subspaces of ⊗ n C 2 that are also orthogonal to V 0 .
III. For each V j there is a unitary isomorphism, U j , of V j onto V 0 with U 0 = I.
IV. X i0i1···i k−1 V 0 ⊂ ⊕ d j=0 V j . V. Let P j be the ortogonal projection of ⊗ n C 2 onto V j then if v ∈ V 0 is a unit vector and P j (X i0i1···i k−1 v) = 0 then equals v up to a phase.
In the next subsection we study Shor's (9, 1, 1) error correcting code and show that it satisfies this definition. However, before that, let us introduce the notion of ktotally entangled subspaces which will play an important role in our discussion of QECC.

Definition 5.
Let H be the space of n qubits, ⊗ n C 2 . Corresponding to any choice of k qubits (tensor factors) we can consider H = H A ⊗ H B with H A = ⊗ n−k C 2 and H B = ⊗ k C 2 . For k ≤ n/2 we will say that a subspace, V , of H is k-totally entangled if it is maximally entangled relative to every decomposition of H as above.
It is interesting to note that all the subspaces spanned by the logical codewords of the different non-degenerate error correcting codes given in [18,19,20] are 2-totally entangled subspaces. On the other hand, the subspaces spanned by the logical codewords of degenerate codes, like Shor's 9 qubits code, are in general only partially maximally entangled subspaces (i.e. maximally entangled for some choices of k qubits but not for all choices). In the following subsections we will see the reason for that.

B. Analysis of Shor's 9 qubits code
We start with the following notations. We set u ± = 1 √ 2 (|000 ± |111 ) so that the two logical codewords in Shor's 9 qubit code are v + = u + ⊗ u + ⊗ u + and v − = u − ⊗u − ⊗u − . The subspace spanned by these codewords is denoted by V 0 = Cv + ⊕ Cv − . We also denote u 0 ± = (|100 ± |011 )/ √ 2, u 1 ± = (|010 ± |101 )/ √ 2 and u 2 ± = (|001 ± |110 )/ √ 2. Using these notations, we define 21 mutually orthogonal 2 dimensional subspaces orthogonal to V 0 : If X ∈ End(C 2 ) (linear maps of C 2 to C 2 ) then we denote by X i the linear map of ⊗ 9 C 2 to itself that is the tensor product of the identity of C 2 in every tensor factor but the i-th and is X in the i-th factor thus X 0 = X ⊗ I ⊗ I ⊗ I ⊗ I ⊗ I ⊗ I ⊗ I ⊗ I, Then we have (here ⌊x⌋ = max{m|m ≤ x, m ∈ Z}) We choose an observable R with where W is the orthogonal complement of ⊕ 21 i=0 V i and λ i = λ j for i = j and λ i = µ for any i. We define a unitary operator U j : V j → V 0 as follows: we denote the Pauli matrices by and then define U 0 = I, U i = (A 1 ) 3i−1 , for i = 1, 2, 3, U i = (A 2 ) i−4 , for 4 ≤ i ≤ 12 and U i = (A 3 ) i−13 , for 13 ≤ i ≤ 21. This gives an one qubit error correcting code since if v ∈ V 0 is a state and if we have an error in the i-th position then we will have Thus, if we measure the observable R on X i v then the measurement will yield one of λ j with j = 0, ⌊i/3⌋+1, i+4 or i + 13 and X i v will have collapsed up to a phase to U j v; hence applying U j will fix the error.
Remark. Note that the subspace V 0 is not 2-totally entangled subspace. Nevertheless, V 0 has very special properties. In particular, if we group the 9 qubits as (1, 2, 3) : (4, 5, 6) : (7,8,9), then for any choice of 2 qubits that are not from the same group, the subspace V 0 is maximally entangled with respect to the decomposition between the 2 qubits and the rest 7 qubits. If the 2 qubits are chosen from the same group then the entanglement of V 0 with respect to this decomposition is 1ebit. Thus, out of the 36 different decompositions, with respect to 27 of them E(V 0 ) = 2ebits and with respect to the other 9 decompositions E(V 0 ) = 1ebit.

C. Orthogonal codes
We now consider a somewhat more intuitive class of codes known as non-degenerate codes which we also name as orthogonal codes. Definition 6. Let A 0 = I, A 1 , A 2 , A 3 the Pauli basis and define A where 0 ≤ j r ≤ 3 and 0 ≤ i 0 < i 1 < ... < i k−1 ≤ n − 1. Let Σ be the set of distinct operators of the form A j0j1···j k−1 i0i1···i k−1 . Then an orthogonal (n, l, k) code is an (n, l, k) error correcting code such that if we label Σ as the set of d + 1 operators S 0 = I, S 1 , ..., S d then Note that Σ has d + 1 = Proof. Let V be a 2k-totally entangled subspace in H = ⊗ n C 2 , and let X : ⊗ k C 2 → ⊗ k C 2 be a linear map on k qubits. As above, for any i 0 < i 1 < ... < i k−1 (1 ≤ i l ≤ n) we denote by X i0i1...i k−1 the operation X on H, when acting on the k qubits i 0 , i 1 , ...., i k−1 (the rest of the n − k qubits are left "untouched"). Let also Z ≡ {X ∈ End ⊗ k C 2 |TrX = 0} and for any i 0 < ..
We define the subspace That is, W consists of all the possible states after an error on k or less qubits has been occurred. Now, let A 0 = I, A 1 , A 2 , A 3 be an orthonormal basis of End(C 2 ) with A i invertible (e.g. the Pauli basis of 2 × 2 matrices). As in Definition 6, we denote by A j0...j k−1 i0...i k−1 the operator X i0...i k−1 that corresponds to X = A j0 ⊗ · · · ⊗ A j k−1 , and the set of all such operators we denote by Now, let v 1 , ..., v d be an orthonormal basis of V and define We now argue that B is an orthonormal basis of W. Clearly, the vectors in B span W. It is therefore enough to show that the vectors in B are orthogonal. Let Sv i and S ′ v j be two vectors in We denote by H B the Hilbert space of the qubits i 0 , ..., i k−1 and i ′ 0 , ..., i ′ k−1 , and by H A the Hilbert space of the rest of the qubits. Note that H B consists of at most 2k qubits. Now, since V is 2k-totally entangled subspace, it is maximally entangled relative to the decomposition H = H A ⊗ H B . Thus, from Proposition 5 we clearly have where S ≡ I A ⊗S and S ′ ≡ I A ⊗S ′ ; that is,S andS ′ are the projections of S and S ′ onto H B , respectively. Hence, B is an orthonormal basis of W.
Since B is an orthonormal basis we can construct an observable (i.e. Hermition operator) R such that for all v ∈ V R(Sv) = λ S Sv with all of the λ S distinct. We also define R to be zero on the orthogonal complement to W in H. Now, suppose that an element v has been changed by a k-qubit transformation yielding X i0...i k−1 v. We do a measurment of R and since the image is in W the outcome is λ S for some S. After the measurment, the quantum state is Sv and so we recover v by applying S −1 (actually S if we used the Pauli basis). The converse follows from the same lines in the opposite direction. This completes the proof.
Note that Corollary 4 together with the proposition above is consistent with the quantum Singleton bound [22], n ≥ 4k + l, which also follows trivially from the quantum Hamming bound for the case of orthogonal codes that we considered in this subsection.

IV. SUMMERY AND CONCLUSIONS
We introduced the notion of entanglement of subspaces as a measure that quantify the entanglement of bipartite states in a randomly selected subspace. We discussed its properties and suggested that it is additive. We were not able to prove this conjecture (which is equivalent to the additivity conjecture of the entanglement of formation) although some numerical tests [14] supports that and for maximally entangled subspaces we proved that it is additive. We then extended the definition of maximally entangled subspaces into k-totally entangled subspaces and showed that the later can play an important role in the study of quantum error correction codes.
We considered both degenerate and non-degenerate codes and showed that the subspace spanned by the logical codewords of a non-degenerate code is a k-totally (maximally) entangled subspace. This observation, followed by an analysis of the degenerate Shor's nine qubits code in terms of 22 mutually orthogonal subspaces, motivated us to define a general (possible degenerate) error correcting code in terms of subspaces. We believe that further investigation in this direction would lead to a better understanding of degenerate quantum error correcting codes.