feat: Add RQang operation to parametric qubit operations - #10257
Open
LestlinRobins wants to merge 3 commits into
Open
LestlinRobins wants to merge 3 commits into
LestlinRobins wants to merge 3 commits into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10171
Context
Single-qubit rotations in the XY plane are commonly used in quantum circuits and pulse-level control. While these rotations can already be constructed using combinations of existing gates, having a native operation makes them easier to work with, particularly when building and optimizing parametrized quantum circuits.
Description of the Change
This PR introduces
RQang, a new parametric single-qubit operation in PennyLane for arbitrary rotations in the XY plane, parameterized by a rotation angle (\theta) and an azimuthal angle (\phi).The implementation includes:
G = 1/2 * (cos(phi) * X + sin(phi) * Y).RZ(-phi) @ RX(theta) @ RZ(phi).assert_valid.The operation is exported through PennyLane's public API, with the necessary updates to
pennylane/__init__.py,pennylane/ops/qubit/__init__.py, andtach.toml.Unit tests have also been added to
tests/ops/qubit/test_parametric_ops.py, along with a changelog entry indoc/releases/changelog-dev.md.Benefits
Possible Drawbacks
No specific drawbacks have been identified.
Related GitHub Issues