From 8ec0ce1474ea716ad45affffe588c61498b85015 Mon Sep 17 00:00:00 2001 From: chensgit169 Date: Wed, 6 Sep 2023 15:31:24 +0800 Subject: [PATCH] fix typing-style not supported for python3.8 --- src/quafu/visualisation/circuitPlot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/quafu/visualisation/circuitPlot.py b/src/quafu/visualisation/circuitPlot.py index 1c151a6..d81511c 100644 --- a/src/quafu/visualisation/circuitPlot.py +++ b/src/quafu/visualisation/circuitPlot.py @@ -20,6 +20,7 @@ from matplotlib.text import Text from quafu.elements.quantum_element import Instruction, ControlledGate +from typing import Dict # this line for developers only # from quafu.circuits.quantum_circuit import QuantumCircuit @@ -226,7 +227,7 @@ def _circuit_wires(self): x1 = self.xs[-1] - 1 self._h_wire_points.append([[x0, y], [x1, y]]) - def _inits_label(self, labels: dict[int: str] = None): + def _inits_label(self, labels: Dict[int, str] = None): """ qubit-labeling """ if labels is None: labels = self.q_label @@ -241,7 +242,7 @@ def _inits_label(self, labels: dict[int: str] = None): ) self._text_list.append(txt) - def _measured_label(self, labels: dict[int: str] = None): + def _measured_label(self, labels: Dict[int, str] = None): """ measured qubit-labeling """ if labels is None: labels = self.c_label