Here are the different toffolis (or maybe one of them is toffoli and the others are very similar to toffoli gates)
My question is:
- we know the matrix of the number 1 Toffoli:
What are the matrices for other two toffoli gates?
Quantum Computing Stack Exchange is a question and answer site for engineers, scientists, programmers, and computing professionals interested in quantum computing. It only takes a minute to sign up.
Sign up to join this communityHere are the different toffolis (or maybe one of them is toffoli and the others are very similar to toffoli gates)
My question is:
What are the matrices for other two toffoli gates?
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.
-----UPDATED------
Thanks to @Rajiv Krishnakumar, I solved the problem by this link
Here are my toffolis: