Closed antalszava closed 3 years ago
Hey! I would like to have a crack at this. Would you have any tips on writing the tests? Thanks for the opportunity!
Hi @charmerDark - you can have a look at some of the decomposition tests we have in test_qubit_ops.py
. Essentially, the idea is to:
Another possible landing spot (and reference) for gate tests:
Hi @antalszava I send a Pull requests about this issue, but I forgot to add the Unitaryhack label, is there any problem or should I resend it?
Hi @MaldoAlberto, I can add the label for 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.CSWAP
operation by:qml.CSWAP
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.CSWAP
in thetests/ops/test_qubit_ops.py
file to verify its correctness.