Self-testing maximally-dimensional genuinely entangled subspaces within the stabilizer formalism

Self-testing was originally introduced as a device-independent method of certification of entangled quantum states and local measurements performed on them. Recently, in [F. Baccari \textit{et al.}, arXiv:2003.02285] the notion of state self-testing has been generalized to entangled subspaces and the first self-testing strategies for exemplary genuinely entangled subspaces have been given. The main aim of our work is to pursue this line of research and to address the question how"large"(in terms of dimension) are genuinely entangled subspaces that can be self-tested, concentrating on the multiqubit stabilizer formalism. To this end, we first introduce a framework allowing to efficiently check whether a given stabilizer subspace is genuinely entangled. Building on it, we then determine the maximal dimension of genuinely entangled subspaces that can be constructed within the stabilizer subspaces and provide an exemplary construction of such maximally-dimensional subspaces for any number of qubits. Third, we construct Bell inequalities that are maximally violated by any entangled state from those subspaces and thus also any mixed states supported on them, and we show these inequalities to be useful for self-testing. Interestingly, our Bell inequalities allow for identification of higher-dimensional face structures in the boundaries of the sets of quantum correlations in the simplest multipartite Bell scenarios in which every observer performs two dichotomic measurements.


I. INTRODUCTION
Nonlocality, or the existence of correlations that violate Bell inequalities, is one of the most characteristic features of quantum theory [1]. Initially studied as an indicator of impossibility of describing quantum correlations in terms of local-realistic models, later nonlocality has been turned into a powerful resource for certain applications such as for instance device-independent certification. Indeed, nonlocality generated by an unknown quantum system allows one to make nontrivial statements about this system. For instance, observation of nonlocal correlations in an unknown quantum system can be used to certify in a device-independent way its dimension [2], that it is entangled [3], and that the outcomes of quantum measurements performed on it are truly random [4,5].
Interestingly, it turns out that in certain situations the observed nonlocal correlations enable, basically complete, characterization of the quantum system under study along with quantum measurements performed on it. This strongest form of device-independent certification is referred to as selftesting [6,7] (see also the recent review [8]), and due to its utility certification of quantum systems it has attracted much attention in recent years. Device-independent certification strategies have been designed for various quantum states [9,10,12,13] and/or quantum measurements [14,15]. Extensions of self-testing to other scenarios featuring nonclassical effects have also been studied, such as the steering scenario [16], the prepare-and-measure scenario [17], or the contextuality scenario [18][19][20].
Very recently, in Ref. [22] a definition of self-testing of entangled subspaces has been put forward as a natural generalization of state self-testing, and self-testing schemes for genuinely entangled subspaces obtained within the stabilizer formalism were provided such as the one corresponding to the well-known toric code [23]. Our main aim here is to pursue this research direction and address one of questions Ref. [22] leaves open, namely, what is the maximal dimension of a genuinely entangled subspace that can be self-tested from maximal violation of Bell inequalities. For simplicity here we focus on subspaces that can be obtained within the stabilizer formalism. To reach our goal, we first introduce a simple and efficient way of checking whether a given stabilizer subspace is genuinely multipartite entangled. Building on it, we then establish what is the maximal dimension of a genuinely entangled subspace within the stabilizer formalism proving the conjecture posed recently in Ref. [24], and present an exemplary construction of such maximally-dimensional subspaces for any number of qubits. Third, we show that each such subspace can be self-tested from maximal violation of a multipartite Bell inequality constructed with the aid of the approach presented in Refs. [22,25]. We finally use these Bell inequalities to identify nontrivial faces in the boundaries of the sets of quantum correlations in the simplest Bell scenarios involving two dichotomic observables per observer.
It should be noticed that this work is basically a publication version of Ref. [38] with a few modifications and additions such as the construction of GME subspaces presented in Sec. III B along with the associated Bell inequalities presented in Appendix B. Also, the proof contained in Sec. VII is a significantly improved version of that presented in Ref. [38].

