# Applying a NOT gate on an entangled qubit of equal amplitudes of $|1⟩$ and $|0⟩$

I am currently listening to lecture 11 (Superdense coding) of Michael Nielsen's Quantum Computation for the determined series.

It starts off with 2 qubits, both in the $|0\rangle$ state. Then the "control qubit" is phase shifted by $\pi/4$ through a Hadamard gate. And they are eventually made entangled by the application of c-NOT gate. Now as the control qubit was in equal probability of appearing in either 0 or 1, so (as far as I understand) the target qubit also attains the same phase (i.e. $\pi/4$) as the control qubit (please correct me if I am wrong, though).

However, this only ensures that upon measurement, although each one of them has an equal probability of appearing either in the $|1\rangle$ state or in the $|0\rangle$ state, if one of them emerges to be $|0\rangle$, the other will emerge to $|1\rangle$ state.

However I am confused with application of NOT gate to the control qubit. It was already in the state $$\frac{1}{\sqrt{2}}\left(|0\rangle+|1\rangle\right).$$ What does the application of NOT gate do? Nothing. Its state remains the same! As its state does not change so also the state of its entangled partner does not change.

I understand that somehow they plan on changing both the quits using only one qubit (as they are entangled & changing one in some way will affect change in the other), but I cannot understand how. Please clarify this question.

I'll cover some of the technical stuff.

Let us denote the 1st qubit as A (for Alice) and the 2nd as B (for Bob). The initial state of the 2 qubits is $$|\psi_0\rangle = |0_A 0_B\rangle$$ The Hadamard gate applied to qubit A produces $$|\psi_1\rangle = H_A \otimes I_B |0_A 0_B \rangle = \frac{1}{\sqrt{2}}(|0_A 0_B\rangle + |1_A 0_B \rangle ) = \frac{1}{\sqrt{2}}(|0_A\rangle + |1_A \rangle )\otimes |0_B\rangle$$ As you can see, at this point the control qubit is still in its initial pure state and the overall state is still separable, not entangled. The role of the CNOT gate applied next to the control qubit is to introduce entanglement and produce the state $$|\psi_2\rangle = CNOT_B |\psi_1\rangle = \frac{1}{\sqrt{2}}(|0_A 0_B\rangle + |1_A 1_B \rangle )$$ In this new entangled but still pure total state the individual qubits are no longer in pure states themselves. Their local states are $$\rho_A = Tr_B(|\psi_2\rangle \langle \psi_2|) = \frac{1}{2}(|0_A\rangle \langle 0_A| + |1_A\rangle \langle 1_A| ) \\ \rho_B = Tr_A(|\psi_2\rangle \langle \psi_2|) = \frac{1}{2}(|0_B\rangle \langle 0_B| + |1_B\rangle \langle 1_B| )$$ That is, they are mixed states.

To answer your 1st question then, the CNOT gate performed the following transformation on qubit B: $$|0_B\rangle \langle 0_B| \rightarrow \frac{1}{2}(|0_B\rangle \langle 0_B| + |1_B\rangle \langle 1_B| )$$ It did not leave it unchanged.

Now for the rest. For completeness, let's first enumerate Alice's operations:

1) If Alice has classical bits 00, she leaves $|\psi_2\rangle$ unchanged,
$$|\psi_{3,00} \rangle = |\psi_2\rangle = \frac{1}{\sqrt{2}}(|0_A 0_B\rangle + |1_A 1_B \rangle )$$

2) If Alice has classical bits 01, she applies an X gate to qubit A and gets $$|\psi_{3,01} \rangle = X_A \otimes I_B |\psi_2\rangle = \left[|1_A\rangle \langle 0_A| + |0_A\rangle \langle 1_A|\right]\otimes I_B \frac{1}{\sqrt{2}}(|0_A 0_B\rangle + |1_A 1_B \rangle ) = \frac{1}{\sqrt{2}}(|1_A 0_B\rangle + |0_A 1_B \rangle )$$ 3) If her classical bits are 10, Alice treats the A qubit with a Z gate: $$|\psi_{3,10} \rangle = Z_A \otimes I_B |\psi_2\rangle = \left[|0_A\rangle \langle 0_A| - |1_A\rangle \langle 1_A|\right]\otimes I_B \frac{1}{\sqrt{2}}(|0_A 0_B\rangle + |1_A 1_B \rangle ) = \frac{1}{\sqrt{2}}(|0_A 0_B\rangle - |1_A 1_B \rangle )$$ 4) Finally if the classical bits are 11, Alice applies Z followed by X and obtains $$|\psi_{3,11} \rangle = X_A Z_A \otimes I_B |\psi_2\rangle = \left[|1_A\rangle \langle 0_A| + |0_A\rangle \langle 1_A|\right] \left[|0_A\rangle \langle 0_A| - |1_A\rangle \langle 1_A|\right] \otimes I_B\frac{1}{\sqrt{2}}(|0_A 0_B\rangle + |1_A 1_B \rangle ) = \frac{1}{\sqrt{2}}(|1_A 0_B\rangle - |0_A 1_B \rangle )$$

