Showing posts with label quantum states. Show all posts
Showing posts with label quantum states. Show all posts

Constructing simple two qubit states

Here, we will describe how to construct some simple two-qubit states using some primitive gates.

In what follows, a two-qubit quantum circuit consisting of one $CNOT$ gate and two Hadamard $H$ gates that computes the following unitary transformation will be described:
\[U=\begin{pmatrix}
1&0&0&0 \\
0&1&0&0\\
0&0&1&0 \\
0&0&0&-1
\end{pmatrix}\]

Consider the for computational basis states and their corresponding representation as column vectors:
\[\ket{00}=\begin{pmatrix}
1\\0\\0\\0
\end{pmatrix},
\ket{01}=\begin{pmatrix}
0\\1\\0\\0
\end{pmatrix},
\ket{10}=\begin{pmatrix}
0\\0\\1\\0
\end{pmatrix},
\ket{11}=\begin{pmatrix}
0\\0\\0\\1
\end{pmatrix}.\]

Observe that $U$ leaves the first three basis states unchanged and only multiplies the last by a factor of $-1$:
\[U\ket{00}=\ket{00},
U\ket{01}=\ket{01},
U\ket{10}=\ket{10},
U\ket{11}=-\ket{11}.\]

Consider the following circuit consisting of a Hadamard gate acting on the second qubit, followed by a controlled-NOT gate, and then with a second Hadamard gate acting on the second qubit again.


 The action of this circuit on each of the four basis states is described below:
 \[\ket{00} \overset{I\otimes H}\mapsto\super{\ket{00}+\ket{01}}\overset{CNOT}\mapsto\super{\ket{00}+\ket{01}}\overset{I\otimes H}\mapsto\frac{1}{2}(\ket{00}+\ket{01}+\ket{00}-\ket{01})=\ket{00},\]

\[\ket{01} \overset{I\otimes H}\mapsto\super{\ket{00}-\ket{01}}\overset{CNOT}\mapsto\super{\ket{00}-\ket{01}}\overset{I\otimes H}\mapsto\frac{1}{2}(\ket{00}+\ket{01}-\ket{00}+\ket{01})=\ket{01},\]

\[\ket{10} \overset{I\otimes H}\mapsto\super{\ket{10}+\ket{11}}\overset{CNOT}\mapsto\super{\ket{11}+\ket{10}}\overset{I\otimes H}\mapsto\frac{1}{2}(\ket{10}-\ket{11}+\ket{10}+\ket{11})=\ket{10}, \]

\[\ket{11} \overset{I\otimes H}\mapsto\super{\ket{10}-\ket{11}}\overset{CNOT}\mapsto\super{\ket{11}-\ket{10}}\overset{I\otimes H}\mapsto\frac{1}{2}(\ket{10}-\ket{11}-\ket{10}-\ket{11})=-\ket{11}.\]

Thus, the action of the circuit is identical to the unitary transformation $U$ expressed as the matrix since the four basis  states are mapped similarly.


Now, define the one-qubit gates $H$ and $S$ as
\[H=\frac{1}{\sqrt{2}}\begin{pmatrix}
1&1\\
1&-1
\end{pmatrix}\]
and
\[S=\begin{pmatrix}
1&0\\
0&i
\end{pmatrix}\]

In each case, the $4\times4$ matrix corresponding to the two-qubit controlled gate is given.

Denote the following gate by $c_1H_2$:

Observe how the $c_1H_2$ gate acts on the four basis states:
\[\ket{00}=\begin{pmatrix} 1\\0\\0\\0\end{pmatrix}\overset{c_1H_2}\mapsto\ket{00}=\begin{pmatrix} 1\\0\\0\\0\end{pmatrix}, \ \ \ \ \ \ \
\ket{01}=\begin{pmatrix} 0\\1\\0\\0\end{pmatrix}\overset{c_1H_2}\mapsto\ket{01}=\begin{pmatrix} 0\\1\\0\\0\end{pmatrix},\]

