# Help on applying a Hadamard gate and CNOT to two single q-bits

I am stuck on a few issues in this video. (Note: It is at the frame concerning this question.)

In it, from what I understand (which could be wrong) we first apply the Hadamard gate to a qbit in the $\lvert 0 \rangle$ state. Then on that we use a controlled not on the output value, together with another input from another qbit set at $\lvert 0 \rangle$. I don't understand how to work this out and how the $\lvert 00 \rangle + \lvert 10 \rangle$ is derived for the output of combination of the two gates.

Here is what I am thinking (neglecting the $1/\sqrt{2}$ multiplier):

$$\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 1 \\ 1 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \end{pmatrix} + \begin{pmatrix} 0 \\ 1 \end{pmatrix} = \lvert 0 \rangle + \lvert 1 \rangle.$$

There however is another $\lvert 0 \rangle$ coming in from the second (bottom) wire and it interacts with the output from the Hadamard gate. I don't understand how to manipulate the values - have no idea if I can do something such as the following by distribution: $$(\lvert 0 \rangle + \lvert 1 \rangle) \lvert 0 \rangle = \lvert 0 \rangle \lvert 0 \rangle + \lvert 1 \rangle \lvert 0\rangle.$$

I have no idea why we can do this (if we can even do so), but this is the only way I can see that we could get $\lvert 0 \rangle \lvert 0 \rangle + \lvert 1\rangle \lvert 0 \rangle = \lvert 00 \rangle + \lvert 10 \rangle$, as the author of the video has on the particular time in the video.

Any clarification would be extremely appreciated.

The basis you have for the two qubits in this example is the product basis, where all states describing the two qubits are products of states describing each individual qubit.

Some notation: $|01 \rangle$ is the same as $|0\rangle |1 \rangle$. The first state is for the first qubit, the second state is for the second qubit.

Thus, the most general 2-qubit state would look something like $( a|0\rangle + b|1\rangle)(c|0\rangle + d|1\rangle)$, taking normalization into account of course.

Some basic linear algebra would then tell you that you can indeed use the distributive property, so $$(|0\rangle + |1\rangle) |0\rangle = |00\rangle + |10\rangle$$

If you want to go the long way to convince yourself that you can do these things, write down the Hadamard gate in the 2-qubit basis: You have your four basis states, $|00\rangle, |01\rangle, |10\rangle$ and $|11\rangle$ and you know how the Hadamard gate acts on the first qubit and that it does not change the second qubit, so you could write down the corresponding 4x4 matrix.

• Might be worth pointing out for the OP's sake that the implicit product here is the tensor product, $\otimes$, which does indeed distribute over addition. It might be "basic" for multiparticle QM, but I feel most pure linear algebra 101 courses for non-mathematicians won't cover it.
– user10851
Jul 30, 2013 at 1:54