Port X to Operator2 - #9844
Open
comp-phys-marc wants to merge 489 commits into
Open
Conversation
comp-phys-marc
marked this pull request as ready for review
July 15, 2026 14:55
Contributor
|
Hello. You may have forgotten to update the changelog!
|
Co-authored-by: Mudit Pandey <18223836+mudit2812@users.noreply.github.com>
**Context:** Migrate the utility `decompose_to_base` decomp to be compatible with `Operator2`. **Description of the Change:** **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:**
Co-authored-by: Mudit Pandey <18223836+mudit2812@users.noreply.github.com>
Co-authored-by: Mudit Pandey <18223836+mudit2812@users.noreply.github.com>
…tion.py Co-authored-by: Mudit Pandey <18223836+mudit2812@users.noreply.github.com>
…ution.py Co-authored-by: Mudit Pandey <18223836+mudit2812@users.noreply.github.com>
…ier.py Co-authored-by: Mudit Pandey <18223836+mudit2812@users.noreply.github.com>
….com/PennyLaneAI/pennylane into chore/port-x-only
astralcai
changed the base branch from
main
to
fix/assert-valid-capture-decomp-rule
July 27, 2026 19:38
dwierichs
requested changes
Jul 30, 2026
dwierichs
left a comment
Contributor
There was a problem hiding this comment.
Mostly looks good to me! :) Just had some minor questions
| @@ -384,11 +384,13 @@ def compute_matrix() -> np.ndarray: # pylint: disable=arguments-differ | |||
|
|
|||
| @staticmethod | |||
| @lru_cache | |||
Contributor
There was a problem hiding this comment.
Should the lru_cache stay on here? 🤔
Contributor
There was a problem hiding this comment.
I was thinking we removed it for compute_matrix because wires are now an argument, so potentially quite a few copies of this might be produced? 🤔 Shouldn't it be the same logic for compute_matrix and compute_sparse_matrix either way? :)
…chore/port-x-only
dwierichs
approved these changes
Jul 30, 2026
dwierichs
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me, thanks @astralcai 🎉 Just the lru_cache removal pending :)
Oh, and a changelog entry? Or is that handled at the end of the PR chain?
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.
Context: Removes the changes involved in porting Y, Z from #9684 so we can have a PR chain that ports X, CNOT, Toffoli, MCX and not also all of the Y, Z, CY, CZ at once.
Description of the Change: Isolates the X changes and what is needed to address errors not specifically related to Y, Z.
Benefits: We can isolate some of our work.
Possible Drawbacks: Undoing stuff.
Related GitHub Issues: [sc-125488]