Closed antalszava closed 3 years ago
Hello! I would like to solve this issue :) Thank you
Hi @Miru19, that's great to hear! :) Feel free to start with it and open up a draft PR that's work in progress if you'd like. Don't hesitate to post any questions here.
This issue has been tagged for contributions during unitaryHACK
Context
We would like to define a new diagonal operation called
ZZ
, as defined in the PennyLane-Braket plugin.Steps to take
A. Adding the operation
ZZ
class and its attributes topennylane/ops/qubit.py
. This class would inherit fromDiagonalOperation
. Complete its docstring in a similar fashion as for other operations. Make sure the class is accessible throughqml.ZZ
.tests/ops/test_qubit_ops.py
file,Note:
ZZ
is a special case forPauliRot
for the"ZZ"
Pauli word. Therefore, the decomposition ofZZ
can directly depend on usingPauliRot
, which further decomposes into elementary gates. Inheriting fromPauliRot
could also be considered.B. Adding
default.qubit
supportdefault.qubit
device,default.qubit
in thetests/devices/test_default_qubit.py
file.Bonus: Add support to the interface-specific
default.qubit
devices too:default.qubit.autograd
anddefault.qubit.tf
. This will require the operation to be defined in a framework-specific way. These devices inherit the supported operations fromdefault.qubit
, so if this step is not tackled, theZZ
can be removed from theoperations
dictionary fordefault.qubit.autograd
anddefault.qubit.tf
.