\[\ket{10}=\begin{pmatrix} 0\\0\\1\\0\end{pmatrix}\overset{c_1H_2}\mapsto\super{\ket{10}+\ket{11}}=\frac{1}{\sqrt{2}}\begin{pmatrix} 0\\0\\1\\1\end{pmatrix},\]

\[\ket{11}=\begin{pmatrix} 0\\0\\0\\1\end{pmatrix}\overset{c_1H_2}\mapsto\super{\ket{10}-\ket{11}}=\frac{1}{\sqrt{2}}\begin{pmatrix} 0\\0\\1\\-1\end{pmatrix}.\]

The matrix representation of the gate $c_1H_2$ can be constructed by placing each of these output vectors as the columns of the matrix:
\[c_1H_2=\begin{pmatrix}
1&0&0&0\\
0&1&0&0\\
0&0&\frac{1}{\sqrt{2}}&\frac{1}{\sqrt{2}}\\
0&0&\frac{1}{\sqrt{2}}&\frac{-1}{\sqrt{2}}
\end{pmatrix}.\]


Denote the following gate by $c_2H_1$:

Observe how the $c_2H_1$ gate acts on the four basis states:
\[\ket{00}=\begin{pmatrix} 1\\0\\0\\0\end{pmatrix}\overset{c_2H_1}\mapsto\ket{00}=\begin{pmatrix} 1\\0\\0\\0\end{pmatrix}, \ \ \ \
\ket{01}=\begin{pmatrix} 0\\1\\0\\0\end{pmatrix}\overset{c_2H_1}\mapsto\super{\ket{01}+\ket{11}}=\frac{1}{\sqrt{2}}\begin{pmatrix} 0\\1\\0\\1\end{pmatrix},\]

\[\ket{10}=\begin{pmatrix} 0\\0\\1\\0\end{pmatrix}\overset{c_2H_1}\mapsto\ket{10}=\begin{pmatrix} 0\\0\\1\\0\end{pmatrix}, \ \ \ \ \
\ket{11}=\begin{pmatrix} 0\\0\\0\\1\end{pmatrix}\overset{c_2H_1}\mapsto\super{\ket{01}-\ket{11}}=\frac{1}{\sqrt{2}}\begin{pmatrix} 0\\1\\0\\-1\end{pmatrix}.\]

Then, matrix representation of the gate $c_1H_2$ can be constructed by placing each of these output vectors as the columns of the matrix:
\[c_1H_2=\begin{pmatrix}
1&0&0&0\\
0&\frac{1}{\sqrt{2}}&0&\frac{1}{\sqrt{2}}\\
0&0&1&0\\
0&\frac{1}{\sqrt{2}}&0&\frac{-1}{\sqrt{2}}
\end{pmatrix}.\]


Denote the following gate by $c_1S_2$:

 First note that $S\ket{0}=\ket{0}$ and $S\ket{1}=i\ket{1}$. Now observe how the $c_1S_2$ gate acts on the four basis states:
\[\ket{00}=\begin{pmatrix} 1\\0\\0\\0\end{pmatrix}\overset{c_1S_2}\mapsto\ket{00}=\begin{pmatrix} 1\\0\\0\\0\end{pmatrix}, \ \ \ \ \ \ \
\ket{01}=\begin{pmatrix} 0\\1\\0\\0\end{pmatrix}\overset{c_1S_2}\mapsto\ket{01}=\begin{pmatrix} 0\\1\\0\\0\end{pmatrix},\]

\[\ket{10}=\begin{pmatrix} 0\\0\\1\\0\end{pmatrix}\overset{c_1S_2}\mapsto\ket{10}=\begin{pmatrix} 0\\0\\1\\0\end{pmatrix}, \ \ \ \ \ \ \
\ket{11}=\begin{pmatrix} 0\\0\\0\\1\end{pmatrix}\overset{c_1S_2}\mapsto\ket{11}=\begin{pmatrix} 0\\0\\0\\i\end{pmatrix}.\]

