Skip to content

Conversation

@astralcai
Copy link
Contributor

@astralcai astralcai commented Nov 11, 2025

Context:

Description of the Change:

Benefits:
Now this is possible

import pennylane as qml

def circuit():
    qml.H(0)
    qml.H(2)
    m0 = qml.pauli_measure("XY", wires=[0, 1])
    qml.cond(m0, qml.Z)(2)
>>> print(qml.draw(circuit)())
0: ──H─╭┤↗X├────┤  
1: ────╰┤↗Y├────┤  
2: ──H───║────Z─┤  
         ╚════╝    

Possible Drawbacks:

Related GitHub Issues:
[sc-99882]

@github-actions
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

Copy link
Contributor

@comp-phys-marc comp-phys-marc left a comment

Choose a reason for hiding this comment

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

Just a few questions to start!

@astralcai astralcai changed the title [WIP] qml.draw supports drawing of PPMs qml.draw supports drawing of PPMs Nov 11, 2025
@astralcai astralcai marked this pull request as ready for review November 11, 2025 20:36
@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.43%. Comparing base (da1a292) to head (5a13be6).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8623   +/-   ##
=======================================
  Coverage   99.43%   99.43%           
=======================================
  Files         587      587           
  Lines       61930    61945   +15     
=======================================
+ Hits        61577    61592   +15     
  Misses        353      353           

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

@astralcai astralcai requested a review from albi3ro November 12, 2025 19:53
@gabrielasd
Copy link
Contributor

@astralcai this looks awesome! I ran the following without problems:

def circuit():
    qml.Hadamard(0)
    qml.Hadamard(1)
    m = qml.pauli_measure("YXZ", wires=[0,3,2])
    qml.PauliRot(2*np.pi/8, 'XY',  wires=[2,1])
    qml.cond(m, qml.PauliX, qml.PauliZ)(wires=0)
    return qml.probs(wires=[0,1])

print(qml.draw(circuit)())

@astralcai astralcai requested a review from gabrielasd November 13, 2025 17:21
Copy link
Contributor

@gabrielasd gabrielasd left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @astralcai

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.

5 participants