Toffoli gate decomposition


Is it also necessary to decompose Toffoli gates in our circuit?

You will want to measure the depth of the circuit, and for this, the Toffoli needs to be decomposed. Here are some instructions on how it can be done: Measuring Depth and 2-Qubit Gate Count - #3 by dp_1

Do we need to use the suggested decomposition for the Toffoli gate in the problem?
If yes, the suggested decomposition has problems with this input:
first qubit =1 , second qubit=0, target qubit=0,
the result is: 101 and 001. Its output should be 001 only because this is supposed to be equal to the Toffoli gate.
Is this okay?

1 Like

You don’t need to use the example decomposition. You can use whatever decomposition you want as long as the result is the multi controlled gate, and the order of the audits is as specified.