Suppose we want to obtain the measurement outcome of the stabilizer $X_1X_2X_3X_4X_5X_6$. Of course, by measuring $X_1X_2$, $X_3X_4$, $X_5X_6$ in this order and combining these three outcomes, we can obtain the measurement outcome of the stabilizer.

What I would like to know is that, in some document, it is said that

i) if we measure $X_1X_2$, $Z_2Z_3$, $X_3X_4$, $X_5X_6$ in this order, we cannot obtain the outcome of the stabilizer.

ii)if we measure $X_1X_2$, $X_3X_4$, $Z_2Z_3$, $X_5X_6$ in this order, we can obtain the outcome of the stabilizer.

iii)if we measure $X_5X_6$, $Z_6Z_7$, $X_1X_2$, $X_3X_4$ in this order, we can obtain the outcome of the stabilizer.

Could you explain why these statements fold? I guess the commutation relationships play an important role, but I am not sure how to verify the statements are true.


2 Answers 2


As long as don't measure operators which anti commute, you are fine. Once you did, the value of the previous operators is random (it is like measuring a single qubit in X and then in Z).

So, in i), the second operator anti commutes with the first. In ii), the third anti commutes with the first two, but it commutes with thier multiplication, so each of them is random but $X_1X_2X_3X_4$ does not change. But iii) seems wrong. Maybe it should be $Z_5Z_6$?

  • $\begingroup$ The lattice surgery cnot builds a cnot out of a series of anti-commuting measurements, so commutation is not a necessary condition. $\endgroup$ Commented Jul 9 at 17:31

This can actually get complicated to solve, because of lattice surgery. For example, measuring these Pauli strings will measure $X_1X_2X_3X_4X_5X_6$ and no other operators over qubits 1-6:

  1. $Z_{98}$
  2. $X_1X_{98}$
  3. $Z_{98}Z_{99}$
  4. $X_3X_{98}$
  5. $Z_{98}$
  6. $X_5X_{98}$
  7. $Z_{98}Z_{99}$
  8. $X_2X_{98}$
  9. $Z_{98}$
  10. $X_4X_{98}$
  11. $Z_{98}Z_{99}$
  12. $X_6X_{98}$
  13. $Z_{98}$

If you don't know the ZX calculus, this sounds totally wild. If you do know the ZX calculus, it's quite easy to see it works because the corresponding graph reduces to the same thing as the graph corresponding to measuring $X_1X_2X_3X_4X_5X_6$ when you repeatedly apply leaf-cutting and spider-fusion. They're both ultimately just a central Z-type connected component linked to X-type components touching each of the qubits:

enter image description here

The way I would approach this problem in general is as follows:

  1. Given a series of Pauli product measurements, you can produce a stabilizer ZX calculus graph that postselects these measurements one after the other.
  2. Given a stabilizer ZX calculus graph, you can compute the stabilizer generators of its exterior edges.
  3. If $+P$ or $-P$ on the input edges is in the stabilizer group of those generators, then a circuit measuring the specified operators must have a stabilizer flow $P \rightarrow \pm\Pi_{m \in M} (-1)^m$ for some set of measurements $M$ somewhere. If $P$ isn't a stabilizer of that state, then the original circuit cannot be measuring $P$.

(At some point I'll probably add a stim.Circuit.flow_generators method, at which point you could just feed in a circuit with a bunch of MPP instructions and get back flow generators and see if the measurement you want can be built out of those generators. This would equivalently solve your problem.)

  • $\begingroup$ Thank you. I am looking forward to stim.Circuit.flow_generators method! $\endgroup$
    – david
    Commented Jul 10 at 4:17
  • $\begingroup$ @david It exists in stim~=1.14.dev now: github.com/quantumlib/Stim/commit/… $\endgroup$ Commented Jul 14 at 6:40

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.