Skip to content
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

Circuit marplot lib register and measurement on-top of each other #4148

Closed
jaygambetta opened this issue Apr 14, 2020 · 0 comments · Fixed by #4616
Closed

Circuit marplot lib register and measurement on-top of each other #4148

jaygambetta opened this issue Apr 14, 2020 · 0 comments · Fixed by #4616
Labels
type: enhancement It's working, but needs polishing

Comments

@jaygambetta
Copy link
Member

What is the expected enhancement?

If the circuit goes over two frames the second frame if it is a measurement the register and the value are on top of each other -- see figure.

image

@jaygambetta jaygambetta added the type: enhancement It's working, but needs polishing label Apr 14, 2020
@jaygambetta jaygambetta changed the title Circuit marplot lib Circuit marplot lib register and measurement on-top of each other Apr 14, 2020
enavarro51 added a commit to enavarro51/qiskit-terra that referenced this issue Apr 23, 2020
-	Reposition cbit total at bottom left to fix Qiskit#4148
-	Corrected multigate control display for to_gate() gates
-	Updated colors to match standard on several gates
-	Restructured draw_ops code to simplify
-	Fixed controlled rzz and swap for multiple control bits
text.py
-	Corrected multigate control display for to_gate() gates
-	Restructured controlled gate section to simplify
qcstyle.py
-	Added display names for iswap, dcx, rxx, ryy, and rzx
test_circuit_text_drawer.py
-	Corrected test for multigate control display for to_gate() gates
@mergify mergify bot closed this as completed in #4616 Jul 3, 2020
mergify bot pushed a commit that referenced this issue Jul 3, 2020
…h spacing and labels (#4616)

* matplotlib.py
-	Reposition cbit total at bottom left to fix #4148
-	Corrected multigate control display for to_gate() gates
-	Updated colors to match standard on several gates
-	Restructured draw_ops code to simplify
-	Fixed controlled rzz and swap for multiple control bits
text.py
-	Corrected multigate control display for to_gate() gates
-	Restructured controlled gate section to simplify
qcstyle.py
-	Added display names for iswap, dcx, rxx, ryy, and rzx
test_circuit_text_drawer.py
-	Corrected test for multigate control display for to_gate() gates

* Changes to matplotlib.py to match text.py
  - Updated sizing on custom_multiqubit_gates
  - Restructured layer_width code
  - Extensive testing of supported gates

* Cleaned up some lint

* Update text.py for long multigates

* Adjust large box spacing & fix initialize crash

* Added support for hamiltonian display

* Tweak to hamiltonian in text

* Fixed isometry gate display

* Revert text.py and test_circuit_text_drawer.py to master

* - Add _get_text_width method & supporting attributes
- Use text width to place qreg and creg labels
- Fix barrier bug when fold is set to 0 or 1
- Fix spacing of showindex numbers on plot

* Convert custom_multiqubit_gate to use text width

* - Use text width for sizing
	- Gates with long names
	- cu1 and ctrl-rzz
- Use text widths to place cregs and qregs
- Add mcx to controlled-x gates
- Reconfigure layer width using text widths

* Converted text width calcs to use table

* - removed unused add_width
- fixed all ctrl-x gates
- fixed capitalize

* Multi boxes and first steps

* Refactor text width and remove math font

* Completed B/W version and fixed initialize and reset

* Corrected reset & initialize & set default gate color to other_color

* Corrected color on basic gates

* Change B/W multi to white

* Further fixes for folding and fold=-1

* Added fold=-1 fix

* Added primary get_renderer option which falls back to char_list if no renderer

* Fix merge conflict w/fix4052_4148textchange

* Clean up op for-loop and fix param displays

* Adding labels to mpl drawer

* Cleanup barriers after master merge

* Major cleanup and respacing of code

* More name changes and cleanup to mpl

* Added initial_state & cregbundle & fixed fold=-1 in mpl

* Add param to rxx, ryy, rzx in mpl

* Refactor cu1, rzz and ctrl-rzz sections

* Added labels to gate displays

* Fixed formatting of subtext and control labels

* Interim changes to gate_text and ctrl_text

* Fix initialize and test label changes

* Added get_max_width function and put text call in-line for conditionals

* Consolidated color selection and added _get_color

* Remove unnecessary special gate sections & cleanup

* Adjusted layer spacing and qreg/creg display location, and changed char_list to /74.0

* Adjusted sidetext spacing

* Added qargs check for placing control labels at top/bottom

* Comments, cleanup, more ps backend testing

* Set test_teleport in test_visualization.py to cregbundle=False until latex bug is fixed

* Revert change to unitary control and update matplotlib test reference files for new spacing

* Updating code comments

* Fixed minus/hyphen issue, tested with jupyter

* Comments and move block of code

* Replace hyphen with unicode hyphen for mathtext

* Update circuit_visualization.py

* bug in the tester

* new references

* Added fold tests

* Lint and create pngs using jupyter

* Added big_gates test

* Three more test images & update barriers

* Fix filename

* Fix initial_state bug and more tests

* Minor filename fix

* Update test/ipynb/mpl/test_circuit_matplotlib_drawer.py

* Update test/ipynb/mpl/test_circuit_matplotlib_drawer.py

* sorted results in the test notebook

* Added release note

* Fix typo in release note

* Fixed import in release note

* cregbundle=False

* test_plot_partial_barrier

* Update qiskit/visualization/matplotlib.py

* ctrl_x -> cnot

* links in release note

* new refs

* Gate non-used import

Co-authored-by: Luciano Bello <luciano.bello@ibm.com>
faisaldebouni pushed a commit to faisaldebouni/qiskit-terra that referenced this issue Aug 5, 2020
…h spacing and labels (Qiskit#4616)

* matplotlib.py
-	Reposition cbit total at bottom left to fix Qiskit#4148
-	Corrected multigate control display for to_gate() gates
-	Updated colors to match standard on several gates
-	Restructured draw_ops code to simplify
-	Fixed controlled rzz and swap for multiple control bits
text.py
-	Corrected multigate control display for to_gate() gates
-	Restructured controlled gate section to simplify
qcstyle.py
-	Added display names for iswap, dcx, rxx, ryy, and rzx
test_circuit_text_drawer.py
-	Corrected test for multigate control display for to_gate() gates

* Changes to matplotlib.py to match text.py
  - Updated sizing on custom_multiqubit_gates
  - Restructured layer_width code
  - Extensive testing of supported gates

* Cleaned up some lint

* Update text.py for long multigates

* Adjust large box spacing & fix initialize crash

* Added support for hamiltonian display

* Tweak to hamiltonian in text

* Fixed isometry gate display

* Revert text.py and test_circuit_text_drawer.py to master

* - Add _get_text_width method & supporting attributes
- Use text width to place qreg and creg labels
- Fix barrier bug when fold is set to 0 or 1
- Fix spacing of showindex numbers on plot

* Convert custom_multiqubit_gate to use text width

* - Use text width for sizing
	- Gates with long names
	- cu1 and ctrl-rzz
- Use text widths to place cregs and qregs
- Add mcx to controlled-x gates
- Reconfigure layer width using text widths

* Converted text width calcs to use table

* - removed unused add_width
- fixed all ctrl-x gates
- fixed capitalize

* Multi boxes and first steps

* Refactor text width and remove math font

* Completed B/W version and fixed initialize and reset

* Corrected reset & initialize & set default gate color to other_color

* Corrected color on basic gates

* Change B/W multi to white

* Further fixes for folding and fold=-1

* Added fold=-1 fix

* Added primary get_renderer option which falls back to char_list if no renderer

* Fix merge conflict w/fix4052_4148textchange

* Clean up op for-loop and fix param displays

* Adding labels to mpl drawer

* Cleanup barriers after master merge

* Major cleanup and respacing of code

* More name changes and cleanup to mpl

* Added initial_state & cregbundle & fixed fold=-1 in mpl

* Add param to rxx, ryy, rzx in mpl

* Refactor cu1, rzz and ctrl-rzz sections

* Added labels to gate displays

* Fixed formatting of subtext and control labels

* Interim changes to gate_text and ctrl_text

* Fix initialize and test label changes

* Added get_max_width function and put text call in-line for conditionals

* Consolidated color selection and added _get_color

* Remove unnecessary special gate sections & cleanup

* Adjusted layer spacing and qreg/creg display location, and changed char_list to /74.0

* Adjusted sidetext spacing

* Added qargs check for placing control labels at top/bottom

* Comments, cleanup, more ps backend testing

* Set test_teleport in test_visualization.py to cregbundle=False until latex bug is fixed

* Revert change to unitary control and update matplotlib test reference files for new spacing

* Updating code comments

* Fixed minus/hyphen issue, tested with jupyter

* Comments and move block of code

* Replace hyphen with unicode hyphen for mathtext

* Update circuit_visualization.py

* bug in the tester

* new references

* Added fold tests

* Lint and create pngs using jupyter

* Added big_gates test

* Three more test images & update barriers

* Fix filename

* Fix initial_state bug and more tests

* Minor filename fix

* Update test/ipynb/mpl/test_circuit_matplotlib_drawer.py

* Update test/ipynb/mpl/test_circuit_matplotlib_drawer.py

* sorted results in the test notebook

* Added release note

* Fix typo in release note

* Fixed import in release note

* cregbundle=False

* test_plot_partial_barrier

* Update qiskit/visualization/matplotlib.py

* ctrl_x -> cnot

* links in release note

* new refs

* Gate non-used import

Co-authored-by: Luciano Bello <luciano.bello@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement It's working, but needs polishing
Projects
None yet
1 participant