I am trying to implement the 9 qubit 'surface 17' code, however it appeared to me that I couldn't find in the literature what the encoding states for such a physical system are.

The surface 17 code with its X and Z checks

I have found in the paper Low-distance Surface Codes under Realistic Quantum Noise that one may use $\bar{X}=X_2X_4X_6$ and $\bar{Z}=Z_0Z_4Z_8$ as logical operator (qubits are numbered 0 to 8), however I don't quite understand why these should be chosen and how they are recovered. Isn't checking only 3/9 qubit more prone to errors ?

  • $\begingroup$ "Surface 17"? What is that supposed to be? $\endgroup$ Commented Dec 10, 2022 at 17:53
  • $\begingroup$ It's the code you can see above with 9 data qubits and 8 checks (9+8=17), so they chose this name i guess. $\endgroup$ Commented Dec 21, 2022 at 11:51
  • 2
    $\begingroup$ Yes, but it is very non-standard. $\endgroup$ Commented Dec 21, 2022 at 13:01

2 Answers 2


To find the logical operators starting from a stabilizer set, you need the former to be stabilized by the latter.

This happens iff all the stabilizers commute with the operators, that can be considered logical (as their application to any logical state is closed into the code scheme space).

You can verify yourself on table II of the cited paper that the operators you mention commute with all the Z and X stabilizers.

I.e. X operators have one common qubit with X stabilizers, while two common qubits (or zero) with Z stibilizers. The Z operators case is symmetrical.


To add some resources to Daniele's answer, there is an algorithm similar to Gaussian elimination that permits you to efficiently find these logical operators (that commute with all the given stabilizing operators) for any quantum code.

It is described in a few places, most conveniently in Gottesman's PhD thesis, chapter 4.

The algorithm is also implemented in the QuantumClifford.jl library among others, with the MixedDestabilizer constructor. E.g. with the Steane code:

julia> MixedDestabilizer(S"___XXXX
+ Z______
+ _Z_____
+ ___Z___
+ __X____
+ ____X__
+ ______X
+ __X_XX_
+ X_X_X_X
+ _XX__XX
+ ___XXXX
+ Z_ZZ_Z_
+ ZZ__ZZ_
+ ZZ_Z__Z
+ _Z_Z_Z_

Your Answer

By clicking โ€œPost Your Answerโ€, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.