# Hadamard gate on entangled qubit

TL;DR: If you have two entangled qubits in the state $|00\rangle + |11\rangle$, what is the result of applying the Hadamard gate on the second qubit, and why?

I am trying to understand $\text{PSPACE} \subseteq \text{QIP}(3)$ (Watrous, 2003), and have troubles understanding the following.

Hadamard gate: Given some qubit, one can test that it is in a uniform superposition by applying the Hadamard gate on it as it will map it to $|0\rangle$ in this case, $$H(|0\rangle + |1\rangle) = |0\rangle.$$ By measuring it, you have some probability to get a $1$ iff. the qubit was not in a perfectly uniform state.

With entanglement: Now, the paper claims that you can use the Hadamard gate to detect entanglement as well. Given two qubits, $x,y$, that are perfectly entangled, you can have them in the superposition $$xy = |00\rangle + |11\rangle.$$ I understand that if you measure $x$, then apply the Hadamard gate to $y$, it will not map it to $|0\rangle$ as it will be entirely determinated by the measurement made on $x$.

What I don't understand: They do not claim to be able to measure/collapse the qubits that are entangled with the qubits they want to test, so how does it work? If you have two entangled qubits in the state $|00\rangle + |11\rangle$, what is the result of applying the Hadamard gate on the second qubit, and why?

Where is it in the paper:

• When skecthing the protocol at the end of the introduction section (End of first paragraph, page 2):

If there is significant correlation between the low-index prover responses and the high-index verifier-messages, the uniformity test [Hadamard gate, measure 0s] will fail with high probability

• When discussing the completeness of the protocol, in particular step 2. of the verifier (start of page 8):

Next, the verifier applies the Hadamard transform to every qubit in each register of $\bar{R^u}$. If $\bar{R^u}$ now contains only 0 values, the verifier accepts, otherwise the verifier rejects. In short, the verifier is projecting the state of $\bar{R^u}$ onto the state where $\bar{R^u}$ is uniformly distributed over all possible values. It is easy to check that in the case of the honest prover the registers $\bar{R^u}$ are not entangled with any other registers, as each register of $P^u$ depends only on those of $R^u$, and are in a uniform superposition over all possible values. Thus, the verifier accepts with certainty in this case.

• Also in the proof of soundess, same page

If you mean result in terms of state, then you can compute this by applying the matrix $I \otimes H$ to the Bell state.

If you mean what happens operationally, then observe that applying a hadamard gate on each qubit of the Bell state results in no change -- the resulting state is again the Bell state. So, if you apply two hadamard gates in parallel or none at all and then you measure both qubits, you will get perfect correlations between the measurement outcomes (measurement outcomes on the qubits are guaranteed to be equal). However, if you apply a hadamard gate to either the second qubit or the first qubit and then measure both qubits, then the measurement outcomes will be completely independent of each other, that is, the measurement result of the first qubit can be $0$ or $1$ with $50\%$ probability and the measurement result of the second qubit can be $0$ or $1$ with $50\%$ probability, regardless of what was seen in the other measurement.

Algebra:

Given the state $|00\rangle + |11\rangle$, you can not compute the Hadamard gate by factoring the state and applying a Hadamard to only one qubit, as the state is entangled and cannot be factored into two independent qubits. You can, however, apply the result of $I \otimes H$, which is the operation of applying Identity gate on the first qubit and the Hadamard gate on the second. The resulting operation is, with scaling factor $s$,

$$I \otimes H = \left[\begin{matrix} 1 & 0 \\ 0 & 1 \end{matrix}\right] \otimes \frac{1}{\sqrt{2}} \left[\begin{matrix} 1 & 1 \\ 1 & -1 \end{matrix}\right] = s\left[\begin{matrix} 1 & 1 & 0 & 0 \\ 1 & -1 & 0 & 0 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & -1 \\ \end{matrix}\right]$$

For more details on this, see the question How to apply a 1-qubit gate to a single qubit from an entangled pair?.

