From 4451f1aadb77232b936cd5c50d45fc314198ee2c Mon Sep 17 00:00:00 2001 From: Jim Garrison Date: Thu, 8 Jun 2023 10:58:20 -0400 Subject: [PATCH] Fix mypy under rustworkx 0.13.0 (#245) --- circuit_knitting_toolbox/utils/transforms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/circuit_knitting_toolbox/utils/transforms.py b/circuit_knitting_toolbox/utils/transforms.py index 96daaf248..94a9dc479 100644 --- a/circuit_knitting_toolbox/utils/transforms.py +++ b/circuit_knitting_toolbox/utils/transforms.py @@ -27,7 +27,7 @@ from collections.abc import Sequence, Iterable, Hashable, MutableMapping from typing import NamedTuple -from rustworkx import PyGraph, connected_components +from rustworkx import PyGraph, connected_components # type: ignore[attr-defined] from qiskit.circuit import ( QuantumCircuit, CircuitInstruction, @@ -99,7 +99,7 @@ def separate_circuit( def _partition_labels_from_circuit(circuit: QuantumCircuit) -> list[int]: """Generate partition labels from the connectivity of a quantum circuit.""" # Determine connectivity structure of the circuit - graph = PyGraph() + graph: PyGraph = PyGraph() graph.add_nodes_from(range(circuit.num_qubits)) for instruction in circuit.data: qubits = instruction.qubits