|
12 | 12 |
|
13 | 13 | import logging |
14 | 14 | from pathlib import Path |
15 | | -from typing import TYPE_CHECKING, Optional, Callable |
| 15 | +from typing import TYPE_CHECKING, Optional, Callable, List, Tuple, Dict, Any |
16 | 16 |
|
17 | 17 | import numpy as np |
18 | 18 | from qiskit import QuantumCircuit |
|
34 | 34 |
|
35 | 35 | logger = logging.getLogger("mqt-predictor") |
36 | 36 |
|
37 | | -def extract_cregs_and_measurements(qc: QuantumCircuit) -> tuple[list[ClassicalRegister], list[tuple[Instruction, list, list]]]: |
| 37 | +def extract_cregs_and_measurements(qc: QuantumCircuit) -> Tuple[List[ClassicalRegister], List[tuple[Instruction, List, List]]]: |
38 | 38 | """ |
39 | 39 | Extracts classical registers and measurement operations from a quantum circuit. |
40 | 40 |
|
@@ -77,9 +77,9 @@ def remove_cregs(qc: QuantumCircuit) -> QuantumCircuit: |
77 | 77 |
|
78 | 78 | def add_cregs_and_measurements( |
79 | 79 | qc: QuantumCircuit, |
80 | | - cregs: list[ClassicalRegister], |
81 | | - measurements: list[tuple[Instruction, list, list]], |
82 | | - qubit_map: Optional[dict] = None, |
| 80 | + cregs: List[ClassicalRegister], |
| 81 | + measurements: List[Tuple[Instruction, List, List]], |
| 82 | + qubit_map: Optional[Dict] = None, |
83 | 83 | ) -> QuantumCircuit: |
84 | 84 | """ |
85 | 85 | Adds classical registers and measurement operations back to the quantum circuit. |
@@ -155,9 +155,9 @@ def best_of_n_passmanager( |
155 | 155 | action: Action, |
156 | 156 | device: Target, |
157 | 157 | qc: QuantumCircuit, |
158 | | - max_iteration: tuple[int, int] = (20, 20), |
| 158 | + max_iteration: Tuple[int, int] = (20, 20), |
159 | 159 | metric_fn: Optional[Callable[[QuantumCircuit], float]] = None, |
160 | | -)-> tuple[QuantumCircuit, dict[str, any]]: |
| 160 | +)-> tuple[QuantumCircuit, Dict[str, Any]]: |
161 | 161 | """ |
162 | 162 | Runs the given transpile_pass multiple times and keeps the best result. |
163 | 163 |
|
|
0 commit comments