Closed antalszava closed 3 years ago
Hi! I would like to work on this issue. Would it be a good idea to decompose the Toffoli gate to a list of Hadamard, CNOT and T gates?
Hi @tgag17, that's great :tada: Yes, using the Hadamard, CNOT and T gates for the decomposition would work nicely. :slightly_smiling_face:
Feel free to open up a PR (even if it's still a work in progress) and ask any questions that you may have.
Great! Thank you.
This issue has been tagged for contributions during unitaryHACK
Each PennyLane operation defines a decomposition. The decomposition of an operation is an ordered list of other operations. Applying this list of operations evolves quantum states the same way as applying the operation itself does. In most cases, this list includes elementary gates that are often supported by most quantum devices.
We would like to add the decomposition of the
qml.Toffoli
operation by:qml.Toffoli
operation that has the following signature:Other operations in the
pennylane/ops/qubit.py
file can serve as an example for defining this method (e.g., seeqml.Hadamard
).qml.Toffoli
in thetests/ops/test_qubit_ops.py
file to verify its correctness.