-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add display of expressions to circuit drawers #10869
Conversation
One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 6252135361
💛 - Coveralls |
@jakelishman This PR has now been merged with main and conflicts resolved. Should be ready to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed up a minor tweak to some bits of documentation to make things easier. I had one (very minor) inline question about a magic number, and my other thing is: could we add a test or two to each of the text and MPL drawers that conditionals in nested control-flow scopes work correctly?
@@ -1543,6 +1584,17 @@ def _flow_op_gate(self, node, node_data, glob_data): | |||
clip_on=True, | |||
zorder=PORDER_FLOW, | |||
) | |||
self._ax.text( | |||
xpos - x_shift - 0.08, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this 0.08 be spacer
?
…into add_expr_to_mpl
…el flow op layers
In straightening out the mpl spacing, I found that for loops and case statements with only 1 qarg were printing outside the box in mpl. Also I redid display of the for loop range to fit for 1 qarg cases. Added tests for all this plus the nested expr's in both text and mpl. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful, thank you very very much!
Summary
Adds expressions to mpl and text drawers
Details and comments
Close #10236
This PR adds displays of expressions to ControlFlowOps in the mpl and text circuit drawers. The expressions are parsed using the QASM3 parser, so they appear the same as they would in a QASM3 string output.
Some of the changes in #10804 are incorporated in this PR, so that PR should be merged first.