# Equivalence of circuits in measurement-based QC

I am looking at Slide 40 from this deck. It is claimed that the circuits 1 to 4 are equivalent. I don't understand the step to go from 2 to 3.

How does one backpropagate a measurement in the X basis of two qubits through a CZ gate and a Hadamard gate to obtain two measurements $$Z\otimes Z$$ and $$X\otimes X$$? In particular, is there an elegant way to see this?

It is also unclear to me what it means to measure those qubits and then continue with gates. Does it mean - take the post measurement state and then apply those gates?

In step 2, you are doing two measurements, $$X$$ on qubit 1 and $$X$$ on qubit 2. To move to step 3, you need to bring these measurements earlier in the circuit, which means updating what they look like as they propagate through the other circuit elements.

Thankfully, controlled-phase is symmetric, so that reduces the amount of work we have to do. You just need to check the identity $$CP.(X\otimes I)=(X\otimes Z).CP$$ This shows that the two $$X$$ measurements become measurements in $$X\otimes Z$$ and $$Z\otimes X$$ just before the controlled-phase. Then you also have to pull them through the Hadamard, which just converts $$X$$ and $$Z$$ and vice versa. Thus, your two measurements become $$X\otimes X$$ and $$Z\otimes Z$$. Note that since they commute with each other, it doesn't matter which of the two you write down first.

It is also unclear to me what it means to measure those qubits and then continue with gates. Does it mean - take the post measurement state and then apply those gates?

Yes, although the whole point of going from step 3 to 4 is to say "actually, we don't care about the post-measurement state". So if you're happy with that already, just make it part of the process in moving the measurements.

• Thank you. And for the identity there, I can see it is true by writing out the 4x4 matrices but is there an easier way to see that this is true? Commented Nov 17, 2023 at 12:32
• Well, the way that I think about it is that controlled-phase works as "if the input is 0, do I, if the input is 1, apply Z". But if I flip the input first using an X, then to correct for that logic, I now want to do "if the input is 1, do I, if the input is 0, apply Z", the difference simply being a Z applied to the second qubit. Commented Nov 17, 2023 at 13:05
• I see what you mean for an $X$ gate. Here, we have an $X$ measurement though but your argument still works. Could you explain why? I am maybe missing something obvious here about the connection between an $U$ operation and the measurement in the eigenbasis of $U$. Commented Nov 17, 2023 at 15:08
• Let's say I'm measuring an observable $X$ on a state $|\psi\rangle$. Yes, I could think about what that really means in terms of splitting it up into projectors and talking about different outcomes corresponding to those different projectors. Or, I could just say that all I'm really interested in is the probabilities (call them $p_\pm$). I know $p_++p_-=1$, so $p_+-p_-$ would tell me everything I need to know. But this is just $\langle\psi|X|\psi\rangle$. Commented Nov 17, 2023 at 15:28
• Now this is just a mathematical object, and if $|\psi\rangle$ was produced by some circuit $U$, I can equally well calculate $\langle 0|UU'|0\rangle$ where $U'=XU$ is a new circuit. Commented Nov 17, 2023 at 15:28

If $$AU \equiv UB$$ then $$M_{A} \cdot U \equiv U \cdot M_B$$. Measuring $$B$$ before $$U$$ is equivalent to measuring $$A$$ after $$U$$ if $$U$$ conjugates $$B$$ into $$A$$.

The transition from step 2 to step 3 is using this logic with:

$$B=X_1X_2, U=\text{CZ}_{1,2} \cdot H_2, A=X_1$$

and

$$B=Z_1Z_2, U=\text{CZ}_{1,2} \cdot H_2, A=X_2$$

• Probably a very silly question but why is it true that $AU = UB \implies M_AU = UM_B$? Is there a name for this result in textbooks/literature? Commented Nov 17, 2023 at 12:58
• @user1936752 try checking it numerically for X basis measurement (A=X, B=Z, U=H). Pick a simple example state, and show the probabilities and resulting collapsed states are the same with and without the rewrite. Then generalize to all states. Then try XX measurement. Then generalize to all A,U,B. Commented Nov 17, 2023 at 18:19