## Saturday, 30 November 2013

### Constructing an AND gate as a quantum operation

Here we consider operations that map the two-bit state $\ket{a,b}$ to the one-qubit state $\ket{a\wedge b}$, for all $a,b\in\{0,1\}$, where $a\wedge b$ represents the binary logical AND operation of $a$ and $b$. We will construct  $k$ matrices $A_1,\dots, A_k$ (where $k\leq 4$, and each $A_j$ is a $2 \times 4$ matrix) such that $\sum_ {j=1}^{k}A^\dagger_jA_j=I$, and whose quantum operation $\Phi$ computes the above mapping. In other words, for all $a,b\in \{0,1\}$, when $\rho=\ket{a,b}\bra{a,b}$,
$\Phi(\rho):=\SUM{j=1}{k}A_j\rho A^\dagger_j=\ket{a\wedge b}\bra{a\wedge b}.$

Define the following matrices:
$A_1=\begin{pmatrix} 1&0&0&0 \\ 0&0&0&0 \end{pmatrix}, \ A_2=\begin{pmatrix} 0&1&0&0 \\ 0&0&0&0 \end{pmatrix}, \ A_3=\begin{pmatrix} 0&0&1&0 \\ 0&0&0&0 \end{pmatrix}, \ A_4=\begin{pmatrix} 0&0&0&0 \\ 0&0&0&1 \end{pmatrix},$
and observe that
\begin{align*} A^\dagger_1A_1=\begin{pmatrix} 1&0&0&0\\0&0&0&0\\0&0&0&0\\ 0&0&0&0 \end{pmatrix} , \ & A^\dagger_2A_2=\begin{pmatrix} 0&0&0&0\\0&1&0&0\\0&0&0&0\\ 0&0&0&0 \end{pmatrix} \\ A^\dagger_3A_3=\begin{pmatrix} 0&0&0&0\\0&0&0&0\\0&0&1&0\\ 0&0&0&0 \end{pmatrix} , \ & A^\dagger_4A_4=\begin{pmatrix} 0&0&0&0\\0&0&0&0\\0&0&0&0\\ 0&0&0&1 \end{pmatrix}. \end{align*}
Therefore $\sum_{j=1}^{4}A^\dagger_j A_j=I$ is the $4\times 4$ identity matrix, which is necessary to define a valid channel in the Krauss representation

Now consider the four computational basis states $\ket{a,b}$, for $a,b\in\{0,1\}$, with corresponding density operators given by $\rho_i:=\ket{a,b}\bra{a,b}$ where the index can be represented in terms of $a$ and $b$ as $i=2a+b+1$. More explicitly,

\begin{align*} \rho_1:=\ket{0,0}\bra{0,0}=\begin{pmatrix} 1&0&0&0\\0&0&0&0\\0&0&0&0\\ 0&0&0&0 \end{pmatrix} , \ & \rho_2:=\ket{0,1}\bra{0,1}=\begin{pmatrix} 0&0&0&0\\0&1&0&0\\0&0&0&0\\ 0&0&0&0 \end{pmatrix} \\ \rho_3:=\ket{1,0}\bra{1,0}=\begin{pmatrix} 0&0&0&0\\0&0&0&0\\0&0&1&0\\ 0&0&0&0 \end{pmatrix} , \ & \rho_4:=\ket{1,1}\bra{1,1}=\begin{pmatrix} 0&0&0&0\\0&0&0&0\\0&0&0&0\\ 0&0&0&1 \end{pmatrix}. \end{align*}

