Problem:
Consider the following inputs to the classical Toffoli gate:
What 2-input function of \(x,y\) describes the third output?
Solution:
Recall that
$$
\mbox{TOF}\kt{x,y,z} \eql \kt{x,y, xy\oplus z}
$$
and so
$$
\mbox{TOF}\kt{x,y,1} \eql \kt{x,y, xy\oplus 1}
\eql \kt{x,y, (xy)^\prime}
$$
This is the Boolean NAND gate, which we can see perhaps more
clearly through this truth table:
$$
\begin{array}{|c|c|c|c|c|}\hline
x & y & xy & (xy)^\prime & xy\oplus 1 \\\hline
0 & 0 & 0 & 1 & 1 \\
0 & 1 & 0 & 1 & 1 \\
1 & 0 & 0 & 1 & 1 \\
1 & 1 & 1 & 0 & 0 \\\hline
\end{array}
$$
Problem:
Is the following a plausible quantum gate?
Solution:
Let's write out the truth-table:
\begin{array}{|c|c|c|c|c|c|}\hline
x & y & z & y\oplus x & z & y\\\hline
0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 1 & 0 \\
0 & 1 & 0 & 1 & 0 & 1 \\
0 & 1 & 1 & 1 & 1 & 1 \\
1 & 0 & 0 & 1 & 0 & 0 \\
1 & 0 & 1 & 1 & 1 & 0 \\
1 & 1 & 0 & 0 & 0 & 1 \\
1 & 1 & 1 & 0 & 1 & 1 \\\hline
\end{array}
$$
There are no duplicate rows in the output, making this a reversible
Boolean function (a permutation), which means a quantum equivalent
is theoretically feasible.
As a further exercise to try on your own, suppose \(G\kt{x}\kt{y}\kt{z} = \kt{y\oplus x}\kt{z}\kt{y}\). Compute the effect of \(G^3\) algebraically. What do you conclude?