The matrix representation of the gate $c_1S_2$ can be constructed by placing each of these output vectors as the columns of the matrix:
\[c_1S_2=\begin{pmatrix}
1&0&0&0\\
0&1&0&0\\
0&0&1&0\\
0&0&0&i
\end{pmatrix}.\]


Denote the following gate by $c_2S_1$:

Observe how the $c_2S_1$ gate acts on the four basis states:
\[\ket{00}=\begin{pmatrix} 1\\0\\0\\0\end{pmatrix}\overset{c_2S_1}\mapsto\ket{00}=\begin{pmatrix} 1\\0\\0\\0\end{pmatrix}, \ \ \ \ \ \ \
\ket{01}=\begin{pmatrix} 0\\1\\0\\0\end{pmatrix}\overset{c_2S_1}\mapsto\ket{01}=\begin{pmatrix} 0\\1\\0\\0\end{pmatrix},\]

\[\ket{10}=\begin{pmatrix} 0\\0\\1\\0\end{pmatrix}\overset{c_2S_1}\mapsto\ket{10}=\begin{pmatrix} 0\\0\\1\\0\end{pmatrix}, \ \ \ \ \ \ \
\ket{11}=\begin{pmatrix} 0\\0\\0\\1\end{pmatrix}\overset{c_2S_1}\mapsto\ket{11}=\begin{pmatrix} 0\\0\\0\\i\end{pmatrix}.\]

Note that the action of $c_2S_1$ is identical to that of $c_1S_2$ from case (iii), and so the matrix representation of $c_2S_1$ is also the same:
\[c_2S_1=\begin{pmatrix}
1&0&0&0\\
0&1&0&0\\
0&0&1&0\\
0&0&0&i
\end{pmatrix}.\]

Here, the $4\times4$ matrix corresponding to the following quantum circuit will be given:

where $S$ is defined as it was above, and the last two-qubit gate denoted by $SWAP$ transposes the two qubits (more precisely, the $SWAP$ gate maps $\ket{00}\mapsto\ket{00}, \ket{01}\mapsto\ket{10}, \ket{10}\mapsto\ket{01},\ \text{and}\ \ket{11}\mapsto\ket{11}$).


Denote the overall action of this circuit by the unitary operator $U$. In order to express the action of $U$ as a matrix, first observe how $U$ acts on the four computational basis states:

\[\begin{array}{rcl}
\ket{00} &\overset{H\otimes I}\mapsto&\super{\ket{00}+\ket{10}} \\
&\overset{c_1S_2}\mapsto&\super{\ket{00}+\ket{10}} \\
&\overset{I\otimes H}\mapsto&\frac{1}{2}(\ket{00}+\ket{01}+\ket{10}+\ket{11}) \\
&\overset{SWAP}\mapsto&\frac{1}{2}(\ket{00}+\ket{10}+\ket{01}+\ket{11})
\end{array}
\implies U\begin{pmatrix}1\\0\\0\\0\end{pmatrix}=\frac{1}{2}\begin{pmatrix}1\\1\\1\\1\end{pmatrix},\]

\[\begin{array}{rcl}
\ket{01} &\overset{H\otimes I}\mapsto&\super{\ket{01}+\ket{11}} \\
&\overset{c_1S_2}\mapsto&\super{\ket{01}+i\ket{11}} \\
&\overset{I\otimes H}\mapsto&\frac{1}{2}(\ket{00}-\ket{01}+i\ket{10}-i\ket{11}) \\
&\overset{SWAP}\mapsto&\frac{1}{2}(\ket{00}-\ket{10}+i\ket{01}-i\ket{11})
\end{array}
\implies U\begin{pmatrix}0\\1\\0\\0\end{pmatrix}=\frac{1}{2}\begin{pmatrix}1\\i\\-1\\-i\end{pmatrix},\]

