# What's the logical X and Z operator in XZZX surface code?

I sort of understand the logical operator in conventional surface code from this question. But for XZZX surface code, the logical operator seems a line of alternating Xs and Zs (see c of Fig 1 in the paper). For example I also found that in this qiskit circuit, it measures an alternating Xs and Zs as logical measurement. However since logical errors in XZZX surface code behave diagonally like repetition codes, why isn't logical operator like diagonal strings of Zs for logical Z and Xs? How is logical X or Z defined for XZZX surface code?

My understanding of a dz=3,dx=2 XZZX surface code is like this (similar to Fig.1 j):

Is this correct? If so, what's the logical X and Z operator?

Also, how can I initialize this code? In the XZZX paper it mentions hexon surface code, but think this dz=3,dx=2 code is too small to do that.

Yes, the logical operators are alternating Xs and Zs from one side to the other. So it is perhaps most clear to refer to them as the horizontal and vertical observables, since they're no longer distinguished by the physical basis.

• How to decide the correct order of Xs and Zs? For example, in the qiskit circuit I mentioned in the question, the data qubits are arrange like 0 1 2 in first row, 3 4 5 in second row, 6 7 8 in third row. the Z operator can be X0Z1X2 or Z3X4Z6 or X6Z7X8. Why aren't they Z0X1Z2, X3Z4X6 or Z6X7Z8? Oct 29, 2022 at 17:30
• @GuhhoiWong The way I do it is the same way I plug in USB cables. I try one, then Stim says "observable not deterministic", then I try the other one, and Stim says "observable not deterministic", then I try the original one and it works. Oct 29, 2022 at 17:56