I know for instance I can derive a cccX gate using 2 Toffoli gates on 5 qubit wire or ccccX with 3 Toffoli gates and 7 qubits and so on. you will notice the depth is increasing as the number of control qubits increase, that is for every additional c, there are 2 additional qubits. Is there a better way I can derive these multiple controlled x gate using fewer resources (gates and qubits)?
1 Answer
This Qiskit tutorial does what I think you're looking for; with the cnx()
function. It uses this paper to decompose the CNOT gate without ancilla qubits.
Let me know, if this helps you.
-
$\begingroup$ Replaced the depreciated
cu3
gates withcu
gates and it worked perfectly. Thanks. $\endgroup$ Feb 27, 2021 at 10:42