Physics Stack Exchange is a question and answer site for active researchers, academics and students of physics. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a circuit that has 4 wires and 2 following each other Toffoli gates. The first Toffoli gate occupies 3 wires from above, the following Toffoli gate occupies 3 wires from below.
What will look like the inverse circuit of this entire circuit?

Thanks much!

share|cite|improve this question
Related question from OP: – Qmechanic Mar 25 '13 at 13:51
Yes, they are started similar, but here is quite another question :) – ABCD Mar 25 '13 at 14:03
up vote 1 down vote accepted

Well, if inverse means "how to undo", you just need to calculate the inverse matrix of the product of the two matrices discussed there: 2 following gates, permutation matrix

Have fun.

share|cite|improve this answer
thanks, but I wonder how will the circuit look like – ABCD Mar 25 '13 at 19:47
Well, it seems to me that a Toffoli gate is its own inverse when looking at the permutation table... By the way circuits and logic gates are supposed to be reversibly, isn't it ? – FraSchelle Mar 25 '13 at 20:38
Thanks. I'm sorry, I don't understand your question. The circuit for an inverse of BA will look the same as the circuit for BA? – ABCD Mar 26 '13 at 6:24
Not in general, but $(B.A)^{-1}=A^{-1}.B^{-1}$ and for Toffoli, $A^{-1}.B^{-1}=A.B$, am I right ? – FraSchelle Mar 26 '13 at 9:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.