I was watching some lectures on qubits. They were talking about how to generate a Bell state. They described it as follows:

  1. Prepare state 00: $$\left |0 \right> \otimes \left |0 \right>$$
  2. Apply the Hadamard: $$ (H \otimes I)(\left |0 \right> \otimes \left |0 \right> ) = \left |+0 \right> = \frac{\left|00 \right> + \left |10 \right>}{\sqrt{2}}$$
  3. Apply CNOT to go from state 00 + 10 to state 00 + 11, $$ CNOT = \left |0 \right> \left <0 \right| \otimes I + \left |1 \right> \left<1 \right| \otimes X $$ such that: $$CNOT\times\frac{\left|00 \right> + \left |10 \right>}{\sqrt{2}}=\frac{\left |0 \right> \left <0|0 \right> \otimes I \left |0 \right> + \left |0 \right> \left <0|1 \right> \otimes I\left |1 \right> + \left |1 \right> \left <1|0 \right> \otimes X \left |0 \right> + \left |1 \right> \left <1|1 \right> \otimes X \left |0 \right> }{\sqrt{2}} = \left | \Omega \right >$$

I am not sure I can follow how the product of the CNOT and the state $\left|00 \right> + \left |10 \right>$ can be expanded out as written above. Hope you guys can help me out.


4 Answers 4


I would recommend to use a direct matrix representation.

  1. An input state $|00\rangle$ can be writen as vector $$x= \begin{pmatrix} 1\\0\\0\\0 \end{pmatrix} $$

  2. First step, i.e. Hadamard gate on first qubit and "nothing" on second qubit is described by operation $$ H \otimes I = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} \otimes \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \\ 1 & 0 & -1 & 0 \\ 0 & 1 & 0 & -1 \\ \end{pmatrix} $$

  3. Multiplying vector $x$ with matrix $H \otimes I$ gives vector $$ y=\ \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ 0 \\ 1 \\0 \end{pmatrix}, $$ which is a first column of the matrix.

  4. Now, you can apply CNOT gate described by matrix $$ \text{CNOT}= \begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 1\\ 0 & 0 & 1 & 0\\ \end{pmatrix}, $$ so $$ z=\text{CNOT}\, y= \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ 0 \\ 0 \\ 1 \end{pmatrix} $$

In computational basis, vector $z$ is $$ z = \frac{1}{\sqrt{2}}(|00\rangle+|11\rangle), $$ which is a desired Bell state.


As you wrote at point 3, $CNOT$ is the sum of two tensor products, each one involving two matrices. Consider the first tensor product and apply the two matrices respectively to $|0\rangle$ and to $|0\rangle$ (the $|00\rangle$ pair in your state obtained at 2.) and perform the tensor product, so you get the first quarter of the final expansion. Apply the same two matrices respectively to $|0\rangle$ and to $|1\rangle$ (the $|01\rangle$ pair in your state obtained at 2.) and perform the tensor product, so you get the second quarter of the final expansion. Then repeat using the second tensor product of the CNOT expansion, and you get the third and fourth quarters of the final expansion. Shortly, use the distributive property of multiplication.


I will answer the question in a different way. Let's assume your two qubits are represented as below.

enter image description here

Consider your $|00\rangle$, represented by $|q_1q_0\rangle$, is the state of above circuit before applying any gates, this is same as your original state $|0\rangle \otimes |0\rangle$.

Now applying hadamard in your step 2 is same as applying hadamard on $q_0$. We know $q_0$ is $|0\rangle$. So if apply hadamard gate on $|0\rangle$ it will be transformed to $\frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$. (check this by doing simple matrix multiplication if you are in doubt).

Let's see $q_1$ now, no gate is applied to it so it remains as $|0\rangle$.

So now, the combined state is $\frac{1}{\sqrt{2}}(|00\rangle + |01\rangle)$ after applying the hadamard gate. Now apply the CNOT gate (same as your step 3) on the 2 qubits. Classical CNOT gate simply means if control bit is 1 the target bit is flipped, so same logic can be applied for a CNOT gate applied on the qubit. In our case control qubit is $q_0$ and target qubit is $q_1$. So let's apply CNOT on $|q_1q_0\rangle$

$CNOT(\frac{1}{\sqrt{2}}(|00\rangle + |01\rangle))$ when you apply from rightmost, $|01\rangle$ transforms to $|11\rangle$ as control qubit ($q_0$) is contributing $|1\rangle$ here so the target qubit $q_1$ which is contributing $|0\rangle$ flips to $|1\rangle$. Similarly if you move left, $|00\rangle$ will remain $|00\rangle$ as control qubit $q_0$ is contributing $|0\rangle$ to this part, so flipping is not required, hence target qubit($q_1$) remains same($|0\rangle$). So putting both together you get following

CNOT($\frac{1}{\sqrt{2}}(|00\rangle + |01\rangle)$) = $\frac{1}{\sqrt{2}}(|00\rangle + |11\rangle)$

This way of thinking would be helpful when you are dealing with bigger transformations and more qubits. Hope it is helpful.


I'd rather follow a different path... Starting from the fact that Hadamard gate is

$$H = (X + Z) \frac{1}{\sqrt{2}}$$

I exploited a 4x4 block-matrix $B$ adding two tensor products and normalizing the same way:

$$B := ( X \otimes X + Z \otimes I ) \frac{1}{\sqrt{2}}$$

Yet amazingly for me, the definition of $B$ looks very similar to the above equation of $H$.

Expanding the two tensor products using block-matrices, $B$ looks like

$$B := \begin{bmatrix}0&X\\X&0\end{bmatrix}\frac{1}{\sqrt{2}} + \begin{bmatrix}I&0\\0&-I\end{bmatrix}\frac{1}{\sqrt{2}} = \begin{bmatrix}I&X\\X&-I\end{bmatrix}\frac{1}{\sqrt{2}} = \begin{bmatrix}1&0&0&1\\0&1&1&0\\0&1&-1&0\\1&0&0&-1\end{bmatrix}\frac{1}{\sqrt{2}}$$

and the four columns of matrix $B$ are the coefficients of the four Bell states:

$$B\left |00\right> = \left |\Phi^+\right>$$

$$B\left |01\right> = \left |\Psi^+\right>$$

$$B\left |10\right> = \left |\Psi^-\right>$$

$$B\left |11\right> = \left |\Phi^-\right>$$

But indeed, other replies show that's the same as applying the circuit depicted in their reply and which can be written as

$$CNOT \space \space (H \otimes I) = \begin{bmatrix}1&0&0&0\\0&1&0&0\\0&0&0&1\\0&0&1&0\end{bmatrix} \begin{bmatrix}1&0&1&0\\0&1&0&1\\1&0&-1&0\\0&1&0&-1\end{bmatrix}\frac{1}{\sqrt{2}} =\begin{bmatrix}1&0&1&0\\0&1&0&1\\0&1&0&-1\\1&0&-1&0\end{bmatrix}\frac{1} {\sqrt{2}}$$

that's one column-permutation off from the very same $B$.

Applying another $CNOT$ to the right of (or before) $H$ we obtain:

$$CNOT \space \space (H \otimes I) \space CNOT =\begin{bmatrix}1&0&1&0\\0&1&0&1\\0&1&0&-1\\1&0&-1&0\end{bmatrix}\frac{1} {\sqrt{2}} \begin{bmatrix}1&0&0&0\\0&1&0&0\\0&0&0&1\\0&0&1&0\end{bmatrix} =\begin{bmatrix}1&0&0&1\\0&1&1&0\\0&1&-1&0\\1&0&0&-1\end{bmatrix}\frac{1}{\sqrt{2}}=B$$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.