diff --git a/src/qiskit_qec/analysis/distance.h b/src/qiskit_qec/analysis/distance.h index abd99083..9970b916 100644 --- a/src/qiskit_qec/analysis/distance.h +++ b/src/qiskit_qec/analysis/distance.h @@ -5,6 +5,7 @@ #include #include #include +#include #include "linear.h" #include "combinations.h" diff --git a/src/qiskit_qec/analysis/distance.py b/src/qiskit_qec/analysis/distance.py index 3b484a4d..08f65b2d 100644 --- a/src/qiskit_qec/analysis/distance.py +++ b/src/qiskit_qec/analysis/distance.py @@ -113,14 +113,12 @@ def _minimum_distance_2_python(stabilizer: np.ndarray, gauge: np.ndarray, max_we for row in range(xl.shape[0]): for w in range(1, max_weight + 1): if _distance_test(stabilizer.astype(int), xl[row].astype(int), w): - if w < weight: - weight = w + weight = min(weight, w) break for row in range(zl.shape[0]): for w in range(1, max_weight + 1): if _distance_test(stabilizer.astype(int), zl[row].astype(int), w): - if w < weight: - weight = w + weight = min(weight, w) break if weight < max_weight + 1: return weight diff --git a/src/qiskit_qec/decoders/decoding_graph.py b/src/qiskit_qec/decoders/decoding_graph.py index 69ef9599..f4037414 100644 --- a/src/qiskit_qec/decoders/decoding_graph.py +++ b/src/qiskit_qec/decoders/decoding_graph.py @@ -322,7 +322,7 @@ def weight_syndrome_graph(self, counts, method: str = METHOD_SPITZ): boundary_nodes = [] for n, node in enumerate(self.graph.nodes()): - if node.is_boundary: + if node.is_logical: boundary_nodes.append(n) for edge in self.graph.edge_list():