Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumjim committed Feb 14, 2024
1 parent f7f2f2b commit e76f319
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/qiskit_qec/circuits/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
f"from qiskit_qec.analysis._c_circuits import _c_check_nodes \
failed, raising {import_error}"
)
C_MIN_DISTANCE = False
C_MIN_DISTANCE = False
11 changes: 7 additions & 4 deletions src/qiskit_qec/circuits/repetition_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(" "):
Expand Down Expand Up @@ -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]
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/qiskit_qec/utils/decoding_graph_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,4 @@ def _nodes2cpp(nodes):
cnode.append(node.time)
cnode.append(node.is_logical)
cnodes.append(tuple(cnode))
return cnodes
return cnodes

0 comments on commit e76f319

Please sign in to comment.