pennylane
pennylane copied to clipboard
Group "utility" operations into same file.
Right now, Barrier
and WireCut
are located in pennylane/ops/qubit/non_parametric_ops.py
, even though they are not unique to qubit ops. Snapshot
is located in its own file in pennylane/ops/snapshot.py
.
I propose grouping all three ops:
-
Barrier
-
WireCut
-
Snapshot
into a new file pennylane/ops/utility_ops.py
. The tests should then be moved as well.
I am open to a different name than "utility". Whatever term bests describes "things we mostly treat as operations but aren't really."
Update: Let's place these in pennylane/ops/meta.py
.
Maybe a module name that indicates that these are 'meta' operations? That is, they use the Operation
abstraction but aren't actually operations in the theoretical sense
Hi! Can I work on this issue?
Hi @tgag17 , Go ahead! I've tagged you on the issue.
Thanks @albi3ro!
Heyy, is this issue still available? Please let me know!! As the related/attached PR is closed due to inactivity
This issue is still good to go. Feel free to take this on @AnuravModak !
Hello @albi3ro, I've begun working on this issue, and I have a few questions. But before that, let me update you on my progress. I've relocated the Barrier and WireCut operations from pennylane/ops/qubit/non_parametric_ops.py
, moved the Snapshot operation from pennylane/ops/snapshot.py
, and deleted the snapshot.py
file. Additionally, I've updated the import statements in pennylane/ops/qubit/__init__.py
.
Now, I'd like to know your plan regarding the movement of the corresponding test code. Should I transfer the test code from tests/ops/qubit/test_non_parametric_ops.py
to meta.py
, or do you have a different directory or file in mind where I should relocate these test codes?
Also kindly provide the command to reformat the files according to black
formatting style or any other mandatory formatting styles so that there is no issue with formatting.
Thanks for reaching out @AnuravModak :)
Moving tests from tests/ops/qubit/test_non_parametric_opy.py
and tests/ops/test_snapshot.py
to a new file tests/ops/test_meta.py
would be recommended.
Formatting with black can be done with:
black -l 100 pennylane
black -l 100 tests
and pylint can be run with
pylint relevant_file.py
These commands can also be found in our page on Submitting a pull request
Closed by #4789