What Alice accomplishes with her protocol is to encode her combinations of classical bits in the entanglement of distinct states that share identical local states for the 2 qubits. Indeed, if you look closely, she doesn't change the local state $\rho_A$ of qubit A, just the kind of entangled correlations it has with qubit B.

The general idea used to accomplish this is to take advantage of the fact that each state of qubit A is correlated strictly with one state of qubit B. Then if Alice applies operations that interchange and/or shift the relative phase of states $|0_A \rangle$ and $|1_A \rangle$, the result is still a total entangled state in which each state of qubit A is correlated strictly with one state of qubit B, while the local state of A remains the same $\rho_A$. The state of qubit B is not affected, since it was not operated on. Alice just needs to find a way to produce 4 different such states. That's all.

The Hadamard and CNOT gates that Bob applies simply serve to distinguish the states produced by Alice. The CNOT decouples qubit B, while the Hadamard simplifies/rotates the state of qubit A in preparation for measurement. Equivalently, we could apply the CNOT to qubit A, etc. The last Hadamard gate is not even really necessary. It could be eliminated by adjusting the measuring device for A.

1) $$|\psi_{4,00} \rangle = (H_A\otimes I_B)(I_A \otimes CNOT_B)|\psi_{3,00} \rangle = H_A\otimes I_B \frac{1}{\sqrt{2}}(|0_A 0_B\rangle + |1_A 0_B \rangle ) = |0_A 0_B\rangle$$ 2) $$|\psi_{4,01} \rangle = (H_A\otimes I_B)(I_A \otimes CNOT_B)|\psi_{3,01} \rangle = H_A\otimes I_B \frac{1}{\sqrt{2}}(|1_A 1_B\rangle + |0_A 1_B \rangle ) = |0_A 1_B\rangle$$ 3) $$|\psi_{4,10} \rangle = (H_A\otimes I_B)(I_A \otimes CNOT_B)|\psi_{3,10} \rangle = (H_A\otimes I_B) \frac{1}{\sqrt{2}}(|0_A 0_B\rangle - |1_A 0_B \rangle ) = |1_A 0_B\rangle$$ 4) $$|\psi_{4,11} \rangle = (H_A\otimes I_B)(I_A \otimes CNOT_B)|\psi_{3,11} \rangle = (H_A\otimes I_B) \frac{1}{\sqrt{2}}(|1_A 1_B\rangle - |0_A 1_B \rangle ) = -|1_A 1_B\rangle$$

Final note: In principle the choice of 4 states that Alice has to produce is not unique, as long as they can be easily distinguished by Bob. Overall, the protocol discussed is simply the one that produces the neat encoding of the classical bits in the disentangled basis states of the 2 qubits.

You have a serious serious misconception. The misconception is that you write as if each object has its own spin state. This is wrong. That only happens sometimes, specifically, when they are not entangled.

The state could start out like $|0\rangle\otimes|0\rangle=|00\rangle.$ And then each has a spin state, namely $|0\rangle.$ But later they can be in a state like $$\alpha|00\rangle+\beta|01\rangle+\gamma|10\rangle+\delta|11\rangle.$$

And now the individual qubits don't have their own states, so writing a single particle state is an error. And the c-not gate flips the second bit only if the first bit (the control bit) is one. So it turns $$\alpha|00\rangle+\beta|01\rangle+\gamma|10\rangle+\delta|11\rangle$$

into

$$\alpha|00\rangle+\beta|01\rangle+\delta|10\rangle+\gamma|11\rangle.$$

In your case you need to write the full two particle spin state and perform every interaction on the two particle joint spin state, and stop stop stop thinking that individual single particles have their own states.

Oh, and don't say things like

However, this only ensures that upon measurement, although each one of them has an equal probability of appearing either in the $|1\rangle$ state or in the $|0\rangle$ state, if one of them emerges to be $|0\rangle$, the other will emerge to $|1\rangle$ state.

There are many reasons not to talk like that. Firstly, there is more to a state than how it interacts with a single kind of measurement. It's not like someone just assigned values of up and down in some basis with some probability and some correlation, that would be a classical computer and would defeat the purpose of everything. Secondly you are ignoring the entire fact of a phase difference between the outcomes. One way to get both outcomes equally likely in that basis and to have them always be opposite in that basis is to have a state like

$$0|00\rangle+\beta|01\rangle+\gamma|10\rangle+0|11\rangle,$$

where $|\beta|=|\gamma|.$ And note there are continuum many such states and you aren't saying which one you have. And while they might all behave the same under this measurement, they behave differently under other measurements.

Finally. Don't confuse a NOT gate and a c-NOT gate. Don't confuse it yourself and don't confuse others by using the wrong word sometimes.