Skip to content

Conversation

@andrijapau
Copy link
Contributor

@andrijapau andrijapau commented Nov 25, 2025

This PR adds basic cluster visualization for these control flow operators.

⚠️ The cluster labels are not descriptive at the moment but a future PR will add more functionality. For example, for ... should be drawn like for i in range(x,y,z) if possible.

@qml.qjit(autograph=True, target="mlir")
@qml.qnode(dev)
def my_workflow(x):
    if x == 2:
        qml.X(0)
    else:
        qml.Y(0)

    for i in range(3):
        qml.H(0)

    counter = 0 
    while counter < 5:
        qml.RX(0.5, 0)

gets you (ignore quantum nodes for now),
image

[sc-103462]
[sc-103464]
[sc-103465]

@andrijapau andrijapau added wip PRs that are a Work-In-Progress unified compiler Pull requests for the integration with xDSL labels Nov 25, 2025
@andrijapau andrijapau changed the title Feature/control flow clusters feat: visualize control flow as clusters in the graph Nov 25, 2025
@andrijapau andrijapau changed the title feat: visualize control flow as clusters in the graph feat: visualize control flow operations as clusters in the graph Nov 25, 2025
@andrijapau andrijapau changed the title feat: visualize control flow operations as clusters in the graph feat: visualize WhileOp, IfOp, ForOp from the func dialect Nov 26, 2025
@andrijapau andrijapau changed the title feat: visualize WhileOp, IfOp, ForOp from the func dialect feat: visualize WhileOp, IfOp, ForOp from the scf dialect Nov 26, 2025
@codecov
Copy link

codecov bot commented Nov 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.66%. Comparing base (1c9c857) to head (61b70d9).

Additional details and impacted files
@@                   Coverage Diff                    @@
##           feature/visualize-qnode    #2234   +/-   ##
========================================================
  Coverage                    97.66%   97.66%           
========================================================
  Files                           93       93           
  Lines                        10899    10899           
  Branches                      1039     1039           
========================================================
  Hits                         10645    10645           
  Misses                         195      195           
  Partials                        59       59           

☔ 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.

@andrijapau andrijapau changed the title feat: visualize WhileOp, IfOp, ForOp from the scf dialect feat: add basic cluster visualization for WhileOp, IfOp, ForOp from the scf dialect Dec 2, 2025
@andrijapau andrijapau changed the title feat: add basic cluster visualization for WhileOp, IfOp, ForOp from the scf dialect feat: add basic cluster visualization for WhileOp, IfOp, ForOp Dec 2, 2025
@andrijapau andrijapau removed the wip PRs that are a Work-In-Progress label Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

unified compiler Pull requests for the integration with xDSL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants