-
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 internal circuits for ControlFlowOps to mpl circuit drawer #10207
Conversation
…erra into pre_control_flow_mpl
…-terra into display_mpl_for_switch
…-terra into display_mpl_for_switch
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.
Thanks so much for this Edwin. I've left a couple of minor comments in line, but mostly I'm judging by the test output for this, and it looks fantastic. I think it might be one of those things where we need to put it out in the wild, and see if other people find any issues with visualisation.
I added a test using |
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.
Thanks so much for this, Edwin - I know it was a huge amount of work, both in design and actual execution, and I really appreciate it! These look fantastic, and I'm really keen to get them into the hands of our users, so we've got better ways to actually understand what's going on in a dynamic circuit.
…awer (Qiskit#10207) * Remove deprecated args from mpl drawer * Reno mod * Convert to wire_map, node_data, etc * Lint * Minor changes to match flow changes * Cleanup * Fix layer width per node and comments * Lint * Adjust layer num loading * Revert n_lines * Lint * Add glob_data * Lint and cleanup * Initial PR for if-else * Unused arg * Lint * Iniital box fold * Fold flow boxes * Add reno * Fix initial mpl and window load * Move figure, mpl, and style info to draw() * Comments * Change font vars and fix ax * Make patches_mod global * Minor fixes after pre merege * Lint * Add while * Add for loop * Finish SwitchCase and cleanup and utils gate_span * Cleanup * Fix gate_span bug and comments * Fix layer bug by using all qubits in _get_layered * Added final release note and deleted old one * Minor spacing changes * Add ipynb/mpl/circuit tests and references * Lint * Minor comments * Adjust for_loop test * Add test for IfElseOp with body * Lint * Update state_city image * Comments, PORDER changes, cleanup * Adjust MASK zorder * Fix text color issue with other styles * Final fixes
Summary
This PR adds display of the circuits inside ForLoopOps and SwitchCaseOps to the mpl circuit drawer
Details and comments
This PR should be merged after #10096 and #10170. This adds the display of ForLoopOps and SwitchCaseOps in the same manner as was done in #10170 for IfElseOps and WhileLoopOps. This also fixes a bug in how gates were folding introduced in #10170.