Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1e4b7b3
fixed issue 4391 by updating idle_wires() in dagcircuit and skipping …
sar49 May 20, 2020
fb99bc6
fixed issue 4179 by updating matplotlib scaler
sar49 May 24, 2020
8de9408
fixed issue 4179 by updating matplotlib drawer and matplotlib testcase
sar49 May 25, 2020
02cabde
fixed issue 4179 by updating matplotlib drawer and updating matplotli…
sar49 May 25, 2020
64df6d3
Update dagcircuit.py
sar49 May 25, 2020
7ad4695
Update dagcircuit.py
sar49 May 25, 2020
001b938
Update dagcircuit.py
sar49 May 25, 2020
e9e4879
Update dagcircuit.py
sar49 May 25, 2020
fd6bed1
Update matplotlib.py
sar49 May 25, 2020
e482de7
Update text.py
sar49 May 25, 2020
e8027a5
Update text.py
sar49 May 25, 2020
69d87c3
Update matplotlib.py
sar49 May 25, 2020
5342609
Update test_circuit_matplotlib_drawer.py
sar49 May 26, 2020
792d5bc
Update test_circuit_matplotlib_drawer.py
sar49 May 26, 2020
a98d39e
Update test_circuit_matplotlib_drawer.py
sar49 May 26, 2020
51d401f
Update test_circuit_matplotlib_drawer.py
sar49 May 26, 2020
8655ef8
Update test_circuit_matplotlib_drawer.py
sar49 May 26, 2020
3cdf437
fixed issue 4563 by updating matplotlib drawer
sar49 Jun 11, 2020
b4d0610
Update matplotlib.py
sar49 Jun 11, 2020
1f5696e
Update matplotlib.py
sar49 Jun 11, 2020
8d99110
Update matplotlib.py
sar49 Jun 11, 2020
01b3064
Update test_circuit_matplotlib_drawer.py
sar49 Jun 11, 2020
f9f2145
Delete matplotlib_barriers_ref2.png
sar49 Jun 11, 2020
8dcf1b4
Add files via upload
sar49 Jun 11, 2020
1d54fe0
Update matplotlib.py
sar49 Jun 13, 2020
1727452
Merge branch 'master' into fixissue4563branch
sar49 Jun 13, 2020
b2140e3
Update qcstyle.py
sar49 Jun 15, 2020
34d4328
Update matplotlib.py
sar49 Jun 15, 2020
818bf55
Merge branch 'master' into fixissue4563branch
sar49 Jun 15, 2020
51e5f8e
Merge branch 'master' into fixissue4563branch
1ucian0 Jun 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions qiskit/visualization/matplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,17 @@ def _custom_multiqubit_gate(self, xy, cxy=None, fc=None, wide=True, text=None,
clip_on=True, zorder=PORDER_TEXT)

if text:
if text in self._style.dispcol:
disp_text = "${}$".format(self._style.disptex[text])

disp_text = text
else:
disp_text = text
if subtext:
self.ax.text(xpos, ypos + 0.5 * height, disp_text, ha='center',
self.ax.text(xpos, ypos + 0.4 * height, disp_text, ha='center',
va='center', fontsize=self._style.fs,
color=self._style.gt, clip_on=True,
zorder=PORDER_TEXT)
self.ax.text(xpos, ypos + 0.3 * height, subtext, ha='center',
self.ax.text(xpos, ypos + 0.2 * height, subtext, ha='center',
va='center', fontsize=self._style.sfs,
color=self._style.sc, clip_on=True,
zorder=PORDER_TEXT)
Expand Down Expand Up @@ -293,6 +296,7 @@ def _gate(self, xy, fc=None, wide=False, text=None, subtext=None):

if text in self._style.dispcol:
disp_text = "${}$".format(self._style.disptex[text])

else:
disp_text = text
if subtext:
Expand Down Expand Up @@ -1012,7 +1016,7 @@ def _draw_ops(self, verbose=False):
# Custom gate
else:
self._custom_multiqubit_gate(q_xy, c_xy, wide=_iswide,
text=op.op.label or op.name)
text=op.op.label or op.name, subtext=param)
#
# draw multi-qubit gates (n=3)
#
Expand Down
12 changes: 12 additions & 0 deletions qiskit/visualization/qcstyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ def __init__(self):
'tdg': 'T^\\dagger',
'r': 'R',
'rx': 'R_x',
'rxx': 'R_{xx}',
'ry': 'R_y',
'ryy': 'R_{yy}',
'rz': 'R_z',
'rzx': 'R_{zx}',
'reset': '\\left|0\\right\\rangle'
}
self.dispcol = {
Expand All @@ -88,8 +91,11 @@ def __init__(self):
'tdg': other_color,
'r': other_color,
'rx': other_color,
'rxx': other_color,
'ry': other_color,
'ryy': other_color,
'rz': other_color,
'rzx': other_color,
'reset': non_gate_color,
'target': '#ffffff',
'multi': other_color,
Expand Down Expand Up @@ -163,8 +169,11 @@ def __init__(self):
'tdg': 'T^\\dagger',
'r': 'R',
'rx': 'R_x',
'rxx': 'R_{xx}',
'ry': 'R_y',
'ryy': 'R_{yy}',
'rz': 'R_z',
'rzx': 'R_{zx}',
'reset': '\\left|0\\right\\rangle'
}
self.dispcol = {
Expand All @@ -184,8 +193,11 @@ def __init__(self):
'tdg': '#ffffff',
'r': '#ffffff',
'rx': '#ffffff',
'rxx': '#ffffff',
'ry': '#ffffff',
'ryy': '#ffffff',
'rz': '#ffffff',
'rzx': '#ffffff',
'reset': '#ffffff',
'target': '#ffffff',
'meas': '#ffffff',
Expand Down