II. PRELIMINARIES
Before presenting our results we first introduce some notions and terminology used throughout our work. We begin with the notion of genuine multipartite entanglement, and then move to Bell scenarios and the stabilizer formalism. A reader familiar with these notions can skip this section.
(1) Genuinely entangled subspaces. Let us consider N spatially separated parties P i and assume that they share some pure quantum state |ψ belonging to a product Hilbert space where the local Hilbert space H Pi corresponds to party P i and we assume it to be finite-dimensional. Consider then a partition of N observers into two disjoint groups Q and Q such that Q ∪ Q = {1, . . . , N } and denote it Q|Q. We call such a bipartition nontrivial if both sets Q and Q are nonempty. We say that |ψ is entangled across Q|Q if it cannot be written as |ψ = |ψ Q ⊗ |ψ Q for some pure states |ψ Q and |ψ Q supported on Q and Q, respectively. We then call |ψ genuinely multipartite entangled (GME) if it is entangled across any nontrivial bipartition Q|Q.
Consider then a notrivial subspace V ⊂ H P . Following Ref. [21] we call V genuinely multipartite entangled (or, shortly, genuinely entangled) if all pure states belonging to it are genuinely multipartite entangled. The notion of genuinely entangled subspaces is a natural multipartite generalization of the notion of completely entangled subspaces introduced in the bipartite case [26,27]. A well-known example of such a genuinely entangled subspace in ( 2 ) ⊗3 is the one spanned by the three-qubit Greenberger-Horne-Zeilinger (GHZ) state and the W states It is not difficult to verify that for any α, β ∈ such that |α| 2 + |β| 2 = 1, the state α|GHZ 3 + β|W 3 is genuinely entangled.
(2) The Bell scenario. Let us now assume that the parties P i share a mixed state ρ acting on H P and that each party on their subsystem of ρ can freely choose to measure one of two quantum observables A If this procedure is repeated sufficiently many times, the parties can estimate the collection of expectation values with i 1 < i 2 < . . . , < i k , k = 1, . . . , N and i j = 1, . . . , N .
In what follows we denote this collection by P and refer to it as to correlations or behaviour. It is worth adding here that in the considered scenario all correlations obtained by performing measurements on quantum states form a convex set which we denote Q N . Later in Sec. VII we identify faces in the boundaries of Q N . We say that the correlations P are nonlocal if they cannot be reproduced by any local hidden variable model, or, equivalently, if they violate Bell inequalities whose most general form in the considered scenario is where all α i1,...,i k xi 1 ,...,xi k ∈ Ê and β c is the maximal value of the Bell expression I N over all local deterministic correlations, that is, those for which all expectation values are product and each A (i k ) xi k = ±1. A simple example of a Bell inequality is the one due to Clauser, Horne, Shimony and Holte, typically referred to as CHSH Bell inequality [28]. It is defined in the bipartite scenario (N = 2) and reads The maximal quantum value of the CHSH Bell inequality is 2 √ 2 and is achieved by the two-qubit maximally entangled state |ψ + 2 = (1/ √ 2)(|00 + |11 ) and the following observables and A (2) 0 = X and A (2) 1 = Z, where X and Z are the well known Pauli matrices. It is worth noting that after plugging these into the CHSH Bell expression the resulting Bell operators is a sum of the stabilizing operators X ⊗ X and Z ⊗ Z of |ψ + 2 . Later we exploit this observation when constructing our Bell inequalities maximally violated by entangled subspaces.
Let us finally stress that nonlocality is the key resource making the device-independent verification and certification possible: the observers are able to make nontrivial statements about functioning of their devices only if they observe quantum nonlocality [1].
(3) Stabilizer formalism. Let X, Y , Z be the Pauli matrices and G N denote the Pauli group on N qubits which consists of N -fold tensor products of X, Y , Z or ½ 2 with the overall factors ±1 or ±i, where by ½ 2 we denote the 2 × 2 identity matrix.
Let us consider a subgroup S of G N generated by k independent elements of G N , denoted G i with i = 1, . . . , k. Such a subgroup is called stabilizer if it stabilizes a nontrivial subspace V in ( 2 ) ⊗N , that is, for any |ψ ∈ V . In what follows we refer to a subspace stabilized in the above sense as stabilizer subspace. Importantly, not every subgroup of G N stabilizes a nontrivial subspace; for instance, X ⊗X and −X ⊗X generate a subgroup that stabilizes no subspace because it contains −½ ⊗2 2 . It turns out that a necessary and sufficient condition for a subgroup S to stabilize a nontrivial subspace is that it is Abelian (or, equivalently, that all generators G i mutually commute), and that −½ ⊗N 2 / ∈ S (see Ref. [29]). Let us notice here that, as proven below, it actually suffices to satisfy the second condition in order for S to stabilize a nontrivial subspace.
Proof. Assume that there is a pair of generators G i , G j which do not commute, [G i , G j ] = 0. Due to the definition of G N it is not difficult to see that they must anticommute, Consider then a product G i G j G i G j . Taking into account Eq. (10) it can be rewritten as are ruled out by the assumption), and therefore which contradicts the assumption.
The dimension of a subspace stabilized by a subgroup satisfying these conditions is a simple function of the number of its generators k as well as the number of qubits N : D N,k = 2 N −k ; the number of elements of the stabilizer is |S| = 2 k . Let us also notice there that a stabilizer subspace of dimension 2 k might be used to encode k logical qubits; the corresponding vectors belonging to V N are called quantum code words (for more details see Refs. [30][31][32]).
Let us illustrate these concepts with two examples of states and subspaces stabilized by subgroups of G N . First we consider the well-known graph states. Consider a graph G = (V, E) where V is the set of vertices matching the parties P i and E stands for the set of edges connecting vertices. To each vertex i one associates the following operator where X i denotes X operator acting on qubit i, whereas N (i) stands for the set of neighbours of the vertex i, which are all vertices of V connected to i by an edge. These operators generate a subgroup of G N that for any N stabilizes a onedimensional subspace spanned by the so-called graph state |ψ G . It is worth noting here that Bell inequalities maximally violated by the graph states are known [33]. Moreover, scalable self-testing schemes for them have recently been given in Ref. [25].
Let us now provide an example of a stabilizer generating a GME subspace of dimension higher than one. To this aim, we consider the stabilizer corresponding to the five-qubit error correction code (see, e.g., [29]), which is generated by the following four operators acting on ( 2 ) ⊗5 : where for simplicity we skip the tensor product. By direct inspection one confirms that all these operators mutually commute and that one cannot generate −½ ⊗5 2 by taking their product. Thus, S 5−qubit = G 1 , G 2 , G 3 , G 4 spans a nontrivial subspace whose dimension is 2 5−4 = 2, as the number of independent generators is four. This subspace is genuinely entangled and a self-testing method based on maximal violation of a Bell inequality has recently been designed in Ref. [22]. One of our aims here is to generalize the results of the latter work and construct stabilizer subspaces of maximal dimension for any number of qubits which can be self-tested from maximal violation of certain multipartite Bell inequalities.

