-
Notifications
You must be signed in to change notification settings - Fork 59
feat: add graph visualization for compiled programs #2216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
andrijapau
wants to merge
67
commits into
main
Choose a base branch
from
feature/graph-visualization
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
…neAI/catalyst into migrate-unified-compiler
…_in_dim verify methods
…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]>
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]>
andrijapau
commented
Dec 10, 2025
This reverts commit 53923a6.
andrijapau
commented
Dec 10, 2025
andrijapau
commented
Dec 10, 2025
andrijapau
commented
Dec 10, 2025
andrijapau
commented
Dec 10, 2025
andrijapau
commented
Dec 10, 2025
andrijapau
commented
Dec 10, 2025
andrijapau
commented
Dec 10, 2025
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.
Base branch for feature.