Skip to content

Commit

Permalink
Fix IQX color schemes (Qiskit#10941)
Browse files Browse the repository at this point in the history
* fix diagonal gate colors

* fix iqx-dark and iswap

* add reno

* update reference images
  • Loading branch information
Cryoris authored Oct 6, 2023
1 parent 660448c commit 5f53e33
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 9 deletions.
18 changes: 15 additions & 3 deletions qiskit/visualization/circuit/styles/iqx-dark.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,15 @@
"#000000"
],
"cz": [
"#FF7EB6",
"#BAE6FF",
"#000000"
],
"cp": [
"#BAE6FF",
"#000000"
],
"mcphase": [
"#BAE6FF",
"#000000"
],
"swap": [
Expand Down Expand Up @@ -131,7 +139,7 @@
"#000000"
],
"iswap": [
"#BAE6FF",
"#FF7EB6",
"#000000"
],
"s": [
Expand Down Expand Up @@ -171,7 +179,7 @@
"#000000"
],
"rz": [
"#FF7EB6",
"#BAE6FF",
"#000000"
],
"rxx": [
Expand All @@ -186,6 +194,10 @@
"#FF7EB6",
"#000000"
],
"rzz": [
"#BAE6FF",
"#000000"
],
"reset": [
"#8D8D8D",
"#000000"
Expand Down
24 changes: 18 additions & 6 deletions qiskit/visualization/circuit/styles/iqx.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,16 @@
"#FFFFFF"
],
"cz": [
"#9F1853",
"#FFFFFF"
"#33B1FF",
"#000000"
],
"cp": [
"#33B1FF",
"#000000"
],
"mcphase": [
"#33B1FF",
"#000000"
],
"swap": [
"#002D9C",
Expand All @@ -131,8 +139,8 @@
"#FFFFFF"
],
"iswap": [
"#33B1FF",
"#000000"
"#9F1853",
"#FFFFFF"
],
"s": [
"#33B1FF",
Expand Down Expand Up @@ -171,8 +179,8 @@
"#FFFFFF"
],
"rz": [
"#9F1853",
"#FFFFFF"
"#33B1FF",
"#000000"
],
"rxx": [
"#9F1853",
Expand All @@ -186,6 +194,10 @@
"#9F1853",
"#FFFFFF"
],
"rzz": [
"#33B1FF",
"#000000"
],
"reset": [
"#A8A8A8",
"#000000"
Expand Down
6 changes: 6 additions & 0 deletions releasenotes/notes/fix-iqx-colors-a744cea132896e53.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
fixes:
- |
Fix the coloring of the ``"iqx"`` and ``"iqx-dark"`` matplotlib color schemes,
which previously drew the :class:`.RZGate`, :class:`.RZZGate`, (multi-)controlled
:class:`.PhaseGate`\s and :class:`.iSwapGate` in the wrong color.
Binary file modified test/visual/mpl/circuit/references/iqx-dark_color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/visual/mpl/circuit/references/iqx_color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/visual/mpl/circuit/references/textbook_color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions test/visual/mpl/circuit/test_circuit_matplotlib_drawer.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,7 @@ def test_alternative_colors(self):
circuit.cx(0, 1)
circuit.ccx(0, 1, 2)
circuit.swap(0, 1)
circuit.iswap(2, 3)
circuit.cswap(0, 1, 2)
circuit.append(SwapGate().control(2), [0, 1, 2, 3])
circuit.dcx(0, 1)
Expand All @@ -905,9 +906,12 @@ def test_alternative_colors(self):
circuit.p(pi / 2, 4)
circuit.cz(5, 6)
circuit.cp(pi / 2, 5, 6)
circuit.mcp(pi / 5, [0, 1, 2, 3], 4)
circuit.y(5)
circuit.rx(pi / 3, 5)
circuit.rz(pi / 6, 6)
circuit.rzx(pi / 2, 5, 6)
circuit.rzz(pi / 4, 5, 6)
circuit.u(pi / 2, pi / 2, pi / 2, 5)
circuit.barrier(5, 6)
circuit.reset(5)
Expand Down

0 comments on commit 5f53e33

Please sign in to comment.