\[\begin{array}{rcl}
\ket{10} &\overset{H\otimes I}\mapsto&\super{\ket{00}-\ket{10}} \\
&\overset{c_1S_2}\mapsto&\super{\ket{00}-\ket{10}} \\
&\overset{I\otimes H}\mapsto&\frac{1}{2}(\ket{00}+\ket{01}-\ket{10}-\ket{11}) \\
&\overset{SWAP}\mapsto&\frac{1}{2}(\ket{00}+\ket{10}-\ket{01}-\ket{11})
\end{array}
\implies U\begin{pmatrix}0\\0\\1\\0\end{pmatrix}=\frac{1}{2}\begin{pmatrix}1\\-1\\1\\-1\end{pmatrix},\]

\[\begin{array}{rcl}
\ket{11} &\overset{H\otimes I}\mapsto&\super{\ket{01}-\ket{11}} \\
&\overset{c_1S_2}\mapsto&\super{\ket{01}-i\ket{11}} \\
&\overset{I\otimes H}\mapsto&\frac{1}{2}(\ket{00}-\ket{01}-i\ket{10}+i\ket{11}) \\
&\overset{SWAP}\mapsto&\frac{1}{2}(\ket{00}-\ket{10}-i\ket{01}+i\ket{11})
\end{array}
\implies U\begin{pmatrix}1\\0\\0\\0\end{pmatrix}=\frac{1}{2}\begin{pmatrix}1\\-i\\-1\\i\end{pmatrix}.\]

Then the matrix constructed that contains the four output vectors as its columns gives the matrix representation of the unitary operation $U$ given by the circuit:
\[U=\frac{1}{2}\begin{pmatrix}
1&1&1&1\\
1&i&-1&-i\\
1&-1&1&-1\\
1&-i&-1&i
\end{pmatrix}.\]

Entangled vs. Seperable states

If possible, each two-qubit state given below will be expressed as a product of two one-qubit states. Otherwise, it will be shown that such a factorization is impossible (in this case, the qubits are said to be entangled).


Case (i):
$\ket{\psi}=\frac{1}{2}\ket{00}+\frac{i}{2}\ket{01}-\frac{1}{2}\ket{10}-\frac{i}{2}\ket{11}$


Consider the one-qubit states $\ket{\phi_1}=\frac{1}{\sqrt2}\ket{0}-\frac{1}{\sqrt2}\ket{1}$ and $\ket{\phi_2}=\frac{1}{\sqrt2}\ket{0}+\frac{i}{\sqrt2}\ket{1}$. Then expanding the tensor product of the two states $\ket{\phi_1}\otimes\ket{\phi_2}=\ket{\phi_1}\ket{\phi_2}$ yields:
\[\begin{array}{rcl}\ket{\phi_1}\ket{\phi_2}&=&(\frac{1}{\sqrt2}\ket{0}-\frac{1}{\sqrt2}\ket{1})(\frac{1}{\sqrt2}\ket{0}+\frac{i}{\sqrt2}\ket{1}) \\
\\
&=&\frac{1}{\sqrt2}\frac{1}{\sqrt2}\ket{0}\ket{0}+\frac{1}{\sqrt2}\frac{i}{\sqrt2}\ket{0}\ket{1}-\frac{1}{\sqrt2}\frac{1}{\sqrt2}\ket{1}\ket{0}-\frac{1}{\sqrt2}\frac{i}{\sqrt2}\ket{1}\ket{1} \\
\\
&=&\frac{1}{2}\ket{00}+\frac{i}{2}\ket{01}-\frac{1}{2}\ket{10}-\frac{i}{2}\ket{11}.
\end{array}\]
Thus, $\ket{\psi}=\ket{\phi_1}\ket{\phi_2}$ can be expressed as the tensor product of two one-qubit states and is therefore a separable state.


Case (ii):

