Skip to content

feat: Allow modifier use with qis-compiler#1451

Open
jake-arkinstall wants to merge 1 commit intomainfrom
feat/qis-compiler-modifier-pass
Open

feat: Allow modifier use with qis-compiler#1451
jake-arkinstall wants to merge 1 commit intomainfrom
feat/qis-compiler-modifier-pass

Conversation

@jake-arkinstall
Copy link
Copy Markdown
Contributor

Presently, the use of (experimental?) guppylang modifiers, such as:

@guppy
def main() -> None:
    q1 = qubit()
    q2 = qubit()
    h(q1)
    with control(q1):
        x(q2)
    
    result("q1", measure(q1))
    result("q2", measure(q2))

Results in

RuntimeError: No extension could emit extension op: (IdentList("tket.modifier"), "ControlModifier")

This PR adds use of the ModifierResolverPass before QSystemPass to resolve modifiers, enabling compilation to QIS.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.60%. Comparing base (2d3a5de) to head (9f5f789).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1451   +/-   ##
=======================================
  Coverage   79.60%   79.60%           
=======================================
  Files         155      155           
  Lines       20335    20335           
  Branches    19345    19345           
=======================================
  Hits        16187    16187           
  Misses       3188     3188           
  Partials      960      960           
Flag Coverage Δ
qis-compiler 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@aborgna-q
Copy link
Copy Markdown
Collaborator

We decided to have the users call the pass explicitly instead, while this remains experimental.

Note that the pass is not yet exposed from python. See #1452

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.

2 participants