From e76f3193f1f39b34ee7c2d033b6a1831ed87df3d Mon Sep 17 00:00:00 2001 From: James Wootton Date: Wed, 14 Feb 2024 10:57:26 +0100 Subject: [PATCH] lint --- src/qiskit_qec/circuits/extensions.py | 2 +- src/qiskit_qec/circuits/repetition_code.py | 11 +++++++---- src/qiskit_qec/utils/decoding_graph_attributes.py | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/qiskit_qec/circuits/extensions.py b/src/qiskit_qec/circuits/extensions.py index 8b4165be..97b3485e 100644 --- a/src/qiskit_qec/circuits/extensions.py +++ b/src/qiskit_qec/circuits/extensions.py @@ -26,4 +26,4 @@ f"from qiskit_qec.analysis._c_circuits import _c_check_nodes \ failed, raising {import_error}" ) - C_MIN_DISTANCE = False \ No newline at end of file + C_MIN_DISTANCE = False diff --git a/src/qiskit_qec/circuits/repetition_code.py b/src/qiskit_qec/circuits/repetition_code.py index 1f5ca1f6..038f1e8e 100644 --- a/src/qiskit_qec/circuits/repetition_code.py +++ b/src/qiskit_qec/circuits/repetition_code.py @@ -34,6 +34,7 @@ from qiskit_qec.utils.decoding_graph_attributes import _nodes2cpp from qiskit_qec.circuits._c_circuits import _c_check_nodes + def _separate_string(string): separated_string = [] for syndrome_type_string in string.split(" "): @@ -1162,8 +1163,8 @@ def check_nodes(self, nodes, ignore_extra_logical=False, minimal=False, cpp=Fals self.cycle_dict, self._cpp_link_graph, self._cpp_link_neighbors, - self.z_logicals - ) + self.z_logicals, + ) neutral = bool(cpp_output[0]) num_errors = cpp_output[1] @@ -1177,7 +1178,7 @@ def check_nodes(self, nodes, ignore_extra_logical=False, minimal=False, cpp=Fals flipped_logical_nodes.append(node) return neutral, flipped_logical_nodes, num_errors - + else: nodes = self.flatten_nodes(nodes) @@ -1321,7 +1322,9 @@ def check_nodes(self, nodes, ignore_extra_logical=False, minimal=False, cpp=Fals # if unneeded logical zs are given, cluster is not neutral # (unless this is ignored) - if (not ignore_extra_logical) and given_logicals.difference(flipped_logicals): + if (not ignore_extra_logical) and given_logicals.difference( + flipped_logicals + ): neutral = False flipped_logicals = set() # otherwise, report only needed logicals that aren't given diff --git a/src/qiskit_qec/utils/decoding_graph_attributes.py b/src/qiskit_qec/utils/decoding_graph_attributes.py index 001530de..3e619590 100644 --- a/src/qiskit_qec/utils/decoding_graph_attributes.py +++ b/src/qiskit_qec/utils/decoding_graph_attributes.py @@ -192,4 +192,4 @@ def _nodes2cpp(nodes): cnode.append(node.time) cnode.append(node.is_logical) cnodes.append(tuple(cnode)) - return cnodes \ No newline at end of file + return cnodes