# Understanding measurement based quantum computing

I am currently reading M. A. Nielsen's review on Cluster-state Quantum Computation (Nielsen, Michael A. "Cluster-state quantum computation." Reports on Mathematical Physics 57.1 (2006): 147-161.).

My first question concerns the output of a one-bit teleportation, circuit (11) from the paper:

Where $|\psi \rangle=\alpha |0\rangle + \beta |1\rangle$ and $|+\rangle = (|0\rangle + |1\rangle)/\sqrt{2}.$

• I don't see why the outcome after the controlled-phase and Hadamrad is equal to: $$\alpha |++\rangle + \beta |--\rangle = (|0\rangle \otimes H|\psi\rangle+|1\rangle \otimes XH|\psi\rangle)/\sqrt{2}$$

• Why isn't $X^m H|\psi \rangle$ the output of the first qubit?

• I think if I understand the above I'll be able to see why the output of the following cluster state is $X^{m_2} HZ_{\pm \alpha 2} X^{m_1}HZ_{\alpha 1}|+\rangle$ where $m_1$ and $m_2$ are the outputs of the first and second qubit measurements in the circuits below:

Circuit (14) from Nielsen's paper:

equivalently as: (circuit 15):

Thanks for any clarification you may offer.

• Why the outcome after the controlled-phase and Hadamrad is equal to: $$\alpha |++\rangle + \beta |--\rangle = (|0\rangle \otimes H|\psi\rangle+|1\rangle \otimes XH|\psi\rangle)/\sqrt{2}$$

Let us label the qubits $A$ and $B$ for clarity. The initial state for circuit (11) is $$|\psi_A \rangle \otimes |+_B\rangle = \left( \alpha |0_A\rangle + \beta |1_A\rangle \right) \otimes \frac{1}{\sqrt{2}}\left( |0_B\rangle + |1_B\rangle\right)$$ which expands as $$|\psi_A \rangle \otimes |+_B\rangle = \frac{\alpha}{\sqrt{2}} |0_A 0_B \rangle + \frac{\alpha}{\sqrt{2}} |0_A 1_B \rangle + \frac{\beta}{\sqrt{2}} |1_A 0_B \rangle + \frac{\beta}{\sqrt{2}} |1_A 1_B \rangle$$ The reason we need to expand is because the controlled-phase gate is defined on the basis states $|0_A 0_B \rangle$, $|1_A 0_B \rangle$, $|1_A 0_B \rangle$, $|1_A 1_B \rangle$ as $|xy\rangle \rightarrow (-1)^{xy}|xy\rangle$. So its action on the initial state produces $$|\Phi_{AB}\rangle = \frac{\alpha}{\sqrt{2}} |0_A 0_B \rangle + \frac{\alpha}{\sqrt{2}} |0_A 1_B \rangle + \frac{\beta}{\sqrt{2}} |1_A 0_B \rangle - \frac{\beta}{\sqrt{2}} |1_A 1_B \rangle = \\ = \alpha \;|0_A +_B \rangle + \beta \;|1_A -_B \rangle$$ The subsequent Hadamard gate on qubit $A$ acts as $H_A |0_A\rangle = |+_A\rangle$ and $H_A |1_A\rangle = |-_A\rangle$ to give the output state $$|\Psi_{AB}\rangle = H_A|\Phi_{AB}\rangle = \alpha \;|+_A +_B \rangle + \beta \;|-_A -_B \rangle$$ What we need now is to express $|\Psi_{AB}\rangle$ in a way that allows us to see what happens to the state of qubit $B$ after a measurement on qubit $A$ in the canonical basis $|0_A\rangle$, $|1_A\rangle$. That is, we need to rewrite $$|\Psi_{AB}\rangle = |0_A \rangle \otimes |\sigma_B \rangle + |1_A \rangle \otimes |\omega_B \rangle$$ A little algebra gives us: $$|\Psi_{AB} \rangle = \frac{\alpha}{\sqrt{2}} \left( |0_A\rangle + |1_A\rangle \right) \otimes |+_B \rangle + \frac{\beta}{\sqrt{2}} \left( |0_A\rangle - |1_A\rangle \right) \otimes |-_B \rangle = \\ = |0_A\rangle \otimes \frac{1}{\sqrt{2}} \left( \alpha\; |+_B\rangle + \beta \;|-_B\rangle \right) + |1_A\rangle \otimes \frac{1}{\sqrt{2}} \left( \alpha\; |+_B\rangle - \beta\; |-_B\rangle \right) = |0_A \rangle \otimes |\sigma_B \rangle + |1_A \rangle \otimes |\omega_B\rangle$$ But what we prefer is some relationship between the states $|\sigma_B\rangle$, $|\omega_B\rangle$ of qubit $B$ and the initial state $|\psi\rangle$ of qubit $A$. For this, recall that a Hadamard gate on qubit $B$ acts as $H_B |0_B\rangle = |+_B\rangle$ and $H_B |1_B\rangle = |-_B\rangle$. We can use this to rewrite $|\sigma_B\rangle$ as $$|\sigma_B \rangle = \frac{1}{\sqrt{2}} \left( \alpha \;|+_B\rangle + \beta \;|-_B\rangle \right) = \frac{1}{\sqrt{2}} \left( \alpha \; H_B|0_B\rangle + \beta \;H_B|1_B\rangle \right) = \frac{1}{\sqrt{2}} H_B |\psi_B \rangle$$ As for $|\omega_B\rangle = \frac{1}{\sqrt{2}} \left( \alpha\; |+_B\rangle - \beta\; |-_B\rangle \right)$, let us remove the negative sign by recalling that states $|\pm\rangle$ are eigenstates of gate $X$, such that $X_B |+_B\rangle = |+_B\rangle$ and $X_B |-_B\rangle = -|-_B\rangle$. This means that we have $$|\omega_B\rangle = \frac{1}{\sqrt{2}} \left( \alpha\; |+_B\rangle - \beta\; |-_B\rangle \right) = X_B \frac{1}{\sqrt{2}} \left( \alpha\; |+_B\rangle + \beta\; |-_B\rangle \right) = X_B |\sigma_B \rangle = \frac{1}{\sqrt{2}} X_B H_B |\psi_B\rangle$$ and the final form of the output state is $$|\Psi_{AB} \rangle = \frac{1}{\sqrt{2}}\left( |0_A \rangle \otimes H_B |\psi_B \rangle + |1_A \rangle \otimes X_B H_B |\psi_B\rangle\right)$$