Now, you can pass your entangled state, $\left[\begin{matrix} \frac{1}{\sqrt{2}} & 0 & 0 & \frac{1}{\sqrt{2}}\\ \end{matrix}\right]^{T}$ for $\frac{1}{\sqrt{2}}|00\rangle + \frac{1}{\sqrt{2}}|11\rangle$, through the gate and get $$s\left[\begin{matrix} 1 & 1 & 0 & 0 \\ 1 & -1 & 0 & 0 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & -1 \\ \end{matrix}\right] \left[\begin{matrix} \frac{1}{\sqrt{2}} \\ 0 \\ 0 \\ \frac{1}{\sqrt{2}}\\ \end{matrix}\right] = \frac{1}{2}\left[\begin{matrix} 1 \\ 1 \\ 1 \\ -1\\ \end{matrix}\right]$$ Which is the state $$|00\rangle + |01\rangle + |10\rangle - |11\rangle.$$ And measurement of the first qubit or the second qubit would be 0 or 1 with equal probability, and give no information on the state of the other qubit.

• I have difficulty following your last point. Given the state $|00\rangle + |11\rangle$, my intuition is that applying the Hadamard gate to, say, the last qubit would map it to the state $|0\rangle$, because if we take it in isolation it is in the state $|0\rangle + |1\rangle$. Therefore, measuring both qubits, we would get 0 or 1 in the first qubit, with probability 1/2 each, and 0 on the second, with probability 1. Could you elaborate on your last point, with regard to my understanding of how it works? May 28, 2016 at 11:33
• No, what you are saying is not correct. If you apply the hadamard gate either to the second qubit or to the first qubit, you get exactly the same state. So, it doesn't matter where you apply the hadamard gate, but how many times you apply the hadamard gate. The error in what you are describing is that you cannot apply the hadamard gate in isolation, as you put it, to only one qubit. This is because the Bell state is entangled so you cannot factor it into two independent qubits. The resulting state can be computed by applying the matrix $I \otimes H$ to the whole state. Try it!
– user51117
May 28, 2016 at 11:53
• It ticked, I get it now. I added the algebraic developement to your answer as an edit (currently pending). If it is sound, I have only one follow up question. Assume I create an entangled pair as above and send you one of the qubits. How are you able to manipulate it if you need to apply the $I \otimes H$ operation to the pair? May 28, 2016 at 12:31
• Good question. If you have access to only 1 qubit, then you can only apply local operations to it (like the Hadamard). However, if you don't know what operations the other party is applying, then you will not know what will happen to your measurement outcomes. So basically, to see what the result will be, you have to consider different cases, depending on what the other party does. In short, you can manipulate your qubit in any way you like, however, the actions of the other party will also have an effect on your qubit after measuring, so you have to consider both qubits at the same time.
– user51117
May 28, 2016 at 12:51
• Also, now that I see the rendered output of the edit, there is a small detail you can fix. The ket vectors are actually column vectors. And you also need to multiply the column vector from the left with the specified matrix. Still, the result will be the same, in this case, but in general this is the proper notation. See the answer you linked for the proper notation.
– user51117
May 28, 2016 at 12:53

You don't have to do the whole matrix multiplication to get the final result. A more intuitive way is two write

$$|00\rangle +|11\rangle = |0\rangle|0\rangle + |1\rangle|1\rangle\,.$$

Now apply the Hadamard gate on all terms of the first qubit and keep the second untouched. Since for a single qubit we have $H|0\rangle = |0\rangle+|1\rangle$ and $H|1\rangle =|0\rangle -|1\rangle$, we can write:

\begin{align*} \big(H|0\rangle\big)|0\rangle + \big(H|1\rangle\big)|1\rangle &= \big(|0\rangle+|1\rangle\big)|0\rangle + \big(|0\rangle -|1\rangle\big)|1\rangle\\ & = |0\rangle|0\rangle + |1\rangle|0\rangle + |0\rangle|1\rangle - |1\rangle|1\rangle\\ &= |00\rangle + |01\rangle + |10\rangle -|11\rangle\,. \end{align*}

I have dropped the normalizations.