Bugfix: support adjoint S in qecl->qecp lowering#2922
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2922 +/- ##
=======================================
Coverage 96.94% 96.94%
=======================================
Files 165 165
Lines 19073 19075 +2
Branches 1763 1764 +1
=======================================
+ Hits 18491 18493 +2
Misses 430 430
Partials 152 152 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
joeycarter
approved these changes
Jun 8, 2026
…l_convert_qecl_to_qecp.py Co-authored-by: Joey Carter <joseph.carter@xanadu.ai>
sarababaeii
pushed a commit
that referenced
this pull request
Jun 10, 2026
**Context:** When translating to the `qecp` dialect, we currently only generate a subroutine for `S`, and not for adjoint S. **Description of the Change:** We add support for adjoint S. We add a subroutine by adding an `s_adj` in the `QecCode` definition for `Steane`, and we map `qecl.s %0 adj` to `s_adj` instead of `s` when selecting a subroutine. Currently S is the only qecl logical op that can have adjoint=True, but if other ops are added in the future, they can similarly have their lowering defined by adding `opname_adj` to the `QecCode`. **Benefits:** We can use logical `adjoint(S)` and get correct results. [sc-121126] --------- Co-authored-by: Joey Carter <joseph.carter@xanadu.ai>
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:
When translating to the
qecpdialect, we currently only generate a subroutine forS, and not for adjoint S.Description of the Change:
We add support for adjoint S. We add a subroutine by adding an
s_adjin theQecCodedefinition forSteane, and we mapqecl.s %0 adjtos_adjinstead ofswhen selecting a subroutine.Currently S is the only qecl logical op that can have adjoint=True, but if other ops are added in the future, they can similarly have their lowering defined by adding
opname_adjto theQecCode.Benefits:
We can use logical
adjoint(S)and get correct results.[sc-121126]