Skip to content

Conversation

@andrijapau
Copy link
Contributor

@andrijapau andrijapau commented Nov 20, 2025

Base branch for feature.

mudit2812 and others added 30 commits November 17, 2025 10:48
…tions (#2231)

This PR adds the ability to view multiple QNodes in a workflow with
clusters and their devices as nodes within said clusters.

Some examples,

```
dev1 = qml.device("lightning.qubit", wires=5)
dev2 = qml.device("null.qubit", wires=5)

@qml.qnode(dev1)
def my_qnode2():
    qml.X(0)

@qml.qnode(dev2)
def my_qnode1():
    qml.H(0)

@qml.qjit(autograph=True, target="mlir")
def my_workflow():
    my_qnode1()
    my_qnode2()
```
<img width="359" height="180" alt="image"
src="https://github.com/user-attachments/assets/9e8aa849-4085-4a71-ac67-6e7d379e5614"
/>

```
@qml.qjit(autograph=True, target="mlir")
@qml.qnode(dev2)
def circuit():
    qml.H(0)
```
<img width="233" height="172" alt="image"
src="https://github.com/user-attachments/assets/4943d56a-f92c-4572-a894-f98c9e8ab810"
/>


[sc-104730]
[sc-104731]

---------

Co-authored-by: Mehrdad Malek <[email protected]>
Co-authored-by: Mudit Pandey <[email protected]>
Base automatically changed from migrate-unified-compiler to main December 5, 2025 22:54
andrijapau and others added 4 commits December 10, 2025 14:38
As discussed with product, we've simplified cluster visualization by
removing the information label nodes and relying on the standard cluster
labels.

This improves both rendering performance and readability by preventing
the illogical layout issues previously caused by treating labels as
separate nodes.

[sc-105624]
This PR adds basic cluster visualization for these control flow
operators.

⚠️ The cluster labels are not descriptive at the moment but a future PR
should improve upon them (not required for MVP).

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

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

    counter = 0 
    while counter < 5:
        qml.RX(0.5, 0)
```
<img width="684" height="207" alt="Screenshot 2025-12-10 at 3 05 55 PM"
src="https://github.com/user-attachments/assets/b39b6722-f1ff-498c-8046-771bc0fd7d33"
/>

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

---------

Co-authored-by: Mudit Pandey <[email protected]>
Co-authored-by: Mehrdad Malek <[email protected]>
This PR adds basic visualization support for operators and measurement
nodes in the DAG.

```python

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

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

    counter = 0 
    while counter < 5:
        qml.RX(0.5, 0)
   
    return qml.expval(qml.PauliZ(0)), qml.probs(), qml.var(qml.X(0)), qml.state()
```
<img width="1632" height="189" alt="Screenshot 2025-12-10 at 2 34 02 PM"
src="https://github.com/user-attachments/assets/14d639a6-a5a8-40f1-8a53-0866ec075567"
/>



[sc-104322]

---------

Co-authored-by: Mehrdad Malek <[email protected]>
Co-authored-by: Mudit Pandey <[email protected]>
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.

5 participants