How can I apply single qubit gates and CNOT to 8x1 column vectors?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 2K views
EightBells
Messages
9
Reaction score
1
Homework Statement
Construct the GHZ state, |GHZ>= (1/sqrt(2))*(|000>+|111>) from the state |000> using a sequence of CNOT and single qubit gates.
Relevant Equations
n/a
I know |GHZ>=(1/sqrt(2))[1; 0; 0; 0; 0; 0; 0; 1], and |000>= the tensor product |0> x |0> x |0> = [1; 0; 0; 0; 0; 0; 0; 0].

Can I apply single qubit gates (i.e. 2x2 matrices) and CNOT (a 4x4 matrix) to 8x1 column vectors? If so, does anyone know a good starting point or a hint to get me moving in the right direction?
 
Physics news on Phys.org
Well, of course, any qubit gate that you apply must be an 8x8 unitary matrix. For example, if you want to apply an H gate to the second bit, you are applying the unitary transformation
$$\frac{1}{\sqrt{2}}
\begin{pmatrix}
1 & 0 & 1 & 0 &0 & 0 & 0 & 0 \\
0 & 1 & 0 & 1 &0 & 0 & 0 & 0 \\
1 & 0 & -1 & 0 &0 & 0 & 0 & 0 \\
0 & 1 & 0 & -1 &0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 &1 & 0 & 1 & 0 \\
0 & 0 & 0 & 0 &0 & 1 & 0 & 1 \\
0 & 0 & 0 & 0 &1& 0 & -1 & 0 \\
0 & 0 & 0 & 0 &0 & 1 & 0 & -1 \\
\end{pmatrix}
$$
But work with 8x8 matrices is very tedious, so it's better to always work in tensor product, in this case multiply by the previous matrix is equivalent to do
$$H_2\left|000\right> = \left(I\left|0\right>\right)\left(H\left|0\right>\right)\left(I\left|0\right>\right) = \left(\left|0\right>\right)\left(\frac{\left|0\right>+\left|1\right>}{\sqrt{2}}\right)\left(\left|0\right>\right) = \frac{\left|000\right>+\left|010\right>}{\sqrt{2}}$$

Or, if you want to apply an ##X## gate to the third qubit you simply do
$$X_3\left|000\right> = \left(I\left|0\right>\right)\left(I\left|0\right>\right)\left(X\left|0\right>\right) = \left(\left|0\right>\right)\left(\left|0\right>\right)\left(\left|1\right>\right)
=\left|001\right>$$
which is equivalent to multiply by the matrix
$$\begin{pmatrix}
0 & 1 & 0 & 0 &0 & 0 & 0 & 0 \\
1 & 0 & 0 & 0 &0 & 0 & 0 & 0 \\
0 & 0 & 0 & 1 &0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 &0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 &0 & 1 & 0 & 0 \\
0 & 0 & 0 & 0 &1 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 &0& 0 & 0 & 1 \\
0 & 0 & 0 & 0 &0 & 0 & 1 & 0 \\
\end{pmatrix}
$$
But we all will agree that is better to work qubit by qubit. The CNOT gate works in the same way. Now, try to apply some qubit gates to go from ##\left|000\right>## to ##\frac{\left|000\right>+\left|111\right>}{\sqrt{2}}##
 
  • Like
Likes   Reactions: EightBells and DrClaude