-
Notifications
You must be signed in to change notification settings - Fork 558
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
qml.simplify
a transform (#4949)
**Context:** `qml.simplify` can be applied to operations, measurements, tapes, qnodes, or qfuncs. It seems appropriate for it to be a transform. So I made it one. **Description of the Change:** * Added `_simplify_transform` with a `transform` decorator to handle transforming tapes, qnodes, and callables. The public `simplify` function directly handles operators and measurements, and dispatches to `_simplify_transform` for other valid inputs. **Benefits:** `qml.simplify` is consistent with other op functions/transforms. **Possible Drawbacks:** When given a tape, `qml.simplify` used to return a tape, but now it returns a list with one tape and a processing function. Small breaking change, but this was also a breaking change for the other op transforms, so I don't think this is a major deal. **Related GitHub Issues:** [sc-52122] --------- Co-authored-by: Romain Moyard <rmoyard@gmail.com>
- Loading branch information
Showing
3 changed files
with
40 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters