{'fraction_non_alphanumeric': 0.04128643216080402, 'fraction_numerical': 0.010934673366834171, 'mean_word_length': 4.069492561646627, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Quantum error-correcting codes associated with graphs

We present a construction scheme for quantum error correcting codes. The basic ingredients are a graph and a finite abelian group, from which the code can explicitly be obtained. We prove necessary and sufficient conditions for the graph such that the resulting code corrects a certain number of errors. This allows a simple verification of the 1-error correcting property of fivefold codes in any dimension. As new examples we construct a large class of codes saturating the singleton bound, as well as a tenfold code detecting 3 errors.


I. INTRODUCTION
From the beginning of Quantum Information Theory it was recognized that error correcting codes play a crucial role. On the one hand it was clear that without error correction decoherence effects could easily annihilate the gain in computing time promised by the new fast quantum algorithms. On the other hand, the no-cloning theorem [1] seemed to forbid at least the most naive approach to classical error correction for noisy channels, e.g., sending each bit three times and taking a majority vote at the output of the channel. Clearly, this simple scheme reduces classical errors with small probability of order ε to order ε 2 . The cloning required for sending "the same bit" three times rules out direct quantum analogues of this scheme. It was therefore an important step to realize [2] that quantum mechanics had other, more subtle ways of "distributing" quantum information over several channels to stabilize against errors. One problem with the known schemes of quantum error correction (e.g. [3,4]), however, is that they tend to be subtle indeed, and the verification of their error correcting capabilities often requires a lengthy computation. It is therefore desirable to find new, perhaps simpler ways of constructing error correcting codes, on which more direct intuitions might be built.
In this paper we propose a new scheme for constructing quantum error correcting codes, which has some of these advantages. The ingredients of our construction are a graph and a finite abelian group. The order of the group determines the type of systems for which errors are corrected so that, e.g., the two-element group corresponds to the qubit case (Compare [5][6][7][8] for other constructions of non-binary codes). The number of vertices of the graph determines how many input systems are coded into how many output systems. From the edges of the graph one can then read off an explicit expression for the code. However, not every graph corresponds to a good code, and we will discuss the condition for the code to correct a certain number of errors. In the simplest case, the fivefold code [9][10][11] (for qubits as well as higher dimensional systems), it can be verified in a few lines that any two errors are corrected. We also give an example of a more complex tenfold code detecting 3 errors.
As we are going to discuss in a following paper in more detail, it turns out that the codes which can be achieved by our method are stabilizer codes. There are various efficient methods for constructing stabilizer codes [3,4,[12][13][14][15][16]. However, we think that, compared to previous stabilizer constructions, our technique has some interesting new features.
• Often the condition for error correction can be proved for many groups simultaneously, so that one gets code families for systems of variable sizes.
• The geometric intuitions about graphs may become helpful for finding new constructions.
• Our codes have the property that in their natural basis all matrix elements of the coding operator have the same modulus (Hadamard form). This is prima facie opposite to the usual goal of getting as few non-zero matrix elements as possible. However, the latter can be achieved for our codes by a discrete Fourier transform applied to some channels. Moreover, the Hadamard form appears to be an interesting normal form for the codes which can be written in both ways.
• For some codes it is possible to exchange some input vertices with some output vertices, while retaining the error correction property. This kind of symmetry is much harder to see in the usual stabilizer constructions, and may prove to be helpful in coding problems with additional inputs and outputs, such as the internal state of the codig device in convolutional codes.
The paper is organized as follows: We begin by describing the general construction of the coding operator within Section II. In Section III we recapitulate the Knill-Laflamme condition for error correction and adapt it to our particular type of codes, resulting in a necessary and sufficient condition for a graph to generate a quantum error detecting code. The remaining sections contain examples of codes constructed in this way. In Section IV we show that it becomes simple indeed to verify the fivefold quantum codes. In Section V we demonstrate that for a given number e of errors and number k of inputs, there is a graph generating an infinite code family using 4e + k output systems, i.e., a family of codes saturating the singleton bound. Finally, in Section VI we construct a code with 1 input and 10 outputs, detecting 3 errors for arbitrary system size.

II. BASIC CONSTRUCTION
Every code we construct is completely determined by the follow ingredients: • An undirected graph Γ with two kinds of vertices.
We distinguish the set X of input vertices and the set Y of output vertices. The links of the graph are given by the coincidence matrix of the graph, which we will denote by Γ for short. Its matrix element Γ(z 1 , z 2 ) is 1 iff the vertices z 1 , z 2 ∈ (X ∪ Y ) are linked, and 0 otherwise. More generally, we allow weighted graphs, whose incidence matrices have arbitrary integer entries, apart from the constraints Γ(z 1 , z 2 ) = Γ(z 2 , z 1 ) and Γ(z, z) = 0.
• A finite abelian group G with a non-degenerate symmetric bicharacter.
By definition, a bicharacter is a function χ : G × G → C such that χ(g + h, g ′ ) = χ(g, g ′ )χ(h, g ′ ) and a similar condition holds for the second argument, which is also implied by the assumed symmetry χ(g, g ′ ) = χ(g ′ , g).
We also assume non-degeneracy in the sense that g χ(g, g ′ ) = |G| δ(g ′ ) ≡ |G| for g ′ = 0 0 for g ′ = 0 (1) Note that since every g ∈ G has finite order, χ(g, g ′ ) is always a root of unity, and χ(g, g ′ ) = χ(−g, g ′ ). For G = Z p , the cyclic group of order p, the standard bicharacter is given by where g, h are integers representing their class modulo p. Since every finite abelian group is a direct product of cyclic groups, this also shows the existence of bicharacters for any such group. The input and output systems of the code are labeled by X and Y . They are all of the same type, i.e., they are described by the same Hilbert space H = L 2 (G). This is the space of all functions ψ : G → C with scalar product φ, ψ = |G| −1 g φ(g)ψ(g). For compactness of notation we write such normalized sums as integrals. Hence the scalar product becomes dg φ(g)ψ(g). The combined input system is thus described in the |X|-fold tensor product H ⊗X = L 2 (G X ). Vectors in this space are functions of |X| variables, one variable g z for every z ∈ X. The entire collection of variables will be denoted by g X . The error correcting code will be an isometry where v Γ under the integral denotes the integral kernel of the operator v Γ . This kernel depends on both input and output variables, which are combined into a collection of variables g z , one for each vertex z ∈ X ∪ Y of the graph. The core of our construction is an explicit expression for this integral kernel: apart from an overall normalization factor, it will simply be a product of phases, with each factor corresponding to a link of the graph: where the product is over all 2 element subsets {z, z ′ } ⊂ (X ∪ Y ). Thus for an ordinary graph (Γ(z, z ′ ) = 0, 1), this is the product of all χ(g z , g z ′ ), for which z and z ′ are linked. The remarkable property of such codes is that apart from the normalization factor the kernel is everywhere of modulus 1. When G = Z p is cyclic, and χ is given by Equation (2), we can write the phase in more compact form as where "·" denotes the product of integer valued matrices and vectors. Note that every term in the sum g X∪Y · Γ · g X∪Y occurs twice, which we compensated by a factor 1/2. This completes the construction of the operator v from the defining ingredients listed at the beginning of this section. Of course, in general this will not be an error correcting code nor even an isometry. The conditions for this will be studied in the following section.

III. THE CONDITION FOR ERROR CORRECTION
A general characterization of quantum error-correcting codes has first been worked out by E. Knill and R. Laflamme [17]. We briefly review here the main aspects, and adapt the condition the particular case of codes constructed as in the previous section. In this theory a quantum code is an isometry v : H → K from the "input Hilbert space" H to the "output Hilbert space" K. Thus an input density operator is transformed by coding into vρv * , which is a density operator on K. The output of the coding is then passed through a noisy channel. The noise is described by a certain class of errors, which are represented by a linear subspace E of operators on K.
The channel is thus represented by a completely positive linear map of the form where F α ∈ E. and are chosen such that the output is always normalized. The isometry v is said to be an error correcting code for E, if there is a completely positive "recovery operator" R such that for all density operators on H. By the theory of Knill and Laflamme [17] this is equivalent to the factorization condition where ω(F α , F β ) is a factor independent of the arbitrary vectors ψ 1 , ψ 2 . As in much of the literature on codes we will consider here a specific type of errors, namely errors happening only on a small number of outputs of the code. Thus the tensor product structure , which are the tensor product of an arbitrary operator on H ⊗E with the identity on H ⊗Y \E . We say that a code corrects e errors, if F α , F β in (9) may be chosen arbitrarily in the linear span of |E|≤e A(E). Note that the operators F * α F β appearing in the scalar product (9) can then be localized on arbitrary sets of 2e elements and any operator with such localization may be written as a linear combination of such F * α F β . It is therefore convenient to introduce the following terminology: we say that the code v detects the error configuration E ⊂ Y , if for all F ∈ A(E). Then a code corrects e errors, iff it detects all error configurations E ⊂ Y with |E| ≤ 2e.
We will now adapt these conditions to operators v Γ of the special form (3). Consider a fixed error configuration E ⊂ Y , and let This must be a multiple of the identity for every choice of F . Choosing, in particular, a rank one operator F = |g E h E | we find that error detection for the configuration E is equivalent to the property that the correlation function factorizes in the following manner where δ(g X ) is defined to be 1 if g x = 0 for all x ∈ X, and zero otherwise, and C(g E , h E ) is a factor independent of the input variables g X , h X . For two subsets K, L of X ∪ Y we denote by Γ K L the group homomorphism from G L to G K which can be derived from the corresponding submatrix of the incidence matrix Γ by the prescription and the following condition is necessary and sufficient for quantum error detection: Theorem III.1 Given a finite abelian group G and a weighted graph Γ as in the basic construction. Then an error configuration E ⊂ Y is detected by the quantum code v Γ iff the system of equations The proof of Theorem III.1 is given in Appendix A and, in view of this result, we discuss some examples.

IV. EXAMPLE: THE FIVEFOLD WAY
The first example of an optimal quantum error correcting code correcting all one bit errors was the famous five qubit code by [10]. The original code is not easy to verify, so it is gratifying to see that our construction produces such a code, which can be verified in a few lines. Moreover, our construction works simultaneously for all groups G, and is hence not restricted to qubits. Fivefold codes for higher dimensional systems have been constructed before [11], and if we believe a recent result by Rains [18], the qubit code is essentially unique anyway. Hence this section has mainly illustrative character.
Consider the graph in Figure 1 where the central vertex "0" is the input vertex, and the remaining five are the output vertices. We will verify the condition of Theorem III.1 in a particularly strong form. Namely we will show that, for every 2-element error configuration E, The error configuration is a 2-element subset of the output vertices 1, ..., 4, and for the purpose of verifying criterion (17) the input vertex 0 plays exactly the same role as an error. It is clear by symmetry that only the two configurations for X ∪E shown by filled dots in Figure 1 need to be considered. Now the condition Γ I X∪E d X∪E = 0 is a set of equations, one for each "integration vertex" y ∈ I: For each vertex y we have to sum the d x for all vertices of x ∈ X ∪ E connected to y, and equate to zero. (In a weighted graph, we would have to sum with coefficients given by the matrix Γ). The following is a table of equations arising in this way for the first error configuration, X ∪ E = {0, 1, 2}: Clearly, this implies d 0 = d 1 = d 2 = 0 in any abelian group. Similarly, for the second error configuration X ∪ E = {0, 1, 3}we get the equations Vertex y Equation which once again implies d 0 = d 1 = d 2 = 0. This concludes the verification that the code associated with the graph in Figure 1, and an arbitrary finite abelian group G, detects any two errors, hence corrects one error. In fact, we proved a little bit more than that. The essential part of the proof was to look at certain 3 × 3submatrices of the 6 × 6-matrix Γ, namely those corresponding to an off-diagonal block in the partition of the vertices {0, 1, . . . , 5} into two disjoint subsets X ∪ E and I, and to show that each such submatrix is non-singular. Regarded in this way, it becomes irrelevant to which of the two sets in the partition the input vertex "0" belongs, so we showed that any vertex, even a peripheral one, may be taken as input vertex, and we still get a 1-error correcting code.
This may seem like a rather strong property of the graph we chose. However, there is (exactly) one other graph with six vertices, which produces in the same way a 1-error correcting code for arbitrary choice of input vertex and abelian group G. This is shown in Figure2.

V. CODES SATURATING THE SINGLETON BOUND
In this Section we briefly discuss one natural generalization of the idea emerging in the previous section. For definiteness, let us fix G as a cyclic group of prime order d, so Z d is a field, and choose an integer m. We then ask for symmetric 2m × 2m-matrices Γ with integer entries (or, equivalently, entries in Z d ) with the following property: for any m-element subset I ⊂ {1, . . . , 2m} the m × m-submatrix Γ ij with i ∈ I, j / ∈ I is invertible in the field Z d . For the purpose of this section, let us call such a matrix strongly error correcting for the prime number d.
What codes can we get from such matrices? Just as in the previous section, let us specify any set X of k < m vertices as input vertices, and call the remaining n = (2m−k) ones output vertices. Then for any configuration of e = m − k errors, the set X ∪ E and its complement I will have exactly m elements. By assumption, the strong form of the error correcting condition (17) is satisfied, hence the code detects e errors. These parameters satisfy n = 2e + k , (18) i.e., the general inequality n ≤ 2e + k, known as the singleton bound [17] is satisfied with equality for any such code.
How can one get strongly error correcting matrices Γ in a practical way? Here is a procedure, we found easy to work with for small m, using a symbolic algebra program. First, we introduce variables for each matrix element Γ ij with i > j, and compute the determinants of all offdiagonal m × m-submatrices as symbolic expressions in these variables. As we go along fixing integer values for these Γ ij , the determinant expressions become simpler, and in some cases factorize. Each of these factors has to be kept non-zero by the next choice of a Γ ij -value. Finally, we end up with an integer matrix, whose offdiagonal m × m-submatrices all have non-zero integer determinant. Then, for any prime d, which does not divide any of these integers, we have solved the problem.
It is natural to begin this process by setting as many weights as possible equal to zero. It is easy to see that Theorem III.1 does not allow too many Γ(k, l) = 0 because an entire row of zeros in the matrix Γ I X∪E leaves one of the difference variables unconstrained. Similarly, in the condition for strong error correction it is clear that no off-diagonal submatrix should have a row of zeros, i.e., each one of the 2m vertices must be connected to at least m other vertices. The graph in Figure 3 is as sparse as possible under these constraints (m = 4), and was the starting point for a search for non-zero weights, as described above, resulting in the matrix This matrix can either be used to get codes detecting three errors on an arbitrarily chosen single input vertex, or as a code detecting two errors (or correcting 1) on two arbitrarily chosen inputs. The set of determinants is {−11, −8, −5, −4, −2, −1, 1, 2, 4, 5, 8, 9}, so this will work for any prime d not in in the set {2, 3, 5, 11}. By fixing the choice of the input vertices, we may restrict to a smaller set of partitions (the input vertices always belong to the same set), hence we get fewer constraints. For example, the code with input vertices {1, 2} has no relevant subdeterminant containing a factor 3, so the resulting code corrects one error on arbitrary pairs of 3-level systems.
Within the above example, the number of matrix elements set to zero is maximal, namely ν i = 4 for each row i = 1, · · · , 8. Looking at the corresponding graph, ν i = 4 is just the number of lines meeting a particular vertex as one can see from Figure 3. Strongly error correcting matrices exist in any dimension, so the code parameters saturating the singleton bound (18) can be chosen arbitrarily, if the dimension d of the one-site system is taken to avoid a certain finite set of primes (Compare also [5]). The argument is quite simple: consider the m × m-subdeterminants of symmetric 2m × 2m-matrices as a family of polynomials f α , α = 1, · · · , 2n n in 2n 2 variables. None of these vanishes identically and since Z is an integral domain, which in contrast is wrong for finite fields, the product polynomial α f α = 0 is non zero [19, p. 106]. This implies that there exists an integer tuple Γ of arguments that α f α (Γ) = 0. Thus we have shown the following statement: Proposition V.1 For each number e of errors, there exists a prime d and a weighted graph Γ such that the quantum code, associated with the weighted graph Γ, is a quantum error correcting code, which encodes k d-level systems into 4e + k p-level systems, and which corrects e errors.

VI. A 10-FOLD QUANTUM ERROR-DETECTING CODE
In this section we present more complex example for a graph, which yields for every finite abelian group G a 10-bit code, detecting 3 errors is given by Figure 4. At the first look, this graph looks rather complicated, but it can be described in a simple fashion, by looking at the graph for the fivefold code in Figure 1. Namely, the graph, given by Figure 4, can be obtained as follows: The output vertices {1, 2, 3, 4, 5} of the graph in Figure 1 are replaced by pairs: 1 → {1, 2}, 2 → {3, 4}, . . . , 5 → {9, 10}. Each output vertex is connected with the following vertices: The central input vertex 0, the vertex belonging the same pair, and all output vertices belonging to neighbored pairs.
The symmetry of this graph can efficiently be used to check that each error configuration with 3 errors can be detected. As it is depicted by Figure 5, there are only four 3-error configurations to distinguish: Proposition VI.1 For each finite abelian group G, the quantum code, which is associated with the graph given by Figure 5, is a quantum error-detecting code, encoding 1 input system into 10 output systems and detecting 3 errors.
Proof: Suppose that each error occurs in different pairs and all these pairs are neighbored (first graph in Figure  5), e.g. the error configuration {1, 3, 5}. Then we proceed as in the example for the fivefold code to obtain the system of equation (15): Analogously, one checks that each error configuration, where each error occurs in a different pair and only two of these pairs are neighbored (second graph in Figure 5) is also detected.
We now consider an error configuration, where one pair {1, 2} is totally corrupted and the remaining error vertex, e.g. 5, is contained within a non-neighbored pair (third graph in Figure 5). We obtain for the system of equations (15): and we conclude again that d 0 = 0 and d 1 + d 2 + d 5 = 0 is true. The equations (16) are fulfilled which implies that the corresponding error configuration is also detected. Finally, it is a bit more straightforward as in the previous case to show that an error configuration, where two errors occur within one pair and the remaining error within a neighbored pair (4th graph in Figure 5) is detected.

VII. CONCLUSION AND OUTLOOK
In this paper we had to limit the exploration of our construction scheme to a few examples. A more systematic investigation is, of course, under way. Some of the issues in this investigation are the following.
• We already mentioned that all codes constructed from graphs are stabilizer codes. This is verified by explicitly constructing a group of unitaries, composed out of shifts and multiplication by characters, leaving all vectors in the code space invariant. The converse of this statement is not so clear, i.e., how to embed the usual stabilizer code constructions into our scheme, and to characterize the subset of codes for which this is possible.
• We have seen in Sec. IV that different graphs generate 5-qubit codes, although such codes are presumably unique up to local transformations. It would be helpful to characterize the local unitary transformations taking one graph code into another, and to study the relationships between the resulting graphs. The Rains invariants [20][21][22] for graph codes can be computed relatively easily, and should help to decide such isomorphism issues.
• From Sec. V it is clear that the singleton bound becomes easier and easier to satisfy as the dimension d of the single system Hilbert space increases. This suggests the search for bounds describing the resource limitations in coding more adequately, perhaps by taking into account more detailed features of the error syndromes than just the maximal number of errors. Our construction could be helpful for developing and testing such bounds.
• Non-stabilizer quantum codes can be constructed from families of stabilizer codes by taking their union [23], where one has to require that the protected subspaces, corresponding to the codes within the family, are mutually orthogonal and that this property remains valid after error operations. Examples of such non-stabilizer codes are given in [24,25]. In view of our construction scheme, it would be desirable to find sufficient conditions for a family of graphs such that the union of their corresponding graph codes yields a (possibly more efficient) non-stabilizer code.
From now on we assume, as we may, that Γ I X∪E (d X∪E ) = 0 implies d X = 0. Then the dependence of (A6) on the input variables g X and h X can be simplified. The δ-function can be written as because the two expressions are equal for h X = g X , and for h X = g X they both vanish by assumption.
To simplify the bicharacter quotient in (A6), we use Eq. (A1) to write With a similar decomposition of χ Γ (g X∪E , g X∪E ) we use the condition that, wherever the δ-function in (A6) is non-zero, we have g X = h X . Hence the X − X factors cancel, and we can write the quotient of the X − E-terms as For (A6) to be of the desired form (A7) with C(g E , h E ) independent of the X-variables, this expression must be independent of all h j , j ∈ X, whenever δ Γ I E (h E − g E ) = 0. But (A10) is independent of h j if and only if i Γ ji (h i − g i ) = 0. Hence we must have that Γ I E (h E − g E ) = 0 implies Γ X E (h E − g E ) = 0. This is the second condition from Theorem III.1, which we have thus shown to be necessary. Conversely, it is sufficient to ensure that (A10) is equal to 1, and (A6) has the desired form (A7) with This concludes the proof.