-
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
Fix issues with ControlFlowOp displays #10842
Conversation
…rra into fix_flow_cregbundle
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 Edwin, mostly this looks solid to me. Just a couple of minor notes.
1859210 fixes a bug in the I think tracking this down into that code is beyond the scope of this PR. |
is this |
Luciano: it is as of the resolution of #10842 (comment) - originally it had some extra bits in it. I can work through to merge this today if you'll accept it for 0.25.2 on Monday - I've heard from a couple of people that the bug being fixed here would be important for them. |
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 for this Edwin - I've fixed up the merge conflicts, and this looks good to merge now.
There'll be a minor conflict when we try to backport this, but I'll fix that up manually.
* Fix override bug and testing * Preliminary changes * First attempts * Work on x_index * Early testing * Cleanup getattr * Complete adding exprs * First fix for cregbundle control flow * Finish basic cregbundle mods * Finish all cregbundle except wire_map bug * Move carg check to circuit_vis and change text tests to circuit_drawer * Move mpl tests to use circuit_drawer and update images for cregbundle changes * Change mpl tests to circuit_drawer * Fix flow_wire_map and tranpile bug * Final cleanup * Missing outputs on mpl tests * Fix output * Restore tests and move carg check to text and mpl and make circuit * Prepare final cregbundle fix * Update ref images * Fixing refs * Update refs again * Final mods * Incorporate mtreinish changes * Add reno * Fix if_else_op test * Lint * Fix target == expr bug in text * Review fixes and outer_circuit, wire_map fixes * Remove png * Minor changes * Fix for_loop measure placement bug --------- Co-authored-by: Jake Lishman <[email protected]> (cherry picked from commit 404df43) # Conflicts: # qiskit/visualization/circuit/text.py # test/python/visualization/test_circuit_text_drawer.py # test/visual/mpl/circuit/test_circuit_matplotlib_drawer.py
Cherry-picked version of only the MPL-drawer changes from the given commit, since the text-drawer support for dynamic circuits is not in the old version. (cherry picked from commit 404df43) Co-authored-by: Jake Lishman <[email protected]>
Cherry-picked version of only the MPL-drawer changes from the given commit, since the text-drawer support for dynamic circuits is not in the old version. (cherry picked from commit 404df43) Co-authored-by: Jake Lishman <[email protected]>
Cherry-picked version of only the MPL-drawer changes from the given commit, since the text-drawer support for dynamic circuits is not in the old version. (cherry picked from commit 404df43) Co-authored-by: Edwin Navarro <[email protected]> Co-authored-by: Jake Lishman <[email protected]>
* Fix override bug and testing * Preliminary changes * First attempts * Work on x_index * Early testing * Cleanup getattr * Complete adding exprs * First fix for cregbundle control flow * Finish basic cregbundle mods * Finish all cregbundle except wire_map bug * Move carg check to circuit_vis and change text tests to circuit_drawer * Move mpl tests to use circuit_drawer and update images for cregbundle changes * Change mpl tests to circuit_drawer * Fix flow_wire_map and tranpile bug * Final cleanup * Missing outputs on mpl tests * Fix output * Restore tests and move carg check to text and mpl and make circuit * Prepare final cregbundle fix * Update ref images * Fixing refs * Update refs again * Final mods * Incorporate mtreinish changes * Add reno * Fix if_else_op test * Lint * Fix target == expr bug in text * Review fixes and outer_circuit, wire_map fixes * Remove png * Minor changes * Fix for_loop measure placement bug --------- Co-authored-by: Jake Lishman <[email protected]>
Summary
Fixes issues with use of
cregbundle
option when displayingControlFlowOps
and fixes #10601Details and comments
This PR addresses the following issues with display of
ControlFlowOps
with thecregbundle
optionControlFlowOp
was part of a circuit being displayed in thempl
andtext
circuit drawers, thecregbundle
option was always being set to False, no matter what the user entered.Clbit
's normally force thecregbundle
option to False, but if the gate was inside aControlFlowOp
, thecregbundle
option was not changing.Per discussions with @jakelishman, this PR also incorporates the fixes to #10601, previously done by @mtreinish in #10602.
In doing testing, it was also noted that the
encoding
option that is used by thetext
drawer, cannot be entered in thecircuit_drawer
function or inQuantumCircuit.draw
meaning users would generally not have access to that option.There were several other cleanup and efficiency changes.
Fix #10601
Close #10602 (obsolete)