Skip to content

Bugfix: support adjoint S in qecl->qecp lowering#2922

Merged
lillian542 merged 14 commits into
mainfrom
lillian542/adj-s-for-qec
Jun 8, 2026
Merged

Bugfix: support adjoint S in qecl->qecp lowering#2922
lillian542 merged 14 commits into
mainfrom
lillian542/adj-s-for-qec

Conversation

@lillian542

@lillian542 lillian542 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

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]

@lillian542 lillian542 marked this pull request as ready for review June 8, 2026 14:58
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.94%. Comparing base (f78fb42) to head (bfa2379).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lillian542 lillian542 changed the title Bugfix: support adjoint S in qecp lowering Bugfix: support adjoint S in qecl->qecp lowering Jun 8, 2026

@multiphaseCFD multiphaseCFD left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to approve

lillian542 and others added 2 commits June 8, 2026 14:37
@lillian542 lillian542 merged commit 70e2581 into main Jun 8, 2026
38 checks passed
@lillian542 lillian542 deleted the lillian542/adj-s-for-qec branch June 8, 2026 20:03
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants