## Tuesday, 15 October 2013

### 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}.$