# Efficiently finding an explicit presentation for $N(S)/S$, for any stabilizer group $S$

Let $$P_n$$ denote the $$n$$-qubit Pauli group. This has presentation $$P_n = \langle iI, X_1, \ldots, X_n, Z_1, \ldots, Z_n \rangle$$. Suppose we have a stabilizer group $$S = \langle s_1, \ldots, s_k \rangle \leq P_n$$ minimally generated by $$k$$ elements. We know that $$N(S)/S \cong P_{n-k}$$, and hence there exists a presentation for $$N(S)/S$$ of the form $$\langle \overline{\iota}, \overline{x_1}, \ldots, \overline{x_{n-k}}, \overline{z_1}, \ldots, \overline{z_{n-k}} \rangle$$ whose generators obey the same commutativity relations as the generators of $$P_{n-k} = \langle iI, X_1, \ldots, X_{n-k}, Z_1, \ldots, Z_{n-k} \rangle$$.

My question is: is an efficient way of finding such a presentation for $$N(S)/S$$ known, for any given $$S$$?

I've read Gottesman's lecture notes (https://arxiv.org/abs/0904.2557) and a bit of his unpublished textbook, in which $$N(S)/S$$ is discussed and properties of it proved, but the key proofs I might otherwise use to derive an algorithm are existential rather than constructive.

What you are looking to construct are the logical operators of the code. These operators are the representatives of each coset in $$N(S)/S$$.

There exists a process to do so, which was presented in Gottesman's thesis [1]. Please refer to step 1 and 2 of this answer which provides the generic process as well as a worked out example, for constructing the logical $$X$$ and $$Z$$ operators.

If you want, you can construct the logical $$Y$$ using the relation $$Y=XZ$$. Finally, the logical identity is just the all zero vector.

[1] D. Gottesman, Stabilizer Codes and Quantum Error Correction, arXiv:quant-ph/9705052.

• Ahh nice, thanks!! I'll check out your 'stac' library :) Apr 5, 2023 at 8:32
• Very cool library! I have a question: I created a stac.Code from the generator matrix [[0, 1, 1, 0, 0, 0], [0, 0, 0, 0, 1, 1]]. i.e. I created the stabilizer group $S = \langle X_2 X_3, Z_2 Z_3 \rangle$. I expected this to have logical operators represented by $X_1$ and $Z_1$. Instead, when calling .construct_logical_operators() I got $X$ logicals [[0 1 1 0 0 0]] and $Z$ logicals [[0 0 0 1 0 1]]. i.e. I got the Paulis $X_2 X_3$ and $Z_1 Z_3$ respectively. These are not what I expected - e.g. $X_2 X_3$ is a stabilizer, so represents logical $I$. Where have I gone wrong? Apr 5, 2023 at 12:01
• Though it all works as expected if I create the group $S = \langle X_1 X_2, Z_1 Z_2 \rangle$ instead; it outputs $X$ logicals [[0 0 1 0 0 0]] and $Z$ logicals [[0 0 0 0 0 1]], i.e. $X_3$ and $Z_3$. Apr 5, 2023 at 12:03
• @Yossarian This is a indeed a problem with the algorithm. You need to relabel your qubits to have at least one stabilizer targeting the 0th index (or 1st index if you are 1-indexing). I have also noticed some problems with the encoding circuits for n=2,3 codes. So please take stac with a grain of salt as it is currently in the dev phase. Apr 5, 2023 at 16:43
• No problem, consider a grain of salt taken. Really nice package idea, look forward to seeing more of it. Apr 6, 2023 at 7:59

Yes there is. You put the code in "standard" form. See Chapter 9 of

https://www.amazon.com/Quantum-Information-Processing-Error-Correction/dp/0123854911

The process uses gaussian elimination and is similar to what you do for classical codes to get a standard (systematic) form. Qiskit or Stim might have this already built in by I'm not sure...