Skip to content

Commit

Permalink
add missing include statement in distance.h (#423)
Browse files Browse the repository at this point in the history
* add missing include statement in distance.h

* weight syntax change

* fix prob assignment

---------

Co-authored-by: James Wootton <decodoku@gmail.com>
  • Loading branch information
kaiott and quantumjim authored Mar 4, 2024
1 parent fb8d9fa commit 778eb61
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/qiskit_qec/analysis/distance.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <vector>
#include <set>
#include <exception>
#include <iterator>

#include "linear.h"
#include "combinations.h"
Expand Down
6 changes: 2 additions & 4 deletions src/qiskit_qec/analysis/distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/qiskit_qec/decoders/decoding_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 778eb61

Please sign in to comment.