III. CRITERIA FOR STABILIZER SUBSPACES TO BE GENUINELY ENTANGLED
In our work we aim at providing self-testing statements for stabilizer subspaces that are genuinely entangled, whereas it is know that not every stabilizer subspace is genuinely entangled. An example of a non-GME stabilizer subspace is the one spanned by the codewords of the famous Shor's code [32], that is, Therefore, we need a condition allowing to check whether a given stabilizer subspace is genuinely multipartite entangled. A simple sufficient for a subspace to be GME condition that does the job was recently formulated in Ref. [22]. Here we show it to be necessary too. Building on it we then introduce another necessary and sufficient condition for a stabilizer subspace to be GME, which not only allows for deciding whether a stabilizer subspace is GME or not, but can also be used to construct such subspaces.
Consider a stabilizer S generated by k stabilizing operators G i (i = 1, . . . , k) and a nontrivial bipartition Q|Q. With respect to this bipartition each generator can be written as where each G Q i (G Q i ) acts on the Hilbert space associated to the group Q (Q).
Let us now formulate our criterion.
iff the subspace V stabilized by G i is genuinely multipartite entangled.
Before we prove this theorem it is worth noting that the condition (15) can be reformulated as {G Q i , G Q j } = 0, which is due to the fact that all G i mutually commute, so for any bipartition Q|Q either or holds true.
Proof. The proof of the "if" part was given in Ref. [22], however, to make the paper self-contained, we also present it here. Let us assume that the subspace V stabilized by the subgroup S is not genuinely entangled. This means that V contains a non-genuinely entangled state, denoted |ψ , which for some nontrivial bipartition Q|Q can be written as for some pure states |ψ Q and |ψ Q . From the fact that |ψ is stabilized by every generator G i , one concludes by virtue of Eqs. (14) and (18) that with respect to the bipartition Q|Q, for any i, where φ i ∈ Ê. This in turn implies that for any pair which contadicts the assumption that for the considered bipartition there exists a pair of anticommuting operators Let us now move on to the "only if" part. Assume that V is genuinely multipartite entangled and that there exists a nontrivial bipartition Q|Q such that for every pair of generators Due to the fact that all generators commute, this implies that for every pair i = j [cf. Eqs. (16) and (17)]. As a result all G Q i (as well as G Q i ) are diagonal in the same basis, that is, there exist orthonormal bases {|φ i } and {|ϕ i } spanning the Hilbert spaces corresponding to the groups Q and Q such that and for some λ Clearly, the product vectors |φ i |ϕ j form a basis of the total Hilbert space ( 2 ) ⊗N and at the same time are eigenvectors of all the stabilizing operators G i . Consequently, the subspace V contains pure states that are separable across the bipartition Q|Q, unless the space stabilized by G i is empty. In both cases we are in contradiction with the assumptions, which completes the proof.
Let us emphasize that Theorem 1 gives us a way of determining whether a subspace V stabilized by S is GME by looking at its generators instead of verifying whether each vector from V is GME. While this already significantly facilitates checking if a given stabilizer subspace is genuinely entangled, in what follows we reformulate Theorem 1 to further simplify this task.
A. Another iff criterion for a stabilizer subspace to be GME Let us consider the Z 2 field, which consists of the set {0, 1} equipped with addition and multiplication mod 2. Consider then a vector space F N = Z N 2 over the field Z 2 , consisting of N -dimensional vectors whose entries are from {0, 1}. By e i we denote the standard basis of F i consisting of vectors with exactly one 1 at the ith position and zeros elsewhere. Notice that for any f ∈ F N , f ⊕ f =0. Now, we consider a subset of F N , denoted W N and composed of those elements of F N that have even number of ones. It is not difficult to see that W N is a proper subspace of F N because addition of two "even" vectors from W N can result only in an "even" vector. The dimension of W N is dim W N = N − 1 because every vector containing an even number of ones can be written as a linear combination of vectors w 1 = e 1 + e 2 ≡ (1, 1, 0, . . . , 0), w 2 = e 2 + e 3 ≡ (0, 1, 1, 0, . . . , 0), . . .
containing two ones, there is N − 1 such vectors and they are linearly independent. Let us now make use of this formalism to introduce our criterion. To this end, consider again a stabilizer S generated by G i (i = 1, . . . , k). To each pair G i and G j with i = j, we associate a vector from F N defined as if the local Pauli operators appearing at the kth position in G i and G j commute or anticommute, respectively. In other words, v ij is a vector that contains all information about commutation/anticommutation of local Pauli matrices in G i and G j .
To illustrate how the vectors v ij are created with an example, let us consider a stabilizer generated by the following two operators Clearly, the Pauli matrices appearing on the first two positions of G 1 and G 2 anticommute, whereas they commute at the third position and therefore the vector v 1,2 associated to G 1 and G 2 reads In general, given a stabilizer S generated by k operators G k we associate to it k(k − 1)/2 vectors v ij which, due to the fact that all G i mutually commute, have even number of ones and thus all belong to W N . In fact, for any stabilizer S these vectors span a subspace of W N , which we denote K(S).
Our aim now is to reformulate Theorem 1 in terms of subspaces K(S). To do so, we need to introduce a few additional notions regarding bipartitions of the set {1, . . . , N }. Consider again a stabilizer S generated by G i and the associated vectors v i,j . Consider then a nontrivial bipartition Q|Q. We call it even or odd on a vector v i,j if this vector has, respectively, even or odd number of ones in Q and Q. We then call a bipartition Q|Q even on K(S) if it is even on every vector from K(S), and call it odd on K(S) if it is odd on at least one vector from K(S).
Having this, we can now reformulate Theorem 1 in terms of the vectors from K(S).

