Skip to content

Commit

Permalink
Remove label property for barriers and snapshots and increase mpl lab…
Browse files Browse the repository at this point in the history
…el font size
  • Loading branch information
enavarro51 committed Aug 17, 2022
1 parent b8349db commit 1a17e25
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 41 deletions.
20 changes: 0 additions & 20 deletions qiskit/circuit/barrier.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,6 @@ def __init__(self, num_qubits, label=None):
self._label = label
super().__init__("barrier", num_qubits, 0, [], label=label)

@property
def label(self):
"""Return barrier label"""
return self._label

@label.setter
def label(self, name):
"""Set barrier label to name
Args:
name (str or None): label to assign barrier
Raises:
TypeError: name is not string or None.
"""
if isinstance(name, str):
self._label = name
else:
raise TypeError("label expects a string")

def inverse(self):
"""Special case. Return self."""
return Barrier(self.num_qubits)
Expand Down
20 changes: 0 additions & 20 deletions qiskit/extensions/simulator/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,6 @@ def snapshot_type(self):
"""Return snapshot type"""
return self._snapshot_type

@property
def label(self):
"""Return snapshot label"""
return self._label

@label.setter
def label(self, name):
"""Set snapshot label to name
Args:
name (str or None): label to assign unitary
Raises:
TypeError: name is not string or None.
"""
if isinstance(name, str):
self._label = name
else:
raise TypeError("label expects a string")

def c_if(self, classical, val):
raise QiskitError("Snapshots are simulator directives and cannot be conditional.")

Expand Down
2 changes: 1 addition & 1 deletion qiskit/visualization/matplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ def _barrier(self, node):
node.op.label,
ha="center",
va="top",
fontsize=self._sfs,
fontsize=self._fs,
color=self._data[node]["tc"],
clip_on=True,
zorder=PORDER_TEXT,
Expand Down

0 comments on commit 1a17e25

Please sign in to comment.