2

Here are the different toffolis (or maybe one of them is toffoli and the others are very similar to toffoli gates)

enter image description here

My question is:

  1. we know the matrix of the number 1 Toffoli:

enter image description here

What are the matrices for other two toffoli gates?

quest
  • 704
  • 4
  • 11

3 Answers3

5

The problem is much easier to think about in turns of permutations. You can see that the matrix you created simply swaps the last two elements of the statevector: $[a_{000}, a_{001}, a_{010}, a_{011}, a_{100}, a_{101}, a_{110}, a_{111}]$ becomes $[a_{000}, a_{001}, a_{010}, a_{011}, a_{100}, a_{101}, a_{111}, a_{110}]$

The middle gate above swaps $a_{010}$ and $a_{011}$. The right gate swaps $a_{100}$ and $a_{101}$. The matrix is the identity matrix, but the two $1$s corresponding to these two rows are moved to the opposite corners of the square they are corners of.

And yes, the two gates, together, make an odd parity check.

Frank Yellin
  • 749
  • 3
  • 8
0
                             -----UPDATED------

Thanks to @Rajiv Krishnakumar, I solved the problem by this link Here are my toffolis: enter image description here

enter image description here The other two toffoli was already found yesterday: enter image description here

enter image description here

quest
  • 704
  • 4
  • 11
0

I always find enlightening the block-matrix display approach, so that these three Toffoli operators can be viewed as

$$\begin{bmatrix}I& & & \\ &I& & \\ & &I& \\ & & &X\end{bmatrix}$$ $$\begin{bmatrix}I& & & \\ &X& & \\ & &I& \\ & & &I\end{bmatrix}$$ $$\begin{bmatrix}I& & & \\ &I& & \\ & &X& \\ & & &I\end{bmatrix}$$

where $I$ is the $2$x$2$ identity operator, $X$ is the NOT operator, and the white spaces are all zeroes for tidyness.