$\ket{\psi}=\frac{1}{2}\ket{00}+\frac{1}{2}\ket{01}+\frac{1}{2}\ket{10}-\frac{1}{2}\ket{11}$

It will be shown that $\ket{\psi}$ is an entangled state. For the sake of contradiction, suppose that $\ket{\psi}$ can be written as the tensor product of two one-qubit states expressed in their general form $\ket{\phi_1}=\alpha\ket{0}+\beta\ket{1}$ and $\ket{\phi_2}=\alpha'\ket{0}+\beta'\ket{1}$, where $\alpha,\beta,\alpha',\beta'\in\mathbb{C}$. Then,
\[\begin{array}{rcl}
\ket{\psi}&=&\ket{\phi_1}\ket{\phi_2} \\
\\
&=&(\alpha\ket{0}+\beta\ket{1})(\alpha'\ket{0}+\beta'\ket{1}) \\
\\
&=&\alpha\alpha'\ket{00}+\alpha\beta'\ket{01}+\beta\alpha'\ket{10}+\beta\beta'\ket{11}
\end{array}\]
Now compare these amplitudes to those actually provided in $\ket{\psi}$:
\[\alpha\alpha'=\frac{1}{2}, \alpha\beta'=\frac{1}{2}, \beta\beta'=\frac{1}{2}, \beta\beta'=\frac{-1}{2}.\]
Since these products are all nonzero numbers and $\alpha,\beta,\alpha',\beta'\in\mathbb{C}$, this implies that $\alpha,\beta,\alpha',\beta'\neq 0$. Consider the following relationships which must also hold:
\[\begin{array}{rl}
&\alpha\alpha'-\alpha\beta'=\frac{1}{2}-\frac{1}{2}=0\\
\implies&\alpha(\alpha'-\beta')=0 \\
\implies&\alpha'=\beta',
\end{array}\]
and likewise
\[\begin{array}{rl}
&\beta\alpha'+\beta\beta'=\frac{1}{2}+\frac{-1}{2}=0\\
\implies&\beta(\alpha'+\beta')=0 \\
\implies&\alpha'=-\beta',
\end{array}\]
but then $\beta'=-\beta'$ implies that $\beta'=0$ which contradicts the fact that $\beta'\neq0$. Therefore, the two-qubit state $\ket{\psi}$ cannot be expressed as the tensor product of two one-qubit states, and must be entangled.


Case (iii):
$\ket{\psi}=\frac{9}{25}\ket{00}+\frac{12}{25}\ket{01}+\frac{12}{25}\ket{10}-\frac{16}{25}\ket{11}$


Consider the two identical one-qubit states $\ket{\phi_1}=\ket{\phi_2}=\frac{3}{5}\ket{0}+\frac{4}{5}\ket{1}$. Then expanding the tensor product of the two states $\ket{\phi_1}\otimes\ket{\phi_2}=\ket{\phi_1}\ket{\phi_2}$ yields:
\[\begin{array}{rcl}\ket{\phi_1}\ket{\phi_2}&=&(\frac{3}{5}\ket{0}+\frac{4}{5}\ket{1})(\frac{3}{5}\ket{0}+\frac{4}{5}\ket{1}) \\
\\
&=&\frac{3}{5}\frac{3}{5}\ket{0}\ket{0}+\frac{3}{5}\frac{4}{5}\ket{0}\ket{1}+\frac{4}{5}\frac{3}{5}\ket{1}\ket{0}+\frac{4}{5}\frac{4}{5}\ket{1}\ket{1} \\
\\
&=&\frac{9}{25}\ket{00}+\frac{12}{25}\ket{01}+\frac{2}{25}\ket{10}+\frac{16}{25}\ket{11}.
\end{array}\]
Thus, $\ket{\psi}=\ket{\phi_1}\ket{\phi_2}$ can be expressed as the tensor product of two one-qubit states and is therefore a separable state.