Skip to content

Commit

Permalink
remove text arg from gate styling and fowarded styling args from circ…
Browse files Browse the repository at this point in the history
…uit.py
  • Loading branch information
gadhvirushiraj committed Aug 5, 2024
1 parent 1ff2776 commit 12db953
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/qutip_qip/circuit/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,7 @@ def draw(
dpi=None,
file_name="exported_pic",
file_path="",
**kwargs,
):
"""
Export circuit object as an image file in a supported format.
Expand Down Expand Up @@ -1014,7 +1015,8 @@ def draw(
f.write(image_data)
elif renderer == "matplotlib":
from .mat_renderer import MatRenderer
mat = MatRenderer(self)

mat = MatRenderer(self, **kwargs)
mat.canvas_plot()
else:
raise ValueError(
Expand Down
10 changes: 5 additions & 5 deletions src/qutip_qip/circuit/mat_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,14 @@ class StyleConfig:
The background color of the circuit. The default is None.
color : Optional[str], optional
Controls color of acsent elements (eg. cross sign in the target node)
and set as deafult color of gate-label. Can be overwritten by gate specific color.
Controls color of acsent elements (eg. cross sign in the target node)
and set as deafult color of gate-label. Can be overwritten by gate specific color.
The default is None.
wire_label : Optional[List], optional
The labels of the wires. The default is None.
"""



dpi: int = 150
fontsize: int = 10
end_wire_ext: int = 2
Expand Down Expand Up @@ -1010,7 +1008,9 @@ def canvas_plot(self) -> None:

if isinstance(gate, Gate):
style = gate.style if gate.style is not None else {}
self.text = style.get("text", gate.name)
self.text = (
gate.arg_label if gate.arg_label is not None else gate.name
)
self.color = style.get(
"color",
self.style.theme.get(
Expand Down

0 comments on commit 12db953

Please sign in to comment.