Abstract
Quantum error correction (QEC) is essential for protecting quantum information against noise, yet understanding the structure of the Knill-Laflamme (KL) coefficients \(\left\{{\lambda }_{ij}\right\}\) from the condition \(P{E}_{i}^{\dagger }{E}_{j}P={\lambda }_{ij}P\) remains challenging, particularly for nonadditive codes. In this work, we introduce the signature vector \(\overrightarrow{\lambda }(P)\), composed of the off-diagonal KL coefficients \(\left\{{\lambda }_{ij}\right\}\), where each coefficient corresponds to equivalence classes of errors counted only once. We define its Euclidean norm λ*(P) as a scalar measure representing the total strength of error correlations within the code subspace defined by the projector P. We parameterize P on a Stiefel manifold and formulate an optimization problem based on the KL conditions to systematically explore possible values of λ*. Moreover, we show that, for ((n, K, d)) codes, λ* is invariant under local unitary transformations. Applying our approach to the ((6, 2, 3)) quantum code, we find that \({\lambda }_{\min }^{* }=\sqrt{0.6}\) and \({\lambda }_{\max }^{* }=1\), with λ* = 1 corresponding to a known degenerate stabilizer code. We construct continuous families of new nonadditive codes parameterized by vectors in \({{\mathbb{R}}}^{5}\), with λ* varying over the interval \([\sqrt{0.6},1]\). For the ((7, 2, 3)) code, we identify \({\lambda }_{\min }^{* }=0\) (corresponding to the non-degenerate Steane code) and \({\lambda }_{\max }^{* }=\sqrt{7}\) (corresponding to the permutation-invariant code by Pollatsek and Ruskai), and we demonstrate continuous paths connecting these extremes via cyclic codes characterized solely by λ*. Our findings provide new insights into the structure of quantum codes, advance the theoretical foundations of QEC, and open new avenues for investigating intricate relationships between code subspaces and error correlations.
Similar content being viewed by others
Introduction
Quantum error correction (QEC) is essential for protecting quantum information from the noise and errors that inevitably arise in quantum systems1,2,3,4,5,6. A deeper understanding of the structure of the set given by all possible coefficients \(\left\{{\lambda }_{ij}\right\}\), which arise from the Knill-Laflamme (KL) conditions \(P{E}_{i}^{\dagger }{E}_{j}P={\lambda }_{ij}P\)7, can provide valuable insights into the performance and underlying properties of quantum error-correcting codes. However, achieving this understanding is challenging. Nonadditive codes, which lie outside the stabilizer formalism, are particularly difficult to analyze, as relatively few examples have been systematically studied8,9,10. Moreover, degenerate codes–where multiple errors produce the same effect on the code space–exhibit inherently quantum phenomena, such as overlapping error syndromes, that lack classical analogues and remain poorly understood11,12. These complexities make it difficult to systematically explore the structure of the set of all possible \(\{{\lambda }_{ij}\}\) values. As a result, there is currently no comprehensive framework for understanding the distribution of these coefficients, leaving important questions about their structure and implications for quantum error correction unanswered.
We analyze the structure defined by the set of all possible values of \(\{{\lambda }_{ij}\}\) that satisfy the KL conditions, which govern how pairs of errors interact within the code subspace defined by P. To encapsulate these interactions, we introduce signature vector \(\overrightarrow{\lambda }(P)\), composed of the off-diagonal elements \(\left\{{\lambda }_{ij}\right\}\) (with each coefficient corresponding to equivalent errors counted only once), which capture the non-trivial correlations between errors. The overall strength of these interactions is quantified by λ*(P), the Euclidean norm of the signature vector. This scalar value provides a measure of the total strength of error interactions within the code subspace, offering a new perspective on the role of these interactions in QEC. Crucially, for ((n, K, d)) codes, λ* is a function of the purity of the local reduced density matrices (RDMs) of the codewords, making it invariant under local unitary operations. This local unitary invariance allows λ* to serve as a powerful tool for distinguishing locally unitary inequivalent quantum codes and identifying different codes based on their error interaction structures.
The focus of this paper is to study the range of λ*: to understand the minimum and maximum values of λ* (denoted by \({\lambda }_{\min }^{* }\) and \({\lambda }_{\max }^{* }\)), and to determine whether the range of λ* is connected between these extrema. As a baseline, in the stabilizer-code setting under a Pauli error model, the KL coefficients satisfy λij ∈ {0, ± 1} after fixing a consistent phase convention. Identifying each off-diagonal equivalence class only once (i.e., whenever \({E}_{i}^{\dagger }{E}_{j}\) and \({E}_{{i}^{{\prime} }}^{\dagger }{E}_{{j}^{{\prime} }}\) coincide up to phase), we obtain \({\lambda }^{* }{(P)}^{2}={\sum }_{i < j}{\lambda }_{ij}^{2}\in {\mathbb{N}}\), so stabilizer codes admit a discrete spectrum of λ*. This stands in sharp and interesting contrast to the continuous ranges of λ* that we will establish for nonadditive codes.
Using our method, we find that for the ((6, 2, 3)) quantum code, \({\lambda }_{\min }^{* }=\sqrt{0.6}\) and \({\lambda }_{\max }^{* }=1\). The value λ* = 1 corresponds to the degenerate stabilizer code described in13. However, there were no known codes corresponding to \({\lambda }^{* }=\sqrt{0.6}\). We construct families of nonadditive codes, parameterized by four mutually orthogonal real vectors \(a,b,c,d\in {{\mathbb{R}}}^{5}\), with λ* parameterized by a vector \(e\in {{\mathbb{R}}}^{5}\), orthogonal to a, b, c, d, which varies continuously over the interval \([\sqrt{0.6},1]\). This confirms that the range of λ* for the ((6, 2, 3)) code is indeed \([\sqrt{0.6},1]\). For each distinct value of \({\lambda }^{* }\in [\sqrt{0.6},1]\), our construction yields locally inequivalent codes, parameterized by the vector \(e\in {{\mathbb{R}}}^{5}\).
For the ((7, 2, 3)) code, we find that \({\lambda }_{\min }^{* }=0\) and \({\lambda }_{\max }^{* }=\sqrt{7}\), where λ* = 0 corresponds to the non-degenerate Steane code14,15, and \({\lambda }^{* }=\sqrt{7}\) corresponds to the permutation-invariant code proposed by Pollatsek and Ruskai16. We identify families of cyclic ((7, 2, 3)) codes that trace continuous paths in the solution space. These paths, each characterized by a single parameter, which is simply λ*, with λ* varies continuously over the interval \([0,\sqrt{7}]\), directly connecting the Steane code and the permutation-invariant code. This finding demonstrates that it is possible to smoothly connect these two distinct codes while preserving cyclic symmetry, offering new insights into the relationship between different locally inequivalent quantum codes and their symmetry properties.
Our approach offers a systematic method to explore the range of λ*, resulting in the construction of numerous new nonadditive codes for ((6, 2, 3)) and ((7, 2, 3)), with λ* varying continuously from \({\lambda }_{\min }^{* }\) to \({\lambda }_{\max }^{* }\). The ability to identify and quantify the range of λ* provides novel insights into the structure of quantum codes, particularly in nonadditive cases. This framework opens new avenues for investigating the intricate relationships between code subspaces and error interactions, offering a deeper understanding of the mathematical structure underlying quantum error correction.
We organize our paper as follows. In Section II A, we discuss preliminaries on quantum error correction and code parameters. In Section II B, we define the signature vector and its norm λ*, show that λ* is invariant under local unitary operations by linking it to the purity of the RDMs of codewords, and develop an algorithm to find the maximum and minimum values of λ*. In Sections II D and II E, we apply our method to the ((6, 2, 3)) and ((7, 2, 3)) quantum codes, respectively, demonstrating how λ* varies and constructing new nonadditive codes.
Results
Preliminary
In quantum error correction, it is our goal to protect quantum information from errors caused by a noisy quantum channel. Quantum error-correcting codes (QECCs) are constructed to correct a specified set of errors {Ei}. The Knill-Laflamme (KL) condition for quantum error correction can be expressed as:
where P denotes the projector onto the code subspace, Ei and Ej represent the Kraus operators corresponding to the possible errors, and \(\left\{{\lambda }_{ij}\right\}\) are complex scalars that characterize how the pair of errors Ei and Ej interact within the code subspace. This condition ensures that errors are correctable, provided that they act within the designated subspace and satisfy this equation.
The dimension of the code subspace is denoted as K, and if the logical information is encoded in a subspace of K-dimensional logical qubits within an n-dimensional physical qubit system, then P is an n × n matrix, and its rank equals K. The code subspace \({\mathcal{C}}\) can be written as the span of orthonormal basis vectors \(\{\left\vert {\psi }_{1}\right\rangle ,\left\vert {\psi }_{2}\right\rangle ,\ldots ,\left\vert {\psi }_{K}\right\rangle \}\), which span the logical space. The projector onto the code subspace is given by
The quantum error correction condition can then be expressed in terms of the basis vectors spanning the code subspace:
where the scalars \(\left\{{\lambda }_{ij}\right\}\) describe how the errors Ei and Ej affect the code subspace.
A non-degenerate QECC is characterized by the Hermitian matrix \(\{{\lambda }_{ij}\}\) being non-singular (having full rank), which means that the determinant of \(\{{\lambda }_{ij}\}\) is non-zero and the matrix is invertible1. This implies that all errors have distinct effects on the code space and can be uniquely identified and corrected. In contrast, a degenerate QECC arises when the matrix \(\{{\lambda }_{ij}\}\) is singular (not of full rank), indicating that there are linear dependencies among the error operators when restricted to the code space4. Some errors or combinations of errors may have the same effect on the code space, making them indistinguishable. A completely degenerate code, or decoherence-free subspace (DFS), represents an extreme case where all \(\{{\lambda }_{ij}\}\) elements are equal, resulting in a matrix of rank 1, meaning λij = λ for all i, j. In this scenario, the code space remains invariant under certain noise processes11,17.
An ((n, K, d)) quantum error-correcting code is defined by three key parameters: n, the number of physical qubits used to encode the quantum information; K, the dimension of the code space, which corresponds to the number of logical qubits the code can protect (for example, if K = 2k, the code protects k logical qubits); and d, the distance of the code, which determines the minimum number of physical qubit errors required to cause a logical error. The distance d indicates the code’s ability to detect and correct errors. Specifically, an ((n, K, d)) code can detect up to d − 1 qubit errors and correct up to \(t=\left\lfloor \frac{d-1}{2}\right\rfloor\) qubit errors1,4. A well-known example is the Steane code, which is a ((7, 2, 3)) code. This code encodes one logical qubit into seven physical qubits and can correct up to one qubit error and detect up to two qubit errors4.
Furthermore, quantum error-correcting codes may either be non-additive or additive. Non-additive codes are a generalization of stabilizer (additive) codes and allow encoding of quantum information without adhering to the 2k constraint for the dimension K. The code distance d, which is the minimum weight of an undetectable error, remains critical in both types of codes, as it determines how many errors can be detected and corrected.
Two quantum error-correcting codes P1 and P2 are locally equivalent if one can be transformed into the other by local unitary operations or local Clifford operations applied to individual qubits. Formally, P1 and P2 are locally equivalent if there exists a unitary transformation U = U1 ⊗ U2 ⊗ ⋯ ⊗ Un, where each Ui acts on a single qubit, such that P2 = UP1U†. This local equivalence ensures that the overall structure of the code and parameters n, K, d are preserved, even though individual states within the code space may change under the transformation3.
In practice, to test whether two ((n, K, d)) codes P1 and P2 are local unitary equivalent, we can use Quantum weight enumerators18, which were defined by
with coefficients
Here
are n-fold tensor product. Denote the number of X factors, Y factors and Z factors in Oα as wtX(Oα), wtY(Oα), and wtZ(Oα). The weight of Oα is
Signature vector
We motivate the idea of a “signature vector” via the joint rank-Knumerical range for a set of operators \({\{{A}_{i}\}}_{i = 1}^{m}\), defined as19,20
Thus, W(K) consists of all vectors \(\overrightarrow{\lambda }(P)=({\lambda }_{i})\) that arise from some K-dimensional projector P satisfying PAiP = λiP.
The joint rank-1 numerical range is connected, and for m = 2 Hermitian operators it is convex by the Toeplitz–Hausdorff theorem19,20; this convexity extends to higher ranks as well21,22. For m > 2, however, the geometry of joint higher-rank numerical ranges is much less understood23,24,25,26,27. In particular, for K≥2 the set is generally non-convex and may have disconnected components. As an example, consider two qubits with A1 = X ⊗ I, A2 = X ⊗ Z, A3 = Y ⊗ I, A4 = Y ⊗ Z, A5 = Z ⊗ I. One can show that the joint rank-2 numerical range consists of exactly two points,
and is therefore disconnected.
To adapt \(\overrightarrow{\lambda }(P)\) to an ((n, K, d)) code, let
denote the set of all Pauli operators of weight less than d including identity, and define
We call \(\overrightarrow{\lambda }(P)\in {{\mathcal{W}}}_{{\rm{error}}}\) a signature vector if
In the Knill–Laflamme (KL) form,
we take \(\overrightarrow{\lambda }\) to be the collection of all distinct off-diagonal coefficients λij (i ≠ j), identifying pairs (i, j) and \(({i}^{{\prime} },{j}^{{\prime} })\) whenever \({E}_{i}^{\dagger }{E}_{j}\) and \({E}_{{i}^{{\prime} }}^{\dagger }{E}_{{j}^{{\prime} }}\) coincide with the same Pauli (up to an overall phase).
We are particularly interested in the length of the signature vector, denoted λ*(P), defined by
This quantity provides a scalar measure of the aggregate strength of error couplings on the code subspace determined by P28. Trivially, λ*(P)≥0, with λ*(P) = 0 achievable when all off-diagonal KL coefficients vanish (e.g., in a non-degenerate stabilizer code). For a fixed noise model, a natural upper bound is approached when the code forms a decoherence-free subspace (DFS), where \({E}_{i}\left\vert \psi \right\rangle ={c}_{i}\left\vert \psi \right\rangle\) on the code so that \(P{E}_{i}^{\dagger }{E}_{j}P={c}_{i}^{* }{c}_{j}P\); under appropriate normalization this yields the maximal possible value of λ*.
To clarify the physical content of λ*, we first establish that it is invariant under local unitaries, and then relate it to the entropy of the code. These are specific features of the error model adopted for the analysis of ((n, K, d)) codes. We then propose a numerical procedure to estimate the attainable range of λ*, which also provides insight into the geometry of W(K) in general.
The physical meaning of λ * for ((n, K, d)) codes
We now show the local unitary invariance (LUI) of λ*. Given a quantum state \(\left\vert \psi \right\rangle\), the RDM for the i-th subsystem is defined as:
where \({{\rm{Tr}}}_{{(i)}^{c}}\) denotes the partial trace over all subsystems except the i-th one. An n-RDM is defined as:
The purity of this RDM is given by:
and since purity is invariant under local unitary transformations, the purity for 1-RDM, 2-RDM, ..., and up to (d-1)-RDM is also LUI. For an ((n, K, d)) code, the (d-1)-qubit RDM is the same for any state \(\left\vert \psi \right\rangle\) within the code subspace, hence all the lower order RDMs are also independent of the state \(\left\vert \psi \right\rangle\).
Next, consider the vector \({\lambda }^{(i)}=({\rm{Tr}}[{\rho }^{(i)}{X}_{i}],{\rm{Tr}}[{\rho }^{(i)}{Y}_{i}],{\rm{Tr}}[{\rho }^{(i)}{Z}_{i}])\), which captures how the i-th subsystem interacts with the Pauli operators. The length of this vector is LUI, and is expressed as:
This can be rewritten in terms of the purity as \(\parallel {\lambda }^{(i)}{\parallel }_{2}^{2}=2{\rm{Tr}}\left[{\left({\rho }^{(i)}\right)}^{2}\right]-1\), demonstrating that ∥λ(i)∥2 is LUI.
Now, let λ(ij) be a vector with 9 components, corresponding to the two-qubit interactions:
The length of this vector is also LUI, and is given by:
We can express this as:
where each term on the right-hand side has already been shown to be LUI.
With invariance of weight-1 and weight-2 vectors, in a similar fashion, the length of weight-(d-1) vectors ∥λ(ij⋯ )∥2 can be proven to be LUI. Consequently, the length of the signature vector is given by:
which is also LUI, as all terms involved are LUI. The LUI property can also be observed from the connection with quantum weight enumerators in Eq.(5). E.g., when d = 3, \({\lambda }^{* 2}={\sum }_{i}\parallel {\lambda }^{(i)}{\parallel }_{2}^{2}+{\sum }_{ij}\parallel {\lambda }^{(ij)}{\parallel }_{2}^{2}={A}_{1}+{A}_{2}\).
Since λ* is LUI, it follows that if two quantum codes P1 and P2 correspond to different values of λ*, i.e., λ*(P1) ≠ λ*(P2), then the two codes must be local unitary inequivalent. This means that the distinct values of λ* reflect different structures in the code subspaces that cannot be transformed into one another via local unitary operations. This shows that λ* serves as a useful tool for distinguishing some local unitary inequivalent codes. However, the converse does not hold: two local unitary inequivalent codes may correspond to the same value of λ*.
Beside the connection between λ* and the quantum weight enumerators and purity of RDMs, we also establish how the quantity λ* connects to the second-order Rényi entropy of the Knill-Laflamme (KL) matrix. The KL matrix Λ has elements
where P is the projector onto the code space, and {Ei} are the error operators. By construction, Λ captures the pairwise overlaps of errors within the code space.
To interpret Λ as a density matrix, we normalize it as
The second-order Rényi entropy of the normalized matrix is
Since \({\mathrm{Tr}}\,(\Lambda )={\sum }_{i}{\lambda }_{ii}={\sum }_{i}1=m\) (often taken to be the code-space dimension), we have
By definition,
where A1 is the first-order quantum error enumerator introduced in Eq. (5). Since \(\{\mathrm{Tr}\,[P\,{O}_{i}]\}\) transforms as a vector under local unitary (LU) rotations, A1 remains invariant under LU transformations. Putting these observations together, we get
Consequently,
This shows that the second-order Rényi entropy of the KL matrix (once normalized) depends directly on λ*, reinforcing the view that λ* serves as a measure of the off-diagonal correlation strength among the error operators.
The local-unitary invariance (LUI) of λ*, together with its connections to several physical quantities, indicates that λ* is a useful measure of codeword properties and physical quantities invariant to choice of basis or representation. The robustness, and the numerical efficiency working in the Stiefel manifold in Section IV A, make λ* a useful tool for finding the code with new error models. These properties, however, are specific to the error model adopted for our analysis of ((n, K, d)) codes. In particular, the LUI statement for λ* holds for any complete set of Hermitian error operators (P ↦ UPU†, Ei ↦ UEiU†), or arbitrary local changes of basis (Ei ↦ ∑kVikEk, Λ ↦ VΛV†); extensions to non-Hermitian errors lie beyond the present derivation. Nevertheless, the numerical procedure developed below is still valid with minimal modification and remains useful for finding the code with new error models.
((6, 2, 3)) codes
It is well known that ((5, 2, 3)) code is unique up to local unitary equivalence, with signature vector \(\overrightarrow{\lambda }=0\), hence the range of λ* is a single point 0. Much less is known about the range of λ* for the case of ((6, 2, 3)). For stabilizer codes, there are only degenerate ones, for example the stabilizer code given in13, with stabilizers given by
For this code, all components of signature vector are zero except the term \(\left\langle {0}_{L}\right\vert {Z}_{4}{Z}_{6}\left\vert {0}_{L}\right\rangle =1\), hence λ* = 1. All the other ((6, 2, 3)) codes found in29 also have λ* = 1.
To find the range of λ*, we sample λ* ∈ [0.5, 1.1], then calculate the optimal value for \({\mathcal{L}}\left(\theta ;\mu ,{\lambda }^{* }\right)\) in eq. (67). The results are shown in Fig. 1. For all optimizations, the violations of error-correcting conditions are less than \({{\mathcal{L}}}_{{\rm{KL}}}\le 1{0}^{-14}\). From the figure, a sharp transition from almost zero to nonzero can be observed, which indicates \(\parallel \lambda {\parallel }_{2}^{2}\in [0.6,1.0]\). This two boundaries are also found via optimizing \({{\mathcal{L}}}_{\overline{\lambda }}\) and \({{\mathcal{L}}}_{\underline{\lambda }}\).
To construct codes with \(\sqrt{0.6}\le {\lambda }^{* }\le 1\), denote the six qubits by q1q2q3q4q5q6, and choose the following five bases for qubits q2q3q4q5q6
Now choose logical states as:
Here
The KL condition reduces to the following conditions on \(\left\vert {x}_{i}\right\rangle\) and \(\left\vert {y}_{i}\right\rangle\) (see Supplementary Information A for details):
Notice that this is equivalent to require that the RDM of q1 is \(\frac{I}{2}\).
Our code are then designed in the following 10-dimensional subspace
We choose this subspace because our numerical results indicate that all 2-RDM of pure states the code space take the form:
In Supplementary Information A, we list the explicit form of 2-RDM for any pair of qubits i, j.
Now let
for j = 1, 2, 3, 4, 5. Where \({a}_{j},{b}_{j},{c}_{j},{d}_{j}\in {\mathbb{R}}\). Define the column vectors a, b, c, and d to be:
Then the KL condition will give the following conditions on a, b, c, d:
This means that a, b, c, d are orthogonal vectors in \({{\mathbb{R}}}^{5}\).
We then choose e being the vector orthogonal to a, b, c, d, that is, the unnormalized orthogonal matrix composed from (a, b, c, d, e) as A
which means each column (row) are orthogonal to each other. In other words, 2A is a 5 × 5 orthogonal matrix.
It turns out that the nonzero element of the signature vector, denoted as \(P{E}_{i}^{\dagger }{E}_{j}P={\lambda }_{ij}P\) of this code is given by the element of e (see Supplementary Information A for details):
And
This means that λ* is invariant with the rotation within the subspace spanned by (a, b, c, d). To further understand this invariance, we can view \(\left\vert {0}_{L}\right\rangle\) and \(\left\vert {1}_{L}\right\rangle\) as bipartite states between q1 (Party I) and q2q3q4q5q6 (Party II). For Party I, an orthogonal transformation (i.e. 2A, change of basis in the subspace spanned by \(\left\vert {S}_{i}\right\rangle\)) will correspond to a unitary transformation on Party II, hence will not change the RDM of Party I. This unitary in general cannot be realized by LU transformations on q2q3q4q5q6, hence will lead to LU inequivalent codes.
It turns out (see Supplementary Information A for details), however, when e is chosen, the freedom in the choice of (a, b, c, d) will lead to locally equivalent codes. This is due to the fact that, all such choices, given by
where O is any 4 × 4 orthogonal matrix, can be generated by
-
1.
local unitary transformations on party I (i.e. the first qubit) (leading to LU equivalent code), and
-
2.
unitary transformations in the logical space spanned by \(\left\vert {0}_{L}\right\rangle\) and \(\left\vert {1}_{L}\right\rangle\) (leading to the same code).
In other words, the choice of e will in general lead to local inequivalent codes. Furthermore, combined with the fact there is a single parameter family of codes that connect \({\lambda }_{\min }^{* 2}=0.6\) to \({\lambda }_{\max }^{* 2}=1\) in Section II D, we found that the signature vector space is connected when choosing the logical states as in Eq. (28), which is the subspace of the whole signature vector space \({{\mathcal{W}}}_{{\rm{error}}}\).
Specifically, the vector e for \({\lambda }_{\min }^{* 2}=0.6\) is
and for \({\lambda }_{\max }^{* 2}=1\)
To have a single-parameter family of codes that connect \({\lambda }_{\min }^{* }\) to \({\lambda }_{\max }^{* 2}=1\), since λ* is only dependent on e, let us choose a single parameter family for e
for \(\cos \theta \in [\frac{1}{\sqrt{5}},1]\).
Now we can choose the matrix A as
This gives a single parameter family of codes with the corresponding
runs continuously from 0.6 to 1.
For this family of codes, the matrix \(\left\{{\lambda }_{ij}\right\}\) will be block diagonal, and each block corresponding to XiXj, YiYj, ZiZj correlations, with the form (we only need to consider \(i,j\in \left\{2,3,4,5,6\right\}\):
The eigenvalues of the matrix are:
Notice that
So the XiXj, YiYj blocks are the same and correspond to
And
The ZiZj block corresponds to
So the matrix \(\left\{{\lambda }_{ij}\right\}\) will be full rank for \(\cos \theta \in \left[\frac{1}{\sqrt{5}},1\right)\), i.e. \({\lambda }^{* }\in \left[\sqrt{0.6},1\right)\). For \(\cos \theta =1\), i.e. λ* = 1, we have λB5 = 0.
The enumerator is found to be:
When \(\cos (\theta )=1\), we have \({\lambda }_{\max }^{* 2}=1\), and
The code subspace, spanned by \((\left\vert {0}_{L}\right\rangle ,\left\vert {1}_{L}\right\rangle )\), resides within the ground state space of the Hamiltonian
which is 16-dimensional degenerate, and is spanned by
This implies that the signature vector \(\overrightarrow{P}\) lies on the boundary of W(1)({Oα}), where wt(Oα) = 1, 2.
((7, 2, 3)) codes
For the ((7, 2, 3)) case, consider the Steane code with stabilizers
This code has a signature vector \(\overrightarrow{\lambda }=0\), corresponding to λ* = 0. To find the maximum value of λ*, we run our algorithm and observe a sharp transition at \({\lambda }^{* }=\sqrt{7}\), as shown in Fig. 2.
It turns out that this maximum value \({\lambda }^{* }=\sqrt{7}\) corresponds to the permutation invariant code, which is constructed from the Dicke basis:
Two permutation invariant codes are given in16 as:
and
Notice that these two codes are local-unitary equivalent.
Now the key question is again, whether the set of all λ*s is connected, i.e., whether the range of λ* is indeed \([0,\sqrt{7}]\). Notice that by permuting the qubits, Steane code can have cyclic symmetry, with logical 0 and logical 1 given by
and \(\left\vert {1}_{L}\right\rangle ={X}^{\otimes 7}\left\vert {0}_{L}\right\rangle .\) Here cyc. denotes all the other computational basis states with cyclic shift. Now we will explicitly construct families of cyclic codes with \({\lambda }^{* }\in [0,\sqrt{7}]\).
Let us choose the cyclic basis with even weights:
Using this basis, we parametrize \(\left\vert {0}_{L}\right\rangle\) and \(\left\vert {1}_{L}\right\rangle\) as follows:
Within the five-dimensional subspace given in Eq. (38), KL conditions will lead to three independent equations. Combined with normalization condition, the coefficients (c0, c1, c2, c3, c4) should satisfy the following four equations:
And for the signature vector, the following components are nonzero, satisfying (for i ≠ j):
From Eq. (41) and Eq. (42) we obtain:
To solve these equations, we first find one solution for c4 (see Supplementary Information B for details):
Then Eq. (48) and Eq. (46) derive another linear relation:
Plug Eq. (48) and Eq. (49) into Eq. (39), (40), (43), (44), (45), (46) and (47), one finds f (for i ≠ j):
Since the signature vector components ((54), (55) and (56)) are equal, it is convenient to introduce λ* as a parameter (for i ≠ j):
By eliminating c0 and c3 through Eq. (51) and Eq. (54), we find \({c}_{1}=\pm \frac{\sqrt{\sqrt{7}{\lambda }^{* }}}{8}\). With parameter \({\lambda }^{* }\in [0,\sqrt{7}]\), they become Steane code when λ* = 0, and parametric code at \({\lambda }^{* }=\sqrt{7}\). The following two QECCs are related to QECC in eq. (35):
The following two correspond to QECC in Eq. (36)
For the quantity inside the square root non-negative, it requires \({\lambda }^{* }\le \sqrt{7}\). The signature vector for these four codes are the same with the following nonzero components (for i ≠ j:
This means that all the 2-particle reduced density matrix of the code have the form
Consequently, the matrix \(\left\{{\lambda }_{ij}\right\}\) will be block diagonal, and each block corresponding to XiXj, YiYj, ZiZj correlations, with the form
where:
-
I is the 7 × 7 identity matrix.
-
J is the 7 × 7 matrix with all entries equal to 1.
This matrix (1 − s)I + sJ has full rank and with one eigenvalues 6x + 1 and six eigenvalues 1 − s.
For the family given in Eq. (60), weight enumerators is given by
We have also explored all the local Clifford inequivalent ((7, 2, 3)) stabilizer codes, and found that the only possible values of λ* are \(\{0,\sqrt{1},\sqrt{2},\sqrt{3},\sqrt{5}\}\) (see30 for details). For instance, the Bare code31 corresponds to \({\lambda }^{* }=\sqrt{5}\).
When \({\lambda }^{* }={\lambda }_{\max }^{* }=\sqrt{7}\), the code subspace, spanned by \((\left\vert {0}_{L}\right\rangle ,\left\vert {1}_{L}\right\rangle )\), resides within the ground state space of the Hamiltonian
This ground state space is 8-dimensional and corresponds to the symmetric subspace spanned by the Dicke basis. This implies that the signature vector \(\overrightarrow{P}\) lies on the boundary of W(1)({Oα}), where wt(Oα) = 1, 2.
Discussion
We introduce a local-unitary invariant λ*(P), built from the off-diagonal Knill-Laflamme coefficients, and characterize its attainable range via optimization over the Stiefel manifold. For ((6, 2, 3)) and ((7, 2, 3)) codes, we identify continuous families of nonadditive codes that interpolate between extremal values of λ*. These numerical observations are corroborated by explicit analytic constructions of the same families, thereby certifying that λ* varies continuously in the exact KL regime.
Our analysis is set in the exact Knill-Laflamme (KL) regime, where both the optimal recovery and the Petz (transpose) recovery achieve entanglement fidelity Fe = 1 for the designed error set. In this regime, λ* is not a performance proxy; rather, it characterizes the internal pattern of error correlations within exact codes. For approximate error correction, Fe is governed instead by the size of the KL residuals PFαP − λαP, not by λ* itself. Although a direct comparison therefore lies outside our present scope, the numerical framework extends naturally to the approximate setting (by incorporating a penalty term for KL residuals) and can report λ* alongside a residual norm that correlates with, and is expected to control, Fe (for both optimal and Petz recovery). A systematic study of this joint landscape is a promising direction for future work.
The continuity observed in λ* for distance-3 codes suggests an organizing principle for nonadditive constructions. Clarifying, in greater generality, when the λ* range is connected, and developing explicit fidelity bounds conditioned on small KL residuals while stratified by λ*, are natural next steps. Furthermore, the present framework served as the methodological foundation for our subsequent study on transversal gates32. By adapting the Stiefel-manifold optimization approach developed here, we were able to enforce both the Knill-Laflamme conditions and target transversal-group constraints, ultimately discovering new codes with non-Clifford transversal gates. This continuity highlights the broader applicability of the λ*-based approach to code discovery problems.
Finally, because λ* depends on the behavior of RDMs, exploring its connection to quantum entanglement measures, such as concentratable entanglement33, may yield new insights into the structure and effectiveness of quantum codes. A deeper grasp of how λ*, entropy, and entanglement measures interrelate could provide a stronger theoretical foundation for designing and improving quantum error-correcting codes.
Methods
Algorithm for calculating range of λ *
To parameterize the code space P, we use Stiefel manifold:
Parametrization for Stiefel manifold is given by:
Above is the polar decomposition which maps (full rank) complex matrix \(\theta \in {{\mathbb{C}}}^{m\times n}\) to a Stiefel matrix and all Stiefel matrices can be generated in such a way34. We embed the code subspace into Stiefel manifold:
For the parametrized states Ψ (not a valid code yet), we can calculate the tensor \({\tilde{\lambda }}_{\alpha ,i,j}=\langle {\psi }_{i}| {O}_{\alpha }| {\psi }_{j}\rangle\). For the subspace to be a valid code, the following loss term \({{\mathcal{L}}}_{{\rm{KL}}}\) should be optimized to zero:
The two loss terms in \({{\mathcal{L}}}_{{\rm{KL}}}\) are introduced to ensure the validity of the code and penalize the deviation from the KL conditions. To find the minimum length of λ vector, we can optimize the following loss
with \({{\mathcal{L}}}_{{\rm{KL}}}\) added as penalty and the hyper-parameter μ control the penalty strength. For a large enough μ, the optimal value of \({{\mathcal{L}}}_{\underline{\lambda }}\) should correspond to λ with minimum length.
Similarly, to find the maximal length of λ, we optimize the following loss function:
To find whether a code exists with length of λ equal to λ*, we can define such a loss function:
Notice that similarly one can also find the code with a predefined vector \(\overrightarrow{\lambda }\), just choose the loss function as:
Data availability
All results presented are reproducible using the code available in our public repository36.
Code availability
The code used in this work is available in our public repository36.
References
Calderbank, A. R. & Shor, P. W. Good quantum error-correcting codes exist. Phys. Rev. A 54, 1098–1105 (1996).
Nielsen, M. A. & Chuang, I. L.Quantum Computation and Quantum Information: 10th Anniversary Edition (Cambridge University Press, 2010).
Gottesman, D. Stabilizer codes and quantum error correction. arXiv: Quantum Physics (1997). https://api.semanticscholar.org/CorpusID:118824832.
Steane, A. M. Error correcting codes in quantum theory. Phys. Rev. Lett. 77, 793–797 (1996).
Lidar, D. A. & Brun, T. A.Quantum Error Correction (Cambridge University Press, 2013).
Kitaev, A. Y. Quantum computations: algorithms and error correction. Russian Math. Surv. 52, 1191 (1997).
Knill, E. & Laflamme, R. Theory of quantum error-correcting codes. Phys. Rev. A 55, 900–911 (1997).
Calderbank, A., Rains, E., Shor, P. & Sloane, N. Quantum error correction via codes over gf(4). IEEE Trans. Inf. Theory 44, 1369–1387 (1998).
Rains, E. M., Hardin, R. H., Shor, P. W. & Sloane, N. J. A. A nonadditive quantum code. Phys. Rev. Lett. 79, 953–954 (1997).
Cross, A., Smith, G., Smolin, J. A. & Zeng, B. Codeword stabilized quantum codes. In 2008 IEEE International Symposium on Information Theory, 364–368 (2008).
Lidar, D. A. & Birgitta Whaley, K. Decoherence-free subspaces and subsystems. In Benatti, F. & Floreanini, R. (eds.) Irreversible Quantum Dynamics, 83–120 (Springer Berlin Heidelberg, Berlin, Heidelberg, 2003). https://doi.org/10.1007/3-540-44874-8_5.
Sarvepalli, P. & Klappenecker, A. Degenerate quantum codes and the quantum hamming bound. Phys. Rev. A 81, 032318 (2010).
Shaw, B., Wilde, M. M., Oreshkov, O., Kremsky, I. & Lidar, D. A. Encoding one logical qubit into six physical qubits. Phys. Rev. A 78, 012337 (2008).
Steane, A. M. Simple quantum error-correcting codes. Phys. Rev. A 54, 4741–4751 (1996).
Steane, A. Multiple-particle interference and quantum error correction. Proc. R. Soc. Lond. Ser. A: Math., Phys. Eng. Sci. 452, 2551–2577 (1996).
Pollatsek, H. & Ruskai, M. B. Permutationally invariant codes for quantum error correction. Linear Algebra its Appl. 392, 255–288 (2004).
Lidar, D. A., Chuang, I. L. & Whaley, K. B. Decoherence-free subspaces for quantum computation. Phys. Rev. Lett. 81, 2594–2597 (1998).
Shor, P. & Laflamme, R. Quantum analog of the macwilliams identities for classical coding theory. Phys. Rev. Lett. 78, 1600–1602 (1997).
Toeplitz, O. Das algebraische analogon zu einem satze von fejér. Mathematische Z. 2, 187–197 (1918).
Hausdorff, F. Der wertvorrat einer bilinearform. Mathematische Z. 3, 314–316 (1919).
Woerdeman, H. J. The higher rank numerical range is convex. Linear Multilinear Algebra 56, 65–67 (2008).
Li, C.-K. & Sze, N.-S. Canonical forms, higher rank numerical ranges, totally isotropic subspaces, and matrix equations. Proc. Am. Math. Soc. 136, 3013–3023 (2008).
Choi, M.-D., Kribs, D. W. & Życzkowski, K. Higher-rank numerical ranges and compression problems. Linear Algebra its Appl. 418, 828–839 (2006).
Choi, M.-D., Giesinger, M., Holbrook, J. A. & Kribs, D. W. Geometry of higher-rank numerical ranges. Linear Multilinear Algebra 56, 53–64 (2008).
Li, C.-K., Poon, Y.-T. & Sze, N.-S. Higher rank numerical ranges and low rank perturbations of quantum channels. J. Math. Anal. Appl. 348, 843–855 (2008).
LI, C.-K. & POON, Y.-T. Generalized numerical ranges and quantum error correction. J. Operator Theory 66, 335–351 (2011).
Gau, H.-L., Li, C.-K., Poon, Y.-T. & Sze, N.-S. Higher rank numerical ranges of normal matrices. SIAM J. Matrix Anal. Appl. 32, 23–43 (2011).
Miller, D. et al. Experimental measurement and a physical interpretation of quantum shadow enumerators. arXiv preprint arXiv:2408.16914 (2024).
Cao, C., Zhang, C., Wu, Z., Grassl, M. & Zeng, B. Quantum variational learning for quantum error-correcting codes. Quantum 6, 828 (2022).
Cross, A. & Vandeth, D. Small binary stabilizer subsystem codes. arXiv preprint arXiv:2501.17447 (2025).
Li, M., Gutiérrez, M., David, S. E., Hernandez, A. & Brown, K. R. Fault tolerance with bare ancillary qubits for a [[7,1,3]] code. Phys. Rev. A 96, 032341 (2017).
Zhang, C., Wu, Z., Huang, S. & Zeng, B. Transversal gates in nonadditive quantum codes. arXiv preprint arXiv:2504.20847 (2025).
Schatzki, L., Liu, G., Cerezo, M. & Chitambar, E. Hierarchy of multipartite correlations based on concentratable entanglement. Phys. Rev. Res. 6, 023019 (2024).
Zhu, X., Zhang, C., An, Z. & Zeng, B. Unified framework for calculating convex roof resource measures (2024). https://arxiv.org/abs/2406.19683. 2406.19683.
Kribs, D. W., Pasieka, A. & Życzkowski, K. Entropy of a quantum error correction code. Open Syst. Inf. Dyn. 15, 329–343 (2008).
Zhang, C., ZHU, X., Zhang, Y. & Zhao, Y. numqi/numqi: v0.6.0 (2025). https://doi.org/10.5281/zenodo.16735391.
Acknowledgements
We thank Karol Życzkowski and David Kribs for bringing ref. 35 to our attention. We also gratefully acknowledge Chenfeng Cao, Markus Grassl, and Andrew Nemec for valuable discussions. B.Z. dedicates this work to Mary Beth Ruskai, whose insight and encouragement over many years were instrumental to this project. Her seminal work with Pollatsek on permutation-invariant codes16 has been a constant source of inspiration, motivating a long-standing effort to seek a unifying picture between permutation-invariant codes and the CWS framework. This work was supported by funding from the University of Texas at Dallas.
Author information
Authors and Affiliations
Contributions
M.D. and C.Z. contributed equally. B.Z. conceived the idea of \({\lambda^*}\) and, together with Y.T.P., developed the framework. M.D. and C.Z. carried out the analytical and numerical calculations. All authors discussed the results and contributed to writing and revising the manuscript.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
About this article
Cite this article
Du, M., Zhang, C., Poon, Y.T. et al. Characterizing quantum codes via the coefficients in Knill-Laflamme conditions. npj Quantum Inf 12, 13 (2026). https://doi.org/10.1038/s41534-025-01155-1
Received:
Accepted:
Published:
Version of record:
DOI: https://doi.org/10.1038/s41534-025-01155-1




