Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/qec/code_constructions/css_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def compute_exact_code_distance(
x_logical, x_stabiliser = next(x_iter)
candidate_x = x_logical + x_stabiliser
candidate_x.data %= 2
x_weight = candidate_x.getnnz()
x_weight = (candidate_x != 0).sum() #count non-duplicate non zeros
if x_weight < x_code_distance:
x_code_distance = x_weight
combinations_considered += 1
Expand All @@ -364,7 +364,7 @@ def compute_exact_code_distance(
z_logical, z_stabiliser = next(z_iter)
candidate_z = z_logical + z_stabiliser
candidate_z.data %= 2
z_weight = candidate_z.getnnz()
z_weight = (candidate_z != 0).sum()
if z_weight < z_code_distance:
z_code_distance = z_weight
combinations_considered += 1
Expand Down