From 4f6546e044d531cab56af65dd62a00ab89b6a9df Mon Sep 17 00:00:00 2001 From: Toru Kawakubo Date: Fri, 2 Jun 2023 19:14:02 +0900 Subject: [PATCH] Use gate.name when latex style string is unavailable --- qulacsvis/visualization/matplotlib.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qulacsvis/visualization/matplotlib.py b/qulacsvis/visualization/matplotlib.py index bf2f2c3..7cec22c 100644 --- a/qulacsvis/visualization/matplotlib.py +++ b/qulacsvis/visualization/matplotlib.py @@ -342,7 +342,10 @@ def _gate_with_size( if gate.name == "": latex_style_gate_str = "" else: - latex_style_gate_str = f"${to_latex_style(gate.name)}$" + try: + latex_style_gate_str = f"${to_latex_style(gate.name)}$" + except KeyError: + latex_style_gate_str = gate.name self._text(xpos, ypos, latex_style_gate_str) self._control_bits(gate.control_bit_infos, (xpos, ypos))