• Why isn't $X^m H|\psi \rangle$ the output of the first qubit?

Actually the output state before measurement on qubit $A$ is symmetrical wrt to qubits $A$ and $B$, so we can rewrite it as $$|\Psi_{AB} \rangle = \frac{1}{\sqrt{2}}\left( H_A |\psi_A \rangle \otimes |0_B \rangle + X_A H_A |\psi_A\rangle \otimes |1_B \rangle \right)$$ But this form cannot tell us much about the state of $B$ after the measurement on $A$. The way it presents the information is useless.

• The cluster state: Should work similarly. Try breaking everything down in elementary steps until you get used to the patterns.
• Thanks a lot for the answer, the labeling using A and B helped immensely. a) So the symmetry that you spoke of is due to the fact that in the expression of $|\Psi_{AB}\rangle$ we have the freedom to factorize the $|0_B\rangle$ and $|1_B\rangle$ in each term respectively? b) In the cluster state, the $HZ_{\alpha 1}$ term, $H$ is the Hadamard, $Z$ the pauli Z gate but is $\alpha$ simply the angle defining the basis? c) Finally can I interpret the Z gate as a single qubit control phase gate? namely $Z |x\rangle \to (-1)^x |x\rangle.$ – user929304 Oct 9 '15 at 10:07
• Welcome. a) Exactly. b) As far as I can tell $Z_{\alpha 1} = Z(\alpha 1)$ as defined by Eq.(5), while the canonical basis does not change. c) Correct. Come to think about it, you can say that in general $Z_{\theta}|x\rangle = e^{i(1-2x)\frac{\theta}{2}}|x\rangle = e^{i\frac{\theta}{2}} e^{-i\theta x} |x\rangle$, with $Z = -iZ_\pi = iZ_{-\pi}$. – udrv Oct 9 '15 at 15:40
• One question in order to gain more intuition: I understand that the main point of having the controlled phase gate is to create an entanglement between neighbouring quibts by correlating their phases, but intuitively speaking, what is the point/use of the Hadamard gate that follows the C-phase gate? Why is it so important to apply the Hadamard here? Thanks – user929304 Oct 19 '15 at 13:45
• Because it completes the teleportation procedure. The purpose here is to transfer the state $|\psi\rangle$ from qubit $A$ (initial state) to qubit $B$. This means in the final state qubit $B$ must somehow show state $|\psi\rangle$, whatever the (computational) state of qubit $A$. Before applying the Hadamard gate the 2 qubits are in state $|\Phi_AB\rangle = \alpha \;|0_A +_B \rangle + \beta \;|1_A -_B \rangle$, so $|\psi_B\rangle$ doesn't show yet. – udrv Oct 19 '15 at 20:04
• After the Hadamard gate on $A$, if qubit $A$ is measured in state $|0_A\rangle$, $B$ is in $H_B|\psi_B\rangle$, and one more application of $H_B$ retrieves $|\psi_B\rangle$. If $A$ is measured in state $|1_A\rangle$, then $B$ is in $X_B H_B|\psi_B\rangle$, and $|\psi_B\rangle$ can be retrieved by an application of $H_B X_B$. This because $(H_B)^2 = (X_B)^2 = I$. – udrv Oct 19 '15 at 20:09