It then follows that,
$A^\dagger_j \rho_i A_j=\left\{ \begin{array}{rl} \begin{pmatrix}0 &0 \\ 0 &0 \end{pmatrix} \ \ &\text{if} \ \ i\neq j, \\ \\ \begin{pmatrix}1 &0 \\ 0 &0 \end{pmatrix} \ \ &\text{if} \ \ i= j<4, \\ \\ \begin{pmatrix}0 &0 \\ 0 &1 \end{pmatrix} \ \ & \text{if} \ \ i= j=4. \end{array} \right.$

Therefore,
$\Phi(\rho_i)=\SUM{j=1}{k}A_j\rho_i A^\dagger_j\left\{ \begin{array}{rl} \begin{pmatrix}1 &0 \\ 0 &0 \end{pmatrix} \ \ &\text{if} \ \ i<4, \\ \\ \begin{pmatrix}0 &0 \\ 0 &1 \end{pmatrix} \ \ & \text{if} \ \ i=4. \end{array} \right.$

Now, for $a,b\in\{0,1\}$ the logical AND operation is such that $a\wedge b=1$ if and only if $a=b=1$, and $a\wedge b=0$ otherwise. Moreover,
$\ket{a\wedge b}\bra{a\wedge b}=\left\{ \begin{array}{rl} \ket{0}\bra{0}=\begin{pmatrix}1 &0 \\ 0 &0 \end{pmatrix} \ \ &\text{if} \ \ a\wedge b=0, \\ \\ \ket{1}\bra{1}=\begin{pmatrix}0 &0 \\ 0 &1 \end{pmatrix} \ \ &\text{if} \ \ a\wedge b=1. \end{array} \right.$

Hence, the quantum operation defined in this manner does indeed compute the logical AND operation
$\Phi(\rho_i)=\SUM{j=1}{k}A_j\rho_i A^\dagger_j=\ket{a\wedge b}\bra{a\wedge b},$
where, as originally defined $\rho_i:=\ket{a,b}\bra{a,b}$ with $i=2a+b+1$ for $a,b\in\{0,1\}$.

This operation maps all basis states to pure states, but does it map all pure input states to pure output states?

Consider the pure state $\ket{\psi}:=\frac{1}{\sqrt{2}}(\ket{0,0}+\ket{1,1})$, with density matrix given by
\begin{align*} \rho:=\ket{\psi}\bra{\psi}&=\frac{1}{2}(\ket{0,0}+\ket{1,1})(\bra{0,0}+\bra{1,1})\\ &=\frac{1}{2}(\ket{0,0}\bra{0,0}+\ket{0,0}\bra{1,1}+\ket{1,1}\bra{0,0}+\ket{1,1}\bra{1,1}) \\ &=\frac{1}{2}\begin{pmatrix} 1&0&0&1 \\ 0&0&0&0 \\ 0&0&0&0 \\ 1&0&0&1 \end{pmatrix}. \end{align*}

Recall that $\Phi(\ket{0,0}\bra{0,0})=\ket{0}\bra{0}$ and $\Phi(\ket{1,1}\bra{1,1})=\ket{1}\bra{1}$. Moreover it can be seen that $\Phi(\ket{0,0}\bra{1,1})=\Phi(\ket{1,1}\bra{0,0})=\mathbf{0}_2$ (where $\mathbf{0}_2$ is the $2\times 2$ zero matrix) since $\Phi$ only acts nontrivially on  a matrix which has some nontrivial coefficient along its main diagonal.That is, for $a,b,c,d\in\{0,1\}$, $\Phi(\ket{a,b}\bra{c,d})\neq \mathbf{0}_2$ only if $a=c$ and $b=d$. Then by the linearity of the quantum operation $\Phi$,
\begin{align*} \Phi(\rho)&=\frac{1}{2}(\Phi(\ket{0,0}\bra{0,0})+\Phi(\ket{0,0}\bra{1,1})+\Phi(\ket{1,1}\bra{0,0})+\Phi(\ket{1,1}\bra{1,1}))\\ &=\frac{1}{2}(\ket{0}\bra{0}+\ket{1}\bra{1}) \\ &=\frac{1}{2}\begin{pmatrix}1 &0 \\ 0 &0 \end{pmatrix} + \frac{1}{2}\begin{pmatrix}0 &0 \\ 0 &1 \end{pmatrix} \\ &=\frac{1}{2}\begin{pmatrix}1 &0 \\ 0 &1 \end{pmatrix} \end{align*}

Thus, since $\Phi(\rho)$ in this case is a mixed state, but $\rho$ was a pure state, the quantum operation $\Phi$ does not always take pure input states to pure output states.