I have an exercise in QEC, where I have given a hexagonal lattice with periodic boundary conditions (wrapped around a torus), with a qubit at each vertex. I have also given the Stabilizer generators $X \otimes Y \otimes Z \otimes X \otimes Y \otimes Z$ and $Z \otimes Z$ on the vertical lines of the hexagon. So how is it possible to deduce the logical operator $X$ and $Z$ on both logical qubits. Or a in a more general way, how can I find by a given lattice and stabilizer generators the logical operations?

In the lecture we have just looked at some QEC like the surface Code (and a version of the surface Code where it is wrapped around the torus) and we have put some lines through the lattice and named it the logical X and Z. If I understood it right we used some stabilizers to change some of the code-qubit values such that it represents the same logical value in the logical qubits. So how can I use this Information to create the logical X and Z operation?


1 Answer 1


For topological codes like this, you can find logical operators by placing down a single seed Pauli. It will anticommute with some of the stabilizers. Try placing a Pauli to fix one of those anticommutations. That will create a new anticommutation, but in a different spot. Keep doing this and you'll realize you can sort of push the anticommutation problem around the grid. Try pushing it into a boundary or pushing it all the way around the donut to make it terminate. That will reveal the observables.

Programmaticaly, you can use stim.Tableau.from_stabilizers([...], allow_underconstrained=True) to solve for the degrees of freedom not covered by the stabilizers (these are typically the logical observables). It won't give you insight into what the observable is, topologically speaking, but it can give you something valid to start from.

  • $\begingroup$ Thank you @CraigGidney for your answer. That already helped a lot. But is it possible that one of my logical X consists entirely out of Z? And on the other hand, that my logical X doesn't have any Z in it? $\endgroup$
    – Ruebli
    Dec 5, 2023 at 18:28
  • $\begingroup$ @Ruebli there's no requirement that the logical observables are made up of any particular type of physical Pauli. That said, for aesthetic reasons people try to pick observables where logical X is made up of physical X's. If you have an all-Z one, maybe call that logical Z instead of logical X. $\endgroup$ Dec 5, 2023 at 21:22
  • $\begingroup$ Thank you again for the Clarification. :) $\endgroup$
    – Ruebli
    Dec 5, 2023 at 22:08

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.