Lemma 1.
A stabiliser subspace V is genuinely multipartite entangled iff all nontrivial bipartitions are odd on the corresponding K(S).
Proof. Let us begin with the "if" part and assume that all nontrivial bipartitions on K(S) are odd. This means, via our construction of v i,j , that the generators G i and G j anticommute on any bipartition, which via Theorem 1 means that the subspace V is genuinely entangled.
For the "only if" part let us assume that the subspace V is genuinely entangled. By virtue of Theorem 1 this implies that for any nontrivial bipartition Q|Q there exists a pair of stabilizing operators G i and G j (i = j) such that G Q i and G Q j anticommute, which implies that the corresponding vector v i,j has odd number of ones in Q and Q, and thus any bipartition on K(S) is odd.
We are now ready to introduce our main necessary and sufficient criterion for a stabilizer subspace to be genuinely entangled. To this end, we introduce the following bilinear form h(·, ·) : where v i and w i are vectors elements of v and w in the standard basis {e i }.
Let us then notice that each bipartition Q|Q can be represented within this new formalism by a vector from F N defined as That is, it has ones at those positions that belong to Q and zeros elsewhere. This representation gives us an easy way of determining whether a given bipartition is odd or even on a vector v: it is odd if h(φ, v) = 1 and even if h(φ, v) = 0.
We can now prove the following lemma. Proof. If φ is odd on the vector u 1 + . . . + u m , then The last equation implies that for at least one vector u i , h(φ, u i ) = 1, which according to our definition means that the representation φ is odd on the set {u 1 , . . . , u m }.
Having all this we can formulate our main criterion.
Proof. Let us begin with the "⇒" part of the proof and assume that the subspace V is genuinely entangled but dim K(S) = m < N −1. The fact that V is genuinely entangled, implies by Lemma 1 that all the nontrivial bipartitions are odd on K(S). Let us then consider some basis in K(S), denoted {u i } m i=1 . Due to Lemma 2 every nontrivial bipartition is also odd on this basis. Since there are 2 N −1 − 1 nontrivial bipartitions and m < N − 1 basis vectors, there exist two different nontrivial bipartitions represented by and consequently φ is even on the basis {u 1 , . . . , u m }, which by virtue of Lemma 2 means that φ is also even on K(S), contradicting that V is genuinely entangled.
Let us now move on to the "⇐" part and assume that dim K(S) = N − 1. We will show that the latter implies that every nontrivial bipartition is odd on K(S), which by virtue of Lemma 1 means that the subspace V is genuinely entangled and the desired implication follows.
Let us therefore consider a nontrivial bipartition Q|Q represented by a vector φ ∈ F N such that φ = (0, . . . , 0) and φ = (1, . . . , 1). The latter conditions imply that the vector φ contains at least one 0 at a position i 0 and one 1 at a position i 1 . Without any loss of generality we can assume that i 0 ∈ Q and i 1 ∈ Q. Let us then consider the following vector which consists of two ones on positions i 0 and i 1 . We thus have h(v, φ) = 1, meaning that for v the bipartition represented by φ is odd. Clearly, following the above reasoning, for any nontrivial bipartition φ such a vector can be constructed; let us denote it v φ ∈ F N . In other words, for any nontrivial bipartition there exist a vector on which this bipartition is odd. Now, the fact that dim K(S) = N − 1 implies that the vectors v i,j constructed from the generators G i span W N . Let us then select those v i,j that form a basis in W N and denote them u 1 , . . . , u N −1 ; recall that in general there might be more vectors v i,j than dim W N = N − 1. Clearly, any vector v φ can be decomposed in that basis, that is, where α i ∈ {0, 1} for all i. As mentioned above h(v φ , φ) = 1, which due to the above decomposition implies that for some i such that α i = 0, Consequently, any nontrivial bipartition φ is odd on at least one vector v i,j and thus it is odd on K(S). Lemma 1 implies then that the subspace V is genuinely entangled.
Thus, this theorem tell us that a stabilizer subspace is genuinely entangled if, and only if the corresponding vectors v i,j span W N , or, equivalently, the subspace K(S) spanned by them is isomorphic to W N .
Let us illustrate the power of this criterion by applying it to show that the examples of stabilizer states (graph states) and subspaces (5-qubit code) introduced in the preliminary section (Sec. II) are indeed genuinely entangled.
Graph states. First, we consider the graph states. Let us choose a particular graph G = (V, E) and the corresponding graph state |ψ G stabilized by the stabilizing operators given in Eq. (11). Now, for a given pair G i and G j with i = j, the corresponding vector v i,j will have either two (if the vertices i, j are connected) or no ones (if the they are unconnected). Let us then consider all vectors obtained from the stabilizing operators G i that have two ones and assume that they do not span W N . This implies that there exists a nontrivial even bipartition Q|Q of v ij , i.e., all vectors v ij can be written as direct sums where all v Q i,j and v Q i,j have even number of ones or no ones. However, if such a bipartition exists it follows that the graph G consists of two unconnected subgraphs, which contradicts that we consider only connected graphs. Thus, the graph state |ψ G is genuinely entangled.
The five-qubit code. Let us now apply our criterion to the five-qubit code; the generators are given in Eq. (12). One finds that the vectors v i,j that are obtained from them are of the form We thus have six vectors with, each having two ones. It is not difficult to see that v 1,2 , v 1,3 , v 1,4 and v 2,4 are linearly independent and therefore they span W 4 , which implies the corresponding subspace to be GME.
B. Construction of GME stabilizer subspaces for any number of qubits Interestingly, the above formalism, in particular Theorem 2 not only serve as a efficient method of checking genuine entanglement of a stabilizer subspace, but can also be employed to construct GME stabilizer subspaces for any number of qubits. More precisely, given a basis spanning W N like the one in Eq. (25) one can try to find stabilizing operators giving rise to this basis. In other words, any abelian stabilizer S = G 1 , . . . , G k that does not contain −½ ⊗N and gives rise to these vectors, stabilizes a nontrivial genuinely entangled subspace.
Let us illustrate the above idea with two examples of nontrivial stabilizers giving rise to vectors (25). The first one corresponds to the well-known N -qubit GHZ state, whereas the second one gives rise to a class of subspaces whose dimension grown exponentially with N Construction 1. A very simple construction of generators that giving rise to the vectors (25) is the following one and It is also fairly easy to see that one cannot obtain −½ ⊗N by taking their products, and consequently, they give rise to a nontrivial stabilizer. Due to the fact that they are all independent, the dimension of the stabilized subspace is one, and it corresponds to the N -qubit GHZ state Construction 2. Let us now present a bit less straightforward construction of a GME stabilizer subspace whose dimension is higher than one and grown with the number of parties N . For clarity we assume N to be even, however, a similar construction can also be given for odd N .
Let us begin with the simplest cases of N = 4 and N = 6. For N = 4 we take the following operators These operators commute and it is not possible to generate −½ ⊗3 2 by taking their products because to obtain −½ ⊗3 2 we need a product of at least four different generators, whereas here we have only three. Now, one finds that the vectors (26) that can be associated to them are exactly that is, they span W 3 , and therefore the two-dimensional subspace V 4 stabilized by (42) is genuinely entangled. For N = 6 we consider the following four operators Again, they mutually commute and do not generate −½ ⊗6 2 , and thus give rise to a stabilizer that stabilizes a nontrivial subspace V 6 of dimension four. These generators give rise to six vectors v i,j among which five are of the form (26), or, equivalently, dim span{v i,j } = 5, and thus the stabilized subspace V 6 is GME.
Given these two particular cases it is not difficult to construct the generators G i for any even N giving rise to the vectors (25). Indeed, let us consider the following operators with i = 3, . . . , N/2, and One realizes that they all mutually commute: G 1 commutes with any G i for i = 2, . . . , N/2 + 1 because the latter consists of two Z operators and one or two X operators, whereas any pair of operators G i , G j for i, j = 2, . . . , N/2 + 1 commutes because they overlap nontrivially on two positions, in which case the local Pauli operators anticommute on these two positions, or they do not have nontrivial overlap. Then, the subgroup generated by G i does not contain −½ ⊗N 2 due to the fact that the largest overlap of any k ≥ 4 different generators is three, while one needs XZXZ to create −½ 2 at a single site. Now, one finds that these generators are independent and there are N/2 + 1 of them, and therefore they stabilize a sub- Moreover, this subspace is GME for any N because the vectors v i,j these generators give rise to contain those listed in Eq. (25). Yet, 2 N/2−1 is not the maximal dimension of a GME subspace that can be achieved within the stabilizer formalism, and, as we will see in the next section, larger subspaces can be constructed and we provide an example of such maximally-dimensional subspace.
Let us conclude this section by noting that one can slightly modify the generators G i for any even N ≥ 6 to make them cyclic with i = 2, . . . , N/2 + 1, where we use the convention that X 0 ≡ X N .

IV. GENUINELY ENTANGLED STABILIZER SUBSPACES OF MAXIMAL DIMENSION
In the preceding section we presented a nontrivial example of a stabilizer GME subspace whose scales exponentially with the number of qubits N . Our aim here is to provide another example of a GME stabilizer subspace whose dimension for any N is maximal achievable within the stabilizer formalism.
Let us first find an upper bound on the maximal dimension of the GME stabilizer subspaces (see also [24]). Theorem 3. For any nontrivial stabilizer S ⊂ G N for which stabilizer subspace V (S) is genuinely entangled, the dimension of V (S) is bounded as where Proof. It follows from Theorem 2 that we need at least N − 1 vectors v i,j from W N for a stabilizer subspace to be GME. Given that the stabilizer S N is generated by k generators, there are k(k−1)/2 vectors v i,j . We thus have an inequality relating k and N : that must be satisfied in order for the subspace V (S) to be GME. The smallest k obeying this inequality is given by (49).
Let us now show that the bound (48) is tight by providing a particular GME stabilizer subspace for which (48) is saturated. To this end, to simplify the notation, let us first denote k ≡ k min (N ) and Consider then the following operators where i = 1, . . . , k − 2 and q max (i) := k min (N + i) − 1 with k min (N + i) being (49) for N + i qubits, and We can now state the following fact, whose proof is quite technical and therefore it is deferred to Appendix A. It is interesting to compare the maximal dimension of GME stabilizer subspaces (48), which for sufficiently large N scales as 2 N − √ 2N , with the maximal dimension of any GME subspace is ( 2 ) ⊗N given by the following simple formula [21], Thus, as expected, the maximal dimension of any GME subspace is bigger for any N than that of GME stabilizer subspaces, and, moreover, gap between them grows with N as their ratio scales as 2 √ 2N . For illustrative purposes let us finally discuss our construction for two particular cases of N = 3 and N = 4 (for N = 2 our construction reproduces stabilizing operators of the maximally entangled state of two qubits).
Moreover, the corresponding subspace K(S max The stabilizing operators are given by (57) Again, they mutually commute and one cannot generate −½ ⊗4 2 by taking their products. Hence, they stabilize a twodimensional subspace V max 4 spanned by the four-qubit states that can be written in the following way and One finally checks that the subspace K(S max 4 ) associated to G i (i = 1, 2, 3) is three dimensional and therefore V max 4 is genuinely entangled.

V. BELL INEQUALITIES MAXIMALLY VIOLATED BY STABILIZER SUBSPACES
Interestingly, taking advantage of the stabilizer formalism we can construct multipartite Bell inequalities that are maximally violated by any state from the maximally-dimensional subspaces introduced in the preceding section (see also Ref. [24,34] for earlier constructions of Bell inequalities maximally violated by entangled subspaces). Our construction builds on a general approach for constructing CHSH-like Bell inequalities within the stabilizer formalism introduced in Refs. [22,25]. (In Appendix B we also provide an analogous construction for Bell inequalities maximally violated by the subspaces given in Sec. III B.) Let us consider again the parties P i and denote by A (i) xi the observables measured by them on their shares of some state ρ. The departure point of our construction of Bell inequalities are the stabilizing operators (52). For pedagogical reasons we begin, however, with the simplest case N = 3, for which they are stated explicitly in Eq. (55). Now, we assign the observables A (i) xi or their combinations to all Pauli matrices X and Z appearing in G max i (i = 1, 2, 3). Precisely, for the first observer we make the following assignments whereas for the remaining two observers P i (i = 2, 3): Then, using these assignments, we associate an expectation value to each generator G max i . Precisely, Adding the obtained expectation values we finally arrive at the following Bell inequality whose classical bound β 3 C = 3 was found by optimizing I max 3 over all local deterministic correlations [cf. Eq. (6) and the text that follows]. Interestingly, the maximal quantum value of (63) can also be found analytically and is given by β 3 Q = 2 √ 2 + 1 > β 3 C . Precisely, observing that for any choice of dichotomic observables A (i) xi , the "shifted Bell operator" (2 √ 2+ 1)½− B decomposes into the following sum of positive operators one infers that the maximal quantum value of I max 3 is upper bounded as β 3 Q ≤ 2 √ 2 + 1. To show that this is in fact an equality it suffices to notice that for the following choice of observables for the first party and A (i) 0 = X and A (i) 1 = Z for i = 2, 3, the Bell operator becomes a weighted sum of the generators, that is, . Its expectation value in the state |ψ max 3 stabilized by G max i is exactly 2 √ 2 + 1, which implies that β 3 Q = 2 √ 2 + 1.
A. The construction for arbitrary N The above construction generalizes directly to arbitrary number of observers N . Let us go back to the stabilizing operators (52) and follow the same steps as above. That is, for the first observer we make the assignments (60), whereas for the remaining ones we substitute for i = 2, . . . , N . We then associate expectation values to all G max i in which the Pauli matrices are replaced by the observables or their combinations according to these assignments. Noting that G 1 and G 2 are the only generators that contain nontrivial matrices X and Z at the first site, we have where here and below we use the convention that A Finally, for the last two generators we have By adding the above expectation values we arrive at the following Bell expression The maximal classical value of these inequalities has been found by noting that for the local deterministic correlations, that is, those for which all expectation values are product A (i1) , all expectation values in the third and the fourth line of (71) can take the maximal value one, whereas only one of the first two terms can be nonzero and takes the maximal value two.
Remarkably, the maximal quantum value of I max N can also be found analytically for any N . Proof. The proof goes along the same lines as that for N = 3. First, one finds by a direct check that the following decomposition into a sum of positive operators is true, where B N is a Bell operator associated to the Bell expression I max N with arbitrary observables A xi . This decomposition implies that β N Q ≤ 2( √ 2 − 1) + k min (N ). In full analogy to the N = 3 case we then let the parties measure the following observables: for the first party we take those defined in Eq. (65), whereas for the remaining ones A and so it is a simple combination of the stabilizing operators G max i that stabilize the subspace V max N . Consequently, for any pure state |ψ ∈ V max N , one has ψ|B N |ψ = 2( √ 2 − 1) + k min (N ), which is what we wanted to achieve.
Two comments are in order. First, we stress that the inequalities (71) are nontrivial for any number of parties as β Q > β C for any N ≥ 2. Second, it is worth pointing out that they are not only maximally violated by any pure state from V max N but also by any mixed state supported on V max N .
In the next section we demonstrate that they can be used to self-test those maximally-dimensional subspaces.

VI. SELF-TESTING THE STABILIZER SUBSPACES OF MAXIMAL DIMENSION
Let us first recall the definition of subspace self-testing introduced in Ref. [22]. Consider an entangled subspace V of the N -qubit Hilbert space H P ′ = ( 2 ) ⊗N spanned by some orthogonal vectors |ψ i ∈ H P ′ . Imagine then that the N parties perform a Bell experiment on some N -partite (generally mixed) state acting on H P whose dimension we assume to be finite but unknown and observe correlations P. Denoting |φ P E ∈ H P E a purification of ρ P to a larger Hilbert space H P E = H P ⊗ H E , we have the following definition [22].
Definition. We say that the correlation P self-test the entangled subspace V if for any pure state |φ P E compatible with P one can deduce that: (i) every local Hilbert space H Pi = 2 ⊗ H ′′ Pi and (ii) there exist a local unitary operation U P = U 1 ⊗ . . . ⊗ U N acting on H P such that where α i ∈ R are some nonnegative coefficients such that i α 2 i = 1, whereas |ξ i P ′′ E are pure states from H P ′′ E . Let us now prove that the maximal quantum violation of the Bell inequalities introduced in the preceding section self-tests the subspaces V max  Before proving this theorem we recall a well-known fact that will be highly useful for our proof.
where X and Z are the Pauli matrices.
Proof. Let us denote by A xi with x i = 0, 1 and i = 1, . . . , N , and |ψ ∈ H P E denote quantum observables and quantum state achieving the maximal quantum value of I max N . Without any loss of generality we can assume that the reduced density matrices ρ Pi are of full rank.
From the sum-of-squares decomposition we infer that where we recall thatG i are quantum operators acting on H P constructed from the generators G i by making the substitutions (60) and (66); for clarity in Eq. (74) and in what follows we omit the identity acting on E. To simplify the mathematical considerations let us denotẽ Let us now show that all operatorsX (i) andZ (i) satisfy both conditions of Lemma 3. We begin with the first condition. Due to the fact thatX (i) andZ (i) for i = 2, . . . , N are Hermitian operators with eigenvalues ±1, we directly see that To prove that the same holds forX (1) andZ (1) , let us consider (74) for i = 1 which can be stated as denotes all elements ofG (1) apart fromX (1) . By applyingX (1) ⊗G (Q1) 1 to both sides of the above identity and then exploiting the fact thatG (Q1) 1 squares to the identity, we arrive at which is equivalent to [X (1) ] 2 = ½; recall that the reduced density matrix ρ P1 acting on H P1 is of full rank. Analogously, we can use the condition (74) for i = 2 to conclude that [Z (1) ] 2 = ½.
We can now proceed with the second condition of Lemma 3. From Eq. (75) one directly realizes that To prove the same for the remaining sites we need to employ the conditions (74). Let us thus consider those for i = 1 and i = 2 and write them as whereG (Q2) i are the parts ofG 2 corresponding to the subset Q 2 = {3, . . . , N }. From these relations we obtain that where we used the fact thatG Let us now assume that {X (i) ,Z (i) } = 0 for some i ≥ 2. Our aim is to prove that {X (i+1) ,Z (i+1) } = 0. As mentioned before the regular generators G max 1 , . . . , G max kmin(N ) stabilizing V max N give rise to vectors (25) for every i ∈ {1, . . . , N − 1}. This by the very definition of these vectors implies that for every pair of adjacent qubits there always exists a pair of generators G max p and G max q (p = q) that anticommute on exactly these two qubits. Consequently, for subsystems i and i + 1 the correspondingG j andG q are of the following form We thus have the following chain of equalities Now, we can use Lemma 3, which tells us that for each site i there exists a unitary matrix U i such that where X i and Z i are the Pauli matrices acting on the ith site and ½ P ′′ i is an identity acting on H P ′′ i . Accordingly, we have for U P = U 1 ⊗. . .⊗U N . Denoting then |ψ = (U P ⊗½ E )|φ , the conditions (74) rewrite as for i = 1, . . . , k min (N ). Taking the Schmidt decomposition of |ψ with respect to the subsystems P and E, one finds that the most general form of |ψ compatible with these conditions is the following one with α i being some nonnegative coefficients whose squares sum up to one. Thus, which completes the proof.

VII. EXPLORING THE BOUNDARIES OF THE SETS OF QUANTUM CORRELATIONS
A behaviour maximally violating a Bell inequality belongs to the boundary of the set of quantum correlations. Thus, Bell inequalities for whose maximal quantum violation is known can serve as a tool for characterizing the boundaries of the sets of quantum correlations. Here we use our inequalities to identify faces of dimension 2 N −kmin(N ) − 1 in the boundaries of the sets Q N . We reach this goal by constructing, for any N , a set of 2 N −kmin(N ) behaviours P i achieving the maximal quantum value of (71) and prove them to be affinely independent. These in turn are obtained from a certain set of 2 N −kmin(N ) multipartite qubit states stabilized by G max i . To simplify further calculation we will not explicitly state the dependence of k min on N , but keep in mind that this is still a function of N .
We establish this result in a few steps. The first one is to consider an additional set of N − k min operators from the group G N of the following form where i = 1, . . . , i max with i max being the largest i fulfilling i(i + 1)/2 < N − k min , whereas j = 1, . . . , N − k min − i max . As shown in Appendix C these operators are independent. Moreover, they mutually commute because the only two nontrivial matrices of H max i,j , which are P i+1 , belong to the block C i+2 ; so either two different H max i,j have their nontrivial matrices in different blocks, or their nontrivial matrices are the same. It is also not difficult to see that one cannot use H max i,j to generate −½ ⊗N 2 . In fact, they give rise to a nontrivial stabilizer.
Let us now consider the generators G max i together with H max i,j . Appendix C establishes that they form a set of N independent operators. It is also not difficult to see that each G max i commutes with each H max i,j . This is because the only two nontrivial matrices P i+1 of H max i,j belong to the block C i+2 . At the same time, the only generator of S N that has matrices P i in this block is G max i+2 and it has P i on every qubit from that block. So H max i,j and G max i+2 anticommute on two qubits, hence they commute. The remaining generators from S N also commute with H max i,j , as either all of their matrices in C i+2 are simply ½ 2 , or one or two equal P i+1 , whereas the rest are ½ 2 . To prove that G max i and H max i,j together do not generate −½ ⊗N 2 we notice, as before, that one cannot generate the product XZXZ at any site by any product of four different generators of S N . Namely, there is only one generator that has a matrix P i on the block C i , which is G max i . These two facts ensure that G max i and H max i,j generate a stabilizer of a one dimensional subspace.
We can now use this set of N independent and mutually commuting operators to construct the aforementioned multiqubit pure states |ψ i . To this aim, we consider a set of 2 N −kmin subgroups of G N generated by G max i and H max i,j , however, the latter we take with different signs ±1; in other words we consider the following sets where i = 1, . . . , 2 N −kmin(N ) . A change of sign in front of the H max j,k operators has no effect on the commutation of the operators and so to show that every S i N stabilises a nontrivial subspace it is enough to show that −½ ⊗N 2 / ∈ S i N . To prove this let us assume that −½ ⊗N 2 ∈ S i N . All operators from S i N clearly square to ½ ⊗N 2 and so −½ ⊗N 2 has to be generated as a product of non repeating generators of S i N . This implies that some product of non repeating generators of S 0 However, it was already proven that S 0 N stabilises a nontrivial subspace, so any product of generators cannot be equal to −1 and the subspace stabilised by S 0 N is also one-dimensional, so the product of non repeating generators cannot be equal to 1. Hence every S i N stabilises a nontrivial subspace. Similarly we can show that every S i N stabilises a one dimensional subspace. This requires the generators of S i N to be mutually independent. Let us assume that this is not a case, and so there exists some product of generators of S i N that equals ½ ⊗N 2 . By the same argument as in the previous paragraph we can show that this contradicts the fact that S 0 N stabilises a nontrivial, one dimensional subspace. Now, each S i N stabilizes a multiqubit state |ψ i that clearly belongs to V max N . Moreover, since states |ψ i are stabilised by (90) it follows that for any i = 1, . . . , 2 N −kmin(N ) and k = 1, . . . , k min , whereas We can define behaviours P i corresponding to the states |ψ i and a choice of observables (65) as in (4). Furthermore, we denote vector elements of the behaviour P i by: where x j ∈ {0, 1}, J ⊂ {1, . . . , N } and we chose the observables as in (65). To show that all P i are affinely independent let us first relabel H max j,k → H i where i ∈ {1, . . . , N − k min }. The exact correspondence between them is not given, because it will not be necessary to know the exact form of operators H i . Next, we denote byH i the quantum operators obtained from generators H i by the substitution (60), (66): H i →H i . Finally, in order to show that all P i are affinely independent, it is sufficient to only consider the following expected values i∈JH i , for all nonempty J ⊂ {1, . . . , 2 N −kmin − 1} and one of the expectation values G i . The operatorG i is an observable created from the operator G max i by the substitution (60), (66). It is irrelevant whichG i we chose, because for all P j we have G i Pj = 1. Let us also mention here that (94) are well defined expectation values, because on every qubit we either have 1, A 0 or A 1 . This is true since from (89) we see that if two operators H max i,j have different index i then on no qubit do they both have a nontrivial matrix, and if they have the same i then they have the same nontrivial matrices P i+1 . Hence the product of H i operators will never result in an operator that has a matrix proportional to Y on some qubit.
It is also important to note that since we consider only behaviours P j obtained from the states |ψ j stabilised by (90), we can write for every P j , Now, let us move on to proving that all P j are linearly independent. To this aim, let us assume that for some q ∈ {1, . . . , 2 N −kmin − 1} we have for some subset M ⊂ {1, . . . , 2 N −kmin − 1} and a i ∈ R. Every expected value (94) gives us one condition on the values of a i . We can add all these conditions, which gives us  (96), however we can also subtract the conditions. To calculate the value of a m we add a condition from an expectation value i∈M ′Hi if i∈M ′Hi Pm = 1 and subtract it if i∈M ′Hi Pm = −1. As a result we get the following equation From this it follows that a m = 0 for m = q and a m = 1 for m = q, and since we can construct this equation for all m ∈ M , all P i are affinely independent. This in turn means that the face of the quantum correlation set corresponding to the Bell inequality (71) is (2 N −kmin − 1)-dimensional.

VIII. CONCLUSIONS
Here we have shown that genuinely entangled stabilizer subspaces of maximal dimension can be self-tested from maximal violation of certain multipartite Bell inequalities. We have established this result in a few steps. First, we have introduced a framework allowing to decide whether stabilizer subspaces in multiqubit Hilbert space are genuinely entangled. We have then determined what is the maximal dimension of genuinely entangled subspaces achievable within the stabilizer formalism, and, using the above framework, we have provided a construction of such a maximally-dimensional stabilizer subspace. Third, we constructed Bell inequalities maximally violated by any pure state from these subspaces and showed that maximal violation of these inequalities can be used to self-test them. Finally, we have used our Bell inequalities to identity "flat structures" in the boundaries of the sets of quantum correlations in the considered Bell scenarios.
Our work opens many possibilities for further research. First, we provide self-testing strategies only for particular stabilizer subspaces and it is interesting to explore whether our approach can be used to self-test any genuinely entangled subspace within the stabilizer formalism. Then, a much more challenging problem would be of course to design self-testing strategies for entangled subspaces that do not fall into the stabilizer formalism; recall, however, that even a simpler problem of whether any genuinely entangled multipartite state can be self-tested remains open. On the other hand, it seems that our formalism to describe entanglement within the stabilizer formalism can be generalized to the case of multi-qudit Hilbert spaces of local dimension being a prime number or a power of prime (see, e.g., Ref. [37]). It thus would be interesting to explore whether such a formalism is of use in studying entanglement properties of stabilizer subspaces, in particular those corresponding to quantum error codes. At the same time, by combining it with the construction of Bell inequalities maximally violated by the two-qudit maximally entangled states of Ref. [15] one could perhaps design self-testing methods for genuinely entangled subspaces in multiqudit Hilbert spaces.

Appendix A: A proof of Fact 2
Here we provide a proof of Fact 2, i.e., that the operators defined in Eqs. (52) generate a subspace of maximal dimension 2 N −kmin(N ) . To this end, we show that they mutually commute and that −½ ⊗N 2 / ∈ G max i . To simplify the notation in what follows we drop the subscript "max" from the generators G max i .
To prove the first condition let us begin by dividing our N qubits {1, . . . , N } into k = k min (N ) disjoint and nonempty blocks defined as As the number of qubits in the block C i equals Now, let us examine the form of G and The matrix P i on the last qubit of G (Ci−1) i comes from the second term in Eq. (52), i.e., P ⊗(i+1) i . The first matrix of this term is in the block C i−1 and from Eq. (A2) we infer that: As we can see, this gives us only the first matrix of G can only be generated from the product XZXZ. Due to the fact that G max i mutually commute and square to identity, such a product can be achieved only from four distinct generators. To see whether the product XZXZ can be constructed, let us analyse (G max i ) (C l ) for every i = 1, . . . , k and some l. From Eqs. (A9), (A10), (A11) and (A12) we can see that the only generator that has matrices P i on the block C l is G max l and the rest have either P i+1 or ½ 2 . Hence, the product P i P i+1 P i P i+1 cannot be constructed with four distinct generators G max i . Next, we need to prove that our stabilizer S = G 1 , . . . , G k stabilises a GME subspace. Let us consider two generators G i and G j and, without any loss of generality, let us assume that i > j. As shown before they commute, but now we are interested in anticommutations on the single qubit. Let us once again consider blocks of qubits indexed by l. From (A9), (A10) (A11) and (A12) we can conclude that the generator G i anticommutes on single qubit with the generator G j in blocks C i−1 and C i . For j ∈ {1, . . . , i − 2} they anticommute on two consecutive qubits from C i . For j = i−1 they anticommute on the last qubit of C i−1 and the first of C i so those two qubits are also consecutive. This is true for any pair of generators, so we have N − 1 vectors from W N,d of the form w p =ê p +ê p+1 where p ∈ {1, . . . , N − 1}. The last step is to show that these vectors are linearly independent. We will attempt that by expressing i and j in terms of the index p. We still assume that i > j which means that (p + 1)'th qubit has to be a part of i'th block. This gives us a condition on p where the right side is just a number of stabilizing operators in blocks with index smaller that i. For (p + 1)'th qubit to be a part of i'th block, we have to take the smallest positive integer i that fulfils this inequality, and hence we get In the i'th block, the generator G j has it's second P i+1 matrix on the qubit of an index: but it is also equal to p + 1 so we can write So to summarise, for every vector w p =ê p +ê p+1 where p ∈ {1, . . . , N − 1} we can find i and j such that G i and G j anticommute only on qubits p and p + 1 so v i,j = w p . Since vectors w p form a basis in W N we have |K(S)| = N − 1.
We finally notice that G max i are certainly independent because we already know that they stabilize a GME subspace and if they were not independent they would necessarily stabilise a subspace of dimension violating the upper bound in Eq. (48).
Appendix B: Bell inequalities for GME stabilizer subspaces from Sec. III B Here we construct Bell inequalities maximally violated by the subspaces V N introduced in Sec. III B.
Consider the stabilizing operators G i given in Eq. (47). To all Pauli matrices X and Z appearing in them we assign, as before, the observables A (i) j or their combinations. Precisely, for the first observer we make the following assignments whereas for the remaining observers P i (i = 2, . . . , N ): Then, using these assignments, we associate an expectation value to each generator G i . Precisely, to the first, the second, and the last ones we associate while to the remaining ones for i = 3, . . . , N/2. Adding the obtained expectation values and multiplying the first one by two, we obtain the following Bell inequality where the maximal classical value β N C = N/2+2 of this Bell expression was found by optimizing I N over all local deterministic correlations.
Importantly, the CHSH-like construction of this inequality makes it also possible to directly determine the maximal quantum value of I ex . Namely, we have the following observation. Proof. Let B N be a Bell operator obtained from the Bell expression I N for an arbitrary choice of the local dichotomic observables A (i) 0/1 . Then, one checks by hand that following sum-of-squares decomposition holds true: meaning that max Q I N ≤ [N/2 + 2(2 √ 2 − 1)]. To prove this bound to be tight we can easily construct a quantum realization for which the value of I N equals N/2 + 2(2 √ 2 − 1). In fact, by taking, as before, and A (i) 0/1 = X/Z for the remaining parties i = 2, . . . , N , we bring the Bell operator B N to a weighted sum of the stabilizing operators G i , i.e., B = √ 2(G 1 + 2G 2 + G N/2+1 ) + G 3 + . . . + G N/2 , whose maximal eigenvalue is N/2 + 2(2 √ 2 − 1) and it is achieved by any state stabilized by G i .
It is worth noting that β N C < β N Q for any even N ≥ 4, and thus any Bell inequality in this construction is nontrivial.

Appendix C: Proof of independence
Our aim here is to show that G max i together with H max i,j form a set of N independent generators. To do this let us first introduce a simple condition that enables verifying independent of elements of G N .
Let us consider a set of operators G i ∈ G N (i = 1, . . . , k) that for simplicity we assume to be composed of X, Z or ½ 2 .
We say that an operator G i has a unique matrix P j on some qubit if the every other operator G i has either P j+1 or ½ 2 on this qubit, where P i is defined in Eq. (51). We can now state our criterion.
Fact 5. If every G i (i = 1, . . . , k) has a unique matrix at some position, then the operators G i are independent.
Proof. Let us say that generator G i has a unique matrix P j on the k'th qubit. Then by taking products of the remaining operators G j (j = i) one cannot construct G i ; only operators that on the k'th qubit have either P j+1 or ½ 2 can be created from them.
This simple observation will be of a great use for our goal. Let us therefore show that all the operators G max i stabilizing the the maximally-dimensional GME subspaces V max N as well as H max i,j have unique matrices. We begin with G max i and consider generators given by Eqs. (A9), (A10), (A11) and (A12). The unique matrices for a generator G max i are in the block C i , because only this generator has matrices P i in C i . The rest of generators on C i has either 1 or P i+1 . As an example we can look at the generators for N = 7: The matrices highlighted in red are unique for their specific generators.
In a similar way we can show that the additional stabilizing operators H max i,j are independent of G max i . For a clearer view we first consider the example for N = 7: It is straightforward to see that for N = 7 these new generators are independent of (C1) and it is not more difficult to draw the same conclusion for any N . To this end, we can once again utilise the blocks C l . From Eq. (A2) we have that the first i + 1 blocks together contain (i 2 + i + 2)/2 qubits, so on all of these blocks H max i,j has identities. The block C i+2 contains i + 1 qubits, so for all j ∈ {0, . . . , i} only nontrivial matrices of H max i,j are in the C i+2 and these matrices are equal to P i+1 , so H max i,j does not contain any unique matrices of stabilizing operators (52). Hence, all H max i,j are independent of the generators of S max N . Let us finally show that H max i,j also form a set of independent operators. As already stated all nontrivial matrices of H max i,j are in C i+2 , so H max i,j with different i are clearly independent. We are left with proving that the operators H max i,j with the same i, but different j are independent from each other. Let us look at the stabilizing operator H max i,1 . It is the only generator H max i,j that has a nontrivial matrix on the first qubit of C i+2 , so it has to be independent. Then, the generator H max i,2 has its first nontrivial matrix at the second qubit of C i+2 and the only generator that also has a nontrivial matrix on this qubit is H max i,1 . However H max i,1 is independent, and so is H max i,2 . This can be done recursively for all j which finally proves that G max i together with H max i,j